News for hackers. Stuff that matters.
Re:Escaping Hell with Monads (2017) by tome on Thursday March 01, 2018 @03:04AM (#16490395)
Could you please give a concrete example? The majority of Haskell expressions have what is called a "principal type". The type of such an expression is independent of its subexpressions or super- expressions.
Re:Escaping Hell with Monads (2017) by xenomachina on Thursday March 01, 2018 @12:11PM (#16493862)
A concrete example of what?
Re:Escaping Hell with Monads (2017) by tome on Thursday March 01, 2018 @12:28PM (#16494071)
A concrete example of an expression that you have difficulty determining the type of.
Re:Escaping Hell with Monads (2017) by xenomachina on Thursday March 01, 2018 @02:18PM (#16495194)
It's been a few years since I gave up on Haskell, but I remember anything involving `do` (especially containing a `return`) or `sequence` seemed to require a lot of guesswork about what type was involved. Pretty much anything where the type of a subexpression would be an overloaded type has a high potential for being confusing.

Another example of what I'm talking about is the fact that even the expression "5 == 5" gives an error unless the kludgy type defaults are enabled. The fact that they felt the need to add type defaults and MR to the language is a pretty strong sign that they screwed up the usability of the type system.

Re:Escaping Hell with Monads (2017) by tome on Thursday March 01, 2018 @03:14PM (#16495773)
Haskellers would tell you that what they appreciate about this is that you don't have to understand sequence and return! They do the "same thing" for all monads in the sense that they obey well-defined laws.

"5 == 5" is a different issue, and ironically is ambiguous because it's so simple. Most practical arithmetic expressions would have some way of disambiguating the type.