Mercurial > hg > Papers > 2022 > soto-sigos
view Paper/src/AgdaInterface.agda @ 14:ba98083f9853 default tip
FIX
author | soto <soto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 27 May 2022 12:31:39 +0900 |
parents | 14a0e409d574 |
children |
line wrap: on
line source
record StackMethods {n m : Level } (a : Set n ) {t : Set m }(stackImpl : Set n ) : Set (m Level.⊔ n) where field push : stackImpl -> a -> (stackImpl -> t) -> t pop : stackImpl -> (stackImpl -> Maybe a -> t) -> t open StackMethods record Stack {n m : Level } (a : Set n ) {t : Set m } (si : Set n ) : Set (m Level.⊔ n) where field stack : si stackMethods : StackMethods {n} {m} a {t} si pushStack : a -> (Stack a si -> t) -> t pushStack d next = push (stackMethods ) (stack ) d (\s1 -> next (record {stack = s1 ; stackMethods = stackMethods } )) popStack : (Stack a si -> Maybe a -> t) -> t popStack next = pop (stackMethods ) (stack ) (\s1 d1 -> next (record {stack = s1 ; stackMethods = stackMethods }) d1 ) open Stack