Merge pull request #4856 from InternetSolutions/wreq-lens45

patch for wreq 0.2 to work with lens 4.5
This commit is contained in:
Mateusz Kowalczyk 2014-11-07 04:12:45 +00:00
commit 4aff88cd48
2 changed files with 16 additions and 1 deletions

View File

@ -21,12 +21,12 @@ cabal.mkDerivation (self: {
temporary testFramework testFrameworkHunit text
];
doCheck = false;
patches = [ ./lens-4.5.patch ];
meta = {
homepage = "http://www.serpentine.com/wreq";
description = "An easy-to-use HTTP client library";
license = self.stdenv.lib.licenses.bsd3;
platforms = self.ghc.meta.platforms;
maintainers = with self.stdenv.lib.maintainers; [ ocharles ];
broken = true;
};
})

View File

@ -0,0 +1,15 @@
diff --git a/Network/Wreq/Lens/Machinery.hs b/Network/Wreq/Lens/Machinery.hs
index 782d965..0c97d27 100644
--- a/Network/Wreq/Lens/Machinery.hs
+++ b/Network/Wreq/Lens/Machinery.hs
@@ -13,8 +13,8 @@ import Language.Haskell.TH.Syntax (Dec, Name, Q, mkName, nameBase)
defaultRules :: LensRules
defaultRules = lensRules
-fieldName :: (String -> String) -> [Name] -> Name -> [DefName]
-fieldName f _ name = [TopName . mkName . f . nameBase $ name]
+fieldName :: (String -> String) -> Name -> [Name] -> Name -> [DefName]
+fieldName f _ _ name = [TopName . mkName . f . nameBase $ name]
makeLenses :: Name -> Q [Dec]
makeLenses = makeLensesWith (defaultRules & lensField .~ fieldName id)