Created
January 1, 2015 16:20
-
-
Save gsg/4831eb4e7af755bb3344 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
module M = struct | |
type 'a key | |
type 'a value | |
type t = Univ : 'a key * 'a value -> t | |
type polymorphic_operations = { | |
conv_key : 'a . 'a key -> string; | |
conv_value : 'a . 'a value -> string; | |
} | |
let as_strings : type a . polymorphic_operations -> t -> (string * string) = | |
fun ops t -> match t with | |
| Univ (k, v) -> (ops.conv_key k, ops.conv_value v) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment