[Haskell-cafe] Re: Why do functions not inherit class when renamed?
Tomáš Janoušek
tomi at nomi.cz
Thu Mar 19 19:55:29 EDT 2009
Hello,
On Thu, Mar 19, 2009 at 05:49:34PM -0600, Duane Johnson wrote:
> I'm not sure I understand what is going on here, but it seems to me that
> the following assignment of "mult = (*)" causes "mult" to lose out on some
> of the polymorphic behavior of (*). Is that right? If so, why?
This is the monomorphism restriction kicking in.
See http://www.haskell.org/haskellwiki/Monomorphism_restriction.
> Prelude> let (...) = (*)
> Prelude> :t (...)
> (...) :: Integer -> Integer -> Integer
>
> Prelude> :set -fno-monomorphism-restriction
> Prelude> let (...) = (*)
> Prelude> :t (...)
> (...) :: (Num a) => a -> a -> a
--
Tomáš Janoušek, a.k.a. Liskni_si, http://work.lisk.in/
More information about the Haskell-Cafe
mailing list