[Haskell-cafe] Bound and free variables

Barak A. Pearlmutter barak at cs.nuim.ie
Tue Sep 23 13:01:29 UTC 2014


On Mon, 22 Sep 2014 19:30:33 -0400, Michael Orlitzky wrote:

> It's hard to tell from your example, but if you want, you can
> translate the let binding directly to lambda calculus and then go from
> there where the rules are simple.
>
> In Haskell,
>
>   let <name> = <argument> in <expression>
>
> translates to,
>
>   (\<name> -> <expression>) <argument>

Although this list might not be for homework problems, there is an
element of terminological confusion and a quest for nomenclature in the
question that don't seem entirely unreasonable.  Even if we're not going
to answer the question per se, we shouldn't give hints that are
misleading, or true in Scheme and lambda calculus but false in Haskell.

  $ ghci

  Prelude> let b = 3:b in take 3 b
  [3,3,3]

  Prelude> (\b -> take 3 b) (3:b)
  <interactive>:3:21: Not in scope: `b'


More information about the Haskell-Cafe mailing list