package minicaml

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

An identifier

type expr =
  1. | Unit
  2. | Integer of int
  3. | Boolean of bool
  4. | Symbol of ide
  5. | List of list_pattern
  6. | Head of expr
  7. | Tail of expr
  8. | Cons of expr * expr
  9. | Sum of expr * expr
  10. | Sub of expr * expr
  11. | Mult of expr * expr
  12. | Eq of expr * expr
  13. | Gt of expr * expr
  14. | Lt of expr * expr
  15. | And of expr * expr
  16. | Or of expr * expr
  17. | Not of expr
  18. | IfThenElse of expr * expr * expr
  19. | Let of ide * expr * expr
  20. | Letrec of ide * expr * expr
  21. | Lambda of ide list * expr
  22. | Apply of expr * expr list
and list_pattern =
  1. | EmptyList
  2. | ListValue of expr * list_pattern
val expand_list : expr list -> list_pattern
val show_expr : expr -> string
val show_list : list_pattern -> string
type 'a env_t = (string * 'a) list

A purely functional environment type, parametrized

type evt =
  1. | EvtUnit
  2. | EvtInt of int
  3. | EvtBool of bool
  4. | EvtList of evt list
  5. | Closure of ide list * expr * evt env_t
    (*

    RecClosure keeps the function name in the environment for recursion

    *)
  6. | 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 TypeError of string

Typing exception

exception ListError of string

List exceptions *

exception SyntaxError of string

Exception to represent a syntax error

OCaml

Innovation. Community. Security.