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

Rescript frustration

$
0
0

Having a lazy getOrElse would be great! I would love to expand on what we have in Core, but it’s also very easy to add this to your project.

module O = {
  let getOrElse = (a, b) => a->Option.getOr(b())
}

Console.log(None->O.getOrElse(() => 42))

Viewing all articles
Browse latest Browse all 1794

Trending Articles