Created
August 10, 2015 17:45
-
-
Save gsg/a58d7b1c02d3477de605 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type literal | |
type param | |
type _ t = | |
| QueryString : string -> literal t | |
| IntParam : string -> param t | |
| StringParam : string -> param t | |
type query = | |
| Nil : query | |
| Cons : 'a t * query -> query | |
let to_string : type a . a t -> string = function | |
| QueryString s -> s | |
| IntParam s -> ":" ^ s | |
| StringParam s -> ":" ^ s | |
let rec query_to_string = function | |
| Nil -> "" | |
| Cons (t, rest) -> to_string t ^ query_to_string rest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment