首先,感谢您抽出宝贵时间回答我的问题。
首先,请快速查看我的代码。您不必了解代码,只需注意类型即可。
这会返回一个错误,上面写着,
Couldn't match expected type `Int' with actual type `Integer'
Expected type: [Int]
Actual type: [Integer]
In the first argument of `myfun', namely `primes'
In the expression: myfun primes
失败,加载模块:无。
如果我将类型更改为 Int 而不是 Integer,我可以成功运行此程序而不会出现错误,例如,“primes :: [Int]”
但是,我需要将其保持为整数,以使程序能够获取大量数字。
非常感谢您提前提供的帮助。