Quantcast
Channel: ReScript Forum - Latest posts
Viewing all articles
Browse latest Browse all 2592

Module types for multi-argument functors

$
0
0

Indeed I was missing glennsl technique, with this you can have:

module type AType = {
  type t 
}

module type BType = {
  type t
  let x: t
}

module Example = (A: AType, B: BType with type t := A.t)  => { 
	let x = B.x
}

module MyExample = Example({type t = int}, {let x = 2}) 

That looks pretty close to what you were trying to achieve I think @liamoc.


Viewing all articles
Browse latest Browse all 2592

Trending Articles