Text package:lens

Traverse the individual characters in a Text.
>>> anyOf text (=='c') "chello"
True
text = unpacked . traversed
When the type is unambiguous, you can also use the more general each.
texteach
Note that when just using this as a Setter, setting map can be more efficient.
Traverse the individual characters in strict or lazy Text.
text = unpacked . traversed
Traverse the individual characters in strict Text.
>>> anyOf text (=='o') "hello"
True
When the type is unambiguous, you can also use the more general each.
textunpacked . traversed
texteach
Note that when just using this as a Setter, setting map can be more efficient.
The indexed store can be used to characterize a Lens and is used by cloneLens. Context a b t is isomorphic to newtype Context a b t = Context { runContext :: forall f. Functor f => (a -> f b) -> f t }, and to exists s. (s, Lens s t a b). A Context is like a Lens that has already been applied to a some structure.
type Context' a s = Context a a s
Return a list of all of the editable contexts for every location in the structure, recursively.
propUniverse x = universe x == map pos (contexts x)
propId x = all (== x) [extract w | w <- contexts x]
contextscontextsOf plate
Return a list of all of the editable contexts for every location in the structure, recursively, using a user-specified Traversal to walk each layer.
propUniverse l x = universeOf l x == map pos (contextsOf l x)
propId l x = all (== x) [extract w | w <- contextsOf l x]
contextsOf :: Traversal' a a -> a -> [Context a a a]
Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied Traversal, recursively using plate.
contextsOn b ≡ contextsOnOf b plate
contextsOn :: Plated a => Traversal' s a -> s -> [Context a a s]
Return a list of all of the editable contexts for every location in the structure in an areas indicated by a user supplied Traversal, recursively using another user-supplied Traversal to walk each layer.
contextsOnOf :: Traversal' s a -> Traversal' a a -> s -> [Context a a s]
This is a generalized form of Context that can be repeatedly cloned with less impact on its performance, and which permits the use of an arbitrary Conjoined Profunctor
type Pretext' p a s = Pretext p a a s
This is a generalized form of Context that can be repeatedly cloned with less impact on its performance, and which permits the use of an arbitrary Conjoined Profunctor. The extra phantom Functor is used to let us lie and claim Getter-compatibility under limited circumstances. This is used internally to permit a number of combinators to gracefully degrade when applied to a Fold or Getter.
type PretextT' p g a s = PretextT p g a a s
We can always forget the rest of the structure of w and obtain a simpler indexed comonad store model called Context.
This is an alias for unpacked that makes it clearer how to use it with (#).
_Text = from packed
>>> _Text # "hello" -- :: Text
"hello"
Traversals for strict or lazy Text
This is an alias for unpacked that makes it clearer how to use it with (#).
_Text = from packed
>>> _Text # "hello" :: Strict.Text
"hello"