Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 foldl 和 foldr 创建了 Factorial 程序,如下所示。但是当我试图找到像 100000 这样的大数的阶乘时,它会给出:错误 - C 堆栈溢出
如果我使用产品功能,它会在很长一段时间后给我结果。
foldl (*) 1 [1..100000] product [1..100000]
为什么我会出现不同的行为?我是 Haskell 的新手,因此试图通过编写这样的程序来理解不同的概念。