tfausak / strive

:bicyclist: A Haskell client for the Strava V3 API.

Home Page:https://hackage.haskell.org/package/strive

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support decoding streams

tfausak opened this issue · comments

Currently streams are returned as Values. That's not too useful. I should support decoding them according to their type.

http://strava.github.io/api/v3/streams/#stream-types

This is a continuation of #31, #32, and #33.

This is roughly what they might look like:

type TimeStreamData           = [Integer]
type LatlngStreamData         = [(Double, Double)]
type DistanceStreamData       = [Double]
type AltitudeStreamData       = [Double]
type VelocitySmoothStreamData = [Double]
type HeartrateStreamData      = [Integer]
type CadenceStreamData        = [Integer]
type WattsStreamData          = [Integer]
type TempStreamData           = [Integer]
type MovingStreamData         = [Bool]
type GradeSmoothStreamData    = [Double]

http://strava.github.io/api/v3/streams/#parameters

if the activity does not have that stream it will not be included in the response

I don't think it's possible to know ahead the type of the streams coming back. It's going to have to be up to the user to convert the Values into something useful.