2012-09-24 221 views
3

刚刚安装了当前的Haskell平台2012.2.0.0, which says it uses base-4.5.0.0base-4.5.0.0 includes the GHC.TypeLits module无法加载GHC.TypeLits模块

但是,当我尝试加载GHC.TypeLitsghc无法找到它:

% ghci --version       
The Glorious Glasgow Haskell Compilation System, version 7.4.1 
% ghci 
GHCi, version 7.4.1: http://www.haskell.org/ghc/ :? for help 
Loading package ghc-prim ... linking ... done. 
Loading package integer-gmp ... linking ... done. 
Loading package base ... linking ... done. 
Prelude> :m +GHC.TypeLits 

<no location info>: 
    Could not find module `GHC.TypeLits' 
    Perhaps you meant GHC.Types (from ghc-prim) 
Prelude> 
% ghc-pkg list base 
/Library/Frameworks/GHC.framework/Versions/7.4.1-i386/usr/lib/ghc-7.4.1/package.conf.d 
    base-4.5.0.0 
% ghc-pkg describe base 
name: base 
version: 4.5.0.0 
id: base-4.5.0.0-a732a3518af7589b6c46f83e8ceae384 
license: BSD3 
copyright: 
maintainer: [email protected] 
stability: 
homepage: 
package-url: 
synopsis: Basic libraries 
description: This package contains the Prelude and its support libraries, 
      and a large collection of useful libraries ranging from data 
      structures to parsing combinators and debugging utilities. 
category: 
author: 
exposed: True 
exposed-modules: Foreign.Concurrent GHC.Arr GHC.Base GHC.Conc 
       GHC.Conc.IO GHC.Conc.Signal GHC.Conc.Sync GHC.ConsoleHandler 
       GHC.Constants GHC.Desugar GHC.Enum GHC.Environment GHC.Err 
       GHC.Exception GHC.Exts GHC.Fingerprint GHC.Fingerprint.Type 
       GHC.Float GHC.Float.ConversionUtils GHC.Float.RealFracMethods 
       GHC.Foreign GHC.ForeignPtr GHC.Handle GHC.IO GHC.IO.Buffer 
       GHC.IO.BufferedIO GHC.IO.Device GHC.IO.Encoding 
       GHC.IO.Encoding.CodePage GHC.IO.Encoding.Failure 
       GHC.IO.Encoding.Iconv GHC.IO.Encoding.Latin1 GHC.IO.Encoding.Types 
       GHC.IO.Encoding.UTF16 GHC.IO.Encoding.UTF32 GHC.IO.Encoding.UTF8 
       GHC.IO.Exception GHC.IO.FD GHC.IO.Handle GHC.IO.Handle.FD 
       GHC.IO.Handle.Internals GHC.IO.Handle.Text GHC.IO.Handle.Types 
       GHC.IO.IOMode GHC.IOArray GHC.IOBase GHC.IORef GHC.Int GHC.List 
       GHC.MVar GHC.Num GHC.PArr GHC.Pack GHC.Ptr GHC.Read GHC.Real GHC.ST 
       GHC.Stack GHC.Stats GHC.Show GHC.Stable GHC.Storable GHC.STRef 
       GHC.TopHandler GHC.Unicode GHC.Weak GHC.Word System.Timeout 
       GHC.Event Control.Applicative Control.Arrow Control.Category 
       Control.Concurrent Control.Concurrent.Chan Control.Concurrent.MVar 
       Control.Concurrent.QSem Control.Concurrent.QSemN 
       Control.Concurrent.SampleVar Control.Exception 
       Control.Exception.Base Control.OldException Control.Monad 
       Control.Monad.Fix Control.Monad.Instances Control.Monad.ST 
       Control.Monad.ST.Safe Control.Monad.ST.Unsafe Control.Monad.ST.Lazy 
       Control.Monad.ST.Lazy.Safe Control.Monad.ST.Lazy.Unsafe 
       Control.Monad.ST.Strict Control.Monad.Zip Data.Bits Data.Bool 
       Data.Char Data.Complex Data.Dynamic Data.Either Data.Eq Data.Data 
       Data.Fixed Data.Foldable Data.Function Data.Functor Data.HashTable 
       Data.IORef Data.Int Data.Ix Data.List Data.Maybe Data.Monoid 
       Data.Ord Data.Ratio Data.STRef Data.STRef.Lazy Data.STRef.Strict 
       Data.String Data.Traversable Data.Tuple Data.Typeable 
       Data.Typeable.Internal Data.Unique Data.Version Data.Word 
       Debug.Trace Foreign Foreign.C Foreign.C.Error Foreign.C.String 
       Foreign.C.Types Foreign.ForeignPtr Foreign.ForeignPtr.Safe 
       Foreign.ForeignPtr.Unsafe Foreign.Marshal Foreign.Marshal.Alloc 
       Foreign.Marshal.Array Foreign.Marshal.Error Foreign.Marshal.Pool 
       Foreign.Marshal.Safe Foreign.Marshal.Utils Foreign.Marshal.Unsafe 
       Foreign.Ptr Foreign.Safe Foreign.StablePtr Foreign.Storable Numeric 
       Prelude System.Console.GetOpt System.CPUTime System.Environment 
       System.Exit System.IO System.IO.Error System.IO.Unsafe System.Info 
       System.Mem System.Mem.StableName System.Mem.Weak 
       System.Posix.Internals System.Posix.Types 
       Text.ParserCombinators.ReadP Text.ParserCombinators.ReadPrec 
       Text.Printf Text.Read Text.Read.Lex Text.Show Text.Show.Functions 
       Unsafe.Coerce 
hidden-modules: GHC.Event.Array GHC.Event.Clock GHC.Event.Control 
       GHC.Event.EPoll GHC.Event.IntMap GHC.Event.Internal 
       GHC.Event.KQueue GHC.Event.Manager GHC.Event.PSQ GHC.Event.Poll 
       GHC.Event.Thread GHC.Event.Unique Control.Monad.ST.Imp 
       Control.Monad.ST.Lazy.Imp Foreign.ForeignPtr.Imp 
trusted: False 
import-dirs: /Library/Frameworks/GHC.framework/Versions/7.4.1-i386/usr/lib/ghc-7.4.1/base-4.5.0.0 
library-dirs: /Library/Frameworks/GHC.framework/Versions/7.4.1-i386/usr/lib/ghc-7.4.1/base-4.5.0.0 
hs-libraries: HSbase-4.5.0.0 
extra-libraries: iconv 
extra-ghci-libraries: 
include-dirs: /Library/Frameworks/GHC.framework/Versions/7.4.1-i386/usr/lib/ghc-7.4.1/base-4.5.0.0/include 
includes: HsBase.h 
depends: ghc-prim-0.2.0.0-bd29cb1ca1b712d64e00ac9207f87d0a 
     integer-gmp-0.4.0.0-ec87c5d9609a1d46da031ef5d51c4f79 builtin_rts 
hugs-options: 
cc-options: 
ld-options: 
framework-dirs: 
frameworks: 
haddock-interfaces: /Library/Frameworks/GHC.framework/Versions/7.4.1-i386/usr/share/doc/ghc/html/libraries/base-4.5.0.0/base.haddock 
haddock-html: /Library/Frameworks/GHC.framework/Versions/7.4.1-i386/usr/share/doc/ghc/html/libraries/base-4.5.0.0 
pkgroot: "/Library/Frameworks/GHC.framework/Versions/7.4.1-i386/usr/lib/ghc-7.4.1" 
% 

那么这是怎么回事?我错误地认为GHC.TypeLits应该与当前的Haskell平台一起使用吗?或者,我是否需要跳过一个步骤才能使它可用?

+2

在GHC网站上的文档似乎已经从开发分支,而不是发布分支产生。 –

回答

4

东西似乎与您链接到的文档页面鱼腥味。您的GHC声称是7.4.1,似乎确实使用base-4.5.0.0,并且the GHC library documentationthe Hackage page均显示base-4.5.0.0不包括GHC.TypeLits。这是完全合理的,因为GHC 7.4.1 doesn't support type literals,不像GHC 7.6.1

+1

好的,文档很腥,使整个事情变得有意义。 – rampion

+0

@rampion:我注意到你链接到的所谓'base-4.5.0.0'好像还包含'base-4.6.0.0'中的其他更改,例如删除'Bits'上的'Num'约束和导出'readEither'和'readMaybe'。 –