我正在尝试使用 GHC 编译以下代码:
module Test where
import Maybe
import Prelude hiding (null)
import System.IO
null = ()
main :: IO ()
main = putStrLn "Hello, world!"
如果我只是运行ghc Test.hs
,我会得到:
Could not find module `Maybe'
It is a member of the hidden package `haskell98-2.0.0.1'.
所以我尝试ghc -package haskell98 Test.hs
:
Ambiguous module name `Prelude':
it was found in multiple packages: base haskell98-2.0.0.1
这似乎不对,但我尝试ghc -package haskell98 -hide-package base Test.hs
:
Could not find module `System.IO'
It is a member of the hidden package `base'.
It is a member of the hidden package `haskell2010-1.1.0.1'.
那么我尝试ghc -package haskell98 -hide-package base -package haskell2010 Test.hs
:
Ambiguous module name `Prelude':
it was found in multiple packages:
haskell2010-1.1.0.1 haskell98-2.0.0.1
如何编译此代码?我正在使用 GHC 7.4.1。