Version française
Home     About     Download     Resources     Contact us    
Browse thread
type t = ()
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Vincenzo Ciancia <vincenzo_yahoo_addressguard-gmane@y...>
Subject: Re: type t = ()
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.

# type d = () of int;;
type d = () of int
# () 3;;
- : d = () 3

V.

-- 
Please note that I do not read the e-mail address used in the from field but
I read vincenzo_ml at yahoo dot it
Attenzione: non leggo l'indirizzo di posta usato nel campo from, ma leggo
vincenzo_ml at yahoo dot it