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: Richard Jones <rich@a...>
Subject: Question about type unification

With this definition:

  type 'a t = float

Why is this allowed?

  # ((3.0 : unit t) : string t) ;;
  - : string t = 3.

Note that unification is prevented if t is opaque, eg, hidden behind a
module signature.

Rich.

-- 
Richard Jones
Red Hat