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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chung-chieh Shan <ccshan@p...>
Subject: Re: Void type?
rossberg@ps.uni-sb.de wrote in article <61777.84.165.172.53.1185610925.squirrel@www.ps.uni-sb.de> in gmane.comp.lang.caml.inria:
> Chung-chieh Shan wrote:
> > type void = Void of void
> Dont't forget OCaml's let-rec:
>   let rec v = Void v
> works like a charm.

Oops!  Thanks.  I guess contravariance in charm is a curse. (:

What about:

    # type void = { v: 'a. 'a };;
    type void = { v : 'a. 'a; }
    # let rec vv = { v = vv };;
    This field value has type 'a which is less general than 'b. 'b

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
People are oddly consistent.