Commit 12cc66f7 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Reverse the order of the args to PackageIndex.insert

To take the index last like the other functions and like Data.Map.
It is actually more convenient that way round.
parent cb5fe0e2
......@@ -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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment