souplesse

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 7cfe6b48921cdf075b5a1e37ad20a1fb8ed05296
parent 6099753702497dabc35a2d284eac310e0b98dc10
Author: Daniel Barlow <dan@telent.net>
Date:   Tue, 29 Oct 2024 19:35:17 +0000

remove comments and debug output

Diffstat:
Mlib/Track.hs | 23++++-------------------
1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/lib/Track.hs b/lib/Track.hs @@ -10,11 +10,9 @@ module Track ( ) where import Data.Time import qualified Data.List --- import qualified Text.XML as X import Text.XML import Text.XML.Cursor as Cursor import qualified Data.Text --- import qualified Data.Text.Lazy import Data.Text.Lazy as T import Debug.Trace (trace, traceShow) import Data.List as List @@ -22,8 +20,6 @@ import Data.Map as Map import Control.Exception data Pos = Pos Float Float deriving (Show, Eq) - - type Power = Maybe Int type Cadence = Maybe Int type HeartRate = Maybe Int @@ -37,6 +33,7 @@ data Point = Point { heartRate :: HeartRate } deriving (Show) +-- TODO do we even need this type? type Track = [Point] mkPoint pos = @@ -48,23 +45,12 @@ mkPoint pos = (Just 0) (Just 0) -parse' str = [ - Point - (Pos 51.6 0) - (Just 0) - (UTCTime (toEnum 60631) 43200) - (Just 0) - (Just 0) - (Just 0) - ] - elToPoint :: Cursor -> Point elToPoint n = - trace "el" $ - case traceShow (node n) (node n) of + case node n of NodeElement (Element _ attrs _) -> let - lat = traceShow (getAttr "lat") (getAttr "lat") + lat = getAttr "lat" lon = getAttr "lon" in mkPoint (Pos lat lon) where getAttr name = @@ -78,7 +64,6 @@ getPoints c = let trkpts = child c >>= - -- element "gpx" >>= child >>= element "trk" >>= descendant >>= element "trkpt" in @@ -93,7 +78,7 @@ parse str = Right gpx -> let points = getPoints $ fromDocument gpx - in traceShow "(gpx)" (Right points) + in Right points Left err -> Left err