Commits

camlspotter  committed 2703341

trivial fixes

  • Participants
  • Parent commits abc2a03

Comments (0)

Files changed (3)

   | Null
 and obj = (string * t) list
 
-(* meta_conv trivial conversions *)
-let json_of_t x = x
-let t_of_json ?adrs:_ x = `Ok x
- 
 exception JSON_NotObject of t
 exception JSON_InvalidField of (string)
 exception JSON_CastErr of string
-let (@@) f x = f x
+external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply"
+external ( |> ) : 'a -> ('a -> 'b) -> 'b = "%revapply"
+
 let ($) g f = fun x -> g (f x)
 let id x = x
 let p = Printf.printf
 let pr = print_endline
 let tee f x = ignore @@ f x; x
-let (|>) x f = f x
 let const c = fun _ -> c
 
 let (!%) = Printf.sprintf

File lib/util.mli

-val ( @@ ) : ('a -> 'b) -> 'a -> 'b
+external ( @@ ) : ('a -> 'b) -> 'a -> 'b = "%apply"
+external ( |> ) : 'a -> ('a -> 'b) -> 'b = "%revapply"
 val ( $ ) : ('a -> 'b) -> ('c -> 'a) -> 'c -> 'b
 val id : 'a -> 'a
 val p : ('a, out_channel, unit) format -> 'a
 val pr : string -> unit
 val tee : ('a -> 'b) -> 'a -> 'a
-val ( |> ) : 'a -> ('a -> 'b) -> 'b
 val const : 'a -> 'b -> 'a
 val ( !% ) : ('a, unit, string) format -> 'a
 val ( !$ ) : 'a Lazy.t -> 'a