Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions lib/svg_f.ml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ let string_of_paint = function
module Make_with_wrapped_functions

(Xml : Xml_sigs.T)
(C : Svg_sigs.Wrapped_functions
with type ('a, 'b) ft = ('a, 'b) Xml.W.ft) =
(C : Svg_sigs.Wrapped_functions with module Xml = Xml) =

struct

Expand Down Expand Up @@ -915,9 +914,11 @@ struct

end

module Wrapped_functions = struct
module Wrapped_functions
(Xml : Xml_sigs.T with type ('a,'b) W.ft = 'a -> 'b) =
struct

type (-'a, 'b) ft = 'a -> 'b
module Xml = Xml

let string_of_alignment_baseline = function
| `Auto -> "auto"
Expand Down Expand Up @@ -1120,4 +1121,4 @@ end

module Make
(Xml : Xml_sigs.T with type ('a, 'b) W.ft = ('a -> 'b)) =
Make_with_wrapped_functions(Xml)(Wrapped_functions)
Make_with_wrapped_functions(Xml)(Wrapped_functions(Xml))
8 changes: 4 additions & 4 deletions lib/svg_f.mli
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ module Make(Xml : Xml_sigs.T with type ('a, 'b) W.ft = ('a -> 'b))
and type +'a attrib = Xml.attrib

(** The standard set of wrapped functions, when [W.ft] is the regular function. *)
module Wrapped_functions :
Svg_sigs.Wrapped_functions with type (-'a, 'b) ft = 'a -> 'b
module Wrapped_functions
(Xml: Xml_sigs.T with type ('a, 'b) W.ft = 'a -> 'b)
: Svg_sigs.Wrapped_functions with module Xml = Xml

(** Similar to {!Make} but with a custom set of wrapped functions. *)
module Make_with_wrapped_functions
(Xml : Xml_sigs.T)
(C : Svg_sigs.Wrapped_functions
with type (-'a, 'b) ft = ('a, 'b) Xml.W.ft)
(C : Svg_sigs.Wrapped_functions with module Xml = Xml)
: Svg_sigs.Make(Xml).T
with type +'a elt = Xml.elt
and type +'a attrib = Xml.attrib
42 changes: 21 additions & 21 deletions lib/svg_sigs.mli
Original file line number Diff line number Diff line change
Expand Up @@ -968,49 +968,49 @@ end
(** Wrapped functions, to be used with {!Svg_f.Make_with_wrapped_functions}. *)
module type Wrapped_functions = sig

type (-'a, 'b) ft
module Xml : Xml_sigs.T

val string_of_alignment_baseline :
([< Svg_types.alignment_baseline], string) ft
([< Svg_types.alignment_baseline], string) Xml.W.ft

val string_of_bool : (bool, string) ft
val string_of_bool : (bool, string) Xml.W.ft

val string_of_big_variant : ([< Svg_types.big_variant], string) ft
val string_of_big_variant : ([< Svg_types.big_variant], string) Xml.W.ft

val string_of_coords : (Svg_types.coords, string) ft
val string_of_coords : (Svg_types.coords, string) Xml.W.ft

val string_of_dominant_baseline :
([< Svg_types.dominant_baseline], string) ft
([< Svg_types.dominant_baseline], string) Xml.W.ft

val string_of_fourfloats : (float * float * float * float, string) ft
val string_of_fourfloats : (float * float * float * float, string) Xml.W.ft

val string_of_in_value : ([< Svg_types.in_value], string) ft
val string_of_in_value : ([< Svg_types.in_value], string) Xml.W.ft

val string_of_int : (int, string) ft
val string_of_int : (int, string) Xml.W.ft

val string_of_length : (Svg_types.Unit.length, string) ft
val string_of_length : (Svg_types.Unit.length, string) Xml.W.ft

val string_of_lengths : (Svg_types.lengths, string) ft
val string_of_lengths : (Svg_types.lengths, string) Xml.W.ft

val string_of_number : (float, string) ft
val string_of_number : (float, string) Xml.W.ft

val string_of_number_optional_number :
(float * float option, string) ft
(float * float option, string) Xml.W.ft

val string_of_numbers : (float list, string) ft
val string_of_numbers : (float list, string) Xml.W.ft

val string_of_numbers_semicolon : (float list, string) ft
val string_of_numbers_semicolon : (float list, string) Xml.W.ft

val string_of_offset : ([< Svg_types.offset], string) ft
val string_of_offset : ([< Svg_types.offset], string) Xml.W.ft

val string_of_orient : (Svg_types.Unit.angle option, string) ft
val string_of_orient : (Svg_types.Unit.angle option, string) Xml.W.ft

val string_of_paint : ([< Svg_types.paint], string) ft
val string_of_paint : ([< Svg_types.paint], string) Xml.W.ft

val string_of_strokedasharray : (Svg_types.lengths, string) ft
val string_of_strokedasharray : (Svg_types.lengths, string) Xml.W.ft

val string_of_transform : (Svg_types.transform, string) ft
val string_of_transform : (Svg_types.transform, string) Xml.W.ft

val string_of_transforms : (Svg_types.transforms, string) ft
val string_of_transforms : (Svg_types.transforms, string) Xml.W.ft

end