package minicaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type ide = string

An identifier

type expr =
  1. | Integer of int
  2. | Boolean of bool
  3. | Symbol of ide
  4. | Sum of expr * expr
  5. | Sub of expr * expr
  6. | Mult of expr * expr
  7. | Eq of expr * expr
  8. | Gt of expr * expr
  9. | Lt of expr * expr
  10. | And of expr * expr
  11. | Or of expr * expr
  12. | Not of expr
  13. | IfThenElse of expr * expr * expr
  14. | Let of ide * expr * expr
  15. | Letrec of ide * expr * expr
  16. | Lambda of ide list * expr
  17. | Apply of expr * expr list
val show_expr : expr -> string
type 'a env_t = (string * 'a) list

A purely functional environment type, parametrized

type evt =
  1. | Int of int
  2. | Bool of bool
  3. | Closure of ide list * expr * evt env_t
    (*

    RecClosure keeps the function name in the environment for recursion

    *)
  4. | RecClosure of ide * ide list * expr * evt env_t

A type that represents an evaluated (reduced) value

val show_evt : evt -> string

Function to get a string representation of an evaluated type

type env_type = evt env_t

An environment type with

exception UnboundVariable of string

Exception to specify an unbound value

exception WrongBindList

Exception that indicates an erroneous usage of bindlist

exception SyntaxError of string

Exception to represent a syntax error

OCaml

Innovation. Community. Security.