The data type of Samba-language expression, Expr, is defined as follows:
 data Expr a
   =  EVar Name                     -- Variables
    | ENum Int                      -- Numbers
    | EConstr Int Int               -- Constructor tag arity
    | EAp (Expr a) (Expr a)         -- Applications
    | ELet                          -- Let(rec) expressions
         IsRec                      --   boolean with True = recursive,
         [(a, Expr a)]              --   Definitions
         (Expr a)                   --   Body of let(rec)
    | ECase                         -- Case expression
         (Expr a)                   --   Expression to scrutinise
         [Alter a]                  --   Alternatives
    | ELam [a] (Expr a)             -- Lambda abstractions
     deriving (Eq,Show,Read)

Next we define the types of supercombinators and programs:

 type ScDefn a = (Name, [a], Expr a)  -- Supercombinator
 type SambaScDefn = ScDefn Name       -- Samba supercombinator
 type Program a = [ScDefn a]          -- Program
 type SambaProgram = Program Name     -- Samba program


File translated from TEX by TTH, version 1.41.