-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A couple of convenience functions for forming predicates. -- -- A couple of convenience functions for forming predicates (currently -- is, isn't, and equals). Also my first library as -- a test ;) @package predicates @version 0.1 -- | Provides a couple of convenience functions to be used for forming -- predicates. module Data.Function.Predicate -- | An example will explain this more than anything: -- --
-- listsLongerThan3Elements :: [[a]] -> [[a]] -- listsLongerThan3Elements = filter (length `is` (>3)) --is :: (a -> b) -> (b -> Bool) -> (a -> Bool) -- | The inverse of is. -- --
-- listsShorterThanFourElements = filter (length `isn't` (>3)) --isn't :: (a -> b) -> (b -> Bool) -> (a -> Bool) -- | This is is with a fixed equality condition. -- -- Example: -- --
-- data Color = White | Black deriving (Eq)
-- data ChessPiece = { color :: Color, name :: String }
-- whitePieces = filter (color `equals` White)
--
equals :: Eq b => (a -> b) -> b -> a -> Bool