Skip to content

Commit a14abb0

Browse files
Philipp Schusterphischu
Philipp Schuster
authored andcommitted
Compatibility with traverse-with-class-1.0.0.0, drop GHC 7.10.3, fixes #97
1 parent 3311440 commit a14abb0

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ before_cache:
1313

1414
matrix:
1515
include:
16-
- env: CABALVER=1.24 GHCVER=7.10.1
17-
compiler: ": #GHC 7.10.1"
18-
addons: {apt: {packages: [cabal-install-1.24,ghc-7.10.1,alex-3.1.7,happy-1.19.5], sources: [hvr-ghc]}}
1916
- env: CABALVER=1.24 GHCVER=8.0.1
2017
compiler: ": #GHC 8.0.1"
2118
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.1,alex-3.1.7,happy-1.19.5], sources: [hvr-ghc]}}

haskell-names.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Homepage: http://documentup.com/haskell-suite/haskell-names
1111
Stability: Experimental
1212
Build-Type: Simple
1313
Cabal-Version: >= 1.10
14-
Tested-With: GHC == 7.10.1, GHC == 8.0.1, GHC == 8.2.1
14+
Tested-With: GHC == 8.0.1, GHC == 8.2.1
1515

1616
extra-source-files:
1717
README.md
@@ -245,7 +245,7 @@ Library
245245
, aeson >= 0.8.0.2 && < 1.3
246246
, bytestring >= 0.10.4.0 && < 0.11
247247
, data-lens-light >= 0.1.2.1 && < 0.2
248-
, traverse-with-class >= 0.2.0.3 && < 0.3
248+
, traverse-with-class >= 1.0.0.0 && < 1.1
249249
if impl(ghc <= 7.8)
250250
Build-depends: tagged >= 0.8.4 && < 0.9
251251
Hs-source-dirs: src
@@ -291,5 +291,5 @@ Test-suite test
291291
, tasty-golden >= 2.2.1 && < 2.4
292292
, filemanip >= 0.3.6.3 && < 0.4
293293
, pretty-show >= 1.6.1 && < 1.7
294-
, traverse-with-class >= 0.2.0.3 && < 0.3
294+
, traverse-with-class >= 1.0.0.0 && < 1.1
295295

src/Language/Haskell/Names/Open/Base.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-- You can look at "Language.Haskell.Exts.Annotated" source as an example
55
-- of how to use this module.
66
{-# LANGUAGE RankNTypes, FlexibleInstances, FlexibleContexts, UndecidableInstances, DefaultSignatures, TemplateHaskell, ScopedTypeVariables #-}
7-
{-# LANGUAGE ImplicitParams, KindSignatures #-}
7+
{-# LANGUAGE ImplicitParams, KindSignatures, TypeApplications #-}
88
module Language.Haskell.Names.Open.Base where
99

1010
import qualified Language.Haskell.Names.GlobalSymbolTable as Global
@@ -91,9 +91,7 @@ data ConstraintProxy (p :: * -> Constraint) = ConstraintProxy
9191
defaultRtraverse
9292
:: (GTraversable Resolvable a, Applicative f, ?alg :: Alg f)
9393
=> a -> Scope -> f a
94-
defaultRtraverse a sc =
95-
let ?c = ConstraintProxy :: ConstraintProxy Resolvable
96-
in gtraverse (\a -> alg a sc) a
94+
defaultRtraverse a sc = gtraverse @Resolvable (\d -> alg d sc) a
9795

9896
-- | A type that implements 'Resolvable' provides a way to perform
9997
-- a shallow scope-aware traversal.

tests/run.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{-# LANGUAGE FlexibleInstances, OverlappingInstances, ImplicitParams,
2-
MultiParamTypeClasses, FlexibleContexts, GADTs #-}
2+
MultiParamTypeClasses, FlexibleContexts, GADTs,
3+
TypeApplications #-}
34
-- GHC 7.8 fails with the default context stack size of 20
45
{-# OPTIONS_GHC -fcontext-stack=50 #-}
56
import Test.Tasty hiding (defaultMain)
@@ -135,15 +136,14 @@ printAnns
135136
:: Rec TestAnn (a (Scoped SrcSpan))
136137
=> a (Scoped SrcSpan) -> String
137138
printAnns =
138-
let ?c = Proxy :: Proxy (Rec TestAnn) in
139139
let
140140
-- format one annotation
141141
one :: TestAnn a => a -> String
142142
one a =
143143
flip F.foldMap (getAnn a) $ uncurry formatAnn
144144
-- tie the knot
145145
go :: Rec TestAnn a => a -> String
146-
go a = one a ++ gfoldMap go a
146+
go a = one a ++ gfoldMap @(Rec TestAnn) go a
147147
in go
148148

149149
-----------------------

0 commit comments

Comments
 (0)