package rfsm

  1. Overview
  2. Docs
On This Page
  1. Annotations
A toolset for describing and simulating StateChart-like state diagrams

Install

dune-project
 Dependency

Authors

Maintainers

Sources

2.2.tar.gz
md5=ea1b496f0aa758933ae23921ee55a531
sha512=4fa72747bb2e32f91d64e4b8c24f60d6f0bdad297cc40f36d5c687ed1de900ab8441fa8a12aecf2523928833cddd5391fa87c11a1af2162ac8001467e8f485a5

doc/rfsm/Rfsm/Annot/index.html

Module Rfsm.AnnotSource

Annotations

Sourcetype ('a, 'b) t = {
  1. mutable desc : 'a;
    (*

    Annotated value

    *)
  2. mutable typ : 'b;
    (*

    Type annotation (type 'b will be bound to the guest language type)

    *)
  3. loc : Location.t;
    (*

    Location in source code

    *)
}

The type ('a,'b) t is used to attach type and location annotations to values of type 'a.

Sourceval mk : loc:(Lexing.position * Lexing.position) -> typ:'b -> 'a -> ('a, 'b) t

mk ~loc ~ty x returns value x annotated with type ty and location loc

Sourceval map : ('a -> 'c) -> ('b -> 'd) -> ('a, 'b) t -> ('c, 'd) t

map f g v returns the annotated value obtained by applying f and g to the desc and typ fields of v resp., without changing the loc field.