在 Windows 7 上安装 Haskell 模块

发布于 2024-10-20 15:59:00 字数 11446 浏览 1 评论 0原文

昨天我尝试通过 cabal 安装 Haskell 模块,以便熟悉 Haskell 中模块的安装。我必须先安装 cabal。

我的系统:Windows 7

Haskell-编译器版本:GHC 7.0.2(链接http://www.haskell.org /ghc/download

阴谋集团:http://haskell.org/cabal/download.html< /a>

我将一步步描述这个过程,希望您能指出我在 cabal 和 cabal 软件包安装过程中的错误行为。

过程:

  1. 安装Haskell编译器GHC 7.0.2

    从 Windows 7 开始菜单启动 GHCi,在 DOS 窗口中给出以下输出:

    GHCi,版本 7.0.2:网站:?寻求帮助。
    正在加载包 ghc-prim ...链接...完成。
    正在加载包integer-gmp ...链接...完成。
    正在加载包基础...链接...完成。
    正在加载包 ffi-1.0 ...链接...完成。
    前奏>                                                 
    

    到目前为止一切顺利:基础包中的每个功能都可以访问并且按照其应有的方式运行。

    结论:GHCi 安装不包含错误步骤。

  2. 从源代码下载cabal.exe(参见简介),将其复制到C:\ghc\ghc-7.0.2\bin(添加到%Path%-variables中)

  3. 下载cabal -install-0.8.2.tar.gz 因为该网站建议用户全新安装需要该软件包。
  4. 打开新的 dos 提示符窗口
  5. 键入 cabal update (根据站点的建议),它确实更新了列表并返回到用户提示模式
  6. 键入 cd C:\pathwhere\cabal-install-0.8.2 .tar.gz(切换到 cabal-install 文件所在的目录)
  7. 输入 cabal install cabal-install-0.8.2,此后安装开始创建以下输出在dos框中:

    正在解决依赖关系...
    正在下载容器-0.3.0.0...
    配置容器-0.3.0.0...
    预处理库容器-0.3.0.0...
    构建容器-0.3.0.0...
    [1 of 7] 编译 Data.Sequence ( Data\Sequence.hs, dist\build\Data\Sequence.o )
    [2 of 7] 编译 Data.Set ( Data\Set.hs, dist\build\Data\Set.o )
    [3 of 7] 编译 Data.Map ( Data\Map.hs, dist\build\Data\Map.o )
    [4 of 7] 编译 Data.IntSet ( Data\IntSet.hs, dist\build\Data\IntSet.o )
    [5 of 7] 编译 Data.IntMap ( Data\IntMap.hs, dist\build\Data\IntMap.o )
    [6 of 7] 编译 Data.Tree ( Data\Tree.hs, dist\build\Data\Tree.o )
    [7 of 7] 编译 Data.Graph ( Data\Graph.hs, dist\build\Data\Graph.o )
    cabal: ar 是必需的,但找不到。
    正在下载文件路径-1.1.0.4...
    正在配置文件路径-1.1.0.4...
    预处理库文件路径-1.1.0.4...
    正在构建文件路径-1.1.0.4...
    [1 of 3] 编译 System.FilePath.Posix ( System\FilePath\Posix.hs, dist\build\System\FilePath\Posix.o )
    [2 of 3] 编译 System.FilePath.Windows ( System\FilePath\Windows.hs, dist\build\System\FilePath\Windows.o )
    [3 of 3] 编译 System.FilePath ( System\FilePath.hs, dist\build\System\FilePath.o )
    cabal: ar 是必需的,但找不到。
    正在下载parsec-2.1.0.1...
    配置parsec-2.1.0.1...
    预处理库parsec-2.1.0.1...
    构建parsec-2.1.0.1...
    [ 1 of 10] 编译 Text.ParserCombinators.Parsec.Pos ( Text\ParserCombinators\Parsec\Pos.hs, dist\build\Text\ParserCombinators\Parsec\Pos.o )
    [ 2 of 10] 编译 Text.ParserCombinators.Parsec.Error ( Text\ParserCombinators\Parsec\Error.hs, dist\build\Text\ParserCombinators\Parsec\Error.o )
    [ 3 of 10] 编译 Text.ParserCombinators.Parsec.Prim ( Text\ParserCombinators\Parsec\Prim.hs, dist\build\Text\ParserCombinators\Parsec\Prim.o )
    [ 4 of 10] 编译 Text.ParserCombinators.Parsec.Char ( Text\ParserCombinators\Parsec\Char.hs, dist\build\Text\ParserCombinators\Parsec\Char.o )
    [ 5 of 10] 编译 Text.ParserCombinators.Parsec.Combinator ( Text\ParserCombinators\Parsec\Combinator.hs, dist\build\Text\ParserCombinators\Parsec\Combinator.o )
    [ 6 of 10] 编译 Text.ParserCombinators.Parsec.Expr ( Text\ParserCombinators\Parsec\Expr.hs, dist\build\Text\ParserCombinators\Parsec\Expr.o )
    [ 7 of 10] 编译 Text.ParserCombinators.Parsec ( Text\ParserCombinators\Parsec.hs, dist\build\Text\ParserCombinators\Parsec.o )
    [ 8 of 10] 编译 Text.ParserCombinators.Parsec.Token ( Text\ParserCombinators\Parsec\Token.hs, dist\build\Text\ParserCombinators\Parsec\Token.o )
    [ 9 of 10] 编译 Text.ParserCombinators.Parsec.Perm ( Text\ParserCombinators\Parsec\Perm.hs, dist\build\Text\ParserCombinators\Parsec\Perm.o )
    [10 of 10] 编译 Text.ParserCombinators.Parsec.Language ( Text\ParserCombinators\Parsec\Language.hs, dist\build\Text\ParserCombinators\Parsec\Language.o )
    cabal: ar 是必需的,但找不到。
    下载时间-1.1.4...
    [1 of 1] 编译主程序 ( C:\Users\altug\AppData\Local\Temp\time-1.1.43528time-1.1.4\Setup.hs、C:\Users\altug\AppData\Local\Temp\time- 1.1.43528\time-1.1.4\dist\setup\Main.o )
    C:\Users\altug\AppData\Local\Temp\time-1.1.43528\time-1.1.4\Setup.hs:5:1:
        警告:在使用“runTests”时
                 (从 Distribution.Simple 导入,但在 Distribution.Simple.UserHooks 中定义):
                 已弃用:“请改用新的测试界面!”
    链接 C:\Users\altug\AppData\Local\Temp\time-1.1.43528\time-1.1.4\dist\setup\setup.exe ...
    配置时间-1.1.4...
    预处理库时间-1.1.4...
    构建时间-1.1.4...
    [ 1 of 24] 编译 Data.Time.Clock.CTimeval ( Data\Time\Clock\CTimeval.hs, dist\build\Data\Time\Clock\CTimeval.o )
    [ 2 of 24] 编译 Data.Time.Clock.Scale ( Data\Time\Clock\Scale.hs, dist\build\Data\Time\Clock\Scale.o )
    [ 3 of 24] 编译 Data.Time.Calendar.Private ( Data\Time\Calendar\Private.hs, dist\build\Data\Time\Calendar\Private.o )
    [ 4 of 24] 编译 Data.Time.Calendar.MonthDay ( Data\Time\Calendar\MonthDay.hs, dist\build\Data\Time\Calendar\MonthDay.o )
    [ 5 of 24] 编译 Data.Time.Calendar.Days ( Data\Time\Calendar\Days.hs, dist\build\Data\Time\Calendar\Days.o )
    [ 6 of 24] 编译 Data.Time.Calendar.OrdinalDate ( Data\Time\Calendar\OrdinalDate.hs, dist\build\Data\Time\Calendar\OrdinalDate.o )
    [ 7 of 24] 编译 Data.Time.Calendar.Gregorian ( Data\Time\Calendar\Gregorian.hs, dist\build\Data\Time\Calendar\Gregorian.o )
    [ 8 of 24] 编译 Data.Time.Calendar.WeekDate ( Data\Time\Calendar\WeekDate.hs, dist\build\Data\Time\Calendar\WeekDate.o )
    [ 9 of 24] 编译 Data.Time.Calendar.JulianYearDay ( Data\Time\Calendar\JulianYearDay.hs, dist\build\Data\Time\Calendar\JulianYearDay.o )
    [10 of 24] 编译 Data.Time.Calendar.Julian ( Data\Time\Calendar\Julian.hs, dist\build\Data\Time\Calendar\Julian.o )
    [11 of 24] 编译 Data.Time.Clock.UTC ( Data\Time\Clock\UTC.hs, dist\build\Data\Time\Clock\UTC.o )
    [12 of 24] 编译 Data.Time.Clock.POSIX ( Data\Time\Clock\POSIX.hs, dist\build\Data\Time\Clock\POSIX.o )
    [13 of 24] 编译 Data.Time.Clock.UTCDiff ( Data\Time\Clock\UTCDiff.hs, dist\build\Data\Time\Clock\UTCDiff.o )
    [14 of 24] 编译 Data.Time.Clock ( Data\Time\Clock.hs, dist\build\Data\Time\Clock.o )
    [15 of 24] 编译 Data.Time.LocalTime.TimeZone ( Data\Time\LocalTime\TimeZone.hs, dist\build\Data\Time\LocalTime\TimeZone.o )
    [16 of 24] 编译 Data.Time.LocalTime.TimeOfDay ( Data\Time\LocalTime\TimeOfDay.hs, dist\build\Data\Time\LocalTime\TimeOfDay.o )
    [17 of 24] 编译 Data.Time.Calendar ( Data\Time\Calendar.hs, dist\build\Data\Time\Calendar.o )
    [18 of 24] 编译 Data.Time.Calendar.Easter ( Data\Time\Calendar\Easter.hs, dist\build\Data\Time\Calendar\Easter.o )
    [19 of 24] 编译 Data.Time.LocalTime.LocalTime ( Data\Time\LocalTime\LocalTime.hs, dist\build\Data\Time\LocalTime\LocalTime.o )
    [20 of 24] 编译 Data.Time.LocalTime ( Data\Time\LocalTime.hs, dist\build\Data\Time\LocalTime.o )
    [21 of 24] 编译 Data.Time.Clock.TAI ( Data\Time\Clock\TAI.hs, dist\build\Data\Time\Clock\TAI.o )
    [22 of 24] 编译 Data.Time.Format.Parse ( Data\Time\Format\Parse.hs, dist\build\Data\Time\Format\Parse.o )
    [23 of 24] 编译 Data.Time.Format ( Data\Time\Format.hs, dist\build\Data\Time\Format.o )
    [24 of 24] 编译 Data.Time ( Data\Time.hs, dist\build\Data\Time.o )
    注册时间-1.1.4...
    安装库在
    C:\Users\altug\AppData\Roaming\cabal\time-1.1.4\ghc-7.0.2
    注册时间-1.1.4...
    正在下载随机-1.0.0.3...
    配置随机-1.0.0.3...
    预处理库 random-1.0.0.3...
    构建随机-1.0.0.3...
    [1 of 1] 编译 System.Random ( System\Random.hs, dist\build\System\Random.o )
    cabal: ar 是必需的,但找不到。
    正在下载变压器-0.2.2.0...
    配置 Transformer-0.2.2.0...
    预处理库 Transformers-0.2.2.0...
    建筑变压器-0.2.2.0...
    [ 1 of 21] 编译 Data.Functor.Product ( Data\Functor\Product.hs, dist\buildData\Functor\Product.o )
    [ 2 of 21] 编译 Data.Functor.Constant ( Data\Functor\Constant.hs, dist\build\Data\Functor\Constant.o )
    [ 3 of 21] 编译 Data.Functor.Compose ( Data\Functor\Compose.hs, dist\build\Data\Functor\Compose.o )
    [ 4 of 21] 编译 Data.Functor.Identity ( Data\Functor\Identity.hs, dist\build\Data\Functor\Identity.o )
    [ 5 of 21] 编译 Control.Monad.Trans.Class ( Control\Monad\Trans\Class.hs, dist\build\Control\Monad\Trans\Class.o )
    [ 6 of 21] 编译 Control.Monad.IO.Class ( Control\Monad\IO\Class.hs, dist\build\Control\Monad\IO\Class.o )
    [ 7 of 21] 编译 Control.Monad.Trans.Cont ( Control\Monad\Trans\Cont.hs, dist\build\Control\Monad\Trans\Cont.o )
    [ 8 of 21] 编译 Control.Monad.Trans.Error ( Control\Monad\Trans\Error.hs, dist\build\Control\Monad\Trans\Error.o )
    [ 9 of 21] 编译 Control.Monad.Trans.Identity ( Control\Monad\Trans\Identity.hs, dist\build\Control\Monad\Trans\Identity.o )
    [10 of 21] 编译 Control.Monad.Trans.List ( Control\Monad\Trans\List.hs, dist\build\Control\Monad\Trans\List.o )
    [11 of 21] 编译 Control.Monad.Trans.Maybe ( Control\Monad\Trans\Maybe.hs, dist\build\Control\Monad\Trans\Maybe.o )
    [12 of 21] 编译 Control.Monad.Trans.Reader ( Control\Monad\Trans\Reader.hs, dist\build\Control\Monad\Trans\Reader.o )
    [13 of 21] 编译 Control.Monad.Trans.RWS.Lazy ( Control\Monad\Trans\RWS\Lazy.hs, dist\build\Control\Monad\Trans\RWS\Lazy.o )
    [14 of 21] 编译 Control.Monad.Trans.RWS ( Control\Monad\Trans\RWS.hs, dist\build\Control\Monad\Trans\RWS.o )
    [15 of 21] 编译 Control.Monad.Trans.RWS.Strict ( Control\Monad\Trans\RWS\Strict.hs, dist\build\Control\Monad\Trans\RWS\Strict.o )
    [16 of 21] 编译 Control.Monad.Trans.State.Lazy ( Control\Monad\Trans\State\Lazy.hs, dist\build\Control\Monad\Trans\State\Lazy.o )
    [17 of 21] 编译 Control.Monad.Trans.State ( Control\Monad\Trans\State.hs, dist\build\Control\Monad\Trans\State.o )
    [18 of 21] 编译 Control.Monad.Trans.State.Strict ( Control\Monad\Trans\State\Strict.hs, dist\build\Control\Monad\Trans\State\Strict.o )
    [19 of 21] 编译 Control.Monad.Trans.Writer.Lazy ( Control\Monad\Trans\Writer\Lazy.hs, dist\build\Control\Monad\Trans\Writer\Lazy.o )
    [20 of 21] 编译 Control.Monad.Trans.Writer ( Control\Monad\Trans\Writer.hs, dist\build\Control\Monad\Trans\Writer.o )
    [21 of 21] 编译 Control.Monad.Trans.Writer.Strict ( Control\Monad\Trans\Writer\Strict.hs, dist\build\Control\Monad\Trans\Writer\Strict.o )
    cabal: ar 是必需的,但找不到。
    正在下载 zlib-0.5.3.1...
    配置 zlib-0.5.3.1...
    预处理库zlib-0.5.3.1...
    构建 zlib-0.5.3.1...
    [1 of 5] 编译 Codec.Compression.Zlib.Stream ( dist\build\Codec\Compression\Zlib\Stream.hs, dist\build\Codec\Compression\Zlib\Stream.o )
    [2 of 5] 编译 Codec.Compression.Zlib.Internal ( Codec\Compression\Zlib\Internal.hs, dist\build\Codec\Compression\Zlib\Internal.o )
    [3 of 5] 编译 Codec.Compression.Zlib.Raw ( Codec\Compression\Zlib\Raw.hs, dist\build\Codec\Compression\Zlib\Raw.o )
    [4 of 5] 编译 Codec.Compression.Zlib ( Codec\Compression\Zlib.hs, dist\build\Codec\ Compression\Zlib.o )
    [5 of 5] 编译 Codec.Compression.GZip ( Codec\Compression\GZip.hs, dist\build\Codec\Compression\GZip.o )
    cabal: ar 是必需的,但找不到。
    cabal:错误:某些软件包安装失败:
    Cabal-1.8.0.6 依赖于 filepath-1.1.0.4,但安装失败。
    HTTP-4000.1.1 依赖于 Transformers-0.2.2.0,但安装失败。
    cabal-install-0.8.2 依赖于 zlib-0.5.3.1,但安装失败。
    Containers-0.3.0.0 在构建阶段失败。例外的是:
    退出失败1
    Directory-1.0.1.2 依赖于 filepath-1.1.0.4,但安装失败。
    filepath-1.1.0.4 在构建阶段失败。例外的是:
    退出失败1
    mtl-2.0.1.0依赖于transformers-0.2.2.0,但安装失败。
    network-2.3.0.2 依赖于未能安装的 parsec-2.1.0.1。
    parsec-2.1.0.1 在构建阶段失败。例外的是:
    退出失败1
    process-1.0.1.5 依赖于 filepath-1.1.0.4,但安装失败。
    random-1.0.0.3 在构建阶段失败。例外的是:
    退出失败1
    Transformer-0.2.2.0 在构建阶段失败。例外的是:
    退出失败1
    zlib-0.5.3.1 在构建阶段失败。例外的是:
    退出失败1
    

    我的结论:

    正如人们所看到的,输出表明了一些错误,但我不知道它们的含义。我继续尝试安装我的代数包,重点是使其可用于步骤 1 中的 Dos-Interpeter。

  8. 再次在 dos-box 输入提示中,我输入 cabal install constructive-algebra,这创建了这个输出:

    正在解决依赖关系...
    cabal:无法配置 algebra-0.0.0.1。它要求基数>=3.0 && <4.1
    对于base的依赖度>=3.0&& <4.1 有这些包:
    base-3.0.3.1、base-3.0.3.2 和 base-4.0.0.0。然而,它们都不可用。
    由于顶级依赖项 base -any,base-3.0.3.1 被排除
    由于顶级依赖项 base -any,base-3.0.3.2 被排除
    由于顶级依赖项 base -any,base-4.0.0.0 被排除
    

我认为该软件包尚未安装。我需要有人可以解释我需要执行哪些具体步骤才能使模块正常工作。

感谢您阅读这篇文章并以让我理解它以及解释器和编译器工作的方式回答。

Yesterday I tried to install a Haskell-module via cabal, in order to get aquainted with the installation of modules in Haskell. I had to install cabal first.

My System: Windows 7

Haskell-Compiler Version: GHC 7.0.2 (Link http://www.haskell.org/ghc/download)

Cabal: http://haskell.org/cabal/download.html

I will describe the process step by step, hoping that you may specify my wrong doings during both cabal and the package installation with cabal.

The procedure:

  1. Installed Haskell Compiler GHC 7.0.2

    Starting GHCi it from the Windows 7 start menu, gives following output in a DOS-window:

    GHCi, version 7.0.2: Website  :? for help .
    Loading package ghc-prim ... linking ... done.
    Loading package integer-gmp ... linking ... done.
    Loading package base ... linking ... done.
    Loading package ffi-1.0 ... linking ... done.
    Prelude>                                                 
    

    So far so good: Every function inside the base packages is accessible and functions just the way its supposed to.

    Conclusion: The GHCi installation contains no erroneous steps.

  2. Downloaded cabal.exe from source (see introduction), copied it into C:\ghc\ghc-7.0.2\bin (which is added into %Path%-variables)

  3. Downloaded cabal-install-0.8.2.tar.gz as the site advises users that the packeage is needed for a clean install.
  4. Opened new dos prompt window
  5. Typed cabal update (as advised by site), it did update the list and returned to user prompt mode
  6. Typed cd C:\pathwhere\cabal-install-0.8.2.tar.gz (switched into the directory where the cabal-install file is located)
  7. Typed cabal install cabal-install-0.8.2, thereafter the installation started creating following output in the dos-box:

    Resolving dependencies...
    Downloading containers-0.3.0.0...
    Configuring containers-0.3.0.0...
    Preprocessing library containers-0.3.0.0...
    Building containers-0.3.0.0...
    [1 of 7] Compiling Data.Sequence    ( Data\Sequence.hs, dist\build\Data\Sequence.o )
    [2 of 7] Compiling Data.Set         ( Data\Set.hs, dist\build\Data\Set.o )
    [3 of 7] Compiling Data.Map         ( Data\Map.hs, dist\build\Data\Map.o )
    [4 of 7] Compiling Data.IntSet      ( Data\IntSet.hs, dist\build\Data\IntSet.o )
    [5 of 7] Compiling Data.IntMap      ( Data\IntMap.hs, dist\build\Data\IntMap.o )
    [6 of 7] Compiling Data.Tree        ( Data\Tree.hs, dist\build\Data\Tree.o )
    [7 of 7] Compiling Data.Graph       ( Data\Graph.hs, dist\build\Data\Graph.o )
    cabal: ar is required but it could not be found.
    Downloading filepath-1.1.0.4...
    Configuring filepath-1.1.0.4...
    Preprocessing library filepath-1.1.0.4...
    Building filepath-1.1.0.4...
    [1 of 3] Compiling System.FilePath.Posix ( System\FilePath\Posix.hs, dist\build\System\FilePath\Posix.o )
    [2 of 3] Compiling System.FilePath.Windows ( System\FilePath\Windows.hs, dist\build\System\FilePath\Windows.o )
    [3 of 3] Compiling System.FilePath  ( System\FilePath.hs, dist\build\System\FilePath.o )
    cabal: ar is required but it could not be found.
    Downloading parsec-2.1.0.1...
    Configuring parsec-2.1.0.1...
    Preprocessing library parsec-2.1.0.1...
    Building parsec-2.1.0.1...
    [ 1 of 10] Compiling Text.ParserCombinators.Parsec.Pos ( Text\ParserCombinators\Parsec\Pos.hs, dist\build\Text\ParserCombinators\Parsec\Pos.o )
    [ 2 of 10] Compiling Text.ParserCombinators.Parsec.Error ( Text\ParserCombinators\Parsec\Error.hs, dist\build\Text\ParserCombinators\Parsec\Error.o )
    [ 3 of 10] Compiling Text.ParserCombinators.Parsec.Prim ( Text\ParserCombinators\Parsec\Prim.hs, dist\build\Text\ParserCombinators\Parsec\Prim.o )
    [ 4 of 10] Compiling Text.ParserCombinators.Parsec.Char ( Text\ParserCombinators\Parsec\Char.hs, dist\build\Text\ParserCombinators\Parsec\Char.o )
    [ 5 of 10] Compiling Text.ParserCombinators.Parsec.Combinator ( Text\ParserCombinators\Parsec\Combinator.hs, dist\build\Text\ParserCombinators\Parsec\Combinator.o )
    [ 6 of 10] Compiling Text.ParserCombinators.Parsec.Expr ( Text\ParserCombinators\Parsec\Expr.hs, dist\build\Text\ParserCombinators\Parsec\Expr.o )
    [ 7 of 10] Compiling Text.ParserCombinators.Parsec ( Text\ParserCombinators\Parsec.hs, dist\build\Text\ParserCombinators\Parsec.o )
    [ 8 of 10] Compiling Text.ParserCombinators.Parsec.Token ( Text\ParserCombinators\Parsec\Token.hs, dist\build\Text\ParserCombinators\Parsec\Token.o )
    [ 9 of 10] Compiling Text.ParserCombinators.Parsec.Perm ( Text\ParserCombinators\Parsec\Perm.hs, dist\build\Text\ParserCombinators\Parsec\Perm.o )
    [10 of 10] Compiling Text.ParserCombinators.Parsec.Language ( Text\ParserCombinators\Parsec\Language.hs, dist\build\Text\ParserCombinators\Parsec\Language.o )
    cabal: ar is required but it could not be found.
    Downloading time-1.1.4...
    [1 of 1] Compiling Main             ( C:\Users\altug\AppData\Local\Temp\time-1.1.43528time-1.1.4\Setup.hs, C:\Users\altug\AppData\Local\Temp\time-1.1.43528\time-1.1.4\dist\setup\Main.o )
    C:\Users\altug\AppData\Local\Temp\time-1.1.43528\time-1.1.4\Setup.hs:5:1:
        Warning: In the use of `runTests'
                 (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
                 Deprecated: "Please use the new testing interface instead!"
    Linking C:\Users\altug\AppData\Local\Temp\time-1.1.43528\time-1.1.4\dist\setup\setup.exe ...
    Configuring time-1.1.4...
    Preprocessing library time-1.1.4...
    Building time-1.1.4...
    [ 1 of 24] Compiling Data.Time.Clock.CTimeval ( Data\Time\Clock\CTimeval.hs, dist\build\Data\Time\Clock\CTimeval.o )
    [ 2 of 24] Compiling Data.Time.Clock.Scale ( Data\Time\Clock\Scale.hs, dist\build\Data\Time\Clock\Scale.o )
    [ 3 of 24] Compiling Data.Time.Calendar.Private ( Data\Time\Calendar\Private.hs, dist\build\Data\Time\Calendar\Private.o )
    [ 4 of 24] Compiling Data.Time.Calendar.MonthDay ( Data\Time\Calendar\MonthDay.hs, dist\build\Data\Time\Calendar\MonthDay.o )
    [ 5 of 24] Compiling Data.Time.Calendar.Days ( Data\Time\Calendar\Days.hs, dist\build\Data\Time\Calendar\Days.o )
    [ 6 of 24] Compiling Data.Time.Calendar.OrdinalDate ( Data\Time\Calendar\OrdinalDate.hs, dist\build\Data\Time\Calendar\OrdinalDate.o )
    [ 7 of 24] Compiling Data.Time.Calendar.Gregorian ( Data\Time\Calendar\Gregorian.hs, dist\build\Data\Time\Calendar\Gregorian.o )
    [ 8 of 24] Compiling Data.Time.Calendar.WeekDate ( Data\Time\Calendar\WeekDate.hs, dist\build\Data\Time\Calendar\WeekDate.o )
    [ 9 of 24] Compiling Data.Time.Calendar.JulianYearDay ( Data\Time\Calendar\JulianYearDay.hs, dist\build\Data\Time\Calendar\JulianYearDay.o )
    [10 of 24] Compiling Data.Time.Calendar.Julian ( Data\Time\Calendar\Julian.hs, dist\build\Data\Time\Calendar\Julian.o )
    [11 of 24] Compiling Data.Time.Clock.UTC ( Data\Time\Clock\UTC.hs, dist\build\Data\Time\Clock\UTC.o )
    [12 of 24] Compiling Data.Time.Clock.POSIX ( Data\Time\Clock\POSIX.hs, dist\build\Data\Time\Clock\POSIX.o )
    [13 of 24] Compiling Data.Time.Clock.UTCDiff ( Data\Time\Clock\UTCDiff.hs, dist\build\Data\Time\Clock\UTCDiff.o )
    [14 of 24] Compiling Data.Time.Clock  ( Data\Time\Clock.hs, dist\build\Data\Time\Clock.o )
    [15 of 24] Compiling Data.Time.LocalTime.TimeZone ( Data\Time\LocalTime\TimeZone.hs, dist\build\Data\Time\LocalTime\TimeZone.o )
    [16 of 24] Compiling Data.Time.LocalTime.TimeOfDay ( Data\Time\LocalTime\TimeOfDay.hs, dist\build\Data\Time\LocalTime\TimeOfDay.o )
    [17 of 24] Compiling Data.Time.Calendar ( Data\Time\Calendar.hs, dist\build\Data\Time\Calendar.o )
    [18 of 24] Compiling Data.Time.Calendar.Easter ( Data\Time\Calendar\Easter.hs, dist\build\Data\Time\Calendar\Easter.o )
    [19 of 24] Compiling Data.Time.LocalTime.LocalTime ( Data\Time\LocalTime\LocalTime.hs, dist\build\Data\Time\LocalTime\LocalTime.o )
    [20 of 24] Compiling Data.Time.LocalTime ( Data\Time\LocalTime.hs, dist\build\Data\Time\LocalTime.o )
    [21 of 24] Compiling Data.Time.Clock.TAI ( Data\Time\Clock\TAI.hs, dist\build\Data\Time\Clock\TAI.o )
    [22 of 24] Compiling Data.Time.Format.Parse ( Data\Time\Format\Parse.hs, dist\build\Data\Time\Format\Parse.o )
    [23 of 24] Compiling Data.Time.Format ( Data\Time\Format.hs, dist\build\Data\Time\Format.o )
    [24 of 24] Compiling Data.Time        ( Data\Time.hs, dist\build\Data\Time.o )
    Registering time-1.1.4...
    Installing library in
    C:\Users\altug\AppData\Roaming\cabal\time-1.1.4\ghc-7.0.2
    Registering time-1.1.4...
    Downloading random-1.0.0.3...
    Configuring random-1.0.0.3...
    Preprocessing library random-1.0.0.3...
    Building random-1.0.0.3...
    [1 of 1] Compiling System.Random    ( System\Random.hs, dist\build\System\Random.o )
    cabal: ar is required but it could not be found.
    Downloading transformers-0.2.2.0...
    Configuring transformers-0.2.2.0...
    Preprocessing library transformers-0.2.2.0...
    Building transformers-0.2.2.0...
    [ 1 of 21] Compiling Data.Functor.Product ( Data\Functor\Product.hs, dist\buildData\Functor\Product.o )
    [ 2 of 21] Compiling Data.Functor.Constant ( Data\Functor\Constant.hs, dist\build\Data\Functor\Constant.o )
    [ 3 of 21] Compiling Data.Functor.Compose ( Data\Functor\Compose.hs, dist\build\Data\Functor\Compose.o )
    [ 4 of 21] Compiling Data.Functor.Identity ( Data\Functor\Identity.hs, dist\build\Data\Functor\Identity.o )
    [ 5 of 21] Compiling Control.Monad.Trans.Class ( Control\Monad\Trans\Class.hs, dist\build\Control\Monad\Trans\Class.o )
    [ 6 of 21] Compiling Control.Monad.IO.Class ( Control\Monad\IO\Class.hs, dist\build\Control\Monad\IO\Class.o )
    [ 7 of 21] Compiling Control.Monad.Trans.Cont ( Control\Monad\Trans\Cont.hs, dist\build\Control\Monad\Trans\Cont.o )
    [ 8 of 21] Compiling Control.Monad.Trans.Error ( Control\Monad\Trans\Error.hs, dist\build\Control\Monad\Trans\Error.o )
    [ 9 of 21] Compiling Control.Monad.Trans.Identity ( Control\Monad\Trans\Identity.hs, dist\build\Control\Monad\Trans\Identity.o )
    [10 of 21] Compiling Control.Monad.Trans.List ( Control\Monad\Trans\List.hs, dist\build\Control\Monad\Trans\List.o )
    [11 of 21] Compiling Control.Monad.Trans.Maybe ( Control\Monad\Trans\Maybe.hs, dist\build\Control\Monad\Trans\Maybe.o )
    [12 of 21] Compiling Control.Monad.Trans.Reader ( Control\Monad\Trans\Reader.hs, dist\build\Control\Monad\Trans\Reader.o )
    [13 of 21] Compiling Control.Monad.Trans.RWS.Lazy ( Control\Monad\Trans\RWS\Lazy.hs, dist\build\Control\Monad\Trans\RWS\Lazy.o )
    [14 of 21] Compiling Control.Monad.Trans.RWS ( Control\Monad\Trans\RWS.hs, dist\build\Control\Monad\Trans\RWS.o )
    [15 of 21] Compiling Control.Monad.Trans.RWS.Strict ( Control\Monad\Trans\RWS\Strict.hs, dist\build\Control\Monad\Trans\RWS\Strict.o )
    [16 of 21] Compiling Control.Monad.Trans.State.Lazy ( Control\Monad\Trans\State\Lazy.hs, dist\build\Control\Monad\Trans\State\Lazy.o )
    [17 of 21] Compiling Control.Monad.Trans.State ( Control\Monad\Trans\State.hs, dist\build\Control\Monad\Trans\State.o )
    [18 of 21] Compiling Control.Monad.Trans.State.Strict ( Control\Monad\Trans\State\Strict.hs, dist\build\Control\Monad\Trans\State\Strict.o )
    [19 of 21] Compiling Control.Monad.Trans.Writer.Lazy ( Control\Monad\Trans\Writer\Lazy.hs, dist\build\Control\Monad\Trans\Writer\Lazy.o )
    [20 of 21] Compiling Control.Monad.Trans.Writer ( Control\Monad\Trans\Writer.hs, dist\build\Control\Monad\Trans\Writer.o )
    [21 of 21] Compiling Control.Monad.Trans.Writer.Strict ( Control\Monad\Trans\Writer\Strict.hs, dist\build\Control\Monad\Trans\Writer\Strict.o )
    cabal: ar is required but it could not be found.
    Downloading zlib-0.5.3.1...
    Configuring zlib-0.5.3.1...
    Preprocessing library zlib-0.5.3.1...
    Building zlib-0.5.3.1...
    [1 of 5] Compiling Codec.Compression.Zlib.Stream ( dist\build\Codec\Compression\Zlib\Stream.hs, dist\build\Codec\Compression\Zlib\Stream.o )
    [2 of 5] Compiling Codec.Compression.Zlib.Internal ( Codec\Compression\Zlib\Internal.hs, dist\build\Codec\Compression\Zlib\Internal.o )
    [3 of 5] Compiling Codec.Compression.Zlib.Raw ( Codec\Compression\Zlib\Raw.hs, dist\build\Codec\Compression\Zlib\Raw.o )
    [4 of 5] Compiling Codec.Compression.Zlib ( Codec\Compression\Zlib.hs, dist\build\Codec\Compression\Zlib.o )
    [5 of 5] Compiling Codec.Compression.GZip ( Codec\Compression\GZip.hs, dist\build\Codec\Compression\GZip.o )
    cabal: ar is required but it could not be found.
    cabal: Error: some packages failed to install:
    Cabal-1.8.0.6 depends on filepath-1.1.0.4 which failed to install.
    HTTP-4000.1.1 depends on transformers-0.2.2.0 which failed to install.
    cabal-install-0.8.2 depends on zlib-0.5.3.1 which failed to install.
    containers-0.3.0.0 failed during the building phase. The exception was:
    ExitFailure 1
    directory-1.0.1.2 depends on filepath-1.1.0.4 which failed to install.
    filepath-1.1.0.4 failed during the building phase. The exception was:
    ExitFailure 1
    mtl-2.0.1.0 depends on transformers-0.2.2.0 which failed to install.
    network-2.3.0.2 depends on parsec-2.1.0.1 which failed to install.
    parsec-2.1.0.1 failed during the building phase. The exception was:
    ExitFailure 1
    process-1.0.1.5 depends on filepath-1.1.0.4 which failed to install.
    random-1.0.0.3 failed during the building phase. The exception was:
    ExitFailure 1
    transformers-0.2.2.0 failed during the building phase. The exception was:
    ExitFailure 1
    zlib-0.5.3.1 failed during the building phase. The exception was:
    ExitFailure 1
    

    My Conclusion:

    As one can easily see, the output indicates some errors, but I got no idea what they mean. I continued trying to install my algebra package focusing on making it availible to the Dos-Interpeter from step 1.

  8. Again in dos-box input prompt, I typed cabal install constructive-algebra, that created this output:

    Resolving dependencies...
    cabal: cannot configure algebra-0.0.0.1. It requires base >=3.0 && <4.1
    For the dependency on base >=3.0 && <4.1 there are these packages:
    base-3.0.3.1, base-3.0.3.2 and base-4.0.0.0. However none of them are available.
    base-3.0.3.1 was excluded because of the top level dependency base -any
    base-3.0.3.2 was excluded because of the top level dependency base -any
    base-4.0.0.0 was excluded because of the top level dependency base -any
    

I suppose that the package is not installed. I need someone who can explain, what exact steps I need to do in order to get modules working.

Thanks for reading this post and answering in way that makes me understand it AND the Interpreter and Compiler working.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冰之心 2024-10-27 15:59:00

最简单的方法是获得像 DasBoot 推荐的 Haskell 平台,但无论如何我都会尝试回答您的问题:

1)对于您问题的第一部分,您的安装失败,因为您的路径有问题。找不到工具“ar”。创建库时使用 ar。如果您在命令窗口中仅输入“ar”,它应该返回类似的内容

用法:ar [模拟选项] [-]{dmpqrstx}[abcfilNoPsSuvV] [成员名称] [计数
] 归档文件文件...
ar -M [

如果没有,则需要将包含 ar 的文件夹(可能是 C:\ghc\ghc-7.0.2\mingw\bin)添加到 Windows 中的路径环境变量中。

2) 您的代数库不会在 7.0.2 下安装,至少不会开箱即用。代数的依赖项列为“依赖项:base >=3.0 && <4.1”,

但 ghc 7.0 附带了 base 4.3。这就是为什么您收到:

cabal:无法配置 algebra-0.0.0.1。它要求基数>=3.0 && <4.1

对于base的依赖关系>=3.0 && <4.1 有这些包:

base-3.0.3.1、base-3.0.3.2 和 base-4.0.0.0。然而它们都不可用

。幸运的是,对于这个特定的软件包,这个问题可以很容易地修复。就做

cabal 解压代数

cd代数-0.0.0.1

记事本代数.cabal

将 4.1 更改为 4.4

阴谋集团安装

,这样就可以了

The easiest way is to get the Haskell Platform like DasBoot recommended, but I'll try and answer your questions anyway:

1) For the first part of your question, your installs are failing because something's wrong with your path. the tool "ar" couldn't be found. ar is used when creating libraries. If you type just "ar" in a command window it should return something like

Usage: ar [emulation options] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count
] archive-file file...
ar -M [

If it doesn't then you need to add the folder containing ar (probably C:\ghc\ghc-7.0.2\mingw\bin) to your path env variable in windows.

2) Your algebra library won't install under 7.0.2, atleast not out of the box. Algebra has a dependency listed as "Dependencies: base >=3.0 && <4.1"

but ghc 7.0 comes with base 4.3. Which is why you received:

cabal: cannot configure algebra-0.0.0.1. It requires base >=3.0 && <4.1

For the dependency on base >=3.0 && <4.1 there are these packages:

base-3.0.3.1, base-3.0.3.2 and base-4.0.0.0. However none of them are available

Luckily, this can easily be fixed for this particulair package. just do

cabal unpack algebra

cd algebra-0.0.0.1

notepad algebra.cabal

change the 4.1 to a 4.4

cabal install

and that should do it

爱殇璃 2024-10-27 15:59:00

我从 下载 Haskell 安装了完整的软件包
该软件包包括 cabal。我是win7下运行的,目前没遇到什么问题。

FWIW,如果您单击帖子中的下载链接,然后尝试下载最新版本,则会出现一条大消息,建议从我提供的链接下载 haskell 平台。

I installed the full package from Download Haskell
This package includes cabal. I'm running it on win7, and haven't had any problems so far.

And FWIW, if you click on the download link in your post and then try to download the latest version there is a big message which suggests downloading the haskell platform from the link I gave.

毅然前行 2024-10-27 15:59:00

包名称是constructive-algebra,但是它的模块名称是什么?该模块名称是您应该在 ghci 中使用的名称。

the package name is constructive-algebra but what is it's module name? That module name is what you should use in ghci.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文