vcard-0.1.4: A library for parsing/printing vCards from/to various formats.

Portabilityportable
Stabilityexperimental
Maintainermboes@tweag.net

Text.VCard.Query

Description

Convenience functions to extract values in vCards and mapping over these values.

Synopsis

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|.

filter :: (VCardValue -> Bool) -> [VCard] -> [VCard]Source

Filter by property value only.

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.