Macros

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
6 May 2001 11:30:03 GMT


Sat, 5 May 2001 04:44:15 -0700 (PDT), Richard <ru@river.org> pisze:

> eg, I recently wanted 
> 
>   case2 foo of ...
> 
> as sugar for
> 
>   foo >>= \output->
>   case output of ...

Yes, often miss OCaml's 'function' and SML's 'fn' syntax which allow
dispatching without inventing a temporary name for the argument nor
the function.

Today I ran across exactly your case. In non-pure languages you would
just write 'case foo of'. I would be happy with just 'function':

  get >>= function
      ... -> ...
      ... -> ...

I wonder if these parts of Haskell's syntax will stay forever or
there is a chance of some more syntactic sugar.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK