Source

cadastr / src / cd_Partapp.ml

module Partapp
 :
  sig
    type partapp 'a 'z = private ('a -> 'z);
    value make : ('a -> 'z) -> partapp 'a 'z;
    value apply : partapp 'a 'z -> 'a -> 'z;
  end
 =
  struct
    type partapp 'a 'z = 'a -> 'z;
    external make : ('a -> 'z) -> partapp 'a 'z = "%identity";
    value apply
     : partapp 'a 'z -> 'a -> 'z
     = fun f a ->
         let r = f a in
         ( ignore r; r )
    ;
  end
;


module Partapp2
 :
  sig
    type partapp2 'a 'b 'z = private ('a -> 'b -> 'z);
    value make : ('a -> 'b -> 'z) -> partapp2 'a 'b 'z;
    value apply : partapp2 'a 'b 'z -> 'a -> 'b -> 'z;
  end
 =
  struct
    type partapp2 'a 'b 'z = 'a -> 'b -> 'z;
    external make : ('a -> 'b -> 'z) -> partapp2 'a 'b 'z = "%identity";
    value apply
     : partapp2 'a 'b 'z -> 'a -> 'b -> 'z
     = fun f a b ->
         let r = f a b in
         ( ignore r; r )
    ;
  end
;