functor-combinators-0.4.1.2: Tools for functor combinator-based program design
Copyright(c) Justin Le 2021
LicenseBSD3
Maintainerjustin@jle.im
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Functor.Invariant.Inplicative

Description

Contains the classes Inply and Inplicative, the invariant counterparts to ApplyDivise and ApplicativeDivisible.

Since: 0.4.0.0

Synopsis

Typeclass

class Invariant f => Inply f where Source #

The invariant counterpart of Apply and Divise.

Conceptually you can think of Apply as, given a way to "combine" a and b to c, lets you merge f a (producer of a) and f b (producer of b) into a f c (producer of c). Divise can be thought of as, given a way to "split" a c into an a and a b, lets you merge f a (consumer of a) and f b (consumder of b) into a f c (consumer of c).

Inply, for gather, requires both a combining function and a splitting function in order to merge f b (producer and consumer of b) and f c (producer and consumer of c) into a f a. You can think of it as, for the f a, it "splits" the a into b and c with the a -> (b, c), feeds it to the original f b and f c, and then re-combines the output back into a a with the b -> c -> a.

Since: 0.4.0.0

Minimal complete definition

gather | gathered

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> f b -> f c -> f a Source #

Like <.>, <*>, divise, or divide, but requires both a splitting and a recombining function. <.> and <*> require only a combining function, and divise and divide require only a splitting function.

It is used to merge f b (producer and consumer of b) and f c (producer and consumer of c) into a f a. You can think of it as, for the f a, it "splits" the a into b and c with the a -> (b, c), feeds it to the original f b and f c, and then re-combines the output back into a a with the b -> c -> a.

An important property is that it will always use both of the ccomponents given in order to fulfil its job. If you gather an f a and an f b into an f c, in order to consume/produdce the c, it will always use both the f a or the f b -- exactly one of them.

Since: 0.4.0.0

gathered :: f a -> f b -> f (a, b) Source #

A simplified version of gather that combines into a tuple. You can then use invmap to reshape it into the proper shape.

Since: 0.4.0.0

Instances

Instances details
Inply SettableStateVar Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> SettableStateVar b -> SettableStateVar c -> SettableStateVar a Source #

gathered :: SettableStateVar a -> SettableStateVar b -> SettableStateVar (a, b) Source #

Inply ZipList Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> ZipList b -> ZipList c -> ZipList a Source #

gathered :: ZipList a -> ZipList b -> ZipList (a, b) Source #

Inply Complex Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Complex b -> Complex c -> Complex a Source #

gathered :: Complex a -> Complex b -> Complex (a, b) Source #

Inply Comparison Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Comparison b -> Comparison c -> Comparison a Source #

gathered :: Comparison a -> Comparison b -> Comparison (a, b) Source #

Inply Equivalence Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Equivalence b -> Equivalence c -> Equivalence a Source #

gathered :: Equivalence a -> Equivalence b -> Equivalence (a, b) Source #

Inply Predicate Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Predicate b -> Predicate c -> Predicate a Source #

gathered :: Predicate a -> Predicate b -> Predicate (a, b) Source #

Inply Identity Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Identity b -> Identity c -> Identity a Source #

gathered :: Identity a -> Identity b -> Identity (a, b) Source #

Inply First Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> First b -> First c -> First a Source #

gathered :: First a -> First b -> First (a, b) Source #

Inply Last Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Last b -> Last c -> Last a Source #

gathered :: Last a -> Last b -> Last (a, b) Source #

Inply First Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> First b -> First c -> First a Source #

gathered :: First a -> First b -> First (a, b) Source #

Inply Last Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Last b -> Last c -> Last a Source #

gathered :: Last a -> Last b -> Last (a, b) Source #

Inply Max Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Max b -> Max c -> Max a Source #

gathered :: Max a -> Max b -> Max (a, b) Source #

Inply Min Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Min b -> Min c -> Min a Source #

gathered :: Min a -> Min b -> Min (a, b) Source #

Inply Dual Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Dual b -> Dual c -> Dual a Source #

gathered :: Dual a -> Dual b -> Dual (a, b) Source #

Inply Product Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Product b -> Product c -> Product a Source #

gathered :: Product a -> Product b -> Product (a, b) Source #

Inply Sum Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Sum b -> Sum c -> Sum a Source #

gathered :: Sum a -> Sum b -> Sum (a, b) Source #

Inply Par1 Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Par1 b -> Par1 c -> Par1 a Source #

gathered :: Par1 a -> Par1 b -> Par1 (a, b) Source #

Inply IntMap Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> IntMap b -> IntMap c -> IntMap a Source #

gathered :: IntMap a -> IntMap b -> IntMap (a, b) Source #

Inply Seq Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Seq b -> Seq c -> Seq a Source #

gathered :: Seq a -> Seq b -> Seq (a, b) Source #

Inply Tree Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Tree b -> Tree c -> Tree a Source #

gathered :: Tree a -> Tree b -> Tree (a, b) Source #

Inply IO Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> IO b -> IO c -> IO a Source #

gathered :: IO a -> IO b -> IO (a, b) Source #

Inply NESeq Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> NESeq b -> NESeq c -> NESeq a Source #

gathered :: NESeq a -> NESeq b -> NESeq (a, b) Source #

Inply NonEmpty Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> NonEmpty b -> NonEmpty c -> NonEmpty a Source #

gathered :: NonEmpty a -> NonEmpty b -> NonEmpty (a, b) Source #

Inply Maybe Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Maybe b -> Maybe c -> Maybe a Source #

gathered :: Maybe a -> Maybe b -> Maybe (a, b) Source #

Inply [] Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> [b] -> [c] -> [a] Source #

gathered :: [a] -> [b] -> [(a, b)] Source #

FreeOf Inply DivAp1 Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy DivAp1 :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). DivAp1 f ~> Final Inply f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy DivAp1 f => Final Inply f ~> DivAp1 f Source #

Monad m => Inply (WrappedMonad m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> WrappedMonad m b -> WrappedMonad m c -> WrappedMonad m a Source #

gathered :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m (a, b) Source #

Inply (Either e) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Either e b -> Either e c -> Either e a Source #

gathered :: Either e a -> Either e b -> Either e (a, b) Source #

Semigroup r => Inply (Op r) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Op r b -> Op r c -> Op r a Source #

gathered :: Op r a -> Op r b -> Op r (a, b) Source #

Inply (Proxy :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Proxy b -> Proxy c -> Proxy a Source #

gathered :: Proxy a -> Proxy b -> Proxy (a, b) Source #

Inply (U1 :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> U1 b -> U1 c -> U1 a Source #

gathered :: U1 a -> U1 b -> U1 (a, b) Source #

Inply (V1 :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> V1 b -> V1 c -> V1 a Source #

gathered :: V1 a -> V1 b -> V1 (a, b) Source #

Ord k => Inply (Map k) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Map k b -> Map k c -> Map k a Source #

gathered :: Map k a -> Map k b -> Map k (a, b) Source #

Inply (Div f) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Div f b -> Div f c -> Div f a Source #

gathered :: Div f a -> Div f b -> Div f (a, b) Source #

Inply (Div1 f) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Div1 f b -> Div1 f c -> Div1 f a Source #

gathered :: Div1 f a -> Div1 f b -> Div1 f (a, b) Source #

Inply (DivAp f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative.Free

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> DivAp f b -> DivAp f c -> DivAp f a Source #

gathered :: DivAp f a -> DivAp f b -> DivAp f (a, b) Source #

Invariant f => Inply (DivAp1 f) Source #

The free Inplicative

Instance details

Defined in Data.Functor.Invariant.Inplicative.Free

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> DivAp1 f b -> DivAp1 f c -> DivAp1 f a Source #

gathered :: DivAp1 f a -> DivAp1 f b -> DivAp1 f (a, b) Source #

Inply f => Inply (Lift f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Lift f b -> Lift f c -> Lift f a Source #

gathered :: Lift f a -> Lift f b -> Lift f (a, b) Source #

Inply f => Inply (ListT f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> ListT f b -> ListT f c -> ListT f a Source #

gathered :: ListT f a -> ListT f b -> ListT f (a, b) Source #

Inply f => Inply (MaybeT f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> MaybeT f b -> MaybeT f c -> MaybeT f a Source #

gathered :: MaybeT f a -> MaybeT f b -> MaybeT f (a, b) Source #

Hashable k => Inply (HashMap k) Source #

Does not require Eq k since base-4.16

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> HashMap k b -> HashMap k c -> HashMap k a Source #

gathered :: HashMap k a -> HashMap k b -> HashMap k (a, b) Source #

Semigroup w => Inply ((,) w) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

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

gathered :: (w, a) -> (w, b) -> (w, (a, b)) Source #

Arrow a => Inply (WrappedArrow a b) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b0 -> c -> a0) -> (a0 -> (b0, c)) -> WrappedArrow a b b0 -> WrappedArrow a b c -> WrappedArrow a b a0 Source #

gathered :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b (a0, b0) Source #

Semigroup w => Inply (Const w :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Const w b -> Const w c -> Const w a Source #

gathered :: Const w a -> Const w b -> Const w (a, b) Source #

Inply f => Inply (Alt f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Alt f b -> Alt f c -> Alt f a Source #

gathered :: Alt f a -> Alt f b -> Alt f (a, b) Source #

Inply f => Inply (Rec1 f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Rec1 f b -> Rec1 f c -> Rec1 f a Source #

gathered :: Rec1 f a -> Rec1 f b -> Rec1 f (a, b) Source #

Divise f => Inply (WrappedDivisible f) Source #

Ignores the covariant part of gather

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> WrappedDivisible f b -> WrappedDivisible f c -> WrappedDivisible f a Source #

gathered :: WrappedDivisible f a -> WrappedDivisible f b -> WrappedDivisible f (a, b) Source #

(Applicative f, Invariant f) => Inply (WrappedApplicativeOnly f) Source #

Ignores the contravariant part of gather

Instance details

Defined in Data.Functor.Invariant.Inplicative

(Divisible f, Invariant f) => Inply (WrappedDivisibleOnly f) Source #

Ignores the covariant part of gather

Instance details

Defined in Data.Functor.Invariant.Inplicative

Divise f => Inply (WrappedContravariant f) Source #

Ignores the covariant part of gather

Instance details

Defined in Data.Functor.Invariant.Inplicative

Apply f => Inply (WrappedFunctor f) Source #

Ignores the contravariant part of gather

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> WrappedFunctor f b -> WrappedFunctor f c -> WrappedFunctor f a Source #

gathered :: WrappedFunctor f a -> WrappedFunctor f b -> WrappedFunctor f (a, b) Source #

Inply (Tagged a) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a0) -> (a0 -> (b, c)) -> Tagged a b -> Tagged a c -> Tagged a a0 Source #

gathered :: Tagged a a0 -> Tagged a b -> Tagged a (a0, b) Source #

Inply f => Inply (Backwards f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Backwards f b -> Backwards f c -> Backwards f a Source #

gathered :: Backwards f a -> Backwards f b -> Backwards f (a, b) Source #

Inply f => Inply (ErrorT e f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> ErrorT e f b -> ErrorT e f c -> ErrorT e f a Source #

gathered :: ErrorT e f a -> ErrorT e f b -> ErrorT e f (a, b) Source #

Inply f => Inply (ExceptT e f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> ExceptT e f b -> ExceptT e f c -> ExceptT e f a Source #

gathered :: ExceptT e f a -> ExceptT e f b -> ExceptT e f (a, b) Source #

Inply f => Inply (IdentityT f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> IdentityT f b -> IdentityT f c -> IdentityT f a Source #

gathered :: IdentityT f a -> IdentityT f b -> IdentityT f (a, b) Source #

Inply f => Inply (ReaderT r f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> ReaderT r f b -> ReaderT r f c -> ReaderT r f a Source #

gathered :: ReaderT r f a -> ReaderT r f b -> ReaderT r f (a, b) Source #

(Bind m, Invariant m) => Inply (StateT s m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> StateT s m b -> StateT s m c -> StateT s m a Source #

gathered :: StateT s m a -> StateT s m b -> StateT s m (a, b) Source #

(Bind m, Invariant m) => Inply (StateT s m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> StateT s m b -> StateT s m c -> StateT s m a Source #

gathered :: StateT s m a -> StateT s m b -> StateT s m (a, b) Source #

(Inply f, Semigroup w) => Inply (WriterT w f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> WriterT w f b -> WriterT w f c -> WriterT w f a Source #

gathered :: WriterT w f a -> WriterT w f b -> WriterT w f (a, b) Source #

(Inply f, Semigroup w) => Inply (WriterT w f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> WriterT w f b -> WriterT w f c -> WriterT w f a Source #

gathered :: WriterT w f a -> WriterT w f b -> WriterT w f (a, b) Source #

Semigroup w => Inply (Constant w :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Constant w b -> Constant w c -> Constant w a Source #

gathered :: Constant w a -> Constant w b -> Constant w (a, b) Source #

Inply f => Inply (Reverse f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Reverse f b -> Reverse f c -> Reverse f a Source #

gathered :: Reverse f a -> Reverse f b -> Reverse f (a, b) Source #

(Inply f, Inply g) => Inply (Product f g) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Product f g b -> Product f g c -> Product f g a Source #

gathered :: Product f g a -> Product f g b -> Product f g (a, b) Source #

(Inply f, Inply g) => Inply (f :*: g) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> (f :*: g) b -> (f :*: g) c -> (f :*: g) a Source #

gathered :: (f :*: g) a -> (f :*: g) b -> (f :*: g) (a, b) Source #

Semigroup c => Inply (K1 i c :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c0 -> a) -> (a -> (b, c0)) -> K1 i c b -> K1 i c c0 -> K1 i c a Source #

gathered :: K1 i c a -> K1 i c b -> K1 i c (a, b) Source #

Invariant f => Inply (Chain1 Day f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Chain

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Chain1 Day f b -> Chain1 Day f c -> Chain1 Day f a Source #

gathered :: Chain1 Day f a -> Chain1 Day f b -> Chain1 Day f (a, b) Source #

Inply (Final Inplicative f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Final Inplicative f b -> Final Inplicative f c -> Final Inplicative f a Source #

gathered :: Final Inplicative f a -> Final Inplicative f b -> Final Inplicative f (a, b) Source #

Inply (Final Inply f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Final Inply f b -> Final Inply f c -> Final Inply f a Source #

gathered :: Final Inply f a -> Final Inply f b -> Final Inply f (a, b) Source #

Inply (Final Internative f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Final Internative f b -> Final Internative f c -> Final Internative f a Source #

gathered :: Final Internative f a -> Final Internative f b -> Final Internative f (a, b) Source #

Inply (ContT r m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> ContT r m b -> ContT r m c -> ContT r m a Source #

gathered :: ContT r m a -> ContT r m b -> ContT r m (a, b) Source #

Inply ((->) r) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> (r -> b) -> (r -> c) -> r -> a Source #

gathered :: (r -> a) -> (r -> b) -> r -> (a, b) Source #

Invariant (Final Inply f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

invmap :: (a -> b) -> (b -> a) -> Final Inply f a -> Final Inply f b #

Inply f => Inply (M1 i t f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> M1 i t f b -> M1 i t f c -> M1 i t f a Source #

gathered :: M1 i t f a -> M1 i t f b -> M1 i t f (a, b) Source #

(Bind m, Invariant m, Semigroup w) => Inply (RWST r w s m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> RWST r w s m b -> RWST r w s m c -> RWST r w s m a Source #

gathered :: RWST r w s m a -> RWST r w s m b -> RWST r w s m (a, b) Source #

(Bind m, Invariant m, Semigroup w) => Inply (RWST r w s m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> RWST r w s m b -> RWST r w s m c -> RWST r w s m a Source #

gathered :: RWST r w s m a -> RWST r w s m b -> RWST r w s m (a, b) Source #

Inply (Chain Day Identity f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Chain

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Chain Day Identity f b -> Chain Day Identity f c -> Chain Day Identity f a Source #

gathered :: Chain Day Identity f a -> Chain Day Identity f b -> Chain Day Identity f (a, b) Source #

class Inply f => Inplicative f where Source #

The invariant counterpart of Applicative and Divisible.

The main important action is described in Inply, but this adds knot, which is the counterpart to pure and conquer. It's the identity to gather; if combine two f as with gather, and one of them is knot, it will leave the structure unchanged.

Conceptually, if you think of gather as "splitting and re-combining" along multiple forks, then knot introduces a fork that is never taken.

Since: 0.4.0.0

Methods

knot :: a -> f a Source #

Instances

Instances details
Inplicative SettableStateVar Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> SettableStateVar a Source #

Inplicative ZipList Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> ZipList a Source #

Inplicative Complex Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Complex a Source #

Inplicative Comparison Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Comparison a Source #

Inplicative Equivalence Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Equivalence a Source #

Inplicative Predicate Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Predicate a Source #

Inplicative Identity Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Identity a Source #

Inplicative First Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> First a Source #

Inplicative Last Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Last a Source #

Inplicative First Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> First a Source #

Inplicative Last Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Last a Source #

Inplicative Max Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Max a Source #

Inplicative Min Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Min a Source #

Inplicative Dual Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Dual a Source #

Inplicative Product Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Product a Source #

Inplicative Sum Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Sum a Source #

Inplicative Par1 Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Par1 a Source #

Inplicative Seq Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Seq a Source #

Inplicative Tree Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Tree a Source #

Inplicative IO Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> IO a Source #

Inplicative NonEmpty Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> NonEmpty a Source #

Inplicative Maybe Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Maybe a Source #

Inplicative [] Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> [a] Source #

FreeOf Inplicative DivAp Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Associated Types

type FreeFunctorBy DivAp :: (Type -> Type) -> Constraint Source #

Methods

fromFree :: forall (f :: Type -> Type). DivAp f ~> Final Inplicative f Source #

toFree :: forall (f :: Type -> Type). FreeFunctorBy DivAp f => Final Inplicative f ~> DivAp f Source #

Monad m => Inplicative (WrappedMonad m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WrappedMonad m a Source #

Inplicative (Either e) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Either e a Source #

Monoid r => Inplicative (Op r) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Op r a Source #

Inplicative (Proxy :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Proxy a Source #

Inplicative (U1 :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> U1 a Source #

Inplicative (Div f) Source # 
Instance details

Defined in Data.Functor.Contravariant.Divisible.Free

Methods

knot :: a -> Div f a Source #

Inplicative (DivAp f) Source #

The free Inplicative

Instance details

Defined in Data.Functor.Invariant.Inplicative.Free

Methods

knot :: a -> DivAp f a Source #

Inply f => Inplicative (Lift f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Lift f a Source #

Inplicative f => Inplicative (ListT f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> ListT f a Source #

Inplicative f => Inplicative (MaybeT f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> MaybeT f a Source #

Monoid w => Inplicative ((,) w) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> (w, a) Source #

Arrow a => Inplicative (WrappedArrow a b) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a0 -> WrappedArrow a b a0 Source #

Monoid w => Inplicative (Const w :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Const w a Source #

Inplicative f => Inplicative (Alt f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Alt f a Source #

Inplicative f => Inplicative (Rec1 f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Rec1 f a Source #

(Divisible f, Divise f) => Inplicative (WrappedDivisible f) Source #
knot _ = conquer
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WrappedDivisible f a Source #

(Applicative f, Invariant f) => Inplicative (WrappedApplicativeOnly f) Source #
knot = pure
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WrappedApplicativeOnly f a Source #

(Divisible f, Invariant f) => Inplicative (WrappedDivisibleOnly f) Source #
knot _ = conquer
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WrappedDivisibleOnly f a Source #

(Divisible f, Divise f) => Inplicative (WrappedContravariant f) Source #
knot _ = conquer
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WrappedContravariant f a Source #

(Applicative f, Apply f) => Inplicative (WrappedFunctor f) Source #
knot = pure
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WrappedFunctor f a Source #

Inplicative (Tagged a) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a0 -> Tagged a a0 Source #

Inplicative f => Inplicative (Backwards f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Backwards f a Source #

Inplicative f => Inplicative (ErrorT e f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> ErrorT e f a Source #

Inplicative f => Inplicative (ExceptT e f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> ExceptT e f a Source #

Inplicative f => Inplicative (IdentityT f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> IdentityT f a Source #

Inplicative f => Inplicative (ReaderT r f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> ReaderT r f a Source #

(Monad m, Bind m, Invariant m) => Inplicative (StateT s m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> StateT s m a Source #

(Monad m, Bind m, Invariant m) => Inplicative (StateT s m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> StateT s m a Source #

(Inplicative f, Monoid w) => Inplicative (WriterT w f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WriterT w f a Source #

(Inplicative f, Monoid w) => Inplicative (WriterT w f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WriterT w f a Source #

Monoid w => Inplicative (Constant w :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Constant w a Source #

Inplicative f => Inplicative (Reverse f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Reverse f a Source #

(Inplicative f, Inplicative g) => Inplicative (Product f g) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> Product f g a Source #

(Inplicative f, Inplicative g) => Inplicative (f :*: g) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> (f :*: g) a Source #

Monoid c => Inplicative (K1 i c :: Type -> Type) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> K1 i c a Source #

Inplicative (Final Inplicative f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

knot :: a -> Final Inplicative f a Source #

Inplicative (Final Internative f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

knot :: a -> Final Internative f a Source #

Inplicative (ContT r m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> ContT r m a Source #

Inplicative ((->) r) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> r -> a Source #

Inply (Final Inplicative f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

gather :: (b -> c -> a) -> (a -> (b, c)) -> Final Inplicative f b -> Final Inplicative f c -> Final Inplicative f a Source #

gathered :: Final Inplicative f a -> Final Inplicative f b -> Final Inplicative f (a, b) Source #

Invariant (Final Inplicative f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Final

Methods

invmap :: (a -> b) -> (b -> a) -> Final Inplicative f a -> Final Inplicative f b #

Inplicative f => Inplicative (M1 i t f) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> M1 i t f a Source #

(Monad m, Bind m, Invariant m, Monoid w) => Inplicative (RWST r w s m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> RWST r w s m a Source #

(Monad m, Bind m, Invariant m, Monoid w) => Inplicative (RWST r w s m) Source #

Since: 0.4.1.0

Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> RWST r w s m a Source #

Inplicative (Chain Day Identity f) Source #

Since: 0.4.0.0

Instance details

Defined in Data.HFunctor.Chain

Methods

knot :: a -> Chain Day Identity f a Source #

Deriving

newtype WrappedApplicativeOnly f a Source #

Wrap an Applicative that is not necessarily an Apply.

Constructors

WrapApplicativeOnly 

Fields

Instances

Instances details
Foldable f => Foldable (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

fold :: Monoid m => WrappedApplicativeOnly f m -> m #

foldMap :: Monoid m => (a -> m) -> WrappedApplicativeOnly f a -> m #

foldMap' :: Monoid m => (a -> m) -> WrappedApplicativeOnly f a -> m #

foldr :: (a -> b -> b) -> b -> WrappedApplicativeOnly f a -> b #

foldr' :: (a -> b -> b) -> b -> WrappedApplicativeOnly f a -> b #

foldl :: (b -> a -> b) -> b -> WrappedApplicativeOnly f a -> b #

foldl' :: (b -> a -> b) -> b -> WrappedApplicativeOnly f a -> b #

foldr1 :: (a -> a -> a) -> WrappedApplicativeOnly f a -> a #

foldl1 :: (a -> a -> a) -> WrappedApplicativeOnly f a -> a #

toList :: WrappedApplicativeOnly f a -> [a] #

null :: WrappedApplicativeOnly f a -> Bool #

length :: WrappedApplicativeOnly f a -> Int #

elem :: Eq a => a -> WrappedApplicativeOnly f a -> Bool #

maximum :: Ord a => WrappedApplicativeOnly f a -> a #

minimum :: Ord a => WrappedApplicativeOnly f a -> a #

sum :: Num a => WrappedApplicativeOnly f a -> a #

product :: Num a => WrappedApplicativeOnly f a -> a #

Eq1 f => Eq1 (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

liftEq :: (a -> b -> Bool) -> WrappedApplicativeOnly f a -> WrappedApplicativeOnly f b -> Bool #

Ord1 f => Ord1 (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Read1 f => Read1 (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Show1 f => Show1 (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> WrappedApplicativeOnly f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [WrappedApplicativeOnly f a] -> ShowS #

Traversable f => Traversable (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Applicative f => Applicative (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Functor f => Functor (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Monad f => Monad (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

(Applicative f, Invariant f) => Inplicative (WrappedApplicativeOnly f) Source #
knot = pure
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WrappedApplicativeOnly f a Source #

(Applicative f, Invariant f) => Inply (WrappedApplicativeOnly f) Source #

Ignores the contravariant part of gather

Instance details

Defined in Data.Functor.Invariant.Inplicative

Invariant f => Invariant (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

invmap :: (a -> b) -> (b -> a) -> WrappedApplicativeOnly f a -> WrappedApplicativeOnly f b #

(Applicative f, Invariant f) => Apply (WrappedApplicativeOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Generic (WrappedApplicativeOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Associated Types

type Rep (WrappedApplicativeOnly f a) :: Type -> Type #

Read (f a) => Read (WrappedApplicativeOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Show (f a) => Show (WrappedApplicativeOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Eq (f a) => Eq (WrappedApplicativeOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Ord (f a) => Ord (WrappedApplicativeOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

type Rep (WrappedApplicativeOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

type Rep (WrappedApplicativeOnly f a) = D1 ('MetaData "WrappedApplicativeOnly" "Data.Functor.Invariant.Inplicative" "functor-combinators-0.4.1.2-6f83RuY9ReR1ECoC76WHzJ" 'True) (C1 ('MetaCons "WrapApplicativeOnly" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapApplicativeOnly") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

newtype WrappedDivisibleOnly f a Source #

Wrap an Divisible that is not necessarily a Divise.

Constructors

WrapDivisibleOnly 

Fields

Instances

Instances details
Foldable f => Foldable (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

fold :: Monoid m => WrappedDivisibleOnly f m -> m #

foldMap :: Monoid m => (a -> m) -> WrappedDivisibleOnly f a -> m #

foldMap' :: Monoid m => (a -> m) -> WrappedDivisibleOnly f a -> m #

foldr :: (a -> b -> b) -> b -> WrappedDivisibleOnly f a -> b #

foldr' :: (a -> b -> b) -> b -> WrappedDivisibleOnly f a -> b #

foldl :: (b -> a -> b) -> b -> WrappedDivisibleOnly f a -> b #

foldl' :: (b -> a -> b) -> b -> WrappedDivisibleOnly f a -> b #

foldr1 :: (a -> a -> a) -> WrappedDivisibleOnly f a -> a #

foldl1 :: (a -> a -> a) -> WrappedDivisibleOnly f a -> a #

toList :: WrappedDivisibleOnly f a -> [a] #

null :: WrappedDivisibleOnly f a -> Bool #

length :: WrappedDivisibleOnly f a -> Int #

elem :: Eq a => a -> WrappedDivisibleOnly f a -> Bool #

maximum :: Ord a => WrappedDivisibleOnly f a -> a #

minimum :: Ord a => WrappedDivisibleOnly f a -> a #

sum :: Num a => WrappedDivisibleOnly f a -> a #

product :: Num a => WrappedDivisibleOnly f a -> a #

Eq1 f => Eq1 (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

liftEq :: (a -> b -> Bool) -> WrappedDivisibleOnly f a -> WrappedDivisibleOnly f b -> Bool #

Ord1 f => Ord1 (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Read1 f => Read1 (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Show1 f => Show1 (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> WrappedDivisibleOnly f a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [WrappedDivisibleOnly f a] -> ShowS #

Contravariant f => Contravariant (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Traversable f => Traversable (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

traverse :: Applicative f0 => (a -> f0 b) -> WrappedDivisibleOnly f a -> f0 (WrappedDivisibleOnly f b) #

sequenceA :: Applicative f0 => WrappedDivisibleOnly f (f0 a) -> f0 (WrappedDivisibleOnly f a) #

mapM :: Monad m => (a -> m b) -> WrappedDivisibleOnly f a -> m (WrappedDivisibleOnly f b) #

sequence :: Monad m => WrappedDivisibleOnly f (m a) -> m (WrappedDivisibleOnly f a) #

Functor f => Functor (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Divisible f => Divisible (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

(Divisible f, Invariant f) => Divise (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

(Divisible f, Invariant f) => Inplicative (WrappedDivisibleOnly f) Source #
knot _ = conquer
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

knot :: a -> WrappedDivisibleOnly f a Source #

(Divisible f, Invariant f) => Inply (WrappedDivisibleOnly f) Source #

Ignores the covariant part of gather

Instance details

Defined in Data.Functor.Invariant.Inplicative

(Decidable f, Invariant f) => Inalt (WrappedDivisibleOnly f) Source #

Ignores the covariant part of gather

Instance details

Defined in Data.Functor.Invariant.Internative

(Decidable f, Invariant f) => Inplus (WrappedDivisibleOnly f) Source #
reject = lose
Instance details

Defined in Data.Functor.Invariant.Internative

Methods

reject :: (a -> Void) -> WrappedDivisibleOnly f a Source #

(Decidable f, Invariant f) => Internative (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Internative

Invariant f => Invariant (WrappedDivisibleOnly f) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Methods

invmap :: (a -> b) -> (b -> a) -> WrappedDivisibleOnly f a -> WrappedDivisibleOnly f b #

Generic (WrappedDivisibleOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Associated Types

type Rep (WrappedDivisibleOnly f a) :: Type -> Type #

Read (f a) => Read (WrappedDivisibleOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Show (f a) => Show (WrappedDivisibleOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Eq (f a) => Eq (WrappedDivisibleOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

Ord (f a) => Ord (WrappedDivisibleOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

type Rep (WrappedDivisibleOnly f a) Source # 
Instance details

Defined in Data.Functor.Invariant.Inplicative

type Rep (WrappedDivisibleOnly f a) = D1 ('MetaData "WrappedDivisibleOnly" "Data.Functor.Invariant.Inplicative" "functor-combinators-0.4.1.2-6f83RuY9ReR1ECoC76WHzJ" 'True) (C1 ('MetaCons "WrapDivisibleOnly" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapDivisibleOnly") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

Invariant Day

runDay :: Inply h => (f ~> h) -> (g ~> h) -> Day f g ~> h Source #

Interpret out of a contravariant Day into any instance of Inply by providing two interpreting functions.

This should go in Data.Functor.Invariant.Day, but that module is in a different package.

Since: 0.4.0.0

dather :: Inply f => Day f f ~> f Source #

Squash the two items in a Day using their natural Inply instances.

This should go in Data.Functor.Invariant.Day, but that module is in a different package.

Since: 0.4.0.0

runDayApply :: forall f g h. Apply h => (f ~> h) -> (g ~> h) -> Day f g ~> h Source #

Interpret out of a contravariant Day into any instance of Apply by providing two interpreting functions.

In theory, this should not need to exist, since you should always be able to use runDay because every instance of Apply is also an instance of Inply. However, this can be handy if you are using an instance of Apply that has no Inply instance. Consider also unsafeInplyCo if you are using a specific, concrete type for h.

runDayDivise :: forall f g h. Divise h => (f ~> h) -> (g ~> h) -> Day f g ~> h Source #

Interpret out of a contravariant Day into any instance of Divise by providing two interpreting functions.

In theory, this should not need to exist, since you should always be able to use runDay because every instance of Divise is also an instance of Inply. However, this can be handy if you are using an instance of Divise that has no Inply instance. Consider also unsafeInplyContra if you are using a specific, concrete type for h.

Assembling Helpers

gatheredN :: Inplicative f => NP f as -> f (NP I as) Source #

Convenient wrapper to build up an Inplicative instance by providing each component of it. This makes it much easier to build up longer chains because you would only need to write the splitting/joining functions in one place.

For example, if you had a data type

data MyType = MT Int Bool String

and an invariant functor and Inplicative instance Prim (representing, say, a bidirectional parser, where Prim Int is a bidirectional parser for an Int), then you could assemble a bidirectional parser for a MyType@ using:

invmap ((MyType x y z) -> I x :* I y :* I z :* Nil)
       ((I x :* I y :* I z :* Nil) -> MyType x y z) $
  gatheredN $ intPrim
                   :* boolPrim
                   :* stringPrim
                   :* Nil

Some notes on usefulness depending on how many components you have:

  • If you have 0 components, use knot directly.
  • If you have 1 component, you don't need anything.
  • If you have 2 components, use gather directly.
  • If you have 3 or more components, these combinators may be useful; otherwise you'd need to manually peel off tuples one-by-one.

Since: 0.4.1.0

gatheredNMap :: Inplicative f => (NP I as -> b) -> (b -> NP I as) -> NP f as -> f b Source #

Given a function to "break out" a data type into a NP (tuple) and one to put it back together from the tuple, gather all of the components together.

For example, if you had a data type

data MyType = MT Int Bool String

and an invariant functor and Inplicative instance Prim (representing, say, a bidirectional parser, where Prim Int is a bidirectional parser for an Int), then you could assemble a bidirectional parser for a MyType@ using:

  concaMapInplicative
     ((MyType x y z) -> I x :* I y :* I z :* Nil)
     ((I x :* I y :* I z :* Nil) -> MyType x y z)
     $ intPrim
    :* boolPrim
    :* stringPrim
    :* Nil

See notes on gatheredNMap for more details and caveats.

Since: 0.4.1.0

gatheredN1 :: Inply f => NP f (a ': as) -> f (NP I (a ': as)) Source #

A version of gatheredN for non-empty NP, but only requiring an Inply instance.

Since: 0.4.1.0

gatheredN1Map :: Inplicative f => (NP I (a ': as) -> b) -> (b -> NP I (a ': as)) -> NP f (a ': as) -> f b Source #

A version of gatheredNMap for non-empty NP, but only requiring an Inply instance.

Since: 0.4.1.0

gatheredNRec :: Inplicative f => Rec f as -> f (XRec Identity as) Source #

A version of gatheredN using XRec from vinyl instead of NP from sop-core. This can be more convenient because it doesn't require manual unwrapping/wrapping of tuple components.

Since: 0.4.1.0

gatheredNMapRec :: Inplicative f => (XRec Identity as -> b) -> (b -> XRec Identity as) -> Rec f as -> f b Source #

A version of gatheredNMap using XRec from vinyl instead of NP from sop-core. This can be more convenient because it doesn't require manual unwrapping/wrapping of tuple components.

Since: 0.4.1.0

gatheredN1Rec :: Inply f => Rec f (a ': as) -> f (XRec Identity (a ': as)) Source #

A version of gatheredN1 using XRec from vinyl instead of NP from sop-core. This can be more convenient because it doesn't require manual unwrapping/wrapping of components.

Since: 0.4.1.0

gatheredN1MapRec :: Inplicative f => (XRec Identity (a ': as) -> b) -> (b -> XRec Identity (a ': as)) -> Rec f (a ': as) -> f b Source #

A version of gatheredNMap using XRec from vinyl instead of NP from sop-core. This can be more convenient because it doesn't require manual unwrapping/wrapping of tuple components.

Since: 0.4.1.0

gatherN :: forall f as b. (Inplicative f, IsoXRec Identity as, RecordCurry as) => Curried as b -> (b -> XRec Identity as) -> CurriedF f as (f b) Source #

Convenient wrapper to gather over multiple arguments using tine vinyl library's multi-arity uncurrying facilities. Makes it a lot more convenient than using gather multiple times and needing to accumulate intermediate types.

For example, if you had a data type

data MyType = MT Int Bool String

and an invariant functor and Inplicative instance Prim (representing, say, a bidirectional parser, where Prim Int is a bidirectional parser for an Int), then you could assemble a bidirectional parser for a MyType@ using:

gatherN
  MT                                         -- ^ curried assembling function
  ((MT x y z) -> x ::& y ::& z ::& XRNil)   -- ^ disassembling function
  (intPrim :: Prim Int)
  (boolPrim :: Prim Bool)
  (stringPrim :: Prim String)

Really only useful with 3 or more arguments, since with two arguments this is just gather (and with zero arguments, you can just use knot).

The generic type is a bit tricky to understand, but it's easier to understand what's going on if you instantiate with concrete types:

ghci> :t gatherN MyInplicative '[Int, Bool, String]
     (Int -> Bool -> String -> b)
  -> (b -> XRec Identity '[Int, Bool, String])
  -> MyInplicative Int
  -> MyInplicative Bool
  -> MyInplicative String
  -> MyInplicative b

Since: 0.4.1.0

gatherN1 :: forall f a as b. (Inply f, IsoXRec Identity as, RecordCurry as) => Curried (a ': as) b -> (b -> XRec Identity (a ': as)) -> CurriedF f (a ': as) (f b) Source #

gatherN but with at least one argument, so can be used with any Inply.

Since: 0.4.1.0