git.iko.soy/typeable/cabal2nix
on master help sign in
BuildInfo: replace anyDep lens with generic 'each'
commit9d4058630c99168783260acc4ba527da9d79de2a authorPeter Simons <simons@cryp.to> dateMon 17 Aug 2015, 13:06 (11 years ago) parent7c00ec5
1 file changed+6−6
src/Distribution/Nixpkgs/Haskell.hs+6−6
src/Distribution/Nixpkgs/Haskell.hs+6−6
@@ -1,6 +1,7 @@
11{-# LANGUAGE DeriveGeneric #-}
22{-# LANGUAGE RecordWildCards #-}
33{-# LANGUAGE TemplateHaskell #-}
4+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}
45
56module Distribution.Nixpkgs.Haskell
67 ( Derivation, nullDerivation, pkgid, revision, src, isLibrary, isExecutable
@@ -8,7 +9,7 @@ module Distribution.Nixpkgs.Haskell
89 , cabalFlags, runHaddock, jailbreak, doCheck, testTarget, hyperlinkSource, enableSplitObjs
910 , phaseOverrides, editedCabalFile, metaSection
1011 , BuildInfo, haskell, pkgconfig, system, tool
11− , dependencies, anyDep
12+ , dependencies
1213 )
1314 where
1415
@@ -37,7 +38,8 @@ data BuildInfo = BuildInfo
3738
3839makeLenses ''BuildInfo
3940
40−makeLensesFor [("_haskell", "anyDep"), ("_pkgconfig", "anyDep"), ("_system", "anyDep"), ("_tool", "anyDep")] ''BuildInfo
41+instance Each BuildInfo BuildInfo (Set Identifier) (Set Identifier) where
42+ each f (BuildInfo a b c d) = BuildInfo <$> f a <*> f b <*> f c <*> f d
4143
4244instance Monoid BuildInfo where
4345 mempty = BuildInfo mempty mempty mempty mempty
@@ -46,9 +48,7 @@ instance Monoid BuildInfo where
4648-- | A represtation of Nix expressions for building Haskell packages.
4749-- The data type correspond closely to the definition of
4850-- 'PackageDescription' from Cabal.
49−--
50−-- Note that the "Text" instance definition provides pretty-printing,
51−-- but no parsing as of now!
51+
5252data Derivation = MkDerivation
5353 { _pkgid :: PackageIdentifier
5454 , _revision :: Int
@@ -137,7 +137,7 @@ instance Pretty Derivation where
137137 where
138138 inputs :: Set String
139139 inputs = Set.unions [ _extraFunctionArgs
140− , setOf (dependencies . anyDep . folded . ident) drv
140+ , setOf (dependencies . each . folded . ident) drv
141141 , Set.fromList ["fetch" ++ derivKind _src | derivKind _src /= "" && not isHackagePackage]
142142 ]
143143