follow-0.1.0.0: Haskell library to follow content published on any subject.

Safe HaskellNone
LanguageHaskell2010

Follow.Middlewares.Filter.Internal

Description

This module defines some predicate builders and combinators useful to apply the filter middleware to a directory.

Synopsis

Documentation

type Predicate = Entry -> Bool Source #

Predicate that takes an Entry as argument.

equalP :: Eq a => EntryGetter a -> a -> Predicate Source #

Builds a predicate which takes the field returned by the getter and compares with given value for equality. It returns False when field is Nothing.

lessP :: Ord a => EntryGetter a -> a -> Predicate Source #

Builds a predicate which takes the field returned by the getter and compares whether it is less than given value. It returns False when field is Nothing.

greaterP :: Ord a => EntryGetter a -> a -> Predicate Source #

Builds a predicate which takes the field returned by the getter and compares whether it is greater than given value. It returns False when field is Nothing.

infixP :: Text -> EntryGetter Text -> Predicate Source #

Builds a predicate which takes given value and checks whether it is an infix for the field returned by given getter. It returns False when field is Nothing.

prefixP :: Text -> EntryGetter Text -> Predicate Source #

Builds a predicate which takes given value and checks whether it is a prefix for the field returned by given getter. It returns False when field is Nothing.

suffixP :: Text -> EntryGetter Text -> Predicate Source #

Builds a predicate which takes given value and checks whether it is a suffix for the field returned by given getter. It returns False when field is Nothing.

andP :: Predicate -> Predicate -> Predicate Source #

Builds a predicate which combines with a logical and given predicates.

orP :: Predicate -> Predicate -> Predicate Source #

Builds a predicate which combines with a logical or given predicates.

notP :: Predicate -> Predicate Source #

Build a predicte which negates the result of given predicate.