GPX 0.5 → 0.8.0
raw patch · 148 files changed
Files
- Data/Geo/GPX.hs +0/−150
- Data/Geo/GPX/Accessor/Accessor.hs +0/−8
- Data/Geo/GPX/Accessor/Ageofdgpsdata.hs +0/−16
- Data/Geo/GPX/Accessor/Author.hs +0/−12
- Data/Geo/GPX/Accessor/Bounds.hs +0/−17
- Data/Geo/GPX/Accessor/Cmt.hs +0/−16
- Data/Geo/GPX/Accessor/Copyright.hs +0/−17
- Data/Geo/GPX/Accessor/Creator.hs +0/−10
- Data/Geo/GPX/Accessor/Desc.hs +0/−16
- Data/Geo/GPX/Accessor/Dgpsid.hs +0/−17
- Data/Geo/GPX/Accessor/Domain.hs +0/−10
- Data/Geo/GPX/Accessor/Ele.hs +0/−16
- Data/Geo/GPX/Accessor/Email.hs +0/−17
- Data/Geo/GPX/Accessor/Extensions.hs +0/−17
- Data/Geo/GPX/Accessor/Fix.hs +0/−17
- Data/Geo/GPX/Accessor/Geoidheight.hs +0/−16
- Data/Geo/GPX/Accessor/Hdop.hs +0/−16
- Data/Geo/GPX/Accessor/Href.hs +0/−10
- Data/Geo/GPX/Accessor/Id.hs +0/−11
- Data/Geo/GPX/Accessor/Keywords.hs +0/−16
- Data/Geo/GPX/Accessor/Lat.hs +0/−11
- Data/Geo/GPX/Accessor/Latlon.hs +0/−11
- Data/Geo/GPX/Accessor/License.hs +0/−16
- Data/Geo/GPX/Accessor/Link.hs +0/−17
- Data/Geo/GPX/Accessor/Links.hs +0/−17
- Data/Geo/GPX/Accessor/Lon.hs +0/−11
- Data/Geo/GPX/Accessor/Magvar.hs +0/−17
- Data/Geo/GPX/Accessor/Maxlat.hs +0/−11
- Data/Geo/GPX/Accessor/Maxlon.hs +0/−11
- Data/Geo/GPX/Accessor/Metadata.hs +0/−17
- Data/Geo/GPX/Accessor/Minlat.hs +0/−11
- Data/Geo/GPX/Accessor/Minlon.hs +0/−11
- Data/Geo/GPX/Accessor/Name.hs +0/−16
- Data/Geo/GPX/Accessor/Number.hs +0/−16
- Data/Geo/GPX/Accessor/Pdop.hs +0/−16
- Data/Geo/GPX/Accessor/Pts.hs +0/−17
- Data/Geo/GPX/Accessor/Rtepts.hs +0/−17
- Data/Geo/GPX/Accessor/Rtes.hs +0/−17
- Data/Geo/GPX/Accessor/Sat.hs +0/−16
- Data/Geo/GPX/Accessor/Src.hs +0/−16
- Data/Geo/GPX/Accessor/Sym.hs +0/−16
- Data/Geo/GPX/Accessor/Text.hs +0/−16
- Data/Geo/GPX/Accessor/Time.hs +0/−17
- Data/Geo/GPX/Accessor/Trkpts.hs +0/−17
- Data/Geo/GPX/Accessor/Trks.hs +0/−17
- Data/Geo/GPX/Accessor/Trksegs.hs +0/−17
- Data/Geo/GPX/Accessor/Type.hs +0/−16
- Data/Geo/GPX/Accessor/Value.hs +0/−11
- Data/Geo/GPX/Accessor/Vdop.hs +0/−16
- Data/Geo/GPX/Accessor/Version.hs +0/−10
- Data/Geo/GPX/Accessor/Wpts.hs +0/−17
- Data/Geo/GPX/Accessor/Year.hs +0/−16
- Data/Geo/GPX/BoundsType.hs +0/−45
- Data/Geo/GPX/CopyrightType.hs +0/−39
- Data/Geo/GPX/DegreesType.hs +0/−25
- Data/Geo/GPX/DgpsStationType.hs +0/−29
- Data/Geo/GPX/EmailType.hs +0/−29
- Data/Geo/GPX/ExtensionsType.hs +0/−24
- Data/Geo/GPX/FixType.hs +0/−66
- Data/Geo/GPX/Gpx.hs +0/−142
- Data/Geo/GPX/GpxType.hs +0/−126
- Data/Geo/GPX/LatitudeType.hs +0/−28
- Data/Geo/GPX/LinkType.hs +0/−22
- Data/Geo/GPX/LongitudeType.hs +0/−28
- Data/Geo/GPX/MetadataType.hs +0/−88
- Data/Geo/GPX/PersonType.hs +0/−39
- Data/Geo/GPX/PtType.hs +0/−48
- Data/Geo/GPX/PtsegType.hs +0/−23
- Data/Geo/GPX/RteType.hs +0/−83
- Data/Geo/GPX/TrkType.hs +0/−89
- Data/Geo/GPX/TrksegType.hs +0/−32
- Data/Geo/GPX/Util/Remove.hs +0/−44
- Data/Geo/GPX/Util/Reverse.hs +0/−47
- Data/Geo/GPX/WptType.hs +0/−226
- GPX.cabal +97/−88
- LICENSE +1/−1
- Setup.hs +3/−0
- Setup.lhs +0/−3
- src/Data/Geo/GPX.hs +69/−0
- src/Data/Geo/GPX/Lens.hs +101/−0
- src/Data/Geo/GPX/Lens/AgeofdgpsdataL.hs +7/−0
- src/Data/Geo/GPX/Lens/AuthorL.hs +9/−0
- src/Data/Geo/GPX/Lens/BoundsL.hs +8/−0
- src/Data/Geo/GPX/Lens/CmtL.hs +7/−0
- src/Data/Geo/GPX/Lens/CopyrightL.hs +8/−0
- src/Data/Geo/GPX/Lens/CreatorL.hs +7/−0
- src/Data/Geo/GPX/Lens/DescL.hs +7/−0
- src/Data/Geo/GPX/Lens/DgpsidL.hs +8/−0
- src/Data/Geo/GPX/Lens/DomainL.hs +7/−0
- src/Data/Geo/GPX/Lens/EleL.hs +7/−0
- src/Data/Geo/GPX/Lens/EmailL.hs +8/−0
- src/Data/Geo/GPX/Lens/ExtensionsL.hs +8/−0
- src/Data/Geo/GPX/Lens/FixL.hs +8/−0
- src/Data/Geo/GPX/Lens/GeoidheightL.hs +7/−0
- src/Data/Geo/GPX/Lens/HdopL.hs +7/−0
- src/Data/Geo/GPX/Lens/HrefL.hs +7/−0
- src/Data/Geo/GPX/Lens/IdL.hs +8/−0
- src/Data/Geo/GPX/Lens/KeywordsL.hs +7/−0
- src/Data/Geo/GPX/Lens/LatL.hs +8/−0
- src/Data/Geo/GPX/Lens/LicenseL.hs +7/−0
- src/Data/Geo/GPX/Lens/LinkL.hs +8/−0
- src/Data/Geo/GPX/Lens/LinksL.hs +8/−0
- src/Data/Geo/GPX/Lens/LonL.hs +8/−0
- src/Data/Geo/GPX/Lens/MagvarL.hs +8/−0
- src/Data/Geo/GPX/Lens/MaxlatL.hs +8/−0
- src/Data/Geo/GPX/Lens/MaxlonL.hs +8/−0
- src/Data/Geo/GPX/Lens/MetadataL.hs +8/−0
- src/Data/Geo/GPX/Lens/MinlatL.hs +8/−0
- src/Data/Geo/GPX/Lens/MinlonL.hs +8/−0
- src/Data/Geo/GPX/Lens/NameL.hs +7/−0
- src/Data/Geo/GPX/Lens/NumberL.hs +7/−0
- src/Data/Geo/GPX/Lens/PdopL.hs +7/−0
- src/Data/Geo/GPX/Lens/PtsL.hs +8/−0
- src/Data/Geo/GPX/Lens/RteptsL.hs +8/−0
- src/Data/Geo/GPX/Lens/RtesL.hs +8/−0
- src/Data/Geo/GPX/Lens/SatL.hs +7/−0
- src/Data/Geo/GPX/Lens/SrcL.hs +7/−0
- src/Data/Geo/GPX/Lens/SymL.hs +7/−0
- src/Data/Geo/GPX/Lens/TextL.hs +7/−0
- src/Data/Geo/GPX/Lens/TimeL.hs +8/−0
- src/Data/Geo/GPX/Lens/TrkptsL.hs +8/−0
- src/Data/Geo/GPX/Lens/TrksL.hs +8/−0
- src/Data/Geo/GPX/Lens/TrksegsL.hs +8/−0
- src/Data/Geo/GPX/Lens/TypeL.hs +7/−0
- src/Data/Geo/GPX/Lens/VdopL.hs +7/−0
- src/Data/Geo/GPX/Lens/VersionL.hs +7/−0
- src/Data/Geo/GPX/Lens/WptsL.hs +8/−0
- src/Data/Geo/GPX/Lens/YearL.hs +7/−0
- src/Data/Geo/GPX/Type.hs +43/−0
- src/Data/Geo/GPX/Type/Bounds.hs +51/−0
- src/Data/Geo/GPX/Type/Copyright.hs +44/−0
- src/Data/Geo/GPX/Type/Degrees.hs +39/−0
- src/Data/Geo/GPX/Type/DgpsStation.hs +33/−0
- src/Data/Geo/GPX/Type/Email.hs +36/−0
- src/Data/Geo/GPX/Type/Extensions.hs +38/−0
- src/Data/Geo/GPX/Type/Fix.hs +76/−0
- src/Data/Geo/GPX/Type/Gpx.hs +82/−0
- src/Data/Geo/GPX/Type/Latitude.hs +40/−0
- src/Data/Geo/GPX/Type/Link.hs +43/−0
- src/Data/Geo/GPX/Type/Longitude.hs +40/−0
- src/Data/Geo/GPX/Type/Metadata.hs +94/−0
- src/Data/Geo/GPX/Type/Person.hs +45/−0
- src/Data/Geo/GPX/Type/Pt.hs +54/−0
- src/Data/Geo/GPX/Type/Ptseg.hs +38/−0
- src/Data/Geo/GPX/Type/Rte.hs +88/−0
- src/Data/Geo/GPX/Type/Trk.hs +88/−0
- src/Data/Geo/GPX/Type/Trkseg.hs +38/−0
- src/Data/Geo/GPX/Type/Wpt.hs +230/−0
− Data/Geo/GPX.hs
@@ -1,150 +0,0 @@--- | GPX 1.1 Schema <http://www.topografix.com/GPX/1/1/>-module Data.Geo.GPX(- module Data.Geo.GPX.DgpsStationType,- module Data.Geo.GPX.FixType,- module Data.Geo.GPX.DegreesType,- module Data.Geo.GPX.LongitudeType,- module Data.Geo.GPX.LatitudeType,- module Data.Geo.GPX.BoundsType,- module Data.Geo.GPX.ExtensionsType,- module Data.Geo.GPX.PtType,- module Data.Geo.GPX.PtsegType,- module Data.Geo.GPX.EmailType,- module Data.Geo.GPX.LinkType,- module Data.Geo.GPX.PersonType,- module Data.Geo.GPX.CopyrightType,- module Data.Geo.GPX.WptType,- module Data.Geo.GPX.TrksegType,- module Data.Geo.GPX.TrkType,- module Data.Geo.GPX.RteType,- module Data.Geo.GPX.MetadataType,- module Data.Geo.GPX.GpxType,- module Data.Geo.GPX.Gpx,- module Data.Geo.GPX.Accessor.Minlat,- module Data.Geo.GPX.Accessor.Maxlat,- module Data.Geo.GPX.Accessor.Minlon,- module Data.Geo.GPX.Accessor.Maxlon,- module Data.Geo.GPX.Accessor.Author,- module Data.Geo.GPX.Accessor.Year,- module Data.Geo.GPX.Accessor.License,- module Data.Geo.GPX.Accessor.Value,- module Data.Geo.GPX.Accessor.Id,- module Data.Geo.GPX.Accessor.Domain,- module Data.Geo.GPX.Accessor.Version,- module Data.Geo.GPX.Accessor.Creator,- module Data.Geo.GPX.Accessor.Metadata,- module Data.Geo.GPX.Accessor.Wpts,- module Data.Geo.GPX.Accessor.Rtes,- module Data.Geo.GPX.Accessor.Trks,- module Data.Geo.GPX.Accessor.Extensions,- module Data.Geo.GPX.Accessor.Href,- module Data.Geo.GPX.Accessor.Text,- module Data.Geo.GPX.Accessor.Type,- module Data.Geo.GPX.Accessor.Name,- module Data.Geo.GPX.Accessor.Desc,- module Data.Geo.GPX.Accessor.Copyright,- module Data.Geo.GPX.Accessor.Links,- module Data.Geo.GPX.Accessor.Time,- module Data.Geo.GPX.Accessor.Keywords,- module Data.Geo.GPX.Accessor.Bounds,- module Data.Geo.GPX.Accessor.Lat,- module Data.Geo.GPX.Accessor.Lon,- module Data.Geo.GPX.Accessor.Ele,- module Data.Geo.GPX.Accessor.Magvar,- module Data.Geo.GPX.Accessor.Geoidheight,- module Data.Geo.GPX.Accessor.Cmt,- module Data.Geo.GPX.Accessor.Src,- module Data.Geo.GPX.Accessor.Sym,- module Data.Geo.GPX.Accessor.Fix,- module Data.Geo.GPX.Accessor.Sat,- module Data.Geo.GPX.Accessor.Hdop,- module Data.Geo.GPX.Accessor.Vdop,- module Data.Geo.GPX.Accessor.Pdop,- module Data.Geo.GPX.Accessor.Ageofdgpsdata,- module Data.Geo.GPX.Accessor.Dgpsid,- module Data.Geo.GPX.Accessor.Email,- module Data.Geo.GPX.Accessor.Link,- module Data.Geo.GPX.Accessor.Pts,- module Data.Geo.GPX.Accessor.Number,- module Data.Geo.GPX.Accessor.Rtepts,- module Data.Geo.GPX.Accessor.Trkpts,- module Data.Geo.GPX.Accessor.Trksegs,- module Data.Geo.GPX.Accessor.Latlon,- module Data.Geo.GPX.Util.Remove,- module Data.Geo.GPX.Util.Reverse,- module Control.Arrow- ) where--import Data.Geo.GPX.DgpsStationType-import Data.Geo.GPX.FixType-import Data.Geo.GPX.DegreesType-import Data.Geo.GPX.LongitudeType-import Data.Geo.GPX.LatitudeType-import Data.Geo.GPX.BoundsType-import Data.Geo.GPX.ExtensionsType-import Data.Geo.GPX.PtType-import Data.Geo.GPX.PtsegType-import Data.Geo.GPX.EmailType-import Data.Geo.GPX.LinkType-import Data.Geo.GPX.PersonType-import Data.Geo.GPX.CopyrightType-import Data.Geo.GPX.WptType-import Data.Geo.GPX.TrksegType-import Data.Geo.GPX.TrkType-import Data.Geo.GPX.RteType-import Data.Geo.GPX.MetadataType-import Data.Geo.GPX.GpxType-import Data.Geo.GPX.Gpx-import Data.Geo.GPX.Accessor.Minlat-import Data.Geo.GPX.Accessor.Maxlat-import Data.Geo.GPX.Accessor.Minlon-import Data.Geo.GPX.Accessor.Maxlon-import Data.Geo.GPX.Accessor.Author-import Data.Geo.GPX.Accessor.Year-import Data.Geo.GPX.Accessor.License-import Data.Geo.GPX.Accessor.Value-import Data.Geo.GPX.Accessor.Id-import Data.Geo.GPX.Accessor.Domain-import Data.Geo.GPX.Accessor.Version-import Data.Geo.GPX.Accessor.Creator-import Data.Geo.GPX.Accessor.Metadata-import Data.Geo.GPX.Accessor.Wpts-import Data.Geo.GPX.Accessor.Rtes-import Data.Geo.GPX.Accessor.Trks-import Data.Geo.GPX.Accessor.Extensions-import Data.Geo.GPX.Accessor.Href-import Data.Geo.GPX.Accessor.Text-import Data.Geo.GPX.Accessor.Type-import Data.Geo.GPX.Accessor.Name-import Data.Geo.GPX.Accessor.Desc-import Data.Geo.GPX.Accessor.Copyright-import Data.Geo.GPX.Accessor.Links-import Data.Geo.GPX.Accessor.Time-import Data.Geo.GPX.Accessor.Keywords-import Data.Geo.GPX.Accessor.Bounds-import Data.Geo.GPX.Accessor.Lat-import Data.Geo.GPX.Accessor.Lon-import Data.Geo.GPX.Accessor.Ele-import Data.Geo.GPX.Accessor.Magvar-import Data.Geo.GPX.Accessor.Geoidheight-import Data.Geo.GPX.Accessor.Cmt-import Data.Geo.GPX.Accessor.Src-import Data.Geo.GPX.Accessor.Sym-import Data.Geo.GPX.Accessor.Fix-import Data.Geo.GPX.Accessor.Sat-import Data.Geo.GPX.Accessor.Hdop-import Data.Geo.GPX.Accessor.Vdop-import Data.Geo.GPX.Accessor.Pdop-import Data.Geo.GPX.Accessor.Ageofdgpsdata-import Data.Geo.GPX.Accessor.Dgpsid-import Data.Geo.GPX.Accessor.Email-import Data.Geo.GPX.Accessor.Link-import Data.Geo.GPX.Accessor.Pts-import Data.Geo.GPX.Accessor.Number-import Data.Geo.GPX.Accessor.Rtepts-import Data.Geo.GPX.Accessor.Trkpts-import Data.Geo.GPX.Accessor.Trksegs-import Data.Geo.GPX.Accessor.Latlon-import Data.Geo.GPX.Util.Remove-import Data.Geo.GPX.Util.Reverse-import Control.Arrow
− Data/Geo/GPX/Accessor/Accessor.hs
@@ -1,8 +0,0 @@-module Data.Geo.GPX.Accessor.Accessor(- using- ) where--import Control.Monad.Instances()--using :: (a -> d) -> (c -> a -> b) -> (d -> c) -> a -> b-using f g = flip (flip =<< (g .) . flip id . f)
− Data/Geo/GPX/Accessor/Ageofdgpsdata.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Ageofdgpsdata where--import Data.Geo.GPX.Accessor.Accessor--class Ageofdgpsdata a where- ageofdgpsdata :: a -> Maybe Double- setAgeofdgpsdata :: Maybe Double -> a -> a-- setAgeofdgpsdata' :: Double -> a -> a- setAgeofdgpsdata' = setAgeofdgpsdata . Just-- usingAgeofdgpsdata :: (Maybe Double -> Maybe Double) -> a -> a- usingAgeofdgpsdata = ageofdgpsdata `using` setAgeofdgpsdata-- usingAgeofdgpsdata' :: (Double -> Double) -> a -> a- usingAgeofdgpsdata' = usingAgeofdgpsdata . fmap
− Data/Geo/GPX/Accessor/Author.hs
@@ -1,12 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}--module Data.Geo.GPX.Accessor.Author where--import Data.Geo.GPX.Accessor.Accessor--class Author a b | a -> b where- author :: a -> b- setAuthor :: b -> a -> a-- usingAuthor :: (b -> b) -> a -> a- usingAuthor = author `using` setAuthor
− Data/Geo/GPX/Accessor/Bounds.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Bounds where--import Data.Geo.GPX.BoundsType-import Data.Geo.GPX.Accessor.Accessor--class Bounds a where- bounds :: a -> Maybe BoundsType- setBounds :: Maybe BoundsType -> a -> a-- setBounds' :: BoundsType -> a -> a- setBounds' = setBounds . Just-- usingBounds :: (Maybe BoundsType -> Maybe BoundsType) -> a -> a- usingBounds = bounds `using` setBounds-- usingBounds' :: (BoundsType -> BoundsType) -> a -> a- usingBounds' = usingBounds . fmap
− Data/Geo/GPX/Accessor/Cmt.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Cmt where--import Data.Geo.GPX.Accessor.Accessor--class Cmt a where- cmt :: a -> Maybe String- setCmt :: Maybe String -> a -> a-- setCmt' :: String -> a -> a- setCmt' = setCmt . Just-- usingCmt :: (Maybe String -> Maybe String) -> a -> a- usingCmt = cmt `using` setCmt-- usingCmt' :: (String -> String) -> a -> a- usingCmt' = usingCmt . fmap
− Data/Geo/GPX/Accessor/Copyright.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Copyright where--import Data.Geo.GPX.CopyrightType-import Data.Geo.GPX.Accessor.Accessor--class Copyright a where- copyright :: a -> Maybe CopyrightType- setCopyright :: Maybe CopyrightType -> a -> a-- setCopyright' :: CopyrightType -> a -> a- setCopyright' = setCopyright . Just-- usingCopyright :: (Maybe CopyrightType -> Maybe CopyrightType) -> a -> a- usingCopyright = copyright `using` setCopyright-- usingCopyright' :: (CopyrightType -> CopyrightType) -> a -> a- usingCopyright' = usingCopyright . fmap
− Data/Geo/GPX/Accessor/Creator.hs
@@ -1,10 +0,0 @@-module Data.Geo.GPX.Accessor.Creator where--import Data.Geo.GPX.Accessor.Accessor--class Creator a where- creator :: a -> String- setCreator :: String -> a -> a-- usingCreator :: (String -> String) -> a -> a- usingCreator = creator `using` setCreator
− Data/Geo/GPX/Accessor/Desc.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Desc where--import Data.Geo.GPX.Accessor.Accessor--class Desc a where- desc :: a -> Maybe String- setDesc :: Maybe String -> a -> a-- setDesc' :: String -> a -> a- setDesc' = setDesc . Just-- usingDesc :: (Maybe String -> Maybe String) -> a -> a- usingDesc = desc `using` setDesc-- usingDesc' :: (String -> String) -> a -> a- usingDesc' = usingDesc . fmap
− Data/Geo/GPX/Accessor/Dgpsid.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Dgpsid where--import Data.Geo.GPX.DgpsStationType-import Data.Geo.GPX.Accessor.Accessor--class Dgpsid a where- dgpsid :: a -> Maybe DgpsStationType- setDgpsid :: Maybe DgpsStationType -> a -> a-- setDgpsid' :: DgpsStationType -> a -> a- setDgpsid' = setDgpsid . Just-- usingDgpsid :: (Maybe DgpsStationType -> Maybe DgpsStationType) -> a -> a- usingDgpsid = dgpsid `using` setDgpsid-- usingDgpsid' :: (DgpsStationType -> DgpsStationType) -> a -> a- usingDgpsid' = usingDgpsid . fmap
− Data/Geo/GPX/Accessor/Domain.hs
@@ -1,10 +0,0 @@-module Data.Geo.GPX.Accessor.Domain where--import Data.Geo.GPX.Accessor.Accessor--class Domain a where- domain :: a -> String- setDomain :: String -> a -> a-- usingDomain :: (String -> String) -> a -> a- usingDomain = domain `using` setDomain
− Data/Geo/GPX/Accessor/Ele.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Ele where--import Data.Geo.GPX.Accessor.Accessor--class Ele a where- ele :: a -> Maybe Double- setEle :: Maybe Double -> a -> a-- setEle' :: Double -> a -> a- setEle' = setEle . Just-- usingEle :: (Maybe Double -> Maybe Double) -> a -> a- usingEle = ele `using` setEle-- usingEle' :: (Double -> Double) -> a -> a- usingEle' = usingEle . fmap
− Data/Geo/GPX/Accessor/Email.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Email where--import Data.Geo.GPX.EmailType-import Data.Geo.GPX.Accessor.Accessor--class Email a where- email :: a -> Maybe EmailType- setEmail :: Maybe EmailType -> a -> a-- setEmail' :: EmailType -> a -> a- setEmail' = setEmail . Just-- usingEmail :: (Maybe EmailType -> Maybe EmailType) -> a -> a- usingEmail = email `using` setEmail-- usingEmail' :: (EmailType -> EmailType) -> a -> a- usingEmail' = usingEmail . fmap
− Data/Geo/GPX/Accessor/Extensions.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Extensions where--import Data.Geo.GPX.ExtensionsType-import Data.Geo.GPX.Accessor.Accessor--class Extensions a where- extensions :: a -> Maybe ExtensionsType- setExtensions :: Maybe ExtensionsType -> a -> a-- setExtensions' :: ExtensionsType -> a -> a- setExtensions' = setExtensions . Just-- usingExtensions :: (Maybe ExtensionsType -> Maybe ExtensionsType) -> a -> a- usingExtensions = extensions `using` setExtensions-- usingExtensions' :: (ExtensionsType -> ExtensionsType) -> a -> a- usingExtensions' = usingExtensions . fmap
− Data/Geo/GPX/Accessor/Fix.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Fix where--import Data.Geo.GPX.FixType-import Data.Geo.GPX.Accessor.Accessor--class Fix a where- fix :: a -> Maybe FixType- setFix :: Maybe FixType -> a -> a-- setFix' :: FixType -> a -> a- setFix' = setFix . Just-- usingFix :: (Maybe FixType -> Maybe FixType) -> a -> a- usingFix = fix `using` setFix-- usingFix' :: (FixType -> FixType) -> a -> a- usingFix' = usingFix . fmap
− Data/Geo/GPX/Accessor/Geoidheight.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Geoidheight where--import Data.Geo.GPX.Accessor.Accessor--class Geoidheight a where- geoidheight :: a -> Maybe Double- setGeoidheight :: Maybe Double -> a -> a-- setGeoidheight' :: Double -> a -> a- setGeoidheight' = setGeoidheight . Just-- usingGeoidheight :: (Maybe Double -> Maybe Double) -> a -> a- usingGeoidheight = geoidheight `using` setGeoidheight-- usingGeoidheight' :: (Double -> Double) -> a -> a- usingGeoidheight' = usingGeoidheight . fmap
− Data/Geo/GPX/Accessor/Hdop.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Hdop where--import Data.Geo.GPX.Accessor.Accessor--class Hdop a where- hdop :: a -> Maybe Double- setHdop :: Maybe Double -> a -> a-- setHdop' :: Double -> a -> a- setHdop' = setHdop . Just-- usingHdop :: (Maybe Double -> Maybe Double) -> a -> a- usingHdop = hdop `using` setHdop-- usingHdop' :: (Double -> Double) -> a -> a- usingHdop' = usingHdop . fmap
− Data/Geo/GPX/Accessor/Href.hs
@@ -1,10 +0,0 @@-module Data.Geo.GPX.Accessor.Href where--import Data.Geo.GPX.Accessor.Accessor--class Href a where- href :: a -> String- setHref :: String -> a -> a-- usingHref :: (String -> String) -> a -> a- usingHref = href `using` setHref
− Data/Geo/GPX/Accessor/Id.hs
@@ -1,11 +0,0 @@-module Data.Geo.GPX.Accessor.Id where--import Data.Geo.GPX.Accessor.Accessor-import Prelude hiding (id)--class Id a where- id :: a -> String- setId :: String -> a -> a-- usingId :: (String -> String) -> a -> a- usingId = id `using` setId
− Data/Geo/GPX/Accessor/Keywords.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Keywords where--import Data.Geo.GPX.Accessor.Accessor--class Keywords a where- keywords :: a -> Maybe String- setKeywords :: Maybe String -> a -> a-- setKeywords' :: String -> a -> a- setKeywords' = setKeywords . Just-- usingKeywords :: (Maybe String -> Maybe String) -> a -> a- usingKeywords = keywords `using` setKeywords-- usingKeywords' :: (String -> String) -> a -> a- usingKeywords' = usingKeywords . fmap
− Data/Geo/GPX/Accessor/Lat.hs
@@ -1,11 +0,0 @@-module Data.Geo.GPX.Accessor.Lat where--import Data.Geo.GPX.LatitudeType-import Data.Geo.GPX.Accessor.Accessor--class Lat a where- lat :: a -> LatitudeType- setLat :: LatitudeType -> a -> a-- usingLat :: (LatitudeType -> LatitudeType) -> a -> a- usingLat = lat `using` setLat
− Data/Geo/GPX/Accessor/Latlon.hs
@@ -1,11 +0,0 @@-{-# LANGUAGE FlexibleContexts, FlexibleInstances, UndecidableInstances #-}--module Data.Geo.GPX.Accessor.Latlon where-import Data.Geo.GPX.Accessor.Accessor--class Latlon a where- latlon :: a -> (Double, Double)- setLatlon :: (Double, Double) -> a -> a-- usingLatlon :: ((Double, Double) -> (Double, Double)) -> a -> a- usingLatlon = latlon `using` setLatlon
− Data/Geo/GPX/Accessor/License.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.License where--import Data.Geo.GPX.Accessor.Accessor--class License a where- license :: a -> Maybe String- setLicense :: Maybe String -> a -> a-- setLicense' :: String -> a -> a- setLicense' = setLicense . Just-- usingLicense :: (Maybe String -> Maybe String) -> a -> a- usingLicense = license `using` setLicense-- usingLicense' :: (String -> String) -> a -> a- usingLicense' = usingLicense . fmap
− Data/Geo/GPX/Accessor/Link.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Link where--import Data.Geo.GPX.LinkType-import Data.Geo.GPX.Accessor.Accessor--class Link a where- link :: a -> Maybe LinkType- setLink :: Maybe LinkType -> a -> a-- setLink' :: LinkType -> a -> a- setLink' = setLink . Just-- usingLink :: (Maybe LinkType -> Maybe LinkType) -> a -> a- usingLink = link `using` setLink-- usingLink' :: (LinkType -> LinkType) -> a -> a- usingLink' = usingLink . fmap
− Data/Geo/GPX/Accessor/Links.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Links where--import Data.Geo.GPX.LinkType-import Data.Geo.GPX.Accessor.Accessor--class Links a where- links :: a -> [LinkType]- setLinks :: [LinkType] -> a -> a-- setLinks' :: LinkType -> a -> a- setLinks' = setLinks . return-- usingLinks :: ([LinkType] -> [LinkType]) -> a -> a- usingLinks = links `using` setLinks-- usingLinks' :: (LinkType -> LinkType) -> a -> a- usingLinks' = usingLinks . fmap
− Data/Geo/GPX/Accessor/Lon.hs
@@ -1,11 +0,0 @@-module Data.Geo.GPX.Accessor.Lon where--import Data.Geo.GPX.LongitudeType-import Data.Geo.GPX.Accessor.Accessor--class Lon a where- lon :: a -> LongitudeType- setLon :: LongitudeType -> a -> a-- usingLon :: (LongitudeType -> LongitudeType) -> a -> a- usingLon = lon `using` setLon
− Data/Geo/GPX/Accessor/Magvar.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Magvar where--import Data.Geo.GPX.DegreesType-import Data.Geo.GPX.Accessor.Accessor--class Magvar a where- magvar :: a -> Maybe DegreesType- setMagvar :: Maybe DegreesType -> a -> a-- setMagvar' :: DegreesType -> a -> a- setMagvar' = setMagvar . Just-- usingMagvar :: (Maybe DegreesType -> Maybe DegreesType) -> a -> a- usingMagvar = magvar `using` setMagvar-- usingMagvar' :: (DegreesType -> DegreesType) -> a -> a- usingMagvar' = usingMagvar . fmap
− Data/Geo/GPX/Accessor/Maxlat.hs
@@ -1,11 +0,0 @@-module Data.Geo.GPX.Accessor.Maxlat where--import Data.Geo.GPX.LatitudeType-import Data.Geo.GPX.Accessor.Accessor--class Maxlat a where- maxlat :: a -> LatitudeType- setMaxlat :: LatitudeType -> a -> a-- usingMaxlat :: (LatitudeType -> LatitudeType) -> a -> a- usingMaxlat = maxlat `using` setMaxlat
− Data/Geo/GPX/Accessor/Maxlon.hs
@@ -1,11 +0,0 @@-module Data.Geo.GPX.Accessor.Maxlon where--import Data.Geo.GPX.LongitudeType-import Data.Geo.GPX.Accessor.Accessor--class Maxlon a where- maxlon :: a -> LongitudeType- setMaxlon :: LongitudeType -> a -> a-- usingMaxlon :: (LongitudeType -> LongitudeType) -> a -> a- usingMaxlon = maxlon `using` setMaxlon
− Data/Geo/GPX/Accessor/Metadata.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Metadata where--import Data.Geo.GPX.MetadataType-import Data.Geo.GPX.Accessor.Accessor--class Metadata a where- metadata :: a -> Maybe MetadataType- setMetadata :: Maybe MetadataType -> a -> a-- setMetadata' :: MetadataType -> a -> a- setMetadata' = setMetadata . Just-- usingMetadata :: (Maybe MetadataType -> Maybe MetadataType) -> a -> a- usingMetadata = metadata `using` setMetadata-- usingMetadata' :: (MetadataType -> MetadataType) -> a -> a- usingMetadata' = usingMetadata . fmap
− Data/Geo/GPX/Accessor/Minlat.hs
@@ -1,11 +0,0 @@-module Data.Geo.GPX.Accessor.Minlat where--import Data.Geo.GPX.LatitudeType-import Data.Geo.GPX.Accessor.Accessor--class Minlat a where- minlat :: a -> LatitudeType- setMinlat :: LatitudeType -> a -> a-- usingMinlat :: (LatitudeType -> LatitudeType) -> a -> a- usingMinlat = minlat `using` setMinlat
− Data/Geo/GPX/Accessor/Minlon.hs
@@ -1,11 +0,0 @@-module Data.Geo.GPX.Accessor.Minlon where--import Data.Geo.GPX.LongitudeType-import Data.Geo.GPX.Accessor.Accessor--class Minlon a where- minlon :: a -> LongitudeType- setMinlon :: LongitudeType -> a -> a-- usingMinlon :: (LongitudeType -> LongitudeType) -> a -> a- usingMinlon = minlon `using` setMinlon
− Data/Geo/GPX/Accessor/Name.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Name where--import Data.Geo.GPX.Accessor.Accessor--class Name a where- name :: a -> Maybe String- setName :: Maybe String -> a -> a-- setName' :: String -> a -> a- setName' = setName . Just-- usingName :: (Maybe String -> Maybe String) -> a -> a- usingName = name `using` setName-- usingName' :: (String -> String) -> a -> a- usingName' = usingName . fmap
− Data/Geo/GPX/Accessor/Number.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Number where--import Data.Geo.GPX.Accessor.Accessor--class Number a where- number :: a -> Maybe Int- setNumber :: Maybe Int -> a -> a-- setNumber' :: Int -> a -> a- setNumber' = setNumber . Just-- usingNumber :: (Maybe Int -> Maybe Int) -> a -> a- usingNumber = number `using` setNumber-- usingNumber' :: (Int -> Int) -> a -> a- usingNumber' = usingNumber . fmap
− Data/Geo/GPX/Accessor/Pdop.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Pdop where--import Data.Geo.GPX.Accessor.Accessor--class Pdop a where- pdop :: a -> Maybe Double- setPdop :: Maybe Double -> a -> a-- setPdop' :: Double -> a -> a- setPdop' = setPdop . Just-- usingPdop :: (Maybe Double -> Maybe Double) -> a -> a- usingPdop = pdop `using` setPdop-- usingPdop' :: (Double -> Double) -> a -> a- usingPdop' = usingPdop . fmap
− Data/Geo/GPX/Accessor/Pts.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Pts where--import Data.Geo.GPX.PtType-import Data.Geo.GPX.Accessor.Accessor--class Pts a where- pts :: a -> [PtType]- setPts :: [PtType] -> a -> a-- setPts' :: PtType -> a -> a- setPts' = setPts . return-- usingPts :: ([PtType] -> [PtType]) -> a -> a- usingPts = pts `using` setPts-- usingPts' :: (PtType -> PtType) -> a -> a- usingPts' = usingPts . fmap
− Data/Geo/GPX/Accessor/Rtepts.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Rtepts where--import Data.Geo.GPX.WptType-import Data.Geo.GPX.Accessor.Accessor--class Rtepts a where- rtepts :: a -> [WptType]- setRtepts :: [WptType] -> a -> a-- setRtepts' :: WptType -> a -> a- setRtepts' = setRtepts . return-- usingRtepts :: ([WptType] -> [WptType]) -> a -> a- usingRtepts = rtepts `using` setRtepts-- usingRtepts' :: (WptType -> WptType) -> a -> a- usingRtepts' = usingRtepts . fmap
− Data/Geo/GPX/Accessor/Rtes.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Rtes where--import Data.Geo.GPX.RteType-import Data.Geo.GPX.Accessor.Accessor--class Rtes a where- rtes :: a -> [RteType]- setRtes :: [RteType] -> a -> a-- setRtes' :: RteType -> a -> a- setRtes' = setRtes . return-- usingRtes :: ([RteType] -> [RteType]) -> a -> a- usingRtes = rtes `using` setRtes-- usingRtes' :: (RteType -> RteType) -> a -> a- usingRtes' = usingRtes . fmap
− Data/Geo/GPX/Accessor/Sat.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Sat where--import Data.Geo.GPX.Accessor.Accessor--class Sat a where- sat :: a -> Maybe Int- setSat :: Maybe Int -> a -> a-- setSat' :: Int -> a -> a- setSat' = setSat . Just-- usingSat :: (Maybe Int -> Maybe Int) -> a -> a- usingSat = sat `using` setSat-- usingSat' :: (Int -> Int) -> a -> a- usingSat' = usingSat . fmap
− Data/Geo/GPX/Accessor/Src.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Src where--import Data.Geo.GPX.Accessor.Accessor--class Src a where- src :: a -> Maybe String- setSrc :: Maybe String -> a -> a-- setSrc' :: String -> a -> a- setSrc' = setSrc . Just-- usingSrc :: (Maybe String -> Maybe String) -> a -> a- usingSrc = src `using` setSrc-- usingSrc' :: (String -> String) -> a -> a- usingSrc' = usingSrc . fmap
− Data/Geo/GPX/Accessor/Sym.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Sym where--import Data.Geo.GPX.Accessor.Accessor--class Sym a where- sym :: a -> Maybe String- setSym :: Maybe String -> a -> a-- setSym' :: String -> a -> a- setSym' = setSym . Just-- usingSym :: (Maybe String -> Maybe String) -> a -> a- usingSym = sym `using` setSym-- usingSym' :: (String -> String) -> a -> a- usingSym' = usingSym . fmap
− Data/Geo/GPX/Accessor/Text.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Text where--import Data.Geo.GPX.Accessor.Accessor--class Text a where- text :: a -> Maybe String- setText :: Maybe String -> a -> a-- setText' :: String -> a -> a- setText' = setText . Just-- usingText :: (Maybe String -> Maybe String) -> a -> a- usingText = text `using` setText-- usingText' :: (String -> String) -> a -> a- usingText' = usingText . fmap
− Data/Geo/GPX/Accessor/Time.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Time where--import Text.XML.XSD.DateTime-import Data.Geo.GPX.Accessor.Accessor--class Time a where- time :: a -> Maybe DateTime- setTime :: Maybe DateTime -> a -> a-- setTime' :: DateTime -> a -> a- setTime' = setTime . Just-- usingTime :: (Maybe DateTime -> Maybe DateTime) -> a -> a- usingTime = time `using` setTime-- usingTime' :: (DateTime -> DateTime) -> a -> a- usingTime' = usingTime . fmap
− Data/Geo/GPX/Accessor/Trkpts.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Trkpts where--import Data.Geo.GPX.WptType-import Data.Geo.GPX.Accessor.Accessor--class Trkpts a where- trkpts :: a -> [WptType]- setTrkpts :: [WptType] -> a -> a-- setTrkpts' :: WptType -> a -> a- setTrkpts' = setTrkpts . return-- usingTrkpts :: ([WptType] -> [WptType]) -> a -> a- usingTrkpts = trkpts `using` setTrkpts-- usingTrkpts' :: (WptType -> WptType) -> a -> a- usingTrkpts' = usingTrkpts . fmap
− Data/Geo/GPX/Accessor/Trks.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Trks where--import Data.Geo.GPX.TrkType-import Data.Geo.GPX.Accessor.Accessor--class Trks a where- trks :: a -> [TrkType]- setTrks :: [TrkType] -> a -> a-- setTrks' :: TrkType -> a -> a- setTrks' = setTrks . return-- usingTrks :: ([TrkType] -> [TrkType]) -> a -> a- usingTrks = trks `using` setTrks-- usingTrks' :: (TrkType -> TrkType) -> a -> a- usingTrks' = usingTrks . fmap
− Data/Geo/GPX/Accessor/Trksegs.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Trksegs where--import Data.Geo.GPX.TrksegType-import Data.Geo.GPX.Accessor.Accessor--class Trksegs a where- trksegs :: a -> [TrksegType]- setTrksegs :: [TrksegType] -> a -> a-- setTrksegs' :: TrksegType -> a -> a- setTrksegs' = setTrksegs . return-- usingTrksegs :: ([TrksegType] -> [TrksegType]) -> a -> a- usingTrksegs = trksegs `using` setTrksegs-- usingTrksegs' :: (TrksegType -> TrksegType) -> a -> a- usingTrksegs' = usingTrksegs . fmap
− Data/Geo/GPX/Accessor/Type.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Type where--import Data.Geo.GPX.Accessor.Accessor--class Type a where- type' :: a -> Maybe String- setType :: Maybe String -> a -> a-- setType' :: String -> a -> a- setType' = setType . Just-- usingType :: (Maybe String -> Maybe String) -> a -> a- usingType = type' `using` setType-- usingType' :: (String -> String) -> a -> a- usingType' = usingType . fmap
− Data/Geo/GPX/Accessor/Value.hs
@@ -1,11 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}-module Data.Geo.GPX.Accessor.Value where--import Data.Geo.GPX.Accessor.Accessor--class Value a b | a -> b where- value :: a -> b- setValue :: b -> a -> a-- usingValue :: (b -> b) -> a -> a- usingValue = value `using` setValue
− Data/Geo/GPX/Accessor/Vdop.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Vdop where--import Data.Geo.GPX.Accessor.Accessor--class Vdop a where- vdop :: a -> Maybe Double- setVdop :: Maybe Double -> a -> a-- setVdop' :: Double -> a -> a- setVdop' = setVdop . Just-- usingVdop :: (Maybe Double -> Maybe Double) -> a -> a- usingVdop = vdop `using` setVdop-- usingVdop' :: (Double -> Double) -> a -> a- usingVdop' = usingVdop . fmap
− Data/Geo/GPX/Accessor/Version.hs
@@ -1,10 +0,0 @@-module Data.Geo.GPX.Accessor.Version where--import Data.Geo.GPX.Accessor.Accessor--class Version a where- version :: a -> String- setVersion :: String -> a -> a-- usingVersion :: (String -> String) -> a -> a- usingVersion = version `using` setVersion
− Data/Geo/GPX/Accessor/Wpts.hs
@@ -1,17 +0,0 @@-module Data.Geo.GPX.Accessor.Wpts where--import Data.Geo.GPX.WptType-import Data.Geo.GPX.Accessor.Accessor--class Wpts a where- wpts :: a -> [WptType]- setWpts :: [WptType] -> a -> a-- setWpts' :: WptType -> a -> a- setWpts' = setWpts . return-- usingWpts :: ([WptType] -> [WptType]) -> a -> a- usingWpts = wpts `using` setWpts-- usingWpts' :: (WptType -> WptType) -> a -> a- usingWpts' = usingWpts . fmap
− Data/Geo/GPX/Accessor/Year.hs
@@ -1,16 +0,0 @@-module Data.Geo.GPX.Accessor.Year where--import Data.Geo.GPX.Accessor.Accessor--class Year a where- year :: a -> Maybe String- setYear :: Maybe String -> a -> a-- setYear' :: String -> a -> a- setYear' = setYear . Just-- usingYear :: (Maybe String -> Maybe String) -> a -> a- usingYear = year `using` setYear-- usingYear' :: (String -> String) -> a -> a- usingYear' = usingYear . fmap
− Data/Geo/GPX/BoundsType.hs
@@ -1,45 +0,0 @@--- | Complex Type: @boundsType@ <http://www.topografix.com/GPX/1/1/#type_boundsType>-module Data.Geo.GPX.BoundsType(- BoundsType,- boundsType- ) where--import Data.Geo.GPX.LatitudeType-import Data.Geo.GPX.LongitudeType-import Data.Geo.GPX.Accessor.Minlat-import Data.Geo.GPX.Accessor.Maxlat-import Data.Geo.GPX.Accessor.Minlon-import Data.Geo.GPX.Accessor.Maxlon-import Text.XML.HXT.Core--data BoundsType = BoundsType (LatitudeType, LongitudeType) (LatitudeType, LongitudeType)- deriving (Show, Eq)--boundsType :: (LatitudeType, LongitudeType) -- ^ The minimum latitude and longitude.- -> (LatitudeType, LongitudeType) -- ^ The maximum latitude and longitude.- -> BoundsType-boundsType = BoundsType--instance XmlPickler BoundsType where- xpickle = xpWrap (\(minlat', minlon', maxlat', maxlon') -> boundsType (minlat', minlon') (maxlat', maxlon'),- \(BoundsType (minlat', minlon') (maxlat', maxlon')) -> (minlat', minlon', maxlat', maxlon')) (xp4Tuple- (xpAttr "minlat" xpickle)- (xpAttr "minlon" xpickle)- (xpAttr "maxlat" xpickle)- (xpAttr "maxlon" xpickle))--instance Minlat BoundsType where- minlat (BoundsType (x, _) (_, _)) = x- setMinlat a (BoundsType (_, b) (c, d)) = boundsType (a, b) (c, d)--instance Maxlat BoundsType where- maxlat (BoundsType (_, _) (x, _)) = x- setMaxlat c (BoundsType (a, b) (_, d)) = boundsType (a, b) (c, d)--instance Minlon BoundsType where- minlon (BoundsType (_, x) (_, _)) = x- setMinlon b (BoundsType (a, _) (c, d)) = boundsType (a, b) (c, d)--instance Maxlon BoundsType where- maxlon (BoundsType (_, _) (_, x)) = x- setMaxlon d (BoundsType (a, b) (c, _)) = boundsType (a, b) (c, d)
− Data/Geo/GPX/CopyrightType.hs
@@ -1,39 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-}---- | Complex Type: @copyrightType@ <http://www.topografix.com/GPX/1/1/#type_copyrightType>-module Data.Geo.GPX.CopyrightType(- CopyrightType,- copyrightType- ) where--import Data.Geo.GPX.Accessor.Author-import Data.Geo.GPX.Accessor.Year-import Data.Geo.GPX.Accessor.License-import Text.XML.HXT.Core--data CopyrightType = CopyrightType String (Maybe String) (Maybe String)- deriving (Eq, Show)--copyrightType :: String -- ^ The author.- -> Maybe String -- ^ The year.- -> Maybe String -- ^ The license.- -> CopyrightType-copyrightType = CopyrightType--instance XmlPickler CopyrightType where- xpickle = xpWrap (\(author', year', license') -> copyrightType author' year' license', \(CopyrightType author' year' license') -> (author', year', license')) (xpTriple- (xpAttr "author" xpText)- (xpOption (xpElem "year" xpText))- (xpOption (xpElem "license" xpText)))--instance Author CopyrightType String where- author (CopyrightType x _ _) = x- setAuthor x (CopyrightType _ y z) = copyrightType x y z--instance Year CopyrightType where- year (CopyrightType _ x _) = x- setYear y (CopyrightType x _ z) = copyrightType x y z--instance License CopyrightType where- license (CopyrightType _ _ x) = x- setLicense z (CopyrightType x y _) = copyrightType x y z
− Data/Geo/GPX/DegreesType.hs
@@ -1,25 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses #-}---- | Simple Type: @degreesType@ <http://www.topografix.com/GPX/1/1/#type_degreesType>-module Data.Geo.GPX.DegreesType(- DegreesType,- degreesType- ) where--import Data.Geo.GPX.Accessor.Value-import Data.Fixed-import Text.XML.HXT.Core--newtype DegreesType = DegreesType Double- deriving (Eq, Show)--degreesType :: Double -- ^ The value which will be between 0 and 360 (values out of the range are truncated using a modulus operation).- -> DegreesType-degreesType n = DegreesType (n `mod'` 360)--instance XmlPickler DegreesType where- xpickle = xpWrap (degreesType, \(DegreesType n) -> n) xpPrim--instance Value DegreesType Double where- value (DegreesType x) = x- setValue x (DegreesType _) = degreesType x
− Data/Geo/GPX/DgpsStationType.hs
@@ -1,29 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses #-}---- | Simple Type: @dgpsStationType@ <http://www.topografix.com/GPX/1/1/#type_dgpsStationType>-module Data.Geo.GPX.DgpsStationType(- DgpsStationType,- dgpsStationType- ) where--import Text.XML.HXT.Core-import Data.Geo.GPX.Accessor.Value-import Data.Ix-import Data.Maybe--newtype DgpsStationType = DgpsStationType Int- deriving Eq--dgpsStationType :: Int -- ^ The value between 0 and 1023.- -> Maybe DgpsStationType-dgpsStationType n = if inRange (0, 1023) n then Just (DgpsStationType n) else Nothing--instance Show DgpsStationType where- show (DgpsStationType n) = show n--instance XmlPickler DgpsStationType where- xpickle = xpWrapMaybe (dgpsStationType, \(DgpsStationType n) -> n) xpickle--instance Value DgpsStationType Int where- value (DgpsStationType x) = x- setValue x (DgpsStationType _) = fromMaybe (error ("DgpsStationType " ++ show x ++ " out of range (0,1023)")) (dgpsStationType x)
− Data/Geo/GPX/EmailType.hs
@@ -1,29 +0,0 @@--- | Complex Type: @emailType@ <http://www.topografix.com/GPX/1/1/#type_emailType>-module Data.Geo.GPX.EmailType(- EmailType,- emailType- ) where--import Text.XML.HXT.Core-import Data.Geo.GPX.Accessor.Id-import Data.Geo.GPX.Accessor.Domain--data EmailType = EmailType String String- deriving (Eq, Show)--emailType :: String -- ^ The id.- -> String -- ^ The domain.- -> EmailType-emailType = EmailType--instance XmlPickler EmailType where- xpickle = xpWrap (uncurry emailType, \(EmailType id' domain') -> (id', domain'))- (xpPair (xpAttr "id" xpText) (xpAttr "domain" xpText))--instance Id EmailType where- id (EmailType x _) = x- setId a (EmailType _ b) = emailType a b--instance Domain EmailType where- domain (EmailType _ x) = x- setDomain b (EmailType a _) = emailType a b
− Data/Geo/GPX/ExtensionsType.hs
@@ -1,24 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleInstances #-}---- | Complex Type: @extensionsType@ <http://www.topografix.com/GPX/1/1/#type_extensionsType>-module Data.Geo.GPX.ExtensionsType(- ExtensionsType,- extensionsType- ) where--import Text.XML.HXT.Core-import Data.Geo.GPX.Accessor.Value--newtype ExtensionsType = ExtensionsType XmlTree- deriving (Eq, Show)--instance XmlPickler ExtensionsType where- xpickle = xpWrap (ExtensionsType, \(ExtensionsType t) -> t) xpTree--extensionsType :: XmlTree -- ^ The extensions sub-tree.- -> ExtensionsType-extensionsType = ExtensionsType--instance Value ExtensionsType XmlTree where- value (ExtensionsType x) = x- setValue x (ExtensionsType _) = extensionsType x
− Data/Geo/GPX/FixType.hs
@@ -1,66 +0,0 @@--- | Simple Type: @fixType@ <http://www.topografix.com/GPX/1/1/#type_fixType>-module Data.Geo.GPX.FixType(- FixType,- foldFixType,- none,- twod,- threed,- dgps,- pps,- fixType- ) where--import Text.XML.HXT.Core hiding (none)--data FixType = None | Twod | Threed | Dgps | Pps- deriving (Eq, Enum)---- | The catamorphism for @FixType@.-foldFixType :: a -- ^ The value if @none@.- -> a -- ^ The value if @twod@.- -> a -- ^ The value if @threed@.- -> a -- ^ The value if @dgps@.- -> a -- ^ The value if @pps@.- -> FixType -- ^ The value to fold.- -> a-foldFixType n _ _ _ _ None = n-foldFixType _ t _ _ _ Twod = t-foldFixType _ _ t _ _ Threed = t-foldFixType _ _ _ d _ Dgps = d-foldFixType _ _ _ _ p Pps = p---- | Construct a @FixType@ with a value of @none@.-none :: FixType-none = None---- | Construct a @FixType@ with a value of @2d@.-twod :: FixType-twod = Twod---- | Construct a @FixType@ with a value of @3d@.-threed :: FixType-threed = Threed---- | Construct a @FixType@ with a value of @dgps@.-dgps :: FixType-dgps = Dgps---- | Construct a @FixType@ with a value of @pps@.-pps :: FixType-pps = Pps---- | Construct a @FixType@ using a string with a value of @["none", "2d", "3d", "dgps", "pps"]@.-fixType :: String -- ^ The string value to construct a @FixType@ with.- -> Maybe FixType-fixType "none" = Just none-fixType "2d"= Just twod-fixType "3d" = Just threed-fixType "dgps" = Just dgps-fixType "pps" = Just pps-fixType _ = Nothing--instance XmlPickler FixType where- xpickle = xpWrapMaybe (fixType, show) xpText--instance Show FixType where- show = foldFixType "none" "2d" "3d" "dgps" "pps"
− Data/Geo/GPX/Gpx.hs
@@ -1,142 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, GeneralizedNewtypeDeriving #-}---- | Element: @gpx@ <http://www.topografix.com/GPX/1/1/#element_gpx>-module Data.Geo.GPX.Gpx(- Gpx,- gpx,- readGpxFile,- readGpxFiles,- interactGpxIO,- interactsGpxIO,- interactGpxIO',- interactsGpxIO',- interactGpx,- interactsGpx,- interactGpx',- interactsGpx'- ) where--import Text.XML.HXT.Core-import Control.Monad-import Data.List-import Data.Geo.GPX.GpxType-import Data.Geo.GPX.PersonType-import Data.Geo.GPX.Accessor.Value-import Data.Geo.GPX.Accessor.Version-import Data.Geo.GPX.Accessor.Creator-import Data.Geo.GPX.Accessor.Metadata-import Data.Geo.GPX.Accessor.Wpts-import Data.Geo.GPX.Accessor.Rtes-import Data.Geo.GPX.Accessor.Trks-import Data.Geo.GPX.Accessor.Extensions-import Data.Geo.GPX.Accessor.Name-import Data.Geo.GPX.Accessor.Desc-import Data.Geo.GPX.Accessor.Author-import Data.Geo.GPX.Accessor.Copyright-import Data.Geo.GPX.Accessor.Links-import Data.Geo.GPX.Accessor.Time-import Data.Geo.GPX.Accessor.Keywords-import Data.Geo.GPX.Accessor.Bounds-import Data.Geo.GPX.Accessor.Rtepts-import Data.Geo.GPX.Accessor.Trkpts--newtype Gpx = Gpx GpxType- deriving (Eq, Version, Creator, Metadata, Wpts, Rtes, Trks, Extensions, Name, Desc, Copyright, Links, Time, Keywords, Bounds, Rtepts, Trkpts)--instance Author Gpx (Maybe PersonType) where- author = author . value- setAuthor = (gpx .) . (. value) . setAuthor--gpx :: GpxType -- ^ The gpx element contents.- -> Gpx-gpx = Gpx--instance Show Gpx where- show (Gpx n) = show n--instance XmlPickler Gpx where- xpickle = xpWrap (gpx, \(Gpx n) -> n) (xpElem "gpx" xpickle)--instance Value Gpx GpxType where- value (Gpx x) = x- setValue x (Gpx _) = gpx x---- | Reads a GPX file into a list of @Gpx@ values removing whitespace.-readGpxFile :: FilePath -> IO [Gpx]-readGpxFile = runX . xunpickleDocument (xpickle :: PU Gpx) [withRemoveWS yes, withValidate no]---- | Reads 0 or more GPX files into a list of @Gpx@ values removing whitespace.-readGpxFiles :: [FilePath] -> IO [Gpx]-readGpxFiles = fmap join . mapM readGpxFile---- | Reads a GPX file, executes the given function on the XML, then writes the given file.-interactGpxIO' :: SysConfigList -- ^ The options for reading the GPX file.- -> FilePath -- ^ The GPX file to read.- -> (Gpx -> IO Gpx) -- ^ The function to execute on the XML that is read.- -> SysConfigList -- ^ The options for writing the GPX file.- -> FilePath -- ^ The GPX file to write.- -> IO ()-interactGpxIO' froma from f toa to = runX (xunpickleDocument (xpickle :: PU Gpx) froma from >>> arrIO f >>> xpickleDocument (xpickle :: PU Gpx) toa to) >> return ()---- | Reads a GPX file, executes the given functions on the XML, then writes the given file.-interactsGpxIO' :: SysConfigList -- ^ The options for reading the GPX file.- -> FilePath -- ^ The GPX file to read.- -> [Gpx -> IO Gpx] -- ^ The function to execute on the XML that is read.- -> SysConfigList -- ^ The options for writing the GPX file.- -> FilePath -- ^ The GPX file to write.- -> IO ()-interactsGpxIO' froma from = interactGpxIO' froma from . sumIO'---- | Reads a GPX file removing whitespace, executes the given function on the XML, then writes the given file with indentation.-interactGpxIO :: FilePath -- ^ The GPX file to read.- -> (Gpx -> IO Gpx) -- ^ The function to execute on the XML that is read.- -> FilePath -- ^ The GPX file to write.- -> IO ()-interactGpxIO from f = interactGpxIO' [] from f []---- | Reads a GPX file removing whitespace, executes the given functions on the XML, then writes the given file with indentation.-interactsGpxIO :: FilePath -- ^ The GPX file to read.- -> [Gpx -> IO Gpx] -- ^ The function to execute on the XML that is read.- -> FilePath -- ^ The GPX file to write.- -> IO ()-interactsGpxIO from = interactGpxIO from . sumIO'---- | Reads a GPX file, executes the given function on the XML, then writes the given file.-interactGpx' :: SysConfigList -- ^ The options for reading the GPX file.- -> FilePath -- ^ The GPX file to read.- -> (Gpx -> Gpx) -- ^ The function to execute on the XML that is read.- -> SysConfigList -- ^ The options for writing the GPX file.- -> FilePath -- ^ The GPX file to write.- -> IO ()-interactGpx' froma from f = interactGpxIO' froma from (return . f)---- | Reads a GPX file, executes the given functions on the XML, then writes the given file.-interactsGpx' :: SysConfigList -- ^ The options for reading the GPX file.- -> FilePath -- ^ The GPX file to read.- -> [Gpx -> Gpx] -- ^ The functions to execute on the XML that is read.- -> SysConfigList -- ^ The options for writing the GPX file.- -> FilePath -- ^ The GPX file to write.- -> IO ()-interactsGpx' froma from = interactGpx' froma from . sum'---- | Reads a GPX file removing whitespace, executes the given function on the XML, then writes the given file with indentation.-interactGpx :: FilePath -- ^ The GPX file to read.- -> (Gpx -> Gpx) -- ^ The function to execute on the XML that is read.- -> FilePath -- ^ The GPX file to write.- -> IO ()-interactGpx from f = interactGpxIO from (return . f)---- | Reads a GPX file removing whitespace, executes the given functions on the XML, then writes the given file with indentation.-interactsGpx :: FilePath -- ^ The GPX file to read.- -> [Gpx -> Gpx] -- ^ The function to execute on the XML that is read.- -> FilePath -- ^ The GPX file to write.- -> IO ()-interactsGpx from = interactGpx from . sum'---- not exported--sum' :: [a -> a] -> a -> a-sum' = foldl' (.) id--sumIO' :: (Monad m) => [a -> m a] -> a -> m a-sumIO' = foldl' (>=>) return
− Data/Geo/GPX/GpxType.hs
@@ -1,126 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}---- | Complex Type: @gpxType@ <http://www.topografix.com/GPX/1/1/#type_gpxType>-module Data.Geo.GPX.GpxType(- GpxType,- gpxType- ) where--import Data.Geo.GPX.MetadataType-import Data.Geo.GPX.WptType-import Data.Geo.GPX.RteType-import Data.Geo.GPX.TrkType-import Data.Geo.GPX.ExtensionsType-import Data.Geo.GPX.PersonType-import Data.Geo.GPX.Accessor.Version-import Data.Geo.GPX.Accessor.Creator-import Data.Geo.GPX.Accessor.Metadata-import Data.Geo.GPX.Accessor.Wpts-import Data.Geo.GPX.Accessor.Rtes-import Data.Geo.GPX.Accessor.Trks-import Data.Geo.GPX.Accessor.Extensions-import Data.Geo.GPX.Accessor.Name-import Data.Geo.GPX.Accessor.Desc-import Data.Geo.GPX.Accessor.Author-import Data.Geo.GPX.Accessor.Copyright-import Data.Geo.GPX.Accessor.Links-import Data.Geo.GPX.Accessor.Time-import Data.Geo.GPX.Accessor.Keywords-import Data.Geo.GPX.Accessor.Bounds-import Data.Geo.GPX.Accessor.Rtepts-import Data.Geo.GPX.Accessor.Trkpts-import Text.XML.HXT.Core-import Text.XML.HXT.Extras-import Data.Maybe--data GpxType = GpxType String String (Maybe MetadataType) [WptType] [RteType] [TrkType] (Maybe ExtensionsType)- deriving (Eq, Show)--gpxType :: String -- ^ The version.- -> String -- ^ The creator.- -> Maybe MetadataType -- ^ The metadata.- -> [WptType] -- ^ The waypoints (wpt).- -> [RteType] -- ^ The routes (rte).- -> [TrkType] -- ^ The tracks (trk).- -> Maybe ExtensionsType -- ^ The extensions.- -> GpxType-gpxType = GpxType--instance XmlPickler GpxType where- xpickle = xpWrap (\(version', creator', metadata', wpt', rte', trk', extensions') -> gpxType version' creator' metadata' wpt' rte' trk' extensions',- \(GpxType version' creator' metadata' wpt' rte' trk' extensions') -> (version', creator', metadata', wpt', rte', trk', extensions')) (xp7Tuple- (xpAttr "version" xpText)- (xpAttr "creator" xpText)- (xpOption (xpElem "metadata" xpickle))- (xpList (xpElem "wpt" xpickle))- (xpList (xpElem "rte" xpickle))- (xpList (xpElem "trk" xpickle))- (xpOption (xpElem "extensions" xpickle)))--instance Version GpxType where- version (GpxType x _ _ _ _ _ _) = x- setVersion a (GpxType _ b c d e f g) = gpxType a b c d e f g--instance Creator GpxType where- creator (GpxType _ x _ _ _ _ _) = x- setCreator b (GpxType a _ c d e f g) = gpxType a b c d e f g--instance Metadata GpxType where- metadata (GpxType _ _ x _ _ _ _) = x- setMetadata c (GpxType a b _ d e f g) = gpxType a b c d e f g--instance Wpts GpxType where- wpts (GpxType _ _ _ x _ _ _) = x- setWpts d (GpxType a b c _ e f g) = gpxType a b c d e f g--instance Rtes GpxType where- rtes (GpxType _ _ _ _ x _ _) = x- setRtes e (GpxType a b c d _ f g) = gpxType a b c d e f g--instance Trks GpxType where- trks (GpxType _ _ _ _ _ x _) = x- setTrks f (GpxType a b c d e _ g) = gpxType a b c d e f g--instance Extensions GpxType where- extensions (GpxType _ _ _ _ _ _ x) = x- setExtensions g (GpxType a b c d e f _) = gpxType a b c d e f g--instance Name GpxType where- name = (name =<<) . metadata- setName x (GpxType a b c d e f g) = gpxType a b (fmap (setName x) c) d e f g--instance Desc GpxType where- desc = (desc =<<) . metadata- setDesc x (GpxType a b c d e f g) = gpxType a b (fmap (setDesc x) c) d e f g--instance Author GpxType (Maybe PersonType) where- author = (author =<<) . metadata- setAuthor x (GpxType a b c d e f g) = gpxType a b (fmap (setAuthor x) c) d e f g--instance Copyright GpxType where- copyright = (copyright =<<) . metadata- setCopyright x (GpxType a b c d e f g) = gpxType a b (fmap (setCopyright x) c) d e f g--instance Links GpxType where- links = (links =<<) . maybeToList . metadata- setLinks x (GpxType a b c d e f g) = gpxType a b (fmap (setLinks x) c) d e f g--instance Time GpxType where- time = (time =<<) . metadata- setTime x (GpxType a b c d e f g) = gpxType a b (fmap (setTime x) c) d e f g--instance Keywords GpxType where- keywords = (keywords =<<) . metadata- setKeywords x (GpxType a b c d e f g) = gpxType a b (fmap (setKeywords x) c) d e f g--instance Bounds GpxType where- bounds = (bounds =<<) . metadata- setBounds x (GpxType a b c d e f g) = gpxType a b (fmap (setBounds x) c) d e f g--instance Rtepts GpxType where- rtepts = (rtepts =<<) . rtes- setRtepts x (GpxType a b c d e f g) = gpxType a b c d (fmap (setRtepts x) e) f g--instance Trkpts GpxType where- trkpts = (trkpts =<<) . trks- setTrkpts x (GpxType a b c d e f g) = gpxType a b c d e (fmap (setTrkpts x) f) g
− Data/Geo/GPX/LatitudeType.hs
@@ -1,28 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving #-}---- | Simple Type: @latitudeType@ <http://www.topografix.com/GPX/1/1/#type_latitudeType>-module Data.Geo.GPX.LatitudeType(- LatitudeType,- latitudeType- ) where--import Data.Geo.GPX.Accessor.Value-import Data.Fixed-import Text.XML.HXT.Core--newtype LatitudeType = LatitudeType Double- deriving (Eq, Ord, Enum, Num, Fractional, Floating, Real, RealFrac, RealFloat)--latitudeType :: Double -- ^ The value which will be between -90 and 90 (values out of the range are truncated using a modulus operation).- -> LatitudeType-latitudeType n = LatitudeType ((n + 90) `mod'` 180 - 90)--instance XmlPickler LatitudeType where- xpickle = xpWrap (latitudeType, \(LatitudeType n) -> n) xpPrim--instance Show LatitudeType where- show (LatitudeType n) = show n--instance Value LatitudeType Double where- value (LatitudeType x) = x- setValue x (LatitudeType _) = latitudeType x
− Data/Geo/GPX/LinkType.hs
@@ -1,22 +0,0 @@--- | Complex Type: @linkType@ <http://www.topografix.com/GPX/1/1/#type_linkType>-module Data.Geo.GPX.LinkType(- LinkType,- linkType- ) where--import Text.XML.HXT.Core--data LinkType = LinkType String (Maybe String) (Maybe String)- deriving (Eq, Show)--linkType :: String -- ^ The href.- -> Maybe String -- ^ The text.- -> Maybe String -- ^ The type.- -> LinkType-linkType = LinkType--instance XmlPickler LinkType where- xpickle = xpWrap (\(href, text, type') -> linkType href text type', \(LinkType href text type') -> (href, text, type')) (xpTriple- (xpAttr "href" xpText)- (xpOption (xpElem "text" xpText))- (xpOption (xpElem "type" xpText)))
− Data/Geo/GPX/LongitudeType.hs
@@ -1,28 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, GeneralizedNewtypeDeriving #-}---- | Simple Type: @latitudeType@ <http://www.topografix.com/GPX/1/1/#type_latitudeType>-module Data.Geo.GPX.LongitudeType(- LongitudeType,- longitudeType- ) where--import Data.Geo.GPX.Accessor.Value-import Data.Fixed-import Text.XML.HXT.Core--newtype LongitudeType = LongitudeType Double- deriving (Eq, Ord, Enum, Num, Fractional, Floating, Real, RealFrac, RealFloat)--longitudeType :: Double -- ^ The value which will be between -180 and 180 (values out of the range are truncated using a modulus operation).- -> LongitudeType-longitudeType n = LongitudeType ((n + 180) `mod'` 360 - 180)--instance XmlPickler LongitudeType where- xpickle = xpWrap (longitudeType, \(LongitudeType n) -> n) xpPrim--instance Show LongitudeType where- show (LongitudeType n) = show n--instance Value LongitudeType Double where- value (LongitudeType x) = x- setValue x (LongitudeType _) = longitudeType x
− Data/Geo/GPX/MetadataType.hs
@@ -1,88 +0,0 @@-{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}---- | Complex Type: @metadataType@ <http://www.topografix.com/GPX/1/1/#type_metadataType>-module Data.Geo.GPX.MetadataType(- MetadataType,- metadataType- ) where--import Data.Geo.GPX.PersonType-import Data.Geo.GPX.CopyrightType-import Data.Geo.GPX.LinkType-import Data.Geo.GPX.BoundsType-import Data.Geo.GPX.ExtensionsType-import Data.Geo.GPX.Accessor.Name-import Data.Geo.GPX.Accessor.Desc-import Data.Geo.GPX.Accessor.Author-import Data.Geo.GPX.Accessor.Copyright-import Data.Geo.GPX.Accessor.Links-import Data.Geo.GPX.Accessor.Time-import Data.Geo.GPX.Accessor.Keywords-import Data.Geo.GPX.Accessor.Bounds-import Data.Geo.GPX.Accessor.Extensions-import Text.XML.HXT.Core-import Text.XML.HXT.Extras-import Text.XML.XSD.DateTime--data MetadataType = MetadataType (Maybe String) (Maybe String) (Maybe PersonType) (Maybe CopyrightType) [LinkType] (Maybe DateTime) (Maybe String) (Maybe BoundsType) (Maybe ExtensionsType)- deriving (Eq, Show)--metadataType :: Maybe String -- ^ The name.- -> Maybe String -- ^ The desc.- -> Maybe PersonType -- ^ The author.- -> Maybe CopyrightType -- ^ The copyright.- -> [LinkType] -- ^ The links (link).- -> Maybe DateTime -- ^ The time.- -> Maybe String -- ^ The keywords.- -> Maybe BoundsType -- ^ The bounds.- -> Maybe ExtensionsType -- ^ The extensions- -> MetadataType-metadataType = MetadataType--instance XmlPickler MetadataType where- xpickle = xpWrap (\(a, b, c, d, e, f, g, h, i) -> metadataType a b c d e f g h i, \(MetadataType a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple- (xpOption (xpElem "name" xpText))- (xpOption (xpElem "desc" xpText))- (xpOption (xpElem "author" xpickle))- (xpOption (xpElem "copyright" xpickle))- (xpList (xpElem "link" xpickle))- (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText)))- (xpOption (xpElem "keywords" xpText))- (xpOption (xpElem "bounds" xpickle))- (xpOption (xpElem "extensions" xpickle)))--instance Name MetadataType where- name (MetadataType x _ _ _ _ _ _ _ _) = x- setName a (MetadataType _ b c d e f g h i) = metadataType a b c d e f g h i--instance Desc MetadataType where- desc (MetadataType _ x _ _ _ _ _ _ _) = x- setDesc b (MetadataType a _ c d e f g h i) = metadataType a b c d e f g h i--instance Author MetadataType (Maybe PersonType) where- author (MetadataType _ _ x _ _ _ _ _ _) = x- setAuthor c (MetadataType a b _ d e f g h i) = metadataType a b c d e f g h i--instance Copyright MetadataType where- copyright (MetadataType _ _ _ x _ _ _ _ _) = x- setCopyright d (MetadataType a b c _ e f g h i) = metadataType a b c d e f g h i--instance Links MetadataType where- links (MetadataType _ _ _ _ x _ _ _ _) = x- setLinks e (MetadataType a b c d _ f g h i) = metadataType a b c d e f g h i--instance Time MetadataType where- time (MetadataType _ _ _ _ _ x _ _ _) = x- setTime f (MetadataType a b c d e _ g h i) = metadataType a b c d e f g h i--instance Keywords MetadataType where- keywords (MetadataType _ _ _ _ _ _ x _ _) = x- setKeywords g (MetadataType a b c d e f _ h i) = metadataType a b c d e f g h i--instance Bounds MetadataType where- bounds (MetadataType _ _ _ _ _ _ _ x _) = x- setBounds h (MetadataType a b c d e f g _ i) = metadataType a b c d e f g h i--instance Extensions MetadataType where- extensions (MetadataType _ _ _ _ _ _ _ _ x) = x- setExtensions i (MetadataType a b c d e f g h _) = metadataType a b c d e f g h i
− Data/Geo/GPX/PersonType.hs
@@ -1,39 +0,0 @@--- | Complex Type: @personType@ <http://www.topografix.com/GPX/1/1/#type_personType>-module Data.Geo.GPX.PersonType(- PersonType,- personType- ) where--import Data.Geo.GPX.EmailType-import Data.Geo.GPX.LinkType-import Data.Geo.GPX.Accessor.Name-import Data.Geo.GPX.Accessor.Email-import Data.Geo.GPX.Accessor.Link-import Text.XML.HXT.Core--data PersonType = PersonType (Maybe String) (Maybe EmailType) (Maybe LinkType)- deriving (Eq, Show)--personType :: Maybe String -- ^ The name.- -> Maybe EmailType -- ^ The email.- -> Maybe LinkType -- ^ The link.- -> PersonType-personType = PersonType--instance XmlPickler PersonType where- xpickle = xpWrap (\(name', email', link') -> personType name' email' link', \(PersonType name' email' link') -> (name', email', link')) (xpTriple- (xpOption (xpElem "name" xpText))- (xpOption (xpElem "email" xpickle))- (xpOption (xpElem "link" xpickle)))--instance Name PersonType where- name (PersonType x _ _) = x- setName a (PersonType _ b c) = personType a b c--instance Email PersonType where- email (PersonType _ x _) = x- setEmail b (PersonType a _ c) = personType a b c--instance Link PersonType where- link (PersonType _ _ x) = x- setLink c (PersonType a b _) = personType a b c
− Data/Geo/GPX/PtType.hs
@@ -1,48 +0,0 @@--- | Complex Type: @ptType@ <http://www.topografix.com/GPX/1/1/#type_ptType>-module Data.Geo.GPX.PtType(- PtType,- ptType- ) where--import Data.Geo.GPX.LatitudeType-import Data.Geo.GPX.LongitudeType-import Data.Geo.GPX.Accessor.Lat-import Data.Geo.GPX.Accessor.Lon-import Data.Geo.GPX.Accessor.Ele-import Data.Geo.GPX.Accessor.Time-import Text.XML.HXT.Core-import Text.XML.XSD.DateTime--data PtType = PtType LatitudeType LongitudeType (Maybe Double) (Maybe DateTime)- deriving (Eq, Show)--ptType :: LatitudeType -- ^ The lat.- -> LongitudeType -- ^ The lon.- -> Maybe Double -- ^ The ele.- -> Maybe DateTime -- ^ The time.- -> PtType-ptType = PtType--instance XmlPickler PtType where- xpickle = xpWrap (\(lat', lon', ele', time') -> ptType lat' lon' ele' time',- \(PtType lat' lon' ele' time') -> (lat', lon', ele', time')) (xp4Tuple- (xpAttr "lat" xpickle)- (xpAttr "lon" xpickle)- (xpOption (xpElem "ele" xpPrim))- (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText))))--instance Lat PtType where- lat (PtType x _ _ _) = x- setLat a (PtType _ b c d) = ptType a b c d--instance Lon PtType where- lon (PtType _ x _ _) = x- setLon b (PtType a _ c d) = ptType a b c d--instance Ele PtType where- ele (PtType _ _ x _) = x- setEle c (PtType a b _ d) = ptType a b c d--instance Time PtType where- time (PtType _ _ _ x) = x- setTime d (PtType a b c _) = ptType a b c d
− Data/Geo/GPX/PtsegType.hs
@@ -1,23 +0,0 @@--- | Complex Type: @ptsegType@ <http://www.topografix.com/GPX/1/1/#type_ptsegType>-module Data.Geo.GPX.PtsegType(- PtsegType,- ptsegType- ) where--import Data.Geo.GPX.PtType-import Data.Geo.GPX.Accessor.Pts-import Text.XML.HXT.Core--newtype PtsegType = PtsegType [PtType]- deriving (Eq, Show)--ptsegType :: [PtType] -- ^ The points (pt).- -> PtsegType-ptsegType = PtsegType--instance XmlPickler PtsegType where- xpickle = xpWrap (ptsegType, \(PtsegType k) -> k) (xpList (xpElem "pt" xpickle))--instance Pts PtsegType where- pts (PtsegType x) = x- setPts x (PtsegType _) = ptsegType x
− Data/Geo/GPX/RteType.hs
@@ -1,83 +0,0 @@--- | Complex Type: @rteType@ <http://www.topografix.com/GPX/1/1/#type_rteType>-module Data.Geo.GPX.RteType(- RteType,- rteType- ) where--import Data.Geo.GPX.WptType-import Data.Geo.GPX.ExtensionsType-import Data.Geo.GPX.LinkType-import Data.Geo.GPX.Accessor.Name-import Data.Geo.GPX.Accessor.Cmt-import Data.Geo.GPX.Accessor.Desc-import Data.Geo.GPX.Accessor.Src-import Data.Geo.GPX.Accessor.Links-import Data.Geo.GPX.Accessor.Number-import Data.Geo.GPX.Accessor.Type-import Data.Geo.GPX.Accessor.Extensions-import Data.Geo.GPX.Accessor.Rtepts-import Text.XML.HXT.Core-import Text.XML.HXT.Extras--data RteType = RteType (Maybe String) (Maybe String) (Maybe String) (Maybe String) [LinkType] (Maybe Int) (Maybe String) (Maybe ExtensionsType) [WptType]- deriving (Eq, Show)--rteType :: Maybe String -- ^ The name.- -> Maybe String -- ^ The cmt.- -> Maybe String -- ^ The desc.- -> Maybe String -- ^ The src.- -> [LinkType] -- ^ The links (link).- -> Maybe Int -- ^ The number.- -> Maybe String -- ^ The type.- -> Maybe ExtensionsType -- ^ The extensions.- -> [WptType] -- ^ The route points (rtept).- -> RteType-rteType a b c d e f = RteType a b c d e (fmap abs f)--instance XmlPickler RteType where- xpickle = xpWrap (\(a, b, c, d, e, f, g, h, i) -> rteType a b c d e f g h i, \(RteType a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple- (xpOption (xpElem "name" xpText))- (xpOption (xpElem "cmt" xpText))- (xpOption (xpElem "desc" xpText))- (xpOption (xpElem "src" xpText))- (xpList (xpElem "link" xpickle))- (xpOption (xpElem "number" xpPrim))- (xpOption (xpElem "type" xpText))- (xpOption (xpElem "extensions" xpickle))- (xpList (xpElem "rtept" xpickle)))--instance Name RteType where- name (RteType x _ _ _ _ _ _ _ _) = x- setName a (RteType _ b c d e f g h i) = rteType a b c d e f g h i--instance Cmt RteType where- cmt (RteType _ x _ _ _ _ _ _ _) = x- setCmt b (RteType a _ c d e f g h i) = rteType a b c d e f g h i--instance Desc RteType where- desc (RteType _ _ x _ _ _ _ _ _) = x- setDesc c (RteType a b _ d e f g h i) = rteType a b c d e f g h i--instance Src RteType where- src (RteType _ _ _ x _ _ _ _ _) = x- setSrc d (RteType a b c _ e f g h i) = rteType a b c d e f g h i--instance Links RteType where- links (RteType _ _ _ _ x _ _ _ _) = x- setLinks e (RteType a b c d _ f g h i) = rteType a b c d e f g h i--instance Number RteType where- number (RteType _ _ _ _ _ x _ _ _) = x- setNumber f (RteType a b c d e _ g h i) = rteType a b c d e f g h i--instance Type RteType where- type' (RteType _ _ _ _ _ _ x _ _) = x- setType g (RteType a b c d e f _ h i) = rteType a b c d e f g h i--instance Extensions RteType where- extensions (RteType _ _ _ _ _ _ _ x _) = x- setExtensions h (RteType a b c d e f g _ i) = rteType a b c d e f g h i--instance Rtepts RteType where- rtepts (RteType _ _ _ _ _ _ _ _ x) = x- setRtepts i (RteType a b c d e f g h _) = rteType a b c d e f g h i
− Data/Geo/GPX/TrkType.hs
@@ -1,89 +0,0 @@--- | Complex Type: @trkType@ <http://www.topografix.com/GPX/1/1/#type_trkType>-module Data.Geo.GPX.TrkType(- TrkType,- trkType- ) where--import Data.Geo.GPX.TrksegType-import Data.Geo.GPX.ExtensionsType-import Data.Geo.GPX.LinkType-import Data.Geo.GPX.Accessor.Name-import Data.Geo.GPX.Accessor.Cmt-import Data.Geo.GPX.Accessor.Desc-import Data.Geo.GPX.Accessor.Src-import Data.Geo.GPX.Accessor.Links-import Data.Geo.GPX.Accessor.Number-import Data.Geo.GPX.Accessor.Type-import Data.Geo.GPX.Accessor.Extensions-import Data.Geo.GPX.Accessor.Trksegs-import Data.Geo.GPX.Accessor.Trkpts-import Text.XML.HXT.Core-import Text.XML.HXT.Extras--data TrkType = TrkType (Maybe String) (Maybe String) (Maybe String) (Maybe String) [LinkType] (Maybe Int) (Maybe String) (Maybe ExtensionsType) [TrksegType]- deriving (Eq, Show)--trkType :: Maybe String -- ^ The name.- -> Maybe String -- ^ The cmt.- -> Maybe String -- ^ The desc.- -> Maybe String -- ^ The src.- -> [LinkType] -- ^ The links (link).- -> Maybe Int -- ^ The number.- -> Maybe String -- ^ The type.- -> Maybe ExtensionsType -- ^ The extensions.- -> [TrksegType] -- ^ The track segments (trkseg).- -> TrkType-trkType a b c d e f = TrkType a b c d e (fmap abs f)--instance XmlPickler TrkType where- xpickle = xpWrap (\(a, b, c, d, e, f, g, h, i) -> trkType a b c d e f g h i, \(TrkType a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple- (xpOption (xpElem "name" xpText))- (xpOption (xpElem "cmt" xpText))- (xpOption (xpElem "desc" xpText))- (xpOption (xpElem "src" xpText))- (xpList (xpElem "link" xpickle))- (xpOption (xpElem "number" xpPrim))- (xpOption (xpElem "type" xpText))- (xpOption (xpElem "extensions" xpickle))- (xpList (xpElem "trkseg" xpickle)))--instance Name TrkType where- name (TrkType x _ _ _ _ _ _ _ _) = x- setName a (TrkType _ b c d e f g h i) = trkType a b c d e f g h i--instance Cmt TrkType where- cmt (TrkType _ x _ _ _ _ _ _ _) = x- setCmt b (TrkType a _ c d e f g h i) = trkType a b c d e f g h i--instance Desc TrkType where- desc (TrkType _ _ x _ _ _ _ _ _) = x- setDesc c (TrkType a b _ d e f g h i) = trkType a b c d e f g h i--instance Src TrkType where- src (TrkType _ _ _ x _ _ _ _ _) = x- setSrc d (TrkType a b c _ e f g h i) = trkType a b c d e f g h i--instance Links TrkType where- links (TrkType _ _ _ _ x _ _ _ _) = x- setLinks e (TrkType a b c d _ f g h i) = trkType a b c d e f g h i--instance Number TrkType where- number (TrkType _ _ _ _ _ x _ _ _) = x- setNumber f (TrkType a b c d e _ g h i) = trkType a b c d e f g h i--instance Type TrkType where- type' (TrkType _ _ _ _ _ _ x _ _) = x- setType g (TrkType a b c d e f _ h i) = trkType a b c d e f g h i--instance Extensions TrkType where- extensions (TrkType _ _ _ _ _ _ _ x _) = x- setExtensions h (TrkType a b c d e f g _ i) = trkType a b c d e f g h i--instance Trksegs TrkType where- trksegs (TrkType _ _ _ _ _ _ _ _ x) = x- setTrksegs i (TrkType a b c d e f g h _) = trkType a b c d e f g h i--instance Trkpts TrkType where- trkpts = (trkpts =<<) . trksegs- setTrkpts x (TrkType a b c d e f g h i) = trkType a b c d e f g h (fmap (setTrkpts x) i)-
− Data/Geo/GPX/TrksegType.hs
@@ -1,32 +0,0 @@--- | Complex Type: @trksegType@ <http://www.topografix.com/GPX/1/1/#type_trksegType>-module Data.Geo.GPX.TrksegType(- TrksegType,- trksegType- ) where--import Data.Geo.GPX.WptType-import Data.Geo.GPX.ExtensionsType-import Data.Geo.GPX.Accessor.Trkpts-import Data.Geo.GPX.Accessor.Extensions-import Text.XML.HXT.Core--data TrksegType = TrksegType [WptType] (Maybe ExtensionsType)- deriving (Eq, Show)--trksegType :: [WptType] -- ^ The track points (trkpt).- -> Maybe ExtensionsType -- ^ The extensions.- -> TrksegType-trksegType = TrksegType--instance XmlPickler TrksegType where- xpickle = xpWrap (uncurry trksegType, \(TrksegType trkpt' extensions') -> (trkpt', extensions')) (xpPair- (xpList (xpElem "trkpt" xpickle))- (xpOption (xpElem "extensions" xpickle)))--instance Trkpts TrksegType where- trkpts (TrksegType x _) = x- setTrkpts a (TrksegType _ b) = trksegType a b--instance Extensions TrksegType where- extensions (TrksegType _ x) = x- setExtensions b (TrksegType a _) = trksegType a b
− Data/Geo/GPX/Util/Remove.hs
@@ -1,44 +0,0 @@--- | Utility functions for removing elements of GPX files.-module Data.Geo.GPX.Util.Remove(- removeWpts,- removeTrks,- removeRtes,- removeMetadata,- removeExtensions- ) where--import Data.Geo.GPX.Accessor.Wpts-import Data.Geo.GPX.Accessor.Rtes-import Data.Geo.GPX.Accessor.Trks-import Data.Geo.GPX.Accessor.Metadata-import Data.Geo.GPX.Accessor.Extensions---- | Removes all waypoints (wpt) elements from the given value.-removeWpts :: (Wpts a) =>- a- -> a-removeWpts = usingWpts (const [])---- | Removes all tracks (trk) elements from the given value.-removeTrks :: (Trks a) =>- a- -> a-removeTrks = usingTrks (const [])---- | Removes all routes (rte) elements from the given value.-removeRtes :: (Rtes a) =>- a- -> a-removeRtes = usingRtes (const [])---- | Removes the metadata element from the given value.-removeMetadata :: (Metadata a) =>- a- -> a-removeMetadata = usingMetadata (const Nothing)---- | Removes the extensions element from the given value.-removeExtensions :: (Extensions a) =>- a- -> a-removeExtensions = usingExtensions (const Nothing)
− Data/Geo/GPX/Util/Reverse.hs
@@ -1,47 +0,0 @@--- | Reversing element lists of a GPX files.-module Data.Geo.GPX.Util.Reverse(- reverseRtes,- reverseTrks,- reverseTrksegs,- reverseWpts,- reverseConservingTime- ) where--import Data.Geo.GPX.Accessor.Trks-import Data.Geo.GPX.Accessor.Trkpts-import Data.Geo.GPX.Accessor.Trksegs-import Data.Geo.GPX.Accessor.Wpts-import Data.Geo.GPX.Accessor.Rtes-import Data.Geo.GPX.Accessor.Rtepts-import Data.Geo.GPX.Accessor.Time-import Control.Applicative---- | Reverses a list of routes (rte).-reverseRtes :: (Rtes a) =>- a- -> a-reverseRtes = usingRtes (map (usingRtepts reverse) . reverse)---- | Reverses a list of tracks (trk).-reverseTrks :: (Trks a) =>- a- -> a-reverseTrks = usingTrks (map reverseTrksegs . reverse)---- | Reverses a list of track segments (trkseg).-reverseTrksegs :: (Trksegs a) =>- a- -> a-reverseTrksegs = usingTrksegs (map (usingTrkpts reverse) . reverse)---- | Reverses a list of waypoints (wpt).-reverseWpts :: (Wpts a) =>- a- -> a-reverseWpts = usingWpts reverse---- | Reverses a list of elements with a time, however, the time is not reversed.-reverseConservingTime :: (Time a) =>- [a]- -> [a]-reverseConservingTime = zipWith setTime . map time <*> reverse
− Data/Geo/GPX/WptType.hs
@@ -1,226 +0,0 @@--- | Complex Type: @wptType@ <http://www.topografix.com/GPX/1/1/#type_wptType>-module Data.Geo.GPX.WptType(- WptType,- wptType,- wptType'- ) where--import Data.Geo.GPX.LatitudeType-import Data.Geo.GPX.LongitudeType-import Data.Geo.GPX.DegreesType-import Data.Geo.GPX.LinkType-import Data.Geo.GPX.FixType-import Data.Geo.GPX.DgpsStationType-import Data.Geo.GPX.ExtensionsType-import Data.Geo.GPX.Accessor.Lat-import Data.Geo.GPX.Accessor.Lon-import Data.Geo.GPX.Accessor.Ele-import Data.Geo.GPX.Accessor.Time-import Data.Geo.GPX.Accessor.Magvar-import Data.Geo.GPX.Accessor.Geoidheight-import Data.Geo.GPX.Accessor.Name-import Data.Geo.GPX.Accessor.Cmt-import Data.Geo.GPX.Accessor.Desc-import Data.Geo.GPX.Accessor.Src-import Data.Geo.GPX.Accessor.Links-import Data.Geo.GPX.Accessor.Sym-import Data.Geo.GPX.Accessor.Type-import Data.Geo.GPX.Accessor.Fix-import Data.Geo.GPX.Accessor.Sat-import Data.Geo.GPX.Accessor.Hdop-import Data.Geo.GPX.Accessor.Vdop-import Data.Geo.GPX.Accessor.Pdop-import Data.Geo.GPX.Accessor.Ageofdgpsdata-import Data.Geo.GPX.Accessor.Dgpsid-import Data.Geo.GPX.Accessor.Extensions-import Data.Geo.GPX.Accessor.Latlon-import Data.Geo.GPX.Accessor.Value-import Text.XML.HXT.Core-import Text.XML.HXT.Extras-import Text.XML.XSD.DateTime--data WptType = WptType LatitudeType- LongitudeType- (Maybe Double)- (Maybe DateTime)- (Maybe DegreesType)- (Maybe Double)- (Maybe String)- (Maybe String)- (Maybe String)- (Maybe String)- [LinkType]- (Maybe String)- (Maybe String)- (Maybe FixType)- (Maybe Int)- (Maybe Double)- (Maybe Double)- (Maybe Double)- (Maybe Double)- (Maybe DgpsStationType)- (Maybe ExtensionsType)- deriving (Eq, Show)--wptType :: LatitudeType -- ^ The lat.- -> LongitudeType -- ^ The lon.- -> Maybe Double -- ^ The ele.- -> Maybe DateTime -- ^ The time.- -> Maybe DegreesType -- ^ The magvar.- -> Maybe Double -- ^ The geoidheight.- -> Maybe String -- ^ The name.- -> Maybe String -- ^ The cmt.- -> Maybe String -- ^ The desc.- -> Maybe String -- ^ The src.- -> [LinkType] -- ^ The links (link).- -> Maybe String -- ^ The sym.- -> Maybe String -- ^ The type.- -> Maybe FixType -- ^ The fix.- -> Maybe Int -- ^ The sat.- -> Maybe Double -- ^ The hdop.- -> Maybe Double -- ^ The vdop.- -> Maybe Double -- ^ The pdop.- -> Maybe Double -- ^ The ageofdgpsdata.- -> Maybe DgpsStationType -- ^ The dgpsid.- -> Maybe ExtensionsType -- ^ The extensions.- -> WptType-wptType a b c d e f g h i j k l m n o p = WptType a b c d e f g h i j k l m n o (fmap abs p)---- | A waypoint with only a latitude and longitude.-wptType' :: LatitudeType -- ^ The lat.- -> LongitudeType -- ^ The lon.- -> WptType-wptType' lat' lon' = wptType lat'- lon'- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- []- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing- Nothing--instance XmlPickler WptType where- xpickle = xpWrap (\(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) -> wptType a b c d e f g h i j k l m n o p q r s t u,- \(WptType a b c d e f g h i j k l m n o p q r s t u) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)) (xp21Tuple- (xpAttr "lat" xpickle)- (xpAttr "lon" xpickle)- (xpOption (xpElem "ele" xpPrim))- (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText)))- (xpOption (xpElem "magvar" xpickle))- (xpOption (xpElem "geoidheight" xpPrim))- (xpOption (xpElem "name" xpText))- (xpOption (xpElem "cmt" xpText))- (xpOption (xpElem "desc" xpText))- (xpOption (xpElem "src" xpText))- (xpList (xpElem "link" xpickle))- (xpOption (xpElem "sym" xpText))- (xpOption (xpElem "type" xpText))- (xpOption (xpElem "fix" xpickle))- (xpOption (xpElem "sat" xpPrim))- (xpOption (xpElem "hdop" xpPrim))- (xpOption (xpElem "vdop" xpPrim))- (xpOption (xpElem "pdop" xpPrim))- (xpOption (xpElem "ageofdgpsdata" xpPrim))- (xpOption (xpElem "dgpsid" xpickle))- (xpOption (xpElem "extensions" xpickle)))--instance Lat WptType where- lat (WptType x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x- setLat a (WptType _ b c d e f g h i j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Lon WptType where- lon (WptType _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x- setLon b (WptType a _ c d e f g h i j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Ele WptType where- ele (WptType _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x- setEle c (WptType a b _ d e f g h i j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Time WptType where- time (WptType _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x- setTime d (WptType a b c _ e f g h i j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Magvar WptType where- magvar (WptType _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x- setMagvar e (WptType a b c d _ f g h i j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Geoidheight WptType where- geoidheight (WptType _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x- setGeoidheight f (WptType a b c d e _ g h i j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Name WptType where- name (WptType _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _ _) = x- setName g (WptType a b c d e f _ h i j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Cmt WptType where- cmt (WptType _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _ _) = x- setCmt h (WptType a b c d e f g _ i j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Desc WptType where- desc (WptType _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _ _) = x- setDesc i (WptType a b c d e f g h _ j k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Src WptType where- src (WptType _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _ _) = x- setSrc j (WptType a b c d e f g h i _ k l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Links WptType where- links (WptType _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _ _) = x- setLinks k (WptType a b c d e f g h i j _ l m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Sym WptType where- sym (WptType _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _) = x- setSym l (WptType a b c d e f g h i j k _ m n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Type WptType where- type' (WptType _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _ _ _) = x- setType m (WptType a b c d e f g h i j k l _ n o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Fix WptType where- fix (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _ _) = x- setFix n (WptType a b c d e f g h i j k l m _ o p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Sat WptType where- sat (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _ _) = x- setSat o (WptType a b c d e f g h i j k l m n _ p q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Hdop WptType where- hdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _ _) = x- setHdop p (WptType a b c d e f g h i j k l m n o _ q r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Vdop WptType where- vdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _ _) = x- setVdop q (WptType a b c d e f g h i j k l m n o p _ r s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Pdop WptType where- pdop (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _ _) = x- setPdop r (WptType a b c d e f g h i j k l m n o p q _ s t u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Ageofdgpsdata WptType where- ageofdgpsdata (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _ _) = x- setAgeofdgpsdata s (WptType a b c d e f g h i j k l m n o p q r _ t u) = wptType a b c d e f g h i j k l m n o p q r s t u----instance Dgpsid WptType where- dgpsid (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x _) = x- setDgpsid t (WptType a b c d e f g h i j k l m n o p q r s _ u) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Extensions WptType where- extensions (WptType _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ x) = x- setExtensions u (WptType a b c d e f g h i j k l m n o p q r s t _) = wptType a b c d e f g h i j k l m n o p q r s t u--instance Latlon WptType where- latlon e = (value (lat e), value (lon e))- setLatlon (a, b) (WptType _ _ c d e f g h i j k l m n o p q r s t u) = wptType (latitudeType a) (longitudeType b) c d e f g h i j k l m n o p q r s t u
GPX.cabal view
@@ -1,98 +1,107 @@ Name: GPX-Version: 0.5+Version: 0.8.0 License: BSD3 License-File: LICENSE Synopsis: Parse GPX files Description: Parse GPS Exchange (GPX) files using HXT into data structures.-Homepage: http://code.google.com/p/geo-gpx/+Homepage: https://github.com/tonymorris/geo-gpx Category: Utils-Author: Tony Morris-Maintainer: code@tmorris.net-Copyright: 2009, 2010 Tony Morris-build-type: Simple-cabal-version: >= 1.2+Author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>, Thomas DuBuisson+Maintainer: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>, Thomas DuBuisson+Copyright: 2009 -- 2012 Tony Morris, Thomas DuBuisson+Build-Type: Simple+Cabal-Version: >= 1.6+Source-Repository head+ Type: git+ Location: git@github.com:tonymorris/geo-gpx.git -Flag small_base- Description: Choose the new, split-up base package. +Flag small_base+ Description: Choose the new, split-up base package.+ Library- if flag(small_base)- Build-Depends: base < 5 && >= 3, hxt >= 9.1, hxt-extras >= 0.4.1, containers, xsd- else- Build-Depends: base < 5 && >= 3, hxt, hxt-extras, containers, xsd+ Build-Depends: base < 5 && >= 3+ , hxt >= 9+ , containers+ , comonad-transformers+ , comonad >= 4.0+ , data-lens+ , xsd >= 0.3 && < 0.4+ , newtype - GHC-Options: -Wall- Exposed-Modules: Data.Geo.GPX- Data.Geo.GPX.DgpsStationType- Data.Geo.GPX.FixType- Data.Geo.GPX.DegreesType- Data.Geo.GPX.LongitudeType- Data.Geo.GPX.LatitudeType- Data.Geo.GPX.BoundsType- Data.Geo.GPX.ExtensionsType- Data.Geo.GPX.PtType- Data.Geo.GPX.PtsegType- Data.Geo.GPX.EmailType- Data.Geo.GPX.LinkType- Data.Geo.GPX.PersonType- Data.Geo.GPX.CopyrightType- Data.Geo.GPX.WptType- Data.Geo.GPX.TrksegType- Data.Geo.GPX.TrkType- Data.Geo.GPX.RteType- Data.Geo.GPX.MetadataType- Data.Geo.GPX.GpxType- Data.Geo.GPX.Gpx- Data.Geo.GPX.Accessor.Accessor- Data.Geo.GPX.Accessor.Minlat- Data.Geo.GPX.Accessor.Maxlat- Data.Geo.GPX.Accessor.Minlon- Data.Geo.GPX.Accessor.Maxlon- Data.Geo.GPX.Accessor.Author- Data.Geo.GPX.Accessor.Year- Data.Geo.GPX.Accessor.License- Data.Geo.GPX.Accessor.Value- Data.Geo.GPX.Accessor.Id- Data.Geo.GPX.Accessor.Domain- Data.Geo.GPX.Accessor.Version- Data.Geo.GPX.Accessor.Creator- Data.Geo.GPX.Accessor.Metadata- Data.Geo.GPX.Accessor.Wpts- Data.Geo.GPX.Accessor.Rtes- Data.Geo.GPX.Accessor.Trks- Data.Geo.GPX.Accessor.Extensions- Data.Geo.GPX.Accessor.Href- Data.Geo.GPX.Accessor.Text- Data.Geo.GPX.Accessor.Type- Data.Geo.GPX.Accessor.Name- Data.Geo.GPX.Accessor.Desc- Data.Geo.GPX.Accessor.Copyright- Data.Geo.GPX.Accessor.Links- Data.Geo.GPX.Accessor.Time- Data.Geo.GPX.Accessor.Keywords- Data.Geo.GPX.Accessor.Bounds- Data.Geo.GPX.Accessor.Lat- Data.Geo.GPX.Accessor.Lon- Data.Geo.GPX.Accessor.Ele- Data.Geo.GPX.Accessor.Magvar- Data.Geo.GPX.Accessor.Geoidheight- Data.Geo.GPX.Accessor.Cmt- Data.Geo.GPX.Accessor.Src- Data.Geo.GPX.Accessor.Sym- Data.Geo.GPX.Accessor.Fix- Data.Geo.GPX.Accessor.Sat- Data.Geo.GPX.Accessor.Hdop- Data.Geo.GPX.Accessor.Vdop- Data.Geo.GPX.Accessor.Pdop- Data.Geo.GPX.Accessor.Ageofdgpsdata- Data.Geo.GPX.Accessor.Dgpsid- Data.Geo.GPX.Accessor.Email- Data.Geo.GPX.Accessor.Link- Data.Geo.GPX.Accessor.Pts- Data.Geo.GPX.Accessor.Number- Data.Geo.GPX.Accessor.Rtepts- Data.Geo.GPX.Accessor.Trkpts- Data.Geo.GPX.Accessor.Trksegs- Data.Geo.GPX.Accessor.Latlon- Data.Geo.GPX.Util.Remove- Data.Geo.GPX.Util.Reverse+ GHC-Options: -Wall+ -fno-warn-name-shadowing++ Hs-Source-Dirs: src++ Exposed-Modules: Data.Geo.GPX+ Data.Geo.GPX.Type+ Data.Geo.GPX.Type.DgpsStation+ Data.Geo.GPX.Type.Fix+ Data.Geo.GPX.Type.Degrees+ Data.Geo.GPX.Type.Longitude+ Data.Geo.GPX.Type.Latitude+ Data.Geo.GPX.Type.Bounds+ Data.Geo.GPX.Type.Extensions+ Data.Geo.GPX.Type.Pt+ Data.Geo.GPX.Type.Ptseg+ Data.Geo.GPX.Type.Email+ Data.Geo.GPX.Type.Link+ Data.Geo.GPX.Type.Person+ Data.Geo.GPX.Type.Copyright+ Data.Geo.GPX.Type.Wpt+ Data.Geo.GPX.Type.Trkseg+ Data.Geo.GPX.Type.Trk+ Data.Geo.GPX.Type.Rte+ Data.Geo.GPX.Type.Metadata+ Data.Geo.GPX.Type.Gpx+ Data.Geo.GPX.Lens+ Data.Geo.GPX.Lens.MinlatL+ Data.Geo.GPX.Lens.MaxlatL+ Data.Geo.GPX.Lens.MinlonL+ Data.Geo.GPX.Lens.MaxlonL+ Data.Geo.GPX.Lens.AuthorL+ Data.Geo.GPX.Lens.YearL+ Data.Geo.GPX.Lens.LicenseL+ Data.Geo.GPX.Lens.IdL+ Data.Geo.GPX.Lens.DomainL+ Data.Geo.GPX.Lens.VersionL+ Data.Geo.GPX.Lens.CreatorL+ Data.Geo.GPX.Lens.MetadataL+ Data.Geo.GPX.Lens.WptsL+ Data.Geo.GPX.Lens.RtesL+ Data.Geo.GPX.Lens.TrksL+ Data.Geo.GPX.Lens.ExtensionsL+ Data.Geo.GPX.Lens.HrefL+ Data.Geo.GPX.Lens.TextL+ Data.Geo.GPX.Lens.TypeL+ Data.Geo.GPX.Lens.NameL+ Data.Geo.GPX.Lens.DescL+ Data.Geo.GPX.Lens.CopyrightL+ Data.Geo.GPX.Lens.LinksL+ Data.Geo.GPX.Lens.TimeL+ Data.Geo.GPX.Lens.KeywordsL+ Data.Geo.GPX.Lens.BoundsL+ Data.Geo.GPX.Lens.LatL+ Data.Geo.GPX.Lens.LonL+ Data.Geo.GPX.Lens.EleL+ Data.Geo.GPX.Lens.MagvarL+ Data.Geo.GPX.Lens.GeoidheightL+ Data.Geo.GPX.Lens.CmtL+ Data.Geo.GPX.Lens.SrcL+ Data.Geo.GPX.Lens.SymL+ Data.Geo.GPX.Lens.FixL+ Data.Geo.GPX.Lens.SatL+ Data.Geo.GPX.Lens.HdopL+ Data.Geo.GPX.Lens.VdopL+ Data.Geo.GPX.Lens.PdopL+ Data.Geo.GPX.Lens.AgeofdgpsdataL+ Data.Geo.GPX.Lens.DgpsidL+ Data.Geo.GPX.Lens.EmailL+ Data.Geo.GPX.Lens.LinkL+ Data.Geo.GPX.Lens.PtsL+ Data.Geo.GPX.Lens.NumberL+ Data.Geo.GPX.Lens.RteptsL+ Data.Geo.GPX.Lens.TrkptsL+ Data.Geo.GPX.Lens.TrksegsL+
LICENSE view
@@ -1,4 +1,4 @@-Copyright 2009 Tony Morris+Copyright 2009-2013 Tony Morris All rights reserved.
+ Setup.hs view
@@ -0,0 +1,3 @@+import Distribution.Simple+main = defaultMain+
− Setup.lhs
@@ -1,3 +0,0 @@-#!/usr/bin/env runhaskell-> import Distribution.Simple-> main = defaultMain
+ src/Data/Geo/GPX.hs view
@@ -0,0 +1,69 @@+{-# LANGUAGE MultiParamTypeClasses #-}++-- | GPX 1.1 Schema <http://www.topografix.com/GPX/1/1/>+module Data.Geo.GPX(+ module Data.Geo.GPX.Type+, module Data.Geo.GPX.Lens+, module Control.Arrow+, GPX+) where++import Data.Geo.GPX.Type+import Data.Geo.GPX.Lens+import Control.Arrow+import Text.XML.HXT.Arrow.Pickle+import Control.Newtype+import Data.Lens.Common+import Control.Comonad.Trans.Store++-- | Top-level GPX data type with the root XML element applied.+newtype GPX = GPX Gpx+ deriving Eq++instance XmlPickler GPX where+ xpickle = xpWrap (GPX, \(GPX g) -> g) (xpElem "gpx" xpickle)++instance GpxP GPX where+ gpx v c m w r t e =+ GPX (gpx v c m w r t e)+ +instance Newtype GPX Gpx where+ pack = + GPX+ unpack (GPX x) =+ x++instance VersionL GPX where+ versionL =+ newtypeLens >>> versionL++instance CreatorL GPX where+ creatorL =+ newtypeLens >>> creatorL++instance MetadataL GPX where+ metadataL =+ newtypeLens >>> metadataL++instance WptsL GPX where+ wptsL =+ newtypeLens >>> wptsL++instance RtesL GPX where+ rtesL =+ newtypeLens >>> rtesL++instance TrksL GPX where+ trksL =+ newtypeLens >>> trksL++instance ExtensionsL GPX where+ extensionsL =+ newtypeLens >>> extensionsL++-- not exported (belongs in data-lens)+newtypeLens ::+ Lens GPX Gpx+newtypeLens =+ Lens (store pack . unpack)+
+ src/Data/Geo/GPX/Lens.hs view
@@ -0,0 +1,101 @@+module Data.Geo.GPX.Lens(+ module Data.Geo.GPX.Lens.AgeofdgpsdataL+, module Data.Geo.GPX.Lens.AuthorL+, module Data.Geo.GPX.Lens.BoundsL+, module Data.Geo.GPX.Lens.CmtL+, module Data.Geo.GPX.Lens.CopyrightL+, module Data.Geo.GPX.Lens.CreatorL+, module Data.Geo.GPX.Lens.DescL+, module Data.Geo.GPX.Lens.DgpsidL+, module Data.Geo.GPX.Lens.DomainL+, module Data.Geo.GPX.Lens.EleL+, module Data.Geo.GPX.Lens.EmailL+, module Data.Geo.GPX.Lens.ExtensionsL+, module Data.Geo.GPX.Lens.FixL+, module Data.Geo.GPX.Lens.GeoidheightL+, module Data.Geo.GPX.Lens.HdopL+, module Data.Geo.GPX.Lens.HrefL+, module Data.Geo.GPX.Lens.IdL+, module Data.Geo.GPX.Lens.KeywordsL+, module Data.Geo.GPX.Lens.LatL+, module Data.Geo.GPX.Lens.LicenseL+, module Data.Geo.GPX.Lens.LinkL+, module Data.Geo.GPX.Lens.LinksL+, module Data.Geo.GPX.Lens.LonL+, module Data.Geo.GPX.Lens.MagvarL+, module Data.Geo.GPX.Lens.MaxlatL+, module Data.Geo.GPX.Lens.MaxlonL+, module Data.Geo.GPX.Lens.MetadataL+, module Data.Geo.GPX.Lens.MinlatL+, module Data.Geo.GPX.Lens.MinlonL+, module Data.Geo.GPX.Lens.NameL+, module Data.Geo.GPX.Lens.NumberL+, module Data.Geo.GPX.Lens.PdopL+, module Data.Geo.GPX.Lens.PtsL+, module Data.Geo.GPX.Lens.RteptsL+, module Data.Geo.GPX.Lens.RtesL+, module Data.Geo.GPX.Lens.SatL+, module Data.Geo.GPX.Lens.SrcL+, module Data.Geo.GPX.Lens.SymL+, module Data.Geo.GPX.Lens.TextL+, module Data.Geo.GPX.Lens.TimeL+, module Data.Geo.GPX.Lens.TrkptsL+, module Data.Geo.GPX.Lens.TrksegsL+, module Data.Geo.GPX.Lens.TrksL+, module Data.Geo.GPX.Lens.TypeL+, module Data.Geo.GPX.Lens.VdopL+, module Data.Geo.GPX.Lens.VersionL+, module Data.Geo.GPX.Lens.WptsL+, module Data.Geo.GPX.Lens.YearL+) where++import Data.Geo.GPX.Lens.AgeofdgpsdataL+import Data.Geo.GPX.Lens.AuthorL+import Data.Geo.GPX.Lens.BoundsL+import Data.Geo.GPX.Lens.CmtL+import Data.Geo.GPX.Lens.CopyrightL+import Data.Geo.GPX.Lens.CreatorL+import Data.Geo.GPX.Lens.DescL+import Data.Geo.GPX.Lens.DgpsidL+import Data.Geo.GPX.Lens.DomainL+import Data.Geo.GPX.Lens.EleL+import Data.Geo.GPX.Lens.EmailL+import Data.Geo.GPX.Lens.ExtensionsL+import Data.Geo.GPX.Lens.FixL+import Data.Geo.GPX.Lens.GeoidheightL+import Data.Geo.GPX.Lens.HdopL+import Data.Geo.GPX.Lens.HrefL+import Data.Geo.GPX.Lens.IdL+import Data.Geo.GPX.Lens.KeywordsL+import Data.Geo.GPX.Lens.LatL+import Data.Geo.GPX.Lens.LicenseL+import Data.Geo.GPX.Lens.LinkL+import Data.Geo.GPX.Lens.LinksL+import Data.Geo.GPX.Lens.LonL+import Data.Geo.GPX.Lens.MagvarL+import Data.Geo.GPX.Lens.MaxlatL+import Data.Geo.GPX.Lens.MaxlonL+import Data.Geo.GPX.Lens.MetadataL+import Data.Geo.GPX.Lens.MinlatL+import Data.Geo.GPX.Lens.MinlonL+import Data.Geo.GPX.Lens.NameL+import Data.Geo.GPX.Lens.NumberL+import Data.Geo.GPX.Lens.PdopL+import Data.Geo.GPX.Lens.PtsL+import Data.Geo.GPX.Lens.RteptsL+import Data.Geo.GPX.Lens.RtesL+import Data.Geo.GPX.Lens.SatL+import Data.Geo.GPX.Lens.SrcL+import Data.Geo.GPX.Lens.SymL+import Data.Geo.GPX.Lens.TextL+import Data.Geo.GPX.Lens.TimeL+import Data.Geo.GPX.Lens.TrkptsL+import Data.Geo.GPX.Lens.TrksegsL+import Data.Geo.GPX.Lens.TrksL+import Data.Geo.GPX.Lens.TypeL+import Data.Geo.GPX.Lens.VdopL+import Data.Geo.GPX.Lens.VersionL+import Data.Geo.GPX.Lens.WptsL+import Data.Geo.GPX.Lens.YearL++
+ src/Data/Geo/GPX/Lens/AgeofdgpsdataL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.AgeofdgpsdataL where++import Data.Lens.Common++class AgeofdgpsdataL a where+ ageofdgpsdataL :: Lens a (Maybe Double)+
+ src/Data/Geo/GPX/Lens/AuthorL.hs view
@@ -0,0 +1,9 @@+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}++module Data.Geo.GPX.Lens.AuthorL where++import Data.Lens.Common++class AuthorL a b | a -> b where+ authorL :: Lens a b+
+ src/Data/Geo/GPX/Lens/BoundsL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.BoundsL where++import Data.Geo.GPX.Type.Bounds+import Data.Lens.Common++class BoundsL a where+ boundsL :: Lens a (Maybe Bounds)+
+ src/Data/Geo/GPX/Lens/CmtL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.CmtL where++import Data.Lens.Common++class CmtL a where+ cmtL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/CopyrightL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.CopyrightL where++import Data.Geo.GPX.Type.Copyright+import Data.Lens.Common++class CopyrightL a where+ copyrightL :: Lens a (Maybe Copyright)+
+ src/Data/Geo/GPX/Lens/CreatorL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.CreatorL where++import Data.Lens.Common++class CreatorL a where+ creatorL :: Lens a String+
+ src/Data/Geo/GPX/Lens/DescL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.DescL where++import Data.Lens.Common++class DescL a where+ descL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/DgpsidL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.DgpsidL where++import Data.Geo.GPX.Type.DgpsStation+import Data.Lens.Common++class DgpsidL a where+ dgpsidL :: Lens a (Maybe DgpsStation)+
+ src/Data/Geo/GPX/Lens/DomainL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.DomainL where++import Data.Lens.Common++class DomainL a where+ domainL :: Lens a String+
+ src/Data/Geo/GPX/Lens/EleL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.EleL where++import Data.Lens.Common++class EleL a where+ eleL :: Lens a (Maybe Double)+
+ src/Data/Geo/GPX/Lens/EmailL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.EmailL where++import Data.Geo.GPX.Type.Email+import Data.Lens.Common++class EmailL a where+ emailL :: Lens a (Maybe Email)+
+ src/Data/Geo/GPX/Lens/ExtensionsL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.ExtensionsL where++import Data.Geo.GPX.Type.Extensions+import Data.Lens.Common++class ExtensionsL a where+ extensionsL :: Lens a (Maybe Extensions)+
+ src/Data/Geo/GPX/Lens/FixL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.FixL where++import Data.Geo.GPX.Type.Fix+import Data.Lens.Common++class FixL a where+ fixL :: Lens a (Maybe Fix)+
+ src/Data/Geo/GPX/Lens/GeoidheightL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.GeoidheightL where++import Data.Lens.Common++class GeoidheightL a where+ geoidheightL :: Lens a (Maybe Double)+
+ src/Data/Geo/GPX/Lens/HdopL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.HdopL where++import Data.Lens.Common++class HdopL a where+ hdopL :: Lens a (Maybe Double)+
+ src/Data/Geo/GPX/Lens/HrefL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.HrefL where++import Data.Lens.Common++class HrefL a where+ hrefL :: Lens a String+
+ src/Data/Geo/GPX/Lens/IdL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.IdL where++import Data.Lens.Common+import Prelude hiding (id)++class IdL a where+ idL :: Lens a String+
+ src/Data/Geo/GPX/Lens/KeywordsL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.KeywordsL where++import Data.Lens.Common++class KeywordsL a where+ keywordsL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/LatL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.LatL where++import Data.Geo.GPX.Type.Latitude+import Data.Lens.Common++class LatL a where+ latL :: Lens a Latitude+
+ src/Data/Geo/GPX/Lens/LicenseL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.LicenseL where++import Data.Lens.Common++class LicenseL a where+ licenseL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/LinkL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.LinkL where++import Data.Geo.GPX.Type.Link+import Data.Lens.Common++class LinkL a where+ linkL :: Lens a (Maybe Link)+
+ src/Data/Geo/GPX/Lens/LinksL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.LinksL where++import Data.Geo.GPX.Type.Link+import Data.Lens.Common++class LinksL a where+ linksL :: Lens a [Link]+
+ src/Data/Geo/GPX/Lens/LonL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.LonL where++import Data.Geo.GPX.Type.Longitude+import Data.Lens.Common++class LonL a where+ lonL :: Lens a Longitude+
+ src/Data/Geo/GPX/Lens/MagvarL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.MagvarL where++import Data.Geo.GPX.Type.Degrees+import Data.Lens.Common++class MagvarL a where+ magvarL :: Lens a (Maybe Degrees)+
+ src/Data/Geo/GPX/Lens/MaxlatL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.MaxlatL where++import Data.Geo.GPX.Type.Latitude+import Data.Lens.Common++class MaxlatL a where+ maxlatL :: Lens a Latitude+
+ src/Data/Geo/GPX/Lens/MaxlonL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.MaxlonL where++import Data.Geo.GPX.Type.Longitude+import Data.Lens.Common++class MaxlonL a where+ maxlonL :: Lens a Longitude+
+ src/Data/Geo/GPX/Lens/MetadataL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.MetadataL where++import Data.Geo.GPX.Type.Metadata+import Data.Lens.Common++class MetadataL a where+ metadataL :: Lens a (Maybe Metadata)+
+ src/Data/Geo/GPX/Lens/MinlatL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.MinlatL where++import Data.Geo.GPX.Type.Latitude+import Data.Lens.Common++class MinlatL a where+ minlatL :: Lens a Latitude+
+ src/Data/Geo/GPX/Lens/MinlonL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.MinlonL where++import Data.Geo.GPX.Type.Longitude+import Data.Lens.Common++class MinlonL a where+ minlonL :: Lens a Longitude+
+ src/Data/Geo/GPX/Lens/NameL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.NameL where++import Data.Lens.Common++class NameL a where+ nameL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/NumberL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.NumberL where++import Data.Lens.Common++class NumberL a where+ numberL :: Lens a (Maybe Int)+
+ src/Data/Geo/GPX/Lens/PdopL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.PdopL where++import Data.Lens.Common++class PdopL a where+ pdopL :: Lens a (Maybe Double)+
+ src/Data/Geo/GPX/Lens/PtsL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.PtsL where++import Data.Geo.GPX.Type.Pt+import Data.Lens.Common++class PtsL a where+ ptsL :: Lens a [Pt]+
+ src/Data/Geo/GPX/Lens/RteptsL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.RteptsL where++import Data.Geo.GPX.Type.Wpt+import Data.Lens.Common++class RteptsL a where+ rteptsL :: Lens a [Wpt]+
+ src/Data/Geo/GPX/Lens/RtesL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.RtesL where++import Data.Geo.GPX.Type.Rte+import Data.Lens.Common++class RtesL a where+ rtesL :: Lens a [Rte]+
+ src/Data/Geo/GPX/Lens/SatL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.SatL where++import Data.Lens.Common++class SatL a where+ satL :: Lens a (Maybe Int)+
+ src/Data/Geo/GPX/Lens/SrcL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.SrcL where++import Data.Lens.Common++class SrcL a where+ srcL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/SymL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.SymL where++import Data.Lens.Common++class SymL a where+ symL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/TextL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.TextL where++import Data.Lens.Common++class TextL a where+ textL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/TimeL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.TimeL where++import Text.XML.XSD.DateTime+import Data.Lens.Common++class TimeL a where+ timeL :: Lens a (Maybe DateTime)+
+ src/Data/Geo/GPX/Lens/TrkptsL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.TrkptsL where++import Data.Geo.GPX.Type.Wpt+import Data.Lens.Common++class TrkptsL a where+ trkptsL :: Lens a [Wpt]+
+ src/Data/Geo/GPX/Lens/TrksL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.TrksL where++import Data.Geo.GPX.Type.Trk+import Data.Lens.Common++class TrksL a where+ trksL :: Lens a [Trk]+
+ src/Data/Geo/GPX/Lens/TrksegsL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.TrksegsL where++import Data.Geo.GPX.Type.Trkseg+import Data.Lens.Common++class TrksegsL a where+ trksegsL :: Lens a [Trkseg]+
+ src/Data/Geo/GPX/Lens/TypeL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.TypeL where++import Data.Lens.Common++class TypeL a where+ typeL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Lens/VdopL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.VdopL where++import Data.Lens.Common++class VdopL a where+ vdopL :: Lens a (Maybe Double)+
+ src/Data/Geo/GPX/Lens/VersionL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.VersionL where++import Data.Lens.Common++class VersionL a where+ versionL :: Lens a String+
+ src/Data/Geo/GPX/Lens/WptsL.hs view
@@ -0,0 +1,8 @@+module Data.Geo.GPX.Lens.WptsL where++import Data.Geo.GPX.Type.Wpt+import Data.Lens.Common++class WptsL a where+ wptsL :: Lens a [Wpt]+
+ src/Data/Geo/GPX/Lens/YearL.hs view
@@ -0,0 +1,7 @@+module Data.Geo.GPX.Lens.YearL where++import Data.Lens.Common++class YearL a where+ yearL :: Lens a (Maybe String)+
+ src/Data/Geo/GPX/Type.hs view
@@ -0,0 +1,43 @@+-- | GPX 1.1 Schema <http://www.topografix.com/GPX/1/1/>+module Data.Geo.GPX.Type(+ module Data.Geo.GPX.Type.DgpsStation+, module Data.Geo.GPX.Type.Fix+, module Data.Geo.GPX.Type.Degrees+, module Data.Geo.GPX.Type.Longitude+, module Data.Geo.GPX.Type.Latitude+, module Data.Geo.GPX.Type.Bounds+, module Data.Geo.GPX.Type.Extensions+, module Data.Geo.GPX.Type.Pt+, module Data.Geo.GPX.Type.Ptseg+, module Data.Geo.GPX.Type.Email+, module Data.Geo.GPX.Type.Link+, module Data.Geo.GPX.Type.Person+, module Data.Geo.GPX.Type.Copyright+, module Data.Geo.GPX.Type.Wpt+, module Data.Geo.GPX.Type.Trkseg+, module Data.Geo.GPX.Type.Trk+, module Data.Geo.GPX.Type.Rte+, module Data.Geo.GPX.Type.Metadata+, module Data.Geo.GPX.Type.Gpx+) where++import Data.Geo.GPX.Type.DgpsStation+import Data.Geo.GPX.Type.Fix+import Data.Geo.GPX.Type.Degrees+import Data.Geo.GPX.Type.Longitude+import Data.Geo.GPX.Type.Latitude+import Data.Geo.GPX.Type.Bounds+import Data.Geo.GPX.Type.Extensions+import Data.Geo.GPX.Type.Pt+import Data.Geo.GPX.Type.Ptseg+import Data.Geo.GPX.Type.Email+import Data.Geo.GPX.Type.Link+import Data.Geo.GPX.Type.Person+import Data.Geo.GPX.Type.Copyright+import Data.Geo.GPX.Type.Wpt+import Data.Geo.GPX.Type.Trkseg+import Data.Geo.GPX.Type.Trk+import Data.Geo.GPX.Type.Rte+import Data.Geo.GPX.Type.Metadata+import Data.Geo.GPX.Type.Gpx+
+ src/Data/Geo/GPX/Type/Bounds.hs view
@@ -0,0 +1,51 @@+-- | Complex Type: @boundsType@ <http://www.topografix.com/GPX/1/1/#type_boundsType>+module Data.Geo.GPX.Type.Bounds(+ Bounds+, bounds+) where++import Data.Geo.GPX.Type.Latitude+import Data.Geo.GPX.Type.Longitude+import Data.Geo.GPX.Lens.MinlatL+import Data.Geo.GPX.Lens.MaxlatL+import Data.Geo.GPX.Lens.MinlonL+import Data.Geo.GPX.Lens.MaxlonL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Bounds = Bounds (Latitude, Longitude) (Latitude, Longitude)+ deriving (Eq, Ord)++bounds :: + (Latitude, Longitude) -- ^ The minimum latitude and longitude.+ -> (Latitude, Longitude) -- ^ The maximum latitude and longitude.+ -> Bounds+bounds =+ Bounds++instance MinlatL Bounds where+ minlatL =+ Lens $ \(Bounds (minlat, minlon) (maxlat, maxlon)) -> store (\minlat -> Bounds (minlat, minlon) (maxlat, maxlon)) minlat++instance MinlonL Bounds where+ minlonL =+ Lens $ \(Bounds (minlat, minlon) (maxlat, maxlon)) -> store (\minlon -> Bounds (minlat, minlon) (maxlat, maxlon)) minlon++instance MaxlatL Bounds where+ maxlatL =+ Lens $ \(Bounds (minlat, minlon) (maxlat, maxlon)) -> store (\maxlat -> Bounds (minlat, minlon) (maxlat, maxlon)) maxlat++instance MaxlonL Bounds where+ maxlonL =+ Lens $ \(Bounds (minlat, minlon) (maxlat, maxlon)) -> store (\maxlon -> Bounds (minlat, minlon) (maxlat, maxlon)) maxlon++instance XmlPickler Bounds where+ xpickle =+ xpWrap (\(minlat', minlon', maxlat', maxlon') -> bounds (minlat', minlon') (maxlat', maxlon'),+ \(Bounds (minlat', minlon') (maxlat', maxlon')) -> (minlat', minlon', maxlat', maxlon')) (xp4Tuple+ (xpAttr "minlat" xpickle)+ (xpAttr "minlon" xpickle)+ (xpAttr "maxlat" xpickle)+ (xpAttr "maxlon" xpickle))+
+ src/Data/Geo/GPX/Type/Copyright.hs view
@@ -0,0 +1,44 @@+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-}++-- | Complex Type: @copyrightType@ <http://www.topografix.com/GPX/1/1/#type_copyrightType>+module Data.Geo.GPX.Type.Copyright(+ Copyright+, copyright+) where++import Data.Geo.GPX.Lens.AuthorL+import Data.Geo.GPX.Lens.YearL+import Data.Geo.GPX.Lens.LicenseL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Copyright = Copyright String (Maybe String) (Maybe String)+ deriving (Eq, Ord)++copyright+ :: String -- ^ The author.+ -> Maybe String -- ^ The year.+ -> Maybe String -- ^ The license.+ -> Copyright+copyright =+ Copyright++instance AuthorL Copyright String where+ authorL =+ Lens $ \(Copyright author year license) -> store (\author -> Copyright author year license) author++instance YearL Copyright where+ yearL =+ Lens $ \(Copyright author year license) -> store (\year -> Copyright author year license) year++instance LicenseL Copyright where+ licenseL =+ Lens $ \(Copyright author year license) -> store (\license -> Copyright author year license) license++instance XmlPickler Copyright where+ xpickle =+ xpWrap (\(author', year', license') -> copyright author' year' license', \(Copyright author' year' license') -> (author', year', license')) (xpTriple+ (xpAttr "author" xpText)+ (xpOption (xpElem "year" xpText))+ (xpOption (xpElem "license" xpText)))
+ src/Data/Geo/GPX/Type/Degrees.hs view
@@ -0,0 +1,39 @@+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}++-- | Simple Type: @degreesType@ <http://www.topografix.com/GPX/1/1/#type_degreesType>+module Data.Geo.GPX.Type.Degrees(+ Degrees+, degrees+, runDegrees+) where+++import Data.Fixed+import Text.XML.HXT.Arrow.Pickle+import Control.Newtype++newtype Degrees = Degrees Double+ deriving (Eq, Ord, Show)++degrees ::+ Double -- ^ The value which will be between 0 and 360 (values out of the range are truncated using a modulus operation).+ -> Degrees+degrees n =+ Degrees (n `mod'` 360)++runDegrees ::+ Degrees+ -> Double+runDegrees (Degrees d) =+ d++instance XmlPickler Degrees where+ xpickle =+ xpWrap (degrees, \(Degrees n) -> n) xpPrim++instance Newtype Degrees Double where+ pack = + degrees+ unpack (Degrees x) =+ x+
+ src/Data/Geo/GPX/Type/DgpsStation.hs view
@@ -0,0 +1,33 @@+-- | Simple Type: @dgpsStationType@ <http://www.topografix.com/GPX/1/1/#type_dgpsStationType>+module Data.Geo.GPX.Type.DgpsStation(+ DgpsStation+, dgpsStation+, runDgpsStation+) where++import Data.Ix+import Text.XML.HXT.Arrow.Pickle++newtype DgpsStation = DgpsStation Int+ deriving (Eq, Ord)++dgpsStation ::+ Int -- ^ The value between 0 and 1023.+ -> Maybe DgpsStation+dgpsStation n =+ if inRange (0, 1023) n+ then+ Just (DgpsStation n)+ else+ Nothing++runDgpsStation ::+ DgpsStation+ -> Int+runDgpsStation (DgpsStation i) =+ i++instance XmlPickler DgpsStation where+ xpickle =+ xpWrapMaybe (dgpsStation, \(DgpsStation n) -> n) xpickle+
+ src/Data/Geo/GPX/Type/Email.hs view
@@ -0,0 +1,36 @@+-- | Complex Type: @emailType@ <http://www.topografix.com/GPX/1/1/#type_emailType>+module Data.Geo.GPX.Type.Email(+ Email+, email+) where++import Data.Geo.GPX.Lens.IdL+import Data.Geo.GPX.Lens.DomainL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Email = Email String String+ deriving (Eq, Ord)++email ::+ String -- ^ The id.+ -> String -- ^ The domain.+ -> Email+email =+ Email++instance IdL Email where+ idL =+ Lens $ \(Email id domain) -> store (\id -> Email id domain) id++instance DomainL Email where+ domainL =+ Lens $ \(Email id domain) -> store (\domain -> Email id domain) domain++instance XmlPickler Email where+ xpickle =+ xpWrap (uncurry email, \(Email id' domain') -> (id', domain'))+ (xpPair (xpAttr "id" xpText) (xpAttr "domain" xpText))++
+ src/Data/Geo/GPX/Type/Extensions.hs view
@@ -0,0 +1,38 @@+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, TypeSynonymInstances #-}++-- | Complex Type: @extensionsType@ <http://www.topografix.com/GPX/1/1/#type_extensionsType>+module Data.Geo.GPX.Type.Extensions(+ Extensions+, extensions+, runExtensions+) where++import Text.XML.HXT.Arrow.Pickle+import Text.XML.HXT.DOM.TypeDefs+import Control.Newtype++newtype Extensions = Extensions XmlTrees+ deriving (Eq, Show)++extensions :: + XmlTrees+ -> Extensions+extensions =+ Extensions++runExtensions ::+ Extensions+ -> XmlTrees+runExtensions (Extensions t) =+ t++instance XmlPickler Extensions where+ xpickle =+ xpWrap (Extensions, \(Extensions t) -> t) xpTrees++instance Newtype Extensions XmlTrees where+ pack = + Extensions+ unpack (Extensions x) =+ x+
+ src/Data/Geo/GPX/Type/Fix.hs view
@@ -0,0 +1,76 @@+-- | Simple Type: @fixType@ <http://www.topografix.com/GPX/1/1/#type_fixType>+module Data.Geo.GPX.Type.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)++-- | The catamorphism for @Fix@.+foldFix ::+ a -- ^ The value if @none@.+ -> a -- ^ The value if @twod@.+ -> a -- ^ The value if @threed@.+ -> a -- ^ The value if @dgps@.+ -> a -- ^ The value if @pps@.+ -> Fix -- ^ The value to fold.+ -> a+foldFix n _ _ _ _ None = n+foldFix _ t _ _ _ Twod = t+foldFix _ _ t _ _ Threed = t+foldFix _ _ _ d _ Dgps = d+foldFix _ _ _ _ p Pps = p++-- | Construct a @Fix@ with a value of @none@.+none ::+ Fix+none =+ None++-- | Construct a @Fix@ with a value of @2d@.+twod :: Fix+twod = Twod++-- | Construct a @Fix@ with a value of @3d@.+threed ::+ Fix+threed =+ Threed++-- | Construct a @Fix@ with a value of @dgps@.+dgps ::+ Fix+dgps =+ Dgps++-- | Construct a @Fix@ with a value of @pps@.+pps ::+ Fix+pps =+ Pps++-- | Construct a @Fix@ using a string with a value of @["none", "2d", "3d", "dgps", "pps"]@.+fix ::+ String -- ^ The string value to construct a @Fix@ with.+ -> 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++
+ src/Data/Geo/GPX/Type/Gpx.hs view
@@ -0,0 +1,82 @@+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-}++-- | Complex Type: @gpxType@ <http://www.topografix.com/GPX/1/1/#type_gpxType>+module Data.Geo.GPX.Type.Gpx(+ Gpx+, GpxP(..)+) where++import Data.Geo.GPX.Type.Metadata+import Data.Geo.GPX.Type.Wpt+import Data.Geo.GPX.Type.Rte+import Data.Geo.GPX.Type.Trk+import Data.Geo.GPX.Type.Extensions+import Data.Geo.GPX.Lens.VersionL+import Data.Geo.GPX.Lens.CreatorL+import Data.Geo.GPX.Lens.MetadataL+import Data.Geo.GPX.Lens.WptsL+import Data.Geo.GPX.Lens.RtesL+import Data.Geo.GPX.Lens.TrksL+import Data.Geo.GPX.Lens.ExtensionsL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Gpx = Gpx String String (Maybe Metadata) [Wpt] [Rte] [Trk] (Maybe Extensions)+ deriving Eq++class GpxP g where+ gpx ::+ String -- ^ The version.+ -> String -- ^ The creator.+ -> Maybe Metadata -- ^ The metadata.+ -> [Wpt] -- ^ The waypoints (wpt).+ -> [Rte] -- ^ The routes (rte).+ -> [Trk] -- ^ The tracks (trk).+ -> Maybe Extensions -- ^ The extensions.+ -> g++instance GpxP Gpx where+ gpx =+ Gpx++instance VersionL Gpx where+ versionL =+ Lens $ \(Gpx version creator metadata wpts rtes trks extensions) -> store (\version -> Gpx version creator metadata wpts rtes trks extensions) version++instance CreatorL Gpx where+ creatorL =+ Lens $ \(Gpx version creator metadata wpts rtes trks extensions) -> store (\creator -> Gpx version creator metadata wpts rtes trks extensions) creator++instance MetadataL Gpx where+ metadataL =+ Lens $ \(Gpx version creator metadata wpts rtes trks extensions) -> store (\metadata -> Gpx version creator metadata wpts rtes trks extensions) metadata++instance WptsL Gpx where+ wptsL =+ Lens $ \(Gpx version creator metadata wpts rtes trks extensions) -> store (\wpts -> Gpx version creator metadata wpts rtes trks extensions) wpts++instance RtesL Gpx where+ rtesL =+ Lens $ \(Gpx version creator metadata wpts rtes trks extensions) -> store (\rtes -> Gpx version creator metadata wpts rtes trks extensions) rtes++instance TrksL Gpx where+ trksL =+ Lens $ \(Gpx version creator metadata wpts rtes trks extensions) -> store (\trks -> Gpx version creator metadata wpts rtes trks extensions) trks++instance ExtensionsL Gpx where+ extensionsL =+ Lens $ \(Gpx version creator metadata wpts rtes trks extensions) -> store (\extensions -> Gpx version creator metadata wpts rtes trks extensions) extensions++instance XmlPickler Gpx where+ xpickle =+ xpWrap (\(version', creator', metadata', wpt', rte', trk', extensions') -> gpx version' creator' metadata' wpt' rte' trk' extensions',+ \(Gpx version' creator' metadata' wpt' rte' trk' extensions') -> (version', creator', metadata', wpt', rte', trk', extensions')) (xp7Tuple+ (xpAttr "version" xpText)+ (xpAttr "creator" xpText)+ (xpOption (xpElem "metadata" xpickle))+ (xpList (xpElem "wpt" xpickle))+ (xpList (xpElem "rte" xpickle))+ (xpList (xpElem "trk" xpickle))+ (xpOption (xpElem "extensions" xpickle)))+
+ src/Data/Geo/GPX/Type/Latitude.hs view
@@ -0,0 +1,40 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, MultiParamTypeClasses #-}++-- | Simple Type: @latitudeType@ <http://www.topografix.com/GPX/1/1/#type_latitudeType>+module Data.Geo.GPX.Type.Latitude(+ Latitude+, latitude+, runLatitude+) where++import Data.Fixed+import Text.XML.HXT.Arrow.Pickle+import Control.Newtype++newtype Latitude = Latitude Double+ deriving (Eq, Ord, Enum, Num, Fractional, Floating, Real, RealFrac, RealFloat)++latitude ::+ Double -- ^ The value which will be between -90 and 90 (values out of the range are truncated using a modulus operation).+ -> Latitude+latitude n =+ Latitude ((n + 90) `mod'` 180 - 90)++runLatitude ::+ Latitude+ -> Double+runLatitude (Latitude d) =+ d++instance Show Latitude where+ show (Latitude n) = show n++instance XmlPickler Latitude where+ xpickle = xpWrap (latitude, \(Latitude n) -> n) xpPrim++instance Newtype Latitude Double where+ pack = + latitude+ unpack (Latitude x) =+ x+
+ src/Data/Geo/GPX/Type/Link.hs view
@@ -0,0 +1,43 @@+-- | Complex Type: @linkType@ <http://www.topografix.com/GPX/1/1/#type_linkType>+module Data.Geo.GPX.Type.Link(+ Link+, link+) where++import Data.Geo.GPX.Lens.HrefL+import Data.Geo.GPX.Lens.TextL+import Data.Geo.GPX.Lens.TypeL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Link = Link String (Maybe String) (Maybe String)+ deriving (Eq, Ord)++link ::+ String -- ^ The href.+ -> Maybe String -- ^ The text.+ -> Maybe String -- ^ The type.+ -> Link+link =+ Link++instance HrefL Link where+ hrefL =+ Lens $ \(Link href text typ) -> store (\href -> Link href text typ) href++instance TextL Link where+ textL =+ Lens $ \(Link href text typ) -> store (\text -> Link href text typ) text++instance TypeL Link where+ typeL =+ Lens $ \(Link href text typ) -> store (\typ -> Link href text typ) typ++instance XmlPickler Link where+ xpickle =+ xpWrap (\(href, text, type') -> link href text type', \(Link href text type') -> (href, text, type')) (xpTriple+ (xpAttr "href" xpText)+ (xpOption (xpElem "text" xpText))+ (xpOption (xpElem "type" xpText)))+
+ src/Data/Geo/GPX/Type/Longitude.hs view
@@ -0,0 +1,40 @@+{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances, MultiParamTypeClasses #-}++-- | Simple Type: @latitudeType@ <http://www.topografix.com/GPX/1/1/#type_latitudeType>+module Data.Geo.GPX.Type.Longitude(+ Longitude+, longitude+, runLongitude+) where++import Data.Fixed+import Text.XML.HXT.Arrow.Pickle+import Control.Newtype++newtype Longitude = Longitude Double+ deriving (Eq, Ord, Enum, Num, Fractional, Floating, Real, RealFrac, RealFloat)++longitude ::+ Double -- ^ The value which will be between -180 and 180 (values out of the range are truncated using a modulus operation).+ -> Longitude+longitude n =+ Longitude ((n + 180) `mod'` 360 - 180)++runLongitude ::+ Longitude+ -> Double+runLongitude (Longitude d) =+ d++instance Show Longitude where+ show (Longitude n) = show n++instance XmlPickler Longitude where+ xpickle = xpWrap (longitude, \(Longitude n) -> n) xpPrim++instance Newtype Longitude Double where+ pack = + longitude+ unpack (Longitude x) =+ x+
+ src/Data/Geo/GPX/Type/Metadata.hs view
@@ -0,0 +1,94 @@+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, TypeSynonymInstances #-}++-- | Complex Type: @metadataType@ <http://www.topografix.com/GPX/1/1/#type_metadataType>+module Data.Geo.GPX.Type.Metadata(+ Metadata+, metadata+) where++import Data.Geo.GPX.Type.Person+import Data.Geo.GPX.Type.Copyright+import Data.Geo.GPX.Type.Link+import Data.Geo.GPX.Type.Bounds+import Data.Geo.GPX.Type.Extensions+import Data.Geo.GPX.Lens.NameL+import Data.Geo.GPX.Lens.DescL+import Data.Geo.GPX.Lens.AuthorL+import Data.Geo.GPX.Lens.CopyrightL+import Data.Geo.GPX.Lens.LinksL+import Data.Geo.GPX.Lens.TimeL+import Data.Geo.GPX.Lens.KeywordsL+import Data.Geo.GPX.Lens.BoundsL+import Data.Geo.GPX.Lens.ExtensionsL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle+import Text.XML.XSD.DateTime++data Metadata = Metadata (Maybe String) (Maybe String) (Maybe Person) (Maybe Copyright) [Link] (Maybe DateTime) (Maybe String) (Maybe Bounds) (Maybe Extensions)+ deriving Eq++metadata ::+ Maybe String -- ^ The name.+ -> Maybe String -- ^ The desc.+ -> Maybe Person -- ^ The author.+ -> Maybe Copyright -- ^ The copyright.+ -> [Link] -- ^ The links (link).+ -> Maybe DateTime -- ^ The time.+ -> Maybe String -- ^ The keywords.+ -> Maybe Bounds -- ^ The bounds.+ -> Maybe Extensions -- ^ The extensions+ -> Metadata+metadata =+ Metadata++instance NameL Metadata where+ nameL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\name -> Metadata name desc author copyright links time keywords bounds extensions) name++instance DescL Metadata where+ descL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\desc -> Metadata name desc author copyright links time keywords bounds extensions) desc++instance AuthorL Metadata (Maybe Person) where+ authorL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\author -> Metadata name desc author copyright links time keywords bounds extensions) author++instance CopyrightL Metadata where+ copyrightL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\copyright -> Metadata name desc author copyright links time keywords bounds extensions) copyright++instance LinksL Metadata where+ linksL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\links -> Metadata name desc author copyright links time keywords bounds extensions) links++instance TimeL Metadata where+ timeL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\time -> Metadata name desc author copyright links time keywords bounds extensions) time++instance KeywordsL Metadata where+ keywordsL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\keywords -> Metadata name desc author copyright links time keywords bounds extensions) keywords++instance BoundsL Metadata where+ boundsL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\bounds -> Metadata name desc author copyright links time keywords bounds extensions) bounds++instance ExtensionsL Metadata where+ extensionsL =+ Lens $ \(Metadata name desc author copyright links time keywords bounds extensions) -> store (\extensions -> Metadata name desc author copyright links time keywords bounds extensions) extensions++instance XmlPickler Metadata where+ xpickle =+ xpWrap (\(a, b, c, d, e, f, g, h, i) -> metadata a b c d e f g h i, \(Metadata a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "desc" xpText))+ (xpOption (xpElem "author" xpickle))+ (xpOption (xpElem "copyright" xpickle))+ (xpList (xpElem "link" xpickle))+ (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText)))+ (xpOption (xpElem "keywords" xpText))+ (xpOption (xpElem "bounds" xpickle))+ (xpOption (xpElem "extensions" xpickle)))++
+ src/Data/Geo/GPX/Type/Person.hs view
@@ -0,0 +1,45 @@+-- | Complex Type: @personType@ <http://www.topografix.com/GPX/1/1/#type_personType>+module Data.Geo.GPX.Type.Person(+ Person+, person+) where++import Data.Geo.GPX.Type.Email+import Data.Geo.GPX.Type.Link+import Data.Geo.GPX.Lens.NameL+import Data.Geo.GPX.Lens.EmailL+import Data.Geo.GPX.Lens.LinkL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Person = Person (Maybe String) (Maybe Email) (Maybe Link)+ deriving (Eq, Ord)++person ::+ Maybe String -- ^ The name.+ -> Maybe Email -- ^ The email.+ -> Maybe Link -- ^ The link.+ -> Person+person =+ Person++instance NameL Person where+ nameL =+ Lens $ \(Person name email link) -> store (\name -> Person name email link) name++instance EmailL Person where+ emailL =+ Lens $ \(Person name email link) -> store (\email -> Person name email link) email++instance LinkL Person where+ linkL =+ Lens $ \(Person name email link) -> store (\link -> Person name email link) link++instance XmlPickler Person where+ xpickle =+ xpWrap (\(name', email', link') -> person name' email' link', \(Person name' email' link') -> (name', email', link')) (xpTriple+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "email" xpickle))+ (xpOption (xpElem "link" xpickle)))+
+ src/Data/Geo/GPX/Type/Pt.hs view
@@ -0,0 +1,54 @@+-- | Complex Type: @ptType@ <http://www.topografix.com/GPX/1/1/#type_ptType>+module Data.Geo.GPX.Type.Pt(+ Pt+, pt+) where++import Data.Geo.GPX.Type.Latitude+import Data.Geo.GPX.Type.Longitude+import Data.Geo.GPX.Lens.LatL+import Data.Geo.GPX.Lens.LonL+import Data.Geo.GPX.Lens.EleL+import Data.Geo.GPX.Lens.TimeL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle+import Text.XML.XSD.DateTime++data Pt = Pt Latitude Longitude (Maybe Double) (Maybe DateTime)+ deriving (Eq, Ord)++pt ::+ Latitude -- ^ The lat.+ -> Longitude -- ^ The lon.+ -> Maybe Double -- ^ The ele.+ -> Maybe DateTime -- ^ The time.+ -> Pt+pt =+ Pt++instance LatL Pt where+ latL =+ Lens $ \(Pt lat lon ele time) -> store (\lat -> Pt lat lon ele time) lat++instance LonL Pt where+ lonL =+ Lens $ \(Pt lat lon ele time) -> store (\lon -> Pt lat lon ele time) lon++instance EleL Pt where+ eleL =+ Lens $ \(Pt lat lon ele time) -> store (\ele -> Pt lat lon ele time) ele++instance TimeL Pt where+ timeL =+ Lens $ \(Pt lat lon ele time) -> store (\time -> Pt lat lon ele time) time++instance XmlPickler Pt where+ xpickle =+ xpWrap (\(lat', lon', ele', time') -> pt lat' lon' ele' time',+ \(Pt lat' lon' ele' time') -> (lat', lon', ele', time')) (xp4Tuple+ (xpAttr "lat" xpickle)+ (xpAttr "lon" xpickle)+ (xpOption (xpElem "ele" xpPrim))+ (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText))))+
+ src/Data/Geo/GPX/Type/Ptseg.hs view
@@ -0,0 +1,38 @@+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-}++-- | Complex Type: @ptsegType@ <http://www.topografix.com/GPX/1/1/#type_ptsegType>+module Data.Geo.GPX.Type.Ptseg(+ Ptseg+, ptseg+, runPtseg+) where++import Data.Geo.GPX.Type.Pt+import Text.XML.HXT.Arrow.Pickle+import Control.Newtype++newtype Ptseg = Ptseg [Pt]+ deriving (Eq, Ord)++ptseg ::+ [Pt] -- ^ The points (pt).+ -> Ptseg+ptseg =+ Ptseg++runPtseg ::+ Ptseg+ -> [Pt]+runPtseg (Ptseg p) =+ p++instance XmlPickler Ptseg where+ xpickle =+ xpWrap (ptseg, \(Ptseg k) -> k) (xpList (xpElem "pt" xpickle))++instance Newtype Ptseg [Pt] where+ pack = + Ptseg+ unpack (Ptseg x) =+ x+
+ src/Data/Geo/GPX/Type/Rte.hs view
@@ -0,0 +1,88 @@+-- | Complex Type: @rteType@ <http://www.topografix.com/GPX/1/1/#type_rteType>+module Data.Geo.GPX.Type.Rte(+ Rte+, rte+) where++import Data.Geo.GPX.Type.Wpt+import Data.Geo.GPX.Type.Extensions+import Data.Geo.GPX.Type.Link+import Data.Geo.GPX.Lens.NameL+import Data.Geo.GPX.Lens.CmtL+import Data.Geo.GPX.Lens.DescL+import Data.Geo.GPX.Lens.SrcL+import Data.Geo.GPX.Lens.LinksL+import Data.Geo.GPX.Lens.NumberL+import Data.Geo.GPX.Lens.TypeL+import Data.Geo.GPX.Lens.ExtensionsL+import Data.Geo.GPX.Lens.RteptsL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Rte = Rte (Maybe String) (Maybe String) (Maybe String) (Maybe String) [Link] (Maybe Int) (Maybe String) (Maybe Extensions) [Wpt]+ deriving Eq++rte ::+ Maybe String -- ^ The name.+ -> Maybe String -- ^ The cmt.+ -> Maybe String -- ^ The desc.+ -> Maybe String -- ^ The src.+ -> [Link] -- ^ The links (link).+ -> Maybe Int -- ^ The number.+ -> Maybe String -- ^ The type.+ -> Maybe Extensions -- ^ The extensions.+ -> [Wpt] -- ^ The route points (rtept).+ -> Rte+rte a b c d e f =+ Rte a b c d e (fmap abs f)++instance NameL Rte where+ nameL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\name -> Rte name cmt desc src links number typ extensions rtepts) name++instance CmtL Rte where+ cmtL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\cmt -> Rte name cmt desc src links number typ extensions rtepts) cmt++instance DescL Rte where+ descL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\desc -> Rte name cmt desc src links number typ extensions rtepts) desc++instance SrcL Rte where+ srcL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\src -> Rte name cmt desc src links number typ extensions rtepts) src++instance LinksL Rte where+ linksL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\links -> Rte name cmt desc src links number typ extensions rtepts) links++instance NumberL Rte where+ numberL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\number -> Rte name cmt desc src links number typ extensions rtepts) number++instance TypeL Rte where+ typeL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\typ -> Rte name cmt desc src links number typ extensions rtepts) typ++instance ExtensionsL Rte where+ extensionsL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\extensions -> Rte name cmt desc src links number typ extensions rtepts) extensions++instance RteptsL Rte where+ rteptsL =+ Lens $ \(Rte name cmt desc src links number typ extensions rtepts) -> store (\rtepts -> Rte name cmt desc src links number typ extensions rtepts) rtepts++instance XmlPickler Rte where+ xpickle =+ xpWrap (\(a, b, c, d, e, f, g, h, i) -> rte a b c d e f g h i, \(Rte a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "cmt" xpText))+ (xpOption (xpElem "desc" xpText))+ (xpOption (xpElem "src" xpText))+ (xpList (xpElem "link" xpickle))+ (xpOption (xpElem "number" xpPrim))+ (xpOption (xpElem "type" xpText))+ (xpOption (xpElem "extensions" xpickle))+ (xpList (xpElem "rtept" xpickle)))+
+ src/Data/Geo/GPX/Type/Trk.hs view
@@ -0,0 +1,88 @@+-- | Complex Type: @trkType@ <http://www.topografix.com/GPX/1/1/#type_trkType>+module Data.Geo.GPX.Type.Trk(+ Trk+, trk+) where++import Data.Geo.GPX.Type.Trkseg+import Data.Geo.GPX.Type.Extensions+import Data.Geo.GPX.Type.Link+import Data.Geo.GPX.Lens.NameL+import Data.Geo.GPX.Lens.CmtL+import Data.Geo.GPX.Lens.DescL+import Data.Geo.GPX.Lens.SrcL+import Data.Geo.GPX.Lens.LinksL+import Data.Geo.GPX.Lens.NumberL+import Data.Geo.GPX.Lens.TypeL+import Data.Geo.GPX.Lens.ExtensionsL+import Data.Geo.GPX.Lens.TrksegsL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Trk = Trk (Maybe String) (Maybe String) (Maybe String) (Maybe String) [Link] (Maybe Int) (Maybe String) (Maybe Extensions) [Trkseg]+ deriving Eq++trk ::+ Maybe String -- ^ The name.+ -> Maybe String -- ^ The cmt.+ -> Maybe String -- ^ The desc.+ -> Maybe String -- ^ The src.+ -> [Link] -- ^ The links (link).+ -> Maybe Int -- ^ The number.+ -> Maybe String -- ^ The type.+ -> Maybe Extensions -- ^ The extensions.+ -> [Trkseg] -- ^ The track segments (trkseg).+ -> Trk+trk a b c d e f =+ Trk a b c d e (fmap abs f)++instance NameL Trk where+ nameL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\name -> Trk name cmt desc src links number typ extensions trksegs) name++instance CmtL Trk where+ cmtL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\cmt -> Trk name cmt desc src links number typ extensions trksegs) cmt++instance DescL Trk where+ descL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\desc -> Trk name cmt desc src links number typ extensions trksegs) desc++instance SrcL Trk where+ srcL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\src -> Trk name cmt desc src links number typ extensions trksegs) src++instance LinksL Trk where+ linksL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\links -> Trk name cmt desc src links number typ extensions trksegs) links++instance NumberL Trk where+ numberL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\number -> Trk name cmt desc src links number typ extensions trksegs) number++instance TypeL Trk where+ typeL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\typ -> Trk name cmt desc src links number typ extensions trksegs) typ++instance ExtensionsL Trk where+ extensionsL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\extensions -> Trk name cmt desc src links number typ extensions trksegs) extensions++instance TrksegsL Trk where+ trksegsL =+ Lens $ \(Trk name cmt desc src links number typ extensions trksegs) -> store (\trksegs -> Trk name cmt desc src links number typ extensions trksegs) trksegs++instance XmlPickler Trk where+ xpickle =+ xpWrap (\(a, b, c, d, e, f, g, h, i) -> trk a b c d e f g h i, \(Trk a b c d e f g h i) -> (a, b, c, d, e, f, g, h, i)) (xp9Tuple+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "cmt" xpText))+ (xpOption (xpElem "desc" xpText))+ (xpOption (xpElem "src" xpText))+ (xpList (xpElem "link" xpickle))+ (xpOption (xpElem "number" xpPrim))+ (xpOption (xpElem "type" xpText))+ (xpOption (xpElem "extensions" xpickle))+ (xpList (xpElem "trkseg" xpickle)))+
+ src/Data/Geo/GPX/Type/Trkseg.hs view
@@ -0,0 +1,38 @@+-- | Complex Type: @trksegType@ <http://www.topografix.com/GPX/1/1/#type_trksegType>+module Data.Geo.GPX.Type.Trkseg(+ Trkseg,+ trkseg+) where++import Data.Geo.GPX.Type.Wpt+import Data.Geo.GPX.Type.Extensions+import Data.Geo.GPX.Lens.TrkptsL+import Data.Geo.GPX.Lens.ExtensionsL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle++data Trkseg = Trkseg [Wpt] (Maybe Extensions)+ deriving Eq++trkseg ::+ [Wpt] -- ^ The track points (trkpt).+ -> Maybe Extensions -- ^ The extensions.+ -> Trkseg+trkseg =+ Trkseg++instance TrkptsL Trkseg where+ trkptsL =+ Lens $ \(Trkseg trkpts extensions) -> store (\trkpts -> Trkseg trkpts extensions) trkpts++instance ExtensionsL Trkseg where+ extensionsL =+ Lens $ \(Trkseg trkpts extensions) -> store (\extensions -> Trkseg trkpts extensions) extensions++instance XmlPickler Trkseg where+ xpickle =+ xpWrap (uncurry trkseg, \(Trkseg trkpt' extensions') -> (trkpt', extensions')) (xpPair+ (xpList (xpElem "trkpt" xpickle))+ (xpOption (xpElem "extensions" xpickle)))+
+ src/Data/Geo/GPX/Type/Wpt.hs view
@@ -0,0 +1,230 @@+-- | Complex Type: @wptType@ <http://www.topografix.com/GPX/1/1/#type_wptType>+module Data.Geo.GPX.Type.Wpt(+ Wpt+, wpt+, wpt'+) where++import Data.Geo.GPX.Type.Latitude+import Data.Geo.GPX.Type.Longitude+import Data.Geo.GPX.Type.Degrees+import Data.Geo.GPX.Type.Link+import Data.Geo.GPX.Type.Fix+import Data.Geo.GPX.Type.DgpsStation+import Data.Geo.GPX.Type.Extensions+import Data.Geo.GPX.Lens.LatL+import Data.Geo.GPX.Lens.LonL+import Data.Geo.GPX.Lens.EleL+import Data.Geo.GPX.Lens.TimeL+import Data.Geo.GPX.Lens.MagvarL+import Data.Geo.GPX.Lens.GeoidheightL+import Data.Geo.GPX.Lens.NameL+import Data.Geo.GPX.Lens.CmtL+import Data.Geo.GPX.Lens.DescL+import Data.Geo.GPX.Lens.SrcL+import Data.Geo.GPX.Lens.LinksL+import Data.Geo.GPX.Lens.SymL+import Data.Geo.GPX.Lens.TypeL+import Data.Geo.GPX.Lens.FixL+import Data.Geo.GPX.Lens.SatL+import Data.Geo.GPX.Lens.HdopL+import Data.Geo.GPX.Lens.VdopL+import Data.Geo.GPX.Lens.PdopL+import Data.Geo.GPX.Lens.AgeofdgpsdataL+import Data.Geo.GPX.Lens.DgpsidL+import Data.Geo.GPX.Lens.ExtensionsL+import Data.Lens.Common+import Control.Comonad.Trans.Store+import Text.XML.HXT.Arrow.Pickle+import Text.XML.XSD.DateTime++data Wpt =+ Wpt+ Latitude+ Longitude+ (Maybe Double)+ (Maybe DateTime)+ (Maybe Degrees)+ (Maybe Double)+ (Maybe String)+ (Maybe String)+ (Maybe String)+ (Maybe String)+ [Link]+ (Maybe String)+ (Maybe String)+ (Maybe Fix)+ (Maybe Int)+ (Maybe Double)+ (Maybe Double)+ (Maybe Double)+ (Maybe Double)+ (Maybe DgpsStation)+ (Maybe Extensions)+ deriving Eq++wpt ::+ Latitude -- ^ The lat.+ -> Longitude -- ^ The lon.+ -> Maybe Double -- ^ The ele.+ -> Maybe DateTime -- ^ The time.+ -> Maybe Degrees -- ^ The magvar.+ -> Maybe Double -- ^ The geoidheight.+ -> Maybe String -- ^ The name.+ -> Maybe String -- ^ The cmt.+ -> Maybe String -- ^ The desc.+ -> Maybe String -- ^ The src.+ -> [Link] -- ^ The links (link).+ -> Maybe String -- ^ The sym.+ -> Maybe String -- ^ The type.+ -> Maybe Fix -- ^ The fix.+ -> Maybe Int -- ^ The sat.+ -> Maybe Double -- ^ The hdop.+ -> Maybe Double -- ^ The vdop.+ -> Maybe Double -- ^ The pdop.+ -> Maybe Double -- ^ The ageofdgpsdata.+ -> Maybe DgpsStation -- ^ The dgpsid.+ -> Maybe Extensions -- ^ The extensions.+ -> Wpt+wpt a b c d e f g h i j k l m n o p =+ Wpt a b c d e f g h i j k l m n o (fmap abs p)++-- | A waypoint with only a latitude and longitude.+wpt' ::+ Latitude -- ^ The lat.+ -> Longitude -- ^ The lon.+ -> Wpt+wpt' lat' lon' =+ wpt+ lat'+ lon'+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ []+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing+ Nothing++instance LatL Wpt where+ latL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\lat -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) lat++instance LonL Wpt where+ lonL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\lon -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) lon++instance EleL Wpt where+ eleL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\ele -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) ele++instance TimeL Wpt where+ timeL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\time -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) time++instance MagvarL Wpt where+ magvarL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\magvar -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) magvar++instance GeoidheightL Wpt where+ geoidheightL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\geoidheight -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) geoidheight++instance NameL Wpt where+ nameL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\name -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) name++instance CmtL Wpt where+ cmtL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\cmt -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) cmt++instance DescL Wpt where+ descL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\desc -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) desc++instance SrcL Wpt where+ srcL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\src -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) src++instance LinksL Wpt where+ linksL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\links -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) links++instance SymL Wpt where+ symL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\sym -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) sym++instance TypeL Wpt where+ typeL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\typ -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) typ++instance FixL Wpt where+ fixL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\fix -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) fix++instance SatL Wpt where+ satL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\sat -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) sat++instance HdopL Wpt where+ hdopL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\hdop -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) hdop++instance VdopL Wpt where+ vdopL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\vdop -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) vdop++instance PdopL Wpt where+ pdopL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\pdop -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) pdop++instance AgeofdgpsdataL Wpt where+ ageofdgpsdataL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\ageofdgpsdata -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) ageofdgpsdata++instance DgpsidL Wpt where+ dgpsidL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\dgpsid -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) dgpsid++instance ExtensionsL Wpt where+ extensionsL =+ Lens $ \(Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) -> store (\extensions -> Wpt lat lon ele time magvar geoidheight name cmt desc src links sym typ fix sat hdop vdop pdop ageofdgpsdata dgpsid extensions) extensions++instance XmlPickler Wpt where+ xpickle =+ xpWrap (\(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) -> wpt a b c d e f g h i j k l m n o p q r s t u,+ \(Wpt a b c d e f g h i j k l m n o p q r s t u) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u)) (xp21Tuple+ (xpAttr "lat" xpickle)+ (xpAttr "lon" xpickle)+ (xpOption (xpElem "ele" xpPrim))+ (xpOption (xpElem "time" (xpWrapMaybe (dateTime, show) xpText)))+ (xpOption (xpElem "magvar" xpickle))+ (xpOption (xpElem "geoidheight" xpPrim))+ (xpOption (xpElem "name" xpText))+ (xpOption (xpElem "cmt" xpText))+ (xpOption (xpElem "desc" xpText))+ (xpOption (xpElem "src" xpText))+ (xpList (xpElem "link" xpickle))+ (xpOption (xpElem "sym" xpText))+ (xpOption (xpElem "type" xpText))+ (xpOption (xpElem "fix" xpickle))+ (xpOption (xpElem "sat" xpPrim))+ (xpOption (xpElem "hdop" xpPrim))+ (xpOption (xpElem "vdop" xpPrim))+ (xpOption (xpElem "pdop" xpPrim))+ (xpOption (xpElem "ageofdgpsdata" xpPrim))+ (xpOption (xpElem "dgpsid" xpickle))+ (xpOption (xpElem "extensions" xpickle)))+