From: David Allsopp <dra-news@metastack.com>
To: OCaml List <caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] exhaustiveness checking within a submatch
Date: Thu, 10 Oct 2013 08:07:46 +0000 [thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D9CCC66B39@Remus.metastack.local> (raw)
In-Reply-To: <CAFrFfuGgMOBF09hGimmKO9um1jKKAseZUs30nFyp-CJZwZA33Q@mail.gmail.com>
Martin DeMello wrote:
> 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
http://caml.inria.fr/pub/ml-archives/caml-list/2007/02/d35648b13d76f1717edbf41101dc913f.en.html
David
next prev parent reply other threads:[~2013-10-10 8:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-10 8:00 Martin DeMello
2013-10-10 8:07 ` David Allsopp [this message]
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=E51C5B015DBD1348A1D85763337FB6D9CCC66B39@Remus.metastack.local \
--to=dra-news@metastack.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