1

Trying to install Quipper (quantum programming language for Haskell), it throws a compilation error:

My build profile: -w ghc-9.0.1 -O1

Preprocessing library for quipper-utils-0.9.0.0..
Building library for quipper-utils-0.9.0.0..

...

[11 of 15] Compiling Quipper.Utils.Template.Lifting ( Quipper/Utils/Template/Lifting.hs, dist/build/Quipper/Utils/Template/Lifting.o, dist/build/Quipper/Utils/Template/Lifting.dyn_o )

Quipper/Utils/Template/Lifting.hs:252:28: error:
    • Couldn't match type ‘Maybe TH.Exp’ with ‘TH.Exp’
      Expected: [TH.Exp]
        Actual: [Maybe TH.Exp]
    • In the second argument of ‘mapM’, namely ‘exps’
      In a stmt of a 'do' block: exps' <- mapM expTHtoAST exps
      In the expression:
        do exps' <- mapM expTHtoAST exps
           return (TupE exps')
    |
252 |   exps' <- mapM expTHtoAST exps
    |                            ^^^^

Quipper/Utils/Template/Lifting.hs:417:20: error:
    • Couldn't match type ‘TH.Exp’ with ‘Maybe TH.Exp’
      Expected: [Maybe TH.Exp]
        Actual: [TH.Exp]
    • In the first argument of ‘TH.TupE’, namely ‘exps'’
      In the second argument of ‘($)’, namely ‘TH.TupE exps'’
      In a stmt of a 'do' block: return $ TH.TupE exps'
    |
417 |   return $ TH.TupE exps'
    |                    ^^^^^
cabal: Failed to build quipper-utils-0.9.0.0 (which is required by
quipper-0.9.0.0). See the build log above for details.

2 Answers2

1

I'm pretty sure the bounds on the Quipper package are too lax. There have been quite some changes in Template Haskell in GHC 9.0.1. And the version of the template-haskell library is bound to the GHC version you're using, so you have to use an older version of GHC. I have tested it with GHC 8.8.4 which works.

Noughtmare
  • 9,410
  • 1
  • 12
  • 38
  • Thanks a lot, can confirm that ghc 8.8.4 works for me. The website mentions `Please note: Quipper does not work with GHC 7.10 or 8.10. The versions currently supported are GHC 8.0, 8.2, 8.4, 8.6, and 8.8.` – tobiasBora Oct 03 '22 at 16:33
0

Try installing version 8.6.5 from here: https://www.haskell.org/platform/prior.html. I had the same problem and this worked for me.

ouflak
  • 2,458
  • 10
  • 44
  • 49