    {-# LANGUAGE MultiParamTypeClasses #-}
    {-# LANGUAGE ScopedTypeVariables #-}

    module Test.Validity.Relations.Reflexivity
      ( reflexiveOnElem,
        reflexivityOnGen,
        reflexivity,
        reflexivityOnArbitrary,
      )
    where

    import Data.GenValidity
    import Test.QuickCheck

    -- |
    --
    -- \[
    --   Reflexive(\prec)
    --   \quad\equiv\quad
    --   \forall a: (a \prec a)
    -- \]
    reflexiveOnElem ::
      -- | A relation
      (a -> a -> Bool) ->
      -- | An element
      a ->
      Bool
    reflexiveOnElem :: forall a. (a -> a -> Bool) -> a -> Bool
    reflexiveOnElem a -> a -> Bool
    func a
    a = a -> a -> Bool
    func a
    a a
    a

    reflexivityOnGen ::
      Show a => (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    reflexivityOnGen :: forall a.
    Show a =>
    (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    reflexivityOnGen a -> a -> Bool
    func Gen a
    gen a -> [a]
    s = Gen a -> (a -> [a]) -> (a -> Bool) -> Property
    forall a prop.
    (Show a, Testable prop) =>
    Gen a -> (a -> [a]) -> (a -> prop) -> Property
    forAllShrink Gen a
    gen a -> [a]
    s ((a -> Bool) -> Property) -> (a -> Bool) -> Property
    forall a b. (a -> b) -> a -> b
    $ (a -> a -> Bool) -> a -> Bool
    forall a. (a -> a -> Bool) -> a -> Bool
    reflexiveOnElem a -> a -> Bool
    func

    -- |
    --
    -- prop> reflexivity ((<=) :: Int -> Int -> Bool)
    -- prop> reflexivity ((==) :: Int -> Int -> Bool)
    -- prop> reflexivity ((>=) :: Int -> Int -> Bool)
    -- prop> reflexivity (Data.List.isPrefixOf :: [Int] -> [Int] -> Bool)
    -- prop> reflexivity (Data.List.isSuffixOf :: [Int] -> [Int] -> Bool)
    -- prop> reflexivity (Data.List.isInfixOf :: [Int] -> [Int] -> Bool)
    reflexivity :: (Show a, GenValid a) => (a -> a -> Bool) -> Property
    reflexivity :: forall a. (Show a, GenValid a) => (a -> a -> Bool) -> Property
    reflexivity a -> a -> Bool
    func = (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    forall a.
    Show a =>
    (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    reflexivityOnGen a -> a -> Bool
    func Gen a
    forall a. GenValid a => Gen a
    genValid a -> [a]
    forall a. GenValid a => a -> [a]
    shrinkValid

    -- |
    --
    -- prop> reflexivityOnArbitrary ((<=) :: Int -> Int -> Bool)
    -- prop> reflexivityOnArbitrary ((==) :: Int -> Int -> Bool)
    -- prop> reflexivityOnArbitrary ((>=) :: Int -> Int -> Bool)
    -- prop> reflexivityOnArbitrary (Data.List.isPrefixOf :: [Int] -> [Int] -> Bool)
    -- prop> reflexivityOnArbitrary (Data.List.isSuffixOf :: [Int] -> [Int] -> Bool)
    -- prop> reflexivityOnArbitrary (Data.List.isInfixOf :: [Int] -> [Int] -> Bool)
    reflexivityOnArbitrary :: (Show a, Arbitrary a) => (a -> a -> Bool) -> Property
    reflexivityOnArbitrary :: forall a. (Show a, Arbitrary a) => (a -> a -> Bool) -> Property
    reflexivityOnArbitrary a -> a -> Bool
    func = (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    forall a.
    Show a =>
    (a -> a -> Bool) -> Gen a -> (a -> [a]) -> Property
    reflexivityOnGen a -> a -> Bool
    func Gen a
    forall a. Arbitrary a => Gen a
    arbitrary a -> [a]
    forall a. Arbitrary a => a -> [a]
    shrink