[Haskell-cafe] Applicative do?
nicolas.pouillard at gmail.com
Fri Oct 9 16:39:26 EDT 2009
Excerpts from Edward Kmett's message of Fri Oct 09 20:04:08 +0200 2009:
> I have idiom brackets in that toy library already, but the ado syntax is
> fairly useful if you want to refer to several intermediate results by name.
> To work with idiom brackets you need to manually write a big lambda yourself
> and them apply it. If you have a lambda that takes several arguments --
> which isn't all that uncommon in a parser! -- the names you are binding and
> their position in the input can get rather far apart, even using idiom
> sugar. Philippa's ado sugar lets you amortize that big binding statement
> over several lines and keeps the names closer to the binding.
You can still name intermediate *computations* using local bindings, right?
Then you just have to use the named computations in idioms brackets.
More information about the Haskell-Cafe