
26 Oct
2010
26 Oct
'10
3:20 p.m.
Bas van Dijk schrieb:
On Tue, Oct 26, 2010 at 8:12 PM, Bulat Ziganshin
wrote: I find the use of 'undefined' ugly yu aren't groked lazy evaluation :)
I know that 'sizeOf (undefined :: Word8)' will never evaluate the 'undefined' due to laziness and is completely safe.
It's pretty easy to be too strict accidentally: sizeOf (a,b) = sizeOf a + sizeOf b Instead you have to write sizeOf ~(a,b) = sizeOf a + sizeOf b (Replace (,) with any other data constructor.)