[Haskell-cafe] Problem with own written monad

Miguel Mitrofanov miguelimo38 at yandex.ru
Mon Jan 7 14:19:48 EST 2008


>> Yes. It's simply impossible. The Stack data type can't be turned  
>> into a monad.
> Why not?  Surely this is just a variation on the theme of a state  
> monad?

Because it can't be turned into a functor. You can't, given a  
function a -> b, construct a function Stack a -> Stack b. On the  
contrast, you can easily construct a function State z a -> State z b.


More information about the Haskell-Cafe mailing list