Question

I would like to install Snap, but i'm new to Haskell and its platform.

I use cabal to install Snap and it fails to install semigroups :

% cabal install snap
Resolving dependencies...
Configuring semigroups-0.8.3...
Preprocessing library semigroups-0.8.3...
Building semigroups-0.8.3...
[1 of 4] Compiling Numeric.Natural.Internal ( Numeric/Natural/Internal.hs, dist/build/Numeric/Natural/Internal.o )
[2 of 4] Compiling Numeric.Natural  ( Numeric/Natural.hs, dist/build/Numeric/Natural.o )
[3 of 4] Compiling Data.List.NonEmpty ( Data/List/NonEmpty.hs, dist/build/Data/List/NonEmpty.o )

Data/List/NonEmpty.hs:115:4:
    Can't make a derived instance of `Data (NonEmpty a)'
      (You need -XDeriveDataTypeable to derive an instance for this class)
    In the data type declaration for `NonEmpty'

Data/List/NonEmpty.hs:115:10:
    Can't make a derived instance of `Typeable (NonEmpty a)'
      (You need -XDeriveDataTypeable to derive an instance for this class)
    In the data type declaration for `NonEmpty'

This is my version of cabal :

% cabal --version
cabal-install version 0.10.2
using version 1.10.2.0 of the Cabal library 

I have seen that semigroups is a dependency for many of Snap dependencies, how could i correct this installation ?

I run in a ubuntu with gnome « Vous utilisez actuellement Ubuntu 10.04 LTS - le Lynx Lucide - version sortie en avril 2010 »

Edits:

In the semigroups.cabal file, in the package, i saw this:

  if !impl(hugs)
    other-extensions: DeriveDataTypeable
    cpp-options: -DLANGUAGE_DeriveDataTypeable

I may have to make « impl(hugs) » return something falsy ? (but i have no idea what it is :) )

Thank you

Was it helpful?

Solution

You can pass ghc-specific flags via the cabal invocation

cabal install snap --ghc-option=-XDeriveDataTypeable

More information about these sorts of flags are in the "Programs used for building" section of the Cabal Users Guide.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top