On Wed, Jul 11, 2012 at 8:00 PM, Qi Qi <qiqi...@gmail.com> wrote: > List [] is a monad, why not for heap data. Heap data could be an instance > of Monad too. >
Only if you can define a meaningful semantics for it. Lists aren't a monad because of liftIO, but because the monad pattern means something (backtracking/multiple evaluation). What does the monad pattern mean for your heap? I'm not saying there *isn't* one; I'm saying that you must *have* one in order to make a monad. Monads are not simply some sneaky way to slipstream I/O into expressions; IO is just one possible monad, and many programs make heavier use of other monads such as state and reader. And in particular, most applications of the list monad don't involve any I/O. (Almost necessarily, since the standard ListT is actually broken but can't be fixed for backward compatibility reasons.) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe