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

Difficulties with functors and abstract types

$
0
0

Just remove the FunctorType type annotation on MyMod

module MyMod = {
  type a = string // this is where I want to set the type
  let injectedRun = (x: a) => Console.log(x)
}

Modules are structurally typed. Using a module type annotation can therefore only remove information. You do not need to (and cannot) specify that MyMod implements or conforms with FunctorType.


Viewing all articles
Browse latest Browse all 1847

Trending Articles