Skip to content

Instantly share code, notes, and snippets.

@j0sh
Created August 10, 2015 17:25
Show Gist options
  • Select an option

  • Save j0sh/d16e9351c00266106c3d to your computer and use it in GitHub Desktop.

Select an option

Save j0sh/d16e9351c00266106c3d to your computer and use it in GitHub Desktop.
File "t.ml", line 14, characters 6-16:
Error: This pattern matches values of type param t
but a pattern was expected which matches values of type literal t
Type param is not compatible with type literal
type literal
type param
type _ t =
| QueryString : string -> literal t
| IntParam : string -> param t
| StringParam : string -> param t
type 'a query = 'a t list
let to_string (q:'a query) : string =
let t2s (r:'a t) : string = match r with
| QueryString s -> s
| IntParam s | StringParam s -> ":" ^ s in
let strs = List.map t2s q in
String.concat "" strs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment