Advertisement
Guest User

Untitled

a guest
Dec 16th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.51 KB | None | 0 0
  1. let f (fn : (?foo:bool -> unit -> unit)) : (?foo:bool -> unit -> unit) = fun ?foo () -> fn ?foo () ;;
  2. val f : (?foo:bool -> unit -> unit) -> ?foo:bool -> unit -> unit = <fun>
  3.  
  4. let g (fn : (unit -> unit)) : (?foo:bool -> unit -> unit) = fun ?foo:_ () -> fn () ;;
  5. val g : (unit -> unit) -> ?foo:bool -> unit -> unit = <fun>
  6.  
  7. let h = fun ?(foo=true) () -> if foo then () else () ;;
  8. val h : ?foo:bool -> unit -> unit = <fun>
  9.  
  10. f h ;;
  11. - : ?foo:bool -> unit -> unit = <fun>
  12.  
  13. g h ;;
  14. - : ?foo:bool -> unit -> unit = <fun>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement