[Haskell-cafe] Is curryfication practical with dynamic scope?

Loup Vaillant loup.vaillant at gmail.com
Sun Apr 26 11:25:24 EDT 2009

Hi, can this code

(\a -> \b -> a) 1 2

eval to normal form in a strict language with dynamic scope?


PS: some context:

I am currently implementing a toy language. The AST is this one:

data whnf = -- Weak Head Normal Form
  | Unit
  | Int  of int
  | Bool of bool
  | Prim of (whnf -> whnf)  -- curried
  | Fun  of string * expr   -- curried

data expr =
  | Whnf of whnf
  | Var  of string
  | App  of expr * expr
  | If   of expr * expr * expr

Dynamic typing, dynamic scope, and, as you can see, functions have to
be curried. I plan to implement lexical scope.

More information about the Haskell-Cafe mailing list