Created
February 20, 2019 16:14
-
-
Save cemerick/4d1b735008a3fb9da20d47ebc875eb60 to your computer and use it in GitHub Desktop.
This file contains 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 _ foo = | |
| A : int -> int foo | |
| B : int -> int foo | |
module FooSet = Set.Make(struct | |
type t | |
let compare a b = | |
let a' = match a with A x -> x | B x -> x in | |
let b' = match b with A x -> x | B x -> x in | |
Pervasives.compare a' b' | |
end) | |
(* | |
Error: Signature mismatch: | |
Modules do not match: | |
sig type t val compare : int foo -> int foo -> int end | |
is not included in | |
Set.OrderedType | |
Values do not match: | |
val compare : int foo -> int foo -> int | |
is not included in | |
val compare : t -> t -> int | |
*) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment