Skip to content

Commit

Permalink
Fix GHC-7.6 and 7.8 builds
Browse files Browse the repository at this point in the history
* Data.Monoid imports are redundant

   for bringing Monoid(..) and (<>) into scope

* GHC-7.6.3 bring back deepseq >= 1.3.0.0 and deepseq-generics

* GHC < 8: need Data.Monoid after all

* GHC-7.8: use older deepseq, too
  • Loading branch information
lambdageek authored Mar 9, 2018
1 parent 17dd2c1 commit 0a1d69e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
10 changes: 9 additions & 1 deletion benchmarks/BenchLam.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-- | Untyped lambda calc for benchmarking
{-# LANGUAGE DeriveGeneric, DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric, DeriveDataTypeable, CPP #-}
module BenchLam where

import Control.Applicative
Expand All @@ -10,6 +10,10 @@ import GHC.Generics (Generic)
import Data.Typeable (Typeable)

import Control.DeepSeq (NFData(..), deepseq)
#if MIN_VERSION_deepseq (1,4,0)
#else
import Control.DeepSeq.Generics (genericRnf)
#endif
import Criterion (Benchmark, env, bench, nf)

import Unbound.Generics.LocallyNameless
Expand All @@ -23,7 +27,11 @@ data Term =
deriving (Show, Generic, Typeable)

instance Alpha Term
#if MIN_VERSION_deepseq (1,4,0)
instance NFData Term
#else
instance NFData Term where rnf = genericRnf
#endif


-- | lambda abstract over all the given vars
Expand Down
2 changes: 1 addition & 1 deletion src/Unbound/Generics/LocallyNameless/Alpha.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import Data.Function (on)
import Data.Functor.Contravariant (Contravariant(..))
import Data.Foldable (Foldable(..))
import Data.List (intersect)
import Data.Monoid (Monoid(..), (<>), All(..))
import Data.Monoid (Monoid(..), All(..))
import Data.Ratio (Ratio)
import Data.Semigroup as Sem
import Data.Typeable (Typeable, gcast, typeOf)
Expand Down
2 changes: 1 addition & 1 deletion src/Unbound/Generics/PermM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module Unbound.Generics.PermM (
) where

import Prelude (Eq(..), Show(..), (.), ($), Monad(return), Ord(..), Maybe(..), otherwise, (&&), Bool(..), id, uncurry, Functor(..))
import Data.Monoid
import Data.Monoid hiding ((<>))
import Data.List
import Data.Map (Map)
import Data.Semigroup as Sem
Expand Down
8 changes: 6 additions & 2 deletions unbound-generics.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ library
-- other-extensions:
build-depends: base >=4.6 && <5,
template-haskell >= 2.8.0.0,
deepseq >= 1.4.0.0,
deepseq >= 1.3.0.0,
mtl >= 2.1,
transformers >= 0.3,
transformers-compat >= 0.3,
Expand Down Expand Up @@ -104,10 +104,14 @@ Benchmark benchmark-unbound-generics
main-is: benchmark-main.hs
build-depends: base
, criterion >= 1.0.0.1
, deepseq >= 1.4.0.0
, deepseq >= 1.3.0.0
, unbound-generics
if impl (ghc == 7.6.*)
build-depends: unix <= 2.6.0.1
if impl (ghc == 7.6.*) || impl (ghc == 7.8.*)
build-depends: deepseq-generics
else
build-depends: deepseq >= 1.4.0.0
other-modules: BenchLam
ghc-options: -Wall
if impl (ghc >= 8.0.0)
Expand Down

0 comments on commit 0a1d69e

Please sign in to comment.