[Haskell-cafe] Lambda-case / lambda-if
wren ng thornton
wren at freegeek.org
Sat Oct 2 19:16:46 EDT 2010
On 10/2/10 3:13 PM, Christopher Done wrote:
> There's nothing more annoying than having to introduce intermediate
> bindings when you're going to immediate pattern match against it
> immediately and never use it again. It's both annoying to have to
> think of a variable name that makes sense and is not in scope or will
> be in scope, and annoying to type it out, and it's just ugly. This is
> *not* a special-case, it happens all the time and it's one of the few
> things in the syntax I wish could be updated.
+1.
In Mark Jones' new language, Habit, they have monadic versions of case
and if-then-else for precisely this reason.
I'm not sure if the (case of {...}) syntax is the best one to use for
this feature, but I'd love to get rid of those intermediate names for
monadic case expressions.
--
Live well,
~wren
More information about the Haskell-Cafe
mailing list