Bonjour j'étudis haskell et j'ai voulu écrire une petite fonction calculant les nombres premiers : http://pastebin.com/GdzZBGk2
Mais j'ai un probleme de convertion que je ne comprend pas?
dec.hs:10:22:
No instance for (RealFrac Integer)
arising from a use of `truncate' at dec.hs:10:22-40
Possible fix: add an instance declaration for (RealFrac Integer)
In the first argument of `toInteger', namely `(truncate (sqrt a))'
In the expression: toInteger (truncate (sqrt a))
In the definition of `max': max = toInteger (truncate (sqrt a))
dec.hs:10:33:
No instance for (Floating Integer)
arising from a use of `sqrt' at dec.hs:10:33-38
Possible fix: add an instance declaration for (Floating Integer)
In the first argument of `truncate', namely `(sqrt a)'
In the first argument of `toInteger', namely `(truncate (sqrt a))'
In the expression: toInteger (truncate (sqrt a))