3 ms·
It doesn't support subtyping or an imperative style I would argue that monads are the ultimate imperative style. I would also agree that Haskell users have ve
by Locke1689 15y ago
It doesn't support subtyping or an imperative style
I would argue that monads are the ultimate imperative style.
I would also agree that Haskell users have very little interest in it becoming mainstream.
My main gripe with Scala (in which another developer in my compilers class used it, not me), was that when reading his code I saw a lot of "magic." I'm not sure if that was better or worse, just... different.
- sreque 15y agoThere are few things that seemed more magical to me at first glance than Haskell's point-free style! :) I would explain the difference between Perl magic and Scala magic as being that Scala magic reduces down to a relatively few simple but flexible rules, whereas Perl magic reduces to a bunch of edge cases and special rules that lack any form of cohesion. Once you learn these rules, reading Scala code becomes very manageable. I found the Haskell code I saw to be clearer because it's type system allows one to omit types much more frequently, its indentation and function declaration style let you avoid a lot of curly braces and parenthesis, it's type class system involved less syntactic ceremony than Scala's implicits, point-free style allows one to omit Scala's underscores, and so on. All of these things added up so that in the end, I felt like Haskell just looked a lot nicer, much more concise and like the math it was trying to express. I'm sure some of the authors of Scalaz could do a much better job than me explaining Haskell's advantages over Scala when writing functional code, since I am by no means a Haskell expert.
- chromatic 15y agoPerl magic reduces to a bunch of edge cases and special rules that lack any form of cohesion. I can think of two general philosophical premises which underlie most of those special rules in Perl: implicit variables and context. Most tutorials and books explain them poorly, which is why so many people never understand them.
- Rusky 15y agoMonads are definitely not the ultimate imperative style. I love Haskell, but once you use too much IO or Reader/Writer or anything like that everything gets messy and ugly. Imperative style really benefits from loops and also several design patterns that really don't work or exist in monads.
- deleted 15y ago[deleted]