[prev in list] [next in list] [prev in thread] [next in thread]
List: haskell-cafe
Subject: Re: [Haskell-cafe] hugs type inference
From: Ross Paterson <ross () soi ! city ! ac ! uk>
Date: 2005-10-27 23:14:56
Message-ID: 20051027231456.GA25657 () soi ! city ! ac ! uk
[Download RAW message or body]
On Thu, Oct 27, 2005 at 11:02:48PM +0200, Christian Maeder wrote:
> Hugs.Base> :t toRational 1 / 2
> toRational 1 / 2 :: Real a => Ratio Integer
>
> ghci yields:
> Prelude> :t toRational 1 / 2
>
> <interactive>:1:0:
> Warning: Defaulting the following constraint(s) to type `Integer'
> `Real a' arising from use of `toRational' at
> <interactive>:1:0-9
> In the first argument of `(/)', namely `toRational 1'
> toRational 1 / 2 :: Rational
They're both telling you the same thing:
1 :: Num a => a
toRational 1 :: Real a => Rational
toRational 1 / 2 :: Real a => Rational
GHCi shows the type after defaulting; Hugs shows the type before, but
this can be changed with the +T option.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic