1

I'm trying to follow the instructions for installing the Haskell components required by Quipper; but, working from a fresh installation of Haskell using the binary installer.

I get as far on the list as attempting to install the Lattices package:

cabal update
cabal install random
cabal install mtl
cabal install primes
cabal install Lattices

However I encounter the follwoing error:

Lattices-0.0.1 failed during the building phase. The exception was: ExitFailure 1

If I attempt to continue the Quipper install instructions:

cabal install zlib
cabal install easyrender

I encounter further errors:

cabal: Could not resolve dependencies:

I'm not sure how to proceed. What can I do to complete the package installation instructions for Quipper?


Resolving dependencies...
Configuring Lattices-0.0.1...
Building Lattices-0.0.1...
Failed to install Lattices-0.0.1
Build log ( /Users/Roy/.cabal/logs/Lattices-0.0.1.log ):
Configuring Lattices-0.0.1...
Building Lattices-0.0.1...
Preprocessing library Lattices-0.0.1...
[1 of 2] Compiling Math.LinearAlgebra.GramSchmidt ( src/Math/LinearAlgebra/GramSchmidt.hs, dist/build/Math/LinearAlgebra/GramSchmidt.o )

src/Math/LinearAlgebra/GramSchmidt.hs:25:26:
    Ambiguous occurrence ‘*>’
    It could refer to either ‘Prelude.*>’,
                             imported from ‘Prelude’ at src/Math/LinearAlgebra/GramSchmidt.hs:2:8-37
                             (and originally defined in ‘GHC.Base’)
                          or ‘Math.Algebra.LinearAlgebra.*>’,
                             imported from ‘Math.Algebra.LinearAlgebra’ at src/Math/LinearAlgebra/GramSchmidt.hs:7:1-43
cabal: Error: some packages failed to install:
Lattices-0.0.1 failed during the building phase. The exception was:
ExitFailure 1

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: easyrender-0.1.0.1 (user goal)
next goal: base (dependency of easyrender-0.1.0.1)
rejecting: base-4.8.1.0/installed-075... (conflict: easyrender => base>=4.6 &&
<4.8)
rejecting: base-4.8.1.0, 4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0, 4.6.0.1, 4.6.0.0,
4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1,
4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires
installed instance)
Dependency tree exhaustively searched.

OS X 10.10.4; Xcode 6.4; CLT: 6.4.0.0.1.1435007323; Clang: 6.1 build 602; Haskell GHC: 7.10.2. Using Homebrew in general, but, following what appears to be Homebrew's recommendation, not for Haskell.

Community
  • 1
  • 1
orome
  • 45,163
  • 57
  • 202
  • 418
  • Note: I'm new to Haskell so I am working from a [fresh installation](https://www.haskell.org/platform/mac.html) and no experience with Cabal other than executing the [instructions specified for configuring Quipper](http://www.mathstat.dal.ca/~selinger/quipper/README). – orome Aug 14 '15 at 16:02
  • Looks like the source of `Lattices-0.0.1` is not compatible with newer versions of `base` which now include the Applicative Functor operators `(<$>)`, `(<*>)`, `(*>)` & `(<*)` by default – recursion.ninja Aug 14 '15 at 16:06
  • @recursion.ninja: Can you elaborate? What can I do to get around that. – orome Aug 14 '15 at 16:08
  • @recursion.ninja: Also, did I start the "right" way by installing using the [platform](https://www.haskell.org/platform/mac.html#windows). I generally use Homebrew, but when I `brew info haskell-platform` I get a [message](http://stackoverflow.com/a/28616677/656912) pointing me to the platform (which certainly seems to be well maintained and easy to set up). – orome Aug 14 '15 at 16:13

2 Answers2

3

I wasn't actually aware anyone was using Lattice-0.0.1 from Hackage at all, so when someone reported me this bug last month, I did fix it on GitHub, but did not immediately release a new version because that didn't seem urgent. Seems I was mistaken :-)

I've uploaded a new version to Hackage, Lattices-0.0.2, that should fix this issue.

bcoppens
  • 31
  • 3
1

The source of Lattices-0.0.1 is not compatible with the newer versions of base included in GHC 7.10.1 or greater which now includes the Applicative Functor operators (<$>), (<*>), (*>) & (<*) by default.

In previous versions of base, the Applicative Functor operators would need to be explicitly imported:

import Control.Applicative ((<$>), (<*>), (*>), (<*))

main = show <$> getArgs -- use the applicative operator(s)

In the latest version of base included with GHC 7.10.1 or greater these operators are included implicitly in the Prelude module.

-- This is not necessary
-- import Control.Applicative ((<$>), (<*>), (*>), (<*))

main = show <$> getArgs -- use the applicative operator(s)

Since the Lattices-0.0.1 package was created a long time ago, it's source is not compatible with the newest version of GHC & base which you installed via the haskell-platform. If you look at the source you can see that the *> operator is used from a mathematics package import. But given the implicit prelude import of *> from the Applicative Functor module there is now a naming ambiguity that did not exist in earlier versions of base. This causes the compilation error.

To correctly compile the Lattice-0.0.1 package you will need to use a version of GHC which is older than GHC 7.10.1.

The haskell-platform is well maintained, unfortunately the Lattices-0.0.1 package is not...

recursion.ninja
  • 5,377
  • 7
  • 46
  • 78
  • How do I backtrack to an older version of GHC? – orome Aug 14 '15 at 16:21
  • @raxacoricofallapatorius Carefully! I'll update my post with a reference. – recursion.ninja Aug 14 '15 at 16:22
  • Thanks. It sounds like a bad idea though ("carefully" has me worried). Maybe the thing to do is for me to contact the Quipper folks and see if they can come up with a solution. As it is, their instructions, as written, don't work for current GHC. – orome Aug 14 '15 at 16:24
  • @raxacoricofallapatorius It's unfortunate that the developer(s) of [**`Quipper`**](http://www.mathstat.dal.ca/~selinger/quipper/) choose an un-maintained package as a dependency. A simple `import Prelude hiding (*>)` would solve the problem with the `Lattice-0.0.1` package. – recursion.ninja Aug 14 '15 at 16:25
  • @raxacoricofallapatorius I would share in your concern about using an older version of `GHC` & `base`. There have been major updates from versions `6.8.*` to `7.10.*` that were known to break some packages. `Lattices-0.0.1` is an unfortunate case. It might be more prudent to suggest an update to the package maintainer. You can find the package maintainer's contact info on the [Hackage's package description page`](https://hackage.haskell.org/package/Lattices-0.0.1) – recursion.ninja Aug 14 '15 at 16:26
  • What about `easyrender` (and for that matter, `newsynth`, which produces errors similar to those generated for `easyrender`) ? – orome Aug 14 '15 at 16:33
  • 1
    @raxacoricofallapatorius Same problem. The package constraints are for `easyrender` are `base >= 4.6 && < 4.8`. Since your `base` is greater than `4.8` it cannot find an acceptable `base` package as a dependency. This is because `GHC 7.10.2` provides a newer version of `base`. Essentially the packages aren't updated to support the newest version of `base`... :( – recursion.ninja Aug 14 '15 at 16:45
  • I'll contact the maintainers of `easyrender` and `newsynth` (who include a Quipper maintainer) too. – orome Aug 14 '15 at 17:01