3

刚刚安装了当前的 Haskell 平台2012.2.0.0,它说它使用base-4.5.0.0,并且base-4.5.0.0包含该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: libraries@haskell.org
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 平台应该可以使用它是错误的吗?或者我是否跳过了使其可用的步骤?

4

3 回答 3

4

您链接到的文档页面似乎有些可疑。您的GHC声称是7.4.1base-4.5.0.0,它似乎使用. 这是完全合理的,因为 GHC 7.4.1不支持 type literals,这与GHC 7.6.1不同。base-4.5.0.0GHC.TypeLits

于 2012-09-24T15:14:15.123 回答
2

是的,当前的 Haskell 平台不支持类型级文字。它们是在 GHC 7.6 中添加的

于 2012-09-24T15:13:21.350 回答
2

GHC.TypeLits从后面添加GHC 7.6http://www.haskell.org/ghc/docs/7.4.2/html/libraries/index.html http://www.haskell.org/ghc/docs/latest/html/libraries/index.html

于 2012-09-24T15:18:14.823 回答