annotate Paper/src/AgdaStack.agda @ 0:14a0e409d574

ADD fast commit
author soto <soto@cr.ie.u-ryukyu.ac.jp>
date Sun, 24 Apr 2022 23:13:44 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 data Element (a : Set) : Set where
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 cons : a -> Maybe (Element a) -> Element a
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 datum : {a : Set} -> Element a -> a
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 datum (cons a _) = a
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 next : {a : Set} -> Element a -> Maybe (Element a)
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 next (cons _ n) = n
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 record SingleLinkedStack (a : Set) : Set where
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 field
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 top : Maybe (Element a)
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13