git.iko.soy/typeable/cabal2nix
on master help sign in
Cabal2Nix/Package.hs: sort all lists of strings without distinguishing upper-/lower case
6c9717cPeter Simons
src/Cabal2Nix/Package.hs+2−2
@@ -11,7 +11,7 @@ import Distribution.NixOS.Derivation.Cabal
11import Cabal2Nix.Name
11import Cabal2Nix.Name
12import Cabal2Nix.CorePackages
12import Cabal2Nix.CorePackages
13import Data.List
13import Data.List
14−-- import Data.Char
14+import Data.Char
15
15
16cabal2nix :: Cabal.GenericPackageDescription -> Derivation
16cabal2nix :: Cabal.GenericPackageDescription -> Derivation
17cabal2nix cabal = MkDerivation
17cabal2nix cabal = MkDerivation
@@ -62,7 +62,7 @@ quote '"' = "\\\""
62quote c = [c]
62quote c = [c]
63
63
64normalizeList :: [String] -> [String]
64normalizeList :: [String] -> [String]
65−normalizeList = nub . sort {- By (\x y -> compare (map toLower x) (map toLower y)) -}
65+normalizeList = nub . sortBy (\x y -> compare (map toLower x) (map toLower y))
66
66
67normalizeNixNames :: [String] -> [String]
67normalizeNixNames :: [String] -> [String]
68normalizeNixNames = normalizeList . map toNixName
68normalizeNixNames = normalizeList . map toNixName