
21 Aug
2003
21 Aug
'03
5:36 p.m.
On Thursday 21 August 2003 23:23, Jon Cast wrote:
I can make such a declaration, but it still gets converted to Double.
How are you doing this? I'm not seeing the behavior you describe.
module Foo where x = 0.5 :: Fractional a => a Then I run "hugs Foo.hs" and get: Foo> :type x x :: Double Same with ghci. An even better illustration of my original problem is: module Foo where x = 0.5 :: Fractional a => a foo :: Fractional a => a -> a foo a = x*a This yields the error message ERROR "/home/hinsen/haskell/Foo.hs":6 - Inferred type is not general enough *** Expression : foo *** Expected type : Fractional a => a -> a *** Inferred type : Fractional Double => Double -> Double Konrad.