caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Ville-Pertti Keinonen <will@exomi.com>
To: Erik de Castro Lopo <mle+ocaml@mega-nerd.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Why isn't -rectypes command line option the default
Date: Wed, 21 Mar 2007 11:01:45 +0200	[thread overview]
Message-ID: <6AF7E3A0-1A70-4381-B06E-13A8A887943C@exomi.com> (raw)
In-Reply-To: <20070321131334.e381b5fb.mle+ocaml@mega-nerd.com>


On Mar 21, 2007, at 4:13 AM, Erik de Castro Lopo wrote:

> Wouldn't it be nicer to be able to specify the rectypes behaviour
> per type? Maybe something like this would work:
>
> 	rec type 'a t = 'a * 'a t Lazy.t

It would probably be possible to allow that by default with no extra  
keyword, since errors are unlikely when writing a type explicitly.

But the ability to write recursive type aliases would not make  
actually creating recursively typed values all that convenient, you'd  
have to give the type explicitly (I'd rather just use a variant and a  
constructor).

Note that in the example using -rectypes posted by Zheng Li, the type  
'a t is never actually used for anything - presumably it's intended  
as an illustration to the reader, and could just as well be a comment  
-  the type inferred for fib is compatible, but not named int t.


  parent reply	other threads:[~2007-03-21  9:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-21  0:34 Erik de Castro Lopo
2007-03-21  1:48 ` Zheng Li
2007-03-21  2:13   ` [Caml-list] " Erik de Castro Lopo
2007-03-21  5:37     ` james woodyatt
2007-03-21  7:08       ` Erik de Castro Lopo
2007-03-21  9:01     ` Ville-Pertti Keinonen [this message]
2007-03-21 12:47     ` Gerd Stolpmann

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=6AF7E3A0-1A70-4381-B06E-13A8A887943C@exomi.com \
    --to=will@exomi.com \
    --cc=caml-list@inria.fr \
    --cc=mle+ocaml@mega-nerd.com \
    /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).