3 ms·
It looks like it could be more concise sometimes. For instance, you could have this: if f(x) is Some(a) and g(x, a) is Some(Right(b)) then h1(a, b) else h2(x
by trealira 2y ago
It looks like it could be more concise sometimes. For instance, you could have this:
if f(x) is Some(a) and g(x, a) is Some(Right(b)) then h1(a, b) else h2(x)
The equivalent pattern matching with a match expression in pseudo-ML:
match f(x) with
None -> h2(x)
Some(a) ->
match g(x, a) with
Some(Right(b)) -> h1(a, b)
_ -> h2(x)