Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

in ubuntu i compile ghc-6.2.2 got the following error

/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
share|improve this question

closed as too localized by jrg Feb 19 '12 at 1:25

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Is there any specific reason you're trying to compile GHC version 6.2.2? It was released over 6 years ago, I don't think you'll be able to get it to work these days. You'll probably be better off with GHC 7.0.3 (the most recent version as of today). –  Cedric Apr 9 '11 at 18:44
    
i want to use generic haskell 1.4.2 –  user13871 Apr 9 '11 at 20:59
    
as the latest version i got error –  user13871 Apr 9 '11 at 20:59
    
Well, whatever you want to do, I think you'll be better of trying to port your code to a newer version of GHC rather than sticking with one that was released 6 years ago. I'm sorry I can't be more helpful. –  Cedric Apr 9 '11 at 23:47
    
This question appears to be abandoned, if you are experiencing a similar issue please ask a new question with details pertaining to your problem. If you feel this question is not abandoned, please flag the question explaining that. :) –  jrg Feb 19 '12 at 1:25

Browse other questions tagged or ask your own question.