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

Bind in ReScript (not to import JS, but to bind multiple Option or Result)

$
0
0

On this note, while more specific to the option case, also worth knowing about Array.filterMap and Array.keepSome

Array.filterMap([1, 3, 5, 7], n => n > 4 ? Some(n) : None)
// [5, 7]

Array.keepSome([Some("a"), None, Some("b")])
// ["a", "b"]

Viewing all articles
Browse latest Browse all 1751

Trending Articles