Skip to content

Commit

Permalink
Reverse the order of the args to PackageIndex.insert
Browse files Browse the repository at this point in the history
To take the index last like the other functions and like Data.Map.
It is actually more convenient that way round.
  • Loading branch information
dcoutts committed May 4, 2008
1 parent cfde858 commit de4f77a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Distribution/Simple/PackageIndex.hs
Expand Up @@ -146,8 +146,8 @@ mergeBuckets pkgs1 pkgs2 = stripDups (pkgs2 ++ pkgs1)
-- This is equivalent to (but slightly quicker than) using 'mappend' or
-- 'merge' with a singleton index.
--
insert :: Package pkg => PackageIndex pkg -> pkg -> PackageIndex pkg
insert (PackageIndex index) pkg = PackageIndex $
insert :: Package pkg => pkg -> PackageIndex pkg -> PackageIndex pkg
insert pkg (PackageIndex index) = PackageIndex $
let key = (lowercase . packageName) pkg
in Map.insertWith (flip mergeBuckets) key [pkg] index

Expand Down

0 comments on commit de4f77a

Please sign in to comment.