Le 12/07/2018 à 15:01, Brett Gilio reacts :
Alexey, could you expand on what you mean in your first point? I am quite intrigued. I do not use Haskell often, but that could be something of interest to me in-and-out of Haskell.
Brett Gilio
...major reasonsI am not Alexey Raga, who precises:
1. The ability to define the specification (types) and then "just" follow them in implementation. Sometimes even without having a clear understanding of the things I was using, I felt (and still feel) guided towards the right solution.
when I wrote a signature for my function, the compiler will make its best to help me implement it. It will yell at me, it will not let me use things that I am not supposed to use (according to constraints), etc.===
Djinn> f ? (a,b) -> (b,a) -- my inputDoaitse Swierstra comments:
f :: (a, b) -> (b, a)
f (a, b) = (b, a)
I don't see that last point... Anyway, the typing power of Haskell should be known.swap (a, b) = (b, a) Once you ask for the type you get (a, b) -> (b, a), hence the type completely specifies what swap computes, and the function is even more general than the version of the type above.