Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
Tumble
gives a Join
semilattice for any Meet
semilattice and vice versa, Lower
bounds for Upper
bounds and vice versa, and swaps the bounds of Bounded
instances.
Instances
Idempotence:
x /\ x == (x :: Tumble Bool)
Associativity:
a /\ (b /\ c) == (a /\ b) /\ (c :: Tumble Bool)
Commutativity:
a /\ b == b /\ (a :: Tumble Bool)
Identity:
upperBound /\ a == (a :: Tumble Bool)
Absorption:
lowerBound /\ a == (lowerBound :: Tumble Bool)
Idempotence:
x \/ x == (x :: Tumble Bool)
Associativity:
a \/ (b \/ c) == (a \/ b) \/ (c :: Tumble Bool)
Commutativity:
a \/ b == b \/ (a :: Tumble Bool)
Identity:
lowerBound \/ a == (a :: Tumble Bool)
Absorption:
upperBound \/ a == (upperBound :: Tumble Bool)
Bounded:
upperBound == (maxBound :: Tumble Bool)
Identity of /\
:
upperBound /\ a == (a :: Tumble Bool)
Absorbing element of \/
:
upperBound \/ a == (upperBound :: Tumble Bool)
Ord:
compare upperBound (a :: Tumble Bool) /= LT
Bounded:
lowerBound == (minBound :: Tumble Bool)
Identity of \/
:
lowerBound \/ a == (a :: Tumble Bool)
Absorbing element of /\
:
lowerBound /\ a == (lowerBound :: Tumble Bool)
Ord:
compare lowerBound (a :: Tumble Bool) /= GT
>>>
import Test.QuickCheck
>>>
instance Arbitrary a => Arbitrary (Tumble a) where arbitrary = Tumble <$> arbitrary ; shrink (Tumble a) = Tumble <$> shrink a