functor-combinators-0.3.4.0: Tools for functor combinator-based program design
Copyright(c) Justin Le 2019
LicenseBSD3
Maintainerjustin@jle.im
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Functor.Combinator

Description

Functor combinators and tools (typeclasses and utiility functions) to manipulate them. This is the main "entrypoint" of the library.

Classes include:

We have some helpful utility functions, as well, built on top of these typeclasses.

The second half of this module exports the various useful functor combinators that can modify functors to add extra functionality, or join two functors together and mix them in different ways. Use them to build your final structure by combining simpler ones in composable ways!

See https://blog.jle.im/entry/functor-combinatorpedia.html and the README for a tutorial and a rundown on each different functor combinator.

Synopsis

Classes

A lot of type signatures are stated in terms of ~>. ~> represents a "natural transformation" between two functors: a value of type f ~> g is a value of type 'f a -> g a that works for any a@.

type (~>) (f :: k -> Type) (g :: k -> Type) = forall (x :: k). f x -> g x infixr 0 #

A natural transformation from f to g.

type (<~>) f g = forall p a. Profunctor p => p (g a) (g a) -> p (f a) (f a) infixr 0 Source #

The type of an isomorphism between two functors. f <~> g means that f and g are isomorphic to each other.

We can effectively use an f <~> g with:

viewF   :: (f <~> g) -> f a -> g a
reviewF :: (f <~> g) -> g a -> a a

Use viewF to extract the "f to g" function, and reviewF to extract the "g to f" function. Reviewing and viewing the same value (or vice versa) leaves the value unchanged.

One nice thing is that we can compose isomorphisms using . from Prelude:

(.) :: f <~> g
    -> g <~> h
    -> f <~> h

Another nice thing about this representation is that we have the "identity" isomorphism by using id from Prelude.

id :: f <~> g

As a convention, most isomorphisms have form "X-ing", where the forwards function is "ing". For example, we have:

splittingSF :: Monoidal t => SF t a <~> t f (MF t f)
splitSF     :: Monoidal t => SF t a  ~> t f (MF t f)

Single Functors

Classes that deal with single-functor combinators, that enhance a single functor.

class HFunctor t where Source #

An HFunctor can be thought of a unary "functor transformer" --- a basic functor combinator. It takes a functor as input and returns a functor as output.

It "enhances" a functor with extra structure (sort of like how a monad transformer enhances a Monad with extra structure).

As a uniform inteface, we can "swap the underlying functor" (also sometimes called "hoisting"). This is what hmap does: it lets us swap out the f in a t f for a t g.

For example, the free monad Free takes a Functor and returns a new Functor. In the process, it provides a monadic structure over f. hmap lets us turn a Free f into a Free g: a monad built over f can be turned into a monad built over g.

For the ability to move in and out of the enhanced functor, see Inject and Interpret.

This class is similar to MFunctor from Control.Monad.Morph, but instances must work without a Monad constraint.

This class is also found in the hschema library with the same name.

Methods

hmap :: (f ~> g) -> t f ~> t g Source #

If we can turn an f into a g, then we can turn a t f into a t g.

It must be the case that

hmap id == id

Essentially, t f adds some "extra structure" to f. hmap must swap out the functor, without affecting the added structure.

For example, ListF f a is essentially a list of f as. If we hmap to swap out the f as for g as, then we must ensure that the "added structure" (here, the number of items in the list, and the ordering of those items) remains the same. So, hmap must preserve the number of items in the list, and must maintain the ordering.

The law hmap id == id is a way of formalizing this property.

Instances

Instances details
HFunctor Dec1 Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Dec1 f ~> Dec1 g Source #

HFunctor Dec Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Dec f ~> Dec g Source #

HFunctor Ap1 Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Ap1 f ~> Ap1 g Source #

HFunctor (Night f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> Night f f0 ~> Night f g Source #

HFunctor (Reverse :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Reverse f ~> Reverse g Source #

HFunctor (Backwards :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Backwards f ~> Backwards g Source #

HFunctor (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> IdentityT f ~> IdentityT g Source #

HFunctor (Flagged :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Flagged f ~> Flagged g Source #

HFunctor (Steps :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Steps f ~> Steps g Source #

HFunctor (Step :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Step f ~> Step g Source #

HFunctor (MaybeF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> MaybeF f ~> MaybeF g Source #

HFunctor (NonEmptyF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> NonEmptyF f ~> NonEmptyF g Source #

HFunctor (ListF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> ListF f ~> ListF g Source #

HFunctor (Void2 :: (k1 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Void2 f ~> Void2 g Source #

HFunctor (NEMapF k2 :: (k1 -> Type) -> k1 -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> NEMapF k2 f ~> NEMapF k2 g Source #

HFunctor (MapF k2 :: (k1 -> Type) -> k1 -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> MapF k2 f ~> MapF k2 g Source #

HFunctor (Sum f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> Sum f f0 ~> Sum f g Source #

HFunctor (Product f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> Product f f0 ~> Product f g Source #

HFunctor ((:+:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> (f :+: f0) ~> (f :+: g) Source #

HFunctor ((:*:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> (f :*: f0) ~> (f :*: g) Source #

HFunctor (ProxyF :: (k1 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> ProxyF f ~> ProxyF g Source #

HFunctor t => HFunctor (HLift t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> HLift t f ~> HLift t g Source #

HFunctor t => HFunctor (HFree t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> HFree t f ~> HFree t g Source #

HBifunctor t => HFunctor (Chain1 t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Chain1 t f ~> Chain1 t g Source #

HFunctor (Final c :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Final c f ~> Final c g Source #

HFunctor (M1 i c :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> M1 i c f ~> M1 i c g Source #

Functor f => HFunctor ((:.:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> (f :.: f0) ~> (f :.: g) Source #

HBifunctor t => HFunctor (WrappedHBifunctor t f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> WrappedHBifunctor t f f0 ~> WrappedHBifunctor t f g Source #

HFunctor (Joker f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> Joker f f0 ~> Joker f g Source #

HFunctor (ConstF e :: (k1 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> ConstF e f ~> ConstF e g Source #

HFunctor t => HFunctor (WrapHF t :: (k1 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> WrapHF t f ~> WrapHF t g Source #

HFunctor (LeftF f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> LeftF f f0 ~> LeftF f g Source #

HFunctor (RightF g :: (k2 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hmap :: forall (f :: k -> Type) (g0 :: k -> Type). (f ~> g0) -> RightF g f ~> RightF g g0 Source #

HFunctor (RightF g :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hmap :: forall (f :: k0 -> Type) (g0 :: k0 -> Type). (f ~> g0) -> RightF g f ~> RightF g g0 Source #

HFunctor (Void3 f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> Void3 f f0 ~> Void3 f g Source #

HBifunctor t => HFunctor (Chain t i :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Chain t i f ~> Chain t i g Source #

HBifunctor t => HFunctor (WrapHBF t f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> WrapHBF t f f0 ~> WrapHBF t f g Source #

HFunctor (NS :: (k -> Type) -> [k] -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> NS f ~> NS g Source #

HFunctor (NP :: (k -> Type) -> [k] -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> NP f ~> NP g Source #

HFunctor (CoRec :: (k -> Type) -> [k] -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> CoRec f ~> CoRec g Source #

HFunctor (Rec :: (k -> Type) -> [k] -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Rec f ~> Rec g Source #

HFunctor (Tagged :: (k -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Tagged f ~> Tagged g Source #

HFunctor MaybeT Source #

Note that there is no Interpret or Bind instance, because inject requires Functor f.

Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> MaybeT f ~> MaybeT g Source #

HFunctor F Source #

Note that there is no Interpret or Bind instance, because inject requires Functor f.

Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> F f ~> F g Source #

HFunctor Ap Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Ap f ~> Ap g Source #

HFunctor Ap Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Ap f ~> Ap g Source #

HFunctor Ap Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Ap f ~> Ap g Source #

HFunctor Alt Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Alt f ~> Alt g Source #

HFunctor Yoneda Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Yoneda f ~> Yoneda g Source #

HFunctor Coyoneda Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Coyoneda f ~> Coyoneda g Source #

HFunctor Coyoneda Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Coyoneda f ~> Coyoneda g Source #

HFunctor WrappedApplicative Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> WrappedApplicative f ~> WrappedApplicative g Source #

HFunctor MaybeApply Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> MaybeApply f ~> MaybeApply g Source #

HFunctor Lift Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Lift f ~> Lift g Source #

HFunctor Free1 Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Free1 f ~> Free1 g Source #

HFunctor Free Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Free f ~> Free g Source #

HFunctor NightChain Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> NightChain f ~> NightChain g Source #

HFunctor NightChain1 Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> NightChain1 f ~> NightChain1 g Source #

HFunctor DayChain Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> DayChain f ~> DayChain g Source #

HFunctor DayChain1 Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> DayChain1 f ~> DayChain1 g Source #

HFunctor Div1 Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Div1 f ~> Div1 g Source #

HFunctor Div Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Div f ~> Div g Source #

HFunctor (EnvT e :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> EnvT e f ~> EnvT e g Source #

HFunctor (Day f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> Day f f0 ~> Day f g Source #

HFunctor (Day f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> Day f f0 ~> Day f g Source #

HFunctor (ReaderT r :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> ReaderT r f ~> ReaderT r g Source #

HFunctor (These1 f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> These1 f f0 ~> These1 f g Source #

HFunctor t => HFunctor (PreT t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Route

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> PreT t f ~> PreT t g Source #

HFunctor (Post a :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Route

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Post a f ~> Post a g Source #

HFunctor (Pre a :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Route

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Pre a f ~> Pre a g Source #

(HFunctor s, HFunctor t) => HFunctor (ComposeT s t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> ComposeT s t f ~> ComposeT s t g Source #

HFunctor (Comp f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> Comp f f0 ~> Comp f g Source #

class HFunctor t => Inject t where Source #

A typeclass for HFunctors where you can "inject" an f a into a t f a:

inject :: f a -> t f a

If you think of t f a as an "enhanced f", then inject allows you to use an f as its enhanced form.

With the exception of directly pattern matching on the result, inject itself is not too useful in the general case without Interpret to allow us to interpret or retrieve back the f.

Methods

inject :: f ~> t f Source #

Lift from f into the enhanced t f structure. Analogous to lift from MonadTrans.

Note that this lets us "lift" a f a; if you want to lift an a with a -> t f a, check if t f is an instance of Applicative or Pointed.

Instances

Instances details
Inject NightChain Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

inject :: forall (f :: k -> Type). f ~> NightChain f Source #

Inject Dec1 Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

inject :: forall (f :: k -> Type). f ~> Dec1 f Source #

Inject Dec Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

inject :: forall (f :: k -> Type). f ~> Dec f Source #

Inject Ap1 Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

inject :: forall (f :: k -> Type). f ~> Ap1 f Source #

Inject (Reverse :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> Reverse f Source #

Inject (Backwards :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> Backwards f Source #

Inject (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> IdentityT f Source #

Inject (Flagged :: (k -> Type) -> k -> Type) Source #

Injects with False.

Equivalent to instance for EnvT Any and HLift IdentityT.

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> Flagged f Source #

Inject (Steps :: (k -> Type) -> k -> Type) Source #

Injects into a singleton map at 0; same behavior as NEMapF (Sum Natural).

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> Steps f Source #

Inject (Step :: (k -> Type) -> k -> Type) Source #

Injects with 0.

Equivalent to instance for EnvT (Sum Natural).

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> Step f Source #

Inject (MaybeF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> MaybeF f Source #

Inject (NonEmptyF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> NonEmptyF f Source #

Inject (ListF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> ListF f Source #

Applicative f => Inject (Comp f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k -> Type). f0 ~> Comp f f0 Source #

HFunctor t => Inject (HFree t :: (k -> Type) -> k -> Type) Source #

HFree is the "free HBind and Inject" for any HFunctor

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> HFree t f Source #

HFunctor t => Inject (HLift t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> HLift t f Source #

Inject (ProxyF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> ProxyF f Source #

Inject (Sum f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k0 -> Type). f0 ~> Sum f f0 Source #

Inject ((:+:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k0 -> Type). f0 ~> (f :+: f0) Source #

Monoid k2 => Inject (MapF k2 :: (k1 -> Type) -> k1 -> Type) Source #

Injects into a singleton map at mempty.

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> MapF k2 f Source #

Monoid k2 => Inject (NEMapF k2 :: (k1 -> Type) -> k1 -> Type) Source #

Injects into a singleton map at mempty.

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> NEMapF k2 f Source #

HBifunctor t => Inject (Chain1 t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

inject :: forall (f :: k0 -> Type). f ~> Chain1 t f Source #

Inject (Final c :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

inject :: forall (f :: k0 -> Type). f ~> Final c f Source #

Monoid e => Inject (ConstF e :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> ConstF e f Source #

Inject (M1 i c :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> M1 i c f Source #

Applicative f => Inject ((:.:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k0 -> Type). f0 ~> (f :.: f0) Source #

Inject t => Inject (WrapHF t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

inject :: forall (f :: k0 -> Type). f ~> WrapHF t f Source #

Inject (RightF g :: (k2 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

inject :: forall (f :: k -> Type). f ~> RightF g f Source #

Tensor t i => Inject (Chain t i :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Chain

Methods

inject :: forall (f :: k -> Type). f ~> Chain t i f Source #

Inject Ap Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Ap f Source #

Inject Ap Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Ap f Source #

Inject Ap Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Ap f Source #

Inject Alt Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Alt f Source #

Inject Coyoneda Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Coyoneda f Source #

Inject Coyoneda Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Coyoneda f Source #

Inject WrappedApplicative Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> WrappedApplicative f Source #

Inject MaybeApply Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> MaybeApply f Source #

Inject Lift Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Lift f Source #

Inject Free1 Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Free1 f Source #

Inject Free Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Free f Source #

Inject NightChain1 Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

inject :: forall (f :: k -> Type). f ~> NightChain1 f Source #

Inject DayChain Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

inject :: forall (f :: k -> Type). f ~> DayChain f Source #

Inject DayChain1 Source # 
Instance details

Defined in Data.HFunctor.Chain.Internal

Methods

inject :: forall (f :: k -> Type). f ~> DayChain1 f Source #

Inject Div1 Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

inject :: forall (f :: k -> Type). f ~> Div1 f Source #

Inject Div Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

inject :: forall (f :: k -> Type). f ~> Div f Source #

Monoid e => Inject (EnvT e :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> EnvT e f Source #

Inject (ReaderT r :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> ReaderT r f Source #

Inject (These1 f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k -> Type). f0 ~> These1 f f0 Source #

Inject t => Inject (PreT t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Route

Methods

inject :: forall (f :: k -> Type). f ~> PreT t f Source #

Monoid a => Inject (Post a :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Route

Methods

inject :: forall (f :: k -> Type). f ~> Post a f Source #

a ~ Void => Inject (Pre a :: (Type -> Type) -> Type -> Type) Source #

This instance is over-contrained (a only needs to be uninhabited), but there is no commonly used "uninhabited" typeclass

Instance details

Defined in Data.HFunctor.Route

Methods

inject :: forall (f :: k -> Type). f ~> Pre a f Source #

Plus f => Inject ((:*:) f :: (Type -> Type) -> Type -> Type) Source #

Only uses zero

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k -> Type). f0 ~> (f :*: f0) Source #

Plus f => Inject (Product f :: (Type -> Type) -> Type -> Type) Source #

Only uses zero

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k -> Type). f0 ~> Product f f0 Source #

(Inject s, Inject t) => Inject (ComposeT s t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> ComposeT s t f Source #

class Inject t => Interpret t f where Source #

An Interpret lets us move in and out of the "enhanced" Functor (t f) and the functor it enhances (f). An instance Interpret t f means we have t f a -> f a.

For example, Free f is f enhanced with monadic structure. We get:

inject    :: f a -> Free f a
interpret :: Monad m => (forall x. f x -> m x) -> Free f a -> m a

inject will let us use our f inside the enhanced Free f. interpret will let us "extract" the f from a Free f if we can give an interpreting function that interprets f into some target Monad.

We enforce that:

interpret id . inject == id
-- or
retract . inject == id

That is, if we lift a value into our structure, then immediately interpret it out as itself, it should lave the value unchanged.

Note that instances of this class are intended to be written with t as a fixed type constructor, and f to be allowed to vary freely:

instance Monad f => Interpret Free 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 WrapHF newtype wrapper over a type variable, where the second argument also uses a type constructor:

instance Interpret (WrapHF t) (MyFunctor t)

This will prevent problems with overloaded instances.

Minimal complete definition

retract | interpret

Methods

retract :: t f ~> f Source #

Remove the f out of the enhanced t f structure, provided that f satisfies the necessary constraints. If it doesn't, it needs to be properly interpreted out.

interpret :: (g ~> f) -> t g ~> f Source #

Given an "interpeting function" from f to g, interpret the f out of the t f into a final context g.

Instances

Instances details
Decide f => Interpret Dec1 (f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

retract :: Dec1 f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Dec1 g ~> f Source #

Conclude f => Interpret Dec (f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

retract :: Dec f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Dec g ~> f Source #

Apply f => Interpret Ap1 (f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

retract :: Ap1 f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Ap1 g ~> f Source #

Interpret (Reverse :: (k -> Type) -> k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Reverse f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> Reverse g ~> f Source #

Interpret (Backwards :: (k -> Type) -> k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Backwards f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> Backwards g ~> f Source #

Interpret (IdentityT :: (k -> Type) -> k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: IdentityT f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> IdentityT g ~> f Source #

Interpret (Flagged :: (k -> Type) -> k -> Type) (f :: k -> Type) Source #

Equivalent to instance for EnvT Any and HLift IdentityT.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Flagged f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> Flagged g ~> f Source #

Interpret (Step :: (k -> Type) -> k -> Type) (f :: k -> Type) Source #

Equivalent to instance for EnvT (Sum Natural).

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Step f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> Step g ~> f Source #

(HBifunctor t, SemigroupIn t f) => Interpret (Chain1 t :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Chain

Methods

retract :: Chain1 t f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Chain1 t g ~> f Source #

Interpret t f => Interpret (HFree t :: (k -> Type) -> k -> Type) (f :: k -> Type) Source #

Never uses inject

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: HFree t f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> HFree t g ~> f Source #

Interpret t f => Interpret (HLift t :: (k -> Type) -> k -> Type) (f :: k -> Type) Source #

Never uses inject

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: HLift t f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> HLift t g ~> f Source #

c f => Interpret (Final c :: (k -> Type) -> k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

retract :: Final c f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> Final c g ~> f Source #

Interpret (M1 i c :: (k -> Type) -> k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: M1 i c f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> M1 i c g ~> f Source #

Interpret (RightF g :: (k2 -> Type) -> k2 -> Type) (f :: k2 -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

retract :: RightF g f ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> RightF g g0 ~> f Source #

MonoidIn t i f => Interpret (Chain t i :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

We can collapse and interpret an Chain t i if we have Tensor t.

Instance details

Defined in Data.HFunctor.Chain

Methods

retract :: Chain t i f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Chain t i g ~> f Source #

Applicative f => Interpret Ap (f :: Type -> Type) Source #

A free Applicative

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Ap f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Ap g ~> f Source #

Applicative f => Interpret Ap (f :: Type -> Type) Source #

A free Applicative

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Ap f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Ap g ~> f Source #

Applicative f => Interpret Ap (f :: Type -> Type) Source #

A free Applicative

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Ap f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Ap g ~> f Source #

Alternative f => Interpret Alt (f :: Type -> Type) Source #

A free Alternative

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Alt f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Alt g ~> f Source #

Functor f => Interpret Coyoneda (f :: Type -> Type) Source #

A free Functor

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Coyoneda f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Coyoneda g ~> f Source #

Contravariant f => Interpret Coyoneda (f :: Type -> Type) Source #

A free Contravariant

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Coyoneda f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Coyoneda g ~> f Source #

Interpret WrappedApplicative (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: WrappedApplicative f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> WrappedApplicative g ~> f Source #

Pointed f => Interpret MaybeApply (f :: Type -> Type) Source #

A free Pointed

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: MaybeApply f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> MaybeApply g ~> f Source #

Pointed f => Interpret Lift (f :: Type -> Type) Source #

A free Pointed

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Lift f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Lift g ~> f Source #

Bind f => Interpret Free1 (f :: Type -> Type) Source #

A free Bind

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Free1 f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Free1 g ~> f Source #

Monad f => Interpret Free (f :: Type -> Type) Source #

A free Monad

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Free f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Free g ~> f Source #

Divise f => Interpret Div1 (f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

retract :: Div1 f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Div1 g ~> f Source #

Divisible f => Interpret Div (f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

retract :: Div f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Div g ~> f Source #

Monoid e => Interpret (EnvT e :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

This ignores the environment, so interpret /= hbind

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: EnvT e f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> EnvT e g ~> f Source #

MonadReader r f => Interpret (ReaderT r :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

A free MonadReader, but only when applied to a Monad.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: ReaderT r f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> ReaderT r g ~> f Source #

Plus f => Interpret (These1 g :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

Technically, f is over-constrained: we only need zero :: f a, but we don't really have that typeclass in any standard hierarchies. We use Plus here instead, but we never use <!>. This would only go wrong in situations where your type supports zero but not <!>, like instances of MonadFail without MonadPlus.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: These1 g f ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> These1 g g0 ~> f Source #

Alt f => Interpret (Steps :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Steps f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Steps g ~> f Source #

Plus f => Interpret (ListF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

A free Plus

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: ListF f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> ListF g ~> f Source #

Alt f => Interpret (NonEmptyF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

A free Alt

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: NonEmptyF f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> NonEmptyF g ~> f Source #

Plus f => Interpret (MaybeF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

Technically, f is over-constrained: we only need zero :: f a, but we don't really have that typeclass in any standard hierarchies. We use Plus here instead, but we never use <!>. This would only go wrong in situations where your type supports zero but not <!>, like instances of MonadFail without MonadPlus.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: MaybeF f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> MaybeF g ~> f Source #

Interpret t f => Interpret (PreT t :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Route

Methods

retract :: PreT t f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> PreT t g ~> f Source #

Monoid a => Interpret (Post a :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Route

Methods

retract :: Post a f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Post a g ~> f Source #

a ~ Void => Interpret (Pre a :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Route

Methods

retract :: Pre a f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Pre a g ~> f Source #

Plus f => Interpret ((:+:) g :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

Technically, f is over-constrained: we only need zero :: f a, but we don't really have that typeclass in any standard hierarchies. We use Plus here instead, but we never use <!>. This would only go wrong in situations where your type supports zero but not <!>, like instances of MonadFail without MonadPlus.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: (g :+: f) ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> (g :+: g0) ~> f Source #

Plus g => Interpret ((:*:) g :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: (g :*: f) ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> (g :*: g0) ~> f Source #

Plus g => Interpret (Product g :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Product g f ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> Product g g0 ~> f Source #

Plus f => Interpret (Sum g :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

Technically, f is over-constrained: we only need zero :: f a, but we don't really have that typeclass in any standard hierarchies. We use Plus here instead, but we never use <!>. This would only go wrong in situations where your type supports zero but not <!>, like instances of MonadFail without MonadPlus.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Sum g f ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> Sum g g0 ~> f Source #

(Interpret s f, Interpret t f) => Interpret (ComposeT s t :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: ComposeT s t f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> ComposeT s t g ~> f Source #

(Monoid k, Plus f) => Interpret (MapF k :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: MapF k f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> MapF k g ~> f Source #

(Monoid k, Alt f) => Interpret (NEMapF k :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: NEMapF k f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> NEMapF k g ~> f Source #

forI :: Interpret t f => t g a -> (g ~> f) -> f a Source #

A convenient flipped version of interpret.

iget :: Interpret t (AltConst b) => (forall x. f x -> b) -> t f a -> b Source #

Useful wrapper over interpret to allow you to directly extract a value b out of the t f a, if you can convert f x into b.

Note that depending on the constraints on f in Interpret t f, you may have extra constraints on b.

For some constraints (like Monad), this will not be usable.

-- get the length of the Map String in the Step.
icollect length
     :: Step (Map String) Bool
     -> Int

Since: 0.3.1.0

icollect :: (forall m. Monoid m => Interpret t (AltConst m)) => (forall x. f x -> b) -> t f a -> [b] Source #

Useful wrapper over iget to allow you to collect a b from all instances of f inside a t f a.

Will work if there is an instance of Interpret t (AltConst m) if Monoid m, which will be the case if the constraint on the target functor is Functor, Apply, Applicative, Alt, Plus, Decide, Divisible, Decide, Conclude, or unconstrained.

-- get the lengths of all Map Strings in the Ap.
icollect length
     :: Ap (Map String) Bool
     -> [Int]

Since: 0.3.1.0

icollect1 :: (forall m. Semigroup m => Interpret t (AltConst m)) => (forall x. f x -> b) -> t f a -> NonEmpty b Source #

Useful wrapper over iget to allow you to collect a b from all instances of f inside a t f a, into a non-empty collection of bs.

Will work if there is an instance of Interpret t (AltConst m) if Semigroup m, which will be the case if the constraint on the target functor is Functor, Apply, Alt, Divise, Decide, or unconstrained.

-- get the lengths of all Map Strings in the Ap.
icollect1 length
     :: Ap1 (Map String) Bool
     -> NonEmpty Int

Since: 0.3.1.0

iapply :: Interpret t (Op b) => (forall x. f x -> x -> b) -> t f a -> a -> b Source #

Useful wrapper over interpret to allow you to directly consume a value of type a with a t f a to create a b. Do this by supplying the method by which each component f x can consume an x. This works for contravariant functor combinators, where t f a can be interpreted as a consumer of as.

Note that depending on the constraints on f in Interpret t f, you may have extra constraints on b.

  • If f is unconstrained, Decide, or Conclude, there are no constraints on b. This will be the case for combinators like contravariant Coyoneda, Dec, Dec1.
  • If f must be Divise, b needs to be an instance of Semigroup. This will be the case for combinators like Div1.
  • If f is Divisible, b needs to be an instance of Monoid. This will be the case for combinators like Div.

For any Functor or Invariant constraint, this is not usable.

Since: 0.3.2.0

ifanout :: (forall m. Monoid m => Interpret t (Op m)) => (forall x. f x -> x -> b) -> t f a -> a -> [b] Source #

Useful wrapper over interpret to allow you to directly consume a value of type a with a t f a to create a b, and create a list of all the bs created by all the fs. Do this by supplying the method by which each component f x can consume an x. This works for contravariant functor combinators, where t f a can be interpreted as a consumer of as.

Will work if there is an instance of Interpret t (Op m) if Monoid m, which will be the case if the constraint on the target functor is Contravariant, Decide, Conclude, Divise, Divisible, or unconstrained.

Note that this is really only useful outside of iapply for Div and Div1, where a Div f which is a collection of many different fs consuming types of different values. You can use this with Dec and Dec1 and the contravarient Coyoneda as well, but those would always just give you a singleton list, so you might as well use iapply. This is really only here for completion alongside icollect, or if you define your own custom functor combinators.

ifanout1 :: (forall m. Semigroup m => Interpret t (Op m)) => (forall x. f x -> x -> b) -> t f a -> a -> NonEmpty b Source #

Useful wrapper over interpret to allow you to directly consume a value of type a with a t f a to create a b, and create a list of all the bs created by all the fs. Do this by supplying the method by which each component f x can consume an x. This works for contravariant functor combinators, where t f a can be interpreted as a consumer of as.

Will work if there is an instance of Interpret t (Op m) if Monoid m, which will be the case if the constraint on the target functor is Contravariant, Decide, Divise, or unconstrained.

Note that this is really only useful outside of iapply and ifanout for Div1, where a Div1 f which is a collection of many different fs consuming types of different values. You can use this with Dec and Dec1 and the contravarient Coyoneda as well, but those would always just give you a singleton list, so you might as well use iapply. This is really only here for completion alongside icollect1, or if you define your own custom functor combinators.

getI :: Interpret t (AltConst b) => (forall x. f x -> b) -> t f a -> b Source #

Deprecated: Use iget instead

(Deprecated) Old name for getI; will be removed in a future version.

collectI :: (forall m. Monoid m => Interpret t (AltConst m)) => (forall x. f x -> b) -> t f a -> [b] Source #

Deprecated: Use icollect instead

(Deprecated) Old name for icollect; will be removed in a future version.

injectMap :: (Inject t, Functor f) => (a -> b) -> f a -> t f b Source #

A useful wrapper over the common pattern of fmap-before-inject/inject-and-fmap.

Since: 0.3.3.0

injectContramap :: (Inject t, Contravariant f) => (a -> b) -> f b -> t f a Source #

A useful wrapper over the common pattern of contramap-before-inject/inject-and-contramap.

Since: 0.3.3.0

newtype AltConst w a Source #

A version of Const that supports Alt, Plus, Decide, and Conclude instances. It does this by avoiding having an Alternative or Decidable instance, which causes all sorts of problems with the interactions between Alternative/Applicative and Decidable/Divisible.

Since: 0.3.1.0

Constructors

AltConst 

Fields

Instances

Instances details
Functor (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

fmap :: (a -> b) -> AltConst w a -> AltConst w b #

(<$) :: a -> AltConst w b -> AltConst w a #

Monoid w => Applicative (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

pure :: a -> AltConst w a #

(<*>) :: AltConst w (a -> b) -> AltConst w a -> AltConst w b #

liftA2 :: (a -> b -> c) -> AltConst w a -> AltConst w b -> AltConst w c #

(*>) :: AltConst w a -> AltConst w b -> AltConst w b #

(<*) :: AltConst w a -> AltConst w b -> AltConst w a #

Foldable (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

fold :: Monoid m => AltConst w m -> m #

foldMap :: Monoid m => (a -> m) -> AltConst w a -> m #

foldMap' :: Monoid m => (a -> m) -> AltConst w a -> m #

foldr :: (a -> b -> b) -> b -> AltConst w a -> b #

foldr' :: (a -> b -> b) -> b -> AltConst w a -> b #

foldl :: (b -> a -> b) -> b -> AltConst w a -> b #

foldl' :: (b -> a -> b) -> b -> AltConst w a -> b #

foldr1 :: (a -> a -> a) -> AltConst w a -> a #

foldl1 :: (a -> a -> a) -> AltConst w a -> a #

toList :: AltConst w a -> [a] #

null :: AltConst w a -> Bool #

length :: AltConst w a -> Int #

elem :: Eq a => a -> AltConst w a -> Bool #

maximum :: Ord a => AltConst w a -> a #

minimum :: Ord a => AltConst w a -> a #

sum :: Num a => AltConst w a -> a #

product :: Num a => AltConst w a -> a #

Traversable (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

traverse :: Applicative f => (a -> f b) -> AltConst w a -> f (AltConst w b) #

sequenceA :: Applicative f => AltConst w (f a) -> f (AltConst w a) #

mapM :: Monad m => (a -> m b) -> AltConst w a -> m (AltConst w b) #

sequence :: Monad m => AltConst w (m a) -> m (AltConst w a) #

Contravariant (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

contramap :: (a -> b) -> AltConst w b -> AltConst w a #

(>$) :: b -> AltConst w b -> AltConst w a #

Eq w => Eq1 (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

liftEq :: (a -> b -> Bool) -> AltConst w a -> AltConst w b -> Bool #

Ord w => Ord1 (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

liftCompare :: (a -> b -> Ordering) -> AltConst w a -> AltConst w b -> Ordering #

Show w => Show1 (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> AltConst w a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [AltConst w a] -> ShowS #

Monoid w => Divisible (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

divide :: (a -> (b, c)) -> AltConst w b -> AltConst w c -> AltConst w a #

conquer :: AltConst w a #

Invariant (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

invmap :: (a -> b) -> (b -> a) -> AltConst w a -> AltConst w b #

Semigroup w => Apply (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

(<.>) :: AltConst w (a -> b) -> AltConst w a -> AltConst w b #

(.>) :: AltConst w a -> AltConst w b -> AltConst w b #

(<.) :: AltConst w a -> AltConst w b -> AltConst w a #

liftF2 :: (a -> b -> c) -> AltConst w a -> AltConst w b -> AltConst w c #

Monoid w => Plus (AltConst w :: Type -> Type) Source #

Unlike for Const, this is possible because there is no Alternative instance to complicate things.

Instance details

Defined in Data.HFunctor.Interpret

Methods

zero :: AltConst w a #

Semigroup w => Alt (AltConst w :: Type -> Type) Source #

Unlike for Const, this is possible because there is no Alternative instance to complicate things.

Instance details

Defined in Data.HFunctor.Interpret

Methods

(<!>) :: AltConst w a -> AltConst w a -> AltConst w a #

some :: Applicative (AltConst w) => AltConst w a -> AltConst w [a] #

many :: Applicative (AltConst w) => AltConst w a -> AltConst w [a] #

Semigroup w => Divise (AltConst w :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

divise :: (a -> (b, c)) -> AltConst w b -> AltConst w c -> AltConst w a Source #

Semigroup w => Decide (AltConst w :: Type -> Type) Source #

Unlike for Const, this is possible because there is no Decidable instance to complicate things.

Instance details

Defined in Data.HFunctor.Interpret

Methods

decide :: (a -> Either b c) -> AltConst w b -> AltConst w c -> AltConst w a Source #

Monoid w => Conclude (AltConst w :: Type -> Type) Source #

Unlike for Const, this is possible because there is no Decidable instance to complicate things.

Instance details

Defined in Data.HFunctor.Interpret

Methods

conclude :: (a -> Void) -> AltConst w a Source #

Eq w => Eq (AltConst w a) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

(==) :: AltConst w a -> AltConst w a -> Bool #

(/=) :: AltConst w a -> AltConst w a -> Bool #

(Typeable a, Typeable k, Data w) => Data (AltConst w a) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AltConst w a -> c (AltConst w a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (AltConst w a) #

toConstr :: AltConst w a -> Constr #

dataTypeOf :: AltConst w a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (AltConst w a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (AltConst w a)) #

gmapT :: (forall b. Data b => b -> b) -> AltConst w a -> AltConst w a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AltConst w a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AltConst w a -> r #

gmapQ :: (forall d. Data d => d -> u) -> AltConst w a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> AltConst w a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> AltConst w a -> m (AltConst w a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AltConst w a -> m (AltConst w a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AltConst w a -> m (AltConst w a) #

Ord w => Ord (AltConst w a) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

compare :: AltConst w a -> AltConst w a -> Ordering #

(<) :: AltConst w a -> AltConst w a -> Bool #

(<=) :: AltConst w a -> AltConst w a -> Bool #

(>) :: AltConst w a -> AltConst w a -> Bool #

(>=) :: AltConst w a -> AltConst w a -> Bool #

max :: AltConst w a -> AltConst w a -> AltConst w a #

min :: AltConst w a -> AltConst w a -> AltConst w a #

Show w => Show (AltConst w a) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

showsPrec :: Int -> AltConst w a -> ShowS #

show :: AltConst w a -> String #

showList :: [AltConst w a] -> ShowS #

Generic (AltConst w a) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Associated Types

type Rep (AltConst w a) :: Type -> Type #

Methods

from :: AltConst w a -> Rep (AltConst w a) x #

to :: Rep (AltConst w a) x -> AltConst w a #

type Rep (AltConst w a) Source # 
Instance details

Defined in Data.HFunctor.Interpret

type Rep (AltConst w a) = D1 ('MetaData "AltConst" "Data.HFunctor.Interpret" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "AltConst" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAltConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 w)))

Multi-Functors

Classes that deal with two-functor combinators, that "mix" two functors together in some way.

class HBifunctor (t :: (k -> Type) -> (k -> Type) -> k -> Type) where Source #

A HBifunctor is like an HFunctor, but it enhances two different functors instead of just one.

Usually, it enhaces them "together" in some sort of combining way.

This typeclass provides a uniform instance for "swapping out" or "hoisting" the enhanced functors. We can hoist the first one with hleft, the second one with hright, or both at the same time with hbimap.

For example, the f :*: g type gives us "both f and g":

data (f :*: g) a = f a :*: g a

It combines both f and g into a unified structure --- here, it does it by providing both f and g.

The single law is:

hbimap id id == id

This ensures that hleft, hright, and hbimap do not affect the structure that t adds on top of the underlying functors.

Minimal complete definition

hleft, hright | hbimap

Methods

hleft :: (f ~> j) -> t f g ~> t j g Source #

Swap out the first transformed functor.

hright :: (g ~> l) -> t f g ~> t f l Source #

Swap out the second transformed functor.

hbimap :: (f ~> j) -> (g ~> l) -> t f g ~> t j l Source #

Swap out both transformed functors at the same time.

Instances

Instances details
HBifunctor Night Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Night f g ~> Night j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Night f g ~> Night f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Night f g ~> Night j l Source #

HBifunctor Night Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Night f g ~> Night j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Night f g ~> Night f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Night f g ~> Night j l Source #

HBifunctor (Sum :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> Sum f g ~> Sum j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> Sum f g ~> Sum f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> Sum f g ~> Sum j l Source #

HBifunctor ((:+:) :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> (f :+: g) ~> (j :+: g) Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> (f :+: g) ~> (f :+: l) Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> (f :+: g) ~> (j :+: l) Source #

HBifunctor (Product :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> Product f g ~> Product j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> Product f g ~> Product f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> Product f g ~> Product j l Source #

HBifunctor ((:*:) :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> (f :*: g) ~> (j :*: g) Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> (f :*: g) ~> (f :*: l) Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> (f :*: g) ~> (j :*: l) Source #

HBifunctor (Joker :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> Joker f g ~> Joker j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> Joker f g ~> Joker f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> Joker f g ~> Joker j l Source #

HBifunctor (LeftF :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> LeftF f g ~> LeftF j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> LeftF f g ~> LeftF f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> LeftF f g ~> LeftF j l Source #

HBifunctor (RightF :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> RightF f g ~> RightF j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> RightF f g ~> RightF f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> RightF f g ~> RightF j l Source #

HBifunctor (Void3 :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> Void3 f g ~> Void3 j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> Void3 f g ~> Void3 f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> Void3 f g ~> Void3 j l Source #

HBifunctor t => HBifunctor (WrapHBF t :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> WrapHBF t f g ~> WrapHBF t j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> WrapHBF t f g ~> WrapHBF t f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> WrapHBF t f g ~> WrapHBF t j l Source #

HBifunctor Day Source #

Since: 0.3.4.0

Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Day f g ~> Day j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Day f g ~> Day f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Day f g ~> Day j l Source #

HBifunctor Day Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Day f g ~> Day j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Day f g ~> Day f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Day f g ~> Day j l Source #

HBifunctor Day Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Day f g ~> Day j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Day f g ~> Day f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Day f g ~> Day j l Source #

HBifunctor These1 Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> These1 f g ~> These1 j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> These1 f g ~> These1 f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> These1 f g ~> These1 j l Source #

HBifunctor (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Comp f g ~> Comp j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Comp f g ~> Comp f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Comp f g ~> Comp j l Source #

Associative

class (HBifunctor t, Inject (NonEmptyBy t)) => Associative t where Source #

An HBifunctor where it doesn't matter which binds first is Associative. Knowing this gives us a lot of power to rearrange the internals of our HFunctor at will.

For example, for the functor product:

data (f :*: g) a = f a :*: g a

We know that f :*: (g :*: h) is the same as (f :*: g) :*: h.

Formally, we can say that t enriches a the category of endofunctors with semigroup strcture: it turns our endofunctor category into a "semigroupoidal category".

Different instances of t each enrich the endofunctor category in different ways, giving a different semigroupoidal category.

Minimal complete definition

associating, appendNE, matchNE

Associated Types

type NonEmptyBy t :: (Type -> Type) -> Type -> Type Source #

The "semigroup functor combinator" generated by t.

A value of type NonEmptyBy t f a is equivalent to one of:

  • f a
  • t f f a
  • t f (t f f) a
  • t f (t f (t f f)) a
  • t f (t f (t f (t f f))) a
  • .. etc

For example, for :*:, we have NonEmptyF. This is because:

x             ~ NonEmptyF (x :| [])      ~ inject x
x :*: y       ~ NonEmptyF (x :| [y])     ~ toNonEmptyBy (x :*: y)
x :*: y :*: z ~ NonEmptyF (x :| [y,z])
-- etc.

You can create an "singleton" one with inject, or else one from a single t f f with toNonEmptyBy.

See ListBy for a "possibly empty" version of this type.

type FunctorBy t :: (Type -> Type) -> Constraint Source #

A description of "what type of Functor" this tensor is expected to be applied to. This should typically always be either Functor, Contravariant, or Invariant.

Since: 0.3.0.0

Methods

associating :: (FunctorBy t f, FunctorBy t g, FunctorBy t h) => t f (t g h) <~> t (t f g) h Source #

The isomorphism between t f (t g h) a and t (t f g) h a. To use this isomorphism, see assoc and disassoc.

appendNE :: t (NonEmptyBy t f) (NonEmptyBy t f) ~> NonEmptyBy t f Source #

If a NonEmptyBy t f represents multiple applications of t f to itself, then we can also "append" two NonEmptyBy t fs applied to themselves into one giant NonEmptyBy t f containing all of the t fs.

Note that this essentially gives an instance for SemigroupIn t (NonEmptyBy t f), for any functor f.

matchNE :: FunctorBy t f => NonEmptyBy t f ~> (f :+: t f (NonEmptyBy t f)) Source #

If a NonEmptyBy t f represents multiple applications of t f to itself, then we can split it based on whether or not it is just a single f or at least one top-level application of t f.

Note that you can recursively "unroll" a NonEmptyBy completely into a Chain1 by using unrollNE.

consNE :: t f (NonEmptyBy t f) ~> NonEmptyBy t f Source #

Prepend an application of t f to the front of a NonEmptyBy t f.

toNonEmptyBy :: t f f ~> NonEmptyBy t f Source #

Embed a direct application of f to itself into a NonEmptyBy t f.

Instances

Instances details
Associative Day Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Day :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Day :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Day f, FunctorBy Day g, FunctorBy Day h) => Day f (Day g h) <~> Day (Day f g) h Source #

appendNE :: forall (f :: Type -> Type). Day (NonEmptyBy Day f) (NonEmptyBy Day f) ~> NonEmptyBy Day f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Day f => NonEmptyBy Day f ~> (f :+: Day f (NonEmptyBy Day f)) Source #

consNE :: forall (f :: Type -> Type). Day f (NonEmptyBy Day f) ~> NonEmptyBy Day f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Day f f ~> NonEmptyBy Day f Source #

Associative Day Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Day :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Day :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Day f, FunctorBy Day g, FunctorBy Day h) => Day f (Day g h) <~> Day (Day f g) h Source #

appendNE :: forall (f :: Type -> Type). Day (NonEmptyBy Day f) (NonEmptyBy Day f) ~> NonEmptyBy Day f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Day f => NonEmptyBy Day f ~> (f :+: Day f (NonEmptyBy Day f)) Source #

consNE :: forall (f :: Type -> Type). Day f (NonEmptyBy Day f) ~> NonEmptyBy Day f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Day f f ~> NonEmptyBy Day f Source #

Associative Day Source #

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Day :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Day :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Day f, FunctorBy Day g, FunctorBy Day h) => Day f (Day g h) <~> Day (Day f g) h Source #

appendNE :: forall (f :: Type -> Type). Day (NonEmptyBy Day f) (NonEmptyBy Day f) ~> NonEmptyBy Day f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Day f => NonEmptyBy Day f ~> (f :+: Day f (NonEmptyBy Day f)) Source #

consNE :: forall (f :: Type -> Type). Day f (NonEmptyBy Day f) ~> NonEmptyBy Day f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Day f f ~> NonEmptyBy Day f Source #

Associative These1 Source #

Ideally here NonEmptyBy would be equivalent to ListBy, just like for :+:. This should be possible if we can write a bijection. This bijection should be possible in theory --- but it has not yet been implemented.

Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy These1 :: (Type -> Type) -> Type -> Type Source #

type FunctorBy These1 :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy These1 f, FunctorBy These1 g, FunctorBy These1 h) => These1 f (These1 g h) <~> These1 (These1 f g) h Source #

appendNE :: forall (f :: Type -> Type). These1 (NonEmptyBy These1 f) (NonEmptyBy These1 f) ~> NonEmptyBy These1 f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy These1 f => NonEmptyBy These1 f ~> (f :+: These1 f (NonEmptyBy These1 f)) Source #

consNE :: forall (f :: Type -> Type). These1 f (NonEmptyBy These1 f) ~> NonEmptyBy These1 f Source #

toNonEmptyBy :: forall (f :: Type -> Type). These1 f f ~> NonEmptyBy These1 f Source #

Associative Night Source #

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Night :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Night :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Night f, FunctorBy Night g, FunctorBy Night h) => Night f (Night g h) <~> Night (Night f g) h Source #

appendNE :: forall (f :: Type -> Type). Night (NonEmptyBy Night f) (NonEmptyBy Night f) ~> NonEmptyBy Night f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Night f => NonEmptyBy Night f ~> (f :+: Night f (NonEmptyBy Night f)) Source #

consNE :: forall (f :: Type -> Type). Night f (NonEmptyBy Night f) ~> NonEmptyBy Night f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Night f f ~> NonEmptyBy Night f Source #

Associative Night Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Night :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Night :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Night f, FunctorBy Night g, FunctorBy Night h) => Night f (Night g h) <~> Night (Night f g) h Source #

appendNE :: forall (f :: Type -> Type). Night (NonEmptyBy Night f) (NonEmptyBy Night f) ~> NonEmptyBy Night f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Night f => NonEmptyBy Night f ~> (f :+: Night f (NonEmptyBy Night f)) Source #

consNE :: forall (f :: Type -> Type). Night f (NonEmptyBy Night f) ~> NonEmptyBy Night f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Night f f ~> NonEmptyBy Night f Source #

Associative ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy (:+:) :: (Type -> Type) -> Type -> Type Source #

type FunctorBy (:+:) :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy (:+:) f, FunctorBy (:+:) g, FunctorBy (:+:) h) => (f :+: (g :+: h)) <~> ((f :+: g) :+: h) Source #

appendNE :: forall (f :: Type -> Type). (NonEmptyBy (:+:) f :+: NonEmptyBy (:+:) f) ~> NonEmptyBy (:+:) f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy (:+:) f => NonEmptyBy (:+:) f ~> (f :+: (f :+: NonEmptyBy (:+:) f)) Source #

consNE :: forall (f :: Type -> Type). (f :+: NonEmptyBy (:+:) f) ~> NonEmptyBy (:+:) f Source #

toNonEmptyBy :: forall (f :: Type -> Type). (f :+: f) ~> NonEmptyBy (:+:) f Source #

Associative ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy (:*:) :: (Type -> Type) -> Type -> Type Source #

type FunctorBy (:*:) :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy (:*:) f, FunctorBy (:*:) g, FunctorBy (:*:) h) => (f :*: (g :*: h)) <~> ((f :*: g) :*: h) Source #

appendNE :: forall (f :: Type -> Type). (NonEmptyBy (:*:) f :*: NonEmptyBy (:*:) f) ~> NonEmptyBy (:*:) f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy (:*:) f => NonEmptyBy (:*:) f ~> (f :+: (f :*: NonEmptyBy (:*:) f)) Source #

consNE :: forall (f :: Type -> Type). (f :*: NonEmptyBy (:*:) f) ~> NonEmptyBy (:*:) f Source #

toNonEmptyBy :: forall (f :: Type -> Type). (f :*: f) ~> NonEmptyBy (:*:) f Source #

Associative (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Product :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Product :: (Type -> Type) -> Constraint Source #

Associative (Sum :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Sum :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Sum :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Sum f, FunctorBy Sum g, FunctorBy Sum h) => Sum f (Sum g h) <~> Sum (Sum f g) h Source #

appendNE :: forall (f :: Type -> Type). Sum (NonEmptyBy Sum f) (NonEmptyBy Sum f) ~> NonEmptyBy Sum f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Sum f => NonEmptyBy Sum f ~> (f :+: Sum f (NonEmptyBy Sum f)) Source #

consNE :: forall (f :: Type -> Type). Sum f (NonEmptyBy Sum f) ~> NonEmptyBy Sum f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Sum f f ~> NonEmptyBy Sum f Source #

Associative (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Comp :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Comp :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Comp f, FunctorBy Comp g, FunctorBy Comp h) => Comp f (Comp g h) <~> Comp (Comp f g) h Source #

appendNE :: forall (f :: Type -> Type). Comp (NonEmptyBy Comp f) (NonEmptyBy Comp f) ~> NonEmptyBy Comp f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Comp f => NonEmptyBy Comp f ~> (f :+: Comp f (NonEmptyBy Comp f)) Source #

consNE :: forall (f :: Type -> Type). Comp f (NonEmptyBy Comp f) ~> NonEmptyBy Comp f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Comp f f ~> NonEmptyBy Comp f Source #

Associative (Joker :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Joker :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Joker :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Joker f, FunctorBy Joker g, FunctorBy Joker h) => Joker f (Joker g h) <~> Joker (Joker f g) h Source #

appendNE :: forall (f :: Type -> Type). Joker (NonEmptyBy Joker f) (NonEmptyBy Joker f) ~> NonEmptyBy Joker f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Joker f => NonEmptyBy Joker f ~> (f :+: Joker f (NonEmptyBy Joker f)) Source #

consNE :: forall (f :: Type -> Type). Joker f (NonEmptyBy Joker f) ~> NonEmptyBy Joker f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Joker f f ~> NonEmptyBy Joker f Source #

Associative (LeftF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy LeftF :: (Type -> Type) -> Type -> Type Source #

type FunctorBy LeftF :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy LeftF f, FunctorBy LeftF g, FunctorBy LeftF h) => LeftF f (LeftF g h) <~> LeftF (LeftF f g) h Source #

appendNE :: forall (f :: Type -> Type). LeftF (NonEmptyBy LeftF f) (NonEmptyBy LeftF f) ~> NonEmptyBy LeftF f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy LeftF f => NonEmptyBy LeftF f ~> (f :+: LeftF f (NonEmptyBy LeftF f)) Source #

consNE :: forall (f :: Type -> Type). LeftF f (NonEmptyBy LeftF f) ~> NonEmptyBy LeftF f Source #

toNonEmptyBy :: forall (f :: Type -> Type). LeftF f f ~> NonEmptyBy LeftF f Source #

Associative (RightF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy RightF :: (Type -> Type) -> Type -> Type Source #

type FunctorBy RightF :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy RightF f, FunctorBy RightF g, FunctorBy RightF h) => RightF f (RightF g h) <~> RightF (RightF f g) h Source #

appendNE :: forall (f :: Type -> Type). RightF (NonEmptyBy RightF f) (NonEmptyBy RightF f) ~> NonEmptyBy RightF f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy RightF f => NonEmptyBy RightF f ~> (f :+: RightF f (NonEmptyBy RightF f)) Source #

consNE :: forall (f :: Type -> Type). RightF f (NonEmptyBy RightF f) ~> NonEmptyBy RightF f Source #

toNonEmptyBy :: forall (f :: Type -> Type). RightF f f ~> NonEmptyBy RightF f Source #

Associative (Void3 :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Void3 :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Void3 :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Void3 f, FunctorBy Void3 g, FunctorBy Void3 h) => Void3 f (Void3 g h) <~> Void3 (Void3 f g) h Source #

appendNE :: forall (f :: Type -> Type). Void3 (NonEmptyBy Void3 f) (NonEmptyBy Void3 f) ~> NonEmptyBy Void3 f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Void3 f => NonEmptyBy Void3 f ~> (f :+: Void3 f (NonEmptyBy Void3 f)) Source #

consNE :: forall (f :: Type -> Type). Void3 f (NonEmptyBy Void3 f) ~> NonEmptyBy Void3 f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Void3 f f ~> NonEmptyBy Void3 f Source #

Associative t => Associative (WrapHBF t) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy (WrapHBF t) :: (Type -> Type) -> Type -> Type Source #

type FunctorBy (WrapHBF t) :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy (WrapHBF t) f, FunctorBy (WrapHBF t) g, FunctorBy (WrapHBF t) h) => WrapHBF t f (WrapHBF t g h) <~> WrapHBF t (WrapHBF t f g) h Source #

appendNE :: forall (f :: Type -> Type). WrapHBF t (NonEmptyBy (WrapHBF t) f) (NonEmptyBy (WrapHBF t) f) ~> NonEmptyBy (WrapHBF t) f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy (WrapHBF t) f => NonEmptyBy (WrapHBF t) f ~> (f :+: WrapHBF t f (NonEmptyBy (WrapHBF t) f)) Source #

consNE :: forall (f :: Type -> Type). WrapHBF t f (NonEmptyBy (WrapHBF t) f) ~> NonEmptyBy (WrapHBF t) f Source #

toNonEmptyBy :: forall (f :: Type -> Type). WrapHBF t f f ~> NonEmptyBy (WrapHBF t) f Source #

class (Associative t, FunctorBy t f) => SemigroupIn t f where Source #

For different Associative t, we have functors f that we can "squash", using biretract:

t f f ~> f

This gives us the ability to squash applications of t.

Formally, if we have Associative t, we are enriching the category of endofunctors with semigroup structure, turning it into a semigroupoidal category. Different choices of t give different semigroupoidal categories.

A functor f is known as a "semigroup in the (semigroupoidal) category of endofunctors on t" if we can biretract:

t f f ~> 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 semigroups in the semigroupoidal category on :+:
  • The class of functors that are semigroups in the semigroupoidal category on :*: is exactly the functors that are instances of Alt.
  • The class of functors that are semigroups in the semigroupoidal category on Day is exactly the functors that are instances of Apply.
  • The class of functors that are semigroups in the semigroupoidal category on Comp is exactly the functors that are instances of Bind.

Note that instances of this class are intended to be written with t as a fixed type constructor, and f to be allowed to vary freely:

instance Bind f => SemigroupIn Comp 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 newtype wrapper over a type variable, where the second argument also uses a type constructor:

instance SemigroupIn (WrapHBF t) (MyFunctor t i)

This will prevent problems with overloaded instances.

Minimal complete definition

Nothing

Methods

biretract :: t f f ~> f Source #

The HBifunctor analogy of retract. It retracts both fs into a single f, effectively fully mixing them together.

This function makes f a semigroup in the category of endofunctors with respect to tensor t.

default biretract :: Interpret (NonEmptyBy t) f => t f f ~> f Source #

binterpret :: (g ~> f) -> (h ~> f) -> t g h ~> f Source #

The HBifunctor analogy of interpret. It takes two interpreting functions, and mixes them together into a target functor h.

Note that this is useful in the poly-kinded case, but it is not possible to define generically for all SemigroupIn because it only is defined for Type -> Type inputes. See !+! for a version that is poly-kinded for :+: in specific.

default binterpret :: Interpret (NonEmptyBy t) f => (g ~> f) -> (h ~> f) -> t g h ~> f Source #

Instances

Instances details
Apply f => SemigroupIn Day f Source #

Instances of Apply are semigroups in the semigroupoidal category on Day.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Day f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Day g h ~> f Source #

Divise f => SemigroupIn Day f Source #

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Day f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Day g h ~> f Source #

Alt f => SemigroupIn These1 f Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: These1 f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> These1 g h ~> f Source #

Decide f => SemigroupIn Night f Source #

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Night f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Night g h ~> f Source #

SemigroupIn ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

All functors are semigroups in the semigroupoidal category on :+:.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: (f :+: f) ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> (g :+: h) ~> f Source #

Alt f => SemigroupIn ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

Instances of Alt are semigroups in the semigroupoidal category on :*:.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: (f :*: f) ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> (g :*: h) ~> f Source #

Alt f => SemigroupIn (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

Instances of Alt are semigroups in the semigroupoidal category on Product.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Product f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Product g h ~> f Source #

SemigroupIn (Sum :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

All functors are semigroups in the semigroupoidal category on Sum.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Sum f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Sum g h ~> f Source #

Bind f => SemigroupIn (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

Instances of Bind are semigroups in the semigroupoidal category on Comp.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Comp f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Comp g h ~> f Source #

SemigroupIn (Joker :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Joker f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Joker g h ~> f Source #

SemigroupIn (LeftF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: LeftF f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> LeftF g h ~> f Source #

SemigroupIn (RightF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: RightF f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> RightF g h ~> f Source #

SemigroupIn (Void3 :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

All functors are semigroups in the semigroupoidal category on Void3.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Void3 f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Void3 g h ~> f Source #

(Associative t, FunctorBy t f, FunctorBy t (WrapNE t f)) => SemigroupIn (WrapHBF t) (WrapNE t f) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: WrapHBF t (WrapNE t f) (WrapNE t f) ~> WrapNE t f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> WrapNE t f) -> (h ~> WrapNE t f) -> WrapHBF t g h ~> WrapNE t f Source #

(Tensor t i, FunctorBy t f, FunctorBy t (WrapLB t f)) => SemigroupIn (WrapHBF t) (WrapLB t f) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

biretract :: WrapHBF t (WrapLB t f) (WrapLB t f) ~> WrapLB t f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> WrapLB t f) -> (h ~> WrapLB t f) -> WrapHBF t g h ~> WrapLB t f Source #

(Associative t, FunctorBy t f, FunctorBy t (Chain1 t f)) => SemigroupIn (WrapHBF t) (Chain1 t f) Source #

Chain1 t is the "free SemigroupIn t". However, we have to wrap t in WrapHBF to prevent overlapping instances.

Instance details

Defined in Data.HFunctor.Chain

Methods

biretract :: WrapHBF t (Chain1 t f) (Chain1 t f) ~> Chain1 t f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> Chain1 t f) -> (h ~> Chain1 t f) -> WrapHBF t g h ~> Chain1 t f Source #

(Tensor t i, FunctorBy t (Chain t i f)) => SemigroupIn (WrapHBF t) (Chain t i f) Source #

We have to wrap t in WrapHBF to prevent overlapping instances.

Instance details

Defined in Data.HFunctor.Chain

Methods

biretract :: WrapHBF t (Chain t i f) (Chain t i f) ~> Chain t i f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> Chain t i f) -> (h ~> Chain t i f) -> WrapHBF t g h ~> Chain t i f Source #

biget :: SemigroupIn t (AltConst b) => (forall x. f x -> b) -> (forall x. g x -> b) -> t f g a -> b Source #

Useful wrapper over binterpret to allow you to directly extract a value b out of the t f g a, if you can convert an f x and g x into b.

Note that depending on the constraints on h in SemigroupIn t h, you may have extra constraints on b.

For some constraints (like Monad), this will not be usable.

-- Return the length of either the list, or the Map, depending on which
--   one s in the +
biget length length
    :: ([] :+: Map Int) Char
    -> Int

-- Return the length of both the list and the map, added together
biget (Sum . length) (Sum . length)
    :: Day [] (Map Int) Char
    -> Sum Int

biapply :: SemigroupIn t (Op b) => (forall x. f x -> x -> b) -> (forall x. g x -> x -> b) -> t f g a -> a -> b Source #

Useful wrapper over binterpret to allow you to directly extract a value b out of the t f g a, if you can convert an f x and g x into b, given an x input.

Note that depending on the constraints on h in SemigroupIn t h, you may have extra constraints on b.

  • If h is unconstrained, there are no constraints on b
  • If h must be Divise, or Divisible, b needs to be an instance of Semigroup
  • If h must be Divisible, then b needs to be an instance of Monoid.

For some constraints (like Monad), this will not be usable.

Since: 0.3.2.0

(!*!) :: SemigroupIn t h => (f ~> h) -> (g ~> h) -> t f g ~> h infixr 5 Source #

Infix alias for binterpret

Note that this is useful in the poly-kinded case, but it is not possible to define generically for all SemigroupIn because it only is defined for Type -> Type inputes. See !+! for a version that is poly-kinded for :+: in specific.

(!+!) :: (f ~> h) -> (g ~> h) -> (f :+: g) ~> h infixr 5 Source #

A version of !*! specifically for :+: that is poly-kinded

(!$!) :: SemigroupIn t (AltConst b) => (forall x. f x -> b) -> (forall x. g x -> b) -> t f g a -> b infixr 5 Source #

Infix alias for biget

-- Return the length of either the list, or the Map, depending on which
--   one s in the +
length !$! length
    :: ([] :+: Map Int) Char
    -> Int

-- Return the length of both the list and the map, added together
Sum . length !$! Sum . length
    :: Day [] (Map Int) Char
    -> Sum Int

Tensor

class (Associative t, Inject (ListBy t)) => Tensor t i | t -> i where Source #

An Associative HBifunctor can be a Tensor if there is some identity i where t i f and t f i are equivalent to just f.

That is, "enhancing" f with t i does nothing.

The methods in this class provide us useful ways of navigating a Tensor t with respect to this property.

The Tensor is essentially the HBifunctor equivalent of Inject, with intro1 and intro2 taking the place of inject.

Formally, we can say that t enriches a the category of endofunctors with monoid strcture: it turns our endofunctor category into a "monoidal category".

Different instances of t each enrich the endofunctor category in different ways, giving a different monoidal category.

Minimal complete definition

intro1, intro2, elim1, elim2, appendLB, splitNE, splittingLB

Associated Types

type ListBy t :: (Type -> Type) -> Type -> Type Source #

The "monoidal functor combinator" induced by t.

A value of type ListBy t f a is equivalent to one of:

  • I a -- zero fs
  • f a -- one f
  • t f f a -- two fs
  • t f (t f f) a -- three fs
  • t f (t f (t f f)) a
  • t f (t f (t f (t f f))) a
  • .. etc

For example, for :*:, we have ListF. This is because:

Proxy         ~ ListF []         ~ nilLB @(:*:)
x             ~ ListF [x]        ~ inject x
x :*: y       ~ ListF [x,y]      ~ toListBy (x :*: y)
x :*: y :*: z ~ ListF [x,y,z]
-- etc.

You can create an "empty" one with nilLB, a "singleton" one with inject, or else one from a single t f f with toListBy.

See NonEmptyBy for a "non-empty" version of this type.

Methods

intro1 :: f ~> t f i Source #

Because t f (I t) is equivalent to f, we can always "insert" f into t f (I t).

This is analogous to inject from Inject, but for HBifunctors.

intro2 :: g ~> t i g Source #

Because t (I t) g is equivalent to f, we can always "insert" g into t (I t) g.

This is analogous to inject from Inject, but for HBifunctors.

elim1 :: FunctorBy t f => t f i ~> f Source #

Witnesses the property that i is the identity of t: t f i always leaves f unchanged, so we can always just drop the i.

elim2 :: FunctorBy t g => t i g ~> g Source #

Witnesses the property that i is the identity of t: t i g always leaves g unchanged, so we can always just drop the i t.

appendLB :: t (ListBy t f) (ListBy t f) ~> ListBy t f Source #

If a ListBy t f represents multiple applications of t f to itself, then we can also "append" two ListBy t fs applied to themselves into one giant ListBy t f containing all of the t fs.

Note that this essentially gives an instance for SemigroupIn t (ListBy t f), for any functor f; this is witnessed by WrapLB.

splitNE :: NonEmptyBy t f ~> t f (ListBy t f) Source #

Lets you convert an NonEmptyBy t f into a single application of f to ListBy t f.

Analogous to a function NonEmpty a -> (a, [a])

Note that this is not reversible in general unless we have Matchable t.

splittingLB :: ListBy t f <~> (i :+: t f (ListBy t f)) Source #

An ListBy t f is either empty, or a single application of t to f and ListBy t f (the "head" and "tail"). This witnesses that isomorphism.

To use this property, see nilLB, consLB, and unconsLB.

toListBy :: t f f ~> ListBy t f Source #

Embed a direct application of f to itself into a ListBy t f.

fromNE :: NonEmptyBy t f ~> ListBy t f Source #

NonEmptyBy t f is "one or more fs", and 'ListBy t f is "zero or more fs". This function lets us convert from one to the other.

This is analogous to a function NonEmpty a -> [a].

Note that because t is not inferrable from the input or output type, you should call this using -XTypeApplications:

fromNE @(:*:) :: NonEmptyF f a -> ListF f a
fromNE @Comp  :: Free1 f a -> Free f a

Instances

Instances details
Tensor Day Identity Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Day :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Day f Identity Source #

intro2 :: forall (g :: Type -> Type). g ~> Day Identity g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Day f => Day f Identity ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Day g => Day Identity g ~> g Source #

appendLB :: forall (f :: Type -> Type). Day (ListBy Day f) (ListBy Day f) ~> ListBy Day f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Day f ~> Day f (ListBy Day f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Day f <~> (Identity :+: Day f (ListBy Day f)) Source #

toListBy :: forall (f :: Type -> Type). Day f f ~> ListBy Day f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Day f ~> ListBy Day f Source #

Tensor Day Identity Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Day :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Day f Identity Source #

intro2 :: forall (g :: Type -> Type). g ~> Day Identity g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Day f => Day f Identity ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Day g => Day Identity g ~> g Source #

appendLB :: forall (f :: Type -> Type). Day (ListBy Day f) (ListBy Day f) ~> ListBy Day f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Day f ~> Day f (ListBy Day f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Day f <~> (Identity :+: Day f (ListBy Day f)) Source #

toListBy :: forall (f :: Type -> Type). Day f f ~> ListBy Day f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Day f ~> ListBy Day f Source #

Tensor Night Not Source #

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Night :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Night f Not Source #

intro2 :: forall (g :: Type -> Type). g ~> Night Not g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Night f => Night f Not ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Night g => Night Not g ~> g Source #

appendLB :: forall (f :: Type -> Type). Night (ListBy Night f) (ListBy Night f) ~> ListBy Night f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> Night f (ListBy Night f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Night f <~> (Not :+: Night f (ListBy Night f)) Source #

toListBy :: forall (f :: Type -> Type). Night f f ~> ListBy Night f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> ListBy Night f Source #

Tensor Night Not Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Night :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Night f Not Source #

intro2 :: forall (g :: Type -> Type). g ~> Night Not g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Night f => Night f Not ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Night g => Night Not g ~> g Source #

appendLB :: forall (f :: Type -> Type). Night (ListBy Night f) (ListBy Night f) ~> ListBy Night f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> Night f (ListBy Night f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Night f <~> (Not :+: Night f (ListBy Night f)) Source #

toListBy :: forall (f :: Type -> Type). Night f f ~> ListBy Night f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> ListBy Night f Source #

Tensor Day (Proxy :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Day :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Day f Proxy Source #

intro2 :: forall (g :: Type -> Type). g ~> Day Proxy g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Day f => Day f Proxy ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Day g => Day Proxy g ~> g Source #

appendLB :: forall (f :: Type -> Type). Day (ListBy Day f) (ListBy Day f) ~> ListBy Day f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Day f ~> Day f (ListBy Day f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Day f <~> (Proxy :+: Day f (ListBy Day f)) Source #

toListBy :: forall (f :: Type -> Type). Day f f ~> ListBy Day f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Day f ~> ListBy Day f Source #

Tensor These1 (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy These1 :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> These1 f V1 Source #

intro2 :: forall (g :: Type -> Type). g ~> These1 V1 g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy These1 f => These1 f V1 ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy These1 g => These1 V1 g ~> g Source #

appendLB :: forall (f :: Type -> Type). These1 (ListBy These1 f) (ListBy These1 f) ~> ListBy These1 f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy These1 f ~> These1 f (ListBy These1 f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy These1 f <~> (V1 :+: These1 f (ListBy These1 f)) Source #

toListBy :: forall (f :: Type -> Type). These1 f f ~> ListBy These1 f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy These1 f ~> ListBy These1 f Source #

Tensor (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Comp :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Comp f Identity Source #

intro2 :: forall (g :: Type -> Type). g ~> Comp Identity g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Comp f => Comp f Identity ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Comp g => Comp Identity g ~> g Source #

appendLB :: forall (f :: Type -> Type). Comp (ListBy Comp f) (ListBy Comp f) ~> ListBy Comp f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Comp f ~> Comp f (ListBy Comp f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Comp f <~> (Identity :+: Comp f (ListBy Comp f)) Source #

toListBy :: forall (f :: Type -> Type). Comp f f ~> ListBy Comp f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Comp f ~> ListBy Comp f Source #

Tensor ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy (:+:) :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> (f :+: V1) Source #

intro2 :: forall (g :: Type -> Type). g ~> (V1 :+: g) Source #

elim1 :: forall (f :: Type -> Type). FunctorBy (:+:) f => (f :+: V1) ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy (:+:) g => (V1 :+: g) ~> g Source #

appendLB :: forall (f :: Type -> Type). (ListBy (:+:) f :+: ListBy (:+:) f) ~> ListBy (:+:) f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy (:+:) f ~> (f :+: ListBy (:+:) f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy (:+:) f <~> (V1 :+: (f :+: ListBy (:+:) f)) Source #

toListBy :: forall (f :: Type -> Type). (f :+: f) ~> ListBy (:+:) f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy (:+:) f ~> ListBy (:+:) f Source #

Tensor ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy (:*:) :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> (f :*: Proxy) Source #

intro2 :: forall (g :: Type -> Type). g ~> (Proxy :*: g) Source #

elim1 :: forall (f :: Type -> Type). FunctorBy (:*:) f => (f :*: Proxy) ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy (:*:) g => (Proxy :*: g) ~> g Source #

appendLB :: forall (f :: Type -> Type). (ListBy (:*:) f :*: ListBy (:*:) f) ~> ListBy (:*:) f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy (:*:) f ~> (f :*: ListBy (:*:) f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy (:*:) f <~> (Proxy :+: (f :*: ListBy (:*:) f)) Source #

toListBy :: forall (f :: Type -> Type). (f :*: f) ~> ListBy (:*:) f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy (:*:) f ~> ListBy (:*:) f Source #

Tensor (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Product :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Product f Proxy Source #

intro2 :: forall (g :: Type -> Type). g ~> Product Proxy g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Product f => Product f Proxy ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Product g => Product Proxy g ~> g Source #

appendLB :: forall (f :: Type -> Type). Product (ListBy Product f) (ListBy Product f) ~> ListBy Product f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Product f ~> Product f (ListBy Product f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Product f <~> (Proxy :+: Product f (ListBy Product f)) Source #

toListBy :: forall (f :: Type -> Type). Product f f ~> ListBy Product f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Product f ~> ListBy Product f Source #

Tensor (Sum :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Sum :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Sum f V1 Source #

intro2 :: forall (g :: Type -> Type). g ~> Sum V1 g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Sum f => Sum f V1 ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Sum g => Sum V1 g ~> g Source #

appendLB :: forall (f :: Type -> Type). Sum (ListBy Sum f) (ListBy Sum f) ~> ListBy Sum f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Sum f ~> Sum f (ListBy Sum f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Sum f <~> (V1 :+: Sum f (ListBy Sum f)) Source #

toListBy :: forall (f :: Type -> Type). Sum f f ~> ListBy Sum f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Sum f ~> ListBy Sum f Source #

Tensor t i => Tensor (WrapHBF t) (WrapF i) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy (WrapHBF t) :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> WrapHBF t f (WrapF i) Source #

intro2 :: forall (g :: Type -> Type). g ~> WrapHBF t (WrapF i) g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy (WrapHBF t) f => WrapHBF t f (WrapF i) ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy (WrapHBF t) g => WrapHBF t (WrapF i) g ~> g Source #

appendLB :: forall (f :: Type -> Type). WrapHBF t (ListBy (WrapHBF t) f) (ListBy (WrapHBF t) f) ~> ListBy (WrapHBF t) f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy (WrapHBF t) f ~> WrapHBF t f (ListBy (WrapHBF t) f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy (WrapHBF t) f <~> (WrapF i :+: WrapHBF t f (ListBy (WrapHBF t) f)) Source #

toListBy :: forall (f :: Type -> Type). WrapHBF t f f ~> ListBy (WrapHBF t) f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy (WrapHBF t) f ~> ListBy (WrapHBF t) f Source #

class (Tensor t i, SemigroupIn t f) => MonoidIn t i f where Source #

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.

Minimal complete definition

Nothing

Methods

pureT :: i ~> f Source #

If we have an i, we can generate an f based on how it interacts with t.

Specialized (and simplified), this type is:

pureT @Day   :: Applicative f => Identity a -> f a  -- pure
pureT @Comp  :: Monad f => Identity a -> f a        -- return
pureT @(:*:) :: Plus f => Proxy a -> f a            -- zero

Note that because t appears nowhere in the input or output types, you must always use this with explicit type application syntax (like pureT @Day)

Along with biretract, this function makes f a monoid in the category of endofunctors with respect to tensor t.

default pureT :: Interpret (ListBy t) f => i ~> f Source #

Instances

Instances details
(Apply f, Applicative f) => MonoidIn Day Identity f Source #

Instances of Applicative are monoids in the monoidal category on the covariant Day.

Note that because of typeclass constraints, this requires Apply as well as Applicative. But, you can get a "local" instance of Apply for any Applicative using unsafeApply.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Identity ~> f Source #

Conclude f => MonoidIn Night Not f Source #

Instances of Conclude are monoids in the monoidal category on Night.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Not ~> f Source #

(Divise f, Divisible f) => MonoidIn Day (Proxy :: Type -> Type) f Source #

Instances of Divisible are monoids in the monoidal category on contravariant Day.

Note that because of typeclass constraints, this requires Divise as well as Divisible. But, you can get a "local" instance of Divise for any Divisible using unsafeDivise.

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Proxy ~> f Source #

Alt f => MonoidIn These1 (V1 :: Type -> Type) f Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: V1 ~> f Source #

(Bind f, Monad f) => MonoidIn (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f Source #

Instances of Monad are monoids in the monoidal category on Comp.

This instance is the "proof" that "monads are the monoids in the category of endofunctors (enriched with Comp)"

Note that because of typeclass constraints, this requires Bind as well as Monad. But, you can get a "local" instance of Apply for any Monad using unsafeBind.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Identity ~> f Source #

MonoidIn ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) f Source #

All functors are monoids in the monoidal category on :+:.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: V1 ~> f Source #

Plus f => MonoidIn ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f Source #

Instances of Plus are monoids in the monoidal category on :*:.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Proxy ~> f Source #

Plus f => MonoidIn (Product :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f Source #

Instances of Plus are monoids in the monoidal category on Product.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Proxy ~> f Source #

MonoidIn (Sum :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) f Source #

All functors are monoids in the monoidal category on Sum.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: V1 ~> f Source #

(Tensor t i, FunctorBy t f, FunctorBy t (WrapLB t f)) => MonoidIn (WrapHBF t) (WrapF i) (WrapLB t f) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: WrapF i ~> WrapLB t f Source #

(Tensor t i, FunctorBy t (Chain t i f)) => MonoidIn (WrapHBF t) (WrapF i) (Chain t i f) Source #

Chain t i is the "free MonoidIn t i". However, we have to wrap t in WrapHBF and i in WrapF to prevent overlapping instances.

Instance details

Defined in Data.HFunctor.Chain

Methods

pureT :: WrapF i ~> Chain t i f Source #

nilLB :: forall t i f. Tensor t i => i ~> ListBy t f Source #

Create the "empty ListBy".

If ListBy t f represents multiple applications of t f with itself, then nilLB gives us "zero applications of f".

Note that t cannot be inferred from the input or output type of nilLB, so this function must always be called with -XTypeApplications:

nilLB @Day :: Identity ~> Ap f
nilLB @Comp :: Identity ~> Free f
nilLB @(:*:) :: Proxy ~> ListF f

Note that this essentially gives an instance for MonoidIn t i (ListBy t f), for any functor f; this is witnessed by WrapLB.

consLB :: Tensor t i => t f (ListBy t f) ~> ListBy t f Source #

Lets us "cons" an application of f to the front of an ListBy t f.

inL :: forall t i f g. MonoidIn t i g => f ~> t f g Source #

Convenient wrapper over intro1 that lets us introduce an arbitrary functor g to the right of an f.

You can think of this as an HBifunctor analogue of inject.

inR :: forall t i f g. MonoidIn t i f => g ~> t f g Source #

Convenient wrapper over intro2 that lets us introduce an arbitrary functor f to the right of a g.

You can think of this as an HBifunctor analogue of inject.

outL :: (Tensor t Proxy, FunctorBy t f) => t f g ~> f Source #

Convenient wrapper over elim1 that lets us drop one of the arguments of a Tensor for free, without requiring any extra constraints (like for binterpret).

See prodOutL for a version that does not require Functor f, specifically for :*:.

outR :: (Tensor t Proxy, FunctorBy t g) => t f g ~> g Source #

Convenient wrapper over elim2 that lets us drop one of the arguments of a Tensor for free, without requiring any constraints (like for binterpret).

See prodOutR for a version that does not require Functor g, specifically for :*:.

Combinators

Functor combinators ** Single

data Coyoneda (f :: Type -> Type) a where #

A covariant Functor suitable for Yoneda reduction

Constructors

Coyoneda :: forall b a (f :: Type -> Type). (b -> a) -> f b -> Coyoneda f a 

Instances

Instances details
ComonadTrans Coyoneda 
Instance details

Defined in Data.Functor.Coyoneda

Methods

lower :: Comonad w => Coyoneda w a -> w a #

MonadTrans Coyoneda 
Instance details

Defined in Data.Functor.Coyoneda

Methods

lift :: Monad m => m a -> Coyoneda m a #

FreeOf Functor Coyoneda Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Coyoneda :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Coyoneda f ~> Final Functor f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Coyoneda f => Final Functor f ~> Coyoneda f Source #

Monad m => Monad (Coyoneda m) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

(>>=) :: Coyoneda m a -> (a -> Coyoneda m b) -> Coyoneda m b #

(>>) :: Coyoneda m a -> Coyoneda m b -> Coyoneda m b #

return :: a -> Coyoneda m a #

Functor (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

fmap :: (a -> b) -> Coyoneda f a -> Coyoneda f b #

(<$) :: a -> Coyoneda f b -> Coyoneda f a #

MonadFix f => MonadFix (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

mfix :: (a -> Coyoneda f a) -> Coyoneda f a #

Applicative f => Applicative (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

pure :: a -> Coyoneda f a #

(<*>) :: Coyoneda f (a -> b) -> Coyoneda f a -> Coyoneda f b #

liftA2 :: (a -> b -> c) -> Coyoneda f a -> Coyoneda f b -> Coyoneda f c #

(*>) :: Coyoneda f a -> Coyoneda f b -> Coyoneda f b #

(<*) :: Coyoneda f a -> Coyoneda f b -> Coyoneda f a #

Foldable f => Foldable (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

fold :: Monoid m => Coyoneda f m -> m #

foldMap :: Monoid m => (a -> m) -> Coyoneda f a -> m #

foldMap' :: Monoid m => (a -> m) -> Coyoneda f a -> m #

foldr :: (a -> b -> b) -> b -> Coyoneda f a -> b #

foldr' :: (a -> b -> b) -> b -> Coyoneda f a -> b #

foldl :: (b -> a -> b) -> b -> Coyoneda f a -> b #

foldl' :: (b -> a -> b) -> b -> Coyoneda f a -> b #

foldr1 :: (a -> a -> a) -> Coyoneda f a -> a #

foldl1 :: (a -> a -> a) -> Coyoneda f a -> a #

toList :: Coyoneda f a -> [a] #

null :: Coyoneda f a -> Bool #

length :: Coyoneda f a -> Int #

elem :: Eq a => a -> Coyoneda f a -> Bool #

maximum :: Ord a => Coyoneda f a -> a #

minimum :: Ord a => Coyoneda f a -> a #

sum :: Num a => Coyoneda f a -> a #

product :: Num a => Coyoneda f a -> a #

Traversable f => Traversable (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Coyoneda f a -> f0 (Coyoneda f b) #

sequenceA :: Applicative f0 => Coyoneda f (f0 a) -> f0 (Coyoneda f a) #

mapM :: Monad m => (a -> m b) -> Coyoneda f a -> m (Coyoneda f b) #

sequence :: Monad m => Coyoneda f (m a) -> m (Coyoneda f a) #

Distributive f => Distributive (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

distribute :: Functor f0 => f0 (Coyoneda f a) -> Coyoneda f (f0 a) #

collect :: Functor f0 => (a -> Coyoneda f b) -> f0 a -> Coyoneda f (f0 b) #

distributeM :: Monad m => m (Coyoneda f a) -> Coyoneda f (m a) #

collectM :: Monad m => (a -> Coyoneda f b) -> m a -> Coyoneda f (m b) #

Representable f => Representable (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Associated Types

type Rep (Coyoneda f) #

Methods

tabulate :: (Rep (Coyoneda f) -> a) -> Coyoneda f a #

index :: Coyoneda f a -> Rep (Coyoneda f) -> a #

Eq1 f => Eq1 (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

liftEq :: (a -> b -> Bool) -> Coyoneda f a -> Coyoneda f b -> Bool #

Ord1 f => Ord1 (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

liftCompare :: (a -> b -> Ordering) -> Coyoneda f a -> Coyoneda f b -> Ordering #

Read1 f => Read1 (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Coyoneda f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Coyoneda f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Coyoneda f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Coyoneda f a] #

(Functor f, Show1 f) => Show1 (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Coyoneda f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Coyoneda f a] -> ShowS #

Alternative f => Alternative (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

empty :: Coyoneda f a #

(<|>) :: Coyoneda f a -> Coyoneda f a -> Coyoneda f a #

some :: Coyoneda f a -> Coyoneda f [a] #

many :: Coyoneda f a -> Coyoneda f [a] #

MonadPlus f => MonadPlus (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

mzero :: Coyoneda f a #

mplus :: Coyoneda f a -> Coyoneda f a -> Coyoneda f a #

Comonad w => Comonad (Coyoneda w) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

extract :: Coyoneda w a -> a #

duplicate :: Coyoneda w a -> Coyoneda w (Coyoneda w a) #

extend :: (Coyoneda w a -> b) -> Coyoneda w a -> Coyoneda w b #

Foldable1 f => Foldable1 (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

fold1 :: Semigroup m => Coyoneda f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Coyoneda f a -> m #

toNonEmpty :: Coyoneda f a -> NonEmpty a #

Apply f => Apply (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

(<.>) :: Coyoneda f (a -> b) -> Coyoneda f a -> Coyoneda f b #

(.>) :: Coyoneda f a -> Coyoneda f b -> Coyoneda f b #

(<.) :: Coyoneda f a -> Coyoneda f b -> Coyoneda f a #

liftF2 :: (a -> b -> c) -> Coyoneda f a -> Coyoneda f b -> Coyoneda f c #

Traversable1 f => Traversable1 (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Coyoneda f a -> f0 (Coyoneda f b) #

sequence1 :: Apply f0 => Coyoneda f (f0 b) -> f0 (Coyoneda f b) #

Plus f => Plus (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

zero :: Coyoneda f a #

Alt f => Alt (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

(<!>) :: Coyoneda f a -> Coyoneda f a -> Coyoneda f a #

some :: Applicative (Coyoneda f) => Coyoneda f a -> Coyoneda f [a] #

many :: Applicative (Coyoneda f) => Coyoneda f a -> Coyoneda f [a] #

Bind m => Bind (Coyoneda m) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

(>>-) :: Coyoneda m a -> (a -> Coyoneda m b) -> Coyoneda m b #

join :: Coyoneda m (Coyoneda m a) -> Coyoneda m a #

Extend w => Extend (Coyoneda w) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

duplicated :: Coyoneda w a -> Coyoneda w (Coyoneda w a) #

extended :: (Coyoneda w a -> b) -> Coyoneda w a -> Coyoneda w b #

HBind Coyoneda Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k -> Type) (g :: k -> Type). (f ~> Coyoneda g) -> Coyoneda f ~> Coyoneda g Source #

hjoin :: forall (f :: k -> Type). Coyoneda (Coyoneda f) ~> Coyoneda f Source #

Inject Coyoneda Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Coyoneda f Source #

Functor f => Interpret Coyoneda (f :: Type -> Type) Source #

A free Functor

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Coyoneda f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Coyoneda g ~> f Source #

Adjunction f g => Adjunction (Coyoneda f) (Coyoneda g) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

unit :: a -> Coyoneda g (Coyoneda f a) #

counit :: Coyoneda f (Coyoneda g a) -> a #

leftAdjunct :: (Coyoneda f a -> b) -> a -> Coyoneda g b #

rightAdjunct :: (a -> Coyoneda g b) -> Coyoneda f a -> b #

HFunctor Coyoneda Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Coyoneda f ~> Coyoneda g Source #

(Functor f, Eq1 f, Eq a) => Eq (Coyoneda f a) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

(==) :: Coyoneda f a -> Coyoneda f a -> Bool #

(/=) :: Coyoneda f a -> Coyoneda f a -> Bool #

(Functor f, Ord1 f, Ord a) => Ord (Coyoneda f a) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

compare :: Coyoneda f a -> Coyoneda f a -> Ordering #

(<) :: Coyoneda f a -> Coyoneda f a -> Bool #

(<=) :: Coyoneda f a -> Coyoneda f a -> Bool #

(>) :: Coyoneda f a -> Coyoneda f a -> Bool #

(>=) :: Coyoneda f a -> Coyoneda f a -> Bool #

max :: Coyoneda f a -> Coyoneda f a -> Coyoneda f a #

min :: Coyoneda f a -> Coyoneda f a -> Coyoneda f a #

Read (f a) => Read (Coyoneda f a) 
Instance details

Defined in Data.Functor.Coyoneda

(Functor f, Show1 f, Show a) => Show (Coyoneda f a) 
Instance details

Defined in Data.Functor.Coyoneda

Methods

showsPrec :: Int -> Coyoneda f a -> ShowS #

show :: Coyoneda f a -> String #

showList :: [Coyoneda f a] -> ShowS #

type FreeFunctorBy Coyoneda Source # 
Instance details

Defined in Data.HFunctor.Final

type Rep (Coyoneda f) 
Instance details

Defined in Data.Functor.Coyoneda

type Rep (Coyoneda f) = Rep f

newtype ListF f a Source #

A list of f as. Can be used to describe a product of many different values of type f a.

This is the Free Plus.

Incidentally, if used with a Contravariant f, this is instead the free Divisible.

Constructors

ListF 

Fields

Instances

Instances details
HFunctor (ListF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> ListF f ~> ListF g Source #

HBind (ListF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> ListF g) -> ListF f ~> ListF g Source #

hjoin :: forall (f :: k0 -> Type). ListF (ListF f) ~> ListF f Source #

Inject (ListF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> ListF f Source #

FreeOf Plus (ListF :: (Type -> Type) -> Type -> Type) Source #

This could also be FreeOf Divisible if FreeFunctorBy ListF ~ Contravariant. However, there isn't really a way to express this at the moment.

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy ListF :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). ListF f ~> Final Plus f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy ListF f => Final Plus f ~> ListF f Source #

Plus f => Interpret (ListF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

A free Plus

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: ListF f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> ListF g ~> f Source #

Functor f => Functor (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fmap :: (a -> b) -> ListF f a -> ListF f b #

(<$) :: a -> ListF f b -> ListF f a #

Applicative f => Applicative (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

pure :: a -> ListF f a #

(<*>) :: ListF f (a -> b) -> ListF f a -> ListF f b #

liftA2 :: (a -> b -> c) -> ListF f a -> ListF f b -> ListF f c #

(*>) :: ListF f a -> ListF f b -> ListF f b #

(<*) :: ListF f a -> ListF f b -> ListF f a #

Foldable f => Foldable (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fold :: Monoid m => ListF f m -> m #

foldMap :: Monoid m => (a -> m) -> ListF f a -> m #

foldMap' :: Monoid m => (a -> m) -> ListF f a -> m #

foldr :: (a -> b -> b) -> b -> ListF f a -> b #

foldr' :: (a -> b -> b) -> b -> ListF f a -> b #

foldl :: (b -> a -> b) -> b -> ListF f a -> b #

foldl' :: (b -> a -> b) -> b -> ListF f a -> b #

foldr1 :: (a -> a -> a) -> ListF f a -> a #

foldl1 :: (a -> a -> a) -> ListF f a -> a #

toList :: ListF f a -> [a] #

null :: ListF f a -> Bool #

length :: ListF f a -> Int #

elem :: Eq a => a -> ListF f a -> Bool #

maximum :: Ord a => ListF f a -> a #

minimum :: Ord a => ListF f a -> a #

sum :: Num a => ListF f a -> a #

product :: Num a => ListF f a -> a #

Traversable f => Traversable (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ListF f a -> f0 (ListF f b) #

sequenceA :: Applicative f0 => ListF f (f0 a) -> f0 (ListF f a) #

mapM :: Monad m => (a -> m b) -> ListF f a -> m (ListF f b) #

sequence :: Monad m => ListF f (m a) -> m (ListF f a) #

Contravariant f => Contravariant (ListF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

contramap :: (a -> b) -> ListF f b -> ListF f a #

(>$) :: b -> ListF f b -> ListF f a #

Eq1 f => Eq1 (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftEq :: (a -> b -> Bool) -> ListF f a -> ListF f b -> Bool #

Ord1 f => Ord1 (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftCompare :: (a -> b -> Ordering) -> ListF f a -> ListF f b -> Ordering #

Read1 f => Read1 (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (ListF f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [ListF f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (ListF f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [ListF f a] #

Show1 f => Show1 (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ListF f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ListF f a] -> ShowS #

Applicative f => Alternative (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

empty :: ListF f a #

(<|>) :: ListF f a -> ListF f a -> ListF f a #

some :: ListF f a -> ListF f [a] #

many :: ListF f a -> ListF f [a] #

Contravariant f => Divisible (ListF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

divide :: (a -> (b, c)) -> ListF f b -> ListF f c -> ListF f a #

conquer :: ListF f a #

Decidable f => Decidable (ListF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

lose :: (a -> Void) -> ListF f a #

choose :: (a -> Either b c) -> ListF f b -> ListF f c -> ListF f a #

Invariant f => Invariant (ListF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

invmap :: (a -> b) -> (b -> a) -> ListF f a -> ListF f b #

Apply f => Apply (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(<.>) :: ListF f (a -> b) -> ListF f a -> ListF f b #

(.>) :: ListF f a -> ListF f b -> ListF f b #

(<.) :: ListF f a -> ListF f b -> ListF f a #

liftF2 :: (a -> b -> c) -> ListF f a -> ListF f b -> ListF f c #

Pointed f => Pointed (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

point :: a -> ListF f a #

Functor f => Plus (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

zero :: ListF f a #

Functor f => Alt (ListF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(<!>) :: ListF f a -> ListF f a -> ListF f a #

some :: Applicative (ListF f) => ListF f a -> ListF f [a] #

many :: Applicative (ListF f) => ListF f a -> ListF f [a] #

Contravariant f => Divise (ListF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

divise :: (a -> (b, c)) -> ListF f b -> ListF f c -> ListF f a Source #

Decide f => Decide (ListF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

decide :: (a -> Either b c) -> ListF f b -> ListF f c -> ListF f a Source #

Conclude f => Conclude (ListF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

conclude :: (a -> Void) -> ListF f a Source #

Eq (f a) => Eq (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(==) :: ListF f a -> ListF f a -> Bool #

(/=) :: ListF f a -> ListF f a -> Bool #

(Typeable a, Typeable f, Typeable k, Data (f a)) => Data (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ListF f a -> c (ListF f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ListF f a) #

toConstr :: ListF f a -> Constr #

dataTypeOf :: ListF f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ListF f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ListF f a)) #

gmapT :: (forall b. Data b => b -> b) -> ListF f a -> ListF f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ListF f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ListF f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ListF f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ListF f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ListF f a -> m (ListF f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ListF f a -> m (ListF f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ListF f a -> m (ListF f a) #

Ord (f a) => Ord (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

compare :: ListF f a -> ListF f a -> Ordering #

(<) :: ListF f a -> ListF f a -> Bool #

(<=) :: ListF f a -> ListF f a -> Bool #

(>) :: ListF f a -> ListF f a -> Bool #

(>=) :: ListF f a -> ListF f a -> Bool #

max :: ListF f a -> ListF f a -> ListF f a #

min :: ListF f a -> ListF f a -> ListF f a #

Read (f a) => Read (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Show (f a) => Show (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

showsPrec :: Int -> ListF f a -> ShowS #

show :: ListF f a -> String #

showList :: [ListF f a] -> ShowS #

Generic (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Associated Types

type Rep (ListF f a) :: Type -> Type #

Methods

from :: ListF f a -> Rep (ListF f a) x #

to :: Rep (ListF f a) x -> ListF f a #

Semigroup (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(<>) :: ListF f a -> ListF f a -> ListF f a #

sconcat :: NonEmpty (ListF f a) -> ListF f a #

stimes :: Integral b => b -> ListF f a -> ListF f a #

Monoid (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

mempty :: ListF f a #

mappend :: ListF f a -> ListF f a -> ListF f a #

mconcat :: [ListF f a] -> ListF f a #

type FreeFunctorBy (ListF :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

type FreeFunctorBy (ListF :: (Type -> Type) -> Type -> Type) = Functor
type Rep (ListF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

type Rep (ListF f a) = D1 ('MetaData "ListF" "Control.Applicative.ListF" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "ListF" 'PrefixI 'True) (S1 ('MetaSel ('Just "runListF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [f a])))

newtype NonEmptyF f a Source #

A non-empty list of f as. Can be used to describe a product between many different possible values of type f a.

Essentially:

NonEmptyF f
    ~ f                          -- one f
  :+: (f :*: f)              -- two f's
  :+: (f :*: f :*: f)            -- three f's
  :+: (f :*: f :*: f :*: f)      -- four f's
  :+: ...                        -- etc.

This is the Free Plus on any Functor f.

Incidentally, if used with a Contravariant f, this is instead the free Divise.

Constructors

NonEmptyF 

Fields

Bundled Patterns

pattern ProdNonEmpty :: (f :*: ListF f) a -> NonEmptyF f a

Treat a NonEmptyF f as a product between an f and a ListF f.

nonEmptyProd is the record accessor.

Instances

Instances details
HFunctor (NonEmptyF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> NonEmptyF f ~> NonEmptyF g Source #

HBind (NonEmptyF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> NonEmptyF g) -> NonEmptyF f ~> NonEmptyF g Source #

hjoin :: forall (f :: k0 -> Type). NonEmptyF (NonEmptyF f) ~> NonEmptyF f Source #

Inject (NonEmptyF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> NonEmptyF f Source #

FreeOf Alt (NonEmptyF :: (Type -> Type) -> Type -> Type) Source #

This could also be FreeOf Divise if FreeFunctorBy NonEmptyF ~ Contravariant. However, there isn't really a way to express this at the moment.

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy NonEmptyF :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). NonEmptyF f ~> Final Alt f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy NonEmptyF f => Final Alt f ~> NonEmptyF f Source #

Alt f => Interpret (NonEmptyF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

A free Alt

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: NonEmptyF f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> NonEmptyF g ~> f Source #

Functor f => Functor (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fmap :: (a -> b) -> NonEmptyF f a -> NonEmptyF f b #

(<$) :: a -> NonEmptyF f b -> NonEmptyF f a #

Applicative f => Applicative (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

pure :: a -> NonEmptyF f a #

(<*>) :: NonEmptyF f (a -> b) -> NonEmptyF f a -> NonEmptyF f b #

liftA2 :: (a -> b -> c) -> NonEmptyF f a -> NonEmptyF f b -> NonEmptyF f c #

(*>) :: NonEmptyF f a -> NonEmptyF f b -> NonEmptyF f b #

(<*) :: NonEmptyF f a -> NonEmptyF f b -> NonEmptyF f a #

Foldable f => Foldable (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fold :: Monoid m => NonEmptyF f m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmptyF f a -> m #

foldMap' :: Monoid m => (a -> m) -> NonEmptyF f a -> m #

foldr :: (a -> b -> b) -> b -> NonEmptyF f a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmptyF f a -> b #

foldl :: (b -> a -> b) -> b -> NonEmptyF f a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmptyF f a -> b #

foldr1 :: (a -> a -> a) -> NonEmptyF f a -> a #

foldl1 :: (a -> a -> a) -> NonEmptyF f a -> a #

toList :: NonEmptyF f a -> [a] #

null :: NonEmptyF f a -> Bool #

length :: NonEmptyF f a -> Int #

elem :: Eq a => a -> NonEmptyF f a -> Bool #

maximum :: Ord a => NonEmptyF f a -> a #

minimum :: Ord a => NonEmptyF f a -> a #

sum :: Num a => NonEmptyF f a -> a #

product :: Num a => NonEmptyF f a -> a #

Traversable f => Traversable (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

traverse :: Applicative f0 => (a -> f0 b) -> NonEmptyF f a -> f0 (NonEmptyF f b) #

sequenceA :: Applicative f0 => NonEmptyF f (f0 a) -> f0 (NonEmptyF f a) #

mapM :: Monad m => (a -> m b) -> NonEmptyF f a -> m (NonEmptyF f b) #

sequence :: Monad m => NonEmptyF f (m a) -> m (NonEmptyF f a) #

Contravariant f => Contravariant (NonEmptyF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

contramap :: (a -> b) -> NonEmptyF f b -> NonEmptyF f a #

(>$) :: b -> NonEmptyF f b -> NonEmptyF f a #

Eq1 f => Eq1 (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftEq :: (a -> b -> Bool) -> NonEmptyF f a -> NonEmptyF f b -> Bool #

Ord1 f => Ord1 (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftCompare :: (a -> b -> Ordering) -> NonEmptyF f a -> NonEmptyF f b -> Ordering #

Read1 f => Read1 (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NonEmptyF f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NonEmptyF f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NonEmptyF f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NonEmptyF f a] #

Show1 f => Show1 (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NonEmptyF f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NonEmptyF f a] -> ShowS #

Invariant f => Invariant (NonEmptyF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

invmap :: (a -> b) -> (b -> a) -> NonEmptyF f a -> NonEmptyF f b #

Pointed f => Pointed (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

point :: a -> NonEmptyF f a #

Functor f => Alt (NonEmptyF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(<!>) :: NonEmptyF f a -> NonEmptyF f a -> NonEmptyF f a #

some :: Applicative (NonEmptyF f) => NonEmptyF f a -> NonEmptyF f [a] #

many :: Applicative (NonEmptyF f) => NonEmptyF f a -> NonEmptyF f [a] #

Contravariant f => Divise (NonEmptyF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

divise :: (a -> (b, c)) -> NonEmptyF f b -> NonEmptyF f c -> NonEmptyF f a Source #

Decide f => Decide (NonEmptyF f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.ListF

Methods

decide :: (a -> Either b c) -> NonEmptyF f b -> NonEmptyF f c -> NonEmptyF f a Source #

Eq (f a) => Eq (NonEmptyF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(==) :: NonEmptyF f a -> NonEmptyF f a -> Bool #

(/=) :: NonEmptyF f a -> NonEmptyF f a -> Bool #

(Typeable a, Typeable f, Typeable k, Data (f a)) => Data (NonEmptyF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NonEmptyF f a -> c (NonEmptyF f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NonEmptyF f a) #

toConstr :: NonEmptyF f a -> Constr #

dataTypeOf :: NonEmptyF f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NonEmptyF f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NonEmptyF f a)) #

gmapT :: (forall b. Data b => b -> b) -> NonEmptyF f a -> NonEmptyF f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NonEmptyF f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NonEmptyF f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> NonEmptyF f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NonEmptyF f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NonEmptyF f a -> m (NonEmptyF f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmptyF f a -> m (NonEmptyF f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NonEmptyF f a -> m (NonEmptyF f a) #

Ord (f a) => Ord (NonEmptyF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

compare :: NonEmptyF f a -> NonEmptyF f a -> Ordering #

(<) :: NonEmptyF f a -> NonEmptyF f a -> Bool #

(<=) :: NonEmptyF f a -> NonEmptyF f a -> Bool #

(>) :: NonEmptyF f a -> NonEmptyF f a -> Bool #

(>=) :: NonEmptyF f a -> NonEmptyF f a -> Bool #

max :: NonEmptyF f a -> NonEmptyF f a -> NonEmptyF f a #

min :: NonEmptyF f a -> NonEmptyF f a -> NonEmptyF f a #

Read (f a) => Read (NonEmptyF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Show (f a) => Show (NonEmptyF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

showsPrec :: Int -> NonEmptyF f a -> ShowS #

show :: NonEmptyF f a -> String #

showList :: [NonEmptyF f a] -> ShowS #

Generic (NonEmptyF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Associated Types

type Rep (NonEmptyF f a) :: Type -> Type #

Methods

from :: NonEmptyF f a -> Rep (NonEmptyF f a) x #

to :: Rep (NonEmptyF f a) x -> NonEmptyF f a #

Semigroup (NonEmptyF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(<>) :: NonEmptyF f a -> NonEmptyF f a -> NonEmptyF f a #

sconcat :: NonEmpty (NonEmptyF f a) -> NonEmptyF f a #

stimes :: Integral b => b -> NonEmptyF f a -> NonEmptyF f a #

type FreeFunctorBy (NonEmptyF :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

type Rep (NonEmptyF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

type Rep (NonEmptyF f a) = D1 ('MetaData "NonEmptyF" "Control.Applicative.ListF" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "NonEmptyF" 'PrefixI 'True) (S1 ('MetaSel ('Just "runNonEmptyF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty (f a)))))

newtype MaybeF f a Source #

A maybe f a.

Can be useful for describing a "an f a that may or may not be there".

This is the free structure for a "fail"-like typeclass that would only have zero :: f a.

Constructors

MaybeF 

Fields

Instances

Instances details
HFunctor (MaybeF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> MaybeF f ~> MaybeF g Source #

HBind (MaybeF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> MaybeF g) -> MaybeF f ~> MaybeF g Source #

hjoin :: forall (f :: k0 -> Type). MaybeF (MaybeF f) ~> MaybeF f Source #

Inject (MaybeF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> MaybeF f Source #

Plus f => Interpret (MaybeF :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

Technically, f is over-constrained: we only need zero :: f a, but we don't really have that typeclass in any standard hierarchies. We use Plus here instead, but we never use <!>. This would only go wrong in situations where your type supports zero but not <!>, like instances of MonadFail without MonadPlus.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: MaybeF f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> MaybeF g ~> f Source #

Functor f => Functor (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fmap :: (a -> b) -> MaybeF f a -> MaybeF f b #

(<$) :: a -> MaybeF f b -> MaybeF f a #

Applicative f => Applicative (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

pure :: a -> MaybeF f a #

(<*>) :: MaybeF f (a -> b) -> MaybeF f a -> MaybeF f b #

liftA2 :: (a -> b -> c) -> MaybeF f a -> MaybeF f b -> MaybeF f c #

(*>) :: MaybeF f a -> MaybeF f b -> MaybeF f b #

(<*) :: MaybeF f a -> MaybeF f b -> MaybeF f a #

Foldable f => Foldable (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fold :: Monoid m => MaybeF f m -> m #

foldMap :: Monoid m => (a -> m) -> MaybeF f a -> m #

foldMap' :: Monoid m => (a -> m) -> MaybeF f a -> m #

foldr :: (a -> b -> b) -> b -> MaybeF f a -> b #

foldr' :: (a -> b -> b) -> b -> MaybeF f a -> b #

foldl :: (b -> a -> b) -> b -> MaybeF f a -> b #

foldl' :: (b -> a -> b) -> b -> MaybeF f a -> b #

foldr1 :: (a -> a -> a) -> MaybeF f a -> a #

foldl1 :: (a -> a -> a) -> MaybeF f a -> a #

toList :: MaybeF f a -> [a] #

null :: MaybeF f a -> Bool #

length :: MaybeF f a -> Int #

elem :: Eq a => a -> MaybeF f a -> Bool #

maximum :: Ord a => MaybeF f a -> a #

minimum :: Ord a => MaybeF f a -> a #

sum :: Num a => MaybeF f a -> a #

product :: Num a => MaybeF f a -> a #

Traversable f => Traversable (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

traverse :: Applicative f0 => (a -> f0 b) -> MaybeF f a -> f0 (MaybeF f b) #

sequenceA :: Applicative f0 => MaybeF f (f0 a) -> f0 (MaybeF f a) #

mapM :: Monad m => (a -> m b) -> MaybeF f a -> m (MaybeF f b) #

sequence :: Monad m => MaybeF f (m a) -> m (MaybeF f a) #

Contravariant f => Contravariant (MaybeF f) Source #

Since: 0.3.3.0

Instance details

Defined in Control.Applicative.ListF

Methods

contramap :: (a -> b) -> MaybeF f b -> MaybeF f a #

(>$) :: b -> MaybeF f b -> MaybeF f a #

Eq1 f => Eq1 (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftEq :: (a -> b -> Bool) -> MaybeF f a -> MaybeF f b -> Bool #

Ord1 f => Ord1 (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftCompare :: (a -> b -> Ordering) -> MaybeF f a -> MaybeF f b -> Ordering #

Read1 f => Read1 (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (MaybeF f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [MaybeF f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (MaybeF f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [MaybeF f a] #

Show1 f => Show1 (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> MaybeF f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [MaybeF f a] -> ShowS #

Applicative f => Alternative (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

empty :: MaybeF f a #

(<|>) :: MaybeF f a -> MaybeF f a -> MaybeF f a #

some :: MaybeF f a -> MaybeF f [a] #

many :: MaybeF f a -> MaybeF f [a] #

Contravariant f => Divisible (MaybeF f) Source #

Since: 0.3.3.0

Instance details

Defined in Control.Applicative.ListF

Methods

divide :: (a -> (b, c)) -> MaybeF f b -> MaybeF f c -> MaybeF f a #

conquer :: MaybeF f a #

Decidable f => Decidable (MaybeF f) Source #

Since: 0.3.3.0

Instance details

Defined in Control.Applicative.ListF

Methods

lose :: (a -> Void) -> MaybeF f a #

choose :: (a -> Either b c) -> MaybeF f b -> MaybeF f c -> MaybeF f a #

Invariant f => Invariant (MaybeF f) Source #

Since: 0.3.3.0

Instance details

Defined in Control.Applicative.ListF

Methods

invmap :: (a -> b) -> (b -> a) -> MaybeF f a -> MaybeF f b #

Pointed f => Pointed (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

point :: a -> MaybeF f a #

Functor f => Plus (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

zero :: MaybeF f a #

Functor f => Alt (MaybeF f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(<!>) :: MaybeF f a -> MaybeF f a -> MaybeF f a #

some :: Applicative (MaybeF f) => MaybeF f a -> MaybeF f [a] #

many :: Applicative (MaybeF f) => MaybeF f a -> MaybeF f [a] #

Contravariant f => Divise (MaybeF f) Source #

Since: 0.3.3.0

Instance details

Defined in Control.Applicative.ListF

Methods

divise :: (a -> (b, c)) -> MaybeF f b -> MaybeF f c -> MaybeF f a Source #

Decide f => Decide (MaybeF f) Source #

Since: 0.3.3.0

Instance details

Defined in Control.Applicative.ListF

Methods

decide :: (a -> Either b c) -> MaybeF f b -> MaybeF f c -> MaybeF f a Source #

Conclude f => Conclude (MaybeF f) Source #

Since: 0.3.3.0

Instance details

Defined in Control.Applicative.ListF

Methods

conclude :: (a -> Void) -> MaybeF f a Source #

Eq (f a) => Eq (MaybeF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(==) :: MaybeF f a -> MaybeF f a -> Bool #

(/=) :: MaybeF f a -> MaybeF f a -> Bool #

(Typeable a, Typeable f, Typeable k, Data (f a)) => Data (MaybeF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MaybeF f a -> c (MaybeF f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MaybeF f a) #

toConstr :: MaybeF f a -> Constr #

dataTypeOf :: MaybeF f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MaybeF f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MaybeF f a)) #

gmapT :: (forall b. Data b => b -> b) -> MaybeF f a -> MaybeF f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MaybeF f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MaybeF f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> MaybeF f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MaybeF f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MaybeF f a -> m (MaybeF f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MaybeF f a -> m (MaybeF f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MaybeF f a -> m (MaybeF f a) #

Ord (f a) => Ord (MaybeF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

compare :: MaybeF f a -> MaybeF f a -> Ordering #

(<) :: MaybeF f a -> MaybeF f a -> Bool #

(<=) :: MaybeF f a -> MaybeF f a -> Bool #

(>) :: MaybeF f a -> MaybeF f a -> Bool #

(>=) :: MaybeF f a -> MaybeF f a -> Bool #

max :: MaybeF f a -> MaybeF f a -> MaybeF f a #

min :: MaybeF f a -> MaybeF f a -> MaybeF f a #

Read (f a) => Read (MaybeF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Show (f a) => Show (MaybeF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

showsPrec :: Int -> MaybeF f a -> ShowS #

show :: MaybeF f a -> String #

showList :: [MaybeF f a] -> ShowS #

Generic (MaybeF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Associated Types

type Rep (MaybeF f a) :: Type -> Type #

Methods

from :: MaybeF f a -> Rep (MaybeF f a) x #

to :: Rep (MaybeF f a) x -> MaybeF f a #

Semigroup (MaybeF f a) Source #

Picks the first Just.

Instance details

Defined in Control.Applicative.ListF

Methods

(<>) :: MaybeF f a -> MaybeF f a -> MaybeF f a #

sconcat :: NonEmpty (MaybeF f a) -> MaybeF f a #

stimes :: Integral b => b -> MaybeF f a -> MaybeF f a #

Monoid (MaybeF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

mempty :: MaybeF f a #

mappend :: MaybeF f a -> MaybeF f a -> MaybeF f a #

mconcat :: [MaybeF f a] -> MaybeF f a #

type Rep (MaybeF f a) Source # 
Instance details

Defined in Control.Applicative.ListF

type Rep (MaybeF f a) = D1 ('MetaData "MaybeF" "Control.Applicative.ListF" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "MaybeF" 'PrefixI 'True) (S1 ('MetaSel ('Just "runMaybeF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (f a)))))

newtype MapF k f a Source #

A map of f as, indexed by keys of type k. It can be useful for represeting a product of many different values of type f a, each "at" a different k location.

Can be considered a combination of EnvT and ListF, in a way --- a MapF k f a is like a ListF (EnvT k f) a with unique (and ordered) keys.

One use case might be to extend a schema with many "options", indexed by some string.

For example, if you had a command line argument parser for a single command

data Command a

Then you can represent a command line argument parser for multiple named commands with

type Commands = MapF String Command

See NEMapF for a non-empty variant, if you want to enforce that your bag has at least one f a.

Constructors

MapF 

Fields

Instances

Instances details
HFunctor (MapF k2 :: (k1 -> Type) -> k1 -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> MapF k2 f ~> MapF k2 g Source #

Monoid k2 => Inject (MapF k2 :: (k1 -> Type) -> k1 -> Type) Source #

Injects into a singleton map at mempty.

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> MapF k2 f Source #

(Monoid k, Plus f) => Interpret (MapF k :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: MapF k f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> MapF k g ~> f Source #

Functor f => Functor (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fmap :: (a -> b) -> MapF k f a -> MapF k f b #

(<$) :: a -> MapF k f b -> MapF k f a #

Foldable f => Foldable (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fold :: Monoid m => MapF k f m -> m #

foldMap :: Monoid m => (a -> m) -> MapF k f a -> m #

foldMap' :: Monoid m => (a -> m) -> MapF k f a -> m #

foldr :: (a -> b -> b) -> b -> MapF k f a -> b #

foldr' :: (a -> b -> b) -> b -> MapF k f a -> b #

foldl :: (b -> a -> b) -> b -> MapF k f a -> b #

foldl' :: (b -> a -> b) -> b -> MapF k f a -> b #

foldr1 :: (a -> a -> a) -> MapF k f a -> a #

foldl1 :: (a -> a -> a) -> MapF k f a -> a #

toList :: MapF k f a -> [a] #

null :: MapF k f a -> Bool #

length :: MapF k f a -> Int #

elem :: Eq a => a -> MapF k f a -> Bool #

maximum :: Ord a => MapF k f a -> a #

minimum :: Ord a => MapF k f a -> a #

sum :: Num a => MapF k f a -> a #

product :: Num a => MapF k f a -> a #

Traversable f => Traversable (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

traverse :: Applicative f0 => (a -> f0 b) -> MapF k f a -> f0 (MapF k f b) #

sequenceA :: Applicative f0 => MapF k f (f0 a) -> f0 (MapF k f a) #

mapM :: Monad m => (a -> m b) -> MapF k f a -> m (MapF k f b) #

sequence :: Monad m => MapF k f (m a) -> m (MapF k f a) #

(Eq k, Eq1 f) => Eq1 (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftEq :: (a -> b -> Bool) -> MapF k f a -> MapF k f b -> Bool #

(Ord k, Ord1 f) => Ord1 (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftCompare :: (a -> b -> Ordering) -> MapF k f a -> MapF k f b -> Ordering #

(Ord k, Read k, Read1 f) => Read1 (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (MapF k f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [MapF k f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (MapF k f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [MapF k f a] #

(Show k, Show1 f) => Show1 (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> MapF k f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [MapF k f a] -> ShowS #

(Monoid k, Pointed f) => Pointed (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

point :: a -> MapF k f a #

(Functor f, Ord k) => Plus (MapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

zero :: MapF k f a #

(Functor f, Ord k) => Alt (MapF k f) Source #

Left-biased union

Instance details

Defined in Control.Applicative.ListF

Methods

(<!>) :: MapF k f a -> MapF k f a -> MapF k f a #

some :: Applicative (MapF k f) => MapF k f a -> MapF k f [a] #

many :: Applicative (MapF k f) => MapF k f a -> MapF k f [a] #

(Eq k1, Eq (f a)) => Eq (MapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(==) :: MapF k1 f a -> MapF k1 f a -> Bool #

(/=) :: MapF k1 f a -> MapF k1 f a -> Bool #

(Typeable a, Typeable f, Typeable k2, Data k1, Data (f a), Ord k1) => Data (MapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MapF k1 f a -> c (MapF k1 f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MapF k1 f a) #

toConstr :: MapF k1 f a -> Constr #

dataTypeOf :: MapF k1 f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MapF k1 f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MapF k1 f a)) #

gmapT :: (forall b. Data b => b -> b) -> MapF k1 f a -> MapF k1 f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MapF k1 f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MapF k1 f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> MapF k1 f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> MapF k1 f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> MapF k1 f a -> m (MapF k1 f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MapF k1 f a -> m (MapF k1 f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MapF k1 f a -> m (MapF k1 f a) #

(Ord k1, Ord (f a)) => Ord (MapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

compare :: MapF k1 f a -> MapF k1 f a -> Ordering #

(<) :: MapF k1 f a -> MapF k1 f a -> Bool #

(<=) :: MapF k1 f a -> MapF k1 f a -> Bool #

(>) :: MapF k1 f a -> MapF k1 f a -> Bool #

(>=) :: MapF k1 f a -> MapF k1 f a -> Bool #

max :: MapF k1 f a -> MapF k1 f a -> MapF k1 f a #

min :: MapF k1 f a -> MapF k1 f a -> MapF k1 f a #

(Ord k1, Read k1, Read (f a)) => Read (MapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

readsPrec :: Int -> ReadS (MapF k1 f a) #

readList :: ReadS [MapF k1 f a] #

readPrec :: ReadPrec (MapF k1 f a) #

readListPrec :: ReadPrec [MapF k1 f a] #

(Show k1, Show (f a)) => Show (MapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

showsPrec :: Int -> MapF k1 f a -> ShowS #

show :: MapF k1 f a -> String #

showList :: [MapF k1 f a] -> ShowS #

Generic (MapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Associated Types

type Rep (MapF k1 f a) :: Type -> Type #

Methods

from :: MapF k1 f a -> Rep (MapF k1 f a) x #

to :: Rep (MapF k1 f a) x -> MapF k1 f a #

(Ord k, Alt f) => Semigroup (MapF k f a) Source #

A union, combining matching keys with <!>.

Instance details

Defined in Control.Applicative.ListF

Methods

(<>) :: MapF k f a -> MapF k f a -> MapF k f a #

sconcat :: NonEmpty (MapF k f a) -> MapF k f a #

stimes :: Integral b => b -> MapF k f a -> MapF k f a #

(Ord k, Alt f) => Monoid (MapF k f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

mempty :: MapF k f a #

mappend :: MapF k f a -> MapF k f a -> MapF k f a #

mconcat :: [MapF k f a] -> MapF k f a #

type Rep (MapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

type Rep (MapF k1 f a) = D1 ('MetaData "MapF" "Control.Applicative.ListF" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "MapF" 'PrefixI 'True) (S1 ('MetaSel ('Just "runMapF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map k1 (f a)))))

newtype NEMapF k f a Source #

A non-empty map of f as, indexed by keys of type k. It can be useful for represeting a product of many different values of type f a, each "at" a different k location, where you need to have at least one f a at all times.

Can be considered a combination of EnvT and NonEmptyF, in a way --- an NEMapF k f a is like a NonEmptyF (EnvT k f) a with unique (and ordered) keys.

See MapF for some use cases.

Constructors

NEMapF 

Fields

Instances

Instances details
HFunctor (NEMapF k2 :: (k1 -> Type) -> k1 -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> NEMapF k2 f ~> NEMapF k2 g Source #

Monoid k2 => Inject (NEMapF k2 :: (k1 -> Type) -> k1 -> Type) Source #

Injects into a singleton map at mempty.

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> NEMapF k2 f Source #

(Monoid k, Alt f) => Interpret (NEMapF k :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: NEMapF k f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> NEMapF k g ~> f Source #

Functor f => Functor (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fmap :: (a -> b) -> NEMapF k f a -> NEMapF k f b #

(<$) :: a -> NEMapF k f b -> NEMapF k f a #

Foldable f => Foldable (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fold :: Monoid m => NEMapF k f m -> m #

foldMap :: Monoid m => (a -> m) -> NEMapF k f a -> m #

foldMap' :: Monoid m => (a -> m) -> NEMapF k f a -> m #

foldr :: (a -> b -> b) -> b -> NEMapF k f a -> b #

foldr' :: (a -> b -> b) -> b -> NEMapF k f a -> b #

foldl :: (b -> a -> b) -> b -> NEMapF k f a -> b #

foldl' :: (b -> a -> b) -> b -> NEMapF k f a -> b #

foldr1 :: (a -> a -> a) -> NEMapF k f a -> a #

foldl1 :: (a -> a -> a) -> NEMapF k f a -> a #

toList :: NEMapF k f a -> [a] #

null :: NEMapF k f a -> Bool #

length :: NEMapF k f a -> Int #

elem :: Eq a => a -> NEMapF k f a -> Bool #

maximum :: Ord a => NEMapF k f a -> a #

minimum :: Ord a => NEMapF k f a -> a #

sum :: Num a => NEMapF k f a -> a #

product :: Num a => NEMapF k f a -> a #

Traversable f => Traversable (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

traverse :: Applicative f0 => (a -> f0 b) -> NEMapF k f a -> f0 (NEMapF k f b) #

sequenceA :: Applicative f0 => NEMapF k f (f0 a) -> f0 (NEMapF k f a) #

mapM :: Monad m => (a -> m b) -> NEMapF k f a -> m (NEMapF k f b) #

sequence :: Monad m => NEMapF k f (m a) -> m (NEMapF k f a) #

(Eq k, Eq1 f) => Eq1 (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftEq :: (a -> b -> Bool) -> NEMapF k f a -> NEMapF k f b -> Bool #

(Ord k, Ord1 f) => Ord1 (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftCompare :: (a -> b -> Ordering) -> NEMapF k f a -> NEMapF k f b -> Ordering #

(Ord k, Read k, Read1 f) => Read1 (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (NEMapF k f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [NEMapF k f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (NEMapF k f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [NEMapF k f a] #

(Show k, Show1 f) => Show1 (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> NEMapF k f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [NEMapF k f a] -> ShowS #

Foldable1 f => Foldable1 (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

fold1 :: Semigroup m => NEMapF k f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> NEMapF k f a -> m #

toNonEmpty :: NEMapF k f a -> NonEmpty a #

(Monoid k, Pointed f) => Pointed (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

point :: a -> NEMapF k f a #

Traversable1 f => Traversable1 (NEMapF k f) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> NEMapF k f a -> f0 (NEMapF k f b) #

sequence1 :: Apply f0 => NEMapF k f (f0 b) -> f0 (NEMapF k f b) #

(Functor f, Ord k) => Alt (NEMapF k f) Source #

Left-biased union

Instance details

Defined in Control.Applicative.ListF

Methods

(<!>) :: NEMapF k f a -> NEMapF k f a -> NEMapF k f a #

some :: Applicative (NEMapF k f) => NEMapF k f a -> NEMapF k f [a] #

many :: Applicative (NEMapF k f) => NEMapF k f a -> NEMapF k f [a] #

(Eq k1, Eq (f a)) => Eq (NEMapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

(==) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool #

(/=) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool #

(Typeable a, Typeable f, Typeable k2, Data k1, Data (f a), Ord k1) => Data (NEMapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NEMapF k1 f a -> c (NEMapF k1 f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NEMapF k1 f a) #

toConstr :: NEMapF k1 f a -> Constr #

dataTypeOf :: NEMapF k1 f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NEMapF k1 f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NEMapF k1 f a)) #

gmapT :: (forall b. Data b => b -> b) -> NEMapF k1 f a -> NEMapF k1 f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NEMapF k1 f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NEMapF k1 f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> NEMapF k1 f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> NEMapF k1 f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> NEMapF k1 f a -> m (NEMapF k1 f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NEMapF k1 f a -> m (NEMapF k1 f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NEMapF k1 f a -> m (NEMapF k1 f a) #

(Ord k1, Ord (f a)) => Ord (NEMapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

compare :: NEMapF k1 f a -> NEMapF k1 f a -> Ordering #

(<) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool #

(<=) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool #

(>) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool #

(>=) :: NEMapF k1 f a -> NEMapF k1 f a -> Bool #

max :: NEMapF k1 f a -> NEMapF k1 f a -> NEMapF k1 f a #

min :: NEMapF k1 f a -> NEMapF k1 f a -> NEMapF k1 f a #

(Ord k1, Read k1, Read (f a)) => Read (NEMapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

readsPrec :: Int -> ReadS (NEMapF k1 f a) #

readList :: ReadS [NEMapF k1 f a] #

readPrec :: ReadPrec (NEMapF k1 f a) #

readListPrec :: ReadPrec [NEMapF k1 f a] #

(Show k1, Show (f a)) => Show (NEMapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Methods

showsPrec :: Int -> NEMapF k1 f a -> ShowS #

show :: NEMapF k1 f a -> String #

showList :: [NEMapF k1 f a] -> ShowS #

Generic (NEMapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

Associated Types

type Rep (NEMapF k1 f a) :: Type -> Type #

Methods

from :: NEMapF k1 f a -> Rep (NEMapF k1 f a) x #

to :: Rep (NEMapF k1 f a) x -> NEMapF k1 f a #

(Ord k, Alt f) => Semigroup (NEMapF k f a) Source #

A union, combining matching keys with <!>.

Instance details

Defined in Control.Applicative.ListF

Methods

(<>) :: NEMapF k f a -> NEMapF k f a -> NEMapF k f a #

sconcat :: NonEmpty (NEMapF k f a) -> NEMapF k f a #

stimes :: Integral b => b -> NEMapF k f a -> NEMapF k f a #

type Rep (NEMapF k1 f a) Source # 
Instance details

Defined in Control.Applicative.ListF

type Rep (NEMapF k1 f a) = D1 ('MetaData "NEMapF" "Control.Applicative.ListF" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "NEMapF" 'PrefixI 'True) (S1 ('MetaSel ('Just "runNEMapF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NEMap k1 (f a)))))

data Ap (f :: Type -> Type) a #

The free Applicative for a Functor f.

Instances

Instances details
FreeOf Applicative Ap Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Ap :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Ap f ~> Final Applicative f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Ap f => Final Applicative f ~> Ap f Source #

Functor (Ap f) 
Instance details

Defined in Control.Applicative.Free

Methods

fmap :: (a -> b) -> Ap f a -> Ap f b #

(<$) :: a -> Ap f b -> Ap f a #

Applicative (Ap f) 
Instance details

Defined in Control.Applicative.Free

Methods

pure :: a -> Ap f a #

(<*>) :: Ap f (a -> b) -> Ap f a -> Ap f b #

liftA2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c #

(*>) :: Ap f a -> Ap f b -> Ap f b #

(<*) :: Ap f a -> Ap f b -> Ap f a #

Comonad f => Comonad (Ap f) 
Instance details

Defined in Control.Applicative.Free

Methods

extract :: Ap f a -> a #

duplicate :: Ap f a -> Ap f (Ap f a) #

extend :: (Ap f a -> b) -> Ap f a -> Ap f b #

Apply (Ap f) 
Instance details

Defined in Control.Applicative.Free

Methods

(<.>) :: Ap f (a -> b) -> Ap f a -> Ap f b #

(.>) :: Ap f a -> Ap f b -> Ap f b #

(<.) :: Ap f a -> Ap f b -> Ap f a #

liftF2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c #

HBind Ap Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k -> Type) (g :: k -> Type). (f ~> Ap g) -> Ap f ~> Ap g Source #

hjoin :: forall (f :: k -> Type). Ap (Ap f) ~> Ap f Source #

Inject Ap Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Ap f Source #

Applicative f => Interpret Ap (f :: Type -> Type) Source #

A free Applicative

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Ap f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Ap g ~> f Source #

HFunctor Ap Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Ap f ~> Ap g Source #

type FreeFunctorBy Ap Source # 
Instance details

Defined in Data.HFunctor.Final

data Ap1 :: (Type -> Type) -> Type -> Type where Source #

One or more fs convolved with itself.

Essentially:

Ap1 f
    ~ f                            -- one f
  :+: (f `Day` f)          -- two f's
  :+: (f `Day` f `Day` f)           -- three f's
  :+: (f `Day` f `Day` f `Day` f)  -- four f's
  :+: ...                          -- etc.

Useful if you want to promote an f to a situation with "at least one f sequenced with itself".

Mostly useful for its HFunctor and Interpret instance, along with its relationship with Ap and Day.

This is the free Apply --- Basically a "non-empty" Ap.

The construction here is based on Ap, similar to now NonEmpty is built on list.

Constructors

Ap1 :: f a -> Ap f (a -> b) -> Ap1 f b 

Bundled Patterns

pattern DayAp1 :: Day f (Ap f) a -> Ap1 f a

An Ap1 f is just a Day f (Ap f). This bidirectional pattern synonym lets you treat it as such.

Instances

Instances details
HBind Ap1 Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

hbind :: forall (f :: k -> Type) (g :: k -> Type). (f ~> Ap1 g) -> Ap1 f ~> Ap1 g Source #

hjoin :: forall (f :: k -> Type). Ap1 (Ap1 f) ~> Ap1 f Source #

Inject Ap1 Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

inject :: forall (f :: k -> Type). f ~> Ap1 f Source #

FreeOf Apply Ap1 Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Ap1 :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Ap1 f ~> Final Apply f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Ap1 f => Final Apply f ~> Ap1 f Source #

HFunctor Ap1 Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Ap1 f ~> Ap1 g Source #

Apply f => Interpret Ap1 (f :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

retract :: Ap1 f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Ap1 g ~> f Source #

Functor (Ap1 f) Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

fmap :: (a -> b) -> Ap1 f a -> Ap1 f b #

(<$) :: a -> Ap1 f b -> Ap1 f a #

Invariant (Ap1 f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.Functor.Apply.Free

Methods

invmap :: (a -> b) -> (b -> a) -> Ap1 f a -> Ap1 f b #

Apply (Ap1 f) Source # 
Instance details

Defined in Data.Functor.Apply.Free

Methods

(<.>) :: Ap1 f (a -> b) -> Ap1 f a -> Ap1 f b #

(.>) :: Ap1 f a -> Ap1 f b -> Ap1 f b #

(<.) :: Ap1 f a -> Ap1 f b -> Ap1 f a #

liftF2 :: (a -> b -> c) -> Ap1 f a -> Ap1 f b -> Ap1 f c #

type FreeFunctorBy Ap1 Source # 
Instance details

Defined in Data.HFunctor.Final

data Alt (f :: Type -> Type) a #

Instances

Instances details
FreeOf Alternative Alt Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Alt :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Alt f ~> Final Alternative f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Alt f => Final Alternative f ~> Alt f Source #

Functor (Alt f) 
Instance details

Defined in Control.Alternative.Free

Methods

fmap :: (a -> b) -> Alt f a -> Alt f b #

(<$) :: a -> Alt f b -> Alt f a #

Applicative (Alt f) 
Instance details

Defined in Control.Alternative.Free

Methods

pure :: a -> Alt f a #

(<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b #

liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c #

(*>) :: Alt f a -> Alt f b -> Alt f b #

(<*) :: Alt f a -> Alt f b -> Alt f a #

Alternative (Alt f) 
Instance details

Defined in Control.Alternative.Free

Methods

empty :: Alt f a #

(<|>) :: Alt f a -> Alt f a -> Alt f a #

some :: Alt f a -> Alt f [a] #

many :: Alt f a -> Alt f [a] #

Apply (Alt f) 
Instance details

Defined in Control.Alternative.Free

Methods

(<.>) :: Alt f (a -> b) -> Alt f a -> Alt f b #

(.>) :: Alt f a -> Alt f b -> Alt f b #

(<.) :: Alt f a -> Alt f b -> Alt f a #

liftF2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c #

Alt (Alt f) 
Instance details

Defined in Control.Alternative.Free

Methods

(<!>) :: Alt f a -> Alt f a -> Alt f a #

some :: Applicative (Alt f) => Alt f a -> Alt f [a] #

many :: Applicative (Alt f) => Alt f a -> Alt f [a] #

HBind Alt Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k -> Type) (g :: k -> Type). (f ~> Alt g) -> Alt f ~> Alt g Source #

hjoin :: forall (f :: k -> Type). Alt (Alt f) ~> Alt f Source #

Inject Alt Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Alt f Source #

Alternative f => Interpret Alt (f :: Type -> Type) Source #

A free Alternative

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Alt f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Alt g ~> f Source #

HFunctor Alt Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Alt f ~> Alt g Source #

Semigroup (Alt f a) 
Instance details

Defined in Control.Alternative.Free

Methods

(<>) :: Alt f a -> Alt f a -> Alt f a #

sconcat :: NonEmpty (Alt f a) -> Alt f a #

stimes :: Integral b => b -> Alt f a -> Alt f a #

Monoid (Alt f a) 
Instance details

Defined in Control.Alternative.Free

Methods

mempty :: Alt f a #

mappend :: Alt f a -> Alt f a -> Alt f a #

mconcat :: [Alt f a] -> Alt f a #

type FreeFunctorBy Alt Source # 
Instance details

Defined in Data.HFunctor.Final

data Free f a Source #

A Free f is f enhanced with "sequential binding" capabilities. It allows you to sequence multiple fs one after the other, and also to determine "what f to sequence" based on the result of the computation so far.

Essentially, you can think of this as "giving f a Monad instance", with all that that entails (return, >>=, etc.).

Lift f into it with inject :: f a -> Free f a. When you finally want to "use" it, you can interpret it into any monadic context:

interpret
    :: Monad g
    => (forall x. f x -> g x)
    -> Free f a
    -> g a

Structurally, this is equivalent to many "nested" f's. A value of type Free f a is either:

  • a
  • f a
  • f (f a)
  • f (f (f a))
  • .. etc.

Under the hood, this is the Church-encoded Freer monad. It's Free, or F, but in a way that is compatible with HFunctor and Interpret.

Instances

Instances details
FreeOf Monad Free Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Free :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Free f ~> Final Monad f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Free f => Final Monad f ~> Free f Source #

MonadFree f (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

wrap :: f (Free f a) -> Free f a #

Monad (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

(>>=) :: Free f a -> (a -> Free f b) -> Free f b #

(>>) :: Free f a -> Free f b -> Free f b #

return :: a -> Free f a #

Functor (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

fmap :: (a -> b) -> Free f a -> Free f b #

(<$) :: a -> Free f b -> Free f a #

Applicative (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

pure :: a -> Free f a #

(<*>) :: Free f (a -> b) -> Free f a -> Free f b #

liftA2 :: (a -> b -> c) -> Free f a -> Free f b -> Free f c #

(*>) :: Free f a -> Free f b -> Free f b #

(<*) :: Free f a -> Free f b -> Free f a #

Foldable f => Foldable (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

fold :: Monoid m => Free f m -> m #

foldMap :: Monoid m => (a -> m) -> Free f a -> m #

foldMap' :: Monoid m => (a -> m) -> Free f a -> m #

foldr :: (a -> b -> b) -> b -> Free f a -> b #

foldr' :: (a -> b -> b) -> b -> Free f a -> b #

foldl :: (b -> a -> b) -> b -> Free f a -> b #

foldl' :: (b -> a -> b) -> b -> Free f a -> b #

foldr1 :: (a -> a -> a) -> Free f a -> a #

foldl1 :: (a -> a -> a) -> Free f a -> a #

toList :: Free f a -> [a] #

null :: Free f a -> Bool #

length :: Free f a -> Int #

elem :: Eq a => a -> Free f a -> Bool #

maximum :: Ord a => Free f a -> a #

minimum :: Ord a => Free f a -> a #

sum :: Num a => Free f a -> a #

product :: Num a => Free f a -> a #

Traversable f => Traversable (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Free f a -> f0 (Free f b) #

sequenceA :: Applicative f0 => Free f (f0 a) -> f0 (Free f a) #

mapM :: Monad m => (a -> m b) -> Free f a -> m (Free f b) #

sequence :: Monad m => Free f (m a) -> m (Free f a) #

(Functor f, Eq1 f) => Eq1 (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftEq :: (a -> b -> Bool) -> Free f a -> Free f b -> Bool #

(Functor f, Ord1 f) => Ord1 (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftCompare :: (a -> b -> Ordering) -> Free f a -> Free f b -> Ordering #

(Functor f, Read1 f) => Read1 (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Free f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Free f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Free f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Free f a] #

(Functor f, Show1 f) => Show1 (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Free f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Free f a] -> ShowS #

Apply (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

(<.>) :: Free f (a -> b) -> Free f a -> Free f b #

(.>) :: Free f a -> Free f b -> Free f b #

(<.) :: Free f a -> Free f b -> Free f a #

liftF2 :: (a -> b -> c) -> Free f a -> Free f b -> Free f c #

Pointed (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

point :: a -> Free f a #

Bind (Free f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

(>>-) :: Free f a -> (a -> Free f b) -> Free f b #

join :: Free f (Free f a) -> Free f a #

HBind Free Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k -> Type) (g :: k -> Type). (f ~> Free g) -> Free f ~> Free g Source #

hjoin :: forall (f :: k -> Type). Free (Free f) ~> Free f Source #

Inject Free Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Free f Source #

Monad f => Interpret Free (f :: Type -> Type) Source #

A free Monad

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Free f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Free g ~> f Source #

HFunctor Free Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Free f ~> Free g Source #

(Functor f, Eq1 f, Eq a) => Eq (Free f a) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

(==) :: Free f a -> Free f a -> Bool #

(/=) :: Free f a -> Free f a -> Bool #

(Functor f, Ord1 f, Ord a) => Ord (Free f a) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

compare :: Free f a -> Free f a -> Ordering #

(<) :: Free f a -> Free f a -> Bool #

(<=) :: Free f a -> Free f a -> Bool #

(>) :: Free f a -> Free f a -> Bool #

(>=) :: Free f a -> Free f a -> Bool #

max :: Free f a -> Free f a -> Free f a #

min :: Free f a -> Free f a -> Free f a #

(Functor f, Read1 f, Read a) => Read (Free f a) Source #

Read in terms of pure and wrap.

Instance details

Defined in Control.Monad.Freer.Church

Methods

readsPrec :: Int -> ReadS (Free f a) #

readList :: ReadS [Free f a] #

readPrec :: ReadPrec (Free f a) #

readListPrec :: ReadPrec [Free f a] #

(Functor f, Show1 f, Show a) => Show (Free f a) Source #

Show in terms of pure and wrap.

Instance details

Defined in Control.Monad.Freer.Church

Methods

showsPrec :: Int -> Free f a -> ShowS #

show :: Free f a -> String #

showList :: [Free f a] -> ShowS #

type FreeFunctorBy Free Source # 
Instance details

Defined in Data.HFunctor.Final

data Free1 f a Source #

The Free Bind. Imbues any functor f with a Bind instance.

Conceptually, this is "Free without pure". That is, while normally Free f a is an a, a f a, a f (f a), etc., a Free1 f a is an f a, f (f a), f (f (f a)), etc. It's a Free with "at least one layer of f", excluding the a case.

It can be useful as the semigroup formed by :.: (functor composition): Sometimes we want an f :.: f, or an f :.: f :.: f, or an f :.: f :.: f :.: f...just as long as we have at least one f.

Instances

Instances details
FreeOf Bind Free1 Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Free1 :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Free1 f ~> Final Bind f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Free1 f => Final Bind f ~> Free1 f Source #

Functor (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

fmap :: (a -> b) -> Free1 f a -> Free1 f b #

(<$) :: a -> Free1 f b -> Free1 f a #

Foldable f => Foldable (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

fold :: Monoid m => Free1 f m -> m #

foldMap :: Monoid m => (a -> m) -> Free1 f a -> m #

foldMap' :: Monoid m => (a -> m) -> Free1 f a -> m #

foldr :: (a -> b -> b) -> b -> Free1 f a -> b #

foldr' :: (a -> b -> b) -> b -> Free1 f a -> b #

foldl :: (b -> a -> b) -> b -> Free1 f a -> b #

foldl' :: (b -> a -> b) -> b -> Free1 f a -> b #

foldr1 :: (a -> a -> a) -> Free1 f a -> a #

foldl1 :: (a -> a -> a) -> Free1 f a -> a #

toList :: Free1 f a -> [a] #

null :: Free1 f a -> Bool #

length :: Free1 f a -> Int #

elem :: Eq a => a -> Free1 f a -> Bool #

maximum :: Ord a => Free1 f a -> a #

minimum :: Ord a => Free1 f a -> a #

sum :: Num a => Free1 f a -> a #

product :: Num a => Free1 f a -> a #

Traversable f => Traversable (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Free1 f a -> f0 (Free1 f b) #

sequenceA :: Applicative f0 => Free1 f (f0 a) -> f0 (Free1 f a) #

mapM :: Monad m => (a -> m b) -> Free1 f a -> m (Free1 f b) #

sequence :: Monad m => Free1 f (m a) -> m (Free1 f a) #

(Functor f, Eq1 f) => Eq1 (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftEq :: (a -> b -> Bool) -> Free1 f a -> Free1 f b -> Bool #

(Functor f, Ord1 f) => Ord1 (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftCompare :: (a -> b -> Ordering) -> Free1 f a -> Free1 f b -> Ordering #

(Functor f, Read1 f) => Read1 (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Free1 f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Free1 f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Free1 f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Free1 f a] #

(Functor f, Show1 f) => Show1 (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Free1 f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Free1 f a] -> ShowS #

Foldable1 f => Foldable1 (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

fold1 :: Semigroup m => Free1 f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Free1 f a -> m #

toNonEmpty :: Free1 f a -> NonEmpty a #

Apply (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

(<.>) :: Free1 f (a -> b) -> Free1 f a -> Free1 f b #

(.>) :: Free1 f a -> Free1 f b -> Free1 f b #

(<.) :: Free1 f a -> Free1 f b -> Free1 f a #

liftF2 :: (a -> b -> c) -> Free1 f a -> Free1 f b -> Free1 f c #

Traversable1 f => Traversable1 (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Free1 f a -> f0 (Free1 f b) #

sequence1 :: Apply f0 => Free1 f (f0 b) -> f0 (Free1 f b) #

Bind (Free1 f) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

(>>-) :: Free1 f a -> (a -> Free1 f b) -> Free1 f b #

join :: Free1 f (Free1 f a) -> Free1 f a #

HBind Free1 Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k -> Type) (g :: k -> Type). (f ~> Free1 g) -> Free1 f ~> Free1 g Source #

hjoin :: forall (f :: k -> Type). Free1 (Free1 f) ~> Free1 f Source #

Inject Free1 Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Free1 f Source #

Bind f => Interpret Free1 (f :: Type -> Type) Source #

A free Bind

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Free1 f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Free1 g ~> f Source #

HFunctor Free1 Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Free1 f ~> Free1 g Source #

(Functor f, Eq1 f, Eq a) => Eq (Free1 f a) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

(==) :: Free1 f a -> Free1 f a -> Bool #

(/=) :: Free1 f a -> Free1 f a -> Bool #

(Functor f, Ord1 f, Ord a) => Ord (Free1 f a) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

compare :: Free1 f a -> Free1 f a -> Ordering #

(<) :: Free1 f a -> Free1 f a -> Bool #

(<=) :: Free1 f a -> Free1 f a -> Bool #

(>) :: Free1 f a -> Free1 f a -> Bool #

(>=) :: Free1 f a -> Free1 f a -> Bool #

max :: Free1 f a -> Free1 f a -> Free1 f a #

min :: Free1 f a -> Free1 f a -> Free1 f a #

(Functor f, Read1 f, Read a) => Read (Free1 f a) Source #

Read in terms of DoneF1 and MoreF1.

Instance details

Defined in Control.Monad.Freer.Church

(Functor f, Show1 f, Show a) => Show (Free1 f a) Source #

Show in terms of DoneF1 and MoreF1.

Instance details

Defined in Control.Monad.Freer.Church

Methods

showsPrec :: Int -> Free1 f a -> ShowS #

show :: Free1 f a -> String #

showList :: [Free1 f a] -> ShowS #

type FreeFunctorBy Free1 Source # 
Instance details

Defined in Data.HFunctor.Final

data Lift (f :: Type -> Type) a #

Applicative functor formed by adding pure computations to a given applicative functor.

Instances

Instances details
FreeOf Pointed Lift Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Lift :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Lift f ~> Final Pointed f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Lift f => Final Pointed f ~> Lift f Source #

Functor f => Functor (Lift f) 
Instance details

Defined in Control.Applicative.Lift

Methods

fmap :: (a -> b) -> Lift f a -> Lift f b #

(<$) :: a -> Lift f b -> Lift f a #

Applicative f => Applicative (Lift f)

A combination is Pure only if both parts are.

Instance details

Defined in Control.Applicative.Lift

Methods

pure :: a -> Lift f a #

(<*>) :: Lift f (a -> b) -> Lift f a -> Lift f b #

liftA2 :: (a -> b -> c) -> Lift f a -> Lift f b -> Lift f c #

(*>) :: Lift f a -> Lift f b -> Lift f b #

(<*) :: Lift f a -> Lift f b -> Lift f a #

Foldable f => Foldable (Lift f) 
Instance details

Defined in Control.Applicative.Lift

Methods

fold :: Monoid m => Lift f m -> m #

foldMap :: Monoid m => (a -> m) -> Lift f a -> m #

foldMap' :: Monoid m => (a -> m) -> Lift f a -> m #

foldr :: (a -> b -> b) -> b -> Lift f a -> b #

foldr' :: (a -> b -> b) -> b -> Lift f a -> b #

foldl :: (b -> a -> b) -> b -> Lift f a -> b #

foldl' :: (b -> a -> b) -> b -> Lift f a -> b #

foldr1 :: (a -> a -> a) -> Lift f a -> a #

foldl1 :: (a -> a -> a) -> Lift f a -> a #

toList :: Lift f a -> [a] #

null :: Lift f a -> Bool #

length :: Lift f a -> Int #

elem :: Eq a => a -> Lift f a -> Bool #

maximum :: Ord a => Lift f a -> a #

minimum :: Ord a => Lift f a -> a #

sum :: Num a => Lift f a -> a #

product :: Num a => Lift f a -> a #

Traversable f => Traversable (Lift f) 
Instance details

Defined in Control.Applicative.Lift

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Lift f a -> f0 (Lift f b) #

sequenceA :: Applicative f0 => Lift f (f0 a) -> f0 (Lift f a) #

mapM :: Monad m => (a -> m b) -> Lift f a -> m (Lift f b) #

sequence :: Monad m => Lift f (m a) -> m (Lift f a) #

Eq1 f => Eq1 (Lift f) 
Instance details

Defined in Control.Applicative.Lift

Methods

liftEq :: (a -> b -> Bool) -> Lift f a -> Lift f b -> Bool #

Ord1 f => Ord1 (Lift f) 
Instance details

Defined in Control.Applicative.Lift

Methods

liftCompare :: (a -> b -> Ordering) -> Lift f a -> Lift f b -> Ordering #

Read1 f => Read1 (Lift f) 
Instance details

Defined in Control.Applicative.Lift

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Lift f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Lift f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Lift f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Lift f a] #

Show1 f => Show1 (Lift f) 
Instance details

Defined in Control.Applicative.Lift

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Lift f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Lift f a] -> ShowS #

Alternative f => Alternative (Lift f)

A combination is Pure only either part is.

Instance details

Defined in Control.Applicative.Lift

Methods

empty :: Lift f a #

(<|>) :: Lift f a -> Lift f a -> Lift f a #

some :: Lift f a -> Lift f [a] #

many :: Lift f a -> Lift f [a] #

Invariant f => Invariant (Lift f)

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> Lift f a -> Lift f b #

Foldable1 f => Foldable1 (Lift f) 
Instance details

Defined in Data.Semigroup.Foldable.Class

Methods

fold1 :: Semigroup m => Lift f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Lift f a -> m #

toNonEmpty :: Lift f a -> NonEmpty a #

Apply f => Apply (Lift f) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: Lift f (a -> b) -> Lift f a -> Lift f b #

(.>) :: Lift f a -> Lift f b -> Lift f b #

(<.) :: Lift f a -> Lift f b -> Lift f a #

liftF2 :: (a -> b -> c) -> Lift f a -> Lift f b -> Lift f c #

Pointed (Lift f) 
Instance details

Defined in Data.Pointed

Methods

point :: a -> Lift f a #

Traversable1 f => Traversable1 (Lift f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Lift f a -> f0 (Lift f b) #

sequence1 :: Apply f0 => Lift f (f0 b) -> f0 (Lift f b) #

Plus f => Plus (Lift f) 
Instance details

Defined in Data.Functor.Plus

Methods

zero :: Lift f a #

Alt f => Alt (Lift f) 
Instance details

Defined in Data.Functor.Alt

Methods

(<!>) :: Lift f a -> Lift f a -> Lift f a #

some :: Applicative (Lift f) => Lift f a -> Lift f [a] #

many :: Applicative (Lift f) => Lift f a -> Lift f [a] #

HBind Lift Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k -> Type) (g :: k -> Type). (f ~> Lift g) -> Lift f ~> Lift g Source #

hjoin :: forall (f :: k -> Type). Lift (Lift f) ~> Lift f Source #

Inject Lift Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> Lift f Source #

Pointed f => Interpret Lift (f :: Type -> Type) Source #

A free Pointed

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Lift f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Lift g ~> f Source #

HFunctor Lift Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Lift f ~> Lift g Source #

(Eq1 f, Eq a) => Eq (Lift f a) 
Instance details

Defined in Control.Applicative.Lift

Methods

(==) :: Lift f a -> Lift f a -> Bool #

(/=) :: Lift f a -> Lift f a -> Bool #

(Ord1 f, Ord a) => Ord (Lift f a) 
Instance details

Defined in Control.Applicative.Lift

Methods

compare :: Lift f a -> Lift f a -> Ordering #

(<) :: Lift f a -> Lift f a -> Bool #

(<=) :: Lift f a -> Lift f a -> Bool #

(>) :: Lift f a -> Lift f a -> Bool #

(>=) :: Lift f a -> Lift f a -> Bool #

max :: Lift f a -> Lift f a -> Lift f a #

min :: Lift f a -> Lift f a -> Lift f a #

(Read1 f, Read a) => Read (Lift f a) 
Instance details

Defined in Control.Applicative.Lift

Methods

readsPrec :: Int -> ReadS (Lift f a) #

readList :: ReadS [Lift f a] #

readPrec :: ReadPrec (Lift f a) #

readListPrec :: ReadPrec [Lift f a] #

(Show1 f, Show a) => Show (Lift f a) 
Instance details

Defined in Control.Applicative.Lift

Methods

showsPrec :: Int -> Lift f a -> ShowS #

show :: Lift f a -> String #

showList :: [Lift f a] -> ShowS #

type FreeFunctorBy Lift Source # 
Instance details

Defined in Data.HFunctor.Final

data Step f a Source #

An f a, along with a Natural index.

Step f a ~ (Natural, f a)
Step f   ~ ((,) Natural) :.: f       -- functor composition

It is the fixed point of infinite applications of :+: (functor sums).

Intuitively, in an infinite f :+: f :+: f :+: f ..., you have exactly one f somewhere. A Step f a has that f, with a Natural giving you "where" the f is in the long chain.

Can be useful for using with the Monoidal instance of :+:.

interpreting it requires no constraint on the target context.

Note that this type and its instances equivalent to EnvT (Sum Natural).

Constructors

Step 

Fields

Instances

Instances details
HFunctor (Step :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Step f ~> Step g Source #

HBind (Step :: (k -> Type) -> k -> Type) Source #

Equivalent to instance for EnvT (Sum Natural).

Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> Step g) -> Step f ~> Step g Source #

hjoin :: forall (f :: k0 -> Type). Step (Step f) ~> Step f Source #

Inject (Step :: (k -> Type) -> k -> Type) Source #

Injects with 0.

Equivalent to instance for EnvT (Sum Natural).

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> Step f Source #

Interpret (Step :: (k -> Type) -> k -> Type) (f :: k -> Type) Source #

Equivalent to instance for EnvT (Sum Natural).

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Step f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> Step g ~> f Source #

Functor f => Functor (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fmap :: (a -> b) -> Step f a -> Step f b #

(<$) :: a -> Step f b -> Step f a #

Applicative f => Applicative (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

pure :: a -> Step f a #

(<*>) :: Step f (a -> b) -> Step f a -> Step f b #

liftA2 :: (a -> b -> c) -> Step f a -> Step f b -> Step f c #

(*>) :: Step f a -> Step f b -> Step f b #

(<*) :: Step f a -> Step f b -> Step f a #

Foldable f => Foldable (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fold :: Monoid m => Step f m -> m #

foldMap :: Monoid m => (a -> m) -> Step f a -> m #

foldMap' :: Monoid m => (a -> m) -> Step f a -> m #

foldr :: (a -> b -> b) -> b -> Step f a -> b #

foldr' :: (a -> b -> b) -> b -> Step f a -> b #

foldl :: (b -> a -> b) -> b -> Step f a -> b #

foldl' :: (b -> a -> b) -> b -> Step f a -> b #

foldr1 :: (a -> a -> a) -> Step f a -> a #

foldl1 :: (a -> a -> a) -> Step f a -> a #

toList :: Step f a -> [a] #

null :: Step f a -> Bool #

length :: Step f a -> Int #

elem :: Eq a => a -> Step f a -> Bool #

maximum :: Ord a => Step f a -> a #

minimum :: Ord a => Step f a -> a #

sum :: Num a => Step f a -> a #

product :: Num a => Step f a -> a #

Traversable f => Traversable (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Step f a -> f0 (Step f b) #

sequenceA :: Applicative f0 => Step f (f0 a) -> f0 (Step f a) #

mapM :: Monad m => (a -> m b) -> Step f a -> m (Step f b) #

sequence :: Monad m => Step f (m a) -> m (Step f a) #

Contravariant f => Contravariant (Step f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

contramap :: (a -> b) -> Step f b -> Step f a #

(>$) :: b -> Step f b -> Step f a #

Eq1 f => Eq1 (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftEq :: (a -> b -> Bool) -> Step f a -> Step f b -> Bool #

Ord1 f => Ord1 (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftCompare :: (a -> b -> Ordering) -> Step f a -> Step f b -> Ordering #

Read1 f => Read1 (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Step f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Step f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Step f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Step f a] #

Show1 f => Show1 (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Step f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Step f a] -> ShowS #

Divisible f => Divisible (Step f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

divide :: (a -> (b, c)) -> Step f b -> Step f c -> Step f a #

conquer :: Step f a #

Decidable f => Decidable (Step f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

lose :: (a -> Void) -> Step f a #

choose :: (a -> Either b c) -> Step f b -> Step f c -> Step f a #

Invariant f => Invariant (Step f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

invmap :: (a -> b) -> (b -> a) -> Step f a -> Step f b #

Foldable1 f => Foldable1 (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fold1 :: Semigroup m => Step f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Step f a -> m #

toNonEmpty :: Step f a -> NonEmpty a #

Apply f => Apply (Step f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

(<.>) :: Step f (a -> b) -> Step f a -> Step f b #

(.>) :: Step f a -> Step f b -> Step f b #

(<.) :: Step f a -> Step f b -> Step f a #

liftF2 :: (a -> b -> c) -> Step f a -> Step f b -> Step f c #

Pointed f => Pointed (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

point :: a -> Step f a #

Traversable1 f => Traversable1 (Step f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Step f a -> f0 (Step f b) #

sequence1 :: Apply f0 => Step f (f0 b) -> f0 (Step f b) #

Divise f => Divise (Step f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

divise :: (a -> (b, c)) -> Step f b -> Step f c -> Step f a Source #

Decide f => Decide (Step f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

decide :: (a -> Either b c) -> Step f b -> Step f c -> Step f a Source #

Conclude f => Conclude (Step f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

conclude :: (a -> Void) -> Step f a Source #

Eq (f a) => Eq (Step f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

(==) :: Step f a -> Step f a -> Bool #

(/=) :: Step f a -> Step f a -> Bool #

(Typeable a, Typeable f, Typeable k, Data (f a)) => Data (Step f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Step f a -> c (Step f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Step f a) #

toConstr :: Step f a -> Constr #

dataTypeOf :: Step f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Step f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Step f a)) #

gmapT :: (forall b. Data b => b -> b) -> Step f a -> Step f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Step f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Step f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Step f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Step f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Step f a -> m (Step f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Step f a -> m (Step f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Step f a -> m (Step f a) #

Ord (f a) => Ord (Step f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

compare :: Step f a -> Step f a -> Ordering #

(<) :: Step f a -> Step f a -> Bool #

(<=) :: Step f a -> Step f a -> Bool #

(>) :: Step f a -> Step f a -> Bool #

(>=) :: Step f a -> Step f a -> Bool #

max :: Step f a -> Step f a -> Step f a #

min :: Step f a -> Step f a -> Step f a #

Read (f a) => Read (Step f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

readsPrec :: Int -> ReadS (Step f a) #

readList :: ReadS [Step f a] #

readPrec :: ReadPrec (Step f a) #

readListPrec :: ReadPrec [Step f a] #

Show (f a) => Show (Step f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

showsPrec :: Int -> Step f a -> ShowS #

show :: Step f a -> String #

showList :: [Step f a] -> ShowS #

Generic (Step f a) Source # 
Instance details

Defined in Control.Applicative.Step

Associated Types

type Rep (Step f a) :: Type -> Type #

Methods

from :: Step f a -> Rep (Step f a) x #

to :: Rep (Step f a) x -> Step f a #

type Rep (Step f a) Source # 
Instance details

Defined in Control.Applicative.Step

type Rep (Step f a) = D1 ('MetaData "Step" "Control.Applicative.Step" "functor-combinators-0.3.4.0-inplace" 'False) (C1 ('MetaCons "Step" 'PrefixI 'True) (S1 ('MetaSel ('Just "stepPos") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural) :*: S1 ('MetaSel ('Just "stepVal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

newtype Steps f a Source #

A non-empty map of Natural to f a. Basically, contains multiple f as, each at a given Natural index.

Steps f a ~ Map Natural (f a)
Steps f   ~ Map Natural :.: f       -- functor composition

It is the fixed point of applications of TheseT.

You can think of this as an infinite sparse array of f as.

Intuitively, in an infinite f `TheseT` f `TheseT` f `TheseT` f ..., each of those infinite positions may have an f in them. However, because of the at-least-one nature of TheseT, we know we have at least one f at one position somewhere.

A Steps f a has potentially many fs, each stored at a different Natural position, with the guaruntee that at least one f exists.

Can be useful for using with the Monoidal instance of TheseT.

interpreting it requires at least an Alt instance in the target context, since we have to handle potentially more than one f.

This type is essentailly the same as NEMapF (Sum Natural) (except with a different Semigroup instance).

Constructors

Steps 

Fields

Instances

Instances details
HFunctor (Steps :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Steps f ~> Steps g Source #

Inject (Steps :: (k -> Type) -> k -> Type) Source #

Injects into a singleton map at 0; same behavior as NEMapF (Sum Natural).

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> Steps f Source #

Alt f => Interpret (Steps :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Steps f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> Steps g ~> f Source #

Functor f => Functor (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fmap :: (a -> b) -> Steps f a -> Steps f b #

(<$) :: a -> Steps f b -> Steps f a #

Foldable f => Foldable (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fold :: Monoid m => Steps f m -> m #

foldMap :: Monoid m => (a -> m) -> Steps f a -> m #

foldMap' :: Monoid m => (a -> m) -> Steps f a -> m #

foldr :: (a -> b -> b) -> b -> Steps f a -> b #

foldr' :: (a -> b -> b) -> b -> Steps f a -> b #

foldl :: (b -> a -> b) -> b -> Steps f a -> b #

foldl' :: (b -> a -> b) -> b -> Steps f a -> b #

foldr1 :: (a -> a -> a) -> Steps f a -> a #

foldl1 :: (a -> a -> a) -> Steps f a -> a #

toList :: Steps f a -> [a] #

null :: Steps f a -> Bool #

length :: Steps f a -> Int #

elem :: Eq a => a -> Steps f a -> Bool #

maximum :: Ord a => Steps f a -> a #

minimum :: Ord a => Steps f a -> a #

sum :: Num a => Steps f a -> a #

product :: Num a => Steps f a -> a #

Traversable f => Traversable (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Steps f a -> f0 (Steps f b) #

sequenceA :: Applicative f0 => Steps f (f0 a) -> f0 (Steps f a) #

mapM :: Monad m => (a -> m b) -> Steps f a -> m (Steps f b) #

sequence :: Monad m => Steps f (m a) -> m (Steps f a) #

Contravariant f => Contravariant (Steps f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

contramap :: (a -> b) -> Steps f b -> Steps f a #

(>$) :: b -> Steps f b -> Steps f a #

Eq1 f => Eq1 (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftEq :: (a -> b -> Bool) -> Steps f a -> Steps f b -> Bool #

Ord1 f => Ord1 (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftCompare :: (a -> b -> Ordering) -> Steps f a -> Steps f b -> Ordering #

Read1 f => Read1 (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Steps f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Steps f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Steps f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Steps f a] #

Show1 f => Show1 (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Steps f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Steps f a] -> ShowS #

Invariant f => Invariant (Steps f) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

invmap :: (a -> b) -> (b -> a) -> Steps f a -> Steps f b #

Foldable1 f => Foldable1 (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fold1 :: Semigroup m => Steps f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Steps f a -> m #

toNonEmpty :: Steps f a -> NonEmpty a #

Pointed f => Pointed (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

point :: a -> Steps f a #

Traversable1 f => Traversable1 (Steps f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Steps f a -> f0 (Steps f b) #

sequence1 :: Apply f0 => Steps f (f0 b) -> f0 (Steps f b) #

Functor f => Alt (Steps f) Source #

Left-biased untion

Instance details

Defined in Control.Applicative.Step

Methods

(<!>) :: Steps f a -> Steps f a -> Steps f a #

some :: Applicative (Steps f) => Steps f a -> Steps f [a] #

many :: Applicative (Steps f) => Steps f a -> Steps f [a] #

Eq (f a) => Eq (Steps f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

(==) :: Steps f a -> Steps f a -> Bool #

(/=) :: Steps f a -> Steps f a -> Bool #

(Typeable a, Typeable f, Typeable k, Data (f a)) => Data (Steps f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Steps f a -> c (Steps f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Steps f a) #

toConstr :: Steps f a -> Constr #

dataTypeOf :: Steps f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Steps f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Steps f a)) #

gmapT :: (forall b. Data b => b -> b) -> Steps f a -> Steps f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Steps f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Steps f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Steps f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Steps f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Steps f a -> m (Steps f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Steps f a -> m (Steps f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Steps f a -> m (Steps f a) #

Ord (f a) => Ord (Steps f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

compare :: Steps f a -> Steps f a -> Ordering #

(<) :: Steps f a -> Steps f a -> Bool #

(<=) :: Steps f a -> Steps f a -> Bool #

(>) :: Steps f a -> Steps f a -> Bool #

(>=) :: Steps f a -> Steps f a -> Bool #

max :: Steps f a -> Steps f a -> Steps f a #

min :: Steps f a -> Steps f a -> Steps f a #

Read (f a) => Read (Steps f a) Source # 
Instance details

Defined in Control.Applicative.Step

Show (f a) => Show (Steps f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

showsPrec :: Int -> Steps f a -> ShowS #

show :: Steps f a -> String #

showList :: [Steps f a] -> ShowS #

Generic (Steps f a) Source # 
Instance details

Defined in Control.Applicative.Step

Associated Types

type Rep (Steps f a) :: Type -> Type #

Methods

from :: Steps f a -> Rep (Steps f a) x #

to :: Rep (Steps f a) x -> Steps f a #

Semigroup (Steps f a) Source #

Appends the items back-to-back, shifting all of the items in the second map. Matches the behavior as the fixed-point of These1.

Instance details

Defined in Control.Applicative.Step

Methods

(<>) :: Steps f a -> Steps f a -> Steps f a #

sconcat :: NonEmpty (Steps f a) -> Steps f a #

stimes :: Integral b => b -> Steps f a -> Steps f a #

type Rep (Steps f a) Source # 
Instance details

Defined in Control.Applicative.Step

type Rep (Steps f a) = D1 ('MetaData "Steps" "Control.Applicative.Step" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "Steps" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSteps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NEMap Natural (f a)))))

data ProxyF f a Source #

The functor combinator that forgets all structure in the input. Ignores the input structure and stores no information.

Acts like the "zero" with respect to functor combinator composition.

ComposeT ProxyF f      ~ ProxyF
ComposeT f      ProxyF ~ ProxyF

It can be injected into (losing all information), but it is impossible to ever retract or interpret it.

This is essentially ConstF ().

Constructors

ProxyF 

Instances

Instances details
HFunctor (ProxyF :: (k1 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> ProxyF f ~> ProxyF g Source #

HBind (ProxyF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> ProxyF g) -> ProxyF f ~> ProxyF g Source #

hjoin :: forall (f :: k0 -> Type). ProxyF (ProxyF f) ~> ProxyF f Source #

Inject (ProxyF :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> ProxyF f Source #

Functor (ProxyF f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

fmap :: (a -> b) -> ProxyF f a -> ProxyF f b #

(<$) :: a -> ProxyF f b -> ProxyF f a #

Foldable (ProxyF f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

fold :: Monoid m => ProxyF f m -> m #

foldMap :: Monoid m => (a -> m) -> ProxyF f a -> m #

foldMap' :: Monoid m => (a -> m) -> ProxyF f a -> m #

foldr :: (a -> b -> b) -> b -> ProxyF f a -> b #

foldr' :: (a -> b -> b) -> b -> ProxyF f a -> b #

foldl :: (b -> a -> b) -> b -> ProxyF f a -> b #

foldl' :: (b -> a -> b) -> b -> ProxyF f a -> b #

foldr1 :: (a -> a -> a) -> ProxyF f a -> a #

foldl1 :: (a -> a -> a) -> ProxyF f a -> a #

toList :: ProxyF f a -> [a] #

null :: ProxyF f a -> Bool #

length :: ProxyF f a -> Int #

elem :: Eq a => a -> ProxyF f a -> Bool #

maximum :: Ord a => ProxyF f a -> a #

minimum :: Ord a => ProxyF f a -> a #

sum :: Num a => ProxyF f a -> a #

product :: Num a => ProxyF f a -> a #

Traversable (ProxyF f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ProxyF f a -> f0 (ProxyF f b) #

sequenceA :: Applicative f0 => ProxyF f (f0 a) -> f0 (ProxyF f a) #

mapM :: Monad m => (a -> m b) -> ProxyF f a -> m (ProxyF f b) #

sequence :: Monad m => ProxyF f (m a) -> m (ProxyF f a) #

Contravariant (ProxyF f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

contramap :: (a -> b) -> ProxyF f b -> ProxyF f a #

(>$) :: b -> ProxyF f b -> ProxyF f a #

Eq1 (ProxyF f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftEq :: (a -> b -> Bool) -> ProxyF f a -> ProxyF f b -> Bool #

Ord1 (ProxyF f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftCompare :: (a -> b -> Ordering) -> ProxyF f a -> ProxyF f b -> Ordering #

Read1 (ProxyF f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (ProxyF f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [ProxyF f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (ProxyF f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [ProxyF f a] #

Show1 (ProxyF f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ProxyF f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ProxyF f a] -> ShowS #

Divisible (ProxyF f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

divide :: (a -> (b, c)) -> ProxyF f b -> ProxyF f c -> ProxyF f a #

conquer :: ProxyF f a #

Decidable (ProxyF f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

lose :: (a -> Void) -> ProxyF f a #

choose :: (a -> Either b c) -> ProxyF f b -> ProxyF f c -> ProxyF f a #

Invariant (ProxyF f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

invmap :: (a -> b) -> (b -> a) -> ProxyF f a -> ProxyF f b #

Divise (ProxyF f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

divise :: (a -> (b, c)) -> ProxyF f b -> ProxyF f c -> ProxyF f a Source #

Decide (ProxyF f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

decide :: (a -> Either b c) -> ProxyF f b -> ProxyF f c -> ProxyF f a Source #

Conclude (ProxyF f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

conclude :: (a -> Void) -> ProxyF f a Source #

Eq (ProxyF f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

(==) :: ProxyF f a -> ProxyF f a -> Bool #

(/=) :: ProxyF f a -> ProxyF f a -> Bool #

(Typeable f, Typeable a, Typeable k1, Typeable k2) => Data (ProxyF f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ProxyF f a -> c (ProxyF f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ProxyF f a) #

toConstr :: ProxyF f a -> Constr #

dataTypeOf :: ProxyF f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ProxyF f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ProxyF f a)) #

gmapT :: (forall b. Data b => b -> b) -> ProxyF f a -> ProxyF f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ProxyF f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ProxyF f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ProxyF f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ProxyF f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ProxyF f a -> m (ProxyF f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ProxyF f a -> m (ProxyF f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ProxyF f a -> m (ProxyF f a) #

Ord (ProxyF f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

compare :: ProxyF f a -> ProxyF f a -> Ordering #

(<) :: ProxyF f a -> ProxyF f a -> Bool #

(<=) :: ProxyF f a -> ProxyF f a -> Bool #

(>) :: ProxyF f a -> ProxyF f a -> Bool #

(>=) :: ProxyF f a -> ProxyF f a -> Bool #

max :: ProxyF f a -> ProxyF f a -> ProxyF f a #

min :: ProxyF f a -> ProxyF f a -> ProxyF f a #

Read (ProxyF f a) Source # 
Instance details

Defined in Data.HFunctor

Show (ProxyF f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

showsPrec :: Int -> ProxyF f a -> ShowS #

show :: ProxyF f a -> String #

showList :: [ProxyF f a] -> ShowS #

Generic (ProxyF f a) Source # 
Instance details

Defined in Data.HFunctor

Associated Types

type Rep (ProxyF f a) :: Type -> Type #

Methods

from :: ProxyF f a -> Rep (ProxyF f a) x #

to :: Rep (ProxyF f a) x -> ProxyF f a #

type Rep (ProxyF f a) Source # 
Instance details

Defined in Data.HFunctor

type Rep (ProxyF f a) = D1 ('MetaData "ProxyF" "Data.HFunctor" "functor-combinators-0.3.4.0-inplace" 'False) (C1 ('MetaCons "ProxyF" 'PrefixI 'False) (U1 :: Type -> Type))

data ConstF e f a Source #

Functor combinator that forgets all structure on the input, and instead stores a value of type e.

Like ProxyF, acts like a "zero" with functor combinator composition.

It can be injected into (losing all information), but it is impossible to ever retract or interpret it.

Constructors

ConstF 

Fields

Instances

Instances details
HFunctor (ConstF e :: (k1 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> ConstF e f ~> ConstF e g Source #

Monoid e => Inject (ConstF e :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> ConstF e f Source #

Functor (ConstF e f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

fmap :: (a -> b) -> ConstF e f a -> ConstF e f b #

(<$) :: a -> ConstF e f b -> ConstF e f a #

Foldable (ConstF e f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

fold :: Monoid m => ConstF e f m -> m #

foldMap :: Monoid m => (a -> m) -> ConstF e f a -> m #

foldMap' :: Monoid m => (a -> m) -> ConstF e f a -> m #

foldr :: (a -> b -> b) -> b -> ConstF e f a -> b #

foldr' :: (a -> b -> b) -> b -> ConstF e f a -> b #

foldl :: (b -> a -> b) -> b -> ConstF e f a -> b #

foldl' :: (b -> a -> b) -> b -> ConstF e f a -> b #

foldr1 :: (a -> a -> a) -> ConstF e f a -> a #

foldl1 :: (a -> a -> a) -> ConstF e f a -> a #

toList :: ConstF e f a -> [a] #

null :: ConstF e f a -> Bool #

length :: ConstF e f a -> Int #

elem :: Eq a => a -> ConstF e f a -> Bool #

maximum :: Ord a => ConstF e f a -> a #

minimum :: Ord a => ConstF e f a -> a #

sum :: Num a => ConstF e f a -> a #

product :: Num a => ConstF e f a -> a #

Traversable (ConstF e f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ConstF e f a -> f0 (ConstF e f b) #

sequenceA :: Applicative f0 => ConstF e f (f0 a) -> f0 (ConstF e f a) #

mapM :: Monad m => (a -> m b) -> ConstF e f a -> m (ConstF e f b) #

sequence :: Monad m => ConstF e f (m a) -> m (ConstF e f a) #

Contravariant (ConstF e f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

contramap :: (a -> b) -> ConstF e f b -> ConstF e f a #

(>$) :: b -> ConstF e f b -> ConstF e f a #

Eq e => Eq1 (ConstF e f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftEq :: (a -> b -> Bool) -> ConstF e f a -> ConstF e f b -> Bool #

Ord e => Ord1 (ConstF e f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftCompare :: (a -> b -> Ordering) -> ConstF e f a -> ConstF e f b -> Ordering #

Read e => Read1 (ConstF e f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (ConstF e f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [ConstF e f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (ConstF e f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [ConstF e f a] #

Show e => Show1 (ConstF e f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ConstF e f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ConstF e f a] -> ShowS #

Monoid e => Divisible (ConstF e f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

divide :: (a -> (b, c)) -> ConstF e f b -> ConstF e f c -> ConstF e f a #

conquer :: ConstF e f a #

Invariant (ConstF e f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

invmap :: (a -> b) -> (b -> a) -> ConstF e f a -> ConstF e f b #

Semigroup e => Divise (ConstF e f :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

divise :: (a -> (b, c)) -> ConstF e f b -> ConstF e f c -> ConstF e f a Source #

Eq e => Eq (ConstF e f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

(==) :: ConstF e f a -> ConstF e f a -> Bool #

(/=) :: ConstF e f a -> ConstF e f a -> Bool #

(Typeable f, Typeable a, Typeable k1, Typeable k2, Data e) => Data (ConstF e f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ConstF e f a -> c (ConstF e f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ConstF e f a) #

toConstr :: ConstF e f a -> Constr #

dataTypeOf :: ConstF e f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ConstF e f a)) #

dataCast2 :: Typeable t => (forall d e0. (Data d, Data e0) => c (t d e0)) -> Maybe (c (ConstF e f a)) #

gmapT :: (forall b. Data b => b -> b) -> ConstF e f a -> ConstF e f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ConstF e f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ConstF e f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> ConstF e f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ConstF e f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ConstF e f a -> m (ConstF e f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ConstF e f a -> m (ConstF e f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ConstF e f a -> m (ConstF e f a) #

Ord e => Ord (ConstF e f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

compare :: ConstF e f a -> ConstF e f a -> Ordering #

(<) :: ConstF e f a -> ConstF e f a -> Bool #

(<=) :: ConstF e f a -> ConstF e f a -> Bool #

(>) :: ConstF e f a -> ConstF e f a -> Bool #

(>=) :: ConstF e f a -> ConstF e f a -> Bool #

max :: ConstF e f a -> ConstF e f a -> ConstF e f a #

min :: ConstF e f a -> ConstF e f a -> ConstF e f a #

Read e => Read (ConstF e f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

readsPrec :: Int -> ReadS (ConstF e f a) #

readList :: ReadS [ConstF e f a] #

readPrec :: ReadPrec (ConstF e f a) #

readListPrec :: ReadPrec [ConstF e f a] #

Show e => Show (ConstF e f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

showsPrec :: Int -> ConstF e f a -> ShowS #

show :: ConstF e f a -> String #

showList :: [ConstF e f a] -> ShowS #

Generic (ConstF e f a) Source # 
Instance details

Defined in Data.HFunctor

Associated Types

type Rep (ConstF e f a) :: Type -> Type #

Methods

from :: ConstF e f a -> Rep (ConstF e f a) x #

to :: Rep (ConstF e f a) x -> ConstF e f a #

type Rep (ConstF e f a) Source # 
Instance details

Defined in Data.HFunctor

type Rep (ConstF e f a) = D1 ('MetaData "ConstF" "Data.HFunctor" "functor-combinators-0.3.4.0-inplace" 'False) (C1 ('MetaCons "ConstF" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConstF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 e)))

data EnvT e (w :: Type -> Type) a #

Constructors

EnvT e (w a) 

Instances

Instances details
ComonadTrans (EnvT e) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

lower :: Comonad w => EnvT e w a -> w a #

ComonadHoist (EnvT e) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

cohoist :: (Comonad w, Comonad v) => (forall x. w x -> v x) -> EnvT e w a -> EnvT e v a #

Monoid e => HBind (EnvT e :: (Type -> Type) -> Type -> Type) Source #

Combines the accumulators, Writer-style

Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k -> Type) (g :: k -> Type). (f ~> EnvT e g) -> EnvT e f ~> EnvT e g Source #

hjoin :: forall (f :: k -> Type). EnvT e (EnvT e f) ~> EnvT e f Source #

Monoid e => Inject (EnvT e :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> EnvT e f Source #

Monoid e => Interpret (EnvT e :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

This ignores the environment, so interpret /= hbind

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: EnvT e f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> EnvT e g ~> f Source #

HFunctor (EnvT e :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> EnvT e f ~> EnvT e g Source #

Functor w => Functor (EnvT e w) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

fmap :: (a -> b) -> EnvT e w a -> EnvT e w b #

(<$) :: a -> EnvT e w b -> EnvT e w a #

(Monoid e, Applicative m) => Applicative (EnvT e m) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

pure :: a -> EnvT e m a #

(<*>) :: EnvT e m (a -> b) -> EnvT e m a -> EnvT e m b #

liftA2 :: (a -> b -> c) -> EnvT e m a -> EnvT e m b -> EnvT e m c #

(*>) :: EnvT e m a -> EnvT e m b -> EnvT e m b #

(<*) :: EnvT e m a -> EnvT e m b -> EnvT e m a #

Foldable w => Foldable (EnvT e w) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

fold :: Monoid m => EnvT e w m -> m #

foldMap :: Monoid m => (a -> m) -> EnvT e w a -> m #

foldMap' :: Monoid m => (a -> m) -> EnvT e w a -> m #

foldr :: (a -> b -> b) -> b -> EnvT e w a -> b #

foldr' :: (a -> b -> b) -> b -> EnvT e w a -> b #

foldl :: (b -> a -> b) -> b -> EnvT e w a -> b #

foldl' :: (b -> a -> b) -> b -> EnvT e w a -> b #

foldr1 :: (a -> a -> a) -> EnvT e w a -> a #

foldl1 :: (a -> a -> a) -> EnvT e w a -> a #

toList :: EnvT e w a -> [a] #

null :: EnvT e w a -> Bool #

length :: EnvT e w a -> Int #

elem :: Eq a => a -> EnvT e w a -> Bool #

maximum :: Ord a => EnvT e w a -> a #

minimum :: Ord a => EnvT e w a -> a #

sum :: Num a => EnvT e w a -> a #

product :: Num a => EnvT e w a -> a #

Traversable w => Traversable (EnvT e w) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

traverse :: Applicative f => (a -> f b) -> EnvT e w a -> f (EnvT e w b) #

sequenceA :: Applicative f => EnvT e w (f a) -> f (EnvT e w a) #

mapM :: Monad m => (a -> m b) -> EnvT e w a -> m (EnvT e w b) #

sequence :: Monad m => EnvT e w (m a) -> m (EnvT e w a) #

Comonad w => Comonad (EnvT e w) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

extract :: EnvT e w a -> a #

duplicate :: EnvT e w a -> EnvT e w (EnvT e w a) #

extend :: (EnvT e w a -> b) -> EnvT e w a -> EnvT e w b #

(Semigroup e, ComonadApply w) => ComonadApply (EnvT e w) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

(<@>) :: EnvT e w (a -> b) -> EnvT e w a -> EnvT e w b #

(@>) :: EnvT e w a -> EnvT e w b -> EnvT e w b #

(<@) :: EnvT e w a -> EnvT e w b -> EnvT e w a #

(Semigroup e, Apply w) => Apply (EnvT e w)

An 'EnvT e w' is not Applicative unless its e is a Monoid, but it is an instance of Apply

Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: EnvT e w (a -> b) -> EnvT e w a -> EnvT e w b #

(.>) :: EnvT e w a -> EnvT e w b -> EnvT e w b #

(<.) :: EnvT e w a -> EnvT e w b -> EnvT e w a #

liftF2 :: (a -> b -> c) -> EnvT e w a -> EnvT e w b -> EnvT e w c #

(Data e, Typeable w, Data (w a), Data a) => Data (EnvT e w a) 
Instance details

Defined in Control.Comonad.Trans.Env

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EnvT e w a -> c (EnvT e w a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (EnvT e w a) #

toConstr :: EnvT e w a -> Constr #

dataTypeOf :: EnvT e w a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (EnvT e w a)) #

dataCast2 :: Typeable t => (forall d e0. (Data d, Data e0) => c (t d e0)) -> Maybe (c (EnvT e w a)) #

gmapT :: (forall b. Data b => b -> b) -> EnvT e w a -> EnvT e w a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EnvT e w a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EnvT e w a -> r #

gmapQ :: (forall d. Data d => d -> u) -> EnvT e w a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> EnvT e w a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> EnvT e w a -> m (EnvT e w a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EnvT e w a -> m (EnvT e w a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EnvT e w a -> m (EnvT e w a) #

newtype ReaderT r (m :: Type -> Type) a #

The reader monad transformer, which adds a read-only environment to the given monad.

The return function ignores the environment, while >>= passes the inherited environment to both subcomputations.

Constructors

ReaderT 

Fields

Instances

Instances details
Monad m => MonadReader r (ReaderT r m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: ReaderT r m r #

local :: (r -> r) -> ReaderT r m a -> ReaderT r m a #

reader :: (r -> a) -> ReaderT r m a #

(Functor f, MonadFree f m) => MonadFree f (ReaderT e m) 
Instance details

Defined in Control.Monad.Free.Class

Methods

wrap :: f (ReaderT e m a) -> ReaderT e m a #

MonadTrans (ReaderT r) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

lift :: Monad m => m a -> ReaderT r m a #

Inject (ReaderT r :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> ReaderT r f Source #

MonadReader r f => Interpret (ReaderT r :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

A free MonadReader, but only when applied to a Monad.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: ReaderT r f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> ReaderT r g ~> f Source #

HFunctor (ReaderT r :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> ReaderT r f ~> ReaderT r g Source #

Monad m => Monad (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

(>>=) :: ReaderT r m a -> (a -> ReaderT r m b) -> ReaderT r m b #

(>>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #

return :: a -> ReaderT r m a #

Functor m => Functor (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

fmap :: (a -> b) -> ReaderT r m a -> ReaderT r m b #

(<$) :: a -> ReaderT r m b -> ReaderT r m a #

MonadFix m => MonadFix (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

mfix :: (a -> ReaderT r m a) -> ReaderT r m a #

MonadFail m => MonadFail (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

fail :: String -> ReaderT r m a #

Applicative m => Applicative (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

pure :: a -> ReaderT r m a #

(<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b #

liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c #

(*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #

(<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a #

Contravariant m => Contravariant (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

contramap :: (a -> b) -> ReaderT r m b -> ReaderT r m a #

(>$) :: b -> ReaderT r m b -> ReaderT r m a #

Representable m => Representable (ReaderT e m) 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep (ReaderT e m) #

Methods

tabulate :: (Rep (ReaderT e m) -> a) -> ReaderT e m a #

index :: ReaderT e m a -> Rep (ReaderT e m) -> a #

MonadZip m => MonadZip (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

mzip :: ReaderT r m a -> ReaderT r m b -> ReaderT r m (a, b) #

mzipWith :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c #

munzip :: ReaderT r m (a, b) -> (ReaderT r m a, ReaderT r m b) #

MonadIO m => MonadIO (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

liftIO :: IO a -> ReaderT r m a #

Alternative m => Alternative (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

empty :: ReaderT r m a #

(<|>) :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a #

some :: ReaderT r m a -> ReaderT r m [a] #

many :: ReaderT r m a -> ReaderT r m [a] #

MonadPlus m => MonadPlus (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

mzero :: ReaderT r m a #

mplus :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a #

Divisible m => Divisible (ReaderT r m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> ReaderT r m b -> ReaderT r m c -> ReaderT r m a #

conquer :: ReaderT r m a #

Decidable m => Decidable (ReaderT r m) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> ReaderT r m a #

choose :: (a -> Either b c) -> ReaderT r m b -> ReaderT r m c -> ReaderT r m a #

Invariant m => Invariant (ReaderT r m)

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> ReaderT r m a -> ReaderT r m b #

Apply m => Apply (ReaderT e m) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: ReaderT e m (a -> b) -> ReaderT e m a -> ReaderT e m b #

(.>) :: ReaderT e m a -> ReaderT e m b -> ReaderT e m b #

(<.) :: ReaderT e m a -> ReaderT e m b -> ReaderT e m a #

liftF2 :: (a -> b -> c) -> ReaderT e m a -> ReaderT e m b -> ReaderT e m c #

Pointed m => Pointed (ReaderT r m) 
Instance details

Defined in Data.Pointed

Methods

point :: a -> ReaderT r m a #

Plus f => Plus (ReaderT e f) 
Instance details

Defined in Data.Functor.Plus

Methods

zero :: ReaderT e f a #

Alt f => Alt (ReaderT e f) 
Instance details

Defined in Data.Functor.Alt

Methods

(<!>) :: ReaderT e f a -> ReaderT e f a -> ReaderT e f a #

some :: Applicative (ReaderT e f) => ReaderT e f a -> ReaderT e f [a] #

many :: Applicative (ReaderT e f) => ReaderT e f a -> ReaderT e f [a] #

Bind m => Bind (ReaderT e m) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: ReaderT e m a -> (a -> ReaderT e m b) -> ReaderT e m b #

join :: ReaderT e m (ReaderT e m a) -> ReaderT e m a #

Divise m => Divise (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divise

Methods

divise :: (a -> (b, c)) -> ReaderT r m b -> ReaderT r m c -> ReaderT r m a Source #

Decide m => Decide (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Contravariant.Decide

Methods

decide :: (a -> Either b c) -> ReaderT r m b -> ReaderT r m c -> ReaderT r m a Source #

Conclude m => Conclude (ReaderT r m) Source # 
Instance details

Defined in Data.Functor.Contravariant.Conclude

Methods

conclude :: (a -> Void) -> ReaderT r m a Source #

type Rep (ReaderT e m) 
Instance details

Defined in Data.Functor.Rep

type Rep (ReaderT e m) = (e, Rep m)

data Flagged f a Source #

An f a, along with a Bool flag

Flagged f a ~ (Bool, f a)
Flagged f   ~ ((,) Bool) :.: f       -- functor composition

Creation with inject or pure uses False as the boolean.

You can think of it as an f a that is "flagged" with a boolean value, and that value can indicuate whether or not it is "pure" (made with inject or pure) as False, or "impure" (made from some other source) as True. However, False may be always created directly, of course, using the constructor.

You can think of it like a Step that is either 0 or 1, as well.

interpreting it requires no constraint on the target context.

This type is equivalent (along with its instances) to:

Constructors

Flagged 

Fields

Instances

Instances details
HFunctor (Flagged :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Flagged f ~> Flagged g Source #

HBind (Flagged :: (k -> Type) -> k -> Type) Source #

Equivalent to instance for EnvT Any and HLift IdentityT.

Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> Flagged g) -> Flagged f ~> Flagged g Source #

hjoin :: forall (f :: k0 -> Type). Flagged (Flagged f) ~> Flagged f Source #

Inject (Flagged :: (k -> Type) -> k -> Type) Source #

Injects with False.

Equivalent to instance for EnvT Any and HLift IdentityT.

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> Flagged f Source #

Interpret (Flagged :: (k -> Type) -> k -> Type) (f :: k -> Type) Source #

Equivalent to instance for EnvT Any and HLift IdentityT.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: Flagged f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> Flagged g ~> f Source #

Functor f => Functor (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fmap :: (a -> b) -> Flagged f a -> Flagged f b #

(<$) :: a -> Flagged f b -> Flagged f a #

Applicative f => Applicative (Flagged f) Source #

Uses False for pure, and || for <*>.

Instance details

Defined in Control.Applicative.Step

Methods

pure :: a -> Flagged f a #

(<*>) :: Flagged f (a -> b) -> Flagged f a -> Flagged f b #

liftA2 :: (a -> b -> c) -> Flagged f a -> Flagged f b -> Flagged f c #

(*>) :: Flagged f a -> Flagged f b -> Flagged f b #

(<*) :: Flagged f a -> Flagged f b -> Flagged f a #

Foldable f => Foldable (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fold :: Monoid m => Flagged f m -> m #

foldMap :: Monoid m => (a -> m) -> Flagged f a -> m #

foldMap' :: Monoid m => (a -> m) -> Flagged f a -> m #

foldr :: (a -> b -> b) -> b -> Flagged f a -> b #

foldr' :: (a -> b -> b) -> b -> Flagged f a -> b #

foldl :: (b -> a -> b) -> b -> Flagged f a -> b #

foldl' :: (b -> a -> b) -> b -> Flagged f a -> b #

foldr1 :: (a -> a -> a) -> Flagged f a -> a #

foldl1 :: (a -> a -> a) -> Flagged f a -> a #

toList :: Flagged f a -> [a] #

null :: Flagged f a -> Bool #

length :: Flagged f a -> Int #

elem :: Eq a => a -> Flagged f a -> Bool #

maximum :: Ord a => Flagged f a -> a #

minimum :: Ord a => Flagged f a -> a #

sum :: Num a => Flagged f a -> a #

product :: Num a => Flagged f a -> a #

Traversable f => Traversable (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Flagged f a -> f0 (Flagged f b) #

sequenceA :: Applicative f0 => Flagged f (f0 a) -> f0 (Flagged f a) #

mapM :: Monad m => (a -> m b) -> Flagged f a -> m (Flagged f b) #

sequence :: Monad m => Flagged f (m a) -> m (Flagged f a) #

Eq1 f => Eq1 (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftEq :: (a -> b -> Bool) -> Flagged f a -> Flagged f b -> Bool #

Ord1 f => Ord1 (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftCompare :: (a -> b -> Ordering) -> Flagged f a -> Flagged f b -> Ordering #

Read1 f => Read1 (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Flagged f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Flagged f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Flagged f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Flagged f a] #

Show1 f => Show1 (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Flagged f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Flagged f a] -> ShowS #

Foldable1 f => Foldable1 (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fold1 :: Semigroup m => Flagged f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Flagged f a -> m #

toNonEmpty :: Flagged f a -> NonEmpty a #

Pointed f => Pointed (Flagged f) Source #

Uses False for point.

Instance details

Defined in Control.Applicative.Step

Methods

point :: a -> Flagged f a #

Traversable1 f => Traversable1 (Flagged f) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> Flagged f a -> f0 (Flagged f b) #

sequence1 :: Apply f0 => Flagged f (f0 b) -> f0 (Flagged f b) #

Eq (f a) => Eq (Flagged f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

(==) :: Flagged f a -> Flagged f a -> Bool #

(/=) :: Flagged f a -> Flagged f a -> Bool #

(Typeable a, Typeable f, Typeable k, Data (f a)) => Data (Flagged f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Flagged f a -> c (Flagged f a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Flagged f a) #

toConstr :: Flagged f a -> Constr #

dataTypeOf :: Flagged f a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Flagged f a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Flagged f a)) #

gmapT :: (forall b. Data b => b -> b) -> Flagged f a -> Flagged f a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Flagged f a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Flagged f a -> r #

gmapQ :: (forall d. Data d => d -> u) -> Flagged f a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Flagged f a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Flagged f a -> m (Flagged f a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Flagged f a -> m (Flagged f a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Flagged f a -> m (Flagged f a) #

Ord (f a) => Ord (Flagged f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

compare :: Flagged f a -> Flagged f a -> Ordering #

(<) :: Flagged f a -> Flagged f a -> Bool #

(<=) :: Flagged f a -> Flagged f a -> Bool #

(>) :: Flagged f a -> Flagged f a -> Bool #

(>=) :: Flagged f a -> Flagged f a -> Bool #

max :: Flagged f a -> Flagged f a -> Flagged f a #

min :: Flagged f a -> Flagged f a -> Flagged f a #

Read (f a) => Read (Flagged f a) Source # 
Instance details

Defined in Control.Applicative.Step

Show (f a) => Show (Flagged f a) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

showsPrec :: Int -> Flagged f a -> ShowS #

show :: Flagged f a -> String #

showList :: [Flagged f a] -> ShowS #

Generic (Flagged f a) Source # 
Instance details

Defined in Control.Applicative.Step

Associated Types

type Rep (Flagged f a) :: Type -> Type #

Methods

from :: Flagged f a -> Rep (Flagged f a) x #

to :: Rep (Flagged f a) x -> Flagged f a #

type Rep (Flagged f a) Source # 
Instance details

Defined in Control.Applicative.Step

type Rep (Flagged f a) = D1 ('MetaData "Flagged" "Control.Applicative.Step" "functor-combinators-0.3.4.0-inplace" 'False) (C1 ('MetaCons "Flagged" 'PrefixI 'True) (S1 ('MetaSel ('Just "flaggedFlag") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "flaggedVal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

newtype IdentityT (f :: k -> Type) (a :: k) #

The trivial monad transformer, which maps a monad to an equivalent monad.

Constructors

IdentityT 

Fields

Instances

Instances details
HFunctor (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> IdentityT f ~> IdentityT g Source #

HBind (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> IdentityT g) -> IdentityT f ~> IdentityT g Source #

hjoin :: forall (f :: k0 -> Type). IdentityT (IdentityT f) ~> IdentityT f Source #

Inject (IdentityT :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> IdentityT f Source #

Interpret (IdentityT :: (k -> Type) -> k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: IdentityT f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> IdentityT g ~> f Source #

MonadReader r m => MonadReader r (IdentityT m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: IdentityT m r #

local :: (r -> r) -> IdentityT m a -> IdentityT m a #

reader :: (r -> a) -> IdentityT m a #

(Functor f, MonadFree f m) => MonadFree f (IdentityT m) 
Instance details

Defined in Control.Monad.Free.Class

Methods

wrap :: f (IdentityT m a) -> IdentityT m a #

MonadTrans (IdentityT :: (Type -> Type) -> Type -> Type) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

lift :: Monad m => m a -> IdentityT m a #

FreeOf (Unconstrained :: (Type -> Type) -> Constraint) (IdentityT :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy IdentityT :: (Type -> Type) -> Constraint Source #

Monad m => Monad (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

(>>=) :: IdentityT m a -> (a -> IdentityT m b) -> IdentityT m b #

(>>) :: IdentityT m a -> IdentityT m b -> IdentityT m b #

return :: a -> IdentityT m a #

Functor m => Functor (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

fmap :: (a -> b) -> IdentityT m a -> IdentityT m b #

(<$) :: a -> IdentityT m b -> IdentityT m a #

MonadFix m => MonadFix (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

mfix :: (a -> IdentityT m a) -> IdentityT m a #

MonadFail m => MonadFail (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

fail :: String -> IdentityT m a #

Applicative m => Applicative (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

pure :: a -> IdentityT m a #

(<*>) :: IdentityT m (a -> b) -> IdentityT m a -> IdentityT m b #

liftA2 :: (a -> b -> c) -> IdentityT m a -> IdentityT m b -> IdentityT m c #

(*>) :: IdentityT m a -> IdentityT m b -> IdentityT m b #

(<*) :: IdentityT m a -> IdentityT m b -> IdentityT m a #

Foldable f => Foldable (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

fold :: Monoid m => IdentityT f m -> m #

foldMap :: Monoid m => (a -> m) -> IdentityT f a -> m #

foldMap' :: Monoid m => (a -> m) -> IdentityT f a -> m #

foldr :: (a -> b -> b) -> b -> IdentityT f a -> b #

foldr' :: (a -> b -> b) -> b -> IdentityT f a -> b #

foldl :: (b -> a -> b) -> b -> IdentityT f a -> b #

foldl' :: (b -> a -> b) -> b -> IdentityT f a -> b #

foldr1 :: (a -> a -> a) -> IdentityT f a -> a #

foldl1 :: (a -> a -> a) -> IdentityT f a -> a #

toList :: IdentityT f a -> [a] #

null :: IdentityT f a -> Bool #

length :: IdentityT f a -> Int #

elem :: Eq a => a -> IdentityT f a -> Bool #

maximum :: Ord a => IdentityT f a -> a #

minimum :: Ord a => IdentityT f a -> a #

sum :: Num a => IdentityT f a -> a #

product :: Num a => IdentityT f a -> a #

Traversable f => Traversable (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

traverse :: Applicative f0 => (a -> f0 b) -> IdentityT f a -> f0 (IdentityT f b) #

sequenceA :: Applicative f0 => IdentityT f (f0 a) -> f0 (IdentityT f a) #

mapM :: Monad m => (a -> m b) -> IdentityT f a -> m (IdentityT f b) #

sequence :: Monad m => IdentityT f (m a) -> m (IdentityT f a) #

Contravariant f => Contravariant (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

contramap :: (a -> b) -> IdentityT f b -> IdentityT f a #

(>$) :: b -> IdentityT f b -> IdentityT f a #

Representable m => Representable (IdentityT m) 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep (IdentityT m) #

Methods

tabulate :: (Rep (IdentityT m) -> a) -> IdentityT m a #

index :: IdentityT m a -> Rep (IdentityT m) -> a #

Eq1 f => Eq1 (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

liftEq :: (a -> b -> Bool) -> IdentityT f a -> IdentityT f b -> Bool #

Ord1 f => Ord1 (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

liftCompare :: (a -> b -> Ordering) -> IdentityT f a -> IdentityT f b -> Ordering #

Read1 f => Read1 (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (IdentityT f a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [IdentityT f a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (IdentityT f a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [IdentityT f a] #

Show1 f => Show1 (IdentityT f) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> IdentityT f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [IdentityT f a] -> ShowS #

MonadZip m => MonadZip (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

mzip :: IdentityT m a -> IdentityT m b -> IdentityT m (a, b) #

mzipWith :: (a -> b -> c) -> IdentityT m a -> IdentityT m b -> IdentityT m c #

munzip :: IdentityT m (a, b) -> (IdentityT m a, IdentityT m b) #

MonadIO m => MonadIO (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

liftIO :: IO a -> IdentityT m a #

Alternative m => Alternative (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

empty :: IdentityT m a #

(<|>) :: IdentityT m a -> IdentityT m a -> IdentityT m a #

some :: IdentityT m a -> IdentityT m [a] #

many :: IdentityT m a -> IdentityT m [a] #

MonadPlus m => MonadPlus (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

mzero :: IdentityT m a #

mplus :: IdentityT m a -> IdentityT m a -> IdentityT m a #

Comonad w => Comonad (IdentityT w) 
Instance details

Defined in Control.Comonad

Methods

extract :: IdentityT w a -> a #

duplicate :: IdentityT w a -> IdentityT w (IdentityT w a) #

extend :: (IdentityT w a -> b) -> IdentityT w a -> IdentityT w b #

ComonadApply w => ComonadApply (IdentityT w) 
Instance details

Defined in Control.Comonad

Methods

(<@>) :: IdentityT w (a -> b) -> IdentityT w a -> IdentityT w b #

(@>) :: IdentityT w a -> IdentityT w b -> IdentityT w b #

(<@) :: IdentityT w a -> IdentityT w b -> IdentityT w a #

Divisible f => Divisible (IdentityT f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> IdentityT f b -> IdentityT f c -> IdentityT f a #

conquer :: IdentityT f a #

Decidable f => Decidable (IdentityT f) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> IdentityT f a #

choose :: (a -> Either b c) -> IdentityT f b -> IdentityT f c -> IdentityT f a #

Invariant m => Invariant (IdentityT m)

from the transformers package

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> IdentityT m a -> IdentityT m b #

Foldable1 m => Foldable1 (IdentityT m) 
Instance details

Defined in Data.Semigroup.Foldable.Class

Methods

fold1 :: Semigroup m0 => IdentityT m m0 -> m0 #

foldMap1 :: Semigroup m0 => (a -> m0) -> IdentityT m a -> m0 #

toNonEmpty :: IdentityT m a -> NonEmpty a #

Apply w => Apply (IdentityT w) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: IdentityT w (a -> b) -> IdentityT w a -> IdentityT w b #

(.>) :: IdentityT w a -> IdentityT w b -> IdentityT w b #

(<.) :: IdentityT w a -> IdentityT w b -> IdentityT w a #

liftF2 :: (a -> b -> c) -> IdentityT w a -> IdentityT w b -> IdentityT w c #

Pointed m => Pointed (IdentityT m) 
Instance details

Defined in Data.Pointed

Methods

point :: a -> IdentityT m a #

Traversable1 f => Traversable1 (IdentityT f) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> IdentityT f a -> f0 (IdentityT f b) #

sequence1 :: Apply f0 => IdentityT f (f0 b) -> f0 (IdentityT f b) #

Plus f => Plus (IdentityT f) 
Instance details

Defined in Data.Functor.Plus

Methods

zero :: IdentityT f a #

Alt f => Alt (IdentityT f) 
Instance details

Defined in Data.Functor.Alt

Methods

(<!>) :: IdentityT f a -> IdentityT f a -> IdentityT f a #

some :: Applicative (IdentityT f) => IdentityT f a -> IdentityT f [a] #

many :: Applicative (IdentityT f) => IdentityT f a -> IdentityT f [a] #

Bind m => Bind (IdentityT m) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: IdentityT m a -> (a -> IdentityT m b) -> IdentityT m b #

join :: IdentityT m (IdentityT m a) -> IdentityT m a #

Divise f => Divise (IdentityT f) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divise

Methods

divise :: (a -> (b, c)) -> IdentityT f b -> IdentityT f c -> IdentityT f a Source #

Decide f => Decide (IdentityT f) Source # 
Instance details

Defined in Data.Functor.Contravariant.Decide

Methods

decide :: (a -> Either b c) -> IdentityT f b -> IdentityT f c -> IdentityT f a Source #

Conclude f => Conclude (IdentityT f) Source # 
Instance details

Defined in Data.Functor.Contravariant.Conclude

Methods

conclude :: (a -> Void) -> IdentityT f a Source #

(Eq1 f, Eq a) => Eq (IdentityT f a) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

(==) :: IdentityT f a -> IdentityT f a -> Bool #

(/=) :: IdentityT f a -> IdentityT f a -> Bool #

(Ord1 f, Ord a) => Ord (IdentityT f a) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

compare :: IdentityT f a -> IdentityT f a -> Ordering #

(<) :: IdentityT f a -> IdentityT f a -> Bool #

(<=) :: IdentityT f a -> IdentityT f a -> Bool #

(>) :: IdentityT f a -> IdentityT f a -> Bool #

(>=) :: IdentityT f a -> IdentityT f a -> Bool #

max :: IdentityT f a -> IdentityT f a -> IdentityT f a #

min :: IdentityT f a -> IdentityT f a -> IdentityT f a #

(Read1 f, Read a) => Read (IdentityT f a) 
Instance details

Defined in Control.Monad.Trans.Identity

(Show1 f, Show a) => Show (IdentityT f a) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

showsPrec :: Int -> IdentityT f a -> ShowS #

show :: IdentityT f a -> String #

showList :: [IdentityT f a] -> ShowS #

type FreeFunctorBy (IdentityT :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

type Rep (IdentityT m) 
Instance details

Defined in Data.Functor.Rep

type Rep (IdentityT m) = Rep m

data Void2 a b Source #

Void2 a b is uninhabited for all a and b.

Instances

Instances details
HFunctor (Void2 :: (k1 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> Void2 f ~> Void2 g Source #

Functor (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fmap :: (a0 -> b) -> Void2 a a0 -> Void2 a b #

(<$) :: a0 -> Void2 a b -> Void2 a a0 #

Foldable (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

fold :: Monoid m => Void2 a m -> m #

foldMap :: Monoid m => (a0 -> m) -> Void2 a a0 -> m #

foldMap' :: Monoid m => (a0 -> m) -> Void2 a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> Void2 a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> Void2 a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> Void2 a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> Void2 a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> Void2 a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> Void2 a a0 -> a0 #

toList :: Void2 a a0 -> [a0] #

null :: Void2 a a0 -> Bool #

length :: Void2 a a0 -> Int #

elem :: Eq a0 => a0 -> Void2 a a0 -> Bool #

maximum :: Ord a0 => Void2 a a0 -> a0 #

minimum :: Ord a0 => Void2 a a0 -> a0 #

sum :: Num a0 => Void2 a a0 -> a0 #

product :: Num a0 => Void2 a a0 -> a0 #

Traversable (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

traverse :: Applicative f => (a0 -> f b) -> Void2 a a0 -> f (Void2 a b) #

sequenceA :: Applicative f => Void2 a (f a0) -> f (Void2 a a0) #

mapM :: Monad m => (a0 -> m b) -> Void2 a a0 -> m (Void2 a b) #

sequence :: Monad m => Void2 a (m a0) -> m (Void2 a a0) #

Contravariant (Void2 a :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

contramap :: (a0 -> b) -> Void2 a b -> Void2 a a0 #

(>$) :: b -> Void2 a b -> Void2 a a0 #

Eq1 (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftEq :: (a0 -> b -> Bool) -> Void2 a a0 -> Void2 a b -> Bool #

Ord1 (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftCompare :: (a0 -> b -> Ordering) -> Void2 a a0 -> Void2 a b -> Ordering #

Read1 (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Void2 a a0) #

liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Void2 a a0] #

liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Void2 a a0) #

liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Void2 a a0] #

Show1 (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Void2 a a0 -> ShowS #

liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Void2 a a0] -> ShowS #

Invariant (Void2 a :: Type -> Type) Source #

Since: 0.3.0.0

Instance details

Defined in Control.Applicative.Step

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Void2 a a0 -> Void2 a b #

Apply (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

(<.>) :: Void2 a (a0 -> b) -> Void2 a a0 -> Void2 a b #

(.>) :: Void2 a a0 -> Void2 a b -> Void2 a b #

(<.) :: Void2 a a0 -> Void2 a b -> Void2 a a0 #

liftF2 :: (a0 -> b -> c) -> Void2 a a0 -> Void2 a b -> Void2 a c #

Alt (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

(<!>) :: Void2 a a0 -> Void2 a a0 -> Void2 a a0 #

some :: Applicative (Void2 a) => Void2 a a0 -> Void2 a [a0] #

many :: Applicative (Void2 a) => Void2 a a0 -> Void2 a [a0] #

Bind (Void2 a :: Type -> Type) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

(>>-) :: Void2 a a0 -> (a0 -> Void2 a b) -> Void2 a b #

join :: Void2 a (Void2 a a0) -> Void2 a a0 #

Eq (Void2 a b) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

(==) :: Void2 a b -> Void2 a b -> Bool #

(/=) :: Void2 a b -> Void2 a b -> Bool #

(Typeable a, Typeable b, Typeable k1, Typeable k2) => Data (Void2 a b) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> Void2 a b -> c (Void2 a b) #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Void2 a b) #

toConstr :: Void2 a b -> Constr #

dataTypeOf :: Void2 a b -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Void2 a b)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Void2 a b)) #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> Void2 a b -> Void2 a b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Void2 a b -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Void2 a b -> r #

gmapQ :: (forall d. Data d => d -> u) -> Void2 a b -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Void2 a b -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Void2 a b -> m (Void2 a b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Void2 a b -> m (Void2 a b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Void2 a b -> m (Void2 a b) #

Ord (Void2 a b) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

compare :: Void2 a b -> Void2 a b -> Ordering #

(<) :: Void2 a b -> Void2 a b -> Bool #

(<=) :: Void2 a b -> Void2 a b -> Bool #

(>) :: Void2 a b -> Void2 a b -> Bool #

(>=) :: Void2 a b -> Void2 a b -> Bool #

max :: Void2 a b -> Void2 a b -> Void2 a b #

min :: Void2 a b -> Void2 a b -> Void2 a b #

Read (Void2 a b) Source # 
Instance details

Defined in Control.Applicative.Step

Show (Void2 a b) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

showsPrec :: Int -> Void2 a b -> ShowS #

show :: Void2 a b -> String #

showList :: [Void2 a b] -> ShowS #

Generic (Void2 a b) Source # 
Instance details

Defined in Control.Applicative.Step

Associated Types

type Rep (Void2 a b) :: Type -> Type #

Methods

from :: Void2 a b -> Rep (Void2 a b) x #

to :: Rep (Void2 a b) x -> Void2 a b #

Semigroup (Void2 a b) Source # 
Instance details

Defined in Control.Applicative.Step

Methods

(<>) :: Void2 a b -> Void2 a b -> Void2 a b #

sconcat :: NonEmpty (Void2 a b) -> Void2 a b #

stimes :: Integral b0 => b0 -> Void2 a b -> Void2 a b #

type Rep (Void2 a b) Source # 
Instance details

Defined in Control.Applicative.Step

type Rep (Void2 a b) = D1 ('MetaData "Void2" "Control.Applicative.Step" "functor-combinators-0.3.4.0-inplace" 'False) (V1 :: Type -> Type)

newtype Final c f a Source #

A simple way to inject/reject into any eventual typeclass.

In a way, this is the "ultimate" multi-purpose Interpret instance. You can use this to inject an f into a free structure of any typeclass. If you want f to have a Monad instance, for example, just use

inject :: f a -> Final Monad f a

When you want to eventually interpret out the data, use:

interpret :: (f ~> g) -> Final c f a -> g a

Essentially, Final c is the "free c". Final Monad is the free Monad, etc.

Final can theoretically replace Ap, Ap1, ListF, NonEmptyF, MaybeF, Free, Identity, Coyoneda, and other instances of FreeOf, if you don't care about being able to pattern match on explicit structure.

However, it cannot replace Interpret instances that are not free structures, like Step, Steps, Backwards, etc.

Note that this doesn't have instances for all the typeclasses you could lift things into; you probably have to define your own if you want to use Final c as an instance of c (using liftFinal0, liftFinal1, liftFinal2 for help).

Constructors

Final 

Fields

  • runFinal :: forall g. c g => (forall x. f x -> g x) -> g a
     

Instances

Instances details
HFunctor (Final c :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> Final c f ~> Final c g Source #

Inject (Final c :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

inject :: forall (f :: k0 -> Type). f ~> Final c f Source #

c f => Interpret (Final c :: (k -> Type) -> k -> Type) (f :: k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

retract :: Final c f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> Final c g ~> f Source #

MonadReader r (Final (MonadReader r) f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

ask :: Final (MonadReader r) f r #

local :: (r -> r) -> Final (MonadReader r) f a -> Final (MonadReader r) f a #

reader :: (r -> a) -> Final (MonadReader r) f a #

Monad (Final Monad f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(>>=) :: Final Monad f a -> (a -> Final Monad f b) -> Final Monad f b #

(>>) :: Final Monad f a -> Final Monad f b -> Final Monad f b #

return :: a -> Final Monad f a #

Monad (Final (MonadReader r) f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(>>=) :: Final (MonadReader r) f a -> (a -> Final (MonadReader r) f b) -> Final (MonadReader r) f b #

(>>) :: Final (MonadReader r) f a -> Final (MonadReader r) f b -> Final (MonadReader r) f b #

return :: a -> Final (MonadReader r) f a #

Monad (Final MonadPlus f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(>>=) :: Final MonadPlus f a -> (a -> Final MonadPlus f b) -> Final MonadPlus f b #

(>>) :: Final MonadPlus f a -> Final MonadPlus f b -> Final MonadPlus f b #

return :: a -> Final MonadPlus f a #

Functor (Final Monad f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final Monad f a -> Final Monad f b #

(<$) :: a -> Final Monad f b -> Final Monad f a #

Functor (Final Functor f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final Functor f a -> Final Functor f b #

(<$) :: a -> Final Functor f b -> Final Functor f a #

Functor (Final Applicative f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final Applicative f a -> Final Applicative f b #

(<$) :: a -> Final Applicative f b -> Final Applicative f a #

Functor (Final (MonadReader r) f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final (MonadReader r) f a -> Final (MonadReader r) f b #

(<$) :: a -> Final (MonadReader r) f b -> Final (MonadReader r) f a #

Functor (Final Alternative f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final Alternative f a -> Final Alternative f b #

(<$) :: a -> Final Alternative f b -> Final Alternative f a #

Functor (Final MonadPlus f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final MonadPlus f a -> Final MonadPlus f b #

(<$) :: a -> Final MonadPlus f b -> Final MonadPlus f a #

Functor (Final Apply f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final Apply f a -> Final Apply f b #

(<$) :: a -> Final Apply f b -> Final Apply f a #

Functor (Final Plus f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final Plus f a -> Final Plus f b #

(<$) :: a -> Final Plus f b -> Final Plus f a #

Functor (Final Alt f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final Alt f a -> Final Alt f b #

(<$) :: a -> Final Alt f b -> Final Alt f a #

Functor (Final Bind f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

fmap :: (a -> b) -> Final Bind f a -> Final Bind f b #

(<$) :: a -> Final Bind f b -> Final Bind f a #

Applicative (Final Monad f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

pure :: a -> Final Monad f a #

(<*>) :: Final Monad f (a -> b) -> Final Monad f a -> Final Monad f b #

liftA2 :: (a -> b -> c) -> Final Monad f a -> Final Monad f b -> Final Monad f c #

(*>) :: Final Monad f a -> Final Monad f b -> Final Monad f b #

(<*) :: Final Monad f a -> Final Monad f b -> Final Monad f a #

Applicative (Final Applicative f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

pure :: a -> Final Applicative f a #

(<*>) :: Final Applicative f (a -> b) -> Final Applicative f a -> Final Applicative f b #

liftA2 :: (a -> b -> c) -> Final Applicative f a -> Final Applicative f b -> Final Applicative f c #

(*>) :: Final Applicative f a -> Final Applicative f b -> Final Applicative f b #

(<*) :: Final Applicative f a -> Final Applicative f b -> Final Applicative f a #

Applicative (Final (MonadReader r) f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

pure :: a -> Final (MonadReader r) f a #

(<*>) :: Final (MonadReader r) f (a -> b) -> Final (MonadReader r) f a -> Final (MonadReader r) f b #

liftA2 :: (a -> b -> c) -> Final (MonadReader r) f a -> Final (MonadReader r) f b -> Final (MonadReader r) f c #

(*>) :: Final (MonadReader r) f a -> Final (MonadReader r) f b -> Final (MonadReader r) f b #

(<*) :: Final (MonadReader r) f a -> Final (MonadReader r) f b -> Final (MonadReader r) f a #

Applicative (Final Alternative f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

pure :: a -> Final Alternative f a #

(<*>) :: Final Alternative f (a -> b) -> Final Alternative f a -> Final Alternative f b #

liftA2 :: (a -> b -> c) -> Final Alternative f a -> Final Alternative f b -> Final Alternative f c #

(*>) :: Final Alternative f a -> Final Alternative f b -> Final Alternative f b #

(<*) :: Final Alternative f a -> Final Alternative f b -> Final Alternative f a #

Applicative (Final MonadPlus f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

pure :: a -> Final MonadPlus f a #

(<*>) :: Final MonadPlus f (a -> b) -> Final MonadPlus f a -> Final MonadPlus f b #

liftA2 :: (a -> b -> c) -> Final MonadPlus f a -> Final MonadPlus f b -> Final MonadPlus f c #

(*>) :: Final MonadPlus f a -> Final MonadPlus f b -> Final MonadPlus f b #

(<*) :: Final MonadPlus f a -> Final MonadPlus f b -> Final MonadPlus f a #

Contravariant (Final Contravariant f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

contramap :: (a -> b) -> Final Contravariant f b -> Final Contravariant f a #

(>$) :: b -> Final Contravariant f b -> Final Contravariant f a #

Contravariant (Final Divisible f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

contramap :: (a -> b) -> Final Divisible f b -> Final Divisible f a #

(>$) :: b -> Final Divisible f b -> Final Divisible f a #

Contravariant (Final Decidable f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

contramap :: (a -> b) -> Final Decidable f b -> Final Decidable f a #

(>$) :: b -> Final Decidable f b -> Final Decidable f a #

Contravariant (Final Divise f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

contramap :: (a -> b) -> Final Divise f b -> Final Divise f a #

(>$) :: b -> Final Divise f b -> Final Divise f a #

Contravariant (Final Decide f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

contramap :: (a -> b) -> Final Decide f b -> Final Decide f a #

(>$) :: b -> Final Decide f b -> Final Decide f a #

Contravariant (Final Conclude f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

contramap :: (a -> b) -> Final Conclude f b -> Final Conclude f a #

(>$) :: b -> Final Conclude f b -> Final Conclude f a #

Alternative (Final Alternative f) Source # 
Instance details

Defined in Data.HFunctor.Final

Alternative (Final MonadPlus f) Source # 
Instance details

Defined in Data.HFunctor.Final

MonadPlus (Final MonadPlus f) Source # 
Instance details

Defined in Data.HFunctor.Final

Divisible (Final Divisible f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

divide :: (a -> (b, c)) -> Final Divisible f b -> Final Divisible f c -> Final Divisible f a #

conquer :: Final Divisible f a #

Divisible (Final Decidable f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

divide :: (a -> (b, c)) -> Final Decidable f b -> Final Decidable f c -> Final Decidable f a #

conquer :: Final Decidable f a #

Decidable (Final Decidable f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

lose :: (a -> Void) -> Final Decidable f a #

choose :: (a -> Either b c) -> Final Decidable f b -> Final Decidable f c -> Final Decidable f a #

Invariant (Final Invariant f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

invmap :: (a -> b) -> (b -> a) -> Final Invariant f a -> Final Invariant f b #

Apply (Final Monad f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(<.>) :: Final Monad f (a -> b) -> Final Monad f a -> Final Monad f b #

(.>) :: Final Monad f a -> Final Monad f b -> Final Monad f b #

(<.) :: Final Monad f a -> Final Monad f b -> Final Monad f a #

liftF2 :: (a -> b -> c) -> Final Monad f a -> Final Monad f b -> Final Monad f c #

Apply (Final Applicative f) Source # 
Instance details

Defined in Data.HFunctor.Final

Apply (Final (MonadReader r) f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(<.>) :: Final (MonadReader r) f (a -> b) -> Final (MonadReader r) f a -> Final (MonadReader r) f b #

(.>) :: Final (MonadReader r) f a -> Final (MonadReader r) f b -> Final (MonadReader r) f b #

(<.) :: Final (MonadReader r) f a -> Final (MonadReader r) f b -> Final (MonadReader r) f a #

liftF2 :: (a -> b -> c) -> Final (MonadReader r) f a -> Final (MonadReader r) f b -> Final (MonadReader r) f c #

Apply (Final Alternative f) Source # 
Instance details

Defined in Data.HFunctor.Final

Apply (Final Apply f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(<.>) :: Final Apply f (a -> b) -> Final Apply f a -> Final Apply f b #

(.>) :: Final Apply f a -> Final Apply f b -> Final Apply f b #

(<.) :: Final Apply f a -> Final Apply f b -> Final Apply f a #

liftF2 :: (a -> b -> c) -> Final Apply f a -> Final Apply f b -> Final Apply f c #

Apply (Final Bind f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(<.>) :: Final Bind f (a -> b) -> Final Bind f a -> Final Bind f b #

(.>) :: Final Bind f a -> Final Bind f b -> Final Bind f b #

(<.) :: Final Bind f a -> Final Bind f b -> Final Bind f a #

liftF2 :: (a -> b -> c) -> Final Bind f a -> Final Bind f b -> Final Bind f c #

Pointed (Final Pointed f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

point :: a -> Final Pointed f a #

Plus (Final Alternative f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

zero :: Final Alternative f a #

Plus (Final MonadPlus f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

zero :: Final MonadPlus f a #

Plus (Final Plus f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

zero :: Final Plus f a #

Alt (Final Alternative f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Alt (Final MonadPlus f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Alt (Final Plus f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(<!>) :: Final Plus f a -> Final Plus f a -> Final Plus f a #

some :: Applicative (Final Plus f) => Final Plus f a -> Final Plus f [a] #

many :: Applicative (Final Plus f) => Final Plus f a -> Final Plus f [a] #

Alt (Final Alt f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(<!>) :: Final Alt f a -> Final Alt f a -> Final Alt f a #

some :: Applicative (Final Alt f) => Final Alt f a -> Final Alt f [a] #

many :: Applicative (Final Alt f) => Final Alt f a -> Final Alt f [a] #

Bind (Final Bind f) Source # 
Instance details

Defined in Data.HFunctor.Final

Methods

(>>-) :: Final Bind f a -> (a -> Final Bind f b) -> Final Bind f b #

join :: Final Bind f (Final Bind f a) -> Final Bind f a #

Divise (Final Divisible f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

divise :: (a -> (b, c)) -> Final Divisible f b -> Final Divisible f c -> Final Divisible f a Source #

Divise (Final Divise f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

divise :: (a -> (b, c)) -> Final Divise f b -> Final Divise f c -> Final Divise f a Source #

Decide (Final Decidable f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

decide :: (a -> Either b c) -> Final Decidable f b -> Final Decidable f c -> Final Decidable f a Source #

Decide (Final Decide f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

decide :: (a -> Either b c) -> Final Decide f b -> Final Decide f c -> Final Decide f a Source #

Decide (Final Conclude f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

decide :: (a -> Either b c) -> Final Conclude f b -> Final Conclude f c -> Final Conclude f a Source #

Conclude (Final Decidable f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

conclude :: (a -> Void) -> Final Decidable f a Source #

Conclude (Final Conclude f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

conclude :: (a -> Void) -> Final Conclude f a Source #

class FreeOf c t | t -> c where Source #

A typeclass associating a free structure with the typeclass it is free on.

This essentially lists instances of Interpret where a "trip" through Final will leave it unchanged.

fromFree . toFree == id
toFree . fromFree == id

This can be useful because Final doesn't have a concrete structure that you can pattern match on and inspect, but t might. This lets you work on a concrete structure if you desire.

Minimal complete definition

Nothing

Associated Types

type FreeFunctorBy t :: (Type -> Type) -> Constraint Source #

What "type" of functor is expected: should be either Unconstrained, Functor, Contravariant, or Invariant.

Since: 0.3.0.0

Methods

fromFree :: t f ~> Final c f Source #

default fromFree :: Interpret t (Final c f) => t f ~> Final c f Source #

toFree :: FreeFunctorBy t f => Final c f ~> t f Source #

default toFree :: (Inject t, c (t f)) => Final c f ~> t f Source #

Instances

Instances details
FreeOf Monad Free Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Free :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Free f ~> Final Monad f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Free f => Final Monad f ~> Free f Source #

FreeOf Functor Coyoneda Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Coyoneda :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Coyoneda f ~> Final Functor f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Coyoneda f => Final Functor f ~> Coyoneda f Source #

FreeOf Applicative Ap Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Ap :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Ap f ~> Final Applicative f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Ap f => Final Applicative f ~> Ap f Source #

FreeOf Applicative Ap Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Ap :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Ap f ~> Final Applicative f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Ap f => Final Applicative f ~> Ap f Source #

FreeOf Contravariant Coyoneda Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Coyoneda :: (Type -> Type) -> Constraint Source #

FreeOf Alternative Alt Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Alt :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Alt f ~> Final Alternative f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Alt f => Final Alternative f ~> Alt f Source #

FreeOf Divisible Div Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Div :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Div f ~> Final Divisible f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Div f => Final Divisible f ~> Div f Source #

FreeOf Apply Ap1 Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Ap1 :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Ap1 f ~> Final Apply f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Ap1 f => Final Apply f ~> Ap1 f Source #

FreeOf Pointed MaybeApply Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy MaybeApply :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). MaybeApply f ~> Final Pointed f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy MaybeApply f => Final Pointed f ~> MaybeApply f Source #

FreeOf Pointed Lift Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Lift :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Lift f ~> Final Pointed f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Lift f => Final Pointed f ~> Lift f Source #

FreeOf Bind Free1 Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Free1 :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Free1 f ~> Final Bind f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Free1 f => Final Bind f ~> Free1 f Source #

FreeOf Divise Div1 Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Div1 :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Div1 f ~> Final Divise f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Div1 f => Final Divise f ~> Div1 f Source #

FreeOf Decide Dec1 Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Dec1 :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Dec1 f ~> Final Decide f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Dec1 f => Final Decide f ~> Dec1 f Source #

FreeOf Conclude Dec Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy Dec :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). Dec f ~> Final Conclude f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy Dec f => Final Conclude f ~> Dec f Source #

FreeOf Plus (ListF :: (Type -> Type) -> Type -> Type) Source #

This could also be FreeOf Divisible if FreeFunctorBy ListF ~ Contravariant. However, there isn't really a way to express this at the moment.

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy ListF :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). ListF f ~> Final Plus f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy ListF f => Final Plus f ~> ListF f Source #

FreeOf Alt (NonEmptyF :: (Type -> Type) -> Type -> Type) Source #

This could also be FreeOf Divise if FreeFunctorBy NonEmptyF ~ Contravariant. However, there isn't really a way to express this at the moment.

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy NonEmptyF :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). NonEmptyF f ~> Final Alt f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy NonEmptyF f => Final Alt f ~> NonEmptyF f Source #

FreeOf (Unconstrained :: (Type -> Type) -> Constraint) (IdentityT :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy IdentityT :: (Type -> Type) -> Constraint Source #

newtype ComposeT (f :: (Type -> Type) -> Type -> Type) (g :: (Type -> Type) -> Type -> Type) (m :: Type -> Type) a infixr 9 #

Composition of monad transformers.

Constructors

ComposeT infixr 9 

Fields

Instances

Instances details
MonadRWS r w s (f (g m)) => MonadRWS r w s (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

MonadReader r (f (g m)) => MonadReader r (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

ask :: ComposeT f g m r #

local :: (r -> r) -> ComposeT f g m a -> ComposeT f g m a #

reader :: (r -> a) -> ComposeT f g m a #

MonadState s (f (g m)) => MonadState s (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

get :: ComposeT f g m s #

put :: s -> ComposeT f g m () #

state :: (s -> (a, s)) -> ComposeT f g m a #

MonadWriter w (f (g m)) => MonadWriter w (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

writer :: (a, w) -> ComposeT f g m a #

tell :: w -> ComposeT f g m () #

listen :: ComposeT f g m a -> ComposeT f g m (a, w) #

pass :: ComposeT f g m (a, w -> w) -> ComposeT f g m a #

MonadError e (f (g m)) => MonadError e (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

throwError :: e -> ComposeT f g m a #

catchError :: ComposeT f g m a -> (e -> ComposeT f g m a) -> ComposeT f g m a #

(HFunctor s, HFunctor t) => HFunctor (ComposeT s t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f :: k -> Type) (g :: k -> Type). (f ~> g) -> ComposeT s t f ~> ComposeT s t g Source #

(MFunctor f, MFunctor g, forall (m :: Type -> Type). Monad m => Monad (g m)) => MFunctor (ComposeT f g :: (Type -> Type) -> Type -> Type) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

hoist :: forall m n (b :: k). Monad m => (forall a. m a -> n a) -> ComposeT f g m b -> ComposeT f g n b #

(Inject s, Inject t) => Inject (ComposeT s t :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k -> Type). f ~> ComposeT s t f Source #

(Interpret s f, Interpret t f) => Interpret (ComposeT s t :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: ComposeT s t f ~> f Source #

interpret :: forall (g :: k -> Type). (g ~> f) -> ComposeT s t g ~> f Source #

(MFunctor f, MonadTrans f, MonadTrans g) => MonadTrans (ComposeT f g) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

lift :: Monad m => m a -> ComposeT f g m a #

Monad (f (g m)) => Monad (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

(>>=) :: ComposeT f g m a -> (a -> ComposeT f g m b) -> ComposeT f g m b #

(>>) :: ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m b #

return :: a -> ComposeT f g m a #

Functor (f (g m)) => Functor (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

fmap :: (a -> b) -> ComposeT f g m a -> ComposeT f g m b #

(<$) :: a -> ComposeT f g m b -> ComposeT f g m a #

MonadFail (f (g m)) => MonadFail (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

fail :: String -> ComposeT f g m a #

Applicative (f (g m)) => Applicative (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

pure :: a -> ComposeT f g m a #

(<*>) :: ComposeT f g m (a -> b) -> ComposeT f g m a -> ComposeT f g m b #

liftA2 :: (a -> b -> c) -> ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m c #

(*>) :: ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m b #

(<*) :: ComposeT f g m a -> ComposeT f g m b -> ComposeT f g m a #

Foldable (f (g m)) => Foldable (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

fold :: Monoid m0 => ComposeT f g m m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> ComposeT f g m a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> ComposeT f g m a -> m0 #

foldr :: (a -> b -> b) -> b -> ComposeT f g m a -> b #

foldr' :: (a -> b -> b) -> b -> ComposeT f g m a -> b #

foldl :: (b -> a -> b) -> b -> ComposeT f g m a -> b #

foldl' :: (b -> a -> b) -> b -> ComposeT f g m a -> b #

foldr1 :: (a -> a -> a) -> ComposeT f g m a -> a #

foldl1 :: (a -> a -> a) -> ComposeT f g m a -> a #

toList :: ComposeT f g m a -> [a] #

null :: ComposeT f g m a -> Bool #

length :: ComposeT f g m a -> Int #

elem :: Eq a => a -> ComposeT f g m a -> Bool #

maximum :: Ord a => ComposeT f g m a -> a #

minimum :: Ord a => ComposeT f g m a -> a #

sum :: Num a => ComposeT f g m a -> a #

product :: Num a => ComposeT f g m a -> a #

Traversable (f (g m)) => Traversable (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ComposeT f g m a -> f0 (ComposeT f g m b) #

sequenceA :: Applicative f0 => ComposeT f g m (f0 a) -> f0 (ComposeT f g m a) #

mapM :: Monad m0 => (a -> m0 b) -> ComposeT f g m a -> m0 (ComposeT f g m b) #

sequence :: Monad m0 => ComposeT f g m (m0 a) -> m0 (ComposeT f g m a) #

MonadIO (f (g m)) => MonadIO (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

liftIO :: IO a -> ComposeT f g m a #

Alternative (f (g m)) => Alternative (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

empty :: ComposeT f g m a #

(<|>) :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a #

some :: ComposeT f g m a -> ComposeT f g m [a] #

many :: ComposeT f g m a -> ComposeT f g m [a] #

MonadPlus (f (g m)) => MonadPlus (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

mzero :: ComposeT f g m a #

mplus :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a #

MonadCont (f (g m)) => MonadCont (ComposeT f g m) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

callCC :: ((a -> ComposeT f g m b) -> ComposeT f g m a) -> ComposeT f g m a #

Eq (f (g m) a) => Eq (ComposeT f g m a) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

(==) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

(/=) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

Ord (f (g m) a) => Ord (ComposeT f g m a) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

compare :: ComposeT f g m a -> ComposeT f g m a -> Ordering #

(<) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

(<=) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

(>) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

(>=) :: ComposeT f g m a -> ComposeT f g m a -> Bool #

max :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a #

min :: ComposeT f g m a -> ComposeT f g m a -> ComposeT f g m a #

Read (f (g m) a) => Read (ComposeT f g m a) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

readsPrec :: Int -> ReadS (ComposeT f g m a) #

readList :: ReadS [ComposeT f g m a] #

readPrec :: ReadPrec (ComposeT f g m a) #

readListPrec :: ReadPrec [ComposeT f g m a] #

Show (f (g m) a) => Show (ComposeT f g m a) 
Instance details

Defined in Control.Monad.Trans.Compose

Methods

showsPrec :: Int -> ComposeT f g m a -> ShowS #

show :: ComposeT f g m a -> String #

showList :: [ComposeT f g m a] -> ShowS #

Multi

data Day (f :: Type -> Type) (g :: Type -> Type) a #

The Day convolution of two covariant functors.

Constructors

Day (f b) (g c) (b -> c -> a) 

Instances

Instances details
Associative Day Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Day :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Day :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Day f, FunctorBy Day g, FunctorBy Day h) => Day f (Day g h) <~> Day (Day f g) h Source #

appendNE :: forall (f :: Type -> Type). Day (NonEmptyBy Day f) (NonEmptyBy Day f) ~> NonEmptyBy Day f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Day f => NonEmptyBy Day f ~> (f :+: Day f (NonEmptyBy Day f)) Source #

consNE :: forall (f :: Type -> Type). Day f (NonEmptyBy Day f) ~> NonEmptyBy Day f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Day f f ~> NonEmptyBy Day f Source #

Apply f => SemigroupIn Day f Source #

Instances of Apply are semigroups in the semigroupoidal category on Day.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Day f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Day g h ~> f Source #

Tensor Day Identity Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Day :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Day f Identity Source #

intro2 :: forall (g :: Type -> Type). g ~> Day Identity g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Day f => Day f Identity ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Day g => Day Identity g ~> g Source #

appendLB :: forall (f :: Type -> Type). Day (ListBy Day f) (ListBy Day f) ~> ListBy Day f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Day f ~> Day f (ListBy Day f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Day f <~> (Identity :+: Day f (ListBy Day f)) Source #

toListBy :: forall (f :: Type -> Type). Day f f ~> ListBy Day f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Day f ~> ListBy Day f Source #

Matchable Day Identity Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

unsplitNE :: forall (f :: Type -> Type). FunctorBy Day f => Day f (ListBy Day f) ~> NonEmptyBy Day f Source #

matchLB :: forall (f :: Type -> Type). FunctorBy Day f => ListBy Day f ~> (Identity :+: NonEmptyBy Day f) Source #

(Apply f, Applicative f) => MonoidIn Day Identity f Source #

Instances of Applicative are monoids in the monoidal category on the covariant Day.

Note that because of typeclass constraints, this requires Apply as well as Applicative. But, you can get a "local" instance of Apply for any Applicative using unsafeApply.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Identity ~> f Source #

Comonad f => ComonadTrans (Day f) 
Instance details

Defined in Data.Functor.Day

Methods

lower :: Comonad w => Day f w a -> w a #

HBifunctor Day Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Day f g ~> Day j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Day f g ~> Day f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Day f g ~> Day j l Source #

HFunctor (Day f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> Day f f0 ~> Day f g Source #

Functor (Day f g) 
Instance details

Defined in Data.Functor.Day

Methods

fmap :: (a -> b) -> Day f g a -> Day f g b #

(<$) :: a -> Day f g b -> Day f g a #

(Applicative f, Applicative g) => Applicative (Day f g) 
Instance details

Defined in Data.Functor.Day

Methods

pure :: a -> Day f g a #

(<*>) :: Day f g (a -> b) -> Day f g a -> Day f g b #

liftA2 :: (a -> b -> c) -> Day f g a -> Day f g b -> Day f g c #

(*>) :: Day f g a -> Day f g b -> Day f g b #

(<*) :: Day f g a -> Day f g b -> Day f g a #

(Representable f, Representable g) => Distributive (Day f g) 
Instance details

Defined in Data.Functor.Day

Methods

distribute :: Functor f0 => f0 (Day f g a) -> Day f g (f0 a) #

collect :: Functor f0 => (a -> Day f g b) -> f0 a -> Day f g (f0 b) #

distributeM :: Monad m => m (Day f g a) -> Day f g (m a) #

collectM :: Monad m => (a -> Day f g b) -> m a -> Day f g (m b) #

(Representable f, Representable g) => Representable (Day f g) 
Instance details

Defined in Data.Functor.Day

Associated Types

type Rep (Day f g) #

Methods

tabulate :: (Rep (Day f g) -> a) -> Day f g a #

index :: Day f g a -> Rep (Day f g) -> a #

(Comonad f, Comonad g) => Comonad (Day f g) 
Instance details

Defined in Data.Functor.Day

Methods

extract :: Day f g a -> a #

duplicate :: Day f g a -> Day f g (Day f g a) #

extend :: (Day f g a -> b) -> Day f g a -> Day f g b #

(ComonadApply f, ComonadApply g) => ComonadApply (Day f g) 
Instance details

Defined in Data.Functor.Day

Methods

(<@>) :: Day f g (a -> b) -> Day f g a -> Day f g b #

(@>) :: Day f g a -> Day f g b -> Day f g b #

(<@) :: Day f g a -> Day f g b -> Day f g a #

Functor f => Apply (Chain1 Day f) Source #

Chain1 Day is the free "semigroup in the semigroupoidal category of endofunctors enriched by Day" --- aka, the free Apply.

Instance details

Defined in Data.HFunctor.Chain

Methods

(<.>) :: Chain1 Day f (a -> b) -> Chain1 Day f a -> Chain1 Day f b #

(.>) :: Chain1 Day f a -> Chain1 Day f b -> Chain1 Day f b #

(<.) :: Chain1 Day f a -> Chain1 Day f b -> Chain1 Day f a #

liftF2 :: (a -> b -> c) -> Chain1 Day f a -> Chain1 Day f b -> Chain1 Day f c #

Applicative (Chain Day Identity f) Source #

Chain Day Identity is the free "monoid in the monoidal category of endofunctors enriched by Day" --- aka, the free Applicative.

Instance details

Defined in Data.HFunctor.Chain

Methods

pure :: a -> Chain Day Identity f a #

(<*>) :: Chain Day Identity f (a -> b) -> Chain Day Identity f a -> Chain Day Identity f b #

liftA2 :: (a -> b -> c) -> Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f c #

(*>) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f b #

(<*) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f a #

Apply (Chain Day Identity f) Source # 
Instance details

Defined in Data.HFunctor.Chain

Methods

(<.>) :: Chain Day Identity f (a -> b) -> Chain Day Identity f a -> Chain Day Identity f b #

(.>) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f b #

(<.) :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f a #

liftF2 :: (a -> b -> c) -> Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f c #

type NonEmptyBy Day Source # 
Instance details

Defined in Data.HBifunctor.Associative

type FunctorBy Day Source # 
Instance details

Defined in Data.HBifunctor.Associative

type ListBy Day Source # 
Instance details

Defined in Data.HBifunctor.Tensor

type ListBy Day = Ap
type Rep (Day f g) 
Instance details

Defined in Data.Functor.Day

type Rep (Day f g) = (Rep f, Rep g)

data ((f :: k -> Type) :*: (g :: k -> Type)) (p :: k) infixr 6 #

Products: encode multiple arguments to constructors

Constructors

(f p) :*: (g p) infixr 6 

Instances

Instances details
HFunctor ((:*:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> (f :*: f0) ~> (f :*: g) Source #

HBifunctor ((:*:) :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> (f :*: g) ~> (j :*: g) Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> (f :*: g) ~> (f :*: l) Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> (f :*: g) ~> (j :*: l) Source #

Generic1 (f :*: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (f :*: g) :: k -> Type #

Methods

from1 :: forall (a :: k0). (f :*: g) a -> Rep1 (f :*: g) a #

to1 :: forall (a :: k0). Rep1 (f :*: g) a -> (f :*: g) a #

Associative ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy (:*:) :: (Type -> Type) -> Type -> Type Source #

type FunctorBy (:*:) :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy (:*:) f, FunctorBy (:*:) g, FunctorBy (:*:) h) => (f :*: (g :*: h)) <~> ((f :*: g) :*: h) Source #

appendNE :: forall (f :: Type -> Type). (NonEmptyBy (:*:) f :*: NonEmptyBy (:*:) f) ~> NonEmptyBy (:*:) f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy (:*:) f => NonEmptyBy (:*:) f ~> (f :+: (f :*: NonEmptyBy (:*:) f)) Source #

consNE :: forall (f :: Type -> Type). (f :*: NonEmptyBy (:*:) f) ~> NonEmptyBy (:*:) f Source #

toNonEmptyBy :: forall (f :: Type -> Type). (f :*: f) ~> NonEmptyBy (:*:) f Source #

Alt f => SemigroupIn ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

Instances of Alt are semigroups in the semigroupoidal category on :*:.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: (f :*: f) ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> (g :*: h) ~> f Source #

Tensor ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy (:*:) :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> (f :*: Proxy) Source #

intro2 :: forall (g :: Type -> Type). g ~> (Proxy :*: g) Source #

elim1 :: forall (f :: Type -> Type). FunctorBy (:*:) f => (f :*: Proxy) ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy (:*:) g => (Proxy :*: g) ~> g Source #

appendLB :: forall (f :: Type -> Type). (ListBy (:*:) f :*: ListBy (:*:) f) ~> ListBy (:*:) f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy (:*:) f ~> (f :*: ListBy (:*:) f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy (:*:) f <~> (Proxy :+: (f :*: ListBy (:*:) f)) Source #

toListBy :: forall (f :: Type -> Type). (f :*: f) ~> ListBy (:*:) f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy (:*:) f ~> ListBy (:*:) f Source #

Matchable ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

unsplitNE :: forall (f :: Type -> Type). FunctorBy (:*:) f => (f :*: ListBy (:*:) f) ~> NonEmptyBy (:*:) f Source #

matchLB :: forall (f :: Type -> Type). FunctorBy (:*:) f => ListBy (:*:) f ~> (Proxy :+: NonEmptyBy (:*:) f) Source #

Plus f => MonoidIn ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f Source #

Instances of Plus are monoids in the monoidal category on :*:.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Proxy ~> f Source #

Plus f => HBind ((:*:) f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> (f :*: g)) -> (f :*: f0) ~> (f :*: g) Source #

hjoin :: forall (f0 :: k -> Type). (f :*: (f :*: f0)) ~> (f :*: f0) Source #

Plus f => Inject ((:*:) f :: (Type -> Type) -> Type -> Type) Source #

Only uses zero

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k -> Type). f0 ~> (f :*: f0) Source #

Plus g => Interpret ((:*:) g :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: (g :*: f) ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> (g :*: g0) ~> f Source #

(Monad f, Monad g) => Monad (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b #

(>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #

return :: a -> (f :*: g) a #

(Functor f, Functor g) => Functor (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b #

(<$) :: a -> (f :*: g) b -> (f :*: g) a #

(MonadFix f, MonadFix g) => MonadFix (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fix

Methods

mfix :: (a -> (f :*: g) a) -> (f :*: g) a #

(Applicative f, Applicative g) => Applicative (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> (f :*: g) a #

(<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b #

liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c #

(*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #

(<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a #

(Foldable f, Foldable g) => Foldable (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (f :*: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m #

foldMap' :: Monoid m => (a -> m) -> (f :*: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :*: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :*: g) a -> a #

toList :: (f :*: g) a -> [a] #

null :: (f :*: g) a -> Bool #

length :: (f :*: g) a -> Int #

elem :: Eq a => a -> (f :*: g) a -> Bool #

maximum :: Ord a => (f :*: g) a -> a #

minimum :: Ord a => (f :*: g) a -> a #

sum :: Num a => (f :*: g) a -> a #

product :: Num a => (f :*: g) a -> a #

(Traversable f, Traversable g) => Traversable (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #

sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((f :*: g) a) #

mapM :: Monad m => (a -> m b) -> (f :*: g) a -> m ((f :*: g) b) #

sequence :: Monad m => (f :*: g) (m a) -> m ((f :*: g) a) #

(Contravariant f, Contravariant g) => Contravariant (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> (f :*: g) b -> (f :*: g) a #

(>$) :: b -> (f :*: g) b -> (f :*: g) a #

(Representable f, Representable g) => Representable (f :*: g) 
Instance details

Defined in Data.Functor.Rep

Associated Types

type Rep (f :*: g) #

Methods

tabulate :: (Rep (f :*: g) -> a) -> (f :*: g) a #

index :: (f :*: g) a -> Rep (f :*: g) -> a #

(Representable f, Representable g) => Representable (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant.Rep

Associated Types

type Rep (f :*: g) #

Methods

tabulate :: (a -> Rep (f :*: g)) -> (f :*: g) a #

index :: (f :*: g) a -> a -> Rep (f :*: g) #

contramapWithRep :: (b -> Either a (Rep (f :*: g))) -> (f :*: g) a -> (f :*: g) b #

(Alternative f, Alternative g) => Alternative (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

empty :: (f :*: g) a #

(<|>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #

some :: (f :*: g) a -> (f :*: g) [a] #

many :: (f :*: g) a -> (f :*: g) [a] #

(MonadPlus f, MonadPlus g) => MonadPlus (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

mzero :: (f :*: g) a #

mplus :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #

(Divisible f, Divisible g) => Divisible (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

divide :: (a -> (b, c)) -> (f :*: g) b -> (f :*: g) c -> (f :*: g) a #

conquer :: (f :*: g) a #

(Decidable f, Decidable g) => Decidable (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant.Divisible

Methods

lose :: (a -> Void) -> (f :*: g) a #

choose :: (a -> Either b c) -> (f :*: g) b -> (f :*: g) c -> (f :*: g) a #

(Invariant l, Invariant r) => Invariant (l :*: r)

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> (l :*: r) a -> (l :*: r) b #

(Foldable1 f, Foldable1 g) => Foldable1 (f :*: g) 
Instance details

Defined in Data.Semigroup.Foldable.Class

Methods

fold1 :: Semigroup m => (f :*: g) m -> m #

foldMap1 :: Semigroup m => (a -> m) -> (f :*: g) a -> m #

toNonEmpty :: (f :*: g) a -> NonEmpty a #

(Apply f, Apply g) => Apply (f :*: g) 
Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b #

(.>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #

(<.) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a #

liftF2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c #

(Pointed f, Pointed g) => Pointed (f :*: g) 
Instance details

Defined in Data.Pointed

Methods

point :: a -> (f :*: g) a #

(Traversable1 f, Traversable1 g) => Traversable1 (f :*: g) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #

sequence1 :: Apply f0 => (f :*: g) (f0 b) -> f0 ((f :*: g) b) #

(Plus f, Plus g) => Plus (f :*: g) 
Instance details

Defined in Data.Functor.Plus

Methods

zero :: (f :*: g) a #

(Alt f, Alt g) => Alt (f :*: g) 
Instance details

Defined in Data.Functor.Alt

Methods

(<!>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #

some :: Applicative (f :*: g) => (f :*: g) a -> (f :*: g) [a] #

many :: Applicative (f :*: g) => (f :*: g) a -> (f :*: g) [a] #

Functor f => Alt (Chain1 ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source #

Chain1 (:*:) is the free "semigroup in the semigroupoidal category of endofunctors enriched by :*:" --- aka, the free Alt.

Instance details

Defined in Data.HFunctor.Chain

Methods

(<!>) :: Chain1 (:*:) f a -> Chain1 (:*:) f a -> Chain1 (:*:) f a #

some :: Applicative (Chain1 (:*:) f) => Chain1 (:*:) f a -> Chain1 (:*:) f [a] #

many :: Applicative (Chain1 (:*:) f) => Chain1 (:*:) f a -> Chain1 (:*:) f [a] #

(GIndex f, GIndex g) => GIndex (f :*: g) 
Instance details

Defined in Data.Functor.Rep

Methods

gindex' :: (f :*: g) a -> GRep' (f :*: g) -> a

(GTabulate f, GTabulate g) => GTabulate (f :*: g) 
Instance details

Defined in Data.Functor.Rep

Methods

gtabulate' :: (GRep' (f :*: g) -> a) -> (f :*: g) a

(Divise f, Divise g) => Divise (f :*: g) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divise

Methods

divise :: (a -> (b, c)) -> (f :*: g) b -> (f :*: g) c -> (f :*: g) a Source #

(Decide f, Decide g) => Decide (f :*: g) Source # 
Instance details

Defined in Data.Functor.Contravariant.Decide

Methods

decide :: (a -> Either b c) -> (f :*: g) b -> (f :*: g) c -> (f :*: g) a Source #

(Conclude f, Conclude g) => Conclude (f :*: g) Source # 
Instance details

Defined in Data.Functor.Contravariant.Conclude

Methods

conclude :: (a -> Void) -> (f :*: g) a Source #

(Eq (f p), Eq (g p)) => Eq ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: (f :*: g) p -> (f :*: g) p -> Bool #

(/=) :: (f :*: g) p -> (f :*: g) p -> Bool #

(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((f :*: g) p)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> (f :*: g) p -> c ((f :*: g) p) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ((f :*: g) p) #

toConstr :: (f :*: g) p -> Constr #

dataTypeOf :: (f :*: g) p -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ((f :*: g) p)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ((f :*: g) p)) #

gmapT :: (forall b. Data b => b -> b) -> (f :*: g) p -> (f :*: g) p #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (f :*: g) p -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (f :*: g) p -> r #

gmapQ :: (forall d. Data d => d -> u) -> (f :*: g) p -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> (f :*: g) p -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :*: g) p -> m ((f :*: g) p) #

(Ord (f p), Ord (g p)) => Ord ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: (f :*: g) p -> (f :*: g) p -> Ordering #

(<) :: (f :*: g) p -> (f :*: g) p -> Bool #

(<=) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>=) :: (f :*: g) p -> (f :*: g) p -> Bool #

max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

(Read (f p), Read (g p)) => Read ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: Int -> ReadS ((f :*: g) p) #

readList :: ReadS [(f :*: g) p] #

readPrec :: ReadPrec ((f :*: g) p) #

readListPrec :: ReadPrec [(f :*: g) p] #

(Show (f p), Show (g p)) => Show ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> (f :*: g) p -> ShowS #

show :: (f :*: g) p -> String #

showList :: [(f :*: g) p] -> ShowS #

Generic ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :*: g) p) :: Type -> Type #

Methods

from :: (f :*: g) p -> Rep ((f :*: g) p) x #

to :: Rep ((f :*: g) p) x -> (f :*: g) p #

(Semigroup (f p), Semigroup (g p)) => Semigroup ((f :*: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

sconcat :: NonEmpty ((f :*: g) p) -> (f :*: g) p #

stimes :: Integral b => b -> (f :*: g) p -> (f :*: g) p #

(Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: (f :*: g) p #

mappend :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

mconcat :: [(f :*: g) p] -> (f :*: g) p #

Functor f => Plus (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source #

Chain (:*:) Proxy is the free "monoid in the monoidal category of endofunctors enriched by :*:" --- aka, the free Plus.

Instance details

Defined in Data.HFunctor.Chain

Methods

zero :: Chain (:*:) Proxy f a #

Functor f => Alt (Chain ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (Proxy :: Type -> Type) f) Source # 
Instance details

Defined in Data.HFunctor.Chain

type Rep1 (f :*: g :: k -> Type) 
Instance details

Defined in GHC.Generics

type NonEmptyBy ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type NonEmptyBy ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = NonEmptyF :: (Type -> Type) -> Type -> Type
type FunctorBy ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type FunctorBy ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Unconstrained :: (Type -> Type) -> Constraint
type ListBy ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

type ListBy ((:*:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = ListF :: (Type -> Type) -> Type -> Type
type Rep (f :*: g) 
Instance details

Defined in Data.Functor.Rep

type Rep (f :*: g) = Either (Rep f) (Rep g)
type Rep (f :*: g) 
Instance details

Defined in Data.Functor.Contravariant.Rep

type Rep (f :*: g) = (Rep f, Rep g)
type GRep' (f :*: g) 
Instance details

Defined in Data.Functor.Rep

type GRep' (f :*: g) = Either (GRep' f) (GRep' g)
type Rep ((f :*: g) p) 
Instance details

Defined in GHC.Generics

prodOutL :: (f :*: g) ~> f Source #

A poly-kinded version of outL for :*:.

prodOutR :: (f :*: g) ~> g Source #

A poly-kinded version of outR for :*:.

data ((f :: k -> Type) :+: (g :: k -> Type)) (p :: k) infixr 5 #

Sums: encode choice between constructors

Constructors

L1 (f p) 
R1 (g p) 

Instances

Instances details
HFunctor ((:+:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> (f :+: f0) ~> (f :+: g) Source #

HBifunctor ((:+:) :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> (f :+: g) ~> (j :+: g) Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> (f :+: g) ~> (f :+: l) Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> (f :+: g) ~> (j :+: l) Source #

HBind ((:+:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> (f :+: g)) -> (f :+: f0) ~> (f :+: g) Source #

hjoin :: forall (f0 :: k0 -> Type). (f :+: (f :+: f0)) ~> (f :+: f0) Source #

Inject ((:+:) f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k0 -> Type). f0 ~> (f :+: f0) Source #

Generic1 (f :+: g :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (f :+: g) :: k -> Type #

Methods

from1 :: forall (a :: k0). (f :+: g) a -> Rep1 (f :+: g) a #

to1 :: forall (a :: k0). Rep1 (f :+: g) a -> (f :+: g) a #

(GSum arity a, GSum arity b) => GSum arity (a :+: b) 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

hashSum :: HashArgs arity a0 -> Int -> Int -> (a :+: b) a0 -> Int

Associative ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy (:+:) :: (Type -> Type) -> Type -> Type Source #

type FunctorBy (:+:) :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy (:+:) f, FunctorBy (:+:) g, FunctorBy (:+:) h) => (f :+: (g :+: h)) <~> ((f :+: g) :+: h) Source #

appendNE :: forall (f :: Type -> Type). (NonEmptyBy (:+:) f :+: NonEmptyBy (:+:) f) ~> NonEmptyBy (:+:) f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy (:+:) f => NonEmptyBy (:+:) f ~> (f :+: (f :+: NonEmptyBy (:+:) f)) Source #

consNE :: forall (f :: Type -> Type). (f :+: NonEmptyBy (:+:) f) ~> NonEmptyBy (:+:) f Source #

toNonEmptyBy :: forall (f :: Type -> Type). (f :+: f) ~> NonEmptyBy (:+:) f Source #

SemigroupIn ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

All functors are semigroups in the semigroupoidal category on :+:.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: (f :+: f) ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> (g :+: h) ~> f Source #

Tensor ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy (:+:) :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> (f :+: V1) Source #

intro2 :: forall (g :: Type -> Type). g ~> (V1 :+: g) Source #

elim1 :: forall (f :: Type -> Type). FunctorBy (:+:) f => (f :+: V1) ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy (:+:) g => (V1 :+: g) ~> g Source #

appendLB :: forall (f :: Type -> Type). (ListBy (:+:) f :+: ListBy (:+:) f) ~> ListBy (:+:) f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy (:+:) f ~> (f :+: ListBy (:+:) f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy (:+:) f <~> (V1 :+: (f :+: ListBy (:+:) f)) Source #

toListBy :: forall (f :: Type -> Type). (f :+: f) ~> ListBy (:+:) f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy (:+:) f ~> ListBy (:+:) f Source #

Matchable ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

unsplitNE :: forall (f :: Type -> Type). FunctorBy (:+:) f => (f :+: ListBy (:+:) f) ~> NonEmptyBy (:+:) f Source #

matchLB :: forall (f :: Type -> Type). FunctorBy (:+:) f => ListBy (:+:) f ~> (V1 :+: NonEmptyBy (:+:) f) Source #

MonoidIn ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) f Source #

All functors are monoids in the monoidal category on :+:.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: V1 ~> f Source #

Plus f => Interpret ((:+:) g :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

Technically, f is over-constrained: we only need zero :: f a, but we don't really have that typeclass in any standard hierarchies. We use Plus here instead, but we never use <!>. This would only go wrong in situations where your type supports zero but not <!>, like instances of MonadFail without MonadPlus.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: (g :+: f) ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> (g :+: g0) ~> f Source #

(Functor f, Functor g) => Functor (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b #

(<$) :: a -> (f :+: g) b -> (f :+: g) a #

(Foldable f, Foldable g) => Foldable (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (f :+: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m #

foldMap' :: Monoid m => (a -> m) -> (f :+: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :+: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :+: g) a -> a #

toList :: (f :+: g) a -> [a] #

null :: (f :+: g) a -> Bool #

length :: (f :+: g) a -> Int #

elem :: Eq a => a -> (f :+: g) a -> Bool #

maximum :: Ord a => (f :+: g) a -> a #

minimum :: Ord a => (f :+: g) a -> a #

sum :: Num a => (f :+: g) a -> a #

product :: Num a => (f :+: g) a -> a #

(Traversable f, Traversable g) => Traversable (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #

sequenceA :: Applicative f0 => (f :+: g) (f0 a) -> f0 ((f :+: g) a) #

mapM :: Monad m => (a -> m b) -> (f :+: g) a -> m ((f :+: g) b) #

sequence :: Monad m => (f :+: g) (m a) -> m ((f :+: g) a) #

(Contravariant f, Contravariant g) => Contravariant (f :+: g) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> (f :+: g) b -> (f :+: g) a #

(>$) :: b -> (f :+: g) b -> (f :+: g) a #

(Invariant l, Invariant r) => Invariant (l :+: r)

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> (l :+: r) a -> (l :+: r) b #

(Foldable1 f, Foldable1 g) => Foldable1 (f :+: g) 
Instance details

Defined in Data.Semigroup.Foldable.Class

Methods

fold1 :: Semigroup m => (f :+: g) m -> m #

foldMap1 :: Semigroup m => (a -> m) -> (f :+: g) a -> m #

toNonEmpty :: (f :+: g) a -> NonEmpty a #

(Traversable1 f, Traversable1 g) => Traversable1 (f :+: g) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #

sequence1 :: Apply f0 => (f :+: g) (f0 b) -> f0 ((f :+: g) b) #

(SumSize a, SumSize b) => SumSize (a :+: b) 
Instance details

Defined in Data.Hashable.Generic.Instances

Methods

sumSize :: Tagged (a :+: b)

(GSumGet a, GSumGet b) => GSumGet (a :+: b) 
Instance details

Defined in Data.Binary.Generic

Methods

getSum :: (Ord word, Num word, Bits word) => word -> word -> Get ((a :+: b) a0)

(SumSize a, SumSize b) => SumSize (a :+: b) 
Instance details

Defined in Data.Binary.Generic

Methods

sumSize :: Tagged (a :+: b) Word64

(GSumPut a, GSumPut b) => GSumPut (a :+: b) 
Instance details

Defined in Data.Binary.Generic

Methods

putSum :: (Num w, Bits w, Binary w) => w -> w -> (a :+: b) a0 -> Put

(Eq (f p), Eq (g p)) => Eq ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: (f :+: g) p -> (f :+: g) p -> Bool #

(/=) :: (f :+: g) p -> (f :+: g) p -> Bool #

(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((f :+: g) p)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> (f :+: g) p -> c ((f :+: g) p) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ((f :+: g) p) #

toConstr :: (f :+: g) p -> Constr #

dataTypeOf :: (f :+: g) p -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ((f :+: g) p)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ((f :+: g) p)) #

gmapT :: (forall b. Data b => b -> b) -> (f :+: g) p -> (f :+: g) p #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> (f :+: g) p -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> (f :+: g) p -> r #

gmapQ :: (forall d. Data d => d -> u) -> (f :+: g) p -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> (f :+: g) p -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> (f :+: g) p -> m ((f :+: g) p) #

(Ord (f p), Ord (g p)) => Ord ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: (f :+: g) p -> (f :+: g) p -> Ordering #

(<) :: (f :+: g) p -> (f :+: g) p -> Bool #

(<=) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>=) :: (f :+: g) p -> (f :+: g) p -> Bool #

max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

(Read (f p), Read (g p)) => Read ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: Int -> ReadS ((f :+: g) p) #

readList :: ReadS [(f :+: g) p] #

readPrec :: ReadPrec ((f :+: g) p) #

readListPrec :: ReadPrec [(f :+: g) p] #

(Show (f p), Show (g p)) => Show ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> (f :+: g) p -> ShowS #

show :: (f :+: g) p -> String #

showList :: [(f :+: g) p] -> ShowS #

Generic ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ((f :+: g) p) :: Type -> Type #

Methods

from :: (f :+: g) p -> Rep ((f :+: g) p) x #

to :: Rep ((f :+: g) p) x -> (f :+: g) p #

type Rep1 (f :+: g :: k -> Type) 
Instance details

Defined in GHC.Generics

type NonEmptyBy ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type NonEmptyBy ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Step :: (Type -> Type) -> Type -> Type
type FunctorBy ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type FunctorBy ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Unconstrained :: (Type -> Type) -> Constraint
type ListBy ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

type ListBy ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Step :: (Type -> Type) -> Type -> Type
type Rep ((f :+: g) p) 
Instance details

Defined in GHC.Generics

data V1 (p :: k) #

Void: used for datatypes without constructors

Instances

Instances details
Generic1 (V1 :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 V1 :: k -> Type #

Methods

from1 :: forall (a :: k0). V1 a -> Rep1 V1 a #

to1 :: forall (a :: k0). Rep1 V1 a -> V1 a #

Tensor These1 (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy These1 :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> These1 f V1 Source #

intro2 :: forall (g :: Type -> Type). g ~> These1 V1 g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy These1 f => These1 f V1 ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy These1 g => These1 V1 g ~> g Source #

appendLB :: forall (f :: Type -> Type). These1 (ListBy These1 f) (ListBy These1 f) ~> ListBy These1 f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy These1 f ~> These1 f (ListBy These1 f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy These1 f <~> (V1 :+: These1 f (ListBy These1 f)) Source #

toListBy :: forall (f :: Type -> Type). These1 f f ~> ListBy These1 f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy These1 f ~> ListBy These1 f Source #

Alt f => MonoidIn These1 (V1 :: Type -> Type) f Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: V1 ~> f Source #

Functor (V1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> V1 a -> V1 b #

(<$) :: a -> V1 b -> V1 a #

Foldable (V1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => V1 m -> m #

foldMap :: Monoid m => (a -> m) -> V1 a -> m #

foldMap' :: Monoid m => (a -> m) -> V1 a -> m #

foldr :: (a -> b -> b) -> b -> V1 a -> b #

foldr' :: (a -> b -> b) -> b -> V1 a -> b #

foldl :: (b -> a -> b) -> b -> V1 a -> b #

foldl' :: (b -> a -> b) -> b -> V1 a -> b #

foldr1 :: (a -> a -> a) -> V1 a -> a #

foldl1 :: (a -> a -> a) -> V1 a -> a #

toList :: V1 a -> [a] #

null :: V1 a -> Bool #

length :: V1 a -> Int #

elem :: Eq a => a -> V1 a -> Bool #

maximum :: Ord a => V1 a -> a #

minimum :: Ord a => V1 a -> a #

sum :: Num a => V1 a -> a #

product :: Num a => V1 a -> a #

Traversable (V1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) #

sequenceA :: Applicative f => V1 (f a) -> f (V1 a) #

mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) #

sequence :: Monad m => V1 (m a) -> m (V1 a) #

Contravariant (V1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Contravariant

Methods

contramap :: (a -> b) -> V1 b -> V1 a #

(>$) :: b -> V1 b -> V1 a #

Invariant (V1 :: Type -> Type)

from GHC.Generics

Instance details

Defined in Data.Functor.Invariant

Methods

invmap :: (a -> b) -> (b -> a) -> V1 a -> V1 b #

Foldable1 (V1 :: Type -> Type) 
Instance details

Defined in Data.Semigroup.Foldable.Class

Methods

fold1 :: Semigroup m => V1 m -> m #

foldMap1 :: Semigroup m => (a -> m) -> V1 a -> m #

toNonEmpty :: V1 a -> NonEmpty a #

Apply (V1 :: Type -> Type)

A V1 is not Applicative, but it is an instance of Apply

Instance details

Defined in Data.Functor.Bind.Class

Methods

(<.>) :: V1 (a -> b) -> V1 a -> V1 b #

(.>) :: V1 a -> V1 b -> V1 b #

(<.) :: V1 a -> V1 b -> V1 a #

liftF2 :: (a -> b -> c) -> V1 a -> V1 b -> V1 c #

Traversable1 (V1 :: Type -> Type) 
Instance details

Defined in Data.Semigroup.Traversable.Class

Methods

traverse1 :: Apply f => (a -> f b) -> V1 a -> f (V1 b) #

sequence1 :: Apply f => V1 (f b) -> f (V1 b) #

Alt (V1 :: Type -> Type) 
Instance details

Defined in Data.Functor.Alt

Methods

(<!>) :: V1 a -> V1 a -> V1 a #

some :: Applicative V1 => V1 a -> V1 [a] #

many :: Applicative V1 => V1 a -> V1 [a] #

Bind (V1 :: Type -> Type)

A V1 is not a Monad, but it is an instance of Bind

Instance details

Defined in Data.Functor.Bind.Class

Methods

(>>-) :: V1 a -> (a -> V1 b) -> V1 b #

join :: V1 (V1 a) -> V1 a #

Divise (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divise

Methods

divise :: (a -> (b, c)) -> V1 b -> V1 c -> V1 a Source #

Decide (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.Functor.Contravariant.Decide

Methods

decide :: (a -> Either b c) -> V1 b -> V1 c -> V1 a Source #

Tensor ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy (:+:) :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> (f :+: V1) Source #

intro2 :: forall (g :: Type -> Type). g ~> (V1 :+: g) Source #

elim1 :: forall (f :: Type -> Type). FunctorBy (:+:) f => (f :+: V1) ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy (:+:) g => (V1 :+: g) ~> g Source #

appendLB :: forall (f :: Type -> Type). (ListBy (:+:) f :+: ListBy (:+:) f) ~> ListBy (:+:) f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy (:+:) f ~> (f :+: ListBy (:+:) f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy (:+:) f <~> (V1 :+: (f :+: ListBy (:+:) f)) Source #

toListBy :: forall (f :: Type -> Type). (f :+: f) ~> ListBy (:+:) f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy (:+:) f ~> ListBy (:+:) f Source #

Tensor (Sum :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Sum :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Sum f V1 Source #

intro2 :: forall (g :: Type -> Type). g ~> Sum V1 g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Sum f => Sum f V1 ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Sum g => Sum V1 g ~> g Source #

appendLB :: forall (f :: Type -> Type). Sum (ListBy Sum f) (ListBy Sum f) ~> ListBy Sum f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Sum f ~> Sum f (ListBy Sum f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Sum f <~> (V1 :+: Sum f (ListBy Sum f)) Source #

toListBy :: forall (f :: Type -> Type). Sum f f ~> ListBy Sum f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Sum f ~> ListBy Sum f Source #

Matchable ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

unsplitNE :: forall (f :: Type -> Type). FunctorBy (:+:) f => (f :+: ListBy (:+:) f) ~> NonEmptyBy (:+:) f Source #

matchLB :: forall (f :: Type -> Type). FunctorBy (:+:) f => ListBy (:+:) f ~> (V1 :+: NonEmptyBy (:+:) f) Source #

Matchable (Sum :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

unsplitNE :: forall (f :: Type -> Type). FunctorBy Sum f => Sum f (ListBy Sum f) ~> NonEmptyBy Sum f Source #

matchLB :: forall (f :: Type -> Type). FunctorBy Sum f => ListBy Sum f ~> (V1 :+: NonEmptyBy Sum f) Source #

MonoidIn ((:+:) :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) f Source #

All functors are monoids in the monoidal category on :+:.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: V1 ~> f Source #

MonoidIn (Sum :: (Type -> Type) -> (Type -> Type) -> Type -> Type) (V1 :: Type -> Type) f Source #

All functors are monoids in the monoidal category on Sum.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: V1 ~> f Source #

Eq (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: V1 p -> V1 p -> Bool #

(/=) :: V1 p -> V1 p -> Bool #

Data p => Data (V1 p)

Since: base-4.9.0.0

Instance details

Defined in Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> V1 p -> c (V1 p) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (V1 p) #

toConstr :: V1 p -> Constr #

dataTypeOf :: V1 p -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (V1 p)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V1 p)) #

gmapT :: (forall b. Data b => b -> b) -> V1 p -> V1 p #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V1 p -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V1 p -> r #

gmapQ :: (forall d. Data d => d -> u) -> V1 p -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> V1 p -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> V1 p -> m (V1 p) #

Ord (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: V1 p -> V1 p -> Ordering #

(<) :: V1 p -> V1 p -> Bool #

(<=) :: V1 p -> V1 p -> Bool #

(>) :: V1 p -> V1 p -> Bool #

(>=) :: V1 p -> V1 p -> Bool #

max :: V1 p -> V1 p -> V1 p #

min :: V1 p -> V1 p -> V1 p #

Read (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> V1 p -> ShowS #

show :: V1 p -> String #

showList :: [V1 p] -> ShowS #

Generic (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep (V1 p) :: Type -> Type #

Methods

from :: V1 p -> Rep (V1 p) x #

to :: Rep (V1 p) x -> V1 p #

Semigroup (V1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: V1 p -> V1 p -> V1 p #

sconcat :: NonEmpty (V1 p) -> V1 p #

stimes :: Integral b => b -> V1 p -> V1 p #

type Rep1 (V1 :: k -> Type) 
Instance details

Defined in GHC.Generics

type Rep1 (V1 :: k -> Type) = D1 ('MetaData "V1" "GHC.Generics" "base" 'False) (V1 :: k -> Type)
type Rep (V1 p) 
Instance details

Defined in GHC.Generics

type Rep (V1 p) = D1 ('MetaData "V1" "GHC.Generics" "base" 'False) (V1 :: Type -> Type)

data These1 (f :: Type -> Type) (g :: Type -> Type) a #

Constructors

This1 (f a) 
That1 (g a) 
These1 (f a) (g a) 

Instances

Instances details
Associative These1 Source #

Ideally here NonEmptyBy would be equivalent to ListBy, just like for :+:. This should be possible if we can write a bijection. This bijection should be possible in theory --- but it has not yet been implemented.

Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy These1 :: (Type -> Type) -> Type -> Type Source #

type FunctorBy These1 :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy These1 f, FunctorBy These1 g, FunctorBy These1 h) => These1 f (These1 g h) <~> These1 (These1 f g) h Source #

appendNE :: forall (f :: Type -> Type). These1 (NonEmptyBy These1 f) (NonEmptyBy These1 f) ~> NonEmptyBy These1 f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy These1 f => NonEmptyBy These1 f ~> (f :+: These1 f (NonEmptyBy These1 f)) Source #

consNE :: forall (f :: Type -> Type). These1 f (NonEmptyBy These1 f) ~> NonEmptyBy These1 f Source #

toNonEmptyBy :: forall (f :: Type -> Type). These1 f f ~> NonEmptyBy These1 f Source #

Alt f => SemigroupIn These1 f Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: These1 f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> These1 g h ~> f Source #

Tensor These1 (V1 :: Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy These1 :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> These1 f V1 Source #

intro2 :: forall (g :: Type -> Type). g ~> These1 V1 g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy These1 f => These1 f V1 ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy These1 g => These1 V1 g ~> g Source #

appendLB :: forall (f :: Type -> Type). These1 (ListBy These1 f) (ListBy These1 f) ~> ListBy These1 f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy These1 f ~> These1 f (ListBy These1 f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy These1 f <~> (V1 :+: These1 f (ListBy These1 f)) Source #

toListBy :: forall (f :: Type -> Type). These1 f f ~> ListBy These1 f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy These1 f ~> ListBy These1 f Source #

Alt f => MonoidIn These1 (V1 :: Type -> Type) f Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: V1 ~> f Source #

HBifunctor These1 Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> These1 f g ~> These1 j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> These1 f g ~> These1 f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> These1 f g ~> These1 j l Source #

Alt f => HBind (These1 f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> These1 f g) -> These1 f f0 ~> These1 f g Source #

hjoin :: forall (f0 :: k -> Type). These1 f (These1 f f0) ~> These1 f f0 Source #

Inject (These1 f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k -> Type). f0 ~> These1 f f0 Source #

Plus f => Interpret (These1 g :: (Type -> Type) -> Type -> Type) (f :: Type -> Type) Source #

Technically, f is over-constrained: we only need zero :: f a, but we don't really have that typeclass in any standard hierarchies. We use Plus here instead, but we never use <!>. This would only go wrong in situations where your type supports zero but not <!>, like instances of MonadFail without MonadPlus.

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: These1 g f ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> These1 g g0 ~> f Source #

HFunctor (These1 f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> These1 f f0 ~> These1 f g Source #

Generic1 (These1 f g :: Type -> Type) 
Instance details

Defined in Data.Functor.These

Associated Types

type Rep1 (These1 f g) :: k -> Type #

Methods

from1 :: forall (a :: k). These1 f g a -> Rep1 (These1 f g) a #

to1 :: forall (a :: k). Rep1 (These1 f g) a -> These1 f g a #

(Functor f, Functor g) => Functor (These1 f g) 
Instance details

Defined in Data.Functor.These

Methods

fmap :: (a -> b) -> These1 f g a -> These1 f g b #

(<$) :: a -> These1 f g b -> These1 f g a #

(Foldable f, Foldable g) => Foldable (These1 f g) 
Instance details

Defined in Data.Functor.These

Methods

fold :: Monoid m => These1 f g m -> m #

foldMap :: Monoid m => (a -> m) -> These1 f g a -> m #

foldMap' :: Monoid m => (a -> m) -> These1 f g a -> m #

foldr :: (a -> b -> b) -> b -> These1 f g a -> b #

foldr' :: (a -> b -> b) -> b -> These1 f g a -> b #

foldl :: (b -> a -> b) -> b -> These1 f g a -> b #

foldl' :: (b -> a -> b) -> b -> These1 f g a -> b #

foldr1 :: (a -> a -> a) -> These1 f g a -> a #

foldl1 :: (a -> a -> a) -> These1 f g a -> a #

toList :: These1 f g a -> [a] #

null :: These1 f g a -> Bool #

length :: These1 f g a -> Int #

elem :: Eq a => a -> These1 f g a -> Bool #

maximum :: Ord a => These1 f g a -> a #

minimum :: Ord a => These1 f g a -> a #

sum :: Num a => These1 f g a -> a #

product :: Num a => These1 f g a -> a #

(Traversable f, Traversable g) => Traversable (These1 f g) 
Instance details

Defined in Data.Functor.These

Methods

traverse :: Applicative f0 => (a -> f0 b) -> These1 f g a -> f0 (These1 f g b) #

sequenceA :: Applicative f0 => These1 f g (f0 a) -> f0 (These1 f g a) #

mapM :: Monad m => (a -> m b) -> These1 f g a -> m (These1 f g b) #

sequence :: Monad m => These1 f g (m a) -> m (These1 f g a) #

(Eq1 f, Eq1 g) => Eq1 (These1 f g) 
Instance details

Defined in Data.Functor.These

Methods

liftEq :: (a -> b -> Bool) -> These1 f g a -> These1 f g b -> Bool #

(Ord1 f, Ord1 g) => Ord1 (These1 f g) 
Instance details

Defined in Data.Functor.These

Methods

liftCompare :: (a -> b -> Ordering) -> These1 f g a -> These1 f g b -> Ordering #

(Read1 f, Read1 g) => Read1 (These1 f g) 
Instance details

Defined in Data.Functor.These

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (These1 f g a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [These1 f g a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (These1 f g a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [These1 f g a] #

(Show1 f, Show1 g) => Show1 (These1 f g) 
Instance details

Defined in Data.Functor.These

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> These1 f g a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [These1 f g a] -> ShowS #

(NFData1 f, NFData1 g) => NFData1 (These1 f g)

This instance is available only with deepseq >= 1.4.3.0

Instance details

Defined in Data.Functor.These

Methods

liftRnf :: (a -> ()) -> These1 f g a -> () #

(Eq1 f, Eq1 g, Eq a) => Eq (These1 f g a) 
Instance details

Defined in Data.Functor.These

Methods

(==) :: These1 f g a -> These1 f g a -> Bool #

(/=) :: These1 f g a -> These1 f g a -> Bool #

(Typeable f, Typeable g, Typeable a, Data (f a), Data (g a)) => Data (These1 f g a) 
Instance details

Defined in Data.Functor.These

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> These1 f g a -> c (These1 f g a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (These1 f g a) #

toConstr :: These1 f g a -> Constr #

dataTypeOf :: These1 f g a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (These1 f g a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (These1 f g a)) #

gmapT :: (forall b. Data b => b -> b) -> These1 f g a -> These1 f g a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> These1 f g a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> These1 f g a -> r #

gmapQ :: (forall d. Data d => d -> u) -> These1 f g a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> These1 f g a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> These1 f g a -> m (These1 f g a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> These1 f g a -> m (These1 f g a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> These1 f g a -> m (These1 f g a) #

(Ord1 f, Ord1 g, Ord a) => Ord (These1 f g a) 
Instance details

Defined in Data.Functor.These

Methods

compare :: These1 f g a -> These1 f g a -> Ordering #

(<) :: These1 f g a -> These1 f g a -> Bool #

(<=) :: These1 f g a -> These1 f g a -> Bool #

(>) :: These1 f g a -> These1 f g a -> Bool #

(>=) :: These1 f g a -> These1 f g a -> Bool #

max :: These1 f g a -> These1 f g a -> These1 f g a #

min :: These1 f g a -> These1 f g a -> These1 f g a #

(Read1 f, Read1 g, Read a) => Read (These1 f g a) 
Instance details

Defined in Data.Functor.These

Methods

readsPrec :: Int -> ReadS (These1 f g a) #

readList :: ReadS [These1 f g a] #

readPrec :: ReadPrec (These1 f g a) #

readListPrec :: ReadPrec [These1 f g a] #

(Show1 f, Show1 g, Show a) => Show (These1 f g a) 
Instance details

Defined in Data.Functor.These

Methods

showsPrec :: Int -> These1 f g a -> ShowS #

show :: These1 f g a -> String #

showList :: [These1 f g a] -> ShowS #

Generic (These1 f g a) 
Instance details

Defined in Data.Functor.These

Associated Types

type Rep (These1 f g a) :: Type -> Type #

Methods

from :: These1 f g a -> Rep (These1 f g a) x #

to :: Rep (These1 f g a) x -> These1 f g a #

(NFData1 f, NFData1 g, NFData a) => NFData (These1 f g a)

This instance is available only with deepseq >= 1.4.3.0

Instance details

Defined in Data.Functor.These

Methods

rnf :: These1 f g a -> () #

type NonEmptyBy These1 Source # 
Instance details

Defined in Data.HBifunctor.Associative

type NonEmptyBy These1 = ComposeT (Flagged :: (Type -> Type) -> Type -> Type) (Steps :: (Type -> Type) -> Type -> Type)
type FunctorBy These1 Source # 
Instance details

Defined in Data.HBifunctor.Associative

type ListBy These1 Source # 
Instance details

Defined in Data.HBifunctor.Tensor

type ListBy These1 = Steps :: (Type -> Type) -> Type -> Type
type Rep1 (These1 f g :: Type -> Type) 
Instance details

Defined in Data.Functor.These

type Rep1 (These1 f g :: Type -> Type) = D1 ('MetaData "These1" "Data.Functor.These" "these-1.1.1.1-828484024619563adbf738b31d162b5c513f5c232d3436228e66e04a2aa238c7" 'False) (C1 ('MetaCons "This1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)) :+: (C1 ('MetaCons "That1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 g)) :+: C1 ('MetaCons "These1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 g))))
type Rep (These1 f g a) 
Instance details

Defined in Data.Functor.These

type Rep (These1 f g a) = D1 ('MetaData "These1" "Data.Functor.These" "these-1.1.1.1-828484024619563adbf738b31d162b5c513f5c232d3436228e66e04a2aa238c7" 'False) (C1 ('MetaCons "This1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))) :+: (C1 ('MetaCons "That1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g a))) :+: C1 ('MetaCons "These1" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g a)))))

data Night :: (Type -> Type) -> (Type -> Type) -> Type -> Type where Source #

A pairing of invariant functors to create a new invariant functor that represents the "choice" between the two.

A Night f g a is a invariant "consumer" and "producer" of a, and it does this by either feeding the a to f, or feeding the a to g, and then collecting the result from whichever one it was fed to. Which decision of which path to takes happens at runtime depending what a is actually given.

For example, if we have x :: f a and y :: g b, then night x y :: Night f g (Either a b). This is a consumer/producer of Either a bs, and it consumes Left branches by feeding it to x, and Right branches by feeding it to y. It then passes back the single result from the one of the two that was chosen.

Mathematically, this is a invariant day convolution, except with a different choice of bifunctor (Either) than the typical one we talk about in Haskell (which uses (,)). Therefore, it is an alternative to the typical Day convolution --- hence, the name Night.

Constructors

Night :: f b -> g c -> (a -> Either b c) -> (b -> a) -> (c -> a) -> Night f g a 

Instances

Instances details
Associative Night Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Night :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Night :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Night f, FunctorBy Night g, FunctorBy Night h) => Night f (Night g h) <~> Night (Night f g) h Source #

appendNE :: forall (f :: Type -> Type). Night (NonEmptyBy Night f) (NonEmptyBy Night f) ~> NonEmptyBy Night f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Night f => NonEmptyBy Night f ~> (f :+: Night f (NonEmptyBy Night f)) Source #

consNE :: forall (f :: Type -> Type). Night f (NonEmptyBy Night f) ~> NonEmptyBy Night f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Night f f ~> NonEmptyBy Night f Source #

HBifunctor Night Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Night f g ~> Night j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Night f g ~> Night f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Night f g ~> Night j l Source #

Tensor Night Not Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Night :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Night f Not Source #

intro2 :: forall (g :: Type -> Type). g ~> Night Not g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Night f => Night f Not ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Night g => Night Not g ~> g Source #

appendLB :: forall (f :: Type -> Type). Night (ListBy Night f) (ListBy Night f) ~> ListBy Night f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> Night f (ListBy Night f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Night f <~> (Not :+: Night f (ListBy Night f)) Source #

toListBy :: forall (f :: Type -> Type). Night f f ~> ListBy Night f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> ListBy Night f Source #

Matchable Night Not Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

unsplitNE :: forall (f :: Type -> Type). FunctorBy Night f => Night f (ListBy Night f) ~> NonEmptyBy Night f Source #

matchLB :: forall (f :: Type -> Type). FunctorBy Night f => ListBy Night f ~> (Not :+: NonEmptyBy Night f) Source #

HFunctor (Night f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> Night f f0 ~> Night f g Source #

Invariant (Night f g) Source # 
Instance details

Defined in Data.Functor.Invariant.Night

Methods

invmap :: (a -> b) -> (b -> a) -> Night f g a -> Night f g b #

type NonEmptyBy Night Source # 
Instance details

Defined in Data.HBifunctor.Associative

type FunctorBy Night Source # 
Instance details

Defined in Data.HBifunctor.Associative

type ListBy Night Source # 
Instance details

Defined in Data.HBifunctor.Tensor

newtype Not a Source #

A value of type Not a is "proof" that a is uninhabited.

Constructors

Not 

Fields

Instances

Instances details
Contravariant Not Source # 
Instance details

Defined in Data.Functor.Contravariant.Night

Methods

contramap :: (a -> b) -> Not b -> Not a #

(>$) :: b -> Not b -> Not a #

Invariant Not Source #

Since: 0.3.1.0

Instance details

Defined in Data.Functor.Contravariant.Night

Methods

invmap :: (a -> b) -> (b -> a) -> Not a -> Not b #

Tensor Night Not Source #

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Night :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Night f Not Source #

intro2 :: forall (g :: Type -> Type). g ~> Night Not g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Night f => Night f Not ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Night g => Night Not g ~> g Source #

appendLB :: forall (f :: Type -> Type). Night (ListBy Night f) (ListBy Night f) ~> ListBy Night f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> Night f (ListBy Night f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Night f <~> (Not :+: Night f (ListBy Night f)) Source #

toListBy :: forall (f :: Type -> Type). Night f f ~> ListBy Night f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> ListBy Night f Source #

Tensor Night Not Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Night :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Night f Not Source #

intro2 :: forall (g :: Type -> Type). g ~> Night Not g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Night f => Night f Not ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Night g => Night Not g ~> g Source #

appendLB :: forall (f :: Type -> Type). Night (ListBy Night f) (ListBy Night f) ~> ListBy Night f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> Night f (ListBy Night f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Night f <~> (Not :+: Night f (ListBy Night f)) Source #

toListBy :: forall (f :: Type -> Type). Night f f ~> ListBy Night f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Night f ~> ListBy Night f Source #

Matchable Night Not Source #

Since: 0.3.0.0

Instance details

Defined in Data.HBifunctor.Tensor

Methods

unsplitNE :: forall (f :: Type -> Type). FunctorBy Night f => Night f (ListBy Night f) ~> NonEmptyBy Night f Source #

matchLB :: forall (f :: Type -> Type). FunctorBy Night f => ListBy Night f ~> (Not :+: NonEmptyBy Night f) Source #

Matchable Night Not Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Methods

unsplitNE :: forall (f :: Type -> Type). FunctorBy Night f => Night f (ListBy Night f) ~> NonEmptyBy Night f Source #

matchLB :: forall (f :: Type -> Type). FunctorBy Night f => ListBy Night f ~> (Not :+: NonEmptyBy Night f) Source #

Conclude f => MonoidIn Night Not f Source #

Instances of Conclude are monoids in the monoidal category on Night.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Not ~> f Source #

Semigroup (Not a) Source # 
Instance details

Defined in Data.Functor.Contravariant.Night

Methods

(<>) :: Not a -> Not a -> Not a #

sconcat :: NonEmpty (Not a) -> Not a #

stimes :: Integral b => b -> Not a -> Not a #

Decide (Chain Night Not f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Chain

Methods

decide :: (a -> Either b c) -> Chain Night Not f b -> Chain Night Not f c -> Chain Night Not f a Source #

Conclude (Chain Night Not f) Source #

Chain Night Refutec is the free "monoid in the monoidal category of endofunctors enriched by Night" --- aka, the free Conclude.

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor.Chain

Methods

conclude :: (a -> Void) -> Chain Night Not f a Source #

refuted :: Not Void Source #

A useful shortcut for a common usage: Void is always not so.

Since: 0.3.1.0

data Comp f g a where Source #

Functor composition. Comp f g a is equivalent to f (g a), and the Comp pattern synonym is a way of getting the f (g a) in a Comp f g a.

For example, Maybe (IO Bool) is Comp Maybe IO Bool.

This is mostly useful for its typeclass instances: in particular, Functor, Applicative, HBifunctor, and Monoidal.

This is essentially a version of :.: and Compose that allows for an HBifunctor instance.

It is slightly less performant. Using comp . unComp every once in a while will concretize a Comp value (if you have Functor f) and remove some indirection if you have a lot of chained operations.

The "free monoid" over Comp is Free, and the "free semigroup" over Comp is Free1.

Bundled Patterns

pattern Comp :: Functor f => f (g a) -> Comp f g a

Pattern match on and construct a Comp f g a as if it were f (g a).

Instances

Instances details
Applicative f => Inject (Comp f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f0 :: k -> Type). f0 ~> Comp f f0 Source #

Associative (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy Comp :: (Type -> Type) -> Type -> Type Source #

type FunctorBy Comp :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy Comp f, FunctorBy Comp g, FunctorBy Comp h) => Comp f (Comp g h) <~> Comp (Comp f g) h Source #

appendNE :: forall (f :: Type -> Type). Comp (NonEmptyBy Comp f) (NonEmptyBy Comp f) ~> NonEmptyBy Comp f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy Comp f => NonEmptyBy Comp f ~> (f :+: Comp f (NonEmptyBy Comp f)) Source #

consNE :: forall (f :: Type -> Type). Comp f (NonEmptyBy Comp f) ~> NonEmptyBy Comp f Source #

toNonEmptyBy :: forall (f :: Type -> Type). Comp f f ~> NonEmptyBy Comp f Source #

Bind f => SemigroupIn (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source #

Instances of Bind are semigroups in the semigroupoidal category on Comp.

Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: Comp f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> Comp g h ~> f Source #

Tensor (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity Source # 
Instance details

Defined in Data.HBifunctor.Tensor

Associated Types

type ListBy Comp :: (Type -> Type) -> Type -> Type Source #

Methods

intro1 :: forall (f :: Type -> Type). f ~> Comp f Identity Source #

intro2 :: forall (g :: Type -> Type). g ~> Comp Identity g Source #

elim1 :: forall (f :: Type -> Type). FunctorBy Comp f => Comp f Identity ~> f Source #

elim2 :: forall (g :: Type -> Type). FunctorBy Comp g => Comp Identity g ~> g Source #

appendLB :: forall (f :: Type -> Type). Comp (ListBy Comp f) (ListBy Comp f) ~> ListBy Comp f Source #

splitNE :: forall (f :: Type -> Type). NonEmptyBy Comp f ~> Comp f (ListBy Comp f) Source #

splittingLB :: forall (f :: Type -> Type). ListBy Comp f <~> (Identity :+: Comp f (ListBy Comp f)) Source #

toListBy :: forall (f :: Type -> Type). Comp f f ~> ListBy Comp f Source #

fromNE :: forall (f :: Type -> Type). NonEmptyBy Comp f ~> ListBy Comp f Source #

(Bind f, Monad f) => MonoidIn (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f Source #

Instances of Monad are monoids in the monoidal category on Comp.

This instance is the "proof" that "monads are the monoids in the category of endofunctors (enriched with Comp)"

Note that because of typeclass constraints, this requires Bind as well as Monad. But, you can get a "local" instance of Apply for any Monad using unsafeBind.

Instance details

Defined in Data.HBifunctor.Tensor

Methods

pureT :: Identity ~> f Source #

HBifunctor (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hleft :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type). (f ~> j) -> Comp f g ~> Comp j g Source #

hright :: forall (g :: k -> Type) (l :: k -> Type) (f :: k -> Type). (g ~> l) -> Comp f g ~> Comp f l Source #

hbimap :: forall (f :: k -> Type) (j :: k -> Type) (g :: k -> Type) (l :: k -> Type). (f ~> j) -> (g ~> l) -> Comp f g ~> Comp j l Source #

HFunctor (Comp f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HFunctor.Internal

Methods

hmap :: forall (f0 :: k -> Type) (g :: k -> Type). (f0 ~> g) -> Comp f f0 ~> Comp f g Source #

Functor g => Functor (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

fmap :: (a -> b) -> Comp f g a -> Comp f g b #

(<$) :: a -> Comp f g b -> Comp f g a #

(Applicative f, Applicative g) => Applicative (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

pure :: a -> Comp f g a #

(<*>) :: Comp f g (a -> b) -> Comp f g a -> Comp f g b #

liftA2 :: (a -> b -> c) -> Comp f g a -> Comp f g b -> Comp f g c #

(*>) :: Comp f g a -> Comp f g b -> Comp f g b #

(<*) :: Comp f g a -> Comp f g b -> Comp f g a #

(Foldable f, Foldable g) => Foldable (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

fold :: Monoid m => Comp f g m -> m #

foldMap :: Monoid m => (a -> m) -> Comp f g a -> m #

foldMap' :: Monoid m => (a -> m) -> Comp f g a -> m #

foldr :: (a -> b -> b) -> b -> Comp f g a -> b #

foldr' :: (a -> b -> b) -> b -> Comp f g a -> b #

foldl :: (b -> a -> b) -> b -> Comp f g a -> b #

foldl' :: (b -> a -> b) -> b -> Comp f g a -> b #

foldr1 :: (a -> a -> a) -> Comp f g a -> a #

foldl1 :: (a -> a -> a) -> Comp f g a -> a #

toList :: Comp f g a -> [a] #

null :: Comp f g a -> Bool #

length :: Comp f g a -> Int #

elem :: Eq a => a -> Comp f g a -> Bool #

maximum :: Ord a => Comp f g a -> a #

minimum :: Ord a => Comp f g a -> a #

sum :: Num a => Comp f g a -> a #

product :: Num a => Comp f g a -> a #

(Traversable f, Traversable g) => Traversable (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Comp f g a -> f0 (Comp f g b) #

sequenceA :: Applicative f0 => Comp f g (f0 a) -> f0 (Comp f g a) #

mapM :: Monad m => (a -> m b) -> Comp f g a -> m (Comp f g b) #

sequence :: Monad m => Comp f g (m a) -> m (Comp f g a) #

(Functor f, Eq1 f, Eq1 g) => Eq1 (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftEq :: (a -> b -> Bool) -> Comp f g a -> Comp f g b -> Bool #

(Functor f, Ord1 f, Ord1 g) => Ord1 (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftCompare :: (a -> b -> Ordering) -> Comp f g a -> Comp f g b -> Ordering #

(Functor f, Read1 f, Read1 g) => Read1 (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Comp f g a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Comp f g a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Comp f g a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Comp f g a] #

(Functor f, Show1 f, Show1 g) => Show1 (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Comp f g a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Comp f g a] -> ShowS #

(Alternative f, Alternative g) => Alternative (Comp f g) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

empty :: Comp f g a #

(<|>) :: Comp f g a -> Comp f g a -> Comp f g a #

some :: Comp f g a -> Comp f g [a] #

many :: Comp f g a -> Comp f g [a] #

Functor f => Apply (Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source # 
Instance details

Defined in Data.HFunctor.Chain

Methods

(<.>) :: Chain1 Comp f (a -> b) -> Chain1 Comp f a -> Chain1 Comp f b #

(.>) :: Chain1 Comp f a -> Chain1 Comp f b -> Chain1 Comp f b #

(<.) :: Chain1 Comp f a -> Chain1 Comp f b -> Chain1 Comp f a #

liftF2 :: (a -> b -> c) -> Chain1 Comp f a -> Chain1 Comp f b -> Chain1 Comp f c #

Functor f => Bind (Chain1 (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f) Source #

Chain1 Comp is the free "semigroup in the semigroupoidal category of endofunctors enriched by Comp" --- aka, the free Bind.

Instance details

Defined in Data.HFunctor.Chain

Methods

(>>-) :: Chain1 Comp f a -> (a -> Chain1 Comp f b) -> Chain1 Comp f b #

join :: Chain1 Comp f (Chain1 Comp f a) -> Chain1 Comp f a #

(Functor f, Eq1 f, Eq1 g, Eq a) => Eq (Comp f g a) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

(==) :: Comp f g a -> Comp f g a -> Bool #

(/=) :: Comp f g a -> Comp f g a -> Bool #

(Functor f, Ord1 f, Ord1 g, Ord a) => Ord (Comp f g a) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

compare :: Comp f g a -> Comp f g a -> Ordering #

(<) :: Comp f g a -> Comp f g a -> Bool #

(<=) :: Comp f g a -> Comp f g a -> Bool #

(>) :: Comp f g a -> Comp f g a -> Bool #

(>=) :: Comp f g a -> Comp f g a -> Bool #

max :: Comp f g a -> Comp f g a -> Comp f g a #

min :: Comp f g a -> Comp f g a -> Comp f g a #

(Functor f, Read1 f, Read1 g, Read a) => Read (Comp f g a) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

readsPrec :: Int -> ReadS (Comp f g a) #

readList :: ReadS [Comp f g a] #

readPrec :: ReadPrec (Comp f g a) #

readListPrec :: ReadPrec [Comp f g a] #

(Functor f, Show1 f, Show1 g, Show a) => Show (Comp f g a) Source # 
Instance details

Defined in Control.Monad.Freer.Church

Methods

showsPrec :: Int -> Comp f g a -> ShowS #

show :: Comp f g a -> String #

showList :: [Comp f g a] -> ShowS #

Monad (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source #

Chain Comp Identity is the free "monoid in the monoidal category of endofunctors enriched by Comp" --- aka, the free Monad.

Instance details

Defined in Data.HFunctor.Chain

Methods

(>>=) :: Chain Comp Identity f a -> (a -> Chain Comp Identity f b) -> Chain Comp Identity f b #

(>>) :: Chain Comp Identity f a -> Chain Comp Identity f b -> Chain Comp Identity f b #

return :: a -> Chain Comp Identity f a #

Applicative (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # 
Instance details

Defined in Data.HFunctor.Chain

Methods

pure :: a -> Chain Comp Identity f a #

(<*>) :: Chain Comp Identity f (a -> b) -> Chain Comp Identity f a -> Chain Comp Identity f b #

liftA2 :: (a -> b -> c) -> Chain Comp Identity f a -> Chain Comp Identity f b -> Chain Comp Identity f c #

(*>) :: Chain Comp Identity f a -> Chain Comp Identity f b -> Chain Comp Identity f b #

(<*) :: Chain Comp Identity f a -> Chain Comp Identity f b -> Chain Comp Identity f a #

Apply (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # 
Instance details

Defined in Data.HFunctor.Chain

Methods

(<.>) :: Chain Comp Identity f (a -> b) -> Chain Comp Identity f a -> Chain Comp Identity f b #

(.>) :: Chain Comp Identity f a -> Chain Comp Identity f b -> Chain Comp Identity f b #

(<.) :: Chain Comp Identity f a -> Chain Comp Identity f b -> Chain Comp Identity f a #

liftF2 :: (a -> b -> c) -> Chain Comp Identity f a -> Chain Comp Identity f b -> Chain Comp Identity f c #

Bind (Chain (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Identity f) Source # 
Instance details

Defined in Data.HFunctor.Chain

type NonEmptyBy (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type NonEmptyBy (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Free1
type FunctorBy (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type FunctorBy (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Functor
type ListBy (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Tensor

type ListBy (Comp :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Free

newtype LeftF f g a Source #

An HBifunctor that ignores its second input. Like a :+: with no R1/right branch.

This is Joker from Data.Bifunctors.Joker, but given a more sensible name for its purpose.

Constructors

LeftF 

Fields

Instances

Instances details
HFunctor (LeftF f :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hmap :: forall (f0 :: k0 -> Type) (g :: k0 -> Type). (f0 ~> g) -> LeftF f f0 ~> LeftF f g Source #

HBifunctor (LeftF :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> LeftF f g ~> LeftF j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> LeftF f g ~> LeftF f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> LeftF f g ~> LeftF j l Source #

Associative (LeftF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy LeftF :: (Type -> Type) -> Type -> Type Source #

type FunctorBy LeftF :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy LeftF f, FunctorBy LeftF g, FunctorBy LeftF h) => LeftF f (LeftF g h) <~> LeftF (LeftF f g) h Source #

appendNE :: forall (f :: Type -> Type). LeftF (NonEmptyBy LeftF f) (NonEmptyBy LeftF f) ~> NonEmptyBy LeftF f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy LeftF f => NonEmptyBy LeftF f ~> (f :+: LeftF f (NonEmptyBy LeftF f)) Source #

consNE :: forall (f :: Type -> Type). LeftF f (NonEmptyBy LeftF f) ~> NonEmptyBy LeftF f Source #

toNonEmptyBy :: forall (f :: Type -> Type). LeftF f f ~> NonEmptyBy LeftF f Source #

SemigroupIn (LeftF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: LeftF f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> LeftF g h ~> f Source #

Functor f => Bifunctor (LeftF f :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

bimap :: (a -> b) -> (c -> d) -> LeftF f a c -> LeftF f b d #

first :: (a -> b) -> LeftF f a c -> LeftF f b c #

second :: (b -> c) -> LeftF f a b -> LeftF f a c #

Traversable f => Bitraversable (LeftF f :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

bitraverse :: Applicative f0 => (a -> f0 c) -> (b -> f0 d) -> LeftF f a b -> f0 (LeftF f c d) #

Foldable f => Bifoldable (LeftF f :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

bifold :: Monoid m => LeftF f m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> LeftF f a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> LeftF f a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> LeftF f a b -> c #

Applicative f => Biapplicative (LeftF f :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

bipure :: a -> b -> LeftF f a b #

(<<*>>) :: LeftF f (a -> b) (c -> d) -> LeftF f a c -> LeftF f b d #

biliftA2 :: (a -> b -> c) -> (d -> e -> f0) -> LeftF f a d -> LeftF f b e -> LeftF f c f0 #

(*>>) :: LeftF f a b -> LeftF f c d -> LeftF f c d #

(<<*) :: LeftF f a b -> LeftF f c d -> LeftF f a b #

Functor f => Functor (LeftF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

fmap :: (a -> b) -> LeftF f g a -> LeftF f g b #

(<$) :: a -> LeftF f g b -> LeftF f g a #

Foldable f => Foldable (LeftF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

fold :: Monoid m => LeftF f g m -> m #

foldMap :: Monoid m => (a -> m) -> LeftF f g a -> m #

foldMap' :: Monoid m => (a -> m) -> LeftF f g a -> m #

foldr :: (a -> b -> b) -> b -> LeftF f g a -> b #

foldr' :: (a -> b -> b) -> b -> LeftF f g a -> b #

foldl :: (b -> a -> b) -> b -> LeftF f g a -> b #

foldl' :: (b -> a -> b) -> b -> LeftF f g a -> b #

foldr1 :: (a -> a -> a) -> LeftF f g a -> a #

foldl1 :: (a -> a -> a) -> LeftF f g a -> a #

toList :: LeftF f g a -> [a] #

null :: LeftF f g a -> Bool #

length :: LeftF f g a -> Int #

elem :: Eq a => a -> LeftF f g a -> Bool #

maximum :: Ord a => LeftF f g a -> a #

minimum :: Ord a => LeftF f g a -> a #

sum :: Num a => LeftF f g a -> a #

product :: Num a => LeftF f g a -> a #

Traversable f => Traversable (LeftF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

traverse :: Applicative f0 => (a -> f0 b) -> LeftF f g a -> f0 (LeftF f g b) #

sequenceA :: Applicative f0 => LeftF f g (f0 a) -> f0 (LeftF f g a) #

mapM :: Monad m => (a -> m b) -> LeftF f g a -> m (LeftF f g b) #

sequence :: Monad m => LeftF f g (m a) -> m (LeftF f g a) #

Eq1 f => Eq1 (LeftF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

liftEq :: (a -> b -> Bool) -> LeftF f g a -> LeftF f g b -> Bool #

Ord1 f => Ord1 (LeftF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

liftCompare :: (a -> b -> Ordering) -> LeftF f g a -> LeftF f g b -> Ordering #

Read1 f => Read1 (LeftF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (LeftF f g a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [LeftF f g a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (LeftF f g a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [LeftF f g a] #

Show1 f => Show1 (LeftF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> LeftF f g a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [LeftF f g a] -> ShowS #

Eq (f a) => Eq (LeftF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

(==) :: LeftF f g a -> LeftF f g a -> Bool #

(/=) :: LeftF f g a -> LeftF f g a -> Bool #

(Typeable g, Typeable a, Typeable f, Typeable k1, Typeable k2, Data (f a)) => Data (LeftF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> LeftF f g a -> c (LeftF f g a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (LeftF f g a) #

toConstr :: LeftF f g a -> Constr #

dataTypeOf :: LeftF f g a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (LeftF f g a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (LeftF f g a)) #

gmapT :: (forall b. Data b => b -> b) -> LeftF f g a -> LeftF f g a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> LeftF f g a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> LeftF f g a -> r #

gmapQ :: (forall d. Data d => d -> u) -> LeftF f g a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> LeftF f g a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> LeftF f g a -> m (LeftF f g a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftF f g a -> m (LeftF f g a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> LeftF f g a -> m (LeftF f g a) #

Ord (f a) => Ord (LeftF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

compare :: LeftF f g a -> LeftF f g a -> Ordering #

(<) :: LeftF f g a -> LeftF f g a -> Bool #

(<=) :: LeftF f g a -> LeftF f g a -> Bool #

(>) :: LeftF f g a -> LeftF f g a -> Bool #

(>=) :: LeftF f g a -> LeftF f g a -> Bool #

max :: LeftF f g a -> LeftF f g a -> LeftF f g a #

min :: LeftF f g a -> LeftF f g a -> LeftF f g a #

Read (f a) => Read (LeftF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

readsPrec :: Int -> ReadS (LeftF f g a) #

readList :: ReadS [LeftF f g a] #

readPrec :: ReadPrec (LeftF f g a) #

readListPrec :: ReadPrec [LeftF f g a] #

Show (f a) => Show (LeftF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

showsPrec :: Int -> LeftF f g a -> ShowS #

show :: LeftF f g a -> String #

showList :: [LeftF f g a] -> ShowS #

Generic (LeftF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Associated Types

type Rep (LeftF f g a) :: Type -> Type #

Methods

from :: LeftF f g a -> Rep (LeftF f g a) x #

to :: Rep (LeftF f g a) x -> LeftF f g a #

type NonEmptyBy (LeftF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type NonEmptyBy (LeftF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Flagged :: (Type -> Type) -> Type -> Type
type FunctorBy (LeftF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type FunctorBy (LeftF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Unconstrained :: (Type -> Type) -> Constraint
type Rep (LeftF f g a) Source # 
Instance details

Defined in Data.HBifunctor

type Rep (LeftF f g a) = D1 ('MetaData "LeftF" "Data.HBifunctor" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "LeftF" 'PrefixI 'True) (S1 ('MetaSel ('Just "runLeftF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

newtype RightF f g a Source #

An HBifunctor that ignores its first input. Like a :+: with no L1/left branch.

In its polykinded form (on f), it is essentially a higher-order version of Tagged.

Constructors

RightF 

Fields

Instances

Instances details
HFunctor (RightF g :: (k2 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hmap :: forall (f :: k -> Type) (g0 :: k -> Type). (f ~> g0) -> RightF g f ~> RightF g g0 Source #

HFunctor (RightF g :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hmap :: forall (f :: k0 -> Type) (g0 :: k0 -> Type). (f ~> g0) -> RightF g f ~> RightF g g0 Source #

HBifunctor (RightF :: (k -> Type) -> (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hleft :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type). (f ~> j) -> RightF f g ~> RightF j g Source #

hright :: forall (g :: k0 -> Type) (l :: k0 -> Type) (f :: k0 -> Type). (g ~> l) -> RightF f g ~> RightF f l Source #

hbimap :: forall (f :: k0 -> Type) (j :: k0 -> Type) (g :: k0 -> Type) (l :: k0 -> Type). (f ~> j) -> (g ~> l) -> RightF f g ~> RightF j l Source #

HBind (RightF g :: (k2 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

hbind :: forall (f :: k -> Type) (g0 :: k -> Type). (f ~> RightF g g0) -> RightF g f ~> RightF g g0 Source #

hjoin :: forall (f :: k -> Type). RightF g (RightF g f) ~> RightF g f Source #

Inject (RightF g :: (k2 -> Type) -> k2 -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

inject :: forall (f :: k -> Type). f ~> RightF g f Source #

Interpret (RightF g :: (k2 -> Type) -> k2 -> Type) (f :: k2 -> Type) Source # 
Instance details

Defined in Data.HBifunctor

Methods

retract :: RightF g f ~> f Source #

interpret :: forall (g0 :: k -> Type). (g0 ~> f) -> RightF g g0 ~> f Source #

Associative (RightF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

Associated Types

type NonEmptyBy RightF :: (Type -> Type) -> Type -> Type Source #

type FunctorBy RightF :: (Type -> Type) -> Constraint Source #

Methods

associating :: forall (f :: Type -> Type) (g :: Type -> Type) (h :: Type -> Type). (FunctorBy RightF f, FunctorBy RightF g, FunctorBy RightF h) => RightF f (RightF g h) <~> RightF (RightF f g) h Source #

appendNE :: forall (f :: Type -> Type). RightF (NonEmptyBy RightF f) (NonEmptyBy RightF f) ~> NonEmptyBy RightF f Source #

matchNE :: forall (f :: Type -> Type). FunctorBy RightF f => NonEmptyBy RightF f ~> (f :+: RightF f (NonEmptyBy RightF f)) Source #

consNE :: forall (f :: Type -> Type). RightF f (NonEmptyBy RightF f) ~> NonEmptyBy RightF f Source #

toNonEmptyBy :: forall (f :: Type -> Type). RightF f f ~> NonEmptyBy RightF f Source #

SemigroupIn (RightF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) f Source # 
Instance details

Defined in Data.HBifunctor.Associative

Methods

biretract :: RightF f f ~> f Source #

binterpret :: forall (g :: Type -> Type) (h :: Type -> Type). (g ~> f) -> (h ~> f) -> RightF g h ~> f Source #

Functor g => Functor (RightF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

fmap :: (a -> b) -> RightF f g a -> RightF f g b #

(<$) :: a -> RightF f g b -> RightF f g a #

Foldable g => Foldable (RightF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

fold :: Monoid m => RightF f g m -> m #

foldMap :: Monoid m => (a -> m) -> RightF f g a -> m #

foldMap' :: Monoid m => (a -> m) -> RightF f g a -> m #

foldr :: (a -> b -> b) -> b -> RightF f g a -> b #

foldr' :: (a -> b -> b) -> b -> RightF f g a -> b #

foldl :: (b -> a -> b) -> b -> RightF f g a -> b #

foldl' :: (b -> a -> b) -> b -> RightF f g a -> b #

foldr1 :: (a -> a -> a) -> RightF f g a -> a #

foldl1 :: (a -> a -> a) -> RightF f g a -> a #

toList :: RightF f g a -> [a] #

null :: RightF f g a -> Bool #

length :: RightF f g a -> Int #

elem :: Eq a => a -> RightF f g a -> Bool #

maximum :: Ord a => RightF f g a -> a #

minimum :: Ord a => RightF f g a -> a #

sum :: Num a => RightF f g a -> a #

product :: Num a => RightF f g a -> a #

Traversable g => Traversable (RightF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

traverse :: Applicative f0 => (a -> f0 b) -> RightF f g a -> f0 (RightF f g b) #

sequenceA :: Applicative f0 => RightF f g (f0 a) -> f0 (RightF f g a) #

mapM :: Monad m => (a -> m b) -> RightF f g a -> m (RightF f g b) #

sequence :: Monad m => RightF f g (m a) -> m (RightF f g a) #

Eq1 g => Eq1 (RightF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

liftEq :: (a -> b -> Bool) -> RightF f g a -> RightF f g b -> Bool #

Ord1 g => Ord1 (RightF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

liftCompare :: (a -> b -> Ordering) -> RightF f g a -> RightF f g b -> Ordering #

Read1 g => Read1 (RightF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (RightF f g a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [RightF f g a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (RightF f g a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [RightF f g a] #

Show1 g => Show1 (RightF f g) Source # 
Instance details

Defined in Data.HBifunctor

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> RightF f g a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [RightF f g a] -> ShowS #

Eq (g a) => Eq (RightF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

(==) :: RightF f g a -> RightF f g a -> Bool #

(/=) :: RightF f g a -> RightF f g a -> Bool #

(Typeable f, Typeable a, Typeable g, Typeable k1, Typeable k2, Data (g a)) => Data (RightF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g0. g0 -> c g0) -> RightF f g a -> c (RightF f g a) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (RightF f g a) #

toConstr :: RightF f g a -> Constr #

dataTypeOf :: RightF f g a -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (RightF f g a)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (RightF f g a)) #

gmapT :: (forall b. Data b => b -> b) -> RightF f g a -> RightF f g a #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> RightF f g a -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> RightF f g a -> r #

gmapQ :: (forall d. Data d => d -> u) -> RightF f g a -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> RightF f g a -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> RightF f g a -> m (RightF f g a) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> RightF f g a -> m (RightF f g a) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> RightF f g a -> m (RightF f g a) #

Ord (g a) => Ord (RightF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

compare :: RightF f g a -> RightF f g a -> Ordering #

(<) :: RightF f g a -> RightF f g a -> Bool #

(<=) :: RightF f g a -> RightF f g a -> Bool #

(>) :: RightF f g a -> RightF f g a -> Bool #

(>=) :: RightF f g a -> RightF f g a -> Bool #

max :: RightF f g a -> RightF f g a -> RightF f g a #

min :: RightF f g a -> RightF f g a -> RightF f g a #

Read (g a) => Read (RightF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

readsPrec :: Int -> ReadS (RightF f g a) #

readList :: ReadS [RightF f g a] #

readPrec :: ReadPrec (RightF f g a) #

readListPrec :: ReadPrec [RightF f g a] #

Show (g a) => Show (RightF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Methods

showsPrec :: Int -> RightF f g a -> ShowS #

show :: RightF f g a -> String #

showList :: [RightF f g a] -> ShowS #

Generic (RightF f g a) Source # 
Instance details

Defined in Data.HBifunctor

Associated Types

type Rep (RightF f g a) :: Type -> Type #

Methods

from :: RightF f g a -> Rep (RightF f g a) x #

to :: Rep (RightF f g a) x -> RightF f g a #

type NonEmptyBy (RightF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type NonEmptyBy (RightF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Step :: (Type -> Type) -> Type -> Type
type FunctorBy (RightF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in Data.HBifunctor.Associative

type FunctorBy (RightF :: (Type -> Type) -> (Type -> Type) -> Type -> Type) = Unconstrained :: (Type -> Type) -> Constraint
type Rep (RightF f g a) Source # 
Instance details

Defined in Data.HBifunctor

type Rep (RightF f g a) = D1 ('MetaData "RightF" "Data.HBifunctor" "functor-combinators-0.3.4.0-inplace" 'True) (C1 ('MetaCons "RightF" 'PrefixI 'True) (S1 ('MetaSel ('Just "runRightF") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g a))))

Combinator Combinators

data HLift t f a Source #

An "HFunctor combinator" that enhances an HFunctor with the ability to hold a single f a. This is the higher-order analogue of Lift.

You can think of it as a free Inject for any f.

Note that HLift IdentityT is equivalent to EnvT Any.

Constructors

HPure (f a) 
HOther (t f a) 

Instances

Instances details
HFunctor t => HFunctor (HLift t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> HLift t f ~> HLift t g Source #

(HBind t, Inject t) => HBind (HLift t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> HLift t g) -> HLift t f ~> HLift t g Source #

hjoin :: forall (f :: k0 -> Type). HLift t (HLift t f) ~> HLift t f Source #

HFunctor t => Inject (HLift t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> HLift t f Source #

Interpret t f => Interpret (HLift t :: (k -> Type) -> k -> Type) (f :: k -> Type) Source #

Never uses inject

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: HLift t f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> HLift t g ~> f Source #

(Functor f, Functor (t f)) => Functor (HLift t f) Source # 
Instance details

Defined in Data.HFunctor

Methods

fmap :: (a -> b) -> HLift t f a -> HLift t f b #

(<$) :: a -> HLift t f b -> HLift t f a #

(Contravariant f, Contravariant (t f)) => Contravariant (HLift t f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

contramap :: (a -> b) -> HLift t f b -> HLift t f a #

(>$) :: b -> HLift t f b -> HLift t f a #

(Eq1 (t f), Eq1 f) => Eq1 (HLift t f) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftEq :: (a -> b -> Bool) -> HLift t f a -> HLift t f b -> Bool #

(Ord1 (t f), Ord1 f) => Ord1 (HLift t f) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftCompare :: (a -> b -> Ordering) -> HLift t f a -> HLift t f b -> Ordering #

(Show1 (t f), Show1 f) => Show1 (HLift t f) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> HLift t f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [HLift t f a] -> ShowS #

(Invariant f, Invariant (t f)) => Invariant (HLift t f) Source #

Since: 0.3.0.0

Instance details

Defined in Data.HFunctor

Methods

invmap :: (a -> b) -> (b -> a) -> HLift t f a -> HLift t f b #

(Eq (f a), Eq (t f a)) => Eq (HLift t f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

(==) :: HLift t f a -> HLift t f a -> Bool #

(/=) :: HLift t f a -> HLift t f a -> Bool #

(Ord (f a), Ord (t f a)) => Ord (HLift t f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

compare :: HLift t f a -> HLift t f a -> Ordering #

(<) :: HLift t f a -> HLift t f a -> Bool #

(<=) :: HLift t f a -> HLift t f a -> Bool #

(>) :: HLift t f a -> HLift t f a -> Bool #

(>=) :: HLift t f a -> HLift t f a -> Bool #

max :: HLift t f a -> HLift t f a -> HLift t f a #

min :: HLift t f a -> HLift t f a -> HLift t f a #

(Read (f a), Read (t f a)) => Read (HLift t f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

readsPrec :: Int -> ReadS (HLift t f a) #

readList :: ReadS [HLift t f a] #

readPrec :: ReadPrec (HLift t f a) #

readListPrec :: ReadPrec [HLift t f a] #

(Show (f a), Show (t f a)) => Show (HLift t f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

showsPrec :: Int -> HLift t f a -> ShowS #

show :: HLift t f a -> String #

showList :: [HLift t f a] -> ShowS #

data HFree t f a Source #

An "HFunctor combinator" that turns an HFunctor into potentially infinite nestings of that HFunctor.

An HFree t f a is either f a, t f a, t (t f) a, t (t (t f)) a, etc.

This effectively turns t into a tree with t branches.

One particularly useful usage is with MapF. For example if you had a data type representing a command line command parser:

data Command a

You could represent "many possible named commands" using

type Commands = MapF String Command

And you can represent multiple nested named commands using:

type NestedCommands = HFree (MapF String)

This has an Interpret instance, but it can be more useful to use via direct pattern matching, or through

foldHFree
    :: HBifunctor t
    => f ~> g
    -> t g ~> g
    -> HFree t f ~> g

which requires no extra constriant on g, and lets you consider each branch separately.

This can be considered the higher-oder analogue of Free; it is the free HBind for any HFunctor t.

Note that HFree IdentityT is equivalent to Step.

Constructors

HReturn (f a) 
HJoin (t (HFree t f) a) 

Instances

Instances details
HFunctor t => HFunctor (HFree t :: (k -> Type) -> k -> Type) Source # 
Instance details

Defined in Data.HFunctor

Methods

hmap :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> g) -> HFree t f ~> HFree t g Source #

HFunctor t => HBind (HFree t :: (k -> Type) -> k -> Type) Source #

HFree is the "free HBind" for any HFunctor

Instance details

Defined in Data.HFunctor

Methods

hbind :: forall (f :: k0 -> Type) (g :: k0 -> Type). (f ~> HFree t g) -> HFree t f ~> HFree t g Source #

hjoin :: forall (f :: k0 -> Type). HFree t (HFree t f) ~> HFree t f Source #

HFunctor t => Inject (HFree t :: (k -> Type) -> k -> Type) Source #

HFree is the "free HBind and Inject" for any HFunctor

Instance details

Defined in Data.HFunctor

Methods

inject :: forall (f :: k0 -> Type). f ~> HFree t f Source #

Interpret t f => Interpret (HFree t :: (k -> Type) -> k -> Type) (f :: k -> Type) Source #

Never uses inject

Instance details

Defined in Data.HFunctor.Interpret

Methods

retract :: HFree t f ~> f Source #

interpret :: forall (g :: k0 -> Type). (g ~> f) -> HFree t g ~> f Source #

(Functor f, Functor (t (HFree t f))) => Functor (HFree t f) Source # 
Instance details

Defined in Data.HFunctor

Methods

fmap :: (a -> b) -> HFree t f a -> HFree t f b #

(<$) :: a -> HFree t f b -> HFree t f a #

(Contravariant f, Contravariant (t (HFree t f))) => Contravariant (HFree t f) Source # 
Instance details

Defined in Data.HFunctor

Methods

contramap :: (a -> b) -> HFree t f b -> HFree t f a #

(>$) :: b -> HFree t f b -> HFree t f a #

(Show1 (t (HFree t f)), Show1 f) => Show1 (HFree t f) Source # 
Instance details

Defined in Data.HFunctor

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> HFree t f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [HFree t f a] -> ShowS #

(Invariant f, Invariant (t (HFree t f))) => Invariant (HFree t f) Source # 
Instance details

Defined in Data.HFunctor

Methods

invmap :: (a -> b) -> (b -> a) -> HFree t f a -> HFree t f b #

(Show1 (t (HFree t f)), Show1 f, Show a) => Show (HFree t f a) Source # 
Instance details

Defined in Data.HFunctor

Methods

showsPrec :: Int -> HFree t f a -> ShowS #

show :: HFree t f a -> String #

showList :: [HFree t f a] -> ShowS #

Util

Natural Transformations

generalize :: Applicative f => Identity ~> f Source #

Turn Identity into any Applicative f. Can be useful as an argument to hmap, hbimap, or interpret.

It is a more general form of generalize from mmorph.

absorb :: f ~> Proxy Source #

Natural transformation from any functor f into Proxy. Can be useful for "zeroing out" a functor with hmap or hbimap or interpret.

Divisible

dsum :: (Foldable t, Divisible f) => t (f a) -> f a Source #

Convenient helper function to build up a Divisible by splitting input across many different f as. Most useful when used alongside contramap:

dsum [
    contramap get1 x
  , contramap get2 y
  , contramap get3 z
  ]

Since: 0.3.3.0

dsum1 :: (Foldable1 t, Divise f) => t (f a) -> f a Source #

Convenient helper function to build up a Divise by splitting input across many different f as. Most useful when used alongside contramap:

dsum1 $ contramap get1 x
   :| [ contramap get2 y
      , contramap get3 z
      ]

Since: 0.3.3.0

concludeN :: Conclude f => NP f as -> f (NS I as) Source #

Convenient helper function to build up a Conclude by providing each component of it. This makes it much easier to build up longer chains as opposed to nested calls to decide and manually peeling off eithers one-by-one.

For example, if you had a data type

data MyType = MTI Int | MTB Bool | MTS String

and a contravariant consumer Builder (representing, say, a way to serialize an item, where intBuilder :: Builder Int is a serializer of Ints), then you could assemble a serializer a MyType using:

contramap (case MTI x -> Z (I x); MTB y -> S (Z (I y)); MTS z -> S (S (Z (I z)))) $
  concludeN $ intBuilder
           :* boolBuilder
           :* stringBuilder
           :* Nil

Some notes on usefulness depending on how many components you have:

  • If you have 0 components, use conclude.
  • If you have 1 component, use inject directly.
  • If you have 2 components, use decide directly.
  • If you have 3 or more components, these combinators may be useful; otherwise you'd need to manually peel off eithers one-by-one.

Since: 0.3.0.0

decideN :: Decide f => NP f (a ': as) -> f (NS I (a ': as)) Source #

A version of concludeN that works for non-empty NP/NS, and so only requires a Decide constraint.

Since: 0.3.0.0