From af88c8895bba85fe5340b34aafb3dce7650bd01f Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Fri, 1 Jan 2021 11:08:38 +0100 Subject: Use first type module instead of functors --- layer/canvaPrinter.ml | 12 ++++++------ layer/canvaPrinter.mli | 2 +- layer/repr.ml | 12 ++++++------ layer/svg.ml | 12 ++++++------ 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'layer') diff --git a/layer/canvaPrinter.ml b/layer/canvaPrinter.ml index e696d10..23cf842 100755 --- a/layer/canvaPrinter.ml +++ b/layer/canvaPrinter.ml @@ -1,29 +1,29 @@ module Path = Brr_canvas.C2d.Path module V2 = Gg.V2 -type 'a t = Path.t +type t = Path.t let create - : unit -> 'a t + : unit -> t = Path.create (* Start a new path. *) let move_to - : Gg.v2 -> 'a t -> 'a t + : Gg.v2 -> t -> t = fun point path -> let x, y = V2.to_tuple point in Path.move_to ~x ~y path; path let line_to - : Gg.v2 -> 'a t -> 'a t + : Gg.v2 -> t -> t = fun point path -> let x, y = V2.to_tuple point in Path.line_to ~x ~y path; path let quadratic_to - : Gg.v2 -> Gg.v2 -> Gg.v2 -> 'a t -> 'a t + : Gg.v2 -> Gg.v2 -> Gg.v2 -> t -> t = fun ctrl0 ctrl1 p1 path -> let cx, cy = V2.to_tuple ctrl0 and cx', cy' = V2.to_tuple ctrl1 @@ -36,7 +36,7 @@ let quadratic_to path let close - : 'a t -> 'a t + : t -> t = fun path -> Path.close path; path diff --git a/layer/canvaPrinter.mli b/layer/canvaPrinter.mli index e273054..0c46448 100755 --- a/layer/canvaPrinter.mli +++ b/layer/canvaPrinter.mli @@ -1,2 +1,2 @@ include Repr.PRINTER - with type 'a t = Brr_canvas.C2d.Path.t + with type t = Brr_canvas.C2d.Path.t diff --git a/layer/repr.ml b/layer/repr.ml index b91442b..f2d114c 100755 --- a/layer/repr.ml +++ b/layer/repr.ml @@ -1,19 +1,19 @@ module type PRINTER = sig - type 'a t + type t - val create: unit -> 'a t + val create: unit -> t (* Start a new path. *) - val move_to: Gg.v2 -> 'a t -> 'a t + val move_to: Gg.v2 -> t -> t - val line_to: Gg.v2 -> 'a t -> 'a t + val line_to: Gg.v2 -> t -> t (** [quadratic_to ctrl0 ctrl1 p1] ctreate a quadratic curve from the current point to [p1], with control points [ctrl0] and [ctrl1] *) - val quadratic_to: Gg.v2 -> Gg.v2 -> Gg.v2 -> 'a t -> 'a t + val quadratic_to: Gg.v2 -> Gg.v2 -> Gg.v2 -> t -> t (** Request for the path to be closed *) - val close: 'a t -> 'a t + val close: t -> t end diff --git a/layer/svg.ml b/layer/svg.ml index f7cc670..2394cb8 100755 --- a/layer/svg.ml +++ b/layer/svg.ml @@ -12,15 +12,15 @@ let path: El.cons = fun ?d ?at childs -> El.v ?d ?at (Jstr.v "path") childs -type 'a t = Jstr.t +type t = Jstr.t let create - : unit -> 'a t + : unit -> t = fun () -> Jstr.empty (* Start a new path. *) let move_to - : Gg.v2 -> 'a t -> 'a t + : Gg.v2 -> t -> t = fun point path -> let x, y = V2.to_tuple point in @@ -31,7 +31,7 @@ let move_to ; Jstr.of_float y ] let line_to - : Gg.v2 -> 'a t -> 'a t + : Gg.v2 -> t -> t = fun point path -> let x, y = V2.to_tuple point in Jstr.concat ~sep:(Jstr.v " ") @@ -41,7 +41,7 @@ let line_to ; (Jstr.of_float y) ] let quadratic_to - : Gg.v2 -> Gg.v2 -> Gg.v2 -> 'a t -> 'a t + : Gg.v2 -> Gg.v2 -> Gg.v2 -> t -> t = fun ctrl0 ctrl1 p1 path -> let cx, cy = V2.to_tuple ctrl0 and cx', cy' = V2.to_tuple ctrl1 @@ -59,6 +59,6 @@ let quadratic_to ; (Jstr.of_float y) ] let close - : 'a t -> 'a t + : t -> t = fun path -> Jstr.append path (Jstr.v " Z") -- cgit v1.2.3