[comp.lang.functional] Type Inference in Standard ML

hallgren@cs.chalmers.se (Thomas Hallgren) (01/13/91)

In article <54161@eerie.acsu.Buffalo.EDU> avnaik@sybil.cs.Buffalo.EDU (Ashish V Naik) writes:
>
>
>	I would like to draw your attention to an example for which it appears 
>that the type inference done by ML interpreter is incorrect .
>	Consider the following session that I had with the Standard Edinburgh 
>ML interpreter , 
	...
>Can someone please clarify ? Am I missing out something ? 
>
>Thanks ,
>
>Ashish Naik 

There seems to be a bug in the Edinburgh implementation. Here's another
example:

- fun equal a b = [a]=[b];
> val equal = fn : 'a -> ('a -> bool)

- equal sin sin;
> true : bool
- equal sin cos;
> false : bool
- equal sin (fn x => sin x);
> false : bool

I tried the same thing in the New Jersey implementation of ML, but it seems
to work:

- fun equal a b = [a]=[b];
val equal = fn : ''a -> ''a -> bool


	Thomas Hallgren
Thomas Hallgren
hallgren@cs.chalmers.se