[Haskell-cafe] questions on lazy pattern, StateT monad

Fan Wu wufan9418 at gmail.com
Wed Nov 23 13:02:55 EST 2005


HI Wolfgang,

The code is from GHC source
ghc-6.4.1/libraries/monads/Monad/StateT.hs, am I looking at the wrong
place?

I found the thread discussing "Monad strictness", where is your StateT defined?

But it is still not clear to me why lazy pattern is used here. Any ideas?

Thanks,
Fan

On 11/23/05, Wolfgang Jeltsch <wolfgang at jeltsch.net> wrote:
> Am Mittwoch, 23. November 2005 10:03 schrieb Fan Wu:
> > [...]
>
> > I'm puzzled over this line:
> >
> >     ~(a,s') <- lift (mplus m1' m2')
>
> Why is this line in Monad.State.StateT?  Recently, we discussed that StateT
> does *not* use a lazy pattern here but that it should be changed to using
> one.  So where did you see this lazy pattern?
>
> > [...]
>
> Best wishes,
> Wolfgang
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list