Skip to content

Commit

Permalink
Merge pull request haskell#3537 from ezyang/pr/graph-fixes
Browse files Browse the repository at this point in the history
Import hygiene and miscellaneous fixes.
  • Loading branch information
23Skidoo authored Jul 11, 2016
2 parents 7d192e5 + 8de1f62 commit 9a4bfc3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Cabal/Distribution/Compat/Graph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ import qualified Data.Map as Map
import qualified Data.Array as Array
import Data.Array ((!))
import qualified Data.Tree as Tree
import Data.Either
import Data.Typeable
import Data.Either (partitionEithers)
import Data.Typeable (Typeable)
import qualified Data.Foldable as Foldable
import Control.DeepSeq
import Control.DeepSeq (NFData(..))
import Distribution.Compat.Binary (Binary(..))

-- | A graph of nodes @a@. The nodes are expected to have instance
Expand Down Expand Up @@ -186,7 +186,7 @@ instance Ord k => IsNode (Node k a) where
nodeKey (N _ k _) = k
nodeNeighbors (N _ _ ks) = ks

-- TODO: Maybe introduce a typeclass for items with just
-- TODO: Maybe introduce a typeclass for items which just
-- keys (so, Key associated type, and nodeKey method). But
-- I didn't need it here, so I didn't introduce it.

Expand Down Expand Up @@ -236,7 +236,7 @@ unionRight g g' = fromMap (Map.union (toMap g') (toMap g))
-- | /O(V + V')/. Left-biased union, preferring entries from
-- the first map when conflicts occur.
unionLeft :: IsNode a => Graph a -> Graph a -> Graph a
unionLeft g g' = fromMap (Map.union (toMap g) (toMap g'))
unionLeft = flip unionRight

-- Graph-like operations

Expand Down

0 comments on commit 9a4bfc3

Please sign in to comment.