opaleye-sqlite-0.0.1.1: An SQL-generating DSL targeting SQLite
Safe HaskellNone
LanguageHaskell2010

Opaleye.SQLite.Internal.Aggregate

Synopsis

Documentation

newtype Aggregator a b Source #

An Aggregator takes a collection of rows of type a, groups them, and transforms each group into a single row of type b. This corresponds to aggregators using GROUP BY in SQL.

An Aggregator corresponds closely to a Fold from the foldl package. Whereas an Aggregator a b takes each group of type a to a single row of type b, a Fold a b takes a list of a and returns a single row of type b.

Instances

Instances details
Profunctor Aggregator Source # 
Instance details

Defined in Opaleye.SQLite.Internal.Aggregate

Methods

dimap :: (a -> b) -> (c -> d) -> Aggregator b c -> Aggregator a d #

lmap :: (a -> b) -> Aggregator b c -> Aggregator a c #

rmap :: (b -> c) -> Aggregator a b -> Aggregator a c #

(#.) :: forall a b c q. Coercible c b => q b c -> Aggregator a b -> Aggregator a c #

(.#) :: forall a b c q. Coercible b a => Aggregator b c -> q a b -> Aggregator a c #

ProductProfunctor Aggregator Source # 
Instance details

Defined in Opaleye.SQLite.Internal.Aggregate

Methods

purePP :: b -> Aggregator a b #

(****) :: Aggregator a (b -> c) -> Aggregator a b -> Aggregator a c #

empty :: Aggregator () () #

(***!) :: Aggregator a b -> Aggregator a' b' -> Aggregator (a, a') (b, b') #

SumProfunctor Aggregator Source # 
Instance details

Defined in Opaleye.SQLite.Internal.Aggregate

Methods

(+++!) :: Aggregator a b -> Aggregator a' b' -> Aggregator (Either a a') (Either b b') #

Functor (Aggregator a) Source # 
Instance details

Defined in Opaleye.SQLite.Internal.Aggregate

Methods

fmap :: (a0 -> b) -> Aggregator a a0 -> Aggregator a b #

(<$) :: a0 -> Aggregator a b -> Aggregator a a0 #

Applicative (Aggregator a) Source # 
Instance details

Defined in Opaleye.SQLite.Internal.Aggregate

Methods

pure :: a0 -> Aggregator a a0 #

(<*>) :: Aggregator a (a0 -> b) -> Aggregator a a0 -> Aggregator a b #

liftA2 :: (a0 -> b -> c) -> Aggregator a a0 -> Aggregator a b -> Aggregator a c #

(*>) :: Aggregator a a0 -> Aggregator a b -> Aggregator a b #

(<*) :: Aggregator a a0 -> Aggregator a b -> Aggregator a a0 #