diff --git a/src/routes.ml b/src/routes.ml index f424215..172438e 100644 --- a/src/routes.ml +++ b/src/routes.ml @@ -182,7 +182,7 @@ let string_of_route r = Format.asprintf "%a" pp_route r let ksprintf' k path = let rec aux : type a b. (string list -> b) -> (a, b) path -> a = - fun k -> function + fun k -> function | End -> k [] | Wildcard -> fun { Parts.matched; _ } -> k (List.concat [ matched; [] ]) | Match (w, fmt) -> aux (fun s -> k @@ (w :: s)) fmt @@ -203,7 +203,7 @@ let parse_route path handler params = let rec match_target : type a b. (a, b) path -> a -> string list -> string list -> b match_result = - fun t f seen s -> + fun t f seen s -> match t with | End -> (match s with diff --git a/src/routes.mli b/src/routes.mli index 5c4a85f..890779b 100644 --- a/src/routes.mli +++ b/src/routes.mli @@ -8,8 +8,7 @@ type ('a, 'b) path (** [route] is a combination of a path sequence, with a function that will be called on a successful match. When a path sequence matches, the patterns that are extracted are forwarded to said function with the types that the user defined. Note that because of - {{:https://caml.inria.fr/pub/docs/manual-ocaml/polymorphism.html#ss:valuerestriction} - value restriction}, the route definitions will be assigned a weak type by the + {{:https://caml.inria.fr/pub/docs/manual-ocaml/polymorphism.html#ss:valuerestriction} value restriction}, the route definitions will be assigned a weak type by the compiler. This causes problems if one intends to re-use the same route definition in multiple contexts, like using a single definition for both matching a target url, and serializing to use in a client call. To avoid such problems one can use eta-expansion