我正在尝试在 Real World Haskell - Chapter 24. LineCount.hs 中编译一些代码。
我没有对代码进行任何更改。
但是,当我这样做时:
ghc -O2 --make -threaded LineCount.hs
(按照书中的说明),我收到以下信息:
MapReduce.hs:6:7: Not in scope: `rnf'
我可能做错了什么?
快速搜索显示,过去并行和严格并发包存在一些问题,重新安装它们将解决问题。但是,我试过了,但没有奏效。此外,值得注意的是,该问题已在 2010 年某个时候得到修复: https ://groups.google.com/forum/?fromgroups=#!msg/happs/gOieP4xfpNc/nrasm842JlUJ
注意:编译同一章节中的其他文件时,我会遇到各种其他错误。例如,在编译 Strat.hs 时,我得到:Module Control.Parallel.Strategies' does not export
parZipWith'。在编译 LineChunks.hs 时,我得到:模块Control.Parallel.Strategies' does not export
rnf'。
老实说,作为一个新手 Haskell 程序员,一旦我开始修改代码,我预计会遇到麻烦——但我没想到会遇到书本上的代码问题!