comparison src/AgdaTreeImpl.agda @ 1:73127e0ab57c

(none)
author soto@cr.ie.u-ryukyu.ac.jp
date Tue, 08 Sep 2020 18:38:08 +0900
parents
children
comparison
equal deleted inserted replaced
0:b919985837a3 1:73127e0ab57c
1 record TreeMethods {n m : Level } {a : Set n } {t : Set m } (treeImpl : Set n ) : Set (m Level.⊔ n) where
2 field
3 putImpl : treeImpl -> a -> (treeImpl -> t) -> t
4 getImpl : treeImpl -> (treeImpl -> Maybe a -> t) -> t
5
6 record Tree {n m : Level } {a : Set n } {t : Set m } (treeImpl : Set n ) : Set (m Level.⊔ n) where
7 field
8 tree : treeImpl
9 treeMethods : TreeMethods {n} {m} {a} {t} treeImpl
10 putTree : a -> (Tree treeImpl -> t) -> t
11 putTree d next = putImpl (treeMethods ) tree d (\t1 -> next (record {tree = t1 ; treeMethods = treeMethods} ))
12 getTree : (Tree treeImpl -> Maybe a -> t) -> t
13 getTree next = getImpl (treeMethods ) tree (\t1 d -> next (record {tree = t1 ; treeMethods = treeMethods} ) d )
14