Restrict type of monadic binding
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
According to Do notation considered harmful#Safety the type of the monadic binding combinator (>>) should be restricted to
(>>) :: m () -> m a -> m a
This way, you can omit _ <-
only if the monadic return value has type ()
.