[Haskell-cafe] Plain lambda inside banana brackets in the arrow notation

Tsuyoshi Ito tsuyoshi.ito.2006 at gmail.com
Mon Jul 16 01:05:16 CEST 2012


On Sun, Jul 15, 2012 at 6:30 PM, Ross Paterson <ross at soi.city.ac.uk> wrote:
> Silly me -- that code works with the current GHC (module attached).

Aha!  Now I see why the GHC documentation states “the arrows involved
need not be the same” in the section about banana brackets.  After
all, I was wrong in thinking that banana brackets could not be used
here.

As you remarked, the extraction of variable i in your code is a little
bit involved, but it still looks much better than listing the local
variables used in the inner computation, especially when both the
outer computation and the inner computation involve many local
variables.  Thanks a lot.

Best regards,
  Tsuyoshi



More information about the Haskell-Cafe mailing list