[Haskell-cafe] Applicative do?
Philippa Cowderoy
flippa at flippac.org
Fri Oct 9 17:01:33 EDT 2009
Nicolas Pouillard wrote:
> 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.
>
>
Not really good enough, because of all the computations whose results
aren't used. Being able to tell at a glance which bits of the parser are
handling data for the abstract syntax and which're structure to guide
the parser is pretty handy.
--
flippa at flippac.org
More information about the Haskell-Cafe
mailing list