1 Mar 2001 11:52
Re: Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
Johannes Waldmann <joe <at> isun.informatik.uni-leipzig.de>
2001-03-01 10:52:33 GMT
2001-03-01 10:52:33 GMT
> But if you want to be really weird you can write something > like (I haven't typed this in): > > f x | (Foo _) == x = > f x | (Bar _) == x = no, you can't, e. g. hugs (Feb 2000) says Prelude> let f x | Just 4 == x = 0 in f (Just 4) 0 Prelude> let f x | Just _ == x = 0 in f (Just 4) ERROR: Illegal `_' in expression -- -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe <at> informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --
RSS Feed