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

Unions between polymorphic variants behind module types

$
0
0

Polymorphic variants compose naturally by design, eg:

let foo = Error(#FooError)

let bar = foo->Result.flatMap(foo => switch foo {
  | 0 => Error(#Zero)
  | other => Ok(other)
  })

Why do you need the module functions then?


Viewing all articles
Browse latest Browse all 2592

Trending Articles