Module

Test.QuickCheck.Laws.Control.Align

Package
purescript-these
Repository
purescript-contrib/purescript-these

#checkAlign Source

checkAlign :: forall f. Align f => Arbitrary (f A) => Arbitrary (f B) => Arbitrary (f C) => Eq (f (These A A)) => Eq (f (These A B)) => Eq (f (These C D)) => Eq (f (These A (These B C))) => Proxy2 f -> Effect Unit

Instances are required to satisfy the following laws:

  • Idempotency: join (align identity) == map (join These)
  • Commutativity align identity x y == swap <$> align identity y x
  • Associativity align identity x (align identity y z) == assoc <$> align identity (align identity x y) z
  • Functoriality align identity (f <$> x) (g <$> y) ≡ bimap f g <$> align identity x y