property-list-0.0.0.3: XML property list parserSource codeContentsIndex
Data.PropertyList
Synopsis
type PropertyList = PropertyList_ UnparsedPlistItem
type PropertyList_ = M (PropertyListS [] (Map String))
data UnparsedPlistItem
= UnparsedData String
| UnparsedDate String
| UnparsedInt String
| UnparsedReal String
readPropertyListFromFile :: FilePath -> IO (Either String PropertyList)
writePropertyListToFile :: FilePath -> PropertyList -> IO ()
class PropertyListItem i where
toPropertyList :: i -> PropertyList
fromPropertyList :: PropertyList -> Maybe i
listToPropertyList :: [i] -> PropertyList
listFromPropertyList :: PropertyList -> Maybe [i]
alterPropertyListM :: (Monad m, PropertyListItem i, PropertyListItem i') => (Maybe i -> m (Maybe i')) -> Maybe PropertyList -> m (Maybe PropertyList)
alterDictionaryEntryM :: (Monad m, PropertyListItem i, PropertyListItem i') => String -> (Maybe i -> m (Maybe i')) -> Maybe (Map String PropertyList) -> m (Maybe (Map String PropertyList))
tryAlterDictionaryEntryM :: (Monad m, PropertyListItem i, PropertyListItem i') => String -> (Maybe i -> m (Maybe i')) -> Maybe PropertyList -> m (Maybe PropertyList)
alterItemAtKeyPathM :: (Monad m, PropertyListItem i, PropertyListItem i') => [String] -> (Maybe i -> m (Maybe i')) -> Maybe PropertyList -> m (Maybe PropertyList)
alterPropertyList :: (PropertyListItem i, PropertyListItem i') => (Maybe i -> Maybe i') -> Maybe PropertyList -> Maybe PropertyList
alterDictionaryEntry :: (PropertyListItem i, PropertyListItem i') => String -> (Maybe i -> Maybe i') -> Maybe (Map String PropertyList) -> Maybe (Map String PropertyList)
tryAlterDictionaryEntry :: (PropertyListItem i, PropertyListItem i') => String -> (Maybe i -> Maybe i') -> Maybe PropertyList -> (Maybe PropertyList, Bool)
alterItemAtKeyPath :: (PropertyListItem i, PropertyListItem i') => [String] -> (Maybe i -> Maybe i') -> Maybe PropertyList -> Maybe PropertyList
getItemAtKeyPath :: PropertyListItem i => [String] -> Maybe PropertyList -> Maybe i
setItemAtKeyPath :: PropertyListItem i => [String] -> Maybe i -> Maybe PropertyList -> Maybe PropertyList
Documentation
type PropertyList = PropertyList_ UnparsedPlistItemSource
A property list possibly containing unparsed items (only when items fail to parse or the user puts them there)
type PropertyList_ = M (PropertyListS [] (Map String))Source
The property-list term algebra type itself, parameterized over the type of structural holes in the terms.
data UnparsedPlistItem Source
Constructors
UnparsedData String
UnparsedDate String
UnparsedInt String
UnparsedReal String
show/hide Instances
readPropertyListFromFile :: FilePath -> IO (Either String PropertyList)Source
writePropertyListToFile :: FilePath -> PropertyList -> IO ()Source
class PropertyListItem i whereSource
A class for items which can be converted to and from property lists
Methods
toPropertyList :: i -> PropertyListSource
Convert the item to a property list, usually by simply wrapping the value with the appropriate PropertyList_ constructor
fromPropertyList :: PropertyList -> Maybe iSource
Convert a property list to a property list item if its contents _exactly_ fit the target type. Note that when using types such as Map String Int (as opposed to Map String PropertyList) this will mean that a single element of the dictionary of a non-Int type will cause the entire conversion to fail.
listToPropertyList :: [i] -> PropertyListSource
In order to support a general instance for lists without breaking String, we use the same trick as the Prelude uses for Show. Generally, the list methods should not be overridden, and maybe they shouldn't even be exported.
listFromPropertyList :: PropertyList -> Maybe [i]Source
show/hide Instances
PropertyListItem Bool
PropertyListItem Char
PropertyListItem Double
PropertyListItem Float
PropertyListItem Int
PropertyListItem Integer
PropertyListItem ByteString
PropertyListItem UTCTime
PropertyListItem UnparsedPlistItem
PropertyListItem PropertyList
PropertyListItem a => PropertyListItem ([] a)
(PropertyListItem a1, PropertyListItem a2) => PropertyListItem (Either a1 a2)
(PropertyListItem a1, PropertyListItem a2) => PropertyListItem (OneOf2 a1 a2)
PropertyListItem a => PropertyListItem (Map String a)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3) => PropertyListItem (OneOf3 a1 a2 a3)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4) => PropertyListItem (OneOf4 a1 a2 a3 a4)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5) => PropertyListItem (OneOf5 a1 a2 a3 a4 a5)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6) => PropertyListItem (OneOf6 a1 a2 a3 a4 a5 a6)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7) => PropertyListItem (OneOf7 a1 a2 a3 a4 a5 a6 a7)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8) => PropertyListItem (OneOf8 a1 a2 a3 a4 a5 a6 a7 a8)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9) => PropertyListItem (OneOf9 a1 a2 a3 a4 a5 a6 a7 a8 a9)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10) => PropertyListItem (OneOf10 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11) => PropertyListItem (OneOf11 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12) => PropertyListItem (OneOf12 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12, PropertyListItem a13) => PropertyListItem (OneOf13 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12, PropertyListItem a13, PropertyListItem a14) => PropertyListItem (OneOf14 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12, PropertyListItem a13, PropertyListItem a14, PropertyListItem a15) => PropertyListItem (OneOf15 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12, PropertyListItem a13, PropertyListItem a14, PropertyListItem a15, PropertyListItem a16) => PropertyListItem (OneOf16 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12, PropertyListItem a13, PropertyListItem a14, PropertyListItem a15, PropertyListItem a16, PropertyListItem a17) => PropertyListItem (OneOf17 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12, PropertyListItem a13, PropertyListItem a14, PropertyListItem a15, PropertyListItem a16, PropertyListItem a17, PropertyListItem a18) => PropertyListItem (OneOf18 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12, PropertyListItem a13, PropertyListItem a14, PropertyListItem a15, PropertyListItem a16, PropertyListItem a17, PropertyListItem a18, PropertyListItem a19) => PropertyListItem (OneOf19 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19)
(PropertyListItem a1, PropertyListItem a2, PropertyListItem a3, PropertyListItem a4, PropertyListItem a5, PropertyListItem a6, PropertyListItem a7, PropertyListItem a8, PropertyListItem a9, PropertyListItem a10, PropertyListItem a11, PropertyListItem a12, PropertyListItem a13, PropertyListItem a14, PropertyListItem a15, PropertyListItem a16, PropertyListItem a17, PropertyListItem a18, PropertyListItem a19, PropertyListItem a20) => PropertyListItem (OneOf20 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a17 a18 a19 a20)
alterPropertyListM :: (Monad m, PropertyListItem i, PropertyListItem i') => (Maybe i -> m (Maybe i')) -> Maybe PropertyList -> m (Maybe PropertyList)Source
alterDictionaryEntryM :: (Monad m, PropertyListItem i, PropertyListItem i') => String -> (Maybe i -> m (Maybe i')) -> Maybe (Map String PropertyList) -> m (Maybe (Map String PropertyList))Source
tryAlterDictionaryEntryM :: (Monad m, PropertyListItem i, PropertyListItem i') => String -> (Maybe i -> m (Maybe i')) -> Maybe PropertyList -> m (Maybe PropertyList)Source
alterItemAtKeyPathM :: (Monad m, PropertyListItem i, PropertyListItem i') => [String] -> (Maybe i -> m (Maybe i')) -> Maybe PropertyList -> m (Maybe PropertyList)Source
alterPropertyList :: (PropertyListItem i, PropertyListItem i') => (Maybe i -> Maybe i') -> Maybe PropertyList -> Maybe PropertyListSource
alterDictionaryEntry :: (PropertyListItem i, PropertyListItem i') => String -> (Maybe i -> Maybe i') -> Maybe (Map String PropertyList) -> Maybe (Map String PropertyList)Source
tryAlterDictionaryEntry :: (PropertyListItem i, PropertyListItem i') => String -> (Maybe i -> Maybe i') -> Maybe PropertyList -> (Maybe PropertyList, Bool)Source
alterItemAtKeyPath :: (PropertyListItem i, PropertyListItem i') => [String] -> (Maybe i -> Maybe i') -> Maybe PropertyList -> Maybe PropertyListSource
TODO: capture the success/failure of the operation? (can fail if key path tries to enter something that isn't a dictionary)
getItemAtKeyPath :: PropertyListItem i => [String] -> Maybe PropertyList -> Maybe iSource
setItemAtKeyPath :: PropertyListItem i => [String] -> Maybe i -> Maybe PropertyList -> Maybe PropertyListSource
Produced by Haddock version 2.4.2