module Data.Geo.OSM.Preferences
(
Preferences
, preferences
) where
import Text.XML.HXT.Arrow.Pickle
import Data.Geo.OSM.Tag
import Data.Geo.OSM.Lens.TagsL
import Data.Lens.Common
import Control.Comonad.Trans.Store
import Control.Newtype
newtype Preferences =
Preferences [Tag]
deriving Eq
preferences ::
[Tag]
-> Preferences
preferences =
Preferences
instance XmlPickler Preferences where
xpickle =
xpElem "preferences" (xpWrap (preferences, \(Preferences r) -> r) (xpList xpickle))
instance Show Preferences where
show =
showPickled []
instance TagsL Preferences where
tagsL =
Lens $ \(Preferences tags) -> store (\tags -> Preferences tags) tags
instance Newtype Preferences [Tag] where
pack =
Preferences
unpack (Preferences x) =
x