Created
July 4, 2018 14:29
-
-
Save linktohack/7eb131c52f35af4e9429d7b3d17a59c3 to your computer and use it in GitHub Desktop.
REASONML Two modules
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 Sig = | |
struct | |
module type NoteSig = sig type t end | |
module type TodoSig = sig type t end | |
end | |
module Same = | |
struct | |
module rec Note:Sig.NoteSig = struct type t = { | |
todo: Todo.t;} end | |
and Todo:Sig.TodoSig = struct type t = { | |
notes: Note.t array;} end | |
end | |
module A = | |
struct module Note(T:Sig.TodoSig) = struct type t = { | |
todo: T.t;} end end | |
module B = | |
struct | |
module Todo(N:Sig.NoteSig) = struct type t = { | |
notes: N.t array;} end | |
end | |
module C = | |
struct | |
module rec NoteImpl:Sig.NoteSig = A.Note(TodoImpl) | |
and TodoImpl:Sig.TodoSig = B.Todo(NoteImpl) | |
end | |
let todo1: Same.Todo.t = { notes = [||] } | |
let todo2: C.TodoImpl.t = { notes = [||] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here is the error