[Haskell-cafe] lazy evaluation is not complete

George Pollard porges at porg.es
Tue Feb 10 02:52:11 EST 2009


On Tue, 2009-02-10 at 08:03 +0100, Thomas Davie wrote:
> On 10 Feb 2009, at 07:57, Max Rabkin wrote:
> 
> > On Mon, Feb 9, 2009 at 10:50 PM, Iavor Diatchki
> > <iavor.diatchki at gmail.com> wrote:
> >> I 0 * _       = I 0
> >> I x * I y     = I (x * y)
> >
> > Note that (*) is now non-commutative (w.r.t. _|_). Of course, that's
> > what we need here, but it means that the "obviously correct"
> > transformation of
> 
> just to improve slightly:
> 
> I 0 |* _   = I 0
> I x |* I y = I (x * y)
> 
> _ *| I 0   = I 0
> I x *| I y = I (x * y)
> 
> I x * | y = (I x |* I y) `unamb` (I x *| I y)
> 
> Now it is commutative :)
> 
> Bob

See `parCommute` from the 'lub' package :)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20090210/17ed7760/attachment.bin


More information about the Haskell-Cafe mailing list