influxdb-1.6.0.5: Haskell client library for InfluxDB

Safe HaskellNone
LanguageHaskell2010

Database.InfluxDB.Query

Contents

Synopsis

Query interface

data Query Source #

An InfluxDB query.

A spec of the format is available at https://docs.influxdata.com/influxdb/v1.5/query_language/spec/.

A Query can be constructed using either

>>> :set -XOverloadedStrings
>>> "SELECT * FROM series" :: Query
"SELECT * FROM series"
>>> import qualified Database.InfluxDB.Format as F
>>> formatQuery ("SELECT * FROM "%F.key) "series"
"SELECT * FROM \"series\""

NOTE: Currently this library doesn't support type-safe query construction.

query :: QueryResults a => QueryParams -> Query -> IO (Vector a) Source #

Query data from InfluxDB.

It may throw InfluxException.

If you need a lower-level interface (e.g. to bypass the QueryResults constraint etc), see withQueryResponse.

queryChunked Source #

Arguments

:: QueryResults a 
=> QueryParams 
-> Optional Int

Chunk size

By Default, InfluxDB chunks responses by series or by every 10,000 points, whichever occurs first. If it set to a Specific value, InfluxDB chunks responses by series or by that number of points.

-> Query 
-> FoldM IO (Vector a) r 
-> IO r 

Same as query but it instructs InfluxDB to stream chunked responses rather than returning a huge JSON object. This can be lot more efficient than query if the result is huge.

It may throw InfluxException.

If you need a lower-level interface (e.g. to bypass the QueryResults constraint etc), see withQueryResponse.

Query parameters

data QueryParams Source #

The full set of parameters for the query API

Instances

HasCredentials QueryParams Source #

Authentication info for the query

>>> let p = queryParams "foo"
>>> p ^. authentication
Nothing
>>> let p' = p & authentication ?~ credentials "john" "passw0rd"
>>> p' ^. authentication.traverse.user
"john"
HasManager QueryParams Source #
>>> let p = queryParams "foo" & manager .~ Left HC.defaultManagerSettings
HasDatabase QueryParams Source #
>>> let p = queryParams "foo"
>>> p ^. database
"foo"
HasServer QueryParams Source #
>>> let p = queryParams "foo"
>>> p ^. server.host
"localhost"
HasPrecision QueryRequest QueryParams Source #

Returning JSON responses contain timestamps in the specified precision/format.

>>> let p = queryParams "foo"
>>> p ^. precision
RFC3339

server :: HasServer a => Lens' a Server Source #

InfluxDB server address and port that to interact with.

database :: HasDatabase a => Lens' a Database Source #

Database name to work on.

precision :: HasPrecision ty a => Lens' a (Precision ty) Source #

Time precision parameter.

manager :: HasManager a => Lens' a (Either ManagerSettings Manager) Source #

HTTP manager settings or a manager itself.

If it's set to ManagerSettings, the library will create a Manager from the settings for you.

Parsing results

class QueryResults a where Source #

Types that can be converted from an JSON object returned by InfluxDB.

For example the h2o_feet series in the official document can be encoded as follows:

>>> :{
data H2OFeet = H2OFeet
  { time :: UTCTime
  , levelDesc :: T.Text
  , location :: T.Text
  , waterLevel :: Double
  }
instance QueryResults H2OFeet where
  parseResults prec = parseResultsWith $ \_ _ columns fields -> do
    time <- getField "time" columns fields >>= parseUTCTime prec
    levelDesc <- getField "level_description" columns fields >>= parseJSON
    location <- getField "location" columns fields >>= parseJSON
    waterLevel <- getField "water_level" columns fields >>= parseJSON
    return H2OFeet {..}
:}

Minimal complete definition

parseResults

Methods

parseResults :: Precision QueryRequest -> Value -> Parser (Vector a) Source #

Parse a JSON object as an array of values of expected type.

Instances

QueryResults Void Source # 
QueryResults ShowSeries Source # 
QueryResults ShowQuery Source # 
(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2) Source #

One-off tuple for sigle-field measurements

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3) Source #

One-off tuple for two-field measurements

(KnownSymbol k, FromJSON v) => QueryResults (Tagged Symbol k v) Source #

One-off type for non-timestamped measurements

>>> let p = queryParams "_internal"
>>> dbs <- query p "SHOW DATABASES" :: IO (V.Vector (Tagged "name" T.Text))
>>> find ((== "_internal") . untag) dbs
Just (Tagged "_internal")
(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4) Source #

One-off tuple for three-field measurements

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4, KnownSymbol k5, FromJSON v5) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4, Tagged Symbol k5 v5) Source #

One-off tuple for four-field measurements

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4, KnownSymbol k5, FromJSON v5, KnownSymbol k6, FromJSON v6) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4, Tagged Symbol k5 v5, Tagged Symbol k6 v6) Source #

One-off tuple for five-field measurements

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4, KnownSymbol k5, FromJSON v5, KnownSymbol k6, FromJSON v6, KnownSymbol k7, FromJSON v7) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4, Tagged Symbol k5 v5, Tagged Symbol k6 v6, Tagged Symbol k7 v7) Source #

One-off tuple for six-field measurement

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4, KnownSymbol k5, FromJSON v5, KnownSymbol k6, FromJSON v6, KnownSymbol k7, FromJSON v7, KnownSymbol k8, FromJSON v8) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4, Tagged Symbol k5 v5, Tagged Symbol k6 v6, Tagged Symbol k7 v7, Tagged Symbol k8 v8) Source #

One-off tuple for seven-field measurements

parseResultsWith Source #

Arguments

:: (Maybe Text -> HashMap Text Text -> Vector Text -> Array -> Parser a)

A parser that takes

  1. an optional name of the series
  2. a map of tags
  3. an array of field names
  4. an array of values

to construct a value.

-> Value 
-> Parser (Vector a) 

Parse a JSON response with the lenientDecoder. This can be useful to implement the parseResults method.

Low-level functions

withQueryResponse Source #

Arguments

:: QueryParams 
-> Maybe (Optional Int)

Chunk size

By Nothing, InfluxDB returns all matching data points at once. By Just Default, InfluxDB chunks responses by series or by every 10,000 points, whichever occurs first. If it set to a Specific value, InfluxDB chunks responses by series or by that number of points.

-> Query 
-> (Request -> Response BodyReader -> IO r) 
-> IO r 

Lower-level interface to query data.

Re-exports from tagged

newtype Tagged k (s :: k) b :: forall k. k -> * -> * #

A Tagged s b value is a value b with an attached phantom type s. This can be used in place of the more traditional but less safe idiom of passing in an undefined value with the type, because unlike an (s -> b), a Tagged s b can't try to use the argument s as a real value.

Moreover, you don't have to rely on the compiler to inline away the extra argument, because the newtype is "free"

Tagged has kind k -> * -> * if the compiler supports PolyKinds, therefore there is an extra k showing in the instance haddocks that may cause confusion.

Constructors

Tagged 

Fields

Instances

ToJSON2 (Tagged *) 

Methods

liftToJSON2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> Tagged * a b -> Value #

liftToJSONList2 :: (a -> Value) -> ([a] -> Value) -> (b -> Value) -> ([b] -> Value) -> [Tagged * a b] -> Value #

liftToEncoding2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> Tagged * a b -> Encoding #

liftToEncodingList2 :: (a -> Encoding) -> ([a] -> Encoding) -> (b -> Encoding) -> ([b] -> Encoding) -> [Tagged * a b] -> Encoding #

FromJSON2 (Tagged *) 

Methods

liftParseJSON2 :: (Value -> Parser a) -> (Value -> Parser [a]) -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser (Tagged * a b) #

liftParseJSONList2 :: (Value -> Parser a) -> (Value -> Parser [a]) -> (Value -> Parser b) -> (Value -> Parser [b]) -> Value -> Parser [Tagged * a b] #

Bitraversable (Tagged *) 

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Tagged * a b -> f (Tagged * c d) #

Bifoldable (Tagged *) 

Methods

bifold :: Monoid m => Tagged * m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Tagged * a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Tagged * a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Tagged * a b -> c #

Bifunctor (Tagged *) 

Methods

bimap :: (a -> b) -> (c -> d) -> Tagged * a c -> Tagged * b d #

first :: (a -> b) -> Tagged * a c -> Tagged * b c #

second :: (b -> c) -> Tagged * a b -> Tagged * a c #

Eq2 (Tagged *) 

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Tagged * a c -> Tagged * b d -> Bool #

Ord2 (Tagged *) 

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Tagged * a c -> Tagged * b d -> Ordering #

Read2 (Tagged *) 

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Tagged * a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Tagged * a b] #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Tagged * a b) #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Tagged * a b] #

Show2 (Tagged *) 

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Tagged * a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Tagged * a b] -> ShowS #

Corepresentable (Tagged *) 

Associated Types

type Corep (Tagged * :: * -> * -> *) :: * -> * #

Methods

cotabulate :: (Corep (Tagged *) d -> c) -> Tagged * d c #

Profunctor (Tagged *) 

Methods

dimap :: (a -> b) -> (c -> d) -> Tagged * b c -> Tagged * a d #

lmap :: (a -> b) -> Tagged * b c -> Tagged * a c #

rmap :: (b -> c) -> Tagged * a b -> Tagged * a c #

(#.) :: Coercible * c b => (b -> c) -> Tagged * a b -> Tagged * a c #

(.#) :: Coercible * b a => Tagged * b c -> (a -> b) -> Tagged * a c #

Generic1 * (Tagged k s) 

Associated Types

type Rep1 (Tagged k s) (f :: Tagged k s -> *) :: k -> * #

Methods

from1 :: f a -> Rep1 (Tagged k s) f a #

to1 :: Rep1 (Tagged k s) f a -> f a #

Monad (Tagged k s) 

Methods

(>>=) :: Tagged k s a -> (a -> Tagged k s b) -> Tagged k s b #

(>>) :: Tagged k s a -> Tagged k s b -> Tagged k s b #

return :: a -> Tagged k s a #

fail :: String -> Tagged k s a #

Functor (Tagged k s) 

Methods

fmap :: (a -> b) -> Tagged k s a -> Tagged k s b #

(<$) :: a -> Tagged k s b -> Tagged k s a #

Applicative (Tagged k s) 

Methods

pure :: a -> Tagged k s a #

(<*>) :: Tagged k s (a -> b) -> Tagged k s a -> Tagged k s b #

liftA2 :: (a -> b -> c) -> Tagged k s a -> Tagged k s b -> Tagged k s c #

(*>) :: Tagged k s a -> Tagged k s b -> Tagged k s b #

(<*) :: Tagged k s a -> Tagged k s b -> Tagged k s a #

Foldable (Tagged k s) 

Methods

fold :: Monoid m => Tagged k s m -> m #

foldMap :: Monoid m => (a -> m) -> Tagged k s a -> m #

foldr :: (a -> b -> b) -> b -> Tagged k s a -> b #

foldr' :: (a -> b -> b) -> b -> Tagged k s a -> b #

foldl :: (b -> a -> b) -> b -> Tagged k s a -> b #

foldl' :: (b -> a -> b) -> b -> Tagged k s a -> b #

foldr1 :: (a -> a -> a) -> Tagged k s a -> a #

foldl1 :: (a -> a -> a) -> Tagged k s a -> a #

toList :: Tagged k s a -> [a] #

null :: Tagged k s a -> Bool #

length :: Tagged k s a -> Int #

elem :: Eq a => a -> Tagged k s a -> Bool #

maximum :: Ord a => Tagged k s a -> a #

minimum :: Ord a => Tagged k s a -> a #

sum :: Num a => Tagged k s a -> a #

product :: Num a => Tagged k s a -> a #

Traversable (Tagged k s) 

Methods

traverse :: Applicative f => (a -> f b) -> Tagged k s a -> f (Tagged k s b) #

sequenceA :: Applicative f => Tagged k s (f a) -> f (Tagged k s a) #

mapM :: Monad m => (a -> m b) -> Tagged k s a -> m (Tagged k s b) #

sequence :: Monad m => Tagged k s (m a) -> m (Tagged k s a) #

Representable (Tagged * t) 

Associated Types

type Rep (Tagged * t :: * -> *) :: * #

Methods

tabulate :: (Rep (Tagged * t) -> a) -> Tagged * t a #

index :: Tagged * t a -> Rep (Tagged * t) -> a #

ToJSON1 (Tagged k a) 

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Tagged k a a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Tagged k a a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Tagged k a a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Tagged k a a] -> Encoding #

FromJSON1 (Tagged k a) 

Methods

liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (Tagged k a a) #

liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [Tagged k a a] #

Eq1 (Tagged k s) 

Methods

liftEq :: (a -> b -> Bool) -> Tagged k s a -> Tagged k s b -> Bool #

Ord1 (Tagged k s) 

Methods

liftCompare :: (a -> b -> Ordering) -> Tagged k s a -> Tagged k s b -> Ordering #

Read1 (Tagged k s) 

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Tagged k s a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Tagged k s a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Tagged k s a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Tagged k s a] #

Show1 (Tagged k s) 

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Tagged k s a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Tagged k s a] -> ShowS #

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2) Source #

One-off tuple for sigle-field measurements

Bounded b => Bounded (Tagged k s b) 

Methods

minBound :: Tagged k s b #

maxBound :: Tagged k s b #

Enum a => Enum (Tagged k s a) 

Methods

succ :: Tagged k s a -> Tagged k s a #

pred :: Tagged k s a -> Tagged k s a #

toEnum :: Int -> Tagged k s a #

fromEnum :: Tagged k s a -> Int #

enumFrom :: Tagged k s a -> [Tagged k s a] #

enumFromThen :: Tagged k s a -> Tagged k s a -> [Tagged k s a] #

enumFromTo :: Tagged k s a -> Tagged k s a -> [Tagged k s a] #

enumFromThenTo :: Tagged k s a -> Tagged k s a -> Tagged k s a -> [Tagged k s a] #

Eq b => Eq (Tagged k s b) 

Methods

(==) :: Tagged k s b -> Tagged k s b -> Bool #

(/=) :: Tagged k s b -> Tagged k s b -> Bool #

Floating a => Floating (Tagged k s a) 

Methods

pi :: Tagged k s a #

exp :: Tagged k s a -> Tagged k s a #

log :: Tagged k s a -> Tagged k s a #

sqrt :: Tagged k s a -> Tagged k s a #

(**) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

logBase :: Tagged k s a -> Tagged k s a -> Tagged k s a #

sin :: Tagged k s a -> Tagged k s a #

cos :: Tagged k s a -> Tagged k s a #

tan :: Tagged k s a -> Tagged k s a #

asin :: Tagged k s a -> Tagged k s a #

acos :: Tagged k s a -> Tagged k s a #

atan :: Tagged k s a -> Tagged k s a #

sinh :: Tagged k s a -> Tagged k s a #

cosh :: Tagged k s a -> Tagged k s a #

tanh :: Tagged k s a -> Tagged k s a #

asinh :: Tagged k s a -> Tagged k s a #

acosh :: Tagged k s a -> Tagged k s a #

atanh :: Tagged k s a -> Tagged k s a #

log1p :: Tagged k s a -> Tagged k s a #

expm1 :: Tagged k s a -> Tagged k s a #

log1pexp :: Tagged k s a -> Tagged k s a #

log1mexp :: Tagged k s a -> Tagged k s a #

Fractional a => Fractional (Tagged k s a) 

Methods

(/) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

recip :: Tagged k s a -> Tagged k s a #

fromRational :: Rational -> Tagged k s a #

Integral a => Integral (Tagged k s a) 

Methods

quot :: Tagged k s a -> Tagged k s a -> Tagged k s a #

rem :: Tagged k s a -> Tagged k s a -> Tagged k s a #

div :: Tagged k s a -> Tagged k s a -> Tagged k s a #

mod :: Tagged k s a -> Tagged k s a -> Tagged k s a #

quotRem :: Tagged k s a -> Tagged k s a -> (Tagged k s a, Tagged k s a) #

divMod :: Tagged k s a -> Tagged k s a -> (Tagged k s a, Tagged k s a) #

toInteger :: Tagged k s a -> Integer #

(Data s, Data b) => Data (Tagged * s b) 

Methods

gfoldl :: (forall d a. Data d => c (d -> a) -> d -> c a) -> (forall g. g -> c g) -> Tagged * s b -> c (Tagged * s b) #

gunfold :: (forall a r. Data a => c (a -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tagged * s b) #

toConstr :: Tagged * s b -> Constr #

dataTypeOf :: Tagged * s b -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Tagged * s b)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tagged * s b)) #

gmapT :: (forall a. Data a => a -> a) -> Tagged * s b -> Tagged * s b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tagged * s b -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tagged * s b -> r #

gmapQ :: (forall d. Data d => d -> u) -> Tagged * s b -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Tagged * s b -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tagged * s b -> m (Tagged * s b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged * s b -> m (Tagged * s b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tagged * s b -> m (Tagged * s b) #

Num a => Num (Tagged k s a) 

Methods

(+) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

(-) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

(*) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

negate :: Tagged k s a -> Tagged k s a #

abs :: Tagged k s a -> Tagged k s a #

signum :: Tagged k s a -> Tagged k s a #

fromInteger :: Integer -> Tagged k s a #

Ord b => Ord (Tagged k s b) 

Methods

compare :: Tagged k s b -> Tagged k s b -> Ordering #

(<) :: Tagged k s b -> Tagged k s b -> Bool #

(<=) :: Tagged k s b -> Tagged k s b -> Bool #

(>) :: Tagged k s b -> Tagged k s b -> Bool #

(>=) :: Tagged k s b -> Tagged k s b -> Bool #

max :: Tagged k s b -> Tagged k s b -> Tagged k s b #

min :: Tagged k s b -> Tagged k s b -> Tagged k s b #

Read b => Read (Tagged k s b) 

Methods

readsPrec :: Int -> ReadS (Tagged k s b) #

readList :: ReadS [Tagged k s b] #

readPrec :: ReadPrec (Tagged k s b) #

readListPrec :: ReadPrec [Tagged k s b] #

Real a => Real (Tagged k s a) 

Methods

toRational :: Tagged k s a -> Rational #

RealFloat a => RealFloat (Tagged k s a) 

Methods

floatRadix :: Tagged k s a -> Integer #

floatDigits :: Tagged k s a -> Int #

floatRange :: Tagged k s a -> (Int, Int) #

decodeFloat :: Tagged k s a -> (Integer, Int) #

encodeFloat :: Integer -> Int -> Tagged k s a #

exponent :: Tagged k s a -> Int #

significand :: Tagged k s a -> Tagged k s a #

scaleFloat :: Int -> Tagged k s a -> Tagged k s a #

isNaN :: Tagged k s a -> Bool #

isInfinite :: Tagged k s a -> Bool #

isDenormalized :: Tagged k s a -> Bool #

isNegativeZero :: Tagged k s a -> Bool #

isIEEE :: Tagged k s a -> Bool #

atan2 :: Tagged k s a -> Tagged k s a -> Tagged k s a #

RealFrac a => RealFrac (Tagged k s a) 

Methods

properFraction :: Integral b => Tagged k s a -> (b, Tagged k s a) #

truncate :: Integral b => Tagged k s a -> b #

round :: Integral b => Tagged k s a -> b #

ceiling :: Integral b => Tagged k s a -> b #

floor :: Integral b => Tagged k s a -> b #

Show b => Show (Tagged k s b) 

Methods

showsPrec :: Int -> Tagged k s b -> ShowS #

show :: Tagged k s b -> String #

showList :: [Tagged k s b] -> ShowS #

Ix b => Ix (Tagged k s b) 

Methods

range :: (Tagged k s b, Tagged k s b) -> [Tagged k s b] #

index :: (Tagged k s b, Tagged k s b) -> Tagged k s b -> Int #

unsafeIndex :: (Tagged k s b, Tagged k s b) -> Tagged k s b -> Int

inRange :: (Tagged k s b, Tagged k s b) -> Tagged k s b -> Bool #

rangeSize :: (Tagged k s b, Tagged k s b) -> Int #

unsafeRangeSize :: (Tagged k s b, Tagged k s b) -> Int

IsString a => IsString (Tagged k s a) 

Methods

fromString :: String -> Tagged k s a #

Generic (Tagged k s b) 

Associated Types

type Rep (Tagged k s b) :: * -> * #

Methods

from :: Tagged k s b -> Rep (Tagged k s b) x #

to :: Rep (Tagged k s b) x -> Tagged k s b #

Semigroup a => Semigroup (Tagged k s a) 

Methods

(<>) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

sconcat :: NonEmpty (Tagged k s a) -> Tagged k s a #

stimes :: Integral b => b -> Tagged k s a -> Tagged k s a #

(Semigroup a, Monoid a) => Monoid (Tagged k s a) 

Methods

mempty :: Tagged k s a #

mappend :: Tagged k s a -> Tagged k s a -> Tagged k s a #

mconcat :: [Tagged k s a] -> Tagged k s a #

ToJSON b => ToJSON (Tagged k a b) 

Methods

toJSON :: Tagged k a b -> Value #

toEncoding :: Tagged k a b -> Encoding #

toJSONList :: [Tagged k a b] -> Value #

toEncodingList :: [Tagged k a b] -> Encoding #

ToJSONKey b => ToJSONKey (Tagged k a b) 
FromJSON b => FromJSON (Tagged k a b) 

Methods

parseJSON :: Value -> Parser (Tagged k a b) #

parseJSONList :: Value -> Parser [Tagged k a b] #

FromJSONKey b => FromJSONKey (Tagged k a b) 
Storable a => Storable (Tagged k s a) 

Methods

sizeOf :: Tagged k s a -> Int #

alignment :: Tagged k s a -> Int #

peekElemOff :: Ptr (Tagged k s a) -> Int -> IO (Tagged k s a) #

pokeElemOff :: Ptr (Tagged k s a) -> Int -> Tagged k s a -> IO () #

peekByteOff :: Ptr b -> Int -> IO (Tagged k s a) #

pokeByteOff :: Ptr b -> Int -> Tagged k s a -> IO () #

peek :: Ptr (Tagged k s a) -> IO (Tagged k s a) #

poke :: Ptr (Tagged k s a) -> Tagged k s a -> IO () #

Bits a => Bits (Tagged k s a) 

Methods

(.&.) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

(.|.) :: Tagged k s a -> Tagged k s a -> Tagged k s a #

xor :: Tagged k s a -> Tagged k s a -> Tagged k s a #

complement :: Tagged k s a -> Tagged k s a #

shift :: Tagged k s a -> Int -> Tagged k s a #

rotate :: Tagged k s a -> Int -> Tagged k s a #

zeroBits :: Tagged k s a #

bit :: Int -> Tagged k s a #

setBit :: Tagged k s a -> Int -> Tagged k s a #

clearBit :: Tagged k s a -> Int -> Tagged k s a #

complementBit :: Tagged k s a -> Int -> Tagged k s a #

testBit :: Tagged k s a -> Int -> Bool #

bitSizeMaybe :: Tagged k s a -> Maybe Int #

bitSize :: Tagged k s a -> Int #

isSigned :: Tagged k s a -> Bool #

shiftL :: Tagged k s a -> Int -> Tagged k s a #

unsafeShiftL :: Tagged k s a -> Int -> Tagged k s a #

shiftR :: Tagged k s a -> Int -> Tagged k s a #

unsafeShiftR :: Tagged k s a -> Int -> Tagged k s a #

rotateL :: Tagged k s a -> Int -> Tagged k s a #

rotateR :: Tagged k s a -> Int -> Tagged k s a #

popCount :: Tagged k s a -> Int #

FiniteBits a => FiniteBits (Tagged k s a) 

Methods

finiteBitSize :: Tagged k s a -> Int #

countLeadingZeros :: Tagged k s a -> Int #

countTrailingZeros :: Tagged k s a -> Int #

NFData b => NFData (Tagged k s b) 

Methods

rnf :: Tagged k s b -> () #

Wrapped (Tagged k s a) 

Associated Types

type Unwrapped (Tagged k s a) :: * #

Methods

_Wrapped' :: Iso' (Tagged k s a) (Unwrapped (Tagged k s a)) #

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3) Source #

One-off tuple for two-field measurements

(KnownSymbol k, FromJSON v) => QueryResults (Tagged Symbol k v) Source #

One-off type for non-timestamped measurements

>>> let p = queryParams "_internal"
>>> dbs <- query p "SHOW DATABASES" :: IO (V.Vector (Tagged "name" T.Text))
>>> find ((== "_internal") . untag) dbs
Just (Tagged "_internal")
(~) * t (Tagged k2 s' a') => Rewrapped (Tagged k1 s a) t 
(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4) Source #

One-off tuple for three-field measurements

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4, KnownSymbol k5, FromJSON v5) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4, Tagged Symbol k5 v5) Source #

One-off tuple for four-field measurements

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4, KnownSymbol k5, FromJSON v5, KnownSymbol k6, FromJSON v6) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4, Tagged Symbol k5 v5, Tagged Symbol k6 v6) Source #

One-off tuple for five-field measurements

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4, KnownSymbol k5, FromJSON v5, KnownSymbol k6, FromJSON v6, KnownSymbol k7, FromJSON v7) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4, Tagged Symbol k5 v5, Tagged Symbol k6 v6, Tagged Symbol k7 v7) Source #

One-off tuple for six-field measurement

(KnownSymbol k1, FromJSON v1, KnownSymbol k2, FromJSON v2, KnownSymbol k3, FromJSON v3, KnownSymbol k4, FromJSON v4, KnownSymbol k5, FromJSON v5, KnownSymbol k6, FromJSON v6, KnownSymbol k7, FromJSON v7, KnownSymbol k8, FromJSON v8) => QueryResults (Tagged Symbol k1 v1, Tagged Symbol k2 v2, Tagged Symbol k3 v3, Tagged Symbol k4 v4, Tagged Symbol k5 v5, Tagged Symbol k6 v6, Tagged Symbol k7 v7, Tagged Symbol k8 v8) Source #

One-off tuple for seven-field measurements

type Corep (Tagged *) 
type Corep (Tagged *) = Proxy *
type Rep1 * (Tagged k s) 
type Rep1 * (Tagged k s) = D1 * (MetaData "Tagged" "Data.Tagged" "tagged-0.8.5-2qJpg58g4ecDU6EbzROhsl" True) (C1 * (MetaCons "Tagged" PrefixI True) (S1 * (MetaSel (Just Symbol "unTagged") NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep (Tagged * t) 
type Rep (Tagged * t) = ()
type Rep (Tagged k s b) 
type Rep (Tagged k s b) = D1 * (MetaData "Tagged" "Data.Tagged" "tagged-0.8.5-2qJpg58g4ecDU6EbzROhsl" True) (C1 * (MetaCons "Tagged" PrefixI True) (S1 * (MetaSel (Just Symbol "unTagged") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * b)))
type Unwrapped (Tagged k s a) 
type Unwrapped (Tagged k s a) = a

untag :: Tagged k s b -> b #

Alias for unTagged