
21 Oct
2001
21 Oct
'01
1:17 a.m.
Hi, I think a lazy pattern is "really lazy" if reference to a part of the pattern does not cause matching of rest of the pattern. For example, \ ~((:) a ((:) b [])) -> [a] should not try to match ((:) b[]) part of the pattern, since 'a' is only referenced. It seems the above pattern should be interpreted as the following patern: \ ~((:) ~a ~((:) ~b ~[])) -> [a] Prelude> (\ ~((:) a ((:) b [])) -> [a]) [2] [ Program error: {v1282 [Num_fromInt instNum_v35 2]} Prelude> (\ ~((:) ~a ~((:) ~b ~[])) -> [a]) [2] [2] What are the cons in this interpretation? Cheers, Saswat