lens-family-core-2.1.3: Haskell 2022 Lens Families

Safe Haskell | Safe-Inferred
Language | Haskell2010

Lens.Family.Stock

Contents

- Stock Lenses
- Stock Prisms
- Stock Grids
- Stock Grates
- Stock Traversals
- Stock SECs
- Lens Combinators
- Types
- Re-exports
- Deprecated names

Description

This module contains lenses, prisms, grids, grates and traversals for common structures in Haskell. It also contains the combinators for various kinds of optics.

A Function name with `'` is a grate variant of a grid, and a function name with `_` is a traversal variants of a grid or prism. For example, `both'` is the grate variant of `both` while `both_` is the traversal variant.

Synopsis

- _1 :: Functor f => LensLike f (a, r) (b, r) a b
- _2 :: Functor f => LensLike f (r, a) (r, b) a b
- chosen :: Functor f => LensLike f (Either a a) (Either b b) a b
- ix :: (Eq k, Functor f) => k -> LensLike' f (k -> v) v
- at :: (Ord k, Functor f) => k -> LensLike' f (Map k v) (Maybe v)
- intAt :: Functor f => Int -> LensLike' f (IntMap v) (Maybe v)
- at' :: (Ord k, Functor f) => k -> LensLike' f (Map k v) (Maybe v)
- intAt' :: Functor f => Int -> LensLike' f (IntMap v) (Maybe v)
- contains :: (Ord k, Functor f) => k -> LensLike' f (Set k) Bool
- intContains :: Functor f => Int -> LensLike' f IntSet Bool
- left :: (Applicative f, Traversable g) => AdapterLike f g (Either a r) (Either b r) a b
- right :: (Applicative f, Traversable g) => AdapterLike f g (Either r a) (Either r b) a b
- just :: (Applicative f, Traversable g) => AdapterLike f g (Maybe a) (Maybe b) a b
- nothing :: (Applicative f, Traversable g) => AdapterLike' f g (Maybe a) ()
- both :: (Applicative f, Functor g) => AdapterLike f g (a, a) (b, b) a b
- bend :: (FiniteBits b, Applicative f, Functor g) => AdapterLike' f g b Bool
- lend :: (FiniteBits b, Applicative f, Functor g) => AdapterLike' f g b Bool
- cod :: Functor g => GrateLike g (r -> a) (r -> b) a b
- both' :: Functor g => GrateLike g (a, a) (b, b) a b
- bend' :: (FiniteBits b, Functor g) => GrateLike' g b Bool
- lend' :: (FiniteBits b, Functor g) => GrateLike' g b Bool
- both_ :: Applicative f => LensLike f (a, a) (b, b) a b
- bend_ :: (FiniteBits b, Applicative f) => LensLike' f b Bool
- lend_ :: (FiniteBits b, Applicative f) => LensLike' f b Bool
- left_ :: Applicative f => LensLike f (Either a r) (Either b r) a b
- right_ :: Applicative f => LensLike f (Either r a) (Either r b) a b
- just_ :: Applicative f => LensLike f (Maybe a) (Maybe b) a b
- nothing_ :: Applicative f => LensLike' f (Maybe a) ()
- ignored :: Applicative f => null -> s -> f s
- mapped :: (Identical f, Functor h) => LensLike f (h a) (h b) a b
- alongside :: Functor f => LensLike (AlongsideLeft f b1) s0 t0 a0 b0 -> LensLike (AlongsideRight f t0) s1 t1 a1 b1 -> LensLike f (s0, s1) (t0, t1) (a0, a1) (b0, b1)
- backwards :: LensLike (Backwards f) s t a b -> LensLike f s t a b
- beside :: (Applicative f, Functor g) => AdapterLike f g s0 t0 a b -> AdapterLike f g s1 t1 a b -> AdapterLike f g (s0, s1) (t0, t1) a b
- beside' :: Functor g => GrateLike g s0 t0 a b -> GrateLike g s1 t1 a b -> GrateLike g (s0, s1) (t0, t1) a b
- beside_ :: Applicative f => LensLike f s0 t0 a b -> LensLike f s1 t1 a b -> LensLike f (s0, s1) (t0, t1) a b
- choosing :: Functor f => LensLike f s0 t0 a b -> LensLike f s1 t1 a b -> LensLike f (Either s0 s1) (Either t0 t1) a b
- from :: (Functor f, Functor g) => AdapterLike (FromF (g s -> f t) (f b) g) (FromG (f b) f) b a t s -> AdapterLike f g s t a b
- data AlongsideLeft (f :: Type -> Type) b a
- data AlongsideRight (f :: Type -> Type) a b
- data FromF i j (g :: Type -> Type) x
- data FromG e (f :: Type -> Type) x
- type AdapterLike (f :: Type -> Type) (g :: Type -> Type) s t a b = (g a -> f b) -> g s -> f t
- type AdapterLike' (f :: Type -> Type) (g :: Type -> Type) s a = (g a -> f a) -> g s -> f s
- type LensLike (f :: Type -> Type) s t a b = (a -> f b) -> s -> f t
- type LensLike' (f :: Type -> Type) s a = (a -> f a) -> s -> f s
- type GrateLike (g :: Type -> Type) s t a b = (g a -> b) -> g s -> t
- type GrateLike' (g :: Type -> Type) s a = (g a -> a) -> g s -> s
- class (Traversable f, Applicative f) => Identical (f :: Type -> Type)
- data Backwards (f :: k -> Type) (a :: k)
- class Bits b => FiniteBits b
- lft :: (Applicative f, Traversable g) => AdapterLike f g (Either a r) (Either b r) a b
- rgt :: (Applicative f, Traversable g) => AdapterLike f g (Either r a) (Either r b) a b
- some :: (Applicative f, Traversable g) => AdapterLike f g (Maybe a) (Maybe b) a b
- none :: (Applicative f, Traversable g) => AdapterLike' f g (Maybe a) ()
- lft_ :: Applicative f => LensLike f (Either a r) (Either b r) a b
- rgt_ :: Applicative f => LensLike f (Either r a) (Either r b) a b
- some_ :: Applicative f => LensLike f (Maybe a) (Maybe b) a b
- none_ :: Applicative f => LensLike' f (Maybe a) ()

# Stock Lenses

_1 :: Functor f => LensLike f (a, r) (b, r) a b Source #

    _1 :: Lens (a, r) (b, r) a b

Lens on the first element of a pair.

_2 :: Functor f => LensLike f (r, a) (r, b) a b Source #

    _2 :: Lens (r, a) (r, b) a b

Lens on the second element of a pair.

chosen :: Functor f => LensLike f (Either a a) (Either b b) a b Source #

    chosen :: Lens (Either a a) (Either b b) a b

Lens on the Left or Right element of an (`Either` a a).

ix :: (Eq k, Functor f) => k -> LensLike' f (k -> v) v Source #

    ix :: Eq k => k -> Lens' (k -> v) v

Lens on a given point of a function.

at :: (Ord k, Functor f) => k -> LensLike' f (Map k v) (Maybe v) Source #

    at :: Ord k => k -> Lens' (Map.Map k v) (Maybe v)

Lens on a given point of a `Map`.

intAt :: Functor f => Int -> LensLike' f (IntMap v) (Maybe v) Source #

    intAt :: Int -> Lens (IntMap.IntMap v) (Maybe v)

Lens on a given point of a `IntMap`.

at' :: (Ord k, Functor f) => k -> LensLike' f (Map k v) (Maybe v) Source #

    at :: Ord k => k -> Lens' (Map.Map k v) (Maybe v)

Lens providing strict access to a given point of a `Map`.

intAt' :: Functor f => Int -> LensLike' f (IntMap v) (Maybe v) Source #

    intAt :: Int -> Lens (IntMap.IntMap v) (Maybe v)

Lens providing strict access to a given point of a `IntMap`.

contains :: (Ord k, Functor f) => k -> LensLike' f (Set k) Bool Source #

    contains :: Ord => k -> Lens' (Set.Set k) Bool

Lens on a given point of a `Set`.

intContains :: Functor f => Int -> LensLike' f IntSet Bool Source #

    intContains :: Int -> Lens' IntSet.IntSet Bool

Lens on a given point of a `IntSet`.

# Stock Prisms

left :: (Applicative f, Traversable g) => AdapterLike f g (Either a r) (Either b r) a b Source #

    left :: Prism (Either a r) (Either b r) a b

A prism on the `Left` element of an `Either`.

right :: (Applicative f, Traversable g) => AdapterLike f g (Either r a) (Either r b) a b Source #

    right :: Prism (Either r a) (Either r b) a b

A prism on the `Right` element of an `Either`.

just :: (Applicative f, Traversable g) => AdapterLike f g (Maybe a) (Maybe b) a b Source #

    just :: Prism (Maybe a) (Maybe b) a b

A prism on the `Just` element of a `Maybe`.

nothing :: (Applicative f, Traversable g) => AdapterLike' f g (Maybe a) () Source #

    nothing :: Prism' (Maybe a) ()

A prism on the `Nothing` element of a `Maybe`.

# Stock Grids

both :: (Applicative f, Functor g) => AdapterLike f g (a, a) (b, b) a b Source #

    both :: Grid (a,a) (b,b) a b

A grid on both elements of a pair `(a,a)`.

bend :: (FiniteBits b, Applicative f, Functor g) => AdapterLike' f g b Bool Source #

    bend :: FiniteBits b => Grid' b Bool

A grid from the most significant bit to the least significant bit of a `FiniteBits` type.

Big endian order.

lend :: (FiniteBits b, Applicative f, Functor g) => AdapterLike' f g b Bool Source #

    lend :: FiniteBits b => Grid' b Bool

A grid from the least significant bit to the most significant bit of a `FiniteBits` type.

Little endian order.

# Stock Grates

cod :: Functor g => GrateLike g (r -> a) (r -> b) a b Source #

    cod :: Grate (r -> a) (r -> b) a b

A grate accessing the codomain of a function.

both' :: Functor g => GrateLike g (a, a) (b, b) a b Source #

    both' :: Grate (a,a) (b,b) a b

A grate on both elements of a pair `(a,a)`.

    both' = over both

bend' :: (FiniteBits b, Functor g) => GrateLike' g b Bool Source #

    bend' :: FiniteBits b => Grate' b Bool

A grate from the most significant bit to the least significant bit of a `FiniteBits` type.

Big endian order.

    bend' = over bend

lend' :: (FiniteBits b, Functor g) => GrateLike' g b Bool Source #

    lend' :: FiniteBits b => Grate' b Bool

A grate from the least significant bit to the most significant bit of a `FiniteBits` type.

Little endian order.

    lend' = over lend

# Stock Traversals

both_ :: Applicative f => LensLike f (a, a) (b, b) a b Source #

    both_ :: Traversal (a,a) (b,b) a b

Traversals on both elements of a pair `(a,a)`.

    both_ = under both

bend_ :: (FiniteBits b, Applicative f) => LensLike' f b Bool Source #

    bend_ :: FiniteBits b => Traversal' b Bool

A traversal from the most significant bit to the least significant bit of a `FiniteBits` type.

Big endian order.

    bend_ = under bend

lend_ :: (FiniteBits b, Applicative f) => LensLike' f b Bool Source #

    lend_ :: FiniteBits b => Traversal' b Bool

A traversal from the least significant bit to the most significant bit of a `FiniteBits` type.

Little endian order.

    lend_ = under lend

left_ :: Applicative f => LensLike f (Either a r) (Either b r) a b Source #

    left_ :: Traversal (Either a r) (Either b r) a b

Traversal on the `Left` element of an `Either`.

    left_ = under left

right_ :: Applicative f => LensLike f (Either r a) (Either r b) a b Source #

    right_ :: Traversal (Either r a) (Either r b) a b

Traversal on the `Right` element of an `Either`.

    right_ = under right

just_ :: Applicative f => LensLike f (Maybe a) (Maybe b) a b Source #

    just_ :: Traversal (Maybe a) (Maybe b) a b

Traversal on the `Just` element of a `Maybe`.

nothing_ :: Applicative f => LensLike' f (Maybe a) () Source #

    nothing_ :: Traversal' (Maybe a) ()

Traversal on the `Nothing` element of a `Maybe`.

ignored :: Applicative f => null -> s -> f s Source #

    ignored :: Traversal s s a b

The empty traversal on any type.

# Stock SECs

mapped :: (Identical f, Functor h) => LensLike f (h a) (h b) a b Source #

    mapped :: Functor h => Setter (h a) (h b) a b

An SEC referencing the parameter of a functor.

# Lens Combinators

alongside :: Functor f => LensLike (AlongsideLeft f b1) s0 t0 a0 b0 -> LensLike (AlongsideRight f t0) s1 t1 a1 b1 -> LensLike f (s0, s1) (t0, t1) (a0, a1) (b0, b1) Source #

    alongside :: Lens s0 t0 a0 b0 -> Lens s1 t1 a1 b1 -> Lens (s0, s1) (t0, t1) (a0, a1) (b0, b1)

    alongside :: Getter s0 t0 a0 b0 -> Getter s1 t1 a1 b1 -> Getter (s0, s1) (t0, t1) (a0, a1) (b0, b1)

Given two lens/getter families, make a new lens/getter on their product.

backwards :: LensLike (Backwards f) s t a b -> LensLike f s t a b Source #

    backwards :: Traversal s t a b -> Traversal s t a b
    backwards :: Fold s t a b -> Fold s t a b

Given a traversal or fold, reverse the order that elements are traversed.

    backwards :: Lens s t a b -> Lens s t a b
    backwards :: Getter s t a b -> Getter s t a b
    backwards :: Setter s t a b -> Setter s t a b

No effect on lenses, getters or setters.

beside :: (Applicative f, Functor g) => AdapterLike f g s0 t0 a b -> AdapterLike f g s1 t1 a b -> AdapterLike f g (s0, s1) (t0, t1) a b Source #

    beside :: Grid s1 t1 a b -> Grid s2 t2 a b -> Grid (s1, s2) (t1, t2) a b

Given two grids referencing a type `c`, create a grid on the pair referencing `c`.

beside' :: Functor g => GrateLike g s0 t0 a b -> GrateLike g s1 t1 a b -> GrateLike g (s0, s1) (t0, t1) a b Source #

    beside' :: Grate s0 t0 a b -> Grate s1 t1 a b -> Grate (s0, s1) (t0, t1) a b

    beside' :: Resetter s0 t0 a b -> Resetter s1 t1 a b -> Resetter (s0, s1) (t0, t1) a b

Given two grates/resetters referencing a type `c`, create a grate/resetter on the pair referencing `c`.

beside_ :: Applicative f => LensLike f s0 t0 a b -> LensLike f s1 t1 a b -> LensLike f (s0, s1) (t0, t1) a b Source #

    beside_ :: Traversal s0 t0 a b -> Traversal s1 t1 a b -> Traversal (s0, s1) (t0, t1) a b

    beside_ :: Fold s0 t0 a b -> Fold s1 t1 a b -> Fold (s0, s1) (t0, t1) a b

    beside_ :: Setter s0 t0 a b -> Setter s1 t1 a b -> Setter (s0, s1) (t0, t1) a b

Given two traversals/folds/setters referencing a type `c`, create a traversal/fold/setter on the pair referencing `c`.

choosing :: Functor f => LensLike f s0 t0 a b -> LensLike f s1 t1 a b -> LensLike f (Either s0 s1) (Either t0 t1) a b Source #

    choosing :: Lens s0 t0 a b -> Lens s1 t1 a b -> Lens (Either s0 s1) (Either t0 t1) a b

    choosing :: Traversal s0 t0 a b -> Traversal s1 t1 a b -> Traversal (Either s0 s1) (Either t0 t1) a b

    choosing :: Getter s0 t0 a b -> Getter s1 t1 a b -> Getter (Either s0 s1) (Either t0 t1) a b

    choosing :: Fold s0 t0 a b -> Fold s1 t1 a b -> Fold (Either s0 s1) (Either t0 t1) a b

    choosing :: Setter s0 t0 a b -> Setter s1 t1 a b -> Setter (Either s0 s1) (Either t0 t1) a b

Given two lens/traversal/getter/fold/setter families with the same substructure, make a new lens/traversal/getter/fold/setter on `Either`.

from :: (Functor f, Functor g) => AdapterLike (FromF (g s -> f t) (f b) g) (FromG (f b) f) b a t s -> AdapterLike f g s t a b Source #

    from :: Adapter b a t s -> Adapter s t a b

Reverses the direction of an adapter.

    from :: Getter b a t s -> Reviewer s t a b
    from :: Reviewer b a t s -> Getter s t a b

Changes a Getter into a Reviewer and vice versa.

# Types

data AlongsideLeft (f :: Type -> Type) b a Source #

#### Instances

Instances details

Functor f => Functor (AlongsideLeft f a) Source # |
Instance details Defined in Lens.Family.Stock Methods fmap :: (a0 -> b) -> AlongsideLeft f a a0 -> AlongsideLeft f a b Source # (<$) :: a0 -> AlongsideLeft f a b -> AlongsideLeft f a a0 Source #
Phantom f => Phantom (AlongsideLeft f a) Source # |
Instance details Defined in Lens.Family.Stock Methods coerce :: AlongsideLeft f a a0 -> AlongsideLeft f a b

data AlongsideRight (f :: Type -> Type) a b Source #

#### Instances

Instances details

Functor f => Functor (AlongsideRight f a) Source # |
Instance details Defined in Lens.Family.Stock Methods fmap :: (a0 -> b) -> AlongsideRight f a a0 -> AlongsideRight f a b Source # (<$) :: a0 -> AlongsideRight f a b -> AlongsideRight f a a0 Source #
Phantom f => Phantom (AlongsideRight f a) Source # |
Instance details Defined in Lens.Family.Stock Methods coerce :: AlongsideRight f a a0 -> AlongsideRight f a b

data FromF i j (g :: Type -> Type) x Source #

#### Instances

Instances details

Functor g => Functor (FromF i j g) Source # |
Instance details Defined in Lens.Family.Stock Methods fmap :: (a -> b) -> FromF i j g a -> FromF i j g b Source # (<$) :: a -> FromF i j g b -> FromF i j g a Source #
Phantom g => Phantom (FromF i j g) Source # |
Instance details Defined in Lens.Family.Stock Methods coerce :: FromF i j g a -> FromF i j g b

data FromG e (f :: Type -> Type) x Source #

#### Instances

Instances details

Functor f => Functor (FromG e f) Source # |
Instance details Defined in Lens.Family.Stock Methods fmap :: (a -> b) -> FromG e f a -> FromG e f b Source # (<$) :: a -> FromG e f b -> FromG e f a Source #
Phantom g => Phantom (FromG e g) Source # |
Instance details Defined in Lens.Family.Stock Methods coerce :: FromG e g a -> FromG e g b

# Re-exports

type AdapterLike (f :: Type -> Type) (g :: Type -> Type) s t a b = (g a -> f b) -> g s -> f t Source #

type AdapterLike' (f :: Type -> Type) (g :: Type -> Type) s a = (g a -> f a) -> g s -> f s Source #

type LensLike (f :: Type -> Type) s t a b = (a -> f b) -> s -> f t Source #

type LensLike' (f :: Type -> Type) s a = (a -> f a) -> s -> f s Source #

type GrateLike (g :: Type -> Type) s t a b = (g a -> b) -> g s -> t Source #

type GrateLike' (g :: Type -> Type) s a = (g a -> a) -> g s -> s Source #

class (Traversable f, Applicative f) => Identical (f :: Type -> Type) Source #

Minimal complete definition

extract

#### Instances

Instances details

Identical Identity Source # |
Instance details Defined in Lens.Family.Identical Methods extract :: Identity a -> a
Identical f => Identical (Backwards f) Source # |
Instance details Defined in Lens.Family.Identical Methods extract :: Backwards f a -> a
(Identical f, Identical g) => Identical (Compose f g) Source # |
Instance details Defined in Lens.Family.Identical Methods extract :: Compose f g a -> a

data Backwards (f :: k -> Type) (a :: k) Source #

The same functor, but with an `Applicative` instance that performs actions in the reverse order.

#### Instances

Instances details

Generic1 (Backwards f :: k -> Type) |

Instance details

Defined in Control.Applicative.Backwards

Associated Types

type Rep1 (Backwards f :: k -> Type) |
Instance details Defined in Control.Applicative.Backwards type Rep1 (Backwards f :: k -> Type) = D1 ('MetaData "Backwards" "Control.Applicative.Backwards" "transformers-0.6.1.1-inplace" 'True) (C1 ('MetaCons "Backwards" 'PrefixI 'True) (S1 ('MetaSel ('Just "forwards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)))

Methods

from1 :: forall (a :: k). Backwards f a -> Rep1 (Backwards f) a Source #

to1 :: forall (a :: k). Rep1 (Backwards f) a -> Backwards f a Source #

Foldable1 f => Foldable1 (Backwards f) | Derived instance.

Instance details

Defined in Control.Applicative.Backwards

Methods

fold1 :: Semigroup m => Backwards f m -> m Source #

foldMap1 :: Semigroup m => (a -> m) -> Backwards f a -> m Source #

foldMap1' :: Semigroup m => (a -> m) -> Backwards f a -> m Source #

toNonEmpty :: Backwards f a -> NonEmpty a Source #

maximum :: Ord a => Backwards f a -> a Source #

minimum :: Ord a => Backwards f a -> a Source #

head :: Backwards f a -> a Source #

last :: Backwards f a -> a Source #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Backwards f a -> b Source #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Backwards f a -> b Source #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Backwards f a -> b Source #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Backwards f a -> b Source #

Eq1 f => Eq1 (Backwards f) |
Instance details Defined in Control.Applicative.Backwards Methods liftEq :: (a -> b -> Bool) -> Backwards f a -> Backwards f b -> Bool Source #
Ord1 f => Ord1 (Backwards f) |
Instance details Defined in Control.Applicative.Backwards Methods liftCompare :: (a -> b -> Ordering) -> Backwards f a -> Backwards f b -> Ordering Source #
Read1 f => Read1 (Backwards f) |
Instance details Defined in Control.Applicative.Backwards Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Backwards f a) Source # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Backwards f a] Source # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Backwards f a) Source # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Backwards f a] Source #
Show1 f => Show1 (Backwards f) |
Instance details Defined in Control.Applicative.Backwards Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Backwards f a -> ShowS Source # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Backwards f a] -> ShowS Source #
Contravariant f => Contravariant (Backwards f) | Derived instance.
Instance details Defined in Control.Applicative.Backwards Methods contramap :: (a' -> a) -> Backwards f a -> Backwards f a' Source # (>$) :: b -> Backwards f b -> Backwards f a Source #
Alternative f => Alternative (Backwards f) | Try alternatives in the same order as `f`.
Instance details Defined in Control.Applicative.Backwards Methods empty :: Backwards f a Source # (<|>) :: Backwards f a -> Backwards f a -> Backwards f a Source # some :: Backwards f a -> Backwards f [a] Source # many :: Backwards f a -> Backwards f [a] Source #
Applicative f => Applicative (Backwards f) | Apply `f`-actions in the reverse order.
Instance details Defined in Control.Applicative.Backwards Methods pure :: a -> Backwards f a Source # (<*>) :: Backwards f (a -> b) -> Backwards f a -> Backwards f b Source # liftA2 :: (a -> b -> c) -> Backwards f a -> Backwards f b -> Backwards f c Source # (*>) :: Backwards f a -> Backwards f b -> Backwards f b Source # (<*) :: Backwards f a -> Backwards f b -> Backwards f a Source #
Functor f => Functor (Backwards f) | Derived instance.
Instance details Defined in Control.Applicative.Backwards Methods fmap :: (a -> b) -> Backwards f a -> Backwards f b Source # (<$) :: a -> Backwards f b -> Backwards f a Source #
Foldable f => Foldable (Backwards f) | Derived instance.

Instance details

Defined in Control.Applicative.Backwards

Methods

fold :: Monoid m => Backwards f m -> m Source #

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

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

foldr :: (a -> b -> b) -> b -> Backwards f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Backwards f a -> b Source #

foldl :: (b -> a -> b) -> b -> Backwards f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Backwards f a -> b Source #

foldr1 :: (a -> a -> a) -> Backwards f a -> a Source #

foldl1 :: (a -> a -> a) -> Backwards f a -> a Source #

toList :: Backwards f a -> [a] Source #

null :: Backwards f a -> Bool Source #

length :: Backwards f a -> Int Source #

elem :: Eq a => a -> Backwards f a -> Bool Source #

maximum :: Ord a => Backwards f a -> a Source #

minimum :: Ord a => Backwards f a -> a Source #

sum :: Num a => Backwards f a -> a Source #

product :: Num a => Backwards f a -> a Source #

Traversable f => Traversable (Backwards f) | Derived instance.
Instance details Defined in Control.Applicative.Backwards Methods traverse :: Applicative f0 => (a -> f0 b) -> Backwards f a -> f0 (Backwards f b) Source # sequenceA :: Applicative f0 => Backwards f (f0 a) -> f0 (Backwards f a) Source # mapM :: Monad m => (a -> m b) -> Backwards f a -> m (Backwards f b) Source # sequence :: Monad m => Backwards f (m a) -> m (Backwards f a) Source #
Identical f => Identical (Backwards f) Source # |
Instance details Defined in Lens.Family.Identical Methods extract :: Backwards f a -> a
Phantom f => Phantom (Backwards f) Source # |
Instance details Defined in Lens.Family.Phantom Methods coerce :: Backwards f a -> Backwards f b
Generic (Backwards f a) |

Instance details

Defined in Control.Applicative.Backwards

Associated Types

type Rep (Backwards f a) |
Instance details Defined in Control.Applicative.Backwards type Rep (Backwards f a) = D1 ('MetaData "Backwards" "Control.Applicative.Backwards" "transformers-0.6.1.1-inplace" 'True) (C1 ('MetaCons "Backwards" 'PrefixI 'True) (S1 ('MetaSel ('Just "forwards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

Methods

from :: Backwards f a -> Rep (Backwards f a) x Source #

to :: Rep (Backwards f a) x -> Backwards f a Source #

(Read1 f, Read a) => Read (Backwards f a) |
Instance details Defined in Control.Applicative.Backwards Methods readsPrec :: Int -> ReadS (Backwards f a) Source # readList :: ReadS [Backwards f a] Source # readPrec :: ReadPrec (Backwards f a) Source # readListPrec :: ReadPrec [Backwards f a] Source #
(Show1 f, Show a) => Show (Backwards f a) |
Instance details Defined in Control.Applicative.Backwards Methods showsPrec :: Int -> Backwards f a -> ShowS Source # show :: Backwards f a -> String Source # showList :: [Backwards f a] -> ShowS Source #
(Eq1 f, Eq a) => Eq (Backwards f a) |
Instance details Defined in Control.Applicative.Backwards Methods (==) :: Backwards f a -> Backwards f a -> Bool Source # (/=) :: Backwards f a -> Backwards f a -> Bool Source #
(Ord1 f, Ord a) => Ord (Backwards f a) |

Instance details

Defined in Control.Applicative.Backwards

Methods

compare :: Backwards f a -> Backwards f a -> Ordering Source #

(<) :: Backwards f a -> Backwards f a -> Bool Source #

(<=) :: Backwards f a -> Backwards f a -> Bool Source #

(>) :: Backwards f a -> Backwards f a -> Bool Source #

(>=) :: Backwards f a -> Backwards f a -> Bool Source #

max :: Backwards f a -> Backwards f a -> Backwards f a Source #

min :: Backwards f a -> Backwards f a -> Backwards f a Source #

type Rep1 (Backwards f :: k -> Type) |
Instance details Defined in Control.Applicative.Backwards type Rep1 (Backwards f :: k -> Type) = D1 ('MetaData "Backwards" "Control.Applicative.Backwards" "transformers-0.6.1.1-inplace" 'True) (C1 ('MetaCons "Backwards" 'PrefixI 'True) (S1 ('MetaSel ('Just "forwards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)))
type Rep (Backwards f a) |
Instance details Defined in Control.Applicative.Backwards type Rep (Backwards f a) = D1 ('MetaData "Backwards" "Control.Applicative.Backwards" "transformers-0.6.1.1-inplace" 'True) (C1 ('MetaCons "Backwards" 'PrefixI 'True) (S1 ('MetaSel ('Just "forwards") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))

class Bits b => FiniteBits b Source #

The `FiniteBits` class denotes types with a finite, fixed number of bits.

Since: base-4.7.0.0

Minimal complete definition

finiteBitSize

#### Instances

Instances details

FiniteBits Bool | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Bits Methods finiteBitSize :: Bool -> Int Source # countLeadingZeros :: Bool -> Int Source # countTrailingZeros :: Bool -> Int Source #
FiniteBits Int | Since: base-4.6.0.0
Instance details Defined in GHC.Internal.Bits Methods finiteBitSize :: Int -> Int Source # countLeadingZeros :: Int -> Int Source # countTrailingZeros :: Int -> Int Source #
FiniteBits Word | Since: base-4.6.0.0
Instance details Defined in GHC.Internal.Bits Methods finiteBitSize :: Word -> Int Source # countLeadingZeros :: Word -> Int Source # countTrailingZeros :: Word -> Int Source #
FiniteBits a => FiniteBits (Identity a) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Identity Methods finiteBitSize :: Identity a -> Int Source # countLeadingZeros :: Identity a -> Int Source # countTrailingZeros :: Identity a -> Int Source #
FiniteBits a => FiniteBits (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods finiteBitSize :: Const a b -> Int Source # countLeadingZeros :: Const a b -> Int Source # countTrailingZeros :: Const a b -> Int Source #

# Deprecated names

lft :: (Applicative f, Traversable g) => AdapterLike f g (Either a r) (Either b r) a b Source #

Deprecated: Renamed as `left`.

rgt :: (Applicative f, Traversable g) => AdapterLike f g (Either r a) (Either r b) a b Source #

Deprecated: Renamed as `right`.

some :: (Applicative f, Traversable g) => AdapterLike f g (Maybe a) (Maybe b) a b Source #

Deprecated: Renamed as `just`.

none :: (Applicative f, Traversable g) => AdapterLike' f g (Maybe a) () Source #

Deprecated: Renamed as `nothing`.

lft_ :: Applicative f => LensLike f (Either a r) (Either b r) a b Source #

Deprecated: Renamed as `left_`.

rgt_ :: Applicative f => LensLike f (Either r a) (Either r b) a b Source #

Deprecated: Renamed as `right_`.

some_ :: Applicative f => LensLike f (Maybe a) (Maybe b) a b Source #

Deprecated: Renamed as `just_`.

none_ :: Applicative f => LensLike' f (Maybe a) () Source #

Deprecated: Renamed as `nothing_`.