_1 :: Lens (a, r) (b, r) a b
Lens on the first element of a pair.
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulelens-family-core-2.1.3Haskell2010
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.
_1 :: Lens (a, r) (b, r) a b
Lens on the first element of a pair.
_2 :: Lens (r, a) (r, b) a b
Lens on the second element of a pair.
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 => k -> Lens' (k -> v) v
Lens on a given point of a function.
at :: Ord k => k -> Lens' (Map.Map k v) (Maybe v)
Lens on a given point of a Map.
intAt :: Int -> Lens (IntMap.IntMap v) (Maybe v)
Lens on a given point of a IntMap.
at :: Ord k => k -> Lens' (Map.Map k v) (Maybe v)
Lens providing strict access to a given point of a Map.
intAt :: Int -> Lens (IntMap.IntMap v) (Maybe v)
Lens providing strict access to a given point of a IntMap.
contains :: Ord => k -> Lens' (Set.Set k) Bool
Lens on a given point of a Set.
intContains :: Int -> Lens' IntSet.IntSet Bool
Lens on a given point of a IntSet.
both :: Grid (a,a) (b,b) a b
A grid on both elements of a pair (a,a).
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 => Grid' b Bool
A grid from the least significant bit to the most significant bit of a FiniteBits type.
Little endian order.
cod :: Grate (r -> a) (r -> b) a b
A grate accessing the codomain of a function.
both' :: Grate (a,a) (b,b) a b
A grate on both elements of a pair (a,a).
both' = over both
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 => 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
both_ :: Traversal (a,a) (b,b) a b
Traversals on both elements of a pair (a,a).
both_ = under both
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 => 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
ignored :: Traversal s s a b
The empty traversal on any type.
mapped :: Functor h => Setter (h a) (h b) a b
An SEC referencing the parameter of a functor.
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 :: 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 :: 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' :: 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_ :: 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 :: 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 :: 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.
Functor f => Functor (AlongsideLeft f a)Defined in lens-family-core-2.1.3 · Lens.Family.StockPhantom f => Phantom (AlongsideLeft f a)Defined in lens-family-core-2.1.3 · Lens.Family.StockFunctor f => Functor (AlongsideRight f a)Defined in lens-family-core-2.1.3 · Lens.Family.StockPhantom f => Phantom (AlongsideRight f a)Defined in lens-family-core-2.1.3 · Lens.Family.StockThe same functor, but with an Applicative instance that performs actions in the reverse order.
Generic1 (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsFunctor f => Functor (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsDerived instance.
Applicative f => Applicative (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsApply f-actions in the reverse order.
Foldable f => Foldable (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsDerived instance.
Traversable f => Traversable (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsDerived instance.
Alternative f => Alternative (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsTry alternatives in the same order as f.
Foldable1 f => Foldable1 (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsDerived instance.
Eq1 f => Eq1 (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsOrd1 f => Ord1 (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsRead1 f => Read1 (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsShow1 f => Show1 (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsContravariant f => Contravariant (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsDerived instance.
Phantom f => Phantom (Backwards f)Defined in lens-family-core-2.1.3 · Lens.Family.PhantomIdentical f => Identical (Backwards f)Defined in lens-family-core-2.1.3 · Lens.Family.Identical(Eq1 f, Eq a) => Eq (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards(Ord1 f, Ord a) => Ord (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards(Read1 f, Read a) => Read (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards(Show1 f, Show a) => Show (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsGeneric (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwardstype Rep (Backwards f a) = D1 ('MetaData "Backwards"
"Control.Applicative.Backwards"
"transformers-0.6.1.1-a11a"
'True) (C1 ('MetaCons "Backwards"
'PrefixI 'True) (S1 ('MetaSel ('Just "forwards"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a))))Defined in transformers-0.6.1.1 · Control.Applicative.Backwardstype Rep1 (Backwards f) = D1 ('MetaData "Backwards"
"Control.Applicative.Backwards"
"transformers-0.6.1.1-a11a"
'True) (C1 ('MetaCons "Backwards"
'PrefixI 'True) (S1 ('MetaSel ('Just "forwards"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 f)))Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsThe FiniteBits class denotes types with a finite, fixed number of bits.
FiniteBits EventTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPollFiniteBits EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.PollFiniteBits CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFiniteBits IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrFiniteBits WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrFiniteBits Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntFiniteBits Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntFiniteBits Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntFiniteBits Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntFiniteBits CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesFiniteBits Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordFiniteBits Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordFiniteBits Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordFiniteBits Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordFiniteBits BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsFiniteBits IntDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsFiniteBits WordDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsFiniteBits a => FiniteBits (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsFiniteBits a => FiniteBits (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsFiniteBits a => FiniteBits (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsFiniteBits a => FiniteBits (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsFiniteBits a => FiniteBits (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFiniteBits a => FiniteBits (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdFiniteBits a => FiniteBits (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstDeprecated. Renamed as left.
Deprecated. Renamed as right.
Deprecated. Renamed as just.
Deprecated. Renamed as nothing.
Deprecated. Renamed as left_.
Deprecated. Renamed as right_.
Deprecated. Renamed as just_.
Deprecated. Renamed as nothing_.