Skip to content

Instantly share code, notes, and snippets.

@wchargin
Created March 24, 2016 12:28
Show Gist options
  • Save wchargin/261f658b7088e617948d to your computer and use it in GitHub Desktop.
Save wchargin/261f658b7088e617948d to your computer and use it in GitHub Desktop.
convenience functors for easily defining equality instances
functor MagicEq (eqtype t) : EQUAL where type t = t =
struct
type t = t
val equal : t * t -> bool = op =
end
functor MagicPairOfEq (structure E1 : EQUAL
structure E2 : EQUAL) : PAIR_OF_EQUAL =
struct
structure E1 = E1
structure E2 = E2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment