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

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Robert Fischer <robert@f...>
Subject: Re: [Caml-list] Question about type unification
How is the compiler magically getting from the float to a string value?  Can someone break down
what's actually happening here for me?

~~ Robert.

Fabrice Marchant wrote:
> On Mon, 26 May 2008 13:22:04 +0100
> Richard Jones <rich@annexia.org> wrote:
> 
>> With this definition:
>>
>>   type 'a t = float
>>
>> Why is this allowed?
>>
>>   # ((3.0 : unit t) : string t) ;;
>>   - : string t = 3.
> 
>   Never thought to write such odd things. Maybe is there some interesting use ?
> 
> Fabrice
> 
> _______________________________________________
> 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
>