lens-action-0.2.6: Monadic Getters and Folds

Copyright | (C) 2012-2014 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | non-portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

Control.Lens.Action.Internal

Contents

- Actions

Description

Synopsis

- class (Monad m, Functor f, Contravariant f) => Effective (m :: Type -> Type) r (f :: Type -> Type) | f -> m r where
  - effective :: m r -> f a
  - ineffective :: f a -> m r
- newtype Effect (m :: Type -> Type) r a = Effect {
  - getEffect :: m r
  }

## Actions

class (Monad m, Functor f, Contravariant f) => Effective (m :: Type -> Type) r (f :: Type -> Type) | f -> m r where Source #

An `Effective` `Functor` ignores its argument and is isomorphic to a `Monad` wrapped around a value.

That said, the `Monad` is possibly rather unrelated to any `Applicative` structure.

Methods

effective :: m r -> f a Source #

ineffective :: f a -> m r Source #

#### Instances

Instances details

Effective Identity r (Const r :: Type -> Type) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods effective :: Identity r -> Const r a Source # ineffective :: Const r a -> Identity r Source #
Effective m r f => Effective m r (AlongsideLeft f b) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods effective :: m r -> AlongsideLeft f b a Source # ineffective :: AlongsideLeft f b a -> m r Source #
Effective m r f => Effective m r (AlongsideRight f b) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods effective :: m r -> AlongsideRight f b a Source # ineffective :: AlongsideRight f b a -> m r Source #
Monad m => Effective m r (Effect m r) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods effective :: m r -> Effect m r a Source # ineffective :: Effect m r a -> m r Source #
Effective m r f => Effective m (Dual r) (Backwards f) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods effective :: m (Dual r) -> Backwards f a Source # ineffective :: Backwards f a -> m (Dual r) Source #

newtype Effect (m :: Type -> Type) r a Source #

Wrap a monadic effect with a phantom type argument.

Constructors

Effect |

Fields

- getEffect :: m r

#### Instances

Instances details

Monad m => Effective m r (Effect m r) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods effective :: m r -> Effect m r a Source # ineffective :: Effect m r a -> m r Source #
Contravariant (Effect m r) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods contramap :: (a' -> a) -> Effect m r a -> Effect m r a' Source # (>$) :: b -> Effect m r b -> Effect m r a Source #
(Monad m, Monoid r) => Applicative (Effect m r) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods pure :: a -> Effect m r a Source # (<*>) :: Effect m r (a -> b) -> Effect m r a -> Effect m r b Source # liftA2 :: (a -> b -> c) -> Effect m r a -> Effect m r b -> Effect m r c Source # (*>) :: Effect m r a -> Effect m r b -> Effect m r b Source # (<*) :: Effect m r a -> Effect m r b -> Effect m r a Source #
Functor (Effect m r) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods fmap :: (a -> b) -> Effect m r a -> Effect m r b Source # (<$) :: a -> Effect m r b -> Effect m r a Source #
(Apply m, Semigroup r) => Apply (Effect m r) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods (<.>) :: Effect m r (a -> b) -> Effect m r a -> Effect m r b Source # (.>) :: Effect m r a -> Effect m r b -> Effect m r b Source # (<.) :: Effect m r a -> Effect m r b -> Effect m r a Source # liftF2 :: (a -> b -> c) -> Effect m r a -> Effect m r b -> Effect m r c Source #
(Apply m, Monad m, Monoid r) => Monoid (Effect m r a) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods mempty :: Effect m r a Source # mappend :: Effect m r a -> Effect m r a -> Effect m r a Source # mconcat :: [Effect m r a] -> Effect m r a Source #
(Apply m, Semigroup r) => Semigroup (Effect m r a) Source # |
Instance details Defined in Control.Lens.Action.Internal Methods (<>) :: Effect m r a -> Effect m r a -> Effect m r a Source # sconcat :: NonEmpty (Effect m r a) -> Effect m r a Source # stimes :: Integral b => b -> Effect m r a -> Effect m r a Source #