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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Fernando Alegre <fernando@c...>
Subject: Re: RE : [Caml-list] empty type

How about this:

# type t = () of int;;
type t = () of int
# begin end;;
The constructor () expects 1 argument(s),
but is here applied to 0 argument(s)

Fernando

On Mon, Feb 19, 2007 at 05:03:58PM +0100, Andrej Bauer wrote:
> Mathias Kende wrote:
> >It's not a type, but just a valid name for a constructor that can be
> >redefined if necessary (although one surely does not want to do so).
> 
> Way cool:
> 
> # type t = () of int * int ;;
> type t = () of int * int
> # () (3, 4) ;;
> - : t = () (3, 4)
> 
> Andrej
> 
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs