[Haskell-cafe] Confusing type specialisation in ghci

Yitzchak Gale gale at sefer.org
Mon Oct 8 06:33:26 EDT 2007


David Carter wrote:
>>> Prelude> let sqlist = map sq
...
>>> Prelude> sqlist [2.5]
> >>
>>> <interactive>:1:8:
>>>    No instance for (Fractional Integer)
>>>    ... etc

Isaac Dupree wrote:
>> The dreaded Monomorphism Restriction...
>> You could... use `ghci -fno-monomorphism-restriction`.

> ...it's good to know the syndrome has a name and a prevention
> strategy, even if not a cure :-).

I put

:set -fno-monomorphism-restriction

in my .ghci file. That pretty much cures it for me.

-Yitz


More information about the Haskell-Cafe mailing list