On Wed, Aug 15, 2007 at 06:23:24PM +0100, Brian Hulley wrote: > Hi, > On http://hackage.haskell.org/trac/haskell-prime/wiki/LambdaCase the > proposed syntax for lambda case is: > > case of > alts > > but this has a really bad downside for interactive editors: it doesn't > allow one to distinguish between an incomplete construct and a completed > construct thus removing one opportunity for an editor to alert the user (eg > by highlighting) that there is something missing in the program text.
It's not like the current language has that property; consider (map myFunction) - is that an error or a partial application? I don't hold out much hope for context-free smart editors. You'll need a typechecker to do much of use, and that can easily distinguish lambda cases from regular cases... OTOH, your proposal provides (IMO) much more natural syntax for multi-pattern anonymous functions, especially if we stipulate that unlike a case (but like a lambda) you can have multiple arguments; then you could write stuff like: sumTo0 = foldr (\of 0 k -> 0 n k -> n + k) 0 Anyone else like this? Stefan
signature.asc
Description: Digital signature
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe