Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)
Marcin 'Qrczak' Kowalczyk
qrczak@knm.org.pl
2 Mar 2001 19:00:17 GMT
Thu, 1 Mar 2001 20:25:28 +0900 (KST), Laszlo Nemeth <laszlo@ropas.kaist.ac.kr> pisze:
> > Prelude> let f x | Just _ == x = 0 in f (Just 4)
> > ERROR: Illegal `_' in expression
>
> So it works with (Just 4), but it doesn't with (Just _)?
'Just _ == x' must be an exppression. '_' is a pattern but not an
expression.
--
__("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTĘPCZA
QRCZAK