Marc van Dongen= <[EMAIL PROTECTED]> writes:

> [snip]
> 
> : > > module Main( main ) where
> : > > import List( genericLength )
> : > > main = putStr (show integral) >>
> : > >        putStr "\n"            >>
> : > >        return ()
> : > >      where integral = genericLength []
> 
> [snip]
>  
> : This is a legal Haskell program. The (ambiguous) type of `integral' is
> : (Num a => a), but Haskell disambiguates numeric expressions with the
> : help of `default' declarations. As per Haskell 1.4 (see section 4.3.4
> 
> Thanks for the pointer.
> 
> : of the report), this means resolving `integral' to be a value of type
> : Int.
> 
> I think this ``resolving'' may lead to unwanted results. It took
> me quite some time to discover that Integral was resolved to Int
> in some program I had. Is there a possibility of generating a warning
> message whenever programs like the one above have to be disambiguated?
> Maybe a compiler-switch to turn these warning messages on and off?

If you really don't like the default processing, you could use
  default ()
to disable it totally.

Carl Witty
[EMAIL PROTECTED]

Reply via email to