-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | swap and assoc: Symmetric and Semigroupy Bifunctors
--   
--   Provides generalisations of swap :: (a,b) -> (b,a) and
--   assoc :: ((a,b),c) -> (a,(b,c)) to Bifunctors
--   supporting similar operations (e.g. Either, These).
@package assoc
@version 1.1.1

module Data.Bifunctor.Assoc

-- | "Semigroup-y" Bifunctors.
--   
--   
--   assoc . unassoc = id
--   unassoc . assoc = id
--   assoc . bimap (bimap f g) h = bimap f (bimap g h) . assoc
--   
--   
--   This library doesn't provide Monoidal class, with left and
--   right unitors. Are they useful in practice?
class Bifunctor p => Assoc (p :: Type -> Type -> Type)
assoc :: Assoc p => p (p a b) c -> p a (p b c)
unassoc :: Assoc p => p a (p b c) -> p (p a b) c
instance Data.Bifunctor.Assoc.Assoc GHC.Internal.Data.Functor.Const.Const
instance Data.Bifunctor.Assoc.Assoc GHC.Internal.Data.Either.Either
instance Data.Bifunctor.Assoc.Assoc (,)

module Data.Bifunctor.Swap

-- | Symmetric Bifunctors.
--   
--   
--   swap . swap = id
--   
--   
--   If p is a Bifunctor the following property is assumed
--   to hold:
--   
--   
--   swap . bimap f g = bimap g f . swap
--   
--   
--   Swap isn't a subclass of Bifunctor, as for example
--   
--   
--   >>> newtype Bipredicate a b = Bipredicate (a -> b -> Bool)
--   
--   
--   is not a Bifunctor but has Swap instance
--   
--   
--   >>> instance Swap Bipredicate where swap (Bipredicate p) = Bipredicate (flip p)
--   
class Swap (p :: Type -> Type -> Type)
swap :: Swap p => p a b -> p b a
instance Data.Bifunctor.Swap.Swap GHC.Internal.Data.Either.Either
instance Data.Bifunctor.Swap.Swap (,)
instance Data.Bifunctor.Swap.Swap ((,,) x)
instance Data.Bifunctor.Swap.Swap ((,,,) x y)
instance Data.Bifunctor.Swap.Swap ((,,,,) x y z)
instance Data.Bifunctor.Swap.Swap ((,,,,,) x y z w)
instance Data.Bifunctor.Swap.Swap ((,,,,,,) x y z w v)
