uniplate 1.2.0.1 → 1.2.0.2
raw patch · 3 files changed
+19/−8 lines, 3 filesdep +containsdep +sybdep ~base
Dependencies added: contains, syb
Dependency ranges changed: base
Files
- Data/Generics/PlateData.hs +9/−1
- Data/Generics/UniplateStr.hs +1/−1
- uniplate.cabal +9/−6
Data/Generics/PlateData.hs view
@@ -20,6 +20,7 @@ import Data.List import qualified Data.IntSet as IntSet import Control.Monad.State+import Data.Ratio @@ -83,8 +84,15 @@ tt = typeOf t xs = contains t ++-- Ratio is strict and causes bugs with fromConstr in GHC 6.10.1+-- See bug http://hackage.haskell.org/trac/ghc/ticket/2782+evilRatio = fst $ splitTyConApp $ typeOf (undefined :: Ratio Int) + contains :: (Data a, Typeable a) => a -> [DataBox]-contains x = if isAlgType dtyp then concatMap f ctrs else []+contains x | fst (splitTyConApp $ typeOf x) == evilRatio = []+ | isAlgType dtyp = concatMap f ctrs+ | otherwise = [] where f ctr = gmapQ DataBox (asTypeOf (fromConstr ctr) x) ctrs = dataTypeConstrs dtyp
Data/Generics/UniplateStr.hs view
@@ -103,7 +103,7 @@ -- -- For example, replacing negative literals with literals: ----- > negLits = trasform f+-- > negLits = transform f -- > where f (Neg (Lit i)) = Lit (negate i) -- > f x = x transform :: Uniplate on => (on -> on) -> on -> on
uniplate.cabal view
@@ -1,7 +1,7 @@ Cabal-Version: >= 1.2 Build-Type: Simple Name: uniplate-Version: 1.2.0.1+Version: 1.2.0.2 Copyright: 2006-8, Neil Mitchell Maintainer: ndmitchell@gmail.com Homepage: http://www-users.cs.york.ac.uk/~ndm/uniplate/@@ -17,14 +17,17 @@ Extra-Source-Files: uniplate.htm -Flag splitBase- Description: Choose the new smaller, split-up base package.+Flag ghc_6_10+Flag ghc_6_8 Library- if flag(splitBase)- build-depends: base >= 3, mtl, containers+ if flag(ghc_6_10)+ build-depends: base >= 4, mtl, contains, syb else- build-depends: base < 3, mtl+ if flag(ghc_6_8)+ build-depends: base >= 3, mtl, containers+ else+ build-depends: base < 3, mtl Exposed-modules: Data.Generics.Uniplate