如何使用runhaskell取消隐藏ghc库
我正在使用如何使用runhaskell取消隐藏ghc库,haskell,ghc,runhaskell,Haskell,Ghc,Runhaskell,我正在使用runhaskell构建简单脚本,并尝试使用ghc-7.10.2中的FastString。简单地说: import FastString main = putStrLn "Hello SO" 使用runhaskell Main.hs运行它会导致错误: Main.hs:1:8: Could not find module ‘FastString’ It is a member of the hidden package ‘ghc-7.10.2’. Use -v
runhaskell
构建简单脚本,并尝试使用ghc-7.10.2
中的FastString
。简单地说:
import FastString
main = putStrLn "Hello SO"
使用runhaskell Main.hs运行它会导致错误:
Main.hs:1:8:
Could not find module ‘FastString’
It is a member of the hidden package ‘ghc-7.10.2’.
Use -v to see a list of the files searched for.
我知道我可以用cabal
构建它,并将ghc
指定为依赖项,但我确实需要用runhaskell
来实现它
如何使用runhaskell
取消隐藏ghc库?TL;医生:
$ghc包装暴露ghc
嗯,runhaskell
基本上是runghc
的包装,而runghc
基本上是ghc
。它们都遵循相同的规则:它们只能从配置的数据库导入公开的包
使用ghc-pkg-descripe{package-name}
,可以获得关于某个包的信息。这里的重要字段是exposed
:
$ ghc-pkg describe ghc | grep expose
exposed: False
exposed-modules:
正如您所看到的,包没有公开(因此它是隐藏的)。使用ghc pkg expose
,您可以取消隐藏它:
$ ghc-pkg expose ghc
请记住,如果要更改系统范围包数据库的设置,则需要权限