All pastes #1859095 Raw Edit

Mine

public text v1 · immutable
#1859095 ·published 2010-04-10 18:30 UTC
rendered paste body

structure ILModule =
   struct

      type variable = Variable.variable

      datatype kind =
         Ktype
       | Ksing of con
       | Kpi of variable * kind * kind
       | Ksigma of variable * kind * kind
       | Kunit

      and con =
         Cvar of variable
       | Clam of variable * kind * con
       | Capp of con * con
       | Cpair of con * con
       | Cpi1 of con
       | Cpi2 of con
       | Cunit

       | Carrow of con * con
       | Cprod of con list
       | Csum of con list
       | Crec of variable * con
       | Ctag of con
       | Cref of con
       | Cexn
       | Cbool
       | Cint
       | Cchar
       | Cstring

      datatype name =
         HIDE
       | VAL of string
       | CON of string
       | MOD of string
       | DT of string
       | DCON

      datatype sg =
         Sval of con
       | Scon of kind
       | Ssigma of variable * sg * sg
       | Spi of variable * sg * sg
       | Sunit
       | Snamed of name * sg

      datatype term =
         Tvar of variable

       | Tlam of variable * con * term
       | Tapp of term * term

       | Ttuple of term list
       | Tproj of term * int

       | Tinj of term * int * con
       | Tcase of term * (variable * term) list

       | Troll of term * con
       | Tunroll of term

       | Ttag of term * term
       | Tiftag of term * term * variable * term * term
       | Tnewtag of con
       | Traise of term * con
       | Thandle of term * variable * term

       | Tref of term
       | Tderef of term
       | Tassign of term * term

       | Tbool of bool
       | Tif of term * term * term

       | Tint of int
       | Tchar of char
       | Tstring of string

       | Tlet of variable * term * term
       | Tletm of variable * variable * module * term * con

       | Tsnd of module
       | Tprim of Prim.prim * term list

      and module =
         Mvar of variable

       | Mval of term
       | Mcon of con
       | Munit

       | Mpair of variable * variable * module * module
       | Mpi1 of module
       | Mpi2 of module

       | Mlam of variable * variable * sg * module
       | Mapp of module * module

       | Min of name * module
       | Mout of module

       | Mlet of variable * variable * module * module * sg
       | Mletd of variable * variable * module * module

       | Mseal of module * sg

   end