Safe Haskell | None |
---|---|
Language | Haskell98 |
Van Laarhoven lenses for XMPP types. The lenses are designed to work with
the lens library. This module also provides a few simple accessors (view
,
modify
, set
and getAll
) so you don't need to pull in the
lens library to get some use out of them.
The name of the lenses corresponds to the field name of the data types with an upper-case L appended. For documentation of the fields refer to the documentation of the data types (linked in the section header)
- type Lens a b = Functor f => (b -> f b) -> a -> f a
- type Traversal a b = Applicative f => (b -> f b) -> a -> f a
- view :: Lens a b -> a -> b
- modify :: Traversal a b -> (b -> b) -> a -> a
- set :: Lens a b -> b -> a -> a
- getAll :: Traversal a b -> a -> [b]
- class IsStanza s where
- class HasStanzaPayload s p | s -> p where
- class IsErrorStanza s where
- stanzaError :: Lens s StanzaError
- messageTypeL :: Lens Message MessageType
- presenceTypeL :: Lens Presence PresenceType
- iqRequestTypeL :: Lens IQRequest IQRequestType
- stanzaErrorTypeL :: Lens StanzaError StanzaErrorType
- stanzaErrorConditionL :: Lens StanzaError StanzaErrorCondition
- stanzaErrorTextL :: Lens StanzaError (Maybe (Maybe LangTag, NonemptyText))
- stanzaErrorApplL :: Lens StanzaError (Maybe Element)
- preferredLangL :: Lens StreamConfiguration (Maybe LangTag)
- toJidL :: Lens StreamConfiguration (Maybe (Jid, Bool))
- connectionDetailsL :: Lens StreamConfiguration ConnectionDetails
- resolvConfL :: Lens StreamConfiguration ResolvConf
- establishSessionL :: Lens StreamConfiguration Bool
- tlsBehaviourL :: Lens StreamConfiguration TlsBehaviour
- tlsParamsL :: Lens StreamConfiguration ClientParams
- streamConfigurationL :: Lens SessionConfiguration StreamConfiguration
- onConnectionClosedL :: Lens SessionConfiguration (Session -> XmppFailure -> IO ())
- sessionStanzaIDsL :: Lens SessionConfiguration (IO (IO Text))
- ensableRosterL :: Lens SessionConfiguration Bool
- pluginsL :: Lens SessionConfiguration [Plugin]
- verL :: Lens Roster (Maybe Text)
- itemsL :: Lens Roster (Map Jid Item)
- riApprovedL :: Lens Item Bool
- riAskL :: Lens Item Bool
- riJidL :: Lens Item Jid
- riNameL :: Lens Item (Maybe Text)
- riSubscriptionL :: Lens Item Subscription
- riGroupsL :: Lens Item [Text]
- qiApprovedL :: Lens QueryItem (Maybe Bool)
- qiAskL :: Lens QueryItem Bool
- qiJidL :: Lens QueryItem Jid
- qiNameL :: Lens QueryItem (Maybe Text)
- qiSubscriptionL :: Lens QueryItem (Maybe Subscription)
- qiGroupsL :: Lens QueryItem [Text]
- queryVerL :: Lens Query (Maybe Text)
- queryItemsL :: Lens Query [QueryItem]
- bodyLangL :: Lens MessageBody (Maybe LangTag)
- bodyContentL :: Lens MessageBody Text
- threadIdL :: Lens MessageThread Text
- threadParentL :: Lens MessageThread (Maybe Text)
- subjectLangL :: Lens MessageSubject (Maybe LangTag)
- subjectContentL :: Lens MessageSubject Text
- imThreadL :: Lens InstantMessage (Maybe MessageThread)
- imSubjectL :: Lens InstantMessage [MessageSubject]
- imBodyL :: Lens InstantMessage [MessageBody]
- showStatusL :: Lens IMPresence (Maybe ShowStatus)
- statusL :: Lens IMPresence (Maybe Text)
- priorityL :: Lens IMPresence (Maybe Int)
Documentation
type Traversal a b = Applicative f => (b -> f b) -> a -> f a Source
Accessors
Reimplementation of the basic lens functions so you don't have to bring in all of lens library in to use the lenses
Lenses
modify :: Traversal a b -> (b -> b) -> a -> a Source
modify the Value(s) a Lens or Traversal is pointing to
Traversals
getAll :: Traversal a b -> a -> [b] Source
Return all the values a Traversal is pointing to in a list
Lenses
Stanzas
from :: Lens s (Maybe Jid) Source
From-attribute of the stanza
to :: Lens s (Maybe Jid) Source
To-attribute of the stanza
lang :: Lens s (Maybe LangTag) Source
Langtag of the stanza
sid :: Lens s (Maybe Text) Source
Stanza ID. Setting this to Nothing for IQ* stanzas will set the id to the empty Text.
payloadT :: Traversal s Element Source
Traversal over the payload elements.
class HasStanzaPayload s p | s -> p where Source
class IsErrorStanza s where Source
stanzaError :: Lens s StanzaError Source
Error element of the stanza
StanzaError
stanzaErrorTextL :: Lens StanzaError (Maybe (Maybe LangTag, NonemptyText)) Source
StreamConfiguration
SessionConfiguration
onConnectionClosedL :: Lens SessionConfiguration (Session -> XmppFailure -> IO ()) Source
IM
Roster
Roster
Item
QueryItem
qiApprovedL :: Lens QueryItem (Maybe Bool) Source
qiSubscriptionL :: Lens QueryItem (Maybe Subscription) Source
Query
queryItemsL :: Lens Query [QueryItem] Source