souplesse

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

commit 10c7d68f31d22bee05bfeb2552171a2578ce261f
parent 63f54a93556776f066ae8007974f7abeacbeb06f
Author: Daniel Barlow <dan@telent.net>
Date:   Thu, 31 Oct 2024 13:20:16 +0000

extract function for gpxtpx extensions

Diffstat:
Mlib/Track.hs | 21++++++---------------
1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/lib/Track.hs b/lib/Track.hs @@ -74,21 +74,12 @@ elToPoint c = >>= child >>= element (tpxNS "TrackPointExtension") >>= child - cadence = - gpxtpx - >>= element (tpxNS "cad") - >>= child - >>= content - hr = - gpxtpx - >>= element (tpxNS "hr") - >>= child - >>= content - power = - gpxtpx - >>= element (Name "PowerInWatts" (Just "http://www.garmin.com/xmlschemas/PowerExtension/v1") Nothing) - >>= child - >>= content + extn n = + gpxtpx >>= element n >>= child >>= content + + cadence = extn (tpxNS "cad") + hr = extn (tpxNS "hr") + power = extn "{http://www.garmin.com/xmlschemas/PowerExtension/v1}PowerInWatts" parsedTime = listToMaybe ts >>= (Data.Time.ISO8601.parseISO8601 . Data.Text.unpack)