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 -

How big can a drone be on solar panels?

How big can a drone be on solar panels?
 
 
The idea seems to be a genius: to place solar batteries on a drone, and then it will not need a battery. Without it, the drones can be controlled while the sun is shining. This is fine (assuming that your intentions are pure). This is exactly what students did Singapore National University .
 
 
But from the video it's clear that their drone is flat, like a leaf. Therefore, in fact, the question is: what mass and size can such a device possess, so that it can rise into the air solely on solar energy? I will answer this question and give you a special calculator for quadrocopters on ...
+ 0 -

What for to the person Scala?

Hello colleagues.
 
 
Not so long ago we pre-printed book Oderski, Spoon and Venners about Scala ???. After all, before Scala 3 is still far away.
 
 
What for to the person Scala?
 
The author of today's article is Adam Worski, co-founder of SoftwareMill and an experienced Scala developer. He got an interesting summary of the strengths of the modern language Scala, which we offer to your attention.
 
plenary lecture Martin Oderski on ScalaDays, where he laid out plans for Scala 3 and plenary lecture John de Gous at the Scalapeño conference about the ...
+ 0 -

SAP and Python integration or how to pick up data from SAP is simpler than

SAP and Python integration or how to pick up data from SAP is simpler thanGood afternoon, Habr!
 
 
I want to share an interesting task on how to easily interact with SAP systems using Python - no matter what module or version of the platform.
 
 
If only the technical solution is interesting, then skip all the lyrics and see an example of implementation.
 
 

Lyrics


 
It all boiled down to the fact that one of the customers needed to download data from their SAP ERP system, by manipulating them, already create reports and mailings to interested people via email, as well as other actions.
 
 
Actually, when discussing the solution of such a problem, we, as a contractor...[/h]
+ 0 -

Practical application of the currying in js with the example of the http request module

Hello! It's no secret that in the programming world there are many techniques, practices and patterns of programming (design), but often, learning something new, it's completely unclear where and how to use this new one.
 
Today, using the example of creating a small wrapper module for working with http requests, we will analyze the real use of currying - the reception of functional programming.
 
To all newcomers and interested in the application of functional programming in practice - welcome, those who perfectly understand what is currying - I'm waiting for your comments on the code, for as ...
+ 0 -

Combating dirty side effects in pure JavaScript functional code

Combating dirty side effects in pure JavaScript functional codeIf you try your hand at functional programming, it means that you will soon be confronted with the concept of pure functions. Continuing the exercises, you will find that programmers who prefer a functional style seem to be obsessed with these functions. They say that pure functions allow us to talk about the code. They say that pure functions are entities that are unlikely to work so unpredictably that they will lead to a thermonuclear war. You can also learn from such programmers that pure functions provide referential transparency. And so on - to infinity.
 
 
By the way, functional programmers ...
+ 0 -

We use Ramda together with Redux

This is the translation of article Using Ramda With Redux , which describes how to simplify your code on the basis of the Redux library using the Ramda library, which allows you to write code in a functional style.
 
P.S. If you do not know what Ramda is - I invite you to translation of a series of articles about it .
 
On my current work, we are working on front-end projects using React and Redux. We also use the Ramda library to work effectively with Redux. This post describes several ways in which we used Ramda in our React /Redux applications. React ...
+ 0 -

Competition on programming: Trade (totals)

Many thanks to all the participants of competition on programming !! We are pleased to announce the final results of the competition.
 
 
186 decisions took part in the competition. We held a tournament between them in two rounds, as previously announced. Congratulations to the winners:
 
 
 
Asta - The prize is 3000 USD .
 
Silent Bob - The prize is 2000 USD .
 
Robert Speed ​​ - The prize is 1000 USD .
 
 
Special prize 400 USD receives the participant under the pseudonym indutny for the development of an alternative arena for online testing ...
+ 0 -