2 ms·
"The part which is monad-specific is that Haskell's do-notation is hard-coded to the built-in Monad typeclass." That's not quite true, at least in GHC. It's h
by dllthomas 12y ago
"The part which is monad-specific is that Haskell's do-notation is hard-coded to the built-in Monad typeclass."
That's not quite true, at least in GHC. It's hard-coded to use (>>=) and fail, but the only thing that prevents you from defining your own is the name collision. With -XNoImplicitPrelude, you can (and they can even be locally scoped - I did some cute things with this once that I'd never want to see in production code...).