且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

ubuntu haskell ghci 7.4.1找不到模块"System.Random".

更新时间:2023-11-20 10:11:46

您必须安装随机一个>包.您可能可以从软件包管理器中获取它(例如 libghc-random-dev 之类的东西),也可以 cabal install random .

You must install the random package. You can probably get it from your package manager (as something like libghc-random-dev or similar), or you may cabal install random.

在2021年进行编辑如今, cabal install 成为了不可能.而是使用 cabal init 创建一个程序包,并在 build-depends 字段中列出 random .编译可以使用 cabal build (仅构建)或 cabal run (以执行结果)进行;可以通过 cabal repl 进行交互式使用.

Edit in 2021 These days, cabal install is not the way. Instead, use cabal init to create a package and list random in your build-depends field. Compilation can be performed with cabal build (just build) or cabal run (to execute the result); interactive use is available via cabal repl.