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

Weird error with module type

$
0
0

The sintax for optional arguments is different for signatures and actual implementation. You don’t specify the option part in the signature.

module M: {
  let f: (~a: int=?) => unit
} = {
  let f = (~a: option<int>=?) => {
    ()
  }
}

M.f(~a=1)

You can read more about signatures and type annotations for functions with labeled arguments here.


Viewing all articles
Browse latest Browse all 1813

Trending Articles