Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class ToSeries a where
- class ToSeriesData a where
- toSeriesData :: forall a. ToSeriesData a => a -> SeriesData
- class ToValue a where
Documentation
class ToSeriesData a where Source #
A type that can be converted to a SeriesData
. A typical implementation is
as follows.
import qualified Data.Vector as V data Event = Event Text EventType data EventType = Login | Logout instance ToSeriesData Event where toSeriesColumns _ = V.fromList ["user", "type"] toSeriesPoints (Event user ty) = V.fromList [toValue user, toValue ty] instance ToValue EventType
toSeriesData :: forall a. ToSeriesData a => a -> SeriesData Source #
class ToValue a where Source #
A type that can be stored in InfluxDB.