From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: OCaml Mailing List <caml-list@inria.fr>
Subject: [Caml-list] a question about GADTs
Date: Fri, 15 Jun 2018 16:34:22 +0200 [thread overview]
Message-ID: <m2efh8rudt.fsf@charm-ecran.irisa.fr> (raw)
[-- Attachment #1: Type: text/plain, Size: 654 bytes --]
Hello,
I'm trying to write the following:
#+begin_src ocaml
type state
type value
type literal
type (_,_) term =
| Skip : (state, state) term
| Const : literal -> (state, value) term
| If : expr * stat * stat -> (state,state) term
and expr = (state,value) term
and stat = (state,state) term
#+end_src
and it works well. However I would like to replace the right-hand side
with their abbreviations (stat and expr), and at that point the
typechecker complains. Is there a workaround?
Thanks,
Alan
--
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-05: 411.25, 2017-05: 409.65
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]
next reply other threads:[~2018-06-15 14:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-15 14:34 Alan Schmitt [this message]
2018-06-15 15:21 ` Markus Mottl
2018-06-15 16:34 ` Alan Schmitt
2018-06-17 3:43 ` Chet Murthy
2018-06-17 6:39 ` Viet Le
2018-06-17 6:41 ` Julia Lawall
2018-06-17 9:50 ` Jesper Louis Andersen
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=m2efh8rudt.fsf@charm-ecran.irisa.fr \
--to=alan.schmitt@polytechnique.org \
--cc=caml-list@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;
as well as URLs for NNTP newsgroup(s).