[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hiding again

Lennart Augustsson writes:
> What about this (sorry to keep complaining):
> 	module M where
> 	import Prelude hiding (ShowS)
> 	...
> Is it legal?  Well, that depends what the interface file
> for Prelude looks like.  If it says (e.g.)
> 	showChar :: Char -> ShowS
> then it is illegal since the closure rule is violated.
> If, on the other hand, it says
> 	showChar :: Char -> String -> String
> then it is legal.
> Unfortunately the interface files are not given for the Prelude(s)
> so it is impossible to tell.
> 	-- Lennart

So, it *does* make a difference whether synonyms appear in interfaces (I
thought it might, but couldn't think of an example).  Given that it's
essentially impossible to define which synonyms should not be expanded
in interfaces (to do so requires defining the inference algorithm
used), perhaps we should just rule that synonyms are *always*
expanded...  Lennart's problem would then disappear.