package gobba

  1. Overview
  2. Docs
module T = ANSITerminal
module D = Util.Dict
type ide = string

A value identifier

val pp_ide : Ppx_deriving_runtime.Format.formatter -> ide -> Ppx_deriving_runtime.unit
val show_ide : ide -> Ppx_deriving_runtime.string
val equal_ide : ide -> ide -> Ppx_deriving_runtime.bool
val compare_ide : ide -> ide -> Ppx_deriving_runtime.int
type complext = Stdlib.Complex.t

A type wrapper for complex numbers where equality, ordering and showing are defined

val pp_complext : Ppx_deriving_runtime.Format.formatter -> complext -> Ppx_deriving_runtime.unit
val show_complext : complext -> Ppx_deriving_runtime.string
val equal_complext : complext -> complext -> Ppx_deriving_runtime.bool
val compare_complext : complext -> complext -> Ppx_deriving_runtime.int
type typeinfo =
  1. | TVect of int * typeinfo
  2. | TUnit
  3. | TBool
  4. | TNumber
  5. | TInt
  6. | TFloat
  7. | TComplex
  8. | TString
  9. | TChar
  10. | TList
  11. | TDict
  12. | TLambda

A type containing all the types that a values can assume

val pp_typeinfo : Ppx_deriving_runtime.Format.formatter -> typeinfo -> Ppx_deriving_runtime.unit
val equal_typeinfo : typeinfo -> typeinfo -> Ppx_deriving_runtime.bool
val compare_typeinfo : typeinfo -> typeinfo -> Ppx_deriving_runtime.int
val show_typeinfo : typeinfo -> string
type purityenv_type = (ide, puret) Util.Dict.t

An environment type containing identifier - purity couples

and puret =
  1. | Impure
  2. | Uncertain
  3. | PurityModule of purityenv_type
  4. | Pure
  5. | Numerical

A type representing if a computation is pure or not

val pp_purityenv_type : Ppx_deriving_runtime.Format.formatter -> purityenv_type -> Ppx_deriving_runtime.unit
val show_purityenv_type : purityenv_type -> Ppx_deriving_runtime.string
val pp_puret : Ppx_deriving_runtime.Format.formatter -> puret -> Ppx_deriving_runtime.unit
val show_puret : puret -> Ppx_deriving_runtime.string
val equal_purityenv_type : purityenv_type -> purityenv_type -> Ppx_deriving_runtime.bool
val equal_puret : puret -> puret -> Ppx_deriving_runtime.bool
val compare_purityenv_type : purityenv_type -> purityenv_type -> Ppx_deriving_runtime.int
val compare_puret : puret -> puret -> Ppx_deriving_runtime.int
type primitiveinfo = ide * string array * puret

Contains a primitive's name, number of arguments and pureness

val pp_primitiveinfo : Ppx_deriving_runtime.Format.formatter -> primitiveinfo -> Ppx_deriving_runtime.unit
val show_primitiveinfo : primitiveinfo -> Ppx_deriving_runtime.string
val equal_primitiveinfo : primitiveinfo -> primitiveinfo -> Ppx_deriving_runtime.bool
val compare_primitiveinfo : primitiveinfo -> primitiveinfo -> Ppx_deriving_runtime.int
type binop =
  1. | Getkey
  2. | Eq
  3. | Gt
  4. | Lt
  5. | Ge
  6. | Le
  7. | And
  8. | Or
  9. | MakeComplex
  10. | Plus
  11. | Sub
  12. | Div
  13. | Mult
  14. | Topow
  15. | Modulo
  16. | Cons
  17. | Concat
  18. | Compose

Represents a binary operation kind

val pp_binop : Ppx_deriving_runtime.Format.formatter -> binop -> Ppx_deriving_runtime.unit
val show_binop : binop -> Ppx_deriving_runtime.string
val equal_binop : binop -> binop -> Ppx_deriving_runtime.bool
val compare_binop : binop -> binop -> Ppx_deriving_runtime.int
type expr =
  1. | Unit
  2. | SetPurity of puret * expr
  3. | NumInt of int
  4. | NumFloat of float
  5. | NumComplex of complext
  6. | Character of char
  7. | Boolean of bool
  8. | String of string
  9. | Symbol of ide
  10. | List of expr list
  11. | Vect of expr list
  12. | Dict of assignment_type list
  13. | Binop of binop * expr * expr
  14. | Not of expr
  15. | IfThenElse of expr * expr * expr
  16. | Let of assignment_type list * expr
  17. | Lambda of ide * expr
  18. | Apply of expr * expr
  19. | ApplyPrimitive of primitiveinfo * expr array
  20. | Sequence of expr * expr

The type representing Abstract Syntax Tree expressions

and assignment_type = bool * ide * expr
val pp_expr : Ppx_deriving_runtime.Format.formatter -> expr -> Ppx_deriving_runtime.unit
val show_expr : expr -> Ppx_deriving_runtime.string
val pp_assignment_type : Ppx_deriving_runtime.Format.formatter -> assignment_type -> Ppx_deriving_runtime.unit
val show_assignment_type : assignment_type -> Ppx_deriving_runtime.string
val equal_expr : expr -> expr -> Ppx_deriving_runtime.bool
val equal_assignment_type : assignment_type -> assignment_type -> Ppx_deriving_runtime.bool
val compare_expr : expr -> expr -> Ppx_deriving_runtime.int
val compare_assignment_type : assignment_type -> assignment_type -> Ppx_deriving_runtime.int
type directive =
  1. | Dumpenv
  2. | Dumppurityenv
  3. | Includefile of string
  4. | Includefileasmodule of string * ide option
  5. | Setpurity of puret
  6. | Setverbose of int
  7. | Openmodule of string

A type containing directives information

val pp_directive : Ppx_deriving_runtime.Format.formatter -> directive -> Ppx_deriving_runtime.unit
val show_directive : directive -> Ppx_deriving_runtime.string
val equal_directive : directive -> directive -> Ppx_deriving_runtime.bool
val compare_directive : directive -> directive -> Ppx_deriving_runtime.int
type command =
  1. | Directive of directive
  2. | Expr of expr
  3. | Def of assignment_type list

A type useful for evaluating files, stating if a command is an expression or simply a "global" declaration (appended to environment)

val pp_command : Ppx_deriving_runtime.Format.formatter -> command -> Ppx_deriving_runtime.unit
val show_command : command -> Ppx_deriving_runtime.string
val equal_command : command -> command -> Ppx_deriving_runtime.bool
val compare_command : command -> command -> Ppx_deriving_runtime.int
type evt =
  1. | EvtUnit
  2. | EvtInt of int
  3. | EvtFloat of float
  4. | EvtComplex of complext
  5. | EvtBool of bool
  6. | EvtChar of char
  7. | EvtString of string
  8. | EvtList of evt list
  9. | EvtVect of typeinfo * evt vect_type
  10. | EvtDict of (ide * evt) list
    (*

    Recursion is achieved by keeping an optional function name in the constructor

    *)
  11. | Closure of ide option * ide * expr * env_type
  12. | LazyExpression of expr

A type that represents an evaluated (result of a computation) value

and env_type = (ide, evt) D.t
and 'a vect_type = 'a array
val pp_evt : Ppx_deriving_runtime.Format.formatter -> evt -> Ppx_deriving_runtime.unit
val show_evt : evt -> Ppx_deriving_runtime.string
val pp_env_type : Ppx_deriving_runtime.Format.formatter -> env_type -> Ppx_deriving_runtime.unit
val show_env_type : env_type -> Ppx_deriving_runtime.string
val pp_vect_type : 'a. (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> Ppx_deriving_runtime.Format.formatter -> 'a vect_type -> Ppx_deriving_runtime.unit
val show_vect_type : 'a. (Ppx_deriving_runtime.Format.formatter -> 'a -> Ppx_deriving_runtime.unit) -> 'a vect_type -> Ppx_deriving_runtime.string
val equal_evt : evt -> evt -> Ppx_deriving_runtime.bool
val equal_env_type : env_type -> env_type -> Ppx_deriving_runtime.bool
val equal_vect_type : 'a. ('a -> 'a -> Ppx_deriving_runtime.bool) -> 'a vect_type -> 'a vect_type -> Ppx_deriving_runtime.bool
val compare_evt : evt -> evt -> Ppx_deriving_runtime.int
val compare_env_type : env_type -> env_type -> Ppx_deriving_runtime.int
val compare_vect_type : 'a. ('a -> 'a -> Ppx_deriving_runtime.int) -> 'a vect_type -> 'a vect_type -> Ppx_deriving_runtime.int
type primitive =
  1. | Primitive of evt array -> evt * primitiveinfo

A type representing a primitive

type stackframe =
  1. | StackValue of int * expr * stackframe
  2. | EmptyStack

A recursive type representing a stacktrace frame

val pp_stackframe : Ppx_deriving_runtime.Format.formatter -> stackframe -> Ppx_deriving_runtime.unit
val show_stackframe : stackframe -> Ppx_deriving_runtime.string
type evalstate = {
  1. env : env_type;
  2. purityenv : purityenv_type;
  3. verbosity : int;
  4. stack : stackframe;
  5. mutable printresult : bool;
  6. purity : puret;
}

Options for the eval function

val default_evalstate : evalstate
OCaml

Innovation. Community. Security.