Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] Suboptimal pattern matching specification
@ 2016-04-07 13:36 Daniel Bünzli
  2016-04-07 16:36 ` Gabriel Scherer
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Bünzli @ 2016-04-07 13:36 UTC (permalink / raw)
  To: OCaml List

Hello,   

Something I run quite often is the following pattern matching  

match v with
| None | Some c when sat c -> expr
| Some …  

which doesn't compile and forces me to write  

match v with  
| None -> expr  
| Some c when sat c -> expr
| Some …  

and leads to code duplication or the introduction of a definition to avoid it.  

Am I missing a syntax bit ?  

Best,

Daniel



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-07 16:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-07 13:36 [Caml-list] Suboptimal pattern matching specification Daniel Bünzli
2016-04-07 16:36 ` Gabriel Scherer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox