Pattern guards vs. case (was, unfortunately :Re: interesting example of laziness/ghc optimisation)

Marcin 'Qrczak' Kowalczyk [email protected]
2 Mar 2001 19:00:17 GMT


Thu, 1 Mar 2001 20:25:28 +0900 (KST), Laszlo Nemeth <[email protected]> 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 * [email protected] http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK