[Haskell-cafe] Problem with own written monad

Miguel Mitrofanov miguelimo38 at yandex.ru
Mon Jan 7 10:15:46 EST 2008


> 	data Stack a = Stack { run :: [a] -> (a, [a]) }

[...skipped...]

> But, I have simply no clue how to fix that. :-(
> Can anybody give my a hint?

Yes. It's simply impossible. The Stack data type can't be turned into  
a monad.

May be you can explain what do you want to do with this "monad"? What  
kind of code would you write if it would be such monad?


More information about the Haskell-Cafe mailing list