Version française
Home     About     Download     Resources     Contact us    
Browse thread
A signature that cannot be inhabited by any structures
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Hyeonseung Im <genilhs@p...>
Subject: A signature that cannot be inhabited by any structures
Hi all.

 

I found something interesting. In the OCaml, the following signature is
valid. (I tested it with the OCaml version 3.09.2 and 3.10.0.)

 

(In the top-level)

# module type S = sig val x : int val x : float end;;

module type S = sig val x : int val x : float end

 

But, this module type seems not to be inhabited by any structures. On the
contrary, in the SML this sort of module types cannot be defined. (Actually,
it raises an error: the duplication of variables.)

 

I wonder if this is a feature of the OCaml (or maybe a bug in the
implementation).

I'd appreciate any comment on it.

 

Hyeonseung Im.