Safe Haskell | None |
---|---|
Language | Haskell2010 |
This middleware allows to sort the directory entries according to a
comparison function. The comparison function has a type Entry ->
Entry -> Ordering
.
Some pre-built comparison function builders are also exported. Example:
import Follow
import Follow.Middlewares.Sort
-- Suppose we have a Directory
d
apply (byGetter eTitle) d
Synopsis
- apply :: ComparisonFunction -> Middleware
- byGetter :: Ord a => EntryGetter a -> ComparisonFunction
- type ComparisonFunction = Entry -> Entry -> Ordering
Documentation
apply :: ComparisonFunction -> Middleware Source #
Middleware to sort a directory according to a given comparison function.
byGetter :: Ord a => EntryGetter a -> ComparisonFunction Source #
Creates a comparison function that sorts by the values returned by a getter