caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] a question about GADTs
@ 2018-06-15 14:34 Alan Schmitt
  2018-06-15 15:21 ` Markus Mottl
  2018-06-17  3:43 ` Chet Murthy
  0 siblings, 2 replies; 7+ messages in thread
From: Alan Schmitt @ 2018-06-15 14:34 UTC (permalink / raw)
  To: OCaml Mailing List

[-- 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 --]

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

end of thread, other threads:[~2018-06-17  9:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15 14:34 [Caml-list] a question about GADTs Alan Schmitt
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

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).