Ambiguos Types

Saswat Anand iscp9157@nus.edu.sg
Thu, 7 Jun 2001 12:16:28 +0800


Hi,
  I have 2 questions:

1- When I load the following module:

    module Foo() where
    default (Float)

    into ghci. 2+3 gives (5::Integer). Should it not give (5.0::Float). Hugs
does.

2. class Op a where
      (%+) :: a -> a -> a

   instance Op Integer where
     (%+) = (+)

   with the above code:  (2 %+ 3) should be resolved to Integer type. Could
anybody explain why it should not.

Thanks,
S