[Haskell-cafe] Re: a regressive view of support for imperative
programming in Haskell
David Roundy
droundy at darcs.net
Mon Aug 13 13:26:53 EDT 2007
On Mon, Aug 13, 2007 at 01:27:45PM -0300, Isaac Dupree wrote:
> David Roundy wrote:
> >The only cost is that
> >this syntax relies on the do notation, and thus makes the desugaring of
> >that do notation slightly more complicated when used.
>
> If I understand correctly,
>
> do
> blah
> f (do
> foo
> bar (<- action)
> )
> blah
>
> has an ambiguity: which do-block is the action bound in? I can easily
> imagine myself being frustrated at having to refactor my code if the
> defined answer is not the one I want at the moment.
It doesn't have an ambiguity, because it's defined to be bound in the
innermost do loop. This isn't a new concept, the <- syntax in the existing
do notation has the same behavior.
--
David Roundy
Department of Physics
Oregon State University
More information about the Haskell-Cafe
mailing list