2

ハグをインストールしてからghc6をインストールしてからgenericをインストールした後-haskellには次のメッセージがあります。

# make package
Creating generic-haskell package ...
ghc-pkg: cannot find package generic-haskell
Reading package info from "generic-haskell.cabal.pkg" ... done.
generic-haskell-1.80: missing id field
generic-haskell-1.80: dependency "base-4.2.0.0" doesn't exist (use --force to override)
generic-haskell-1.80: dependency "haskell98-1.0.1.1" doesn't exist (use --force to override)
generic-haskell-1.80: dependency "containers-0.3.0.0" doesn't exist (use --force to override)
make: *** [package] Error 1

ubuntuでghc-6.2.2をコンパイルすると次のエラーが発生しました

/usr/bin/ghc -M -optdep-f -optdep.depend  -osuf o    -H16m -O HaskTags.hs

on the commandline:

    Warning: -optdep-f is deprecated: Use -dep-makefile instead
------------------------------------------------------------------------
==fptools== make boot - --no-print-directory -r;
 in /home/martin/ghc-6.2.2/ghc/utils/ghc-pkg
------------------------------------------------------------------------
/usr/bin/ghc -M -optdep-f -optdep.depend  -osuf o    -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY Main.hs Package.hs ParsePkgConfLite.hs Version.hs

on the commandline:
    Warning: -optdep-f is deprecated: Use -dep-makefile instead
make all
/usr/bin/ghc -H16m -O -cpp -DPKG_TOOL -DWANT_PRETTY    -c Main.hs -o Main.o  -ohi Main.hi

Main.hs:496:11:
    Ambiguous type variable `e' in the constraint:
      `Exception.Exception e'
        arising from a use of `Exception.throw' at Main.hs:496:11-25
    Possible cause: the monomorphism restriction applied to the following:
      my_catch :: forall a. IO a -> (e -> IO a) -> IO a
        (bound at Main.hs:499:0)
      my_throw :: forall a. e -> a (bound at Main.hs:496:0)
    Probable fix: give these definition(s) an explicit type signature
                  or use -XNoMonomorphismRestriction

Main.hs:498:13:
    Ambiguous type variable `e1' in the constraint:
      `Exception.Exception e1'
        arising from a use of `Exception.catch' at Main.hs:498:13-27
    Possible cause: the monomorphism restriction applied to the following:
      eval_catch :: forall a. a -> (e1 -> IO a) -> IO a
        (bound at Main.hs:498:0)
    Probable fix: give these definition(s) an explicit type signature
                  or use -XNoMonomorphismRestriction
make[4]: *** [Main.o] Error 1
make[3]: *** [boot] Error 2
make[2]: *** [boot] Error 1
make[1]: *** [boot] Error 1

古いバージョンのGHCと一般的なhaskellをubuntu10にインストールした人はいますか?

バージョンのペアはたくさんありますが、ghc-6.2.2で上記のエラーが発生しましたが、ubuntu 10をアンインストールして、古いバージョンのubuntuをインストールして動作させる必要がありますか?どのバージョンのghcでどのバージョンのubuntuが機能しますか? http://www.cs.uu.nl/research/projects/generic-haskell/compiler.html

4

2 に答える 2

1

私はgeneric-haskellをソースから自分でインストールしてみましたが、なんとかして、それをどのように修正したかを説明することができました。私のインストールプラットフォームはHaskellPlatform2011.2.0.1-x86_64ですが、次の手順はやや一般的です。

私はあなたが最初に説明した問題(以下の3番目)を含む3つの問題に遭遇しました。他のユーザーのために、おそらくあなたも解決した最初の2つについても説明します。

Data.Map.lookup1)他のユーザーは、変更されたタイプに応じて最初にエラーを修正する必要がありますcontainers。> = 0.2.0.0の場合:以前はMonad m => m b(in containers-1.0.0.0)を返していましたが、現在は。だけを返しますMaybe bData.Maybe.maybeToListリストタイプを使用する必要があるいくつかの呼び出しサイトを修正するための呼び出しを追加しました。なんらかの方法で同じエラーを修正したに違いありません。この修正は http://hpaste.org/47624で見つけることができます。

2)GHC 7で発生した別のエラーは、configureスクリプトがGHC 6.8よりも新しいことを認識しないため、コンテナーにも依存する必要があることです。次の行を含む構成出力:

基本パッケージが分割されているかどうかを確認しています(GHC 6.8以降)...いいえ

これを修正するには、交換する必要があります

if test $ghc_ma -ge 6 -a $ghc_mi -ge 8; then

if test $ghc_ma -eq 6 -a $ghc_mi -ge 8 -o $ghc_ma -ge 7; then

3)問題を修正するには、編集する必要がありますbuild/generic-haskell.cabal.pkg(make in-placeでインプレースインストールを行っていない場合)。id:行を追加し、依存行を修正して、パッケージ名の代わりにシステムに存在するパッケージのパッケージIDを使用する必要があります。次のコマンドを使用してIDを確認できます(私のシステムでの出力が含まれています)。

$ ghc-pkg field base id
id: base-4.3.1.0-f5c465200a37a65ca26c5c6c600f6c76
$ ghc-pkg field haskell98 id
id: haskell98-1.1.0.1-150131ea75216886448a7146c9e0526b
$ ghc-pkg field containers id
id: containers-0.4.0.0-b4885363abca642443ccd842502a3b7e

その場合の変更は次のbuild/generic-haskell.cabal.pkgようになります。

-depends:        base-4.3.1.0
-                haskell98-1.1.0.1
-                containers-0.4.0.0
+depends:        base-4.3.1.0-f5c465200a37a65ca26c5c6c600f6c76
+                haskell98-1.1.0.1-150131ea75216886448a7146c9e0526b
+                containers-0.4.0.0-b4885363abca642443ccd842502a3b7e

さらに、同じファイルにid行を追加する必要があります。ライブラリを再インストールする場合に変更する限り、どのIDでもかまいません。ここで私は使用しました:

id:             generic-haskell-1.80-lib-md5sum-2a7ae9d60440627618ad0b0139ef090b

また、既存のファイルと同様に、すべてのフィールドをスペースに揃えました。このファイルの構文リファレンスは次の場所にあります:http: //www.haskell.org/ghc/docs/6.12.2/html/users_guide/packages.html#installed-pkg-info

于 2011-06-09T17:14:37.127 に答える
1

どうやら、generic-haskellパッケージは の古いバージョンに依存しているようですbase

Haskell Platformはbase-4.3.1.0 を指定しますが、generic-haskell は古いバージョンを必要とします。メンテナに連絡するか、古いバージョンの GHC をインストールしてください。

于 2011-04-21T06:31:45.583 に答える