Hoogle Search

Within LTS Haskell 24.3 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. class (Tensor t i, SemigroupIn t f) => MonoidIn (t :: Type -> Type -> Type -> Type -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type)

    functor-combinators Data.Functor.Combinator

    This class effectively gives us a way to generate a value of f a based on an i a, for Tensor t i. Having this ability makes a lot of interesting functions possible when used with biretract from SemigroupIn that weren't possible without it: it gives us a "base case" for recursion in a lot of cases. Essentially, we get an i ~> f, pureT, where we can introduce an f a as long as we have an i a. Formally, if we have Tensor t i, we are enriching the category of endofunctors with monoid structure, turning it into a monoidal category. Different choices of t give different monoidal categories. A functor f is known as a "monoid in the (monoidal) category of endofunctors on t" if we can biretract:

    t f f ~> f
    
    and also pureT:
    i ~> f
    
    This gives us a few interesting results in category theory, which you can stil reading about if you don't care:
    • All functors are monoids in the monoidal category on :+:
    • The class of functors that are monoids in the monoidal category on :*: is exactly the functors that are instances of Plus.
    • The class of functors that are monoids in the monoidal category on Day is exactly the functors that are instances of Applicative.
    • The class of functors that are monoids in the monoidal category on Comp is exactly the functors that are instances of Monad.
    This is the meaning behind the common adage, "monads are just monoids in the category of endofunctors". It means that if you enrich the category of endofunctors to be monoidal with Comp, then the class of functors that are monoids in that monoidal category are exactly what monads are. However, the adage is a little misleading: there are many other ways to enrich the category of endofunctors to be monoidal, and Comp is just one of them. Similarly, the class of functors that are monoids in the category of endofunctors enriched by Day are Applicative. Note that instances of this class are intended to be written with t and i to be fixed type constructors, and f to be allowed to vary freely:
    instance Monad f => MonoidIn Comp Identity f
    
    Any other sort of instance and it's easy to run into problems with type inference. If you want to write an instance that's "polymorphic" on tensor choice, use the WrapHBF and WrapF newtype wrappers over type variables, where the third argument also uses a type constructor:
    instance MonoidIn (WrapHBF t) (WrapF i) (MyFunctor t i)
    
    This will prevent problems with overloaded instances.

  2. class (Tensor t i, SemigroupIn t f) => MonoidIn (t :: Type -> Type -> Type -> Type -> Type -> Type) (i :: Type -> Type) (f :: Type -> Type)

    functor-combinators Data.HBifunctor.Tensor

    This class effectively gives us a way to generate a value of f a based on an i a, for Tensor t i. Having this ability makes a lot of interesting functions possible when used with biretract from SemigroupIn that weren't possible without it: it gives us a "base case" for recursion in a lot of cases. Essentially, we get an i ~> f, pureT, where we can introduce an f a as long as we have an i a. Formally, if we have Tensor t i, we are enriching the category of endofunctors with monoid structure, turning it into a monoidal category. Different choices of t give different monoidal categories. A functor f is known as a "monoid in the (monoidal) category of endofunctors on t" if we can biretract:

    t f f ~> f
    
    and also pureT:
    i ~> f
    
    This gives us a few interesting results in category theory, which you can stil reading about if you don't care:
    • All functors are monoids in the monoidal category on :+:
    • The class of functors that are monoids in the monoidal category on :*: is exactly the functors that are instances of Plus.
    • The class of functors that are monoids in the monoidal category on Day is exactly the functors that are instances of Applicative.
    • The class of functors that are monoids in the monoidal category on Comp is exactly the functors that are instances of Monad.
    This is the meaning behind the common adage, "monads are just monoids in the category of endofunctors". It means that if you enrich the category of endofunctors to be monoidal with Comp, then the class of functors that are monoids in that monoidal category are exactly what monads are. However, the adage is a little misleading: there are many other ways to enrich the category of endofunctors to be monoidal, and Comp is just one of them. Similarly, the class of functors that are monoids in the category of endofunctors enriched by Day are Applicative. Note that instances of this class are intended to be written with t and i to be fixed type constructors, and f to be allowed to vary freely:
    instance Monad f => MonoidIn Comp Identity f
    
    Any other sort of instance and it's easy to run into problems with type inference. If you want to write an instance that's "polymorphic" on tensor choice, use the WrapHBF and WrapF newtype wrappers over type variables, where the third argument also uses a type constructor:
    instance MonoidIn (WrapHBF t) (WrapF i) (MyFunctor t i)
    
    This will prevent problems with overloaded instances.

  3. newtype MonoidMap k v

    monoidmap-internal Data.MonoidMap.Internal

    No documentation available.

  4. MonoidMap :: Map k (NonNull v) -> MonoidMap k v

    monoidmap-internal Data.MonoidMap.Internal

    No documentation available.

  5. module Data.Dependent.Map.Monoidal

    No documentation available.

  6. newtype MonoidalDMap (f :: k -> Type) (g :: k -> Type)

    dependent-monoidal-map Data.Dependent.Map.Monoidal

    No documentation available.

  7. MonoidalDMap :: DMap f g -> MonoidalDMap (f :: k -> Type) (g :: k -> Type)

    dependent-monoidal-map Data.Dependent.Map.Monoidal

    No documentation available.

  8. module Data.Bifunctor.Monoidal

    No documentation available.

  9. class (Tensor cat t1 i1, Tensor cat t2 i2, Tensor cat to io, Semigroupal cat t1 t2 to f, Unital cat i1 i2 io f) => Monoidal (cat :: Type -> Type -> Type) (t1 :: Type -> Type -> Type) i1 (t2 :: Type -> Type -> Type) i2 (to :: Type -> Type -> Type) io (f :: Type -> Type -> Type)

    monoidal-functors Data.Bifunctor.Monoidal

    Given monoidal categories <math> and <math>. A bifunctor <math> is Monoidal if it maps between <math> and <math> while preserving their monoidal structure. Eg., a homomorphism of monoidal categories. See NCatlab for more details.

    Laws

    Right Unitality: <math>
    combine . grmap introducebwd unitr . fwd unitr
    
    Left Unitality: <math>
    combine . glmap introducefmap (bwd unitl) . fwd unitl
    

  10. module Data.Functor.Monoidal

    No documentation available.

Page 4 of many | Previous | Next