[Haskell-cafe] Type problems

Andrew Coppin andrewcoppin at btinternet.com
Sun Jul 25 08:12:03 EDT 2010


Ivan Miljenovic wrote:
> On 25 July 2010 05:50, Tobias Brandt <tob.brandt at googlemail.com> wrote:
>   
>> You have to fix the type of 1 and 6, e.g. by writing
>> x <- randomRIO (1, 6) :: IO Int
>> or
>> x <- randomRIO (1, 6 :: Int)
>>  GHCi defaults integral numbers to Int, that's why it works there.
>>     
>
> The default numeric type is Integer, not Int.
>   

Isn't there a "default" declaration where you can specify type defaulting?

At least, "default" appears to be a Haskell language keyword - much to 
my irritating the other day... ;-)



More information about the Haskell-Cafe mailing list