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

-- | Semigroupoids: Category sans id
--   
--   Provides a wide array of (semi)groupoids and operations for working
--   with them.
--   
--   A Semigroupoid is a Category without the requirement of
--   identity arrows for every object in the category.
--   
--   A Category is any Semigroupoid for which the Yoneda
--   lemma holds.
--   
--   When working with comonads you often have the <*>
--   portion of an Applicative, but not the pure. This
--   was captured in Uustalu and Vene's "Essence of Dataflow Programming"
--   in the form of the ComonadZip class in the days before
--   Applicative. Apply provides a weaker invariant, but for the
--   comonads used for data flow programming (found in the streams
--   package), this invariant is preserved. Applicative function
--   composition forms a semigroupoid.
--   
--   Similarly many structures are nearly a comonad, but not quite, for
--   instance lists provide a reasonable extend operation in the
--   form of tails, but do not always contain a value.
--   
--   We describe the relationships between the type classes defined in this
--   package and those from base (and some from
--   contravariant) in the diagram below. Thick-bordered nodes
--   correspond to type classes defined in this package; thin-bordered ones
--   correspond to type classes from elsewhere. Solid edges indicate a
--   subclass relationship that actually exists; dashed edges indicate a
--   subclass relationship that should exist, but currently doesn't.
--   
--   
--   Apply, Bind, and Extend (not shown) give rise the Static, Kleisli and
--   Cokleisli semigroupoids respectively.
--   
--   This lets us remove many of the restrictions from various monad
--   transformers as in many cases the binding operation or
--   <*> operation does not require them.
--   
--   Finally, to work with these weaker structures it is beneficial to have
--   containers that can provide stronger guarantees about their contents,
--   so versions of Traversable and Foldable that can be
--   folded with just a Semigroup are added.
@package semigroupoids
@version 6.0.1

module Data.Functor.Extend
class Functor w => Extend (w :: Type -> Type)

-- | 
--   duplicated = extended id
--   fmap (fmap f) . duplicated = duplicated . fmap f
--   
duplicated :: Extend w => w a -> w (w a)

-- | 
--   extended f  = fmap f . duplicated
--   
extended :: Extend w => (w a -> b) -> w a -> w b

-- | Generic duplicated. Caveats:
--   
--   
--   
- Will not compile if w is a product type.
--   
- Will not compile if w contains fields where the type
--   variable appears underneath the composition of type constructors
--   (e.g., f (g a)).
--   
gduplicated :: (Extend (Rep1 w), Generic1 w) => w a -> w (w a)

-- | Generic extended. Caveats are the same as for
--   gduplicated.
gextended :: (Extend (Rep1 w), Generic1 w) => (w a -> b) -> w a -> w b
instance (Data.Functor.Extend.Extend f, Data.Functor.Extend.Extend g) => Data.Functor.Extend.Extend (f GHC.Internal.Generics.:+: g)
instance Data.Functor.Extend.Extend f => Data.Functor.Extend.Extend (GHC.Internal.Data.Semigroup.Internal.Alt f)
instance Data.Functor.Extend.Extend GHC.Internal.Data.Semigroup.Internal.Dual
instance Data.Functor.Extend.Extend (GHC.Internal.Data.Either.Either a)
instance Data.Functor.Extend.Extend w => Data.Functor.Extend.Extend (Control.Comonad.Trans.Env.EnvT e w)
instance GHC.Internal.Base.Semigroup m => Data.Functor.Extend.Extend ((->) m)
instance Data.Functor.Extend.Extend Data.Semigroup.First
instance Data.Functor.Extend.Extend GHC.Internal.Data.Functor.Identity.Identity
instance Data.Functor.Extend.Extend w => Data.Functor.Extend.Extend (Control.Monad.Trans.Identity.IdentityT w)
instance Data.Functor.Extend.Extend (GHC.Internal.Generics.K1 i c)
instance Data.Functor.Extend.Extend Data.Semigroup.Last
instance Data.Functor.Extend.Extend []
instance Data.Functor.Extend.Extend f => Data.Functor.Extend.Extend (GHC.Internal.Generics.M1 i t f)
instance Data.Functor.Extend.Extend Data.Semigroup.Max
instance Data.Functor.Extend.Extend GHC.Internal.Maybe.Maybe
instance Data.Functor.Extend.Extend Data.Semigroup.Min
instance Data.Functor.Extend.Extend GHC.Internal.Base.NonEmpty
instance Data.Functor.Extend.Extend GHC.Internal.Generics.Par1
instance Data.Functor.Extend.Extend GHC.Internal.Data.Semigroup.Internal.Product
instance Data.Functor.Extend.Extend GHC.Internal.Data.Proxy.Proxy
instance Data.Functor.Extend.Extend f => Data.Functor.Extend.Extend (GHC.Internal.Generics.Rec1 f)
instance Data.Functor.Extend.Extend Data.Sequence.Internal.Seq
instance Data.Functor.Extend.Extend w => Data.Functor.Extend.Extend (Control.Comonad.Trans.Store.StoreT s w)
instance Data.Functor.Extend.Extend GHC.Internal.Data.Semigroup.Internal.Sum
instance (Data.Functor.Extend.Extend f, Data.Functor.Extend.Extend g) => Data.Functor.Extend.Extend (Data.Functor.Sum.Sum f g)
instance Data.Functor.Extend.Extend (Data.Tagged.Tagged a)
instance (Data.Functor.Extend.Extend w, GHC.Internal.Base.Semigroup m) => Data.Functor.Extend.Extend (Control.Comonad.Trans.Traced.TracedT m w)
instance Data.Functor.Extend.Extend Data.Tree.Tree
instance Data.Functor.Extend.Extend ((,) e)
instance Data.Functor.Extend.Extend GHC.Internal.Generics.U1
instance Data.Functor.Extend.Extend GHC.Internal.Generics.V1

-- | Deprecated: This module re-exports a limited subset of the class
--   methods in the Foldable1 and Bifoldable1 classes, which are now
--   located in the Data.Foldable1 and Data.Bifoldable1 modules in
--   base-4.18. (On older versions of base, these can be found in the
--   foldable1-classes-compat library.) Import from these modules
--   instead.
module Data.Semigroup.Foldable.Class

-- | Non-empty data structures that can be folded.
class Foldable t => Foldable1 (t :: Type -> Type)

-- | Given a structure with elements whose type is a Semigroup,
--   combine them via the semigroup's (<>) operator.
--   This fold is right-associative and lazy in the accumulator. When you
--   need a strict left-associative fold, use foldMap1' instead,
--   with id as the map.
fold1 :: (Foldable1 t, Semigroup m) => t m -> m

-- | Map each element of the structure to a semigroup, and combine the
--   results with (<>). This fold is
--   right-associative and lazy in the accumulator. For strict
--   left-associative folds consider foldMap1' instead.
--   
--   
--   >>> foldMap1 (:[]) (1 :| [2, 3, 4])
--   [1,2,3,4]
--   
foldMap1 :: (Foldable1 t, Semigroup m) => (a -> m) -> t a -> m

-- | NonEmpty list of elements of a structure, from left to right.
--   
--   
--   >>> toNonEmpty (Identity 2)
--   2 :| []
--   
toNonEmpty :: Foldable1 t => t a -> NonEmpty a
class Bifoldable t => Bifoldable1 (t :: Type -> Type -> Type)
bifold1 :: (Bifoldable1 t, Semigroup m) => t m m -> m
bifoldMap1 :: (Bifoldable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m

-- | Re-exports from the `base-orphans` and `transformers-compat` packages.
module Data.Traversable.Instances

-- | This module is used to resolve the cyclic we get from defining these
--   classes here rather than in a package upstream. Otherwise we'd get
--   orphaned heads for many instances on the types in
--   transformers and bifunctors.
module Data.Functor.Bind.Class

-- | A strong lax semi-monoidal endofunctor. This is equivalent to an
--   Applicative without pure.
--   
--   Laws:
--   
--   
--   (.) <$> u <.> v <.> w = u <.> (v <.> w)
--   x <.> (f <$> y) = (. f) <$> x <.> y
--   f <$> (x <.> y) = (f .) <$> x <.> y
--   
--   
--   The laws imply that .> and <. really ignore their
--   left and right results, respectively, and really return their right
--   and left results, respectively. Specifically,
--   
--   
--   (mf <$> m) .> (nf <$> n) = nf <$> (m .> n)
--   (mf <$> m) <. (nf <$> n) = mf <$> (m <. n)
--   
class Functor f => Apply (f :: Type -> Type)
(<.>) :: Apply f => f (a -> b) -> f a -> f b

-- | 
--   a .> b = const id <$> a <.> b
--   
(.>) :: Apply f => f a -> f b -> f b

-- | 
--   a <. b = const <$> a <.> b
--   
(<.) :: Apply f => f a -> f b -> f a

-- | Lift a binary function into a comonad with zipping
liftF2 :: Apply f => (a -> b -> c) -> f a -> f b -> f c
infixl 4 <.>
infixl 4 .>
infixl 4 <.

-- | Wrap an Applicative to be used as a member of Apply
newtype WrappedApplicative (f :: Type -> Type) a
WrapApplicative :: f a -> WrappedApplicative (f :: Type -> Type) a
[unwrapApplicative] :: WrappedApplicative (f :: Type -> Type) a -> f a

-- | Transform an Apply into an Applicative by adding a unit.
newtype MaybeApply (f :: Type -> Type) a
MaybeApply :: Either (f a) a -> MaybeApply (f :: Type -> Type) a
[runMaybeApply] :: MaybeApply (f :: Type -> Type) a -> Either (f a) a

-- | Apply a non-empty container of functions to a possibly-empty-with-unit
--   container of values.
(<.*>) :: Apply f => f (a -> b) -> MaybeApply f a -> f b
infixl 4 <.*>

-- | Apply a possibly-empty-with-unit container of functions to a non-empty
--   container of values.
(<*.>) :: Apply f => MaybeApply f (a -> b) -> f a -> f b
infixl 4 <*.>

-- | Traverse a Traversable using Apply, getting the results
--   back in a MaybeApply.
traverse1Maybe :: (Traversable t, Apply f) => (a -> f b) -> t a -> MaybeApply f (t b)

-- | A Monad sans return.
--   
--   Minimal definition: Either join or >>-
--   
--   If defining both, then the following laws (the default definitions)
--   must hold:
--   
--   
--   join = (>>- id)
--   m >>- f = join (fmap f m)
--   
--   
--   Laws:
--   
--   
--   induced definition of <.>: f <.> x = f >>- (<$> x)
--   
--   
--   Finally, there are two associativity conditions:
--   
--   
--   associativity of (>>-):    (m >>- f) >>- g == m >>- (\x -> f x >>- g)
--   associativity of join:     join . join = join . fmap join
--   
--   
--   These can both be seen as special cases of the constraint that
--   
--   
--   associativity of (->-): (f ->- g) ->- h = f ->- (g ->- h)
--   
class Apply m => Bind (m :: Type -> Type)
(>>-) :: Bind m => m a -> (a -> m b) -> m b
join :: Bind m => m (m a) -> m a
infixl 1 >>-
apDefault :: Bind f => f (a -> b) -> f a -> f b
returning :: Functor f => f a -> (a -> b) -> f b
class Bifunctor p => Biapply (p :: Type -> Type -> Type)
(<<.>>) :: Biapply p => p (a -> b) (c -> d) -> p a c -> p b d

-- | 
--   a .> b ≡ const id <$> a <.> b
--   
(.>>) :: Biapply p => p a b -> p c d -> p c d

-- | 
--   a <. b ≡ const <$> a <.> b
--   
(<<.) :: Biapply p => p a b -> p c d -> p a b
infixl 4 <<.>>
infixl 4 .>>
infixl 4 <<.
instance GHC.Internal.Base.Alternative f => GHC.Internal.Base.Alternative (Data.Functor.Bind.Class.WrappedApplicative f)
instance Data.Functor.Bind.Class.Apply f => GHC.Internal.Base.Applicative (Data.Functor.Bind.Class.MaybeApply f)
instance GHC.Internal.Base.Applicative f => GHC.Internal.Base.Applicative (Data.Functor.Bind.Class.WrappedApplicative f)
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Apply g) => Data.Functor.Bind.Class.Apply (f GHC.Internal.Generics.:*: g)
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Apply g) => Data.Functor.Bind.Class.Apply (f GHC.Internal.Generics.:.: g)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (GHC.Internal.Data.Semigroup.Internal.Alt f)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Control.Applicative.Backwards.Backwards f)
instance Data.Functor.Bind.Class.Apply (Control.Comonad.Cokleisli w a)
instance Data.Functor.Bind.Class.Apply Data.Complex.Complex
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Apply g) => Data.Functor.Bind.Class.Apply (Data.Functor.Compose.Compose f g)
instance GHC.Internal.Base.Semigroup m => Data.Functor.Bind.Class.Apply (GHC.Internal.Data.Functor.Const.Const m)
instance GHC.Internal.Base.Semigroup f => Data.Functor.Bind.Class.Apply (Data.Functor.Constant.Constant f)
instance Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Cont.ContT r m)
instance Data.Functor.Bind.Class.Apply GHC.Internal.Data.Ord.Down
instance Data.Functor.Bind.Class.Apply GHC.Internal.Data.Semigroup.Internal.Dual
instance Data.Functor.Bind.Class.Apply (GHC.Internal.Data.Either.Either a)
instance (GHC.Internal.Base.Semigroup e, Data.Functor.Bind.Class.Apply w) => Data.Functor.Bind.Class.Apply (Control.Comonad.Trans.Env.EnvT e w)
instance (GHC.Internal.Base.Functor m, GHC.Internal.Base.Monad m) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Except.ExceptT e m)
instance Data.Functor.Bind.Class.Apply ((->) m)
instance Data.Functor.Bind.Class.Apply Data.Semigroup.First
instance Data.Functor.Bind.Class.Apply GHC.Internal.Data.Monoid.First
instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k) => Data.Functor.Bind.Class.Apply (Data.HashMap.Internal.HashMap k)
instance Data.Functor.Bind.Class.Apply GHC.Types.IO
instance Data.Functor.Bind.Class.Apply GHC.Internal.Data.Functor.Identity.Identity
instance Data.Functor.Bind.Class.Apply w => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Identity.IdentityT w)
instance Data.Functor.Bind.Class.Apply Data.IntMap.Internal.IntMap
instance Data.Functor.Bind.Class.Biapply p => Data.Functor.Bind.Class.Apply (Data.Bifunctor.Join.Join p)
instance GHC.Internal.Base.Semigroup c => Data.Functor.Bind.Class.Apply (GHC.Internal.Generics.K1 i c)
instance Data.Functor.Bind.Class.Apply Data.Semigroup.Last
instance Data.Functor.Bind.Class.Apply GHC.Internal.Data.Monoid.Last
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Control.Applicative.Lift.Lift f)
instance Data.Functor.Bind.Class.Apply []
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (GHC.Internal.Generics.M1 i t f)
instance GHC.Classes.Ord k => Data.Functor.Bind.Class.Apply (Data.Map.Internal.Map k)
instance Data.Functor.Bind.Class.Apply Data.Semigroup.Max
instance Data.Functor.Bind.Class.Apply GHC.Internal.Maybe.Maybe
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Data.Functor.Bind.Class.MaybeApply f)
instance (GHC.Internal.Base.Functor m, GHC.Internal.Base.Monad m) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Maybe.MaybeT m)
instance Data.Functor.Bind.Class.Apply Data.Semigroup.Min
instance Data.Functor.Bind.Class.Apply GHC.Internal.Base.NonEmpty
instance Data.Functor.Bind.Class.Apply GHC.Internal.Generics.Par1
instance Data.Functor.Bind.Class.Apply GHC.Internal.Data.Semigroup.Internal.Product
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Apply g) => Data.Functor.Bind.Class.Apply (Data.Functor.Product.Product f g)
instance Data.Functor.Bind.Class.Apply GHC.Internal.Data.Proxy.Proxy
instance Data.Functor.Bind.Class.Apply Language.Haskell.TH.Syntax.Q
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.RWS.CPS.RWST r w s m)
instance (Data.Functor.Bind.Class.Bind m, GHC.Internal.Base.Semigroup w) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance (Data.Functor.Bind.Class.Bind m, GHC.Internal.Base.Semigroup w) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance Data.Functor.Bind.Class.Apply m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Reader.ReaderT e m)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (GHC.Internal.Generics.Rec1 f)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Data.Functor.Reverse.Reverse f)
instance Data.Functor.Bind.Class.Apply Data.Sequence.Internal.Seq
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.State.Lazy.StateT s m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.State.Strict.StateT s m)
instance (Data.Functor.Bind.Class.Apply w, GHC.Internal.Base.Semigroup s) => Data.Functor.Bind.Class.Apply (Control.Comonad.Trans.Store.StoreT s w)
instance Data.Functor.Bind.Class.Apply GHC.Internal.Data.Semigroup.Internal.Sum
instance Data.Functor.Bind.Class.Apply (Data.Tagged.Tagged a)
instance Data.Functor.Bind.Class.Apply w => Data.Functor.Bind.Class.Apply (Control.Comonad.Trans.Traced.TracedT m w)
instance Data.Functor.Bind.Class.Apply Data.Tree.Tree
instance GHC.Internal.Base.Semigroup m => Data.Functor.Bind.Class.Apply ((,) m)
instance Data.Functor.Bind.Class.Apply GHC.Internal.Generics.U1
instance Data.Functor.Bind.Class.Apply GHC.Internal.Generics.V1
instance GHC.Internal.Base.Applicative f => Data.Functor.Bind.Class.Apply (Data.Functor.Bind.Class.WrappedApplicative f)
instance GHC.Internal.Control.Arrow.Arrow a => Data.Functor.Bind.Class.Apply (Control.Applicative.WrappedArrow a b)
instance GHC.Internal.Base.Monad m => Data.Functor.Bind.Class.Apply (Control.Applicative.WrappedMonad m)
instance (Data.Functor.Bind.Class.Apply m, GHC.Internal.Base.Semigroup w) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance (Data.Functor.Bind.Class.Apply m, GHC.Internal.Base.Semigroup w) => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Apply (Control.Monad.Trans.Writer.CPS.WriterT w m)
instance Data.Functor.Bind.Class.Apply GHC.Internal.Functor.ZipList.ZipList
instance Data.Functor.Bind.Class.Biapply Data.Semigroup.Arg
instance (Data.Functor.Bind.Class.Biapply p, Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Apply g) => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Biff.Biff p f g)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Clown.Clown f)
instance Data.Functor.Bind.Class.Biapply GHC.Internal.Data.Functor.Const.Const
instance Data.Functor.Bind.Class.Biapply p => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Flip.Flip p)
instance Data.Functor.Bind.Class.Apply g => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Joker.Joker g)
instance (Data.Functor.Bind.Class.Biapply p, Data.Functor.Bind.Class.Biapply q) => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Product.Product p q)
instance Data.Functor.Bind.Class.Biapply Data.Tagged.Tagged
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Bind.Class.Biapply p) => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Tannen.Tannen f p)
instance Data.Functor.Bind.Class.Biapply (,)
instance GHC.Internal.Base.Semigroup x => Data.Functor.Bind.Class.Biapply ((,,) x)
instance (GHC.Internal.Base.Semigroup x, GHC.Internal.Base.Semigroup y) => Data.Functor.Bind.Class.Biapply ((,,,) x y)
instance (GHC.Internal.Base.Semigroup x, GHC.Internal.Base.Semigroup y, GHC.Internal.Base.Semigroup z) => Data.Functor.Bind.Class.Biapply ((,,,,) x y z)
instance Data.Functor.Bind.Class.Biapply p => Data.Functor.Bind.Class.Biapply (Data.Bifunctor.Wrapped.WrappedBifunctor p)
instance (Data.Functor.Bind.Class.Bind f, Data.Functor.Bind.Class.Bind g) => Data.Functor.Bind.Class.Bind (f GHC.Internal.Generics.:*: g)
instance Data.Functor.Bind.Class.Bind f => Data.Functor.Bind.Class.Bind (GHC.Internal.Data.Semigroup.Internal.Alt f)
instance Data.Functor.Bind.Class.Bind Data.Complex.Complex
instance Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Cont.ContT r m)
instance Data.Functor.Bind.Class.Bind GHC.Internal.Data.Ord.Down
instance Data.Functor.Bind.Class.Bind GHC.Internal.Data.Semigroup.Internal.Dual
instance Data.Functor.Bind.Class.Bind (GHC.Internal.Data.Either.Either a)
instance (GHC.Internal.Base.Functor m, GHC.Internal.Base.Monad m) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Except.ExceptT e m)
instance Data.Functor.Bind.Class.Bind ((->) m)
instance Data.Functor.Bind.Class.Bind Data.Semigroup.First
instance Data.Functor.Bind.Class.Bind GHC.Internal.Data.Monoid.First
instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k) => Data.Functor.Bind.Class.Bind (Data.HashMap.Internal.HashMap k)
instance Data.Functor.Bind.Class.Bind GHC.Types.IO
instance Data.Functor.Bind.Class.Bind GHC.Internal.Data.Functor.Identity.Identity
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Identity.IdentityT m)
instance Data.Functor.Bind.Class.Bind Data.IntMap.Internal.IntMap
instance Data.Functor.Bind.Class.Bind Data.Semigroup.Last
instance Data.Functor.Bind.Class.Bind GHC.Internal.Data.Monoid.Last
instance Data.Functor.Bind.Class.Bind []
instance Data.Functor.Bind.Class.Bind f => Data.Functor.Bind.Class.Bind (GHC.Internal.Generics.M1 i c f)
instance GHC.Classes.Ord k => Data.Functor.Bind.Class.Bind (Data.Map.Internal.Map k)
instance Data.Functor.Bind.Class.Bind Data.Semigroup.Max
instance Data.Functor.Bind.Class.Bind GHC.Internal.Maybe.Maybe
instance (GHC.Internal.Base.Functor m, GHC.Internal.Base.Monad m) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Maybe.MaybeT m)
instance Data.Functor.Bind.Class.Bind Data.Semigroup.Min
instance Data.Functor.Bind.Class.Bind GHC.Internal.Base.NonEmpty
instance Data.Functor.Bind.Class.Bind GHC.Internal.Generics.Par1
instance Data.Functor.Bind.Class.Bind GHC.Internal.Data.Semigroup.Internal.Product
instance (Data.Functor.Bind.Class.Bind f, Data.Functor.Bind.Class.Bind g) => Data.Functor.Bind.Class.Bind (Data.Functor.Product.Product f g)
instance Data.Functor.Bind.Class.Bind GHC.Internal.Data.Proxy.Proxy
instance Data.Functor.Bind.Class.Bind Language.Haskell.TH.Syntax.Q
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.RWS.CPS.RWST r w s m)
instance (Data.Functor.Bind.Class.Bind m, GHC.Internal.Base.Semigroup w) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance (Data.Functor.Bind.Class.Bind m, GHC.Internal.Base.Semigroup w) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Reader.ReaderT e m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (GHC.Internal.Generics.Rec1 m)
instance Data.Functor.Bind.Class.Bind Data.Sequence.Internal.Seq
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.State.Strict.StateT s m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.State.Lazy.StateT s m)
instance Data.Functor.Bind.Class.Bind GHC.Internal.Data.Semigroup.Internal.Sum
instance Data.Functor.Bind.Class.Bind (Data.Tagged.Tagged a)
instance Data.Functor.Bind.Class.Bind Data.Tree.Tree
instance GHC.Internal.Base.Semigroup m => Data.Functor.Bind.Class.Bind ((,) m)
instance Data.Functor.Bind.Class.Bind GHC.Internal.Generics.U1
instance Data.Functor.Bind.Class.Bind GHC.Internal.Generics.V1
instance GHC.Internal.Base.Monad m => Data.Functor.Bind.Class.Bind (Control.Applicative.WrappedMonad m)
instance Data.Functor.Bind.Class.Bind m => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Writer.CPS.WriterT w m)
instance (Data.Functor.Bind.Class.Bind m, GHC.Internal.Base.Semigroup w) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance (Data.Functor.Bind.Class.Bind m, GHC.Internal.Base.Semigroup w) => Data.Functor.Bind.Class.Bind (Control.Monad.Trans.Writer.Lazy.WriterT w m)
instance Control.Comonad.Comonad f => Control.Comonad.Comonad (Data.Functor.Bind.Class.MaybeApply f)
instance Data.Functor.Extend.Extend f => Data.Functor.Extend.Extend (Data.Functor.Bind.Class.MaybeApply f)
instance GHC.Internal.Base.Functor f => GHC.Internal.Base.Functor (Data.Functor.Bind.Class.MaybeApply f)
instance GHC.Internal.Base.Functor f => GHC.Internal.Base.Functor (Data.Functor.Bind.Class.WrappedApplicative f)

module Data.Functor.Apply

-- | A type f is a Functor if it provides a function fmap
--   which, given any types a and b lets you apply any
--   function from (a -> b) to turn an f a into an
--   f b, preserving the structure of f. Furthermore
--   f needs to adhere to the following:
--   
--   
--   
- Identity fmap id == id
--   
- Composition fmap (f . g) == fmap f .
--   fmap g
--   
--   
--   Note, that the second law follows from the free theorem of the type
--   fmap and the first law, so you need only check that the former
--   condition holds. See these articles by School of Haskell or
--   David Luposchainsky for an explanation.
class Functor (f :: Type -> Type)

-- | fmap is used to apply a function of type (a -> b)
--   to a value of type f a, where f is a functor, to produce a
--   value of type f b. Note that for any type constructor with
--   more than one parameter (e.g., Either), only the last type
--   parameter can be modified with fmap (e.g., b in
--   `Either a b`).
--   
--   Some type constructors with two parameters or more have a
--   Bifunctor instance that allows both the last and the
--   penultimate parameters to be mapped over.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe String
--   using show:
--   
--   
--   >>> fmap show Nothing
--   Nothing
--   
--   >>> fmap show (Just 3)
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an Either Int
--   String using show:
--   
--   
--   >>> fmap show (Left 17)
--   Left 17
--   
--   >>> fmap show (Right 17)
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> fmap (*2) [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> fmap even (2,2)
--   (2,True)
--   
--   
--   It may seem surprising that the function is only applied to the last
--   element of the tuple compared to the list example above which applies
--   it to every element in the list. To understand, remember that tuples
--   are type constructors with multiple type parameters: a tuple of 3
--   elements (a,b,c) can also be written (,,) a b c and
--   its Functor instance is defined for Functor ((,,) a
--   b) (i.e., only the third parameter is free to be mapped over with
--   fmap).
--   
--   It explains why fmap can be used with tuples containing
--   values of different types as in the following example:
--   
--   
--   >>> fmap even ("hello", 1.0, 4)
--   ("hello",1.0,True)
--   
fmap :: Functor f => (a -> b) -> f a -> f b

-- | Replace all locations in the input with the same value. The default
--   definition is fmap . const, but this may be
--   overridden with a more efficient version.
--   
--   
Examples
--   
--   Perform a computation with Maybe and replace the result with a
--   constant value if it is Just:
--   
--   
--   >>> 'a' <$ Just 2
--   Just 'a'
--   
--   >>> 'a' <$ Nothing
--   Nothing
--   
(<$) :: Functor f => a -> f b -> f a
infixl 4 <$

-- | An infix synonym for fmap.
--   
--   The name of this operator is an allusion to $. Note the
--   similarities between their types:
--   
--   
--    ($)  ::              (a -> b) ->   a ->   b
--   (<$>) :: Functor f => (a -> b) -> f a -> f b
--   
--   
--   Whereas $ is function application, <$> is function
--   application lifted over a Functor.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe
--   String using show:
--   
--   
--   >>> show <$> Nothing
--   Nothing
--   
--   
--   
--   >>> show <$> Just 3
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an
--   Either Int String using show:
--   
--   
--   >>> show <$> Left 17
--   Left 17
--   
--   
--   
--   >>> show <$> Right 17
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> (*2) <$> [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> even <$> (2,2)
--   (2,True)
--   
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | Flipped version of <$.
--   
--   
Examples
--   
--   Replace the contents of a Maybe Int with a
--   constant String:
--   
--   
--   >>> Nothing $> "foo"
--   Nothing
--   
--   
--   
--   >>> Just 90210 $> "foo"
--   Just "foo"
--   
--   
--   Replace the contents of an Either Int
--   Int with a constant String, resulting in an
--   Either Int String:
--   
--   
--   >>> Left 8675309 $> "foo"
--   Left 8675309
--   
--   
--   
--   >>> Right 8675309 $> "foo"
--   Right "foo"
--   
--   
--   Replace each element of a list with a constant String:
--   
--   
--   >>> [1,2,3] $> "foo"
--   ["foo","foo","foo"]
--   
--   
--   Replace the second element of a pair with a constant String:
--   
--   
--   >>> (1,2) $> "foo"
--   (1,"foo")
--   
($>) :: Functor f => f a -> b -> f b
infixl 4 $>

-- | A strong lax semi-monoidal endofunctor. This is equivalent to an
--   Applicative without pure.
--   
--   Laws:
--   
--   
--   (.) <$> u <.> v <.> w = u <.> (v <.> w)
--   x <.> (f <$> y) = (. f) <$> x <.> y
--   f <$> (x <.> y) = (f .) <$> x <.> y
--   
--   
--   The laws imply that .> and <. really ignore their
--   left and right results, respectively, and really return their right
--   and left results, respectively. Specifically,
--   
--   
--   (mf <$> m) .> (nf <$> n) = nf <$> (m .> n)
--   (mf <$> m) <. (nf <$> n) = mf <$> (m <. n)
--   
class Functor f => Apply (f :: Type -> Type)
(<.>) :: Apply f => f (a -> b) -> f a -> f b

-- | 
--   a .> b = const id <$> a <.> b
--   
(.>) :: Apply f => f a -> f b -> f b

-- | 
--   a <. b = const <$> a <.> b
--   
(<.) :: Apply f => f a -> f b -> f a

-- | Lift a binary function into a comonad with zipping
liftF2 :: Apply f => (a -> b -> c) -> f a -> f b -> f c
infixl 4 <.>
infixl 4 .>
infixl 4 <.

-- | A variant of <.> with the arguments reversed.
(<..>) :: Apply w => w a -> w (a -> b) -> w b
infixl 4 <..>

-- | Lift a ternary function into a comonad with zipping
liftF3 :: Apply w => (a -> b -> c -> d) -> w a -> w b -> w c -> w d

-- | Generic liftF2. Caveats:
--   
--   
--   
- Will not compile if w is a sum type.
--   
- Types in w that do not mention the type variable must be
--   instances of Semigroup.
--   
gliftF2 :: (Generic1 w, Apply (Rep1 w)) => (a -> b -> c) -> w a -> w b -> w c

-- | Generic liftF3. Caveats are the same as for gliftF2.
gliftF3 :: (Generic1 w, Apply (Rep1 w)) => (a -> b -> c -> d) -> w a -> w b -> w c -> w d

-- | Wrap an Applicative to be used as a member of Apply
newtype WrappedApplicative (f :: Type -> Type) a
WrapApplicative :: f a -> WrappedApplicative (f :: Type -> Type) a
[unwrapApplicative] :: WrappedApplicative (f :: Type -> Type) a -> f a

-- | Transform an Apply into an Applicative by adding a unit.
newtype MaybeApply (f :: Type -> Type) a
MaybeApply :: Either (f a) a -> MaybeApply (f :: Type -> Type) a
[runMaybeApply] :: MaybeApply (f :: Type -> Type) a -> Either (f a) a

-- | Apply a non-empty container of functions to a possibly-empty-with-unit
--   container of values.
(<.*>) :: Apply f => f (a -> b) -> MaybeApply f a -> f b
infixl 4 <.*>

-- | Apply a possibly-empty-with-unit container of functions to a non-empty
--   container of values.
(<*.>) :: Apply f => MaybeApply f (a -> b) -> f a -> f b
infixl 4 <*.>

-- | Re-exports a subset of the Data.Bifoldable1 module along with
--   some additional combinators that require Bifoldable1
--   constraints.
module Data.Semigroup.Bifoldable
class Bifoldable t => Bifoldable1 (t :: Type -> Type -> Type)
bifold1 :: (Bifoldable1 t, Semigroup m) => t m m -> m
bifoldMap1 :: (Bifoldable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m
bitraverse1_ :: (Bifoldable1 t, Apply f) => (a -> f b) -> (c -> f d) -> t a c -> f ()
bifor1_ :: (Bifoldable1 t, Apply f) => t a c -> (a -> f b) -> (c -> f d) -> f ()
bisequenceA1_ :: (Bifoldable1 t, Apply f) => t (f a) (f b) -> f ()

-- | Usable default for foldMap, but only if you define bifoldMap1 yourself
bifoldMapDefault1 :: (Bifoldable1 t, Monoid m) => (a -> m) -> (b -> m) -> t a b -> m
instance GHC.Internal.Base.Functor f => GHC.Internal.Base.Functor (Data.Semigroup.Bifoldable.Act f)
instance Data.Functor.Bind.Class.Apply f => GHC.Internal.Base.Semigroup (Data.Semigroup.Bifoldable.Act f a)

-- | This module is only available if building with GHC 8.6 or later, or if
--   the +contravariant cabal build flag is available.
module Data.Functor.Contravariant.Divise

-- | The contravariant analogue of Apply; it is Divisible
--   without conquer.
--   
--   If one thinks of f a as a consumer of as, then
--   divise allows one to handle the consumption of a value by
--   splitting it between two consumers that consume separate parts of
--   a.
--   
--   divise takes the "splitting" method and the two sub-consumers,
--   and returns the wrapped/combined consumer.
--   
--   All instances of Divisible should be instances of Divise
--   with divise = divide.
--   
--   If a function is polymorphic over Divise f (as opposed
--   to Divisible f), we can provide a stronger guarantee:
--   namely, that any input consumed will be passed to at least one
--   sub-consumer. With Divisible f, said input could
--   potentially disappear into the void, as this is possible with
--   conquer.
--   
--   Mathematically, a functor being an instance of Divise means
--   that it is "semigroupoidal" with respect to the contravariant
--   (tupling) Day convolution. That is, it is possible to define a
--   function (f Day f) a -> f a in a way that is
--   associative.
class Contravariant f => Divise (f :: Type -> Type)

-- | Takes a "splitting" method and the two sub-consumers, and returns the
--   wrapped/combined consumer.
divise :: Divise f => (a -> (b, c)) -> f b -> f c -> f a

-- | Generic divise. Caveats:
--   
--   
--   
- Will not compile if f is a sum type.
--   
- Will not compile if f contains fields that do not mention
--   its type variable.
--   
- -XDeriveGeneric is not smart enough to make instances
--   where the type variable appears in negative position.
--   
gdivise :: (Divise (Rep1 f), Generic1 f) => (a -> (b, c)) -> f b -> f c -> f a

-- | Combine a consumer of a with a consumer of b to get
--   a consumer of (a, b).
--   
--   
--   divised = divise id
--   
divised :: Divise f => f a -> f b -> f (a, b)

-- | Generic divised. Caveats are the same as for gdivise.
gdivised :: (Generic1 f, Divise (Rep1 f)) => f a -> f b -> f (a, b)

-- | Wrap a Divisible to be used as a member of Divise
newtype WrappedDivisible (f :: Type -> Type) a
WrapDivisible :: f a -> WrappedDivisible (f :: Type -> Type) a
[unwrapDivisible] :: WrappedDivisible (f :: Type -> Type) a -> f a
instance Data.Functor.Contravariant.Contravariant f => Data.Functor.Contravariant.Contravariant (Data.Functor.Contravariant.Divise.WrappedDivisible f)
instance (Data.Functor.Contravariant.Divise.Divise f, Data.Functor.Contravariant.Divise.Divise g) => Data.Functor.Contravariant.Divise.Divise (f GHC.Internal.Generics.:*: g)
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Contravariant.Divise.Divise g) => Data.Functor.Contravariant.Divise.Divise (f GHC.Internal.Generics.:.: g)
instance Data.Functor.Contravariant.Divise.Divise f => Data.Functor.Contravariant.Divise.Divise (GHC.Internal.Data.Semigroup.Internal.Alt f)
instance Data.Functor.Contravariant.Divise.Divise f => Data.Functor.Contravariant.Divise.Divise (Control.Applicative.Backwards.Backwards f)
instance Data.Functor.Contravariant.Divise.Divise Data.Functor.Contravariant.Comparison
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Contravariant.Divise.Divise g) => Data.Functor.Contravariant.Divise.Divise (Data.Functor.Compose.Compose f g)
instance GHC.Internal.Base.Semigroup m => Data.Functor.Contravariant.Divise.Divise (GHC.Internal.Data.Functor.Const.Const m)
instance GHC.Internal.Base.Semigroup m => Data.Functor.Contravariant.Divise.Divise (Data.Functor.Constant.Constant m)
instance Data.Functor.Contravariant.Divise.Divise Data.Functor.Contravariant.Equivalence
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.Except.ExceptT e m)
instance Data.Functor.Contravariant.Divise.Divise f => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Functor.Contravariant.Divise.Divise f => Data.Functor.Contravariant.Divise.Divise (GHC.Internal.Generics.M1 i c f)
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.Maybe.MaybeT m)
instance GHC.Internal.Base.Semigroup r => Data.Functor.Contravariant.Divise.Divise (Data.Functor.Contravariant.Op r)
instance Data.Functor.Contravariant.Divise.Divise Data.Functor.Contravariant.Predicate
instance (Data.Functor.Contravariant.Divise.Divise f, Data.Functor.Contravariant.Divise.Divise g) => Data.Functor.Contravariant.Divise.Divise (Data.Functor.Product.Product f g)
instance Data.Functor.Contravariant.Divise.Divise GHC.Internal.Data.Proxy.Proxy
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.Reader.ReaderT r m)
instance Data.Functor.Contravariant.Divise.Divise f => Data.Functor.Contravariant.Divise.Divise (GHC.Internal.Generics.Rec1 f)
instance Data.Functor.Contravariant.Divise.Divise f => Data.Functor.Contravariant.Divise.Divise (Data.Functor.Reverse.Reverse f)
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.State.Strict.StateT s m)
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.State.Lazy.StateT s m)
instance Data.Functor.Contravariant.Divise.Divise GHC.Internal.Generics.U1
instance Data.Functor.Contravariant.Divise.Divise GHC.Internal.Generics.V1
instance Data.Functor.Contravariant.Divisible.Divisible f => Data.Functor.Contravariant.Divise.Divise (Data.Functor.Contravariant.Divise.WrappedDivisible f)
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Divise.Divise (Control.Monad.Trans.Writer.Lazy.WriterT w m)

-- | This module is only available if building with GHC 8.6 or later, or if
--   the +contravariant cabal build flag is available.
module Data.Functor.Contravariant.Decide

-- | The contravariant analogue of Alt.
--   
--   If one thinks of f a as a consumer of as, then
--   decide allows one to handle the consumption of a value by
--   choosing to handle it via exactly one of two independent consumers. It
--   redirects the input completely into one of two consumers.
--   
--   decide takes the "decision" method and the two potential
--   consumers, and returns the wrapped/combined consumer.
--   
--   Mathematically, a functor being an instance of Decide means
--   that it is "semigroupoidal" with respect to the contravariant
--   "either-based" Day convolution (data EitherDay f g a = forall b c.
--   EitherDay (f b) (g c) (a -> Either b c)). That is, it is
--   possible to define a function (f EitherDay f) a -> f
--   a in a way that is associative.
class Contravariant f => Decide (f :: Type -> Type)

-- | Takes the "decision" method and the two potential consumers, and
--   returns the wrapped/combined consumer.
decide :: Decide f => (a -> Either b c) -> f b -> f c -> f a

-- | Generic decide. Caveats:
--   
--   
--   
- Will not compile if f is a sum type.
--   
- Will not compile if f contains fields that do not mention
--   its type variable.
--   
- -XDeriveGeneric is not smart enough to make instances
--   where the type variable appears in negative position.
--   
gdecide :: (Generic1 f, Decide (Rep1 f)) => (a -> Either b c) -> f b -> f c -> f a

-- | For decided x y, the resulting f (Either b
--   c) will direct Lefts to be consumed by x, and
--   Rights to be consumed by y.
decided :: Decide f => f b -> f c -> f (Either b c)

-- | Generic decided. Caveats are the same as for gdecide.
gdecided :: (Generic1 f, Decide (Rep1 f)) => f b -> f c -> f (Either b c)
instance (Data.Functor.Contravariant.Decide.Decide f, Data.Functor.Contravariant.Decide.Decide g) => Data.Functor.Contravariant.Decide.Decide (f GHC.Internal.Generics.:*: g)
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Contravariant.Decide.Decide g) => Data.Functor.Contravariant.Decide.Decide (f GHC.Internal.Generics.:.: g)
instance Data.Functor.Contravariant.Decide.Decide f => Data.Functor.Contravariant.Decide.Decide (GHC.Internal.Data.Semigroup.Internal.Alt f)
instance Data.Functor.Contravariant.Decide.Decide f => Data.Functor.Contravariant.Decide.Decide (Control.Applicative.Backwards.Backwards f)
instance Data.Functor.Contravariant.Decide.Decide Data.Functor.Contravariant.Comparison
instance (Data.Functor.Bind.Class.Apply f, Data.Functor.Contravariant.Decide.Decide g) => Data.Functor.Contravariant.Decide.Decide (Data.Functor.Compose.Compose f g)
instance Data.Functor.Contravariant.Decide.Decide Data.Functor.Contravariant.Equivalence
instance Data.Functor.Contravariant.Decide.Decide f => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Functor.Contravariant.Decide.Decide f => Data.Functor.Contravariant.Decide.Decide (GHC.Internal.Generics.M1 i c f)
instance Data.Functor.Contravariant.Divise.Divise m => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.Maybe.MaybeT m)
instance Data.Functor.Contravariant.Decide.Decide (Data.Functor.Contravariant.Op r)
instance Data.Functor.Contravariant.Decide.Decide Data.Functor.Contravariant.Predicate
instance (Data.Functor.Contravariant.Decide.Decide f, Data.Functor.Contravariant.Decide.Decide g) => Data.Functor.Contravariant.Decide.Decide (Data.Functor.Product.Product f g)
instance Data.Functor.Contravariant.Decide.Decide GHC.Internal.Data.Proxy.Proxy
instance Data.Functor.Contravariant.Decide.Decide m => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance Data.Functor.Contravariant.Decide.Decide m => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Data.Functor.Contravariant.Decide.Decide m => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.Reader.ReaderT r m)
instance Data.Functor.Contravariant.Decide.Decide f => Data.Functor.Contravariant.Decide.Decide (GHC.Internal.Generics.Rec1 f)
instance Data.Functor.Contravariant.Decide.Decide f => Data.Functor.Contravariant.Decide.Decide (Data.Functor.Reverse.Reverse f)
instance Data.Functor.Contravariant.Decide.Decide m => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.State.Strict.StateT s m)
instance Data.Functor.Contravariant.Decide.Decide m => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.State.Lazy.StateT s m)
instance Data.Functor.Contravariant.Decide.Decide GHC.Internal.Generics.U1
instance Data.Functor.Contravariant.Decide.Decide GHC.Internal.Generics.V1
instance Data.Functor.Contravariant.Divisible.Decidable f => Data.Functor.Contravariant.Decide.Decide (Data.Functor.Contravariant.Divise.WrappedDivisible f)
instance Data.Functor.Contravariant.Decide.Decide m => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance Data.Functor.Contravariant.Decide.Decide m => Data.Functor.Contravariant.Decide.Decide (Control.Monad.Trans.Writer.Lazy.WriterT w m)

-- | This module is only available if building with GHC 8.6 or later, or if
--   the +contravariant cabal build flag is available.
module Data.Functor.Contravariant.Conclude

-- | The contravariant analogue of Plus. Adds on to Decide
--   the ability to express a combinator that rejects all input, to act as
--   the dead-end. Essentially Decidable without a superclass
--   constraint on Divisible.
--   
--   If one thinks of f a as a consumer of as, then
--   conclude defines a consumer that cannot ever receive any
--   input.
--   
--   Conclude acts as an identity with decide, because any decision
--   that involves conclude must necessarily always pick the
--   other option.
--   
--   That is, for, say,
--   
--   
--   decide f x concluded
--   
--   
--   f is the deciding function that picks which of the inputs of
--   decide to direct input to; in the situation above, f
--   must always direct all input to x, and never
--   concluded.
--   
--   Mathematically, a functor being an instance of Decide means
--   that it is "monoidal" with respect to the contravariant "either-based"
--   Day convolution described in the documentation of Decide. On
--   top of Decide, it adds a way to construct an "identity"
--   conclude where decide f x (conclude q) == x, and
--   decide g (conclude r) y == y.
class Decide f => Conclude (f :: Type -> Type)

-- | The consumer that cannot ever receive any input.
conclude :: Conclude f => (a -> Void) -> f a

-- | Generic conclude. Caveats:
--   
--   
--   
- Will not compile if f is a sum type.
--   
- Will not compile if f contains fields that do not mention
--   its type variable.
--   
gconclude :: (Generic1 f, Conclude (Rep1 f)) => (a -> Void) -> f a

-- | A potentially more meaningful form of conclude, the consumer
--   that cannot ever receive any input. That is because it expects
--   only input of type Void, but such a type has no values.
--   
--   
--   concluded = conclude id
--   
concluded :: Conclude f => f Void

-- | Generic concluded. Caveats are the same as for
--   gconclude.
gconcluded :: (Generic1 f, Conclude (Rep1 f)) => f Void
instance (Data.Functor.Contravariant.Conclude.Conclude f, Data.Functor.Contravariant.Conclude.Conclude g) => Data.Functor.Contravariant.Conclude.Conclude (f GHC.Internal.Generics.:*: g)
instance (Data.Functor.Bind.Class.Apply f, GHC.Internal.Base.Applicative f, Data.Functor.Contravariant.Conclude.Conclude g) => Data.Functor.Contravariant.Conclude.Conclude (f GHC.Internal.Generics.:.: g)
instance Data.Functor.Contravariant.Conclude.Conclude f => Data.Functor.Contravariant.Conclude.Conclude (GHC.Internal.Data.Semigroup.Internal.Alt f)
instance Data.Functor.Contravariant.Conclude.Conclude f => Data.Functor.Contravariant.Conclude.Conclude (Control.Applicative.Backwards.Backwards f)
instance Data.Functor.Contravariant.Conclude.Conclude Data.Functor.Contravariant.Comparison
instance (Data.Functor.Bind.Class.Apply f, GHC.Internal.Base.Applicative f, Data.Functor.Contravariant.Conclude.Conclude g) => Data.Functor.Contravariant.Conclude.Conclude (Data.Functor.Compose.Compose f g)
instance Data.Functor.Contravariant.Conclude.Conclude Data.Functor.Contravariant.Equivalence
instance Data.Functor.Contravariant.Conclude.Conclude f => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Functor.Contravariant.Conclude.Conclude f => Data.Functor.Contravariant.Conclude.Conclude (GHC.Internal.Generics.M1 i c f)
instance (Data.Functor.Contravariant.Divisible.Divisible m, Data.Functor.Contravariant.Divise.Divise m) => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.Maybe.MaybeT m)
instance Data.Functor.Contravariant.Conclude.Conclude (Data.Functor.Contravariant.Op r)
instance Data.Functor.Contravariant.Conclude.Conclude Data.Functor.Contravariant.Predicate
instance (Data.Functor.Contravariant.Conclude.Conclude f, Data.Functor.Contravariant.Conclude.Conclude g) => Data.Functor.Contravariant.Conclude.Conclude (Data.Functor.Product.Product f g)
instance Data.Functor.Contravariant.Conclude.Conclude GHC.Internal.Data.Proxy.Proxy
instance Data.Functor.Contravariant.Conclude.Conclude m => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.RWS.Strict.RWST r w s m)
instance Data.Functor.Contravariant.Conclude.Conclude m => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.RWS.Lazy.RWST r w s m)
instance Data.Functor.Contravariant.Conclude.Conclude m => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.Reader.ReaderT r m)
instance Data.Functor.Contravariant.Conclude.Conclude f => Data.Functor.Contravariant.Conclude.Conclude (GHC.Internal.Generics.Rec1 f)
instance Data.Functor.Contravariant.Conclude.Conclude f => Data.Functor.Contravariant.Conclude.Conclude (Data.Functor.Reverse.Reverse f)
instance Data.Functor.Contravariant.Conclude.Conclude m => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.State.Strict.StateT s m)
instance Data.Functor.Contravariant.Conclude.Conclude m => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.State.Lazy.StateT s m)
instance Data.Functor.Contravariant.Conclude.Conclude GHC.Internal.Generics.U1
instance Data.Functor.Contravariant.Divisible.Decidable f => Data.Functor.Contravariant.Conclude.Conclude (Data.Functor.Contravariant.Divise.WrappedDivisible f)
instance Data.Functor.Contravariant.Conclude.Conclude m => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.Writer.Strict.WriterT w m)
instance Data.Functor.Contravariant.Conclude.Conclude m => Data.Functor.Contravariant.Conclude.Conclude (Control.Monad.Trans.Writer.Lazy.WriterT w m)

module Data.Functor.Bind

-- | A type f is a Functor if it provides a function fmap
--   which, given any types a and b lets you apply any
--   function from (a -> b) to turn an f a into an
--   f b, preserving the structure of f. Furthermore
--   f needs to adhere to the following:
--   
--   
--   
- Identity fmap id == id
--   
- Composition fmap (f . g) == fmap f .
--   fmap g
--   
--   
--   Note, that the second law follows from the free theorem of the type
--   fmap and the first law, so you need only check that the former
--   condition holds. See these articles by School of Haskell or
--   David Luposchainsky for an explanation.
class Functor (f :: Type -> Type)

-- | fmap is used to apply a function of type (a -> b)
--   to a value of type f a, where f is a functor, to produce a
--   value of type f b. Note that for any type constructor with
--   more than one parameter (e.g., Either), only the last type
--   parameter can be modified with fmap (e.g., b in
--   `Either a b`).
--   
--   Some type constructors with two parameters or more have a
--   Bifunctor instance that allows both the last and the
--   penultimate parameters to be mapped over.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe String
--   using show:
--   
--   
--   >>> fmap show Nothing
--   Nothing
--   
--   >>> fmap show (Just 3)
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an Either Int
--   String using show:
--   
--   
--   >>> fmap show (Left 17)
--   Left 17
--   
--   >>> fmap show (Right 17)
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> fmap (*2) [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> fmap even (2,2)
--   (2,True)
--   
--   
--   It may seem surprising that the function is only applied to the last
--   element of the tuple compared to the list example above which applies
--   it to every element in the list. To understand, remember that tuples
--   are type constructors with multiple type parameters: a tuple of 3
--   elements (a,b,c) can also be written (,,) a b c and
--   its Functor instance is defined for Functor ((,,) a
--   b) (i.e., only the third parameter is free to be mapped over with
--   fmap).
--   
--   It explains why fmap can be used with tuples containing
--   values of different types as in the following example:
--   
--   
--   >>> fmap even ("hello", 1.0, 4)
--   ("hello",1.0,True)
--   
fmap :: Functor f => (a -> b) -> f a -> f b

-- | Replace all locations in the input with the same value. The default
--   definition is fmap . const, but this may be
--   overridden with a more efficient version.
--   
--   
Examples
--   
--   Perform a computation with Maybe and replace the result with a
--   constant value if it is Just:
--   
--   
--   >>> 'a' <$ Just 2
--   Just 'a'
--   
--   >>> 'a' <$ Nothing
--   Nothing
--   
(<$) :: Functor f => a -> f b -> f a
infixl 4 <$

-- | An infix synonym for fmap.
--   
--   The name of this operator is an allusion to $. Note the
--   similarities between their types:
--   
--   
--    ($)  ::              (a -> b) ->   a ->   b
--   (<$>) :: Functor f => (a -> b) -> f a -> f b
--   
--   
--   Whereas $ is function application, <$> is function
--   application lifted over a Functor.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe
--   String using show:
--   
--   
--   >>> show <$> Nothing
--   Nothing
--   
--   
--   
--   >>> show <$> Just 3
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an
--   Either Int String using show:
--   
--   
--   >>> show <$> Left 17
--   Left 17
--   
--   
--   
--   >>> show <$> Right 17
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> (*2) <$> [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> even <$> (2,2)
--   (2,True)
--   
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | Flipped version of <$.
--   
--   
Examples
--   
--   Replace the contents of a Maybe Int with a
--   constant String:
--   
--   
--   >>> Nothing $> "foo"
--   Nothing
--   
--   
--   
--   >>> Just 90210 $> "foo"
--   Just "foo"
--   
--   
--   Replace the contents of an Either Int
--   Int with a constant String, resulting in an
--   Either Int String:
--   
--   
--   >>> Left 8675309 $> "foo"
--   Left 8675309
--   
--   
--   
--   >>> Right 8675309 $> "foo"
--   Right "foo"
--   
--   
--   Replace each element of a list with a constant String:
--   
--   
--   >>> [1,2,3] $> "foo"
--   ["foo","foo","foo"]
--   
--   
--   Replace the second element of a pair with a constant String:
--   
--   
--   >>> (1,2) $> "foo"
--   (1,"foo")
--   
($>) :: Functor f => f a -> b -> f b
infixl 4 $>

-- | A strong lax semi-monoidal endofunctor. This is equivalent to an
--   Applicative without pure.
--   
--   Laws:
--   
--   
--   (.) <$> u <.> v <.> w = u <.> (v <.> w)
--   x <.> (f <$> y) = (. f) <$> x <.> y
--   f <$> (x <.> y) = (f .) <$> x <.> y
--   
--   
--   The laws imply that .> and <. really ignore their
--   left and right results, respectively, and really return their right
--   and left results, respectively. Specifically,
--   
--   
--   (mf <$> m) .> (nf <$> n) = nf <$> (m .> n)
--   (mf <$> m) <. (nf <$> n) = mf <$> (m <. n)
--   
class Functor f => Apply (f :: Type -> Type)
(<.>) :: Apply f => f (a -> b) -> f a -> f b

-- | 
--   a .> b = const id <$> a <.> b
--   
(.>) :: Apply f => f a -> f b -> f b

-- | 
--   a <. b = const <$> a <.> b
--   
(<.) :: Apply f => f a -> f b -> f a

-- | Lift a binary function into a comonad with zipping
liftF2 :: Apply f => (a -> b -> c) -> f a -> f b -> f c
infixl 4 <.>
infixl 4 .>
infixl 4 <.

-- | A variant of <.> with the arguments reversed.
(<..>) :: Apply w => w a -> w (a -> b) -> w b
infixl 4 <..>

-- | Lift a ternary function into a comonad with zipping
liftF3 :: Apply w => (a -> b -> c -> d) -> w a -> w b -> w c -> w d

-- | Wrap an Applicative to be used as a member of Apply
newtype WrappedApplicative (f :: Type -> Type) a
WrapApplicative :: f a -> WrappedApplicative (f :: Type -> Type) a
[unwrapApplicative] :: WrappedApplicative (f :: Type -> Type) a -> f a

-- | Transform an Apply into an Applicative by adding a unit.
newtype MaybeApply (f :: Type -> Type) a
MaybeApply :: Either (f a) a -> MaybeApply (f :: Type -> Type) a
[runMaybeApply] :: MaybeApply (f :: Type -> Type) a -> Either (f a) a

-- | A Monad sans return.
--   
--   Minimal definition: Either join or >>-
--   
--   If defining both, then the following laws (the default definitions)
--   must hold:
--   
--   
--   join = (>>- id)
--   m >>- f = join (fmap f m)
--   
--   
--   Laws:
--   
--   
--   induced definition of <.>: f <.> x = f >>- (<$> x)
--   
--   
--   Finally, there are two associativity conditions:
--   
--   
--   associativity of (>>-):    (m >>- f) >>- g == m >>- (\x -> f x >>- g)
--   associativity of join:     join . join = join . fmap join
--   
--   
--   These can both be seen as special cases of the constraint that
--   
--   
--   associativity of (->-): (f ->- g) ->- h = f ->- (g ->- h)
--   
class Apply m => Bind (m :: Type -> Type)
(>>-) :: Bind m => m a -> (a -> m b) -> m b
join :: Bind m => m (m a) -> m a
infixl 1 >>-

-- | Generic (>>-). Caveats:
--   
--   
--   
- Will not compile if m is a sum type.
--   
- Will not compile if m contains fields that do not mention
--   its type variable.
--   
- Will not compile if m contains fields where the type
--   variable appears underneath the composition of type constructors
--   (e.g., f (g a)).
--   
- May do redundant work, due to the nature of the Bind
--   instance for (:*:)
--   
gbind :: (Generic1 m, Bind (Rep1 m)) => m a -> (a -> m b) -> m b
(-<<) :: Bind m => (a -> m b) -> m a -> m b
infixr 1 -<<
(-<-) :: Bind m => (b -> m c) -> (a -> m b) -> a -> m c
infixr 1 -<-
(->-) :: Bind m => (a -> m b) -> (b -> m c) -> a -> m c
infixr 1 ->-
apDefault :: Bind f => f (a -> b) -> f a -> f b
returning :: Functor f => f a -> (a -> b) -> f b

-- | A semigroupoid satisfies all of the requirements to be a Category
--   except for the existence of identity arrows.
module Data.Semigroupoid

-- | Category sans id
class Semigroupoid (c :: k -> k -> Type)
o :: forall (j :: k) (k1 :: k) (i :: k). Semigroupoid c => c j k1 -> c i j -> c i k1
newtype WrappedCategory (k2 :: k -> k1 -> Type) (a :: k) (b :: k1)
WrapCategory :: k2 a b -> WrappedCategory (k2 :: k -> k1 -> Type) (a :: k) (b :: k1)
[unwrapCategory] :: WrappedCategory (k2 :: k -> k1 -> Type) (a :: k) (b :: k1) -> k2 a b
newtype Semi m (a :: k) (b :: k1)
Semi :: m -> Semi m (a :: k) (b :: k1)
[getSemi] :: Semi m (a :: k) (b :: k1) -> m
instance GHC.Internal.Base.Monoid m => GHC.Internal.Control.Category.Category (Data.Semigroupoid.Semi m)
instance forall k1 (k2 :: k1 -> k1 -> *). GHC.Internal.Control.Category.Category k2 => GHC.Internal.Control.Category.Category (Data.Semigroupoid.WrappedCategory k2)
instance Data.Functor.Extend.Extend w => Data.Semigroupoid.Semigroupoid (Control.Comonad.Cokleisli w)
instance Data.Semigroupoid.Semigroupoid GHC.Internal.Data.Functor.Const.Const
instance Data.Semigroupoid.Semigroupoid (->)
instance Data.Functor.Bind.Class.Bind m => Data.Semigroupoid.Semigroupoid (GHC.Internal.Control.Arrow.Kleisli m)
instance Data.Semigroupoid.Semigroupoid Data.Functor.Contravariant.Op
instance Data.Semigroupoid.Semigroupoid Data.Tagged.Tagged
instance Data.Semigroupoid.Semigroupoid (,)
instance Data.Semigroupoid.Semigroupoid (GHC.Internal.Data.Type.Equality.:~:)
instance Data.Semigroupoid.Semigroupoid (GHC.Internal.Data.Type.Equality.:~~:)
instance Data.Semigroupoid.Semigroupoid GHC.Internal.Data.Type.Coercion.Coercion
instance GHC.Internal.Base.Semigroup m => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.Semi m)
instance forall k1 (k2 :: k1 -> k1 -> *). GHC.Internal.Control.Category.Category k2 => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.WrappedCategory k2)

module Data.Semigroupoid.Ob
class Semigroupoid k1 => Ob (k1 :: k -> k -> Type) (a :: k)
semiid :: Ob k1 a => k1 a a
instance (Data.Functor.Extend.Extend w, Control.Comonad.Comonad w) => Data.Semigroupoid.Ob.Ob (Control.Comonad.Cokleisli w) a
instance Data.Semigroupoid.Ob.Ob (->) a
instance (Data.Functor.Bind.Class.Bind m, GHC.Internal.Base.Monad m) => Data.Semigroupoid.Ob.Ob (GHC.Internal.Control.Arrow.Kleisli m) a

-- | A semigroupoid satisfies all of the requirements to be a Category
--   except for the existence of identity arrows.
module Data.Semigroupoid.Dual
newtype Dual (k2 :: k -> k1 -> Type) (a :: k1) (b :: k)
Dual :: k2 b a -> Dual (k2 :: k -> k1 -> Type) (a :: k1) (b :: k)
[getDual] :: Dual (k2 :: k -> k1 -> Type) (a :: k1) (b :: k) -> k2 b a
instance forall k1 (k2 :: k1 -> k1 -> *). GHC.Internal.Control.Category.Category k2 => GHC.Internal.Control.Category.Category (Data.Semigroupoid.Dual.Dual k2)
instance forall k1 (k2 :: k1 -> k1 -> *). Data.Semigroupoid.Semigroupoid k2 => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.Dual.Dual k2)

-- | Provides a way to attach an identity to any semigroupoid.
module Data.Semigroupoid.Categorical

-- | Attaches an identity.
data Categorical (s :: Type -> Type -> Type) a b
[Id] :: forall (s :: Type -> Type -> Type) a. Categorical s a a
[Embed] :: forall (s :: Type -> Type -> Type) a b. s a b -> Categorical s a b

runCategorical :: (a ~ b => r) -> (s a b -> r) -> Categorical s a b -> r
instance Data.Semigroupoid.Semigroupoid s => GHC.Internal.Control.Category.Category (Data.Semigroupoid.Categorical.Categorical s)
instance Data.Semigroupoid.Semigroupoid s => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.Categorical.Categorical s)

module Data.Groupoid

-- | semigroupoid with inverses. This technically should be a category with
--   inverses, except we need to use Ob to define the valid objects for the
--   category
class Semigroupoid k1 => Groupoid (k1 :: k -> k -> Type)
inv :: forall (a :: k) (b :: k). Groupoid k1 => k1 a b -> k1 b a
instance Data.Groupoid.Groupoid (GHC.Internal.Data.Type.Equality.:~:)
instance Data.Groupoid.Groupoid (GHC.Internal.Data.Type.Equality.:~~:)
instance Data.Groupoid.Groupoid GHC.Internal.Data.Type.Coercion.Coercion
instance forall k1 (k2 :: k1 -> k1 -> *). Data.Groupoid.Groupoid k2 => Data.Groupoid.Groupoid (Data.Semigroupoid.Dual.Dual k2)

module Data.Isomorphism
data Iso (k1 :: k -> k -> Type) (a :: k) (b :: k)
Iso :: k1 a b -> k1 b a -> Iso (k1 :: k -> k -> Type) (a :: k) (b :: k)
[embed] :: Iso (k1 :: k -> k -> Type) (a :: k) (b :: k) -> k1 a b
[project] :: Iso (k1 :: k -> k -> Type) (a :: k) (b :: k) -> k1 b a
instance forall k1 (k2 :: k1 -> k1 -> *). GHC.Internal.Control.Category.Category k2 => GHC.Internal.Control.Category.Category (Data.Isomorphism.Iso k2)
instance forall k1 (k2 :: k1 -> k1 -> *). Data.Semigroupoid.Semigroupoid k2 => Data.Groupoid.Groupoid (Data.Isomorphism.Iso k2)
instance forall k1 (k2 :: k1 -> k1 -> *). Data.Semigroupoid.Semigroupoid k2 => Data.Semigroupoid.Semigroupoid (Data.Isomorphism.Iso k2)

module Data.Functor.Bind.Trans

-- | A subset of monad transformers can transform any Bind as well.
class MonadTrans t => BindTrans (t :: Type -> Type -> Type -> Type)
liftB :: (BindTrans t, Bind b) => b a -> t b a
instance Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Cont.ContT r)
instance Data.Functor.Bind.Trans.BindTrans Control.Monad.Trans.Identity.IdentityT
instance GHC.Internal.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.RWS.CPS.RWST r w s)
instance GHC.Internal.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.RWS.Strict.RWST r w s)
instance GHC.Internal.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.RWS.Lazy.RWST r w s)
instance Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Reader.ReaderT e)
instance Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.State.Strict.StateT s)
instance Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.State.Lazy.StateT s)
instance GHC.Internal.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Writer.CPS.WriterT w)
instance GHC.Internal.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Writer.Strict.WriterT w)
instance GHC.Internal.Base.Monoid w => Data.Functor.Bind.Trans.BindTrans (Control.Monad.Trans.Writer.Lazy.WriterT w)

module Data.Bifunctor.Apply

-- | A bifunctor is a type constructor that takes two type arguments and is
--   a functor in both arguments. That is, unlike with
--   Functor, a type constructor such as Either does not need
--   to be partially applied for a Bifunctor instance, and the
--   methods in this class permit mapping functions over the Left
--   value or the Right value, or both at the same time.
--   
--   Formally, the class Bifunctor represents a bifunctor from
--   Hask -> Hask.
--   
--   Intuitively it is a bifunctor where both the first and second
--   arguments are covariant.
--   
--   The class definition of a Bifunctor p uses the
--   QuantifiedConstraints language extension to quantify over the
--   first type argument a in its context. The context requires
--   that p a must be a Functor for all a. In
--   other words a partially applied Bifunctor must be a
--   Functor. This makes Functor a superclass of
--   Bifunctor such that a function with a Bifunctor
--   constraint may use fmap in its implementation. Functor
--   has been a quantified superclass of Bifunctor since
--   base-4.18.0.0.
--   
--   You can define a Bifunctor by either defining bimap or
--   by defining both first and second. The second
--   method must agree with fmap:
--   
--   
--   second ≡ fmap
--   
--   
--   From this it follows that:
--   
--   
--   second id ≡ id
--   
--   
--   If you supply bimap, you should ensure that:
--   
--   
--   bimap id id ≡ id
--   
--   
--   If you supply first and second, ensure:
--   
--   
--   first id ≡ id
--   second id ≡ id
--   
--   
--   If you supply both, you should also ensure:
--   
--   
--   bimap f g ≡ first f . second g
--   
--   
--   These ensure by parametricity:
--   
--   
--   bimap  (f . g) (h . i) ≡ bimap f h . bimap g i
--   first  (f . g) ≡ first  f . first  g
--   second (f . g) ≡ second f . second g
--   
class forall a. () => Functor p a => Bifunctor (p :: Type -> Type -> Type)

-- | Map over both arguments at the same time.
--   
--   
--   bimap f g ≡ first f . second g
--   
--   
--   
Examples
--   
--   
--   >>> bimap toUpper (+1) ('j', 3)
--   ('J',4)
--   
--   
--   
--   >>> bimap toUpper (+1) (Left 'j')
--   Left 'J'
--   
--   
--   
--   >>> bimap toUpper (+1) (Right 3)
--   Right 4
--   
bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d

-- | Map covariantly over the first argument.
--   
--   
--   first f ≡ bimap f id
--   
--   
--   
Examples
--   
--   
--   >>> first toUpper ('j', 3)
--   ('J',3)
--   
--   
--   
--   >>> first toUpper (Left 'j')
--   Left 'J'
--   
first :: Bifunctor p => (a -> b) -> p a c -> p b c

-- | Map covariantly over the second argument.
--   
--   
--   second ≡ bimap id
--   
--   
--   
Examples
--   
--   
--   >>> second (+1) ('j', 3)
--   ('j',4)
--   
--   
--   
--   >>> second (+1) (Right 3)
--   Right 4
--   
second :: Bifunctor p => (b -> c) -> p a b -> p a c
class Bifunctor p => Biapply (p :: Type -> Type -> Type)
(<<.>>) :: Biapply p => p (a -> b) (c -> d) -> p a c -> p b d

-- | 
--   a .> b ≡ const id <$> a <.> b
--   
(.>>) :: Biapply p => p a b -> p c d -> p c d

-- | 
--   a <. b ≡ const <$> a <.> b
--   
(<<.) :: Biapply p => p a b -> p c d -> p a b
infixl 4 <<.>>
infixl 4 .>>
infixl 4 <<.
(<<$>>) :: (a -> b) -> a -> b
infixl 4 <<$>>
(<<..>>) :: Biapply p => p a c -> p (a -> b) (c -> d) -> p b d
infixl 4 <<..>>

-- | Lift binary functions
bilift2 :: Biapply w => (a -> b -> c) -> (d -> e -> f) -> w a d -> w b e -> w c f

-- | Lift ternary functions
bilift3 :: Biapply w => (a -> b -> c -> d) -> (e -> f -> g -> h) -> w a e -> w b f -> w c g -> w d h

module Data.Functor.Alt

-- | Laws:
--   
--   
--   <!> is associative:             (a <!> b) <!> c = a <!> (b <!> c)
--   <$> left-distributes over <!>:  f <$> (a <!> b) = (f <$> a) <!> (f <$> b)
--   
--   
--   If extended to an Alternative then <!> should
--   equal <|>.
--   
--   Ideally, an instance of Alt also satisfies the "left
--   distribution" law of MonadPlus with respect to <.>:
--   
--   
--   <.> right-distributes over <!>: (a <!> b) <.> c = (a <.> c) <!> (b <.> c)
--   
--   
--   IO, Either a, ExceptT e m and
--   STM instead satisfy the "left catch" law:
--   
--   
--   pure a <!> b = pure a
--   
--   
--   Maybe and Identity satisfy both "left distribution" and
--   "left catch".
--   
--   These variations cannot be stated purely in terms of the dependencies
--   of Alt.
--   
--   When and if MonadPlus is successfully refactored, this class should
--   also be refactored to remove these instances.
--   
--   The right distributive law should extend in the cases where the a
--   Bind or Monad is provided to yield variations of the
--   right distributive law:
--   
--   
--   (m <!> n) >>- f = (m >>- f) <!> (m >>- f)
--   (m <!> n) >>= f = (m >>= f) <!> (m >>= f)
--   
class Functor f => Alt (f :: Type -> Type)

-- | <|> without a required empty
(<!>) :: Alt f => f a -> f a -> f a
some :: (Alt f, Applicative f) => f a -> f [a]
many :: (Alt f, Applicative f) => f a -> f [a]
infixl 3 <!>

-- | One or none.
optional :: (Alt f, Applicative f) => f a -> f (Maybe a)

-- | Generic (<!>). Caveats:
--   
--   
--   
- Will not compile if f is a sum type.
--   
- Any types where the a does not appear must have a
--   Semigroup instance.
--   
galt :: (Generic1 f, Alt (Rep1 f)) => f a -> f a -> f a
instance (Data.Functor.Alt.Alt f, Data.Functor.Alt.Alt g) => Data.Functor.Alt.Alt (f GHC.Internal.Generics.:*: g)
instance (Data.Functor.Alt.Alt f, GHC.Internal.Base.Functor g) => Data.Functor.Alt.Alt (f GHC.Internal.Generics.:.: g)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Applicative.Backwards.Backwards f)
instance (Data.Functor.Alt.Alt f, GHC.Internal.Base.Functor g) => Data.Functor.Alt.Alt (Data.Functor.Compose.Compose f g)
instance Data.Functor.Alt.Alt (GHC.Internal.Data.Either.Either a)
instance (GHC.Internal.Base.Functor f, GHC.Internal.Base.Monad f, GHC.Internal.Base.Semigroup e) => Data.Functor.Alt.Alt (Control.Monad.Trans.Except.ExceptT e f)
instance Data.Functor.Alt.Alt GHC.Internal.Data.Monoid.First
instance Data.Functor.Alt.Alt Data.Semigroup.First
instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k) => Data.Functor.Alt.Alt (Data.HashMap.Internal.HashMap k)
instance Data.Functor.Alt.Alt GHC.Types.IO
instance Data.Functor.Alt.Alt GHC.Internal.Data.Functor.Identity.Identity
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Functor.Alt.Alt Data.IntMap.Internal.IntMap
instance GHC.Internal.Base.Semigroup c => Data.Functor.Alt.Alt (GHC.Internal.Generics.K1 i c)
instance Data.Functor.Alt.Alt GHC.Internal.Data.Monoid.Last
instance Data.Functor.Alt.Alt Data.Semigroup.Last
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Applicative.Lift.Lift f)
instance Data.Functor.Alt.Alt []
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (GHC.Internal.Generics.M1 i c f)
instance GHC.Classes.Ord k => Data.Functor.Alt.Alt (Data.Map.Internal.Map k)
instance Data.Functor.Alt.Alt GHC.Internal.Maybe.Maybe
instance (GHC.Internal.Base.Functor f, GHC.Internal.Base.Monad f) => Data.Functor.Alt.Alt (Control.Monad.Trans.Maybe.MaybeT f)
instance Data.Functor.Alt.Alt GHC.Internal.Base.NonEmpty
instance (Data.Functor.Alt.Alt f, Data.Functor.Alt.Alt g) => Data.Functor.Alt.Alt (Data.Functor.Product.Product f g)
instance Data.Functor.Alt.Alt GHC.Internal.Data.Proxy.Proxy
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.RWS.CPS.RWST r w s f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.RWS.Lazy.RWST r w s f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.RWS.Strict.RWST r w s f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Reader.ReaderT e f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (GHC.Internal.Generics.Rec1 f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Data.Functor.Reverse.Reverse f)
instance Data.Functor.Alt.Alt Data.Sequence.Internal.Seq
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.State.Lazy.StateT e f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.State.Strict.StateT e f)
instance Data.Functor.Alt.Alt GHC.Internal.Generics.U1
instance Data.Functor.Alt.Alt GHC.Internal.Generics.V1
instance GHC.Internal.Base.Alternative f => Data.Functor.Alt.Alt (Data.Functor.Bind.Class.WrappedApplicative f)
instance GHC.Internal.Control.Arrow.ArrowPlus a => Data.Functor.Alt.Alt (Control.Applicative.WrappedArrow a b)
instance GHC.Internal.Base.MonadPlus m => Data.Functor.Alt.Alt (Control.Applicative.WrappedMonad m)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Writer.CPS.WriterT w f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Writer.Lazy.WriterT w f)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Control.Monad.Trans.Writer.Strict.WriterT w f)

-- | Re-exports a subset of the Data.Foldable1 module along with
--   some additional combinators that require Foldable1 constraints.
module Data.Semigroup.Foldable

-- | Non-empty data structures that can be folded.
class Foldable t => Foldable1 (t :: Type -> Type)

-- | Given a structure with elements whose type is a Semigroup,
--   combine them via the semigroup's (<>) operator.
--   This fold is right-associative and lazy in the accumulator. When you
--   need a strict left-associative fold, use foldMap1' instead,
--   with id as the map.
fold1 :: (Foldable1 t, Semigroup m) => t m -> m

-- | Map each element of the structure to a semigroup, and combine the
--   results with (<>). This fold is
--   right-associative and lazy in the accumulator. For strict
--   left-associative folds consider foldMap1' instead.
--   
--   
--   >>> foldMap1 (:[]) (1 :| [2, 3, 4])
--   [1,2,3,4]
--   
foldMap1 :: (Foldable1 t, Semigroup m) => (a -> m) -> t a -> m

-- | NonEmpty list of elements of a structure, from left to right.
--   
--   
--   >>> toNonEmpty (Identity 2)
--   2 :| []
--   
toNonEmpty :: Foldable1 t => t a -> NonEmpty a

-- | Insert an m between each pair of t m.
--   
--   
--   >>> intercalate1 ", " $ "hello" :| ["how", "are", "you"]
--   "hello, how, are, you"
--   
--   
--   
--   >>> intercalate1 ", " $ "hello" :| []
--   "hello"
--   
--   
--   
--   >>> intercalate1 mempty $ "I" :| ["Am", "Fine", "You?"]
--   "IAmFineYou?"
--   
intercalate1 :: (Foldable1 t, Semigroup m) => m -> t m -> m

-- | Monadic fold over the elements of a non-empty structure, associating
--   to the right, i.e. from right to left.
foldrM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a

-- | Monadic fold over the elements of a non-empty structure, associating
--   to the left, i.e. from left to right.
foldlM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a

-- | Insert m between each pair of m derived from
--   a.
--   
--   
--   >>> intercalateMap1 " " show $ True :| [False, True]
--   "True False True"
--   
--   
--   
--   >>> intercalateMap1 " " show $ True :| []
--   "True"
--   
intercalateMap1 :: (Foldable1 t, Semigroup m) => m -> (a -> m) -> t a -> m
traverse1_ :: (Foldable1 t, Apply f) => (a -> f b) -> t a -> f ()
for1_ :: (Foldable1 t, Apply f) => t a -> (a -> f b) -> f ()
sequenceA1_ :: (Foldable1 t, Apply f) => t (f a) -> f ()

-- | Usable default for foldMap, but only if you define foldMap1 yourself
foldMapDefault1 :: (Foldable1 t, Monoid m) => (a -> m) -> t a -> m
asum1 :: (Foldable1 t, Alt m) => t (m a) -> m a

-- | Generic fold1. Caveats:
--   
--   
--   
- Will not compile if t is an empty constructor.
--   
- Will not compile if t has some fields that don't mention
--   a, for exmaple data Bar a = MkBar a Int
--   
gfold1 :: (Foldable1 (Rep1 t), Generic1 t, Semigroup m) => t m -> m

-- | Generic foldMap1. Caveats are the same as for gfold1.
gfoldMap1 :: (Foldable1 (Rep1 t), Generic1 t, Semigroup m) => (a -> m) -> t a -> m

-- | Generic toNonEmpty. Caveats are the same as for gfold1.
gtoNonEmpty :: (Foldable1 (Rep1 t), Generic1 t) => t a -> NonEmpty a
instance GHC.Internal.Base.Functor f => GHC.Internal.Base.Functor (Data.Semigroup.Foldable.Act f)
instance Data.Functor.Bind.Class.Apply f => GHC.Internal.Base.Semigroup (Data.Semigroup.Foldable.Act f a)
instance Data.Functor.Alt.Alt f => GHC.Internal.Base.Semigroup (Data.Semigroup.Foldable.Alt_ f a)
instance GHC.Internal.Base.Semigroup a => GHC.Internal.Base.Semigroup (Data.Semigroup.Foldable.JoinWith a)

module Data.Semigroup.Traversable.Class
class (Bifoldable1 t, Bitraversable t) => Bitraversable1 (t :: Type -> Type -> Type)
bitraverse1 :: (Bitraversable1 t, Apply f) => (a -> f b) -> (c -> f d) -> t a c -> f (t b d)
bisequence1 :: (Bitraversable1 t, Apply f) => t (f a) (f b) -> f (t a b)
class (Foldable1 t, Traversable t) => Traversable1 (t :: Type -> Type)
traverse1 :: (Traversable1 t, Apply f) => (a -> f b) -> t a -> f (t b)
sequence1 :: (Traversable1 t, Apply f) => t (f b) -> f (t b)
instance Data.Semigroup.Traversable.Class.Bitraversable1 Data.Semigroup.Arg
instance (Data.Semigroup.Traversable.Class.Bitraversable1 p, Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Biff.Biff p f g)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Clown.Clown f)
instance Data.Semigroup.Traversable.Class.Bitraversable1 GHC.Internal.Data.Functor.Const.Const
instance Data.Semigroup.Traversable.Class.Bitraversable1 GHC.Internal.Data.Either.Either
instance Data.Semigroup.Traversable.Class.Bitraversable1 p => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Flip.Flip p)
instance Data.Semigroup.Traversable.Class.Traversable1 g => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Joker.Joker g)
instance (Data.Semigroup.Traversable.Class.Bitraversable1 f, Data.Semigroup.Traversable.Class.Bitraversable1 g) => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Product.Product f g)
instance Data.Semigroup.Traversable.Class.Bitraversable1 Data.Tagged.Tagged
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Bitraversable1 p) => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Tannen.Tannen f p)
instance Data.Semigroup.Traversable.Class.Bitraversable1 (,)
instance Data.Semigroup.Traversable.Class.Bitraversable1 ((,,) x)
instance Data.Semigroup.Traversable.Class.Bitraversable1 ((,,,) x y)
instance Data.Semigroup.Traversable.Class.Bitraversable1 ((,,,,) x y z)
instance Data.Semigroup.Traversable.Class.Bitraversable1 p => Data.Semigroup.Traversable.Class.Bitraversable1 (Data.Bifunctor.Wrapped.WrappedBifunctor p)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (f GHC.Internal.Generics.:*: g)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (f GHC.Internal.Generics.:+: g)
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (f GHC.Internal.Generics.:.: g)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (GHC.Internal.Data.Semigroup.Internal.Alt f)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (Control.Applicative.Backwards.Backwards f)
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Complex.Complex
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (Data.Functor.Compose.Compose f g)
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Internal.Data.Semigroup.Internal.Dual
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Semigroup.First
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Internal.Data.Functor.Identity.Identity
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Semigroup.Traversable.Class.Bitraversable1 p => Data.Semigroup.Traversable.Class.Traversable1 (Data.Bifunctor.Join.Join p)
instance Data.Semigroup.Traversable.Class.Traversable1 g => Data.Semigroup.Traversable.Class.Traversable1 (Data.Bifunctor.Joker.Joker g a)
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Semigroup.Last
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (Control.Applicative.Lift.Lift f)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (GHC.Internal.Generics.M1 i c f)
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Semigroup.Max
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Semigroup.Min
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Internal.Base.NonEmpty
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Internal.Generics.Par1
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Internal.Data.Semigroup.Internal.Product
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (Data.Functor.Product.Product f g)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (GHC.Internal.Generics.Rec1 f)
instance Data.Semigroup.Traversable.Class.Traversable1 f => Data.Semigroup.Traversable.Class.Traversable1 (Data.Functor.Reverse.Reverse f)
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Internal.Data.Semigroup.Internal.Sum
instance (Data.Semigroup.Traversable.Class.Traversable1 f, Data.Semigroup.Traversable.Class.Traversable1 g) => Data.Semigroup.Traversable.Class.Traversable1 (Data.Functor.Sum.Sum f g)
instance Data.Semigroup.Traversable.Class.Traversable1 (Data.Tagged.Tagged a)
instance Data.Semigroup.Traversable.Class.Traversable1 Data.Tree.Tree
instance Data.Semigroup.Traversable.Class.Traversable1 ((,) a)
instance Data.Semigroup.Traversable.Class.Traversable1 GHC.Internal.Generics.V1

module Data.Semigroup.Traversable
class (Foldable1 t, Traversable t) => Traversable1 (t :: Type -> Type)
traverse1 :: (Traversable1 t, Apply f) => (a -> f b) -> t a -> f (t b)
sequence1 :: (Traversable1 t, Apply f) => t (f b) -> f (t b)

-- | Traverse a Traversable using Apply, getting the results
--   back in a MaybeApply.
traverse1Maybe :: (Traversable t, Apply f) => (a -> f b) -> t a -> MaybeApply f (t b)

-- | Generic traverse1. Caveats:
--   
--   
--   
- Will not compile if t is an empty constructor.
--   
- Will not compile if t has some fields that don't mention
--   a, for exmaple data Bar a = MkBar a Int
--   
gtraverse1 :: (Traversable1 (Rep1 t), Apply f, Generic1 t) => (a -> f b) -> t a -> f (t b)

-- | Generic sequence1. Caveats are the same for gtraverse1.
gsequence1 :: (Traversable1 (Rep1 t), Apply f, Generic1 t) => t (f b) -> f (t b)

-- | Default implementation of foldMap1 given an implementation of
--   Traversable1.
foldMap1Default :: (Traversable1 f, Semigroup m) => (a -> m) -> f a -> m

module Data.Semigroup.Bitraversable
class (Bifoldable1 t, Bitraversable t) => Bitraversable1 (t :: Type -> Type -> Type)
bitraverse1 :: (Bitraversable1 t, Apply f) => (a -> f b) -> (c -> f d) -> t a c -> f (t b d)
bisequence1 :: (Bitraversable1 t, Apply f) => t (f a) (f b) -> f (t a b)
bifoldMap1Default :: (Bitraversable1 t, Semigroup m) => (a -> m) -> (b -> m) -> t a b -> m

module Data.Functor.Plus

-- | Laws:
--   
--   
--   zero <!> m = m
--   m <!> zero = m
--   
--   
--   If extended to an Alternative then zero should equal
--   empty.
class Alt f => Plus (f :: Type -> Type)
zero :: Plus f => f a

-- | The sum of a collection of actions, generalizing concat.
--   
--   
--   >>> psum [Just "Hello", Nothing, Just "World"]
--   Just "Hello"
--   
psum :: (Foldable t, Plus f) => t (f a) -> f a

-- | Generic zero. Caveats:
--   
--   
--   
- Will not compile if f is a sum type.
--   
- Any types where the a does not appear must have a
--   Monoid instance.
--   
gzero :: (Plus (Rep1 f), Generic1 f) => f a
instance (Data.Functor.Plus.Plus f, Data.Functor.Plus.Plus g) => Data.Functor.Plus.Plus (f GHC.Internal.Generics.:*: g)
instance (Data.Functor.Plus.Plus f, GHC.Internal.Base.Functor g) => Data.Functor.Plus.Plus (f GHC.Internal.Generics.:.: g)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Applicative.Backwards.Backwards f)
instance (Data.Functor.Plus.Plus f, GHC.Internal.Base.Functor g) => Data.Functor.Plus.Plus (Data.Functor.Compose.Compose f g)
instance (GHC.Internal.Base.Functor f, GHC.Internal.Base.Monad f, GHC.Internal.Base.Semigroup e, GHC.Internal.Base.Monoid e) => Data.Functor.Plus.Plus (Control.Monad.Trans.Except.ExceptT e f)
instance Data.Functor.Plus.Plus GHC.Internal.Data.Monoid.First
instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k) => Data.Functor.Plus.Plus (Data.HashMap.Internal.HashMap k)
instance Data.Functor.Plus.Plus GHC.Types.IO
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Identity.IdentityT f)
instance Data.Functor.Plus.Plus Data.IntMap.Internal.IntMap
instance GHC.Internal.Base.Monoid c => Data.Functor.Plus.Plus (GHC.Internal.Generics.K1 i c)
instance Data.Functor.Plus.Plus GHC.Internal.Data.Monoid.Last
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Applicative.Lift.Lift f)
instance Data.Functor.Plus.Plus []
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (GHC.Internal.Generics.M1 i c f)
instance GHC.Classes.Ord k => Data.Functor.Plus.Plus (Data.Map.Internal.Map k)
instance Data.Functor.Plus.Plus GHC.Internal.Maybe.Maybe
instance (GHC.Internal.Base.Functor f, GHC.Internal.Base.Monad f) => Data.Functor.Plus.Plus (Control.Monad.Trans.Maybe.MaybeT f)
instance (Data.Functor.Plus.Plus f, Data.Functor.Plus.Plus g) => Data.Functor.Plus.Plus (Data.Functor.Product.Product f g)
instance Data.Functor.Plus.Plus GHC.Internal.Data.Proxy.Proxy
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.RWS.CPS.RWST r w s f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.RWS.Lazy.RWST r w s f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.RWS.Strict.RWST r w s f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Reader.ReaderT e f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (GHC.Internal.Generics.Rec1 f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Data.Functor.Reverse.Reverse f)
instance Data.Functor.Plus.Plus Data.Sequence.Internal.Seq
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.State.Lazy.StateT e f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.State.Strict.StateT e f)
instance Data.Functor.Plus.Plus GHC.Internal.Generics.U1
instance GHC.Internal.Base.Alternative f => Data.Functor.Plus.Plus (Data.Functor.Bind.Class.WrappedApplicative f)
instance GHC.Internal.Control.Arrow.ArrowPlus a => Data.Functor.Plus.Plus (Control.Applicative.WrappedArrow a b)
instance GHC.Internal.Base.MonadPlus m => Data.Functor.Plus.Plus (Control.Applicative.WrappedMonad m)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Writer.CPS.WriterT w f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Writer.Lazy.WriterT w f)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Control.Monad.Trans.Writer.Strict.WriterT w f)

-- | This module re-exports operators from Data.Functor.Apply and
--   Data.Functor.Bind, but under the same names as their
--   Applicative and Monad counterparts. This makes it
--   convenient to use do-notation on a type that is a Bind but not
--   a monad (or an Apply but not an Applicative with
--   ApplicativeDo), either using the QualifiedDo
--   extension or the more traditional RebindableSyntax.
--   
--   
--   {-# LANGUAGE ApplicativeDo #-}
--   {-# LANGUAGE QualifiedDo #-}
--   
--   foo :: Apply f => f a -> f b -> f (a, b)
--   foo as bs = Semi.do
--     a <- as
--     b <- bs
--     pure (a, b)
--   
--   
--   bar :: Bind m => (a -> b -> m c) -> m a -> m b -> m c
--   bar f as bs = Semi.do
--     a <- as
--     b <- bs
--     f a b
--   
module Semigroupoids.Do

-- | fmap is used to apply a function of type (a -> b)
--   to a value of type f a, where f is a functor, to produce a
--   value of type f b. Note that for any type constructor with
--   more than one parameter (e.g., Either), only the last type
--   parameter can be modified with fmap (e.g., b in
--   `Either a b`).
--   
--   Some type constructors with two parameters or more have a
--   Bifunctor instance that allows both the last and the
--   penultimate parameters to be mapped over.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe String
--   using show:
--   
--   
--   >>> fmap show Nothing
--   Nothing
--   
--   >>> fmap show (Just 3)
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an Either Int
--   String using show:
--   
--   
--   >>> fmap show (Left 17)
--   Left 17
--   
--   >>> fmap show (Right 17)
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> fmap (*2) [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> fmap even (2,2)
--   (2,True)
--   
--   
--   It may seem surprising that the function is only applied to the last
--   element of the tuple compared to the list example above which applies
--   it to every element in the list. To understand, remember that tuples
--   are type constructors with multiple type parameters: a tuple of 3
--   elements (a,b,c) can also be written (,,) a b c and
--   its Functor instance is defined for Functor ((,,) a
--   b) (i.e., only the third parameter is free to be mapped over with
--   fmap).
--   
--   It explains why fmap can be used with tuples containing
--   values of different types as in the following example:
--   
--   
--   >>> fmap even ("hello", 1.0, 4)
--   ("hello",1.0,True)
--   
fmap :: Functor f => (a -> b) -> f a -> f b

(<*) :: Apply f => f a -> f b -> f a

(*>) :: Apply f => f a -> f b -> f b

(<*>) :: Apply f => f (a -> b) -> f a -> f b

(>>) :: Bind m => m a -> m b -> m b

(>>=) :: Bind m => m a -> (a -> m b) -> m b
join :: Bind m => m (m a) -> m a

-- | Lift a value into the Structure.
--   
--   
Examples
--   
--   
--   >>> pure 1 :: Maybe Int
--   Just 1
--   
--   
--   
--   >>> pure 'z' :: [Char]
--   "z"
--   
--   
--   
--   >>> pure (pure ":D") :: Maybe [String]
--   Just [":D"]
--   
pure :: Applicative f => a -> f a

-- | Inject a value into the monadic type. This function should not
--   be different from its default implementation as pure. The
--   justification for the existence of this function is merely historic.
return :: Monad m => a -> m a

-- | 
Important note
--   
--   This ignores whatever String you give it. It is a bad
--   idea to use fail as a form of labelled error; instead, it
--   should only be defaulted to when a pattern match fails.
fail :: Plus m => String -> m a

module Data.Semigroupoid.Static
newtype Static (f :: Type -> Type) a b
Static :: f (a -> b) -> Static (f :: Type -> Type) a b
[runStatic] :: Static (f :: Type -> Type) a b -> f (a -> b)
instance Data.Functor.Alt.Alt f => Data.Functor.Alt.Alt (Data.Semigroupoid.Static.Static f a)
instance GHC.Internal.Base.Applicative f => GHC.Internal.Base.Applicative (Data.Semigroupoid.Static.Static f a)
instance Data.Functor.Bind.Class.Apply f => Data.Functor.Bind.Class.Apply (Data.Semigroupoid.Static.Static f a)
instance GHC.Internal.Base.Applicative f => GHC.Internal.Control.Arrow.ArrowChoice (Data.Semigroupoid.Static.Static f)
instance GHC.Internal.Base.Alternative f => GHC.Internal.Control.Arrow.ArrowPlus (Data.Semigroupoid.Static.Static f)
instance GHC.Internal.Base.Applicative f => GHC.Internal.Control.Arrow.Arrow (Data.Semigroupoid.Static.Static f)
instance GHC.Internal.Base.Alternative f => GHC.Internal.Control.Arrow.ArrowZero (Data.Semigroupoid.Static.Static f)
instance GHC.Internal.Base.Applicative f => GHC.Internal.Control.Category.Category (Data.Semigroupoid.Static.Static f)
instance (Control.Comonad.Comonad f, GHC.Internal.Base.Monoid a) => Control.Comonad.Comonad (Data.Semigroupoid.Static.Static f a)
instance (Data.Functor.Extend.Extend f, GHC.Internal.Base.Semigroup a) => Data.Functor.Extend.Extend (Data.Semigroupoid.Static.Static f a)
instance GHC.Internal.Base.Functor f => GHC.Internal.Base.Functor (Data.Semigroupoid.Static.Static f a)
instance Data.Functor.Plus.Plus f => Data.Functor.Plus.Plus (Data.Semigroupoid.Static.Static f a)
instance Data.Functor.Bind.Class.Apply f => Data.Semigroupoid.Semigroupoid (Data.Semigroupoid.Static.Static f)
