comparison src/AgdaStack.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 data Element (a : Set) : Set where
2 cons : a -> Maybe (Element a) -> Element a
3
4 datum : {a : Set} -> Element a -> a
5 datum (cons a _) = a
6
7 next : {a : Set} -> Element a -> Maybe (Element a)
8 next (cons _ n) = n
9
10 record SingleLinkedStack (a : Set) : Set where
11 field
12 top : Maybe (Element a)
13