Compare commits

..

No commits in common. "7af52b4fbfd953cd1ed659d09232cfa5c7dbed6f" and "e15c42ff4a274db387e0af843c226f1e59021bb9" have entirely different histories.

2 changed files with 5 additions and 6 deletions

View File

@ -59,5 +59,5 @@ _Do not look below this line_
* do we even need Track? will it ever be anything more than a collection
of Points?
* [done] need a real gpx file with namespace decls before we can parse power and stuff
* [done] tests seem to pass without <gpx> element?
* [done] stop returning bogus data when missing required elements (e.g. time)
* tests seem to pass without <gpx> element?
* stop returning bogus data when missing required elements (e.g. time)

View File

@ -25,7 +25,6 @@ import Data.Time.ISO8601 qualified
import Debug.Trace (trace, traceShow)
import Text.XML
import Text.XML.Cursor as Cursor
import Data.Functor((<&>))
data Pos = Pos Float Float deriving (Show, Eq)
@ -92,10 +91,10 @@ elToPoint c =
Right $
Point
(Pos lat lon)
(listToMaybe ele <&> asFloat)
(listToMaybe ele >>= return . asFloat)
utime
(listToMaybe cadence <&> asInt)
(listToMaybe power <&> asInt)
(listToMaybe cadence >>= return . asInt)
(listToMaybe power >>= return . asInt)
Nothing
where
asFloat v = (read (Data.Text.unpack v) :: Float)