Skip to content

Commit

Permalink
Reformat with newer ocamlformat
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragsoni committed Sep 18, 2024
1 parent 2b02836 commit 34713d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/routes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/routes.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34713d6

Please sign in to comment.