Safe Haskell | None |
---|---|
Language | Haskell2010 |
This middleware allows to filter the directory entries according to a
predicate. The predicate is a function Entry -> Bool
.
Some pre-built predicate builders are also exported. Example:
import Follow import Follow.Middlewares.Filter -- Suppose we have aDirectory
d apply (eTitleequalP
"Some title") d
Synopsis
- apply :: Predicate -> Middleware
- type Predicate = Entry -> Bool
- equalP :: Eq a => EntryGetter a -> a -> Predicate
- lessP :: Ord a => EntryGetter a -> a -> Predicate
- greaterP :: Ord a => EntryGetter a -> a -> Predicate
- infixP :: Text -> EntryGetter Text -> Predicate
- prefixP :: Text -> EntryGetter Text -> Predicate
- suffixP :: Text -> EntryGetter Text -> Predicate
- andP :: Predicate -> Predicate -> Predicate
- orP :: Predicate -> Predicate -> Predicate
- notP :: Predicate -> Predicate
Documentation
apply :: Predicate -> Middleware Source #
Middleware to filter a directory according to a given predicate.
andP :: Predicate -> Predicate -> Predicate Source #
Builds a predicate which combines with a logical and given predicates.