annotate Paper/pic/AgdaTree.agda.replaced @ 1:df1552e4ac7a

add mindmap, some figs
author ryokka
date Wed, 12 Dec 2018 18:44:19 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
1 record TreeMethods {n m : Level } {a : Set n } {t : Set m } (treeImpl : Set n ) : Set (m Level.@$\sqcup$@ n) where
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
2 field
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
3 putImpl : treeImpl @$\rightarrow$@ a @$\rightarrow$@ (treeImpl @$\rightarrow$@ t) @$\rightarrow$@ t
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
4 getImpl : treeImpl @$\rightarrow$@ (treeImpl @$\rightarrow$@ Maybe a @$\rightarrow$@ t) @$\rightarrow$@ t
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
5 open TreeMethods
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
6
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
7 record Tree {n m : Level } {a : Set n } {t : Set m } (treeImpl : Set n ) : Set (m Level.@$\sqcup$@ n) where
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
8 field
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
9 tree : treeImpl
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
10 treeMethods : TreeMethods {n} {m} {a} {t} treeImpl
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
11 putTree : a @$\rightarrow$@ (Tree treeImpl @$\rightarrow$@ t) @$\rightarrow$@ t
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
12 putTree d next = putImpl (treeMethods ) tree d (\t1 @$\rightarrow$@ next (record {tree = t1 ; treeMethods = treeMethods} ))
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
13 getTree : (Tree treeImpl @$\rightarrow$@ Maybe a @$\rightarrow$@ t) @$\rightarrow$@ t
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
14 getTree next = getImpl (treeMethods ) tree (\t1 d @$\rightarrow$@ next (record {tree = t1 ; treeMethods = treeMethods} ) d )
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
15
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
16 open Tree
df1552e4ac7a add mindmap, some figs
ryokka
parents:
diff changeset
17