Skip to content

Commit b232bd8

Browse files
authored
Merge pull request #76 from nobrakal/master
Use swap from Data.Tuple
2 parents 1d4bd0e + a72c423 commit b232bd8

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

Data/Graph/Inductive/PatriciaTree.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import Data.IntMap (IntMap)
3232
import qualified Data.IntMap as IM
3333
import Data.List (foldl', sort)
3434
import Data.Maybe (fromMaybe)
35+
import Data.Tuple (swap)
3536

3637
#if MIN_VERSION_containers (0,4,2)
3738
import Control.DeepSeq (NFData(..))
@@ -259,9 +260,6 @@ toContext v (ps, a, ss) = (toAdj ps, v, a, toAdj ss)
259260
fromContext :: Context a b -> Context' a b
260261
fromContext (ps, _, a, ss) = (fromAdj ps, a, fromAdj ss)
261262

262-
swap :: (a, b) -> (b, a)
263-
swap (a, b) = (b, a)
264-
265263
-- A version of @++@ where order isn't important, so @xs ++ [x]@
266264
-- becomes @x:xs@. Used when we have to have a function of type @[a]
267265
-- -> [a] -> [a]@ but one of the lists is just going to be a single

Data/Graph/Inductive/Query/DFS.hs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import Data.Graph.Inductive.Graph
5050
import Data.Tree
5151
import qualified Data.Map as Map
5252
import Control.Monad (liftM2)
53-
53+
import Data.Tuple (swap)
5454

5555

5656
-- | Many functions take a list of nodes to visit as an explicit argument.
@@ -244,8 +244,6 @@ condensation gr = mkGraph vs es
244244
vs = zip [1..] sccs
245245
vMap = Map.fromList $ map swap vs
246246

247-
swap = uncurry $ flip (,)
248-
249247
getN = (vMap Map.!)
250248
es = [ (getN c1, getN c2, ()) | c1 <- sccs, c2 <- sccs
251249
, (c1 /= c2) && any (hasEdge gr) (liftM2 (,) c1 c2) ]

fgl.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ library {
6565
other-modules:
6666
Paths_fgl
6767

68-
build-depends: base < 5
68+
build-depends: base >= 4.3 && < 5
6969
, transformers
7070
, array
7171

0 commit comments

Comments
 (0)