Is there a built-in function with signature :: (Monad m) => m a -> a
?
Hoogle tells that there is no such function.
Can you explain why?<
Because it may make no sense (actually, does make no sense in many instances).
For example, I might define a Parser Monad like this:
data Parser a = Parser (String ->[(a, String)])
Now there is absolutely no sensible default way to get a String
out of a Parser String
. Actually, there is no way at all to get a String out of this with just the Monad.