On Mon, 19 Sep 2005, Andrew Pimlott wrote: > On Sat, Sep 17, 2005 at 06:56:36PM +0100, Ben Rudiak-Gould wrote: > > * The new syntax is really nice as a replacement for the annoyingly > > common "x <- foo ; case x of..." idiom that I've always disliked. > > I might wish for "case of" to mean "\x -> case x of": > > foo >>= case of ...
You mean that 'case' should be a function with the selecting value as last argument? So e.g. (case of {Nothing -> g; (Just x) -> f x; }) would be equivalent to (maybe g f) > Useful outside of monads, eg to write anonymous functions for map. Yes, this would be nice. This notation could even replace the current one to prevent from mistakes by mixing up both notations. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe