|
|
|
|
|
by bad_user
5318 days ago
|
|
it did not take me long to actually understand
the type signature here
Bullshit. You just followed somebody else's public explanation. Not a problem per se, but this doesn't strike me as beginner friendly ... Dr. Brian Beckman also has a great description of monads on Channel9 that doesn't involve category theory. Does that mean that monad comprehensions are also beginner friendly? if you map a collection over a function
that returns a list of integers, but you
actually wanted a set of strings
Here's some Ruby code for you: [1,2,3].map{|x| x * 2}.map{|x| x.to_s}.to_set
Ironically I find this code written in a dynamic language to be much more readable. Also, give me first-class functions and recursion in a dynamic language and I can implement all of the above by my own (lists, sets and map). |
|
If you're referring to the stack overflow answer, then no. I understood the signature by learning Scala (by reading a book). Is that cheating?
> Does that mean that monad comprehensions are also beginner friendly?
No, not necessarily. Do you have to understand what that even means to be able to use Scala?