> -- Not valid Haskell!! Can't pattern match on constructor only...
> magic = \case
> Var -> id
> Not -> not
> And -> (&&)
> Or -> (||)
> If -> (==>)
> Iff -> (==)
This has often seemed to me to be a natural extension of case syntax. There
is a short analysis in the following Reddit post:
https://www.reddit.com/r/haskell/comments/7s0ski/ lambdacase_in_the_wild/ dt1zzyy/
I would be strongly in favour of adding an extension to do this (unless
someone can find a reason that it couldn't work).
Tom
_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell- cafe
Only members subscribed via the mailman list are allowed to post.