3 ms·
Fair point about Haskell. Horses for courses. I love the simplicity of Go. Haskell's simplicity breaks for me around the point that I have to use a Monad: brain
by sambeau 15y ago
Fair point about Haskell. Horses for courses. I love the simplicity of Go. Haskell's simplicity breaks for me around the point that I have to use a Monad: brain splosions.
- Peaker 15y agoA Monad is pretty simple. class Monad m where return :: a -> m a (>>=) :: m a -> (a -> m b) -> m b and the left-neutral/right-neutral/associativity laws: x >>= return = x return x >>= f = f x x >>= (\v -> y v >>= z) = (x >>= \v -> y v) >>= z Last law can be expressed more easily if you define: (f >=> g) x = f x >>= g Then you can say: (f >=> g) >=> h = f >=> (g >=> h) How complex is that?