Re:From Monads to Machine Code
by dllthomas on Monday April 24, 2017 @04:12AM
(#14182656)
In the absence of some kind of module or object on its left hand side, return has a polymorphic type.
e.g.
return 'c' :: Monad m => m Char
You can actually sort of think of this as a function from typeclass dictionary to value, except the compiler will pass that dictionary itself once it's inferred what it should be (and will then inline/optimize it away, where it can).
e.g.
return 'c' :: Monad m => m Char
You can actually sort of think of this as a function from typeclass dictionary to value, except the compiler will pass that dictionary itself once it's inferred what it should be (and will then inline/optimize it away, where it can).