Advertisement
Guest User

Untitled

a guest
Nov 17th, 2016
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. type ('a, 'b) t =
  2. | F of ('a -> 'b)
  3. | O : ('c, 'b) t * ('a, 'c) t -> ('a, 'b) t
  4.  
  5. let (@) g f = fun x -> x |> f |> g
  6.  
  7. let rec compute : type a b. (a, b) t -> (a -> b) = fun f ->
  8. match f with
  9. | F f1 -> f1
  10. | O (f1, f2) ->
  11. let f1' = compute f1 in
  12. let f2' = compute f2 in
  13. f1' @ f2'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement