Lens on the first element of a pair.
Modulelens-family-2.1.3Haskell2010
Lens.Family2.Stock
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.
- 16 types
- 2 classes
- 45 values
- Packagelens-family-2.1.3
- Exports63
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceStock.hs
Stock Lenses
10 declarationsLens on the second element of a pair.
Lens on the Left or Right element of an (Either a a).
Lens on a given point of a function.
Lens on a given point of a Map.
Lens on a given point of a IntMap.
Lens providing strict access to a given point of a Map.
Lens providing strict access to a given point of a IntMap.
Lens on a given point of a Set.
Lens on a given point of a IntSet.
Stock Prisms
4 declarationsStock Grids
3 declarationsA grid on both elements of a pair (a,a).
A grid from the most significant bit to the least significant bit of a FiniteBits type.
Big endian order.
A grid from the least significant bit to the most significant bit of a FiniteBits type.
Little endian order.
Stock Grates
4 declarationsA grate accessing the codomain of a function.
A grate on both elements of a pair (a,a).
A grate from the most significant bit to the least significant bit of a FiniteBits type.
Big endian order.
A grate from the least significant bit to the most significant bit of a FiniteBits type.
Little endian order.
Stock Traversals
8 declarationsTraversals on both elements of a pair (a,a).
A traversal from the most significant bit to the least significant bit of a FiniteBits type.
Big endian order.
A traversal from the least significant bit to the most significant bit of a FiniteBits type.
Little endian order.
The empty traveral on any type.
Stock SECs
1 declarationAn SEC referencing the parameter of a functor.
Lens Combinators
7 declarationsalongside :: 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.
Types
4 declarationsInstances2Functor, Phantom
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.Stock
Instances2Functor, Phantom
Functor 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.Stock
Re-exports
14 declarationsThe same functor, but with an Applicative instance that performs actions in the reverse order.
Instances21Generic1, Functor, Applicative, Foldable, Traversable, Alternative, …
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 ('MetaDataDefined in transformers-0.6.1.1 · Control.Applicative.Backwards"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))))type Rep1 (Backwards f) = D1 ('MetaDataDefined in transformers-0.6.1.1 · Control.Applicative.Backwards"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)))
The FiniteBits class denotes types with a finite, fixed number of bits.
Instances63FiniteBits, …
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.Const
Deprecated names
8 declarationsDeprecated. 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_.