[Haskell-cafe] ambiguous types although 'asTypeOf'
lemming at henning-thielemann.de
Thu Dec 27 16:55:13 EST 2007
On Tue, 25 Dec 2007, Felipe Lessa wrote:
> On Dec 25, 2007 4:27 PM, Henning Thielemann
> <lemming at henning-thielemann.de> 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:
> > Warning: Defaulting the following constraint(s) to type `Double'
> > `RealFrac a' arising from use of `round' at src/StorableInstance.hs:38:17-21
> > In the first argument of `asTypeOf', namely `(round c)'
> > In the definition of `test1': test1 = let c = undefined in asTypeOf (round c) c
> Interesting, I don't see this behaviour at all.
Of course, I use -Wall all the time. :-)
More information about the Haskell-Cafe