Created
October 28, 2017 18:42
-
-
Save anonymous/152ed805fe7fda5ce3a8911d3554c64c to your computer and use it in GitHub Desktop.
Ocaml extending Map
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
module type S = sig | |
type key | |
type atom | |
type t | |
val f: t -> t -> t | |
val a: atom -> t -> t * t | |
end | |
(* I would like Make to have a partial signature of S *) | |
module Make (Key: OrderedType) (Atom: Atomic) (* : S *) = struct | |
module Base = Map.Make(Key) | |
type key = Key.t | |
type atom = Atom.t | |
type t = atom Base.t | |
include Base | |
(* Extending map basing on Map 'a t = Atom.t t *) | |
let f = ... | |
let a = ... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment