[Haskell-cafe] Can't explain this error

Dinh Tien Tuan Anh tuananhbirm at hotmail.com
Mon Jul 11 11:37:59 EDT 2005


  could anyone tell me what i did wrong with this please

sumHam :: Integer -> Float
sumHam n = sum [1/x | x<-[1..n]]

Error: type error in explicitly typed binding
**** Term:                 sumHam
**** Type:                  Integer -> Integer
**** Does not match : Integer -> Float




it only works if i remove the first line. Tried changing Float by Double and 
still not working

Pls help
Cheers

_________________________________________________________________
Be the first to hear what's new at MSN - sign up to our free newsletters! 
http://www.msn.co.uk/newsletters



More information about the Haskell-Cafe mailing list