2021-12-16 10:01:08 +00:00
|
|
|
type 'a queue = { front : 'a list; back : 'a list }
|
|
|
|
|
|
|
|
type 'a result =
|
|
|
|
| Error of string
|
|
|
|
| Success of 'a
|
|
|
|
|
|
|
|
type 'a stack =
|
|
|
|
| Empty
|
|
|
|
| Stacked of 'a * 'a stack
|
|
|
|
|
|
|
|
type 'a tree =
|
|
|
|
| Leaf
|
2021-12-18 21:08:10 +00:00
|
|
|
| Branch of 'a * 'a tree list
|
|
|
|
|
|
|
|
|
|
|
|
let id (x : 'a) = x
|
|
|
|
|
|
|
|
let ( >> ) f g x = g (f x)
|
|
|
|
|
|
|
|
let ( << ) g f x = g (f x)
|