Created
October 1, 2014 23:17
-
-
Save mrb/0710bf18a985bab7edc7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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