annotate Paper/src/AgdaTreeImpl.agda.replaced @ 5:339fb67b4375

INIT rbt.agda
author soto <soto@cr.ie.u-ryukyu.ac.jp>
date Sun, 07 Nov 2021 00:51:16 +0900
parents c59202657321
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
339fb67b4375 INIT rbt.agda
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
1 record TreeMethods {n m : Level } {a : Set n } {t : Set m } (treeImpl : Set n ) : Set (m Level.!$\sqcup$! n) where
0
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 field
5
339fb67b4375 INIT rbt.agda
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
3 putImpl : treeImpl !$\rightarrow$! a !$\rightarrow$! (treeImpl !$\rightarrow$! t) !$\rightarrow$! t
339fb67b4375 INIT rbt.agda
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
4 getImpl : treeImpl !$\rightarrow$! (treeImpl !$\rightarrow$! Maybe a !$\rightarrow$! t) !$\rightarrow$! t
0
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
5
339fb67b4375 INIT rbt.agda
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
6 record Tree {n m : Level } {a : Set n } {t : Set m } (treeImpl : Set n ) : Set (m Level.!$\sqcup$! n) where
0
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 field
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 tree : treeImpl
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 treeMethods : TreeMethods {n} {m} {a} {t} treeImpl
5
339fb67b4375 INIT rbt.agda
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
10 putTree : a !$\rightarrow$! (Tree treeImpl !$\rightarrow$! t) !$\rightarrow$! t
339fb67b4375 INIT rbt.agda
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
11 putTree d next = putImpl (treeMethods ) tree d (\t1 !$\rightarrow$! next (record {tree = t1 ; treeMethods = treeMethods} ))
339fb67b4375 INIT rbt.agda
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
12 getTree : (Tree treeImpl !$\rightarrow$! Maybe a !$\rightarrow$! t) !$\rightarrow$! t
339fb67b4375 INIT rbt.agda
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
13 getTree next = getImpl (treeMethods ) tree (\t1 d !$\rightarrow$! next (record {tree = t1 ; treeMethods = treeMethods} ) d )
0
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14