How to handle errors on JVM faster

How to handle errors on JVM fasterThere are various ways to handle errors in programming languages: 3r33371.
 
 
standard exceptions for many languages ​​(Java, Scala and other JVM, python, and many others) 3r3105.  
status codes or flags (Go, bash)
 
various algebraic data structures, the values ​​of which can be both successful results and error descriptions (Scala, haskell, and other functional languages) 3r3105.  
 
Exceptions are used very widely, on the other hand they are often said to be slow. But opponents of the functional approach often appeal to performance. 3r33333.
 
Recently, I have been working with Scala, where ...
+ 0 -

About the composition of functions in JavaScript

Let's fantasize about the functional composition, as well as clarify the meaning of the composition /pipeline operator.
 
TL; DR
 
Compose functions like a boss:
 
About the composition of functions in JavaScript
 
Popular implementations compose - when calling create new and new functions based on recursion, what are the disadvantages here and how to get around it. designed the repository here .
 
NPM package: npm i lazy-compose .
 
It is interesting to get feedback about the limitation of the cache created in runtime functions dependent on the circuitLet's fantasize about the functional composition, as well as clarify the meaning of the composition /pipeline operator. TL; DR Compose functions like a boss:  Popular implementations compose - when calling create new and new functions based on recursion, what are the disadvantages here and how to get around it. designed the repository here . NPM package: npm i lazy-compose . It is interesting to get feedback about the limitation of the cache created in runtime functions dependent on the circuit...
+ 0 -

Designing Types: How to make invalid states ineffable on C #

 3r3-3568. 3r3-31. 3r33553. As a rule, articles telling about type design contain examples in functional languages ​​- Haskell, F # and others. It may seem that this concept does not apply to object-oriented languages, but it is not. 3r33556. 3r? 3551.  3r3-3568. 3r33553. In this article I will translate examples from article Designing types: How to make incorrect states indescribable 3r33555. on 3r311. ideological C #. I will also try to show that this approach is applicable not only as an experiment, but also in the working code. 3r33556. 3r314. 3r33555. 3r? 3551.  3r3-3568. 3r318. We create ...
+ 0 -

Data of the high genus

Data of the high genus 3r3-3589. 3r3-31. Yes, yes, you have not dreamed, and you have not misheard - it is a high kind. A gender (3r33535. Kind 3r33565.) Is a term in category theory, meaning essentially the type of type[данных]. 3r? 3572.  3r3-3589. But first, some lyrics. 3r? 3572.  3r3-3589. On Habré several articles appeared, which described in detail the method of validation of data in functional languages. 3r? 3572.  3r3-3589. This article - my five cents in this HYIP. We will look at data validation in Haskell. 3r? 3572.  3r3-3589. 3r? 3572.  3r3-3589. 3r33333. Validation Type
3r? 3572.  3r3-3589. An example of a validation ...
+ 0 -

How to develop integration tests for Atlassian Jira Server (jira-func-test-plugin)

 3r33338. 3r3-31. How to develop integration tests for Atlassian Jira Server (jira-func-test-plugin)  3r33338.
 3r33338. Let's talk about how to do integration tests for Atlassian Jira Server. For these purposes, we will use the libraries that Atlassian provides: jira-func-test-plugin and jira-testkit-plugin.
 3r33338. here .
 3r33338.
Integration tests require the jira-func-test-plugin and jira-testkit-plugin plugins to run. These tests verify the correctness of the Jira user interface using HTTP requests and responses. An example of such a test is ...
+ 0 -

The quickest introduction to Reactive Programming

 
3r3-31.
The purpose of this article is to show by example why reactive programming is needed, how it relates to functional programming, and how it can be used to write declarative code that can be easily adapted to new requirements. In addition, I want to do this as briefly and simply as possible with an example close to the real one.
 
Take this task:
 
There is a service with REST API and endpoint /people . When a POST request to this endpoint is created, a new entity is created. Write a function that takes an array of objects of the form {name: 'Max'} and create a set of entities ...
+ 0 -

Parsim X12 "on the knee"

 
3r3-31. Parsim X12 "on the knee" When you create an application that actively interacts with third-party services and systems, it is often required to provide information exchange with them, one-way or two-way.  
 
At the same time, the third-party service often provides the only format and data structures for such an interaction.
 
 
One of these electronic document management formats is EDI ANSI ASC X12 , a sufficiently detailed description of which is given by reference.
 
 
CDR was taken from 3r317. of this site
 
 
 
Below the cut is a simple X12 parser algorithm and Clojure code that implements the parser and an example ...
+ 0 -

Great power of newtypes

NewType ( Newtype ) Is a specialized data type declaration. Such that it contains only one constructor and a field. 3r3774.  3r3r7787.
newtype Foo a = Bar a
newtype Id = MkId Word
3r33737. 3r33737. 3r3774.  3r3r7787. Great power of newtypes 3r3774.  3r3r7787. What is the difference from data data type? 3r3774.  3r3r7787.
data Foo a = Bar a
data Id = MkId Word
3r33737. 3r33737. 3r3774.  3r3r7787. The main specificity of 3r3777. newtype [/b] consists in the fact that it consists of the same parts as its only field. More precisely, it differs from the original at the type level, but it has the same memory representation...
+ 0 -

The secrets of impossible computing on GPU

Our experience of using a computing cluster of 480 AMD RX 480 GPU in solving math problems. As a problem, we took the proof of the theorem from the article by Professor A. Chudnov. “ Cyclic decompositions of sets, separating digraphs and cyclic classes of games with guaranteed win “. The task is to find the minimum number of participants of one coalition in coalition games Nim-type, guaranteeing the winning of one of the parties.
 
 
The secrets of impossible computing on GPU  
...
+ 0 -

Designing Types: How to make invalid states ineffable

I present to you the translation of the article Scott Wlaschin "Designing with types: Making illegal states unrepresentable" .
 
In this article, we will look at the key advantage of F # - the ability to "make invalid states ineffable" using a type system (the phrase borrowed from 3r3133. Yaron Minsky
).
 
Consider the type Contact . As a result, carried out refactoring It is much simpler:
 
    type Contact =
{
Name: Name;
EmailContactInfo: EmailContactInfo;
PostalContactInfo: PostalContactInfo;
}

 

Now suppose that there is a simple ...

+ 0 -