Puzzling error

12 views
Skip to first unread message

Gregory Guthrie

unread,
Jun 21, 2012, 9:29:13 PM6/21/12
to lek...@googlegroups.com

I have this expression:

   n = sqrt(fromIntegral(1+8*s))

 

And it gives the error:

src\PairSums.hs:143:22:

    No instance for (Floating Int)

      arising from a use of `sqrt'

    Possible fix: add an instance declaration for (Floating Int)

    In the expression: sqrt (fromIntegral (1 + 8 * s))

    In an equation for `n': n = sqrt (fromIntegral (1 + 8 * s))

 

 

But the exact same thing in GHCi (7.4.1) works fine

    Let   n = sqrt(fromIntegral(1+8*s))

 

I didn’t know how to determine the GHC version used by Leksah to verify that they are the same,

but I also found that even simpler versions fail in Leksah:

       sqrt(fromIntegral(1))

 

src\PairSums.hs:143:22:

    No instance for (Floating Int)

      arising from a use of `sqrt'

    Possible fix: add an instance declaration for (Floating Int)

    In the expression: sqrt (fromIntegral (1))

    In an equation for `n': n = sqrt (fromIntegral (1))

 

What am I missing here???

Reply all
Reply to author
Forward
0 new messages