Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type ('a, 'b) t =
- | F of ('a -> 'b)
- | O : ('c, 'b) t * ('a, 'c) t -> ('a, 'b) t
- let (@) g f = fun x -> x |> f |> g
- let rec compute : type a b. (a, b) t -> (a -> b) = fun f ->
- match f with
- | F f1 -> f1
- | O (f1, f2) ->
- let f1' = compute f1 in
- let f2' = compute f2 in
- f1' @ f2'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement