[Haskell-cafe] proposal: point free case expressions

Edward Kmett ekmett at gmail.com
Thu Nov 5 10:22:23 EST 2009


I seem to recall this proposal being included on the Haskell' proposals. Ah,
here it is:

http://hackage.haskell.org/trac/haskell-prime/ticket/41

-Edward Kmett

On Thu, Nov 5, 2009 at 10:09 AM, Sebastiaan Visser <sfvisser at cs.uu.nl>wrote:

> Hello all,
>
> Wouldn't it be nice if we could write point free case statements?
>
> I regularly find myself writing down something like this:
>
> > myFunc = anotherFunc $ \x -> case x of
> >                                Left err -> print err
> >                                Right msg -> putStrLn msg
>
> We could really use a case statement in which we skip the scrutinee and
> make `(case of {})' be syntactic sugar for `(\x -> case x of {})'.
>
> So we could write:
>
> > myFunc = anotherFunc $ case of
> >                          Left err -> print err
> >                          Right msg -> putStrLn msg
>
> A minor syntactical addition, a big win!
>
> Cheers,
>
> --
> Sebastiaan Visser
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091105/2dd0aaef/attachment.html


More information about the Haskell-Cafe mailing list