Safe Haskell | None |
---|---|
Language | Haskell2010 |
HLRDB.Primitives.Aggregate
Description
Combinators that can be used for aggregating independent queries. See my article about aggregating mget queries for more information.
Synopsis
- newtype T x y a b = T (Traversal a b x y)
- type (⟿) a b = T ByteString (Maybe ByteString) a b
- type (~~>) a b = T ByteString (Maybe ByteString) a b
- type Query a b = a ⟿ b
- aggregatePair :: (Traversing p, Functor (p (a, a')), Applicative (p (a, a'))) => p a b -> p a' b' -> p (a, a') (b, b')
- remember :: T x y a b -> T x y a (a, b)
- bitraverse' :: Bitraversable t => (a ~~> b) -> (c ~~> d) -> t a c ~~> t b d
- runT :: Functor f => ([x] -> f [y]) -> T x y a b -> a -> f b
- data MSET
Documentation
Abstract representation for aggregation.
Instances
Profunctor (T x y) Source # | |
Defined in HLRDB.Primitives.Aggregate Methods dimap :: (a -> b) -> (c -> d) -> T x y b c -> T x y a d # lmap :: (a -> b) -> T x y b c -> T x y a c # rmap :: (b -> c) -> T x y a b -> T x y a c # (#.) :: forall a b c q. Coercible c b => q b c -> T x y a b -> T x y a c # (.#) :: forall a b c q. Coercible b a => T x y b c -> q a b -> T x y a c # | |
Strong (T x y) Source # | |
Choice (T x y) Source # | |
Traversing (T x y) Source # | |
Defined in HLRDB.Primitives.Aggregate | |
Functor (T x y a) Source # | |
Applicative (T x y a) Source # | |
type (⟿) a b = T ByteString (Maybe ByteString) a b Source #
A query using input of type a
and yielding an output of type b
type (~~>) a b = T ByteString (Maybe ByteString) a b Source #
An ASCII version of ⟿
aggregatePair :: (Traversing p, Functor (p (a, a')), Applicative (p (a, a'))) => p a b -> p a' b' -> p (a, a') (b, b') Source #
We can merge any two arbitrary mget queries.
bitraverse' :: Bitraversable t => (a ~~> b) -> (c ~~> d) -> t a c ~~> t b d Source #
runT :: Functor f => ([x] -> f [y]) -> T x y a b -> a -> f b Source #
Reify aggregation into a target functor.
Aggregate, atomic multi-set query (as in setting multiple things in a single query)
Aggregated mset
query