Safe Haskell | Safe-Inferred |
---|

- symmetric :: Eq b => (t -> t -> b) -> t -> t -> Bool
- antisymmetric :: Eq b => (b -> b -> b) -> b -> b -> Bool
- inverts :: Eq b => (b -> b1) -> (b1 -> b) -> b -> Bool
- involutive :: Eq b => (b -> b) -> b -> Bool
- nonDecreasing :: Ord b => (b -> b) -> b -> Bool
- increasing :: Ord b => (b -> b) -> b -> Bool
- fixes :: Eq b => (b -> b) -> b -> Bool
- idempotent :: Eq b => (b -> b) -> b -> Bool
- leftId :: Eq b => (t -> b -> b) -> t -> b -> Bool
- rightId :: Eq b => (b -> t -> b) -> t -> b -> Bool
- identity :: Eq b => (b -> b -> b) -> b -> b -> Bool
- associative :: Eq b => (b -> b -> b) -> b -> b -> b -> Bool
- monoidal :: Eq b => (b -> b -> b) -> b -> b -> b -> b -> Bool
- isomorphic :: (Eq b, Eq b1) => (b -> b1) -> (b1 -> b) -> b -> b1 -> Bool
- partiallyIsomorphic :: Eq b => (b -> b1) -> (b1 -> Maybe b) -> b -> Bool
- absorptive :: Eq b => (b -> b -> b) -> (b -> b -> b) -> b -> b -> Bool
- equalizes :: Eq b => (a -> b) -> (t -> a) -> (t -> a) -> t -> Bool
- eqBy :: Eq b => (a -> b) -> a -> a -> Bool
- leqBy :: Ord b => (a -> b) -> a -> a -> Bool
- leBy :: Ord b => (a -> b) -> a -> a -> Bool
- symmetricBy :: Eq b => (a -> b) -> (t -> t -> a) -> t -> t -> Bool
- antisymmetricBy :: Eq b => (t -> b) -> (t -> t -> t) -> t -> t -> Bool
- invertsBy :: Eq b => (a -> b) -> (a -> b1) -> (b1 -> a) -> a -> Bool
- involutiveBy :: Eq b => (b1 -> b) -> (b1 -> b1) -> b1 -> Bool
- nonDecreasingBy :: Ord b => (a -> b) -> (a -> a) -> a -> Bool
- increasingBy :: Ord b => (a -> b) -> (a -> a) -> a -> Bool
- fixesBy :: Eq b => (a -> b) -> (a -> a) -> a -> Bool
- idempotentBy :: Eq b => (a -> b) -> (a -> a) -> a -> Bool
- associativeBy :: Eq b => (a -> b) -> (a -> a -> a) -> a -> a -> a -> Bool
- monoidalBy :: Eq b => (a -> b) -> (a -> a -> a) -> a -> a -> a -> a -> Bool
- leftIdBy :: Eq b => (a -> b) -> (t -> a -> a) -> t -> a -> Bool
- rightIdBy :: Eq b => (a -> b) -> (a -> t -> a) -> t -> a -> Bool
- identityBy :: Eq b => (t -> b) -> (t -> t -> t) -> t -> t -> Bool
- isomorphicBy :: (Eq b, Eq b1) => (b2 -> b) -> (a -> b1) -> (b2 -> a) -> (a -> b2) -> b2 -> a -> Bool
- partiallyIsomorphicBy :: Eq b => (a -> b) -> (a -> b1) -> (b1 -> Maybe a) -> a -> Bool
- absorptiveBy :: Eq b => (a -> b) -> (a -> a -> a) -> (a -> a -> a) -> a -> a -> Bool

# Documentation

symmetric :: Eq b => (t -> t -> b) -> t -> t -> BoolSource

f a b == f b a

symmetric (==) :: Int -> Int -> Bool

symmetric (+) :: Int -> Int -> Bool

antisymmetric :: Eq b => (b -> b -> b) -> b -> b -> BoolSource

implies `symmetric`

f a b`a == b`

antisymmetric (-) :: Int -> Int -> Bool

inverts :: Eq b => (b -> b1) -> (b1 -> b) -> b -> BoolSource

a == (g . f) a

inverts pred succ :: Int -> Bool

inverts succ pred :: Char -> Bool

involutive :: Eq b => (b -> b) -> b -> BoolSource

nonDecreasing :: Ord b => (b -> b) -> b -> BoolSource

a <= f a

nonDecreasing id

nonDecreasing (\x -> if even x then x else succ x)

increasing :: Ord b => (b -> b) -> b -> BoolSource

a < f a

increasing succ :: Int -> Bool

fixes :: Eq b => (b -> b) -> b -> BoolSource

Alias for `idempotent`

idempotent :: Eq b => (b -> b) -> b -> BoolSource

f a == f (f a)

idempotent (const "thingy")

idempotent (*0)

idempotent (&& False)

associative :: Eq b => (b -> b -> b) -> b -> b -> b -> BoolSource

f a (f b c) == f (f a b) c

associative (&&)

associative (||)

associative (++)

associative (*)

monoidal :: Eq b => (b -> b -> b) -> b -> b -> b -> b -> BoolSource

and `identity`

f e`associative`

f a b c

monoidal (&&) True

monoidal (||) False

monoidal (++) []

monoidal (*) 1

isomorphic :: (Eq b, Eq b1) => (b -> b1) -> (b1 -> b) -> b -> b1 -> BoolSource

a == (f . g) a && b == (g . f) b

isomorphic succ (pred :: Int -> Int)

isomorphic not not

isomorphic reverse (reverse :: String -> String)

isomorphic snd (((),) :: Int -> ((),Int))

partiallyIsomorphic :: Eq b => (b -> b1) -> (b1 -> Maybe b) -> b -> BoolSource

Just a == (g . f) a

partiallyIsomorphic id Just

partiallyIsomorphic show readMaybe

absorptive :: Eq b => (b -> b -> b) -> (b -> b -> b) -> b -> b -> BoolSource

f a (g a b) == a && g a (f a b) == a

http://en.wikipedia.org/wiki/Absorption_law

absorptive (&&) (||)

absorptive min max

equalizes :: Eq b => (a -> b) -> (t -> a) -> (t -> a) -> t -> BoolSource

eq (f a) == eq (g a)

equalizes even (*2) (*4)

equalizes (const [4]) (take 7) (take 12)

symmetricBy :: Eq b => (a -> b) -> (t -> t -> a) -> t -> t -> BoolSource

antisymmetricBy :: Eq b => (t -> b) -> (t -> t -> t) -> t -> t -> BoolSource

involutiveBy :: Eq b => (b1 -> b) -> (b1 -> b1) -> b1 -> BoolSource

nonDecreasingBy :: Ord b => (a -> b) -> (a -> a) -> a -> BoolSource

increasingBy :: Ord b => (a -> b) -> (a -> a) -> a -> BoolSource

idempotentBy :: Eq b => (a -> b) -> (a -> a) -> a -> BoolSource

associativeBy :: Eq b => (a -> b) -> (a -> a -> a) -> a -> a -> a -> BoolSource

monoidalBy :: Eq b => (a -> b) -> (a -> a -> a) -> a -> a -> a -> a -> BoolSource

identityBy :: Eq b => (t -> b) -> (t -> t -> t) -> t -> t -> BoolSource

isomorphicBy :: (Eq b, Eq b1) => (b2 -> b) -> (a -> b1) -> (b2 -> a) -> (a -> b2) -> b2 -> a -> BoolSource

partiallyIsomorphicBy :: Eq b => (a -> b) -> (a -> b1) -> (b1 -> Maybe a) -> a -> BoolSource

absorptiveBy :: Eq b => (a -> b) -> (a -> a -> a) -> (a -> a -> a) -> a -> a -> BoolSource

= DocTest Setup

`>>>`

`:set -XTupleSections`

`>>>`

`import Text.Read (readMaybe)`