Skip to content

Commit

Permalink
Add union operation to PSQ
Browse files Browse the repository at this point in the history
  • Loading branch information
edsko committed Mar 27, 2015
1 parent 4053927 commit 2085511
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cabal-install/Distribution/Client/Dependency/Modular/PSQ.hs
Expand Up @@ -57,7 +57,7 @@ casePSQ (PSQ xs) n c =
(k, v) : ys -> c k v (PSQ ys)

splits :: PSQ k a -> PSQ k (a, PSQ k a)
splits = go id
splits = go id
where
go f xs = casePSQ xs
(PSQ [])
Expand Down Expand Up @@ -92,3 +92,6 @@ null (PSQ xs) = S.null xs

toList :: PSQ k a -> [(k, a)]
toList (PSQ xs) = xs

union :: PSQ k a -> PSQ k a -> PSQ k a
union (PSQ xs) (PSQ ys) = PSQ (xs ++ ys)

0 comments on commit 2085511

Please sign in to comment.