Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: DooMeeR <d@d...>
Subject: Re: [Caml-list] Question about type unification
Robert Fischer a écrit :
> How is the compiler magically getting from the float to a string value?  Can someone break down
> what's actually happening here for me?

It's not "getting to" a "string" value but to a "string t" value, which 
is an abbreviation for "float". The value has type "float", but the user 
requires type "string t", so the compiler unifies "float" and "string t" 
which is actually "float" so it's ok, and then the compiler gives the 
type requested by the user to the value, i.e., "string t".

Well, at least, this is how I understand this :)

Romain Bardou