From: Martin DeMello <martindemello@gmail.com>
To: OCaml List <caml-list@yquem.inria.fr>
Subject: [Caml-list] exhaustiveness checking within a submatch
Date: Thu, 10 Oct 2013 01:00:48 -0700 [thread overview]
Message-ID: <CAFrFfuGgMOBF09hGimmKO9um1jKKAseZUs30nFyp-CJZwZA33Q@mail.gmail.com> (raw)
Just curious as to why the compiler can't handle this, since in theory
everything is statically deducible:
# type test = A | B | C | D;;
type test = A | B | C | D
# let f = A;;
val f : test = A
# match f with A -> 1 | B -> 2 | C | D -> ( match f with C -> 3 | D -> 4);;
Characters 40-71:
Warning
8: this pattern-matching is not exhaustive.
Here is an
example of a value that is not matched:
(A|B)
Characters 40-71:
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a value that is not matched:
(A|B)
- : int = 1
martin
next reply other threads:[~2013-10-10 8:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-10 8:00 Martin DeMello [this message]
2013-10-10 8:07 ` David Allsopp
2013-10-10 8:09 ` David House
2013-10-10 17:32 ` Martin DeMello
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFrFfuGgMOBF09hGimmKO9um1jKKAseZUs30nFyp-CJZwZA33Q@mail.gmail.com \
--to=martindemello@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox