2 ms·
I understood your point. I think you were unclear about what behavior belongs to monad, in a way that will confuse newcomers. "map" (or "fmap") belongs to Fun
by dllthomas 12y ago
I understood your point.
I think you were unclear about what behavior belongs to monad, in a way that will confuse newcomers.
"map" (or "fmap") belongs to Functor; monads have it because they are functors.
I agree that starting with the laws doesn't necessarily makes the most sense, and that they're not necessary (though can be valuable) for use of these things... but you do need to introduce the laws early enough that they're understood by the time someone goes to write their own instances of the relevant typeclasses - otherwise they're going to get bit by something that assumes the laws hold, and they're not going to understand why.