influxdb-0.1.0: Haskell client library for InfluxDB

Safe HaskellNone

Database.InfluxDB.Decode

Synopsis

Documentation

class FromSeries a whereSource

A type that can be converted from a Series.

fromSeries :: FromSeries a => Series -> Either String aSource

Converte a value from a Series, failing if the types do not match.

class FromSeriesData a whereSource

A type that can be converted from a SeriesData. A typical implementation is as follows.

 import Control.Applicative ((<$>), (<*>))
 import qualified Data.Vector as V

 data Event = Event Text EventType
 data EventType = Login | Logout

 instance FromSeriesData where
   parseSeriesData = withValues $ \values -> Event
     <$> values .: "user"
     <*> values .: "type"

 instance FromValue EventType

fromSeriesData :: FromSeriesData a => SeriesData -> Either String [a]Source

Converte a value from a SeriesData, failing if the types do not match.

class FromValue a whereSource

A type that can be converted from a Value.

fromValue :: FromValue a => Value -> Either String aSource

Converte a value from a Value, failing if the types do not match.