functor-monad-0.1.1.0: FFunctor: functors on (the usual) Functors
Safe HaskellSafe-Inferred
LanguageHaskell2010

FStrong

Description

FFunctor with tensorial strength with respect to Day.

Synopsis

Documentation

class FFunctor ff => FStrong ff where Source #

FFunctor with tensorial strength with respect to Day.

Minimal complete definition

fstrength | mapCurried

Methods

fstrength :: Functor g => Day (ff g) h ~> ff (Day g h) Source #

Tensorial strength with respect to Day.

fstrength can be thought as a higher-order version of strength function below.

strength :: Functor f => (f a, b) -> f (a, b)
strength (fa, b) = fmap (a -> (a,b)) fa

For the ordinary Functor, no additional type classes were needed to have strength function, because it works for any Functor f. This is not the case for FFunctor and fstrength.

Laws

These two equations must hold.

ffmap elim2 . fstrength  = elim2
      :: Day (ff g) Identity ~> ff g
fstrength . trans1 fstrength = ffmap assoc . fstrength . disassoc
      :: Day (Day (ff g) h) k ~> ff (Day (Day g h) k))

Alternatively, these diagrams must commute.

                   fstrength
 ff g ⊗ Identity ----------->  ff (g ⊗ Identity)
           \                          |
            \                         |   ffmap elim2
             \                        |
       elim2  \                       v
               \---------------->   ff g
                    trans1 fstrength                      fstrength
(ff g ⊗ h) ⊗ k -------------------->  ff (g ⊗ h) ⊗ k ----------->  ff ((g ⊗ h) ⊗ k)
           |                                                                   ^
           | disassoc                                             ffmap assoc  |
           |                                                                   |
           v                           fstrength                               |
 ff g ⊗ (h ⊗ k) --------------------------------------------------->  ff (g ⊗ (h ⊗ k))

For readability, an infix operator (⊗) was used instead of the type constructor Day@.

mapCurried :: (Functor g, Functor h) => Curried g h ~> Curried (ff g) (ff h) Source #

Internal ffmap.

mapCurried can be seen as ffmap but by using "internal language" of \(\mathrm{Hask}^{\mathrm{Hask}}\), the category of Functors.

ffmap         :: (g ~> h)       ->  (ff g ~> ff h)
mapCurried    :: (Curried g h)  ~>  (Curried (ff g) (ff h))

ffmap takes a natural transformations (~>), in other words morphism in \(\mathrm{Hask}^{\mathrm{Hask}}\), and returns another (~>). ffmap itself is an usual function, which is an outsider for \(\mathrm{Hask}^{\mathrm{Hask}}\).

On the other hand, mapCurried is a natural transformation (~>) between Curried _ _, objects of \(\mathrm{Hask}^{\mathrm{Hask}}\).

The existence of mapCurried is known to be equivalent to the existence of fstrength.

Laws

These equations must hold.

mapCurried . unitCurried = unitCurried
    :: Identity ~> Curried (ff g) (ff g)
mapCurried . composeCurried = composeCurried . trans1 mapCurried . trans2 mapCurried
    :: Day (Curried g h) (Curried h k) ~> Curried (ff g) (ff k)

Instances

Instances details
FStrong (EnvT e) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (EnvT e g) h ~> EnvT e (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (EnvT e g) (EnvT e h) Source #

FStrong (StoreT s) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (StoreT s g) h ~> StoreT s (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (StoreT s g) (StoreT s h) Source #

FStrong (TracedT m) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (TracedT m g) h ~> TracedT m (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (TracedT m g) (TracedT m h) Source #

Functor f => FStrong (Exp1 f) Source # 
Instance details

Defined in Data.Functor.Exp

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (Exp1 f g) h ~> Exp1 f (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (Exp1 f g) (Exp1 f h) Source #

FStrong ff => FStrong (FFree ff) Source # 
Instance details

Defined in FMonad.FFree

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (FFree ff g) h ~> FFree ff (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (FFree ff g) (FFree ff h) Source #

FStrong (Day f) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (Day f g) h ~> Day f (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (Day f g) (Day f h) Source #

Functor f => FStrong (Curried f) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (Curried f g) h ~> Curried f (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (Curried f g) (Curried f h) Source #

FStrong (IdentityT :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (IdentityT g) h ~> IdentityT (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (IdentityT g) (IdentityT h) Source #

FStrong (ReaderT e) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (ReaderT e g) h ~> ReaderT e (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (ReaderT e g) (ReaderT e h) Source #

FStrong (StateT s) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (StateT s g) h ~> StateT s (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (StateT s g) (StateT s h) Source #

FStrong (WriterT m) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (WriterT m g) h ~> WriterT m (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (WriterT m g) (WriterT m h) Source #

(FStrong ff, FStrong gg) => FStrong (FCompose ff gg) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (FCompose ff gg g) h ~> FCompose ff gg (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (FCompose ff gg g) (FCompose ff gg h) Source #

Functor f => FStrong (Compose f :: (Type -> Type) -> Type -> Type) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (Compose f g) h ~> Compose f (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (Compose f g) (Compose f h) Source #

Functor f => FStrong (Precompose f) Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (Precompose f g) h ~> Precompose f (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (Precompose f g) (Precompose f h) Source #

(Functor f, Functor f') => FStrong (Bicompose f f') Source # 
Instance details

Defined in FStrong

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (Bicompose f f' g) h ~> Bicompose f f' (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (Bicompose f f' g) (Bicompose f f' h) Source #

(FStrong ff, FStrong ww, FStrong uu) => FStrong (AdjointT ff uu ww) Source # 
Instance details

Defined in FComonad.Adjoint

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (AdjointT ff uu ww g) h ~> AdjointT ff uu ww (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (AdjointT ff uu ww g) (AdjointT ff uu ww h) Source #

(FStrong ff, FStrong mm, FStrong uu) => FStrong (AdjointT ff uu mm) Source # 
Instance details

Defined in FMonad.Adjoint

Methods

fstrength :: forall (g :: Type -> Type) (h :: Type -> Type). Functor g => Day (AdjointT ff uu mm g) h ~> AdjointT ff uu mm (Day g h) Source #

mapCurried :: forall (g :: Type -> Type) (h :: Type -> Type). (Functor g, Functor h) => Curried g h ~> Curried (AdjointT ff uu mm g) (AdjointT ff uu mm h) Source #

fstrength' :: (FStrong ff, Functor h) => Day g (ff h) ~> ff (Day g h) Source #

fstrength but from left

innerAp :: (FStrong ff, Applicative h) => ff h (a -> b) -> h a -> ff h b Source #

Combine an applicative action(s) inside ff to another action h a.

fap :: (FStrong mm, FMonad mm, Functor g, Functor h) => Day (mm g) (mm h) ~> mm (Day g h) Source #

Cf. ap