Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save matthewhammer/44e3b1290d1a865b573cc2f002146b6c to your computer and use it in GitHub Desktop.
Save matthewhammer/44e3b1290d1a865b573cc2f002146b6c to your computer and use it in GitHub Desktop.
IODyn Collection Signatures
(* Directed graph *)
type graph
val empty : graph
val add_nd : graph -> ndid -> nddat -> (graph, option<nddat>)
val del_nd : graph -> ndid -> (graph, option<nddat>)
val dat_of_nd : graph -> ndid -> optional<nddat>
val adj_of_nd : graph -> ndid -> List<ndid>
val adj_of_nd : graph -> ndid -> (ndid -> α -> α) -> α -> α
type edgeid = (ndid, ndid)
val del_edge : graph -> edge -> (graph, bool)
val add_edge : graph -> edge -> graph
val has_edge : graph -> edge -> bool
type fm
type key
type val
val empty : fm
val add : fm -> key -> val -> (fm, optional<val>) <--- return the old value, if any
val del : fm -> key -> (fm, optional<val>)
val get : fm -> key -> optional<val>
val fold : fm -> (key -> val -> α -> α) -> α -> α
val pairs : fm -> List<(key, val)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment