module Data.Geo.GPX.Fix(
Fix
, foldFix
, none
, twod
, threed
, dgps
, pps
, fix
) where
import Text.XML.HXT.Arrow.Pickle
data Fix = None | Twod | Threed | Dgps | Pps
deriving (Eq, Ord, Show, Enum)
foldFix ::
a
-> a
-> a
-> a
-> a
-> Fix
-> a
foldFix n _ _ _ _ None = n
foldFix _ t _ _ _ Twod = t
foldFix _ _ t _ _ Threed = t
foldFix _ _ _ d _ Dgps = d
foldFix _ _ _ _ p Pps = p
none ::
Fix
none =
None
twod :: Fix
twod = Twod
threed ::
Fix
threed =
Threed
dgps ::
Fix
dgps =
Dgps
pps ::
Fix
pps =
Pps
fix ::
String
-> Maybe Fix
fix "none" = Just none
fix "2d"= Just twod
fix "3d" = Just threed
fix "dgps" = Just dgps
fix "pps" = Just pps
fix _ = Nothing
instance XmlPickler Fix where
xpickle =
xpWrapMaybe (fix, show) xpText