Is there a way to do a match within a match in F#? I've noticed that you can do one tailed on another like so...
match L.Head with
| null -> []
| _ -> match N with
| 1 -> [L.Head]
| _ -> []
But is there a way to do it so that a match, ending with a _ can be placed in the MIDDLE of another match? This seems to give a bug... is there a better way to do this, should you need it for your logic? EX:
match A with
| 0 -> match B with
| 1 -> 1
| _ -> 0
| _ -> 2
Why not use match on a tuple -
match (A,B) with
|0,1 -> 1
|0,_ -> 0
|_, -> 2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With