RE: Haskell and principal types

2001-10-12 Thread Simon Peyton-Jones
| semantics). In doing so, I've come across an oddity. It seems | that Haskell does not have the principal type property It looks to me that you are correct. I hadn't realised that consequence of the dreaded M.R.It may be "well known in the Haskell community", it wasn't well known to me. J

Re: Haskell and principal types

2001-10-10 Thread Karl-Filip Faxen
Oops! I said THIH has problems with type synonyms. That is completely wrong. I meant type SIGNATURES and nothing else. Sorry for the confusion. /kff ___ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell

Re: Haskell and principal types

2001-10-10 Thread Olaf Chitil
Hi Karl-Filip, > (Mark Jones's THIH algorithm, as > well as other algorithms built on W, fails to type some programs > containing type synonyms). Are you thinking of the following kind of problem? type T a = Bool b :: Eq a => T a b = True x = b Gives in Hugs: Type checking ERROR "Test

Re: Haskell and principal types

2001-10-10 Thread Karl-Filip Faxen
Hello again! John Hughes suggested that Haskell should have two forms of binding, one with call-by-name (does not preserve sharing) semantics and polymorphism and overloading and monomorphic with call-by-need (preserves sharing). The question is; would this restore principal types in general?

Re: Haskell and principal types

2001-10-06 Thread John Hughes
So here is the offending program: class IsNil a where isNil :: a -> Bool instance IsNil [b] where isNil [] = True isNil _ = False f x y = let g = isNil in (g x, g y) The monomorphism restriction applies to

Haskell and principal types

2001-10-05 Thread Karl-Filip Faxen
Hi all! I've been spending some time the last year writing up a formalization of the Haskell type system (actually, most of the static semantics). In doing so, I've come across an oddity. It seems that Haskell does not have the principal type property, ie there are Haskell expressions which, in