This commit is contained in:
parent
d406edfa82
commit
16ea1b7d57
|
@ -14,3 +14,5 @@ let merge lhs rhs =
|
|||
{ pop = lhs.pop + pop; push = List.append push rhs.push; }
|
||||
|
||||
let empty = { pop = 0; push = []; }
|
||||
|
||||
let map f sta = { pop = sta.pop; push = List.map f sta.push; }
|
||||
|
|
11
lib/StackAction.mli
Normal file
11
lib/StackAction.mli
Normal file
|
@ -0,0 +1,11 @@
|
|||
(** A stack action (pop is run first, then push sequentially) *)
|
||||
type 'a t =
|
||||
{ pop : int
|
||||
; push : 'a list
|
||||
}
|
||||
|
||||
val merge : 'a t -> 'a t -> 'a t
|
||||
|
||||
val empty : 'a t
|
||||
|
||||
val map : ('a -> 'b) -> 'a t -> 'b t
|
Loading…
Reference in a new issue