packages feed

FilePather 0.1.4 → 0.1.5

raw patch · 2 files changed

+37/−1 lines, 2 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ System.FilePath.FilePather.FilePathPredicate: allof :: (FilePathPredicate f, Foldable t, Monad g) => t (f g) -> f g
+ System.FilePath.FilePather.FilePathPredicate: anyof :: (FilePathPredicate f, Foldable t, Monad g) => t (f g) -> f g
+ System.FilePath.FilePather.FilePathPredicate: extensionEq :: (FilePathPredicate f, Monad g) => FilePath -> f g
+ System.FilePath.FilePather.FilePathPredicate: extensionNoneof :: (FilePathPredicate f, Foldable t, Monad g) => t FilePath -> f g
+ System.FilePath.FilePather.FilePathPredicate: extensionOneof :: (FilePathPredicate f, Foldable t, Monad g) => t FilePath -> f g
- System.FilePath.FilePather.FilePathPredicate: class FilePathPredicate f where hasExtension = (.!.) notHasExtension notHasExtension = (.!.) hasExtension hasTrailingPathSeparator = (.!.) notHasTrailingPathSeparator notHasTrailingPathSeparator = (.!.) hasTrailingPathSeparator isRelative = (.!.) isNotRelative isNotRelative = (.!.) isRelative isAbsolute = (.!.) isNotAbsolute isNotAbsolute = (.!.) isAbsolute isValid = (.!.) isNotValid isNotValid = (.!.) isValid
+ System.FilePath.FilePather.FilePathPredicate: class FilePathPredicate f where anyof = foldr (.||.) never allof = foldr (.&&.) always extensionEq p = extension (== p) extensionOneof = foldr (\ a b -> extensionEq a .||. b) never extensionNoneof = foldr (\ a b -> (.!.) (extensionEq a) .&&. b) always hasExtension = (.!.) notHasExtension notHasExtension = (.!.) hasExtension hasTrailingPathSeparator = (.!.) notHasTrailingPathSeparator notHasTrailingPathSeparator = (.!.) hasTrailingPathSeparator isRelative = (.!.) isNotRelative isNotRelative = (.!.) isRelative isAbsolute = (.!.) isNotAbsolute isNotAbsolute = (.!.) isAbsolute isValid = (.!.) isNotValid isNotValid = (.!.) isValid

Files

FilePather.cabal view
@@ -1,5 +1,5 @@ Name:               FilePather-Version:            0.1.4+Version:            0.1.5 Author:             Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> Maintainer:         Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ> Copyright:          Tony Morris
src/System/FilePath/FilePather/FilePathPredicate.hs view
@@ -7,6 +7,7 @@ import System.FilePath.FilePather.RecursePredicate import System.FilePath.FilePather.FilterPredicate import Control.Monad+import qualified Data.Foldable as F  -- | Functions that are common to predicates that work on 'FilePath' values. class FilePathPredicate f where@@ -35,11 +36,46 @@     Monad g =>     f g     -> f g+  -- | Folds the predicates on disjunction.+  anyof ::+    (F.Foldable t, Monad g) =>+    t (f g)+    -> f g+  -- | Folds the predicates on conjunction.+  anyof =+    F.foldr (.||.) never+  allof ::+    (F.Foldable t, Monad g) =>+    t (f g)+    -> f g+  allof =+    F.foldr (.&&.) always   -- | A predicate that computes its result based on a file name extension.   extension ::     Monad g =>     (FilePath -> Bool)     -> f g+  -- | A predicate that computes its result based equivalence to a file name extension.+  extensionEq ::+    Monad g =>+    FilePath+    -> f g+  extensionEq p =+    extension (== p)+  -- | A predicate that computes its result based equivalence to one of a list of file name extensions.+  extensionOneof ::+    (F.Foldable t, Monad g) =>+    t FilePath+    -> f g+  extensionOneof =+    F.foldr (\a b -> extensionEq a .||. b) never+  -- | A predicate that computes its result based inequivalence to any of a list of file name extensions.+  extensionNoneof ::+    (F.Foldable t, Monad g) =>+    t FilePath+    -> f g+  extensionNoneof =+    F.foldr (\a b -> (.!.) (extensionEq a) .&&. b) always   -- | A predicate that computes its result based on a directory.   directory ::     Monad g =>