Quantcast
Channel: Active questions tagged ocaml - Stack Overflow
Viewing all articles
Browse latest Browse all 597

Or-patterns in Haskell

$
0
0

In OCaml, I was used to writing code which looked like:

let combine o1 o2 = match o1, o2 with    | Valid, Invalid | Invalid, Valid -> Invalid    | _ -> ...

I didn't find a way to write or-patterns in Haskell and I really miss it. Does anyone have a solution?


Viewing all articles
Browse latest Browse all 597

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>