Skip to content

Instantly share code, notes, and snippets.

@mrb
Created October 1, 2014 23:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrb/0710bf18a985bab7edc7 to your computer and use it in GitHub Desktop.
Save mrb/0710bf18a985bab7edc7 to your computer and use it in GitHub Desktop.
module Graph
%default total
%access public
Node : Type
Node = Nat
Adj : Type -> Type
Adj a = List (a, Node)
Context : Type -> Type -> Type
Context a b = (Adj b, Node, a, Adj b)
data Graph : Type -> Type -> Type
data Graph a b = Empty | (&) (Context a b) (Graph a b)
node : Node
node = Z
adj : Adj String
adj = [("one", Z)]
adj2 : Adj String
adj2 = [("two", (S Z))]
context : Context String String
context = (adj, node, "a", adj2)
g : Graph String String
g = (&) context Empty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment