[Haskell-beginners] typeOf raises Error

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Sun Jan 11 05:21:24 EST 2009


On 2009 Jan 11, at 5:27, Frank Schwidom wrote:
> "Integer", as i expected, but if i do so in code which is
> to compile, then there raises an error


Yes.  Numeric literals like 5 are actually read as (fromIntegral 5);  
then ghci applies defaulting to reduce it to Integer.  When compiled,  
you must resolve the polymorphism yourself.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Beginners mailing list