[Haskell-cafe] Eta-expansion destroys memoization?

Ben Millwood haskell at benmachine.co.uk
Thu Oct 7 09:04:32 EDT 2010


On Thu, Oct 7, 2010 at 1:44 PM, Luke Palmer <lrpalmer at gmail.com> wrote:
> The section works because "(a %^&)"  (for some operator %^&) is short
> for "(%^&) a" and "(%^& a)" is short for "flip (%^&) a".  Sections
> don't expand into lambdas.
>

According to the report they do:
http://haskell.org/onlinereport/exps.html#sections
http://haskell.org/onlinereport/haskell2010/haskellch3.html#x8-300003.5

but GHC is different, I think:
http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/syntax-extns.html#postfix-operators

I'm not sure if the significance of this difference is explored
anywhere, but notice that:

ghci> (() `undefined`) `seq` ()
*** Exception: Prelude.undefined
ghci> (`undefined` ()) `seq` ()
()


More information about the Haskell-Cafe mailing list