comparison src/parallel_execution/stack.agda @ 154:efef5d4df54f

Add normal level and agda code
author atton
date Tue, 15 Nov 2016 19:02:36 +0900
parents
children 19cc626943e4
comparison
equal deleted inserted replaced
153:1115367f03a4 154:efef5d4df54f
1 module stack where
2
3 pushSingleLinkedStack : Stack -> Data -> (Code : Stack -> ?) -> ?
4 pushSingleLinkedStack stack data next = next stack1
5 where
6 element = record {next = top stack; data = data}
7 stack1 = record {top = just element}
8
9
10 popSingleLinkedStack : Maybe ?? -> Data -> (Code : Stack -> (Maybe ??) -> ?) -> ?
11 popSingleLinkedStack stack data next with (top stack) =
12 ... | nothing = next stack nothing
13 ... | just a = next stack1 data1
14 where
15 data1 = data a
16 stack1 = record { top = (next a)}