logo       

Re: Interaction and ambiguous type variables: msg#00008

lang.haskell.glasgow.bugs

Subject: Re: Interaction and ambiguous type variables

Could this problem be solved by having interactive environments (ghci, Hugs)
extend the default rules so that they don't just apply for Num contexts but
also for Show contexts?

For example, with a default declaration

default ((), Integer, Double)

we would have the ambiguous type

show [] :: Show a => String

which would be resolved by choosing a=().

(Note that I'm using () instead of adding a new type 'Void'. This seems nicer
from a language-design viewpoint and I'd guess is nicer for someone trying to
teach Haskell.)

--
Alastair


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise