Copyright | 2013-2017 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
This module defines operators on various projected records.
- class ProjectableFlattenMaybe a b where
- flattenPiMaybe :: (PersistableWidth a, ProjectableMaybe (Record cont), ProjectableFlattenMaybe (Maybe b) c) => Record cont (Maybe a) -> Pi a b -> Record cont c
- (!) :: PersistableWidth a => Record c a -> Pi a b -> Record c b
- (?!) :: PersistableWidth a => Record c (Maybe a) -> Pi a b -> Record c (Maybe b)
- (?!?) :: PersistableWidth a => Record c (Maybe a) -> Pi a (Maybe b) -> Record c (Maybe b)
- (!??) :: (PersistableWidth a, ProjectableMaybe (Record cont), ProjectableFlattenMaybe (Maybe b) c) => Record cont (Maybe a) -> Pi a b -> Record cont c
- unsafeAggregateOp :: (AggregatedContext ac, SqlContext ac) => Keyword -> Record Flat a -> Record ac b
- count :: (Integral b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac b
- sum' :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
- sumMaybe :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a)
- avg :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe b)
- avgMaybe :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe b)
- max' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
- maxMaybe :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a)
- min' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a)
- minMaybe :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a)
- every :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
- any' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
- some' :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool)
Projection for nested Maybe
s
class ProjectableFlattenMaybe a b where Source #
Interface to compose phantom Maybe
nested type.
flatten :: ProjectableMaybe p => p a -> p b Source #
ProjectableFlattenMaybe (Maybe a) b => ProjectableFlattenMaybe (Maybe (Maybe a)) b Source # | Compose |
ProjectableFlattenMaybe (Maybe a) (Maybe a) Source # | Not |
:: (PersistableWidth a, ProjectableMaybe (Record cont), ProjectableFlattenMaybe (Maybe b) c) | |
=> Record cont (Maybe a) | |
-> Pi a b | Projection path |
-> Record cont c |
Get narrower record with flatten leaf phantom Maybe types along with projection path.
Get narrower records
:: PersistableWidth a | |
=> Record c a | Source |
-> Pi a b | Record path |
-> Record c b | Narrower projected object |
Get narrower record along with projection path.
:: (PersistableWidth a, ProjectableMaybe (Record cont), ProjectableFlattenMaybe (Maybe b) c) | |
=> Record cont (Maybe a) | |
-> Pi a b | Projection path |
-> Record cont c | Narrower flatten and projected object. |
Get narrower record with flatten leaf phantom Maybe types along with projection path.
Aggregate functions
unsafeAggregateOp :: (AggregatedContext ac, SqlContext ac) => Keyword -> Record Flat a -> Record ac b Source #
Unsafely make aggregation uni-operator from SQL keyword.
count :: (Integral b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac b Source #
Aggregation function COUNT.
sum' :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a) Source #
Aggregation function SUM.
sumMaybe :: (Num a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a) Source #
Aggregation function SUM.
avg :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe b) Source #
Aggregation function AVG.
avgMaybe :: (Num a, Fractional b, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe b) Source #
Aggregation function AVG.
max' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a) Source #
Aggregation function MAX.
maxMaybe :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a) Source #
Aggregation function MAX.
min' :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat a -> Record ac (Maybe a) Source #
Aggregation function MIN.
minMaybe :: (Ord a, AggregatedContext ac, SqlContext ac) => Record Flat (Maybe a) -> Record ac (Maybe a) Source #
Aggregation function MIN.
every :: (AggregatedContext ac, SqlContext ac) => Predicate Flat -> Record ac (Maybe Bool) Source #
Aggregation function EVERY.