No safety in numbers
Fri, 22 Aug 2003 09:39:18 +1200
Konrad Hinsen writes:
| 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
x :: Fractional a => a
x = 0.5
instead. That way, the type signature is in the right place to
The other way is equivalent to
x = (0.5 :: Fractional a => a)
which only confirms a type which is inferred anyway
Prelude> :type 0.5
0.5 :: Fractional a => a
but does not count as a type signature for x.