Portability | portable |
---|---|
Stability | experimental |
Maintainer | mboes@tweag.net |
Text.VCard.Query
Description
Convenience functions to extract values in vCards and mapping over these values.
- lookup :: ByteString -> VCard -> Maybe [VCardValue]
- lookup' :: ByteString -> VCard -> VCardValue
- insert :: VProperty -> VCard -> VCard
- filterWithProperty :: (VProperty -> Bool) -> [VCard] -> [VCard]
- filterWithType :: (Type -> VCardValue -> Bool) -> [VCard] -> [VCard]
- filter :: (VCardValue -> Bool) -> [VCard] -> [VCard]
- mapWithProperty :: (VProperty -> VCardValue) -> [VCard] -> [VCard]
- mapWithType :: (Type -> VCardValue -> VCardValue) -> [VCard] -> [VCard]
- map :: (VCardValue -> VCardValue) -> [VCard] -> [VCard]
Documentation
lookup :: ByteString -> VCard -> Maybe [VCardValue]Source
Analog to |Data.List.lookup|. In general an attribute may map to a number
of values. vCards should maintain the invariant that forall attr, lookup
attr vcard /= Just []
.
lookup' :: ByteString -> VCard -> VCardValueSource
Unsafe variant of |lookup| that assumes given type name maps to exactly one value in the vCard.
filterWithProperty :: (VProperty -> Bool) -> [VCard] -> [VCard]Source
Supports the most general filter predicates of the filter
family of functions.
filterWithType :: (Type -> VCardValue -> Bool) -> [VCard] -> [VCard]Source
A specialization of |filterWithProperty|.
mapWithProperty :: (VProperty -> VCardValue) -> [VCard] -> [VCard]Source
Supports the most general map predicates of the map
family of functions.
mapWithType :: (Type -> VCardValue -> VCardValue) -> [VCard] -> [VCard]Source
A specialization of |mapWithProperty|.
map :: (VCardValue -> VCardValue) -> [VCard] -> [VCard]Source
Map by property value only.