Help with debugging unexpected takeWhile behavior with large numbers in Haskell

First, an apology for the vague title, but I'm not sure exactly what I'm asking here (!).

After meeting with Haskell at the university, I recently started using it in anger, and so I work on problems

Any thoughts would be grateful, because I do not have enough experience to know where to start from this. Thanks for taking the time to take a look.

+3
source share
2 answers

haskell 2 : Int Integer. Integer . Int . Int isPrime 4000000000 Int . isPrime Integer -> Bool Integral a => a -> Bool (: , Integral Bool), .

, ( Int Integer), , 4000000000 , . , Int, Int ( 32- - ). , Integer, Integer ( ). , Integral, Integer, Integer Integral.

+10

(, , ) - " ".

, , :

isPrime :: Int -> Bool

An Int - "" Integer - ! - (, , , ), " 2" - Int, , ( 2 n, , 2 "" Int.

, , , Int - , . 64- , Int 64- , 2 ^ 63-1 2 ^ 31-1 . : 64- MS Windows, , 64- MinGW - 64-, GHC, , 32- , Int s 32 . Linux, , 64- , Int - 64 . , , , !

, , . ( Haskell, ....)

+1

Source: https://habr.com/ru/post/1753804/


All Articles