From: Wolfgang Lux <wlux@uni-muenster.de>
To: Vincenzo Ciancia <vincenzo_yahoo_addressguard-gmane@yahoo.it>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: type t = ()
Date: Fri, 10 Jun 2005 14:56:34 +0200 [thread overview]
Message-ID: <cd188d68860e0385c413d068099a34a8@uni-muenster.de> (raw)
In-Reply-To: <d8ae6e$gi5$1@sea.gmane.org>
Vincenzo Ciancia wrote:
> Richard Jones wrote:
>
>> # type dummy = ();;
>> type dummy = ()
>> # let () = Printf.printf "hello";;
>> This expression has type unit but is here used with type dummy
>>
>
> It seems that the compiler accepted "()" as a type constructor, so now
> every
> instance of "()" is the only constructor of type "dummy" e.g.
Sorry for nitpicking, but in this case () is a *data* constructor.
I guess, Rich would have been more happy if OCaml did recognize ()
as a type constructor in this example.
However, I guess one cannot do much about this in OCaml since () is
a legitimate data constructor name. The problem really is that the
(O)Caml designers chose to overload the type keyword for defining
algebraic data types as well as type abbreviations. Compare with SML
and Haskell where different keywords are used.
Regards
Wolfgang
next prev parent reply other threads:[~2005-06-10 12:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-09 21:22 Richard Jones
2005-06-09 22:05 ` Vincenzo Ciancia
2005-06-10 12:56 ` Wolfgang Lux [this message]
2005-06-09 23:43 ` [Caml-list] " Jonathan Bryant
2005-06-10 7:55 ` Richard Jones
2005-06-10 13:02 ` Florian Hars
2005-06-10 22:12 ` Jon Harrop
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=cd188d68860e0385c413d068099a34a8@uni-muenster.de \
--to=wlux@uni-muenster.de \
--cc=caml-list@inria.fr \
--cc=vincenzo_yahoo_addressguard-gmane@yahoo.it \
/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