module Geo.OSM.Node(
Node,
node
) where
import Text.XML.HXT.Arrow
import Text.XML.HXT.Extras
import Geo.OSM.NWRCommon
import Geo.OSM.Tag
import Geo.OSM.Accessor.Id
import Geo.OSM.Accessor.Tags
import Geo.OSM.Accessor.Changeset
import Geo.OSM.Accessor.Visible
import Geo.OSM.Accessor.User
import Geo.OSM.Accessor.Uid
import Geo.OSM.Accessor.Timestamp
import Geo.OSM.Accessor.Lat
import Geo.OSM.Accessor.Lon
import Prelude hiding (id)
data Node = Node String String NWRCommon
deriving Eq
instance XmlPickler Node where
xpickle = xpElem "node" (xpWrap (\(lat', lon', nwr') -> Node lat' lon' nwr', \(Node lat' lon' nwr') -> (lat', lon', nwr'))
(xpTriple (xpAttr "lat" xpText) (xpAttr "lon" xpText) xpickle))
instance Show Node where
show = showPickled []
instance Lat Node where
lat (Node x _ _) = x
instance Lon Node where
lon (Node _ x _) = x
instance Id Node where
id (Node _ _ x) = id x
instance Tags Node where
tags (Node _ _ x) = tags x
instance Changeset Node where
changeset (Node _ _ x) = changeset x
instance Visible Node where
visible (Node _ _ x) = visible x
instance User Node where
user (Node _ _ x) = user x
instance Uid Node where
uid (Node _ _ x) = uid x
instance Timestamp Node where
timestamp (Node _ _ x) = timestamp x
node :: String
-> String
-> String
-> [Tag]
-> Maybe String
-> Bool
-> (Maybe String, Maybe String)
-> Maybe String
-> Node
node = flip flip nwrCommon . (((.) . (.) . (.) . (.) . (.) . (.)) .) . Node