Re: [Haskell-cafe] ambiguous types although 'asTypeOf'

2007-12-27 Thread Henning Thielemann
On Tue, 25 Dec 2007, Felipe Lessa wrote: On Dec 25, 2007 4:27 PM, Henning Thielemann [EMAIL PROTECTED] wrote: test :: (Integral a, RealFrac a) = a test = let c = undefined in asTypeOf (round c) c When compiling I get: Compiling StorableInstance (

[Haskell-cafe] ambiguous types although 'asTypeOf'

2007-12-25 Thread Henning Thielemann
I thought I understand monomorphism restriction. But it seems, I don't. I have boilt down my problem to the following test. Don't try to make any sense of it, it is just the smallest code I could come up with. test :: (Integral a, RealFrac a) = a test = let c = undefined in asTypeOf

Re: [Haskell-cafe] ambiguous types although 'asTypeOf'

2007-12-25 Thread Andrea Vezzosi
As i understand it, the monomorphism restriction applies to constrained type variables, but c :: forall a. a, so it remains polymorphic and each of its uses can be instantiated to a different type. 2007/12/25, Henning Thielemann [EMAIL PROTECTED]: I thought I understand monomorphism

Re: [Haskell-cafe] ambiguous types although 'asTypeOf'

2007-12-25 Thread Felipe Lessa
On Dec 25, 2007 4:27 PM, Henning Thielemann [EMAIL PROTECTED] wrote: test :: (Integral a, RealFrac a) = a test = let c = undefined in asTypeOf (round c) c When compiling I get: Compiling StorableInstance ( src/StorableInstance.hs, interpreted ) src/StorableInstance.hs:38:17: