squeal-postgresql-0.5.2.0: Squeal PostgreSQL Library

Copyright(c) Eitan Chatav 2019
Maintainereitan@morphism.tech
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Squeal.PostgreSQL.List

Description

Haskell singly-linked lists are very powerful. This module provides functionality for type-level lists, heterogeneous lists and type aligned lists.

Synopsis

Documentation

data NP (a :: k -> Type) (b :: [k]) :: forall k. (k -> Type) -> [k] -> Type where #

An n-ary product.

The product is parameterized by a type constructor f and indexed by a type-level list xs. The length of the list determines the number of elements in the product, and if the i-th element of the list is of type x, then the i-th element of the product is of type f x.

The constructor names are chosen to resemble the names of the list constructors.

Two common instantiations of f are the identity functor I and the constant functor K. For I, the product becomes a heterogeneous list, where the type-level list describes the types of its components. For K a, the product becomes a homogeneous list, where the contents of the type-level list are ignored, but its length still specifies the number of elements.

In the context of the SOP approach to generic programming, an n-ary product describes the structure of the arguments of a single data constructor.

Examples:

I 'x'    :* I True  :* Nil  ::  NP I       '[ Char, Bool ]
K 0      :* K 1     :* Nil  ::  NP (K Int) '[ Char, Bool ]
Just 'x' :* Nothing :* Nil  ::  NP Maybe   '[ Char, Bool ]

Constructors

Nil :: forall k (a :: k -> Type) (b :: [k]). NP a ([] :: [k]) 
(:*) :: forall k (a :: k -> Type) (b :: [k]) (x :: k) (xs :: [k]). a x -> NP a xs -> NP a (x ': xs) infixr 5 
Instances
(Has tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => IsQualified tab col (NP (Aliased (Expression outer commons (Grouped bys) schemas params from)) columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Aliased (Expression outer commons (Grouped bys) schemas params from)) columns Source #

(Has tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, tys ~ (ty ': ([] :: [NullityType]))) => IsQualified tab col (NP (Expression outer commons (Grouped bys) schemas params from) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Expression outer commons (Grouped bys) schemas params from) tys Source #

(Has tab (Join outer from) row, Has col row ty, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => IsQualified tab col (NP (Aliased (Expression outer commons Ungrouped schemas params from)) columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Aliased (Expression outer commons Ungrouped schemas params from)) columns Source #

(Has tab (Join outer from) row, Has col row ty, tys ~ (ty ': ([] :: [NullityType]))) => IsQualified tab col (NP (Expression outer commons Ungrouped schemas params from) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Expression outer commons Ungrouped schemas params from) tys Source #

(Has rel rels cols, Has col cols ty, bys ~ ((,) rel col ': ([] :: [(Symbol, Symbol)]))) => IsQualified rel col (NP (By rels) bys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

(!) :: Alias rel -> Alias col -> NP (By rels) bys Source #

HTrans (NP :: (k1 -> Type) -> [k1] -> Type) (NP :: (k2 -> Type) -> [k2] -> Type) 
Instance details

Defined in Data.SOP.NP

Methods

htrans :: AllZipN (Prod NP) c xs ys => proxy c -> (forall (x :: k10) (y :: k20). c x y => f x -> g y) -> NP f xs -> NP g ys #

hcoerce :: (AllZipN (Prod NP) (LiftedCoercible f g) xs ys, HTrans NP NP) => NP f xs -> NP g ys #

HSequence (NP :: (k -> Type) -> [k] -> Type) 
Instance details

Defined in Data.SOP.NP

Methods

hsequence' :: (SListIN NP xs, Applicative f) => NP (f :.: g) xs -> f (NP g xs) #

hctraverse' :: (AllN NP c xs, Applicative g) => proxy c -> (forall (a :: k0). c a => f a -> g (f' a)) -> NP f xs -> g (NP f' xs) #

htraverse' :: (SListIN NP xs, Applicative g) => (forall (a :: k0). f a -> g (f' a)) -> NP f xs -> g (NP f' xs) #

HTraverse_ (NP :: (k -> Type) -> [k] -> Type) 
Instance details

Defined in Data.SOP.NP

Methods

hctraverse_ :: (AllN NP c xs, Applicative g) => proxy c -> (forall (a :: k0). c a => f a -> g ()) -> NP f xs -> g () #

htraverse_ :: (SListIN NP xs, Applicative g) => (forall (a :: k0). f a -> g ()) -> NP f xs -> g () #

HCollapse (NP :: (k -> Type) -> [k] -> Type) 
Instance details

Defined in Data.SOP.NP

Methods

hcollapse :: SListIN NP xs => NP (K a) xs -> CollapseTo NP a #

HAp (NP :: (k -> Type) -> [k] -> Type) 
Instance details

Defined in Data.SOP.NP

Methods

hap :: Prod NP (f -.-> g) xs -> NP f xs -> NP g xs #

HPure (NP :: (k -> Type) -> [k] -> Type) 
Instance details

Defined in Data.SOP.NP

Methods

hpure :: SListIN NP xs => (forall (a :: k0). f a) -> NP f xs #

hcpure :: AllN NP c xs => proxy c -> (forall (a :: k0). c a => f a) -> NP f xs #

(KnownSymbol alias, tys ~ ((alias ::: ty) ': ([] :: [(Symbol, k)]))) => Aliasable alias (expression ty) (NP (Aliased expression) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Alias

Methods

as :: expression ty -> Alias alias -> NP (Aliased expression) tys Source #

Additional (NP expr :: [a] -> Type) Source # 
Instance details

Defined in Squeal.PostgreSQL.List

Methods

also :: NP expr ys -> NP expr xs -> NP expr (Join xs ys) Source #

Aggregate (Distinction (Expression outer commons Ungrouped schemas params from)) (Distinction (NP (Expression outer commons Ungrouped schemas params from)) :: [NullityType] -> Type) (Expression outer commons (Grouped bys) schemas params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

countStar :: Expression outer commons (Grouped bys) schemas params from (NotNull PGint8) Source #

count :: Distinction (Expression outer commons Ungrouped schemas params from) ty -> Expression outer commons (Grouped bys) schemas params from (NotNull PGint8) Source #

sum_ :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGSum ty)) Source #

arrayAgg :: Distinction (Expression outer commons Ungrouped schemas params from) ty -> Expression outer commons (Grouped bys) schemas params from (Null (PGvararray ty)) Source #

jsonAgg :: Distinction (Expression outer commons Ungrouped schemas params from) ty -> Expression outer commons (Grouped bys) schemas params from (Null PGjson) Source #

jsonbAgg :: Distinction (Expression outer commons Ungrouped schemas params from) ty -> Expression outer commons (Grouped bys) schemas params from (Null PGjsonb) Source #

bitAnd :: In int PGIntegral => Distinction (Expression outer commons Ungrouped schemas params from) (null int) -> Expression outer commons (Grouped bys) schemas params from (Null int) Source #

bitOr :: In int PGIntegral => Distinction (Expression outer commons Ungrouped schemas params from) (null int) -> Expression outer commons (Grouped bys) schemas params from (Null int) Source #

boolAnd :: Distinction (Expression outer commons Ungrouped schemas params from) (null PGbool) -> Expression outer commons (Grouped bys) schemas params from (Null PGbool) Source #

boolOr :: Distinction (Expression outer commons Ungrouped schemas params from) (null PGbool) -> Expression outer commons (Grouped bys) schemas params from (Null PGbool) Source #

every :: Distinction (Expression outer commons Ungrouped schemas params from) (null PGbool) -> Expression outer commons (Grouped bys) schemas params from (Null PGbool) Source #

max_ :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null ty) Source #

min_ :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null ty) Source #

avg :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

corr :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

covarPop :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

covarSamp :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrAvgX :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrAvgY :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrCount :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGint8) Source #

regrIntercept :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrR2 :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrSlope :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrSxx :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrSxy :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

regrSyy :: Distinction (NP (Expression outer commons Ungrouped schemas params from)) (null PGfloat8 ': (null PGfloat8 ': [])) -> Expression outer commons (Grouped bys) schemas params from (Null PGfloat8) Source #

stddev :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

stddevPop :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

stddevSamp :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

variance :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

varPop :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

varSamp :: Distinction (Expression outer commons Ungrouped schemas params from) (null ty) -> Expression outer commons (Grouped bys) schemas params from (Null (PGAvg ty)) Source #

aliases ~ (alias ': ([] :: [Symbol])) => IsLabel alias (NP Alias aliases) Source # 
Instance details

Defined in Squeal.PostgreSQL.Alias

Methods

fromLabel :: NP Alias aliases #

(HasUnique tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => IsLabel col (NP (Aliased (Expression outer commons (Grouped bys) schemas params from)) columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Aliased (Expression outer commons (Grouped bys) schemas params from)) columns #

(HasUnique tab (Join outer from) row, Has col row ty, GroupedBy tab col bys, tys ~ (ty ': ([] :: [NullityType]))) => IsLabel col (NP (Expression outer commons (Grouped bys) schemas params from) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Expression outer commons (Grouped bys) schemas params from) tys #

(HasUnique tab (Join outer from) row, Has col row ty, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullityType)]))) => IsLabel col (NP (Aliased (Expression outer commons Ungrouped schemas params from)) columns) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Aliased (Expression outer commons Ungrouped schemas params from)) columns #

(HasUnique tab (Join outer from) row, Has col row ty, tys ~ (ty ': ([] :: [NullityType]))) => IsLabel col (NP (Expression outer commons Ungrouped schemas params from) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Expression outer commons Ungrouped schemas params from) tys #

(HasUnique rel rels cols, Has col cols ty, bys ~ ((,) rel col ': ([] :: [(Symbol, Symbol)]))) => IsLabel col (NP (By rels) bys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

fromLabel :: NP (By rels) bys #

labels ~ (label ': ([] :: [Symbol])) => IsPGlabel label (NP PGlabel labels) Source # 
Instance details

Defined in Squeal.PostgreSQL.Schema

Methods

label :: NP PGlabel labels Source #

Aggregate (Expression outer commons grp schemas params from) (NP (Expression outer commons grp schemas params from) :: [NullityType] -> Type) (WindowFunction outer commons grp schemas params from) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Window

Methods

countStar :: WindowFunction outer commons grp schemas params from (NotNull PGint8) Source #

count :: Expression outer commons grp schemas params from ty -> WindowFunction outer commons grp schemas params from (NotNull PGint8) Source #

sum_ :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGSum ty)) Source #

arrayAgg :: Expression outer commons grp schemas params from ty -> WindowFunction outer commons grp schemas params from (Null (PGvararray ty)) Source #

jsonAgg :: Expression outer commons grp schemas params from ty -> WindowFunction outer commons grp schemas params from (Null PGjson) Source #

jsonbAgg :: Expression outer commons grp schemas params from ty -> WindowFunction outer commons grp schemas params from (Null PGjsonb) Source #

bitAnd :: In int PGIntegral => Expression outer commons grp schemas params from (null int) -> WindowFunction outer commons grp schemas params from (Null int) Source #

bitOr :: In int PGIntegral => Expression outer commons grp schemas params from (null int) -> WindowFunction outer commons grp schemas params from (Null int) Source #

boolAnd :: Expression outer commons grp schemas params from (null PGbool) -> WindowFunction outer commons grp schemas params from (Null PGbool) Source #

boolOr :: Expression outer commons grp schemas params from (null PGbool) -> WindowFunction outer commons grp schemas params from (Null PGbool) Source #

every :: Expression outer commons grp schemas params from (null PGbool) -> WindowFunction outer commons grp schemas params from (Null PGbool) Source #

max_ :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null ty) Source #

min_ :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null ty) Source #

avg :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

corr :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

covarPop :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

covarSamp :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrAvgX :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrAvgY :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrCount :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGint8) Source #

regrIntercept :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrR2 :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrSlope :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrSxx :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrSxy :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

regrSyy :: NP (Expression outer commons grp schemas params from) (null PGfloat8 ': (null PGfloat8 ': [])) -> WindowFunction outer commons grp schemas params from (Null PGfloat8) Source #

stddev :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

stddevPop :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

stddevSamp :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

variance :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

varPop :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

varSamp :: Expression outer commons grp schemas params from (null ty) -> WindowFunction outer commons grp schemas params from (Null (PGAvg ty)) Source #

All (Compose Eq f) xs => Eq (NP f xs) 
Instance details

Defined in Data.SOP.NP

Methods

(==) :: NP f xs -> NP f xs -> Bool #

(/=) :: NP f xs -> NP f xs -> Bool #

(All (Compose Eq f) xs, All (Compose Ord f) xs) => Ord (NP f xs) 
Instance details

Defined in Data.SOP.NP

Methods

compare :: NP f xs -> NP f xs -> Ordering #

(<) :: NP f xs -> NP f xs -> Bool #

(<=) :: NP f xs -> NP f xs -> Bool #

(>) :: NP f xs -> NP f xs -> Bool #

(>=) :: NP f xs -> NP f xs -> Bool #

max :: NP f xs -> NP f xs -> NP f xs #

min :: NP f xs -> NP f xs -> NP f xs #

All (Compose Show f) xs => Show (NP f xs) 
Instance details

Defined in Data.SOP.NP

Methods

showsPrec :: Int -> NP f xs -> ShowS #

show :: NP f xs -> String #

showList :: [NP f xs] -> ShowS #

All (Compose Semigroup f) xs => Semigroup (NP f xs)

Since: sop-core-0.4.0.0

Instance details

Defined in Data.SOP.NP

Methods

(<>) :: NP f xs -> NP f xs -> NP f xs #

sconcat :: NonEmpty (NP f xs) -> NP f xs #

stimes :: Integral b => b -> NP f xs -> NP f xs #

(All (Compose Monoid f) xs, All (Compose Semigroup f) xs) => Monoid (NP f xs)

Since: sop-core-0.4.0.0

Instance details

Defined in Data.SOP.NP

Methods

mempty :: NP f xs #

mappend :: NP f xs -> NP f xs -> NP f xs #

mconcat :: [NP f xs] -> NP f xs #

All (Compose NFData f) xs => NFData (NP f xs)

Since: sop-core-0.2.5.0

Instance details

Defined in Data.SOP.NP

Methods

rnf :: NP f xs -> () #

All KnownSymbol aliases => RenderSQL (NP Alias aliases) Source # 
Instance details

Defined in Squeal.PostgreSQL.Alias

Methods

renderSQL :: NP Alias aliases -> ByteString Source #

All KnownSymbol labels => RenderSQL (NP PGlabel labels) Source # 
Instance details

Defined in Squeal.PostgreSQL.Schema

Methods

renderSQL :: NP PGlabel labels -> ByteString Source #

SListI tys => RenderSQL (Distinction (NP (Expression outer commons grp schemas params from)) tys) Source # 
Instance details

Defined in Squeal.PostgreSQL.Expression.Aggregate

Methods

renderSQL :: Distinction (NP (Expression outer commons grp schemas params from)) tys -> ByteString Source #

type Same (NP :: (k1 -> Type) -> [k1] -> Type) 
Instance details

Defined in Data.SOP.NP

type Same (NP :: (k1 -> Type) -> [k1] -> Type) = (NP :: (k2 -> Type) -> [k2] -> Type)
type UnProd (NP :: (k -> Type) -> [k] -> Type) 
Instance details

Defined in Data.SOP.NS

type UnProd (NP :: (k -> Type) -> [k] -> Type) = (NS :: (k -> Type) -> [k] -> Type)
type Prod (NP :: (k -> Type) -> [k] -> Type) 
Instance details

Defined in Data.SOP.NP

type Prod (NP :: (k -> Type) -> [k] -> Type) = (NP :: (k -> Type) -> [k] -> Type)
type CollapseTo (NP :: (k -> Type) -> [k] -> Type) a 
Instance details

Defined in Data.SOP.NP

type CollapseTo (NP :: (k -> Type) -> [k] -> Type) a = [a]
type SListIN (NP :: (k -> Type) -> [k] -> Type) 
Instance details

Defined in Data.SOP.NP

type SListIN (NP :: (k -> Type) -> [k] -> Type) = (SListI :: [k] -> Constraint)
type AllN (NP :: (k -> Type) -> [k] -> Type) (c :: k -> Constraint) 
Instance details

Defined in Data.SOP.NP

type AllN (NP :: (k -> Type) -> [k] -> Type) (c :: k -> Constraint) = All c
type AllZipN (NP :: (k -> Type) -> [k] -> Type) (c :: a -> b -> Constraint) 
Instance details

Defined in Data.SOP.NP

type AllZipN (NP :: (k -> Type) -> [k] -> Type) (c :: a -> b -> Constraint) = AllZip c

(*:) :: f x -> f y -> NP f '[x, y] infixl 9 Source #

A useful operator for ending an NP list of length at least 2 without Nil.

type family Join xs ys where ... Source #

Join is simply promoted ++ and is used in JOINs in FromClauses.

Equations

Join '[] ys = ys 
Join (x ': xs) ys = x ': Join xs ys 

disjoin :: forall xs ys expr. SListI xs => NP expr (Join xs ys) -> (NP expr xs, NP expr ys) Source #

disjoin is a utility function for splitting an NP list into pieces.

class Additional expr where Source #

The Additional class is for appending type-level list parameterized constructors such as NP, Selection, and FromClause.

Methods

also :: expr ys -> expr xs -> expr (Join xs ys) Source #

Instances
Additional (NP expr :: [a] -> Type) Source # 
Instance details

Defined in Squeal.PostgreSQL.List

Methods

also :: NP expr ys -> NP expr xs -> NP expr (Join xs ys) Source #

Additional (FromClause outer commons schemas params :: [a] -> Type) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

also :: FromClause outer commons schemas params ys -> FromClause outer commons schemas params xs -> FromClause outer commons schemas params (Join xs ys) Source #

Additional (Selection outer commons grp schemas params from :: RowType -> Type) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

also :: Selection outer commons grp schemas params from ys -> Selection outer commons grp schemas params from xs -> Selection outer commons grp schemas params from (Join xs ys) Source #

data AlignedList p x0 x1 where Source #

An AlignedList is a type-aligned list or free category.

Constructors

Done :: AlignedList p x x 
(:>>) :: p x0 x1 -> AlignedList p x1 x2 -> AlignedList p x0 x2 infixr 7 
Instances
Category (AlignedList p :: k -> k -> Type) Source # 
Instance details

Defined in Squeal.PostgreSQL.List

Methods

id :: AlignedList p a a #

(.) :: AlignedList p b c -> AlignedList p a b -> AlignedList p a c #

(KnownSymbol cte, commons1 ~ ((cte ::: common) ': commons)) => Aliasable cte (statement commons schemas params common) (AlignedList (CommonTableExpression statement schemas params) commons commons1) Source # 
Instance details

Defined in Squeal.PostgreSQL.Query

Methods

as :: statement commons schemas params common -> Alias cte -> AlignedList (CommonTableExpression statement schemas params) commons commons1 Source #

(forall (t0 :: k) (t1 :: k). RenderSQL (p t0 t1)) => RenderSQL (AlignedList p x0 x1) Source # 
Instance details

Defined in Squeal.PostgreSQL.List

Methods

renderSQL :: AlignedList p x0 x1 -> ByteString Source #

single :: p x0 x1 -> AlignedList p x0 x1 Source #

A single step.

extractList :: (forall a0 a1. p a0 a1 -> b) -> AlignedList p x0 x1 -> [b] Source #

extractList turns an AlignedList into a standard list.

mapAligned :: (forall z0 z1. p z0 z1 -> q z0 z1) -> AlignedList p x0 x1 -> AlignedList q x0 x1 Source #

mapAligned applies a function to each element of an AlignedList.

type family Elem x xs where ... Source #

Elem is a promoted elem.

Equations

Elem x '[] = False 
Elem x (x ': xs) = True 
Elem x (_ ': xs) = Elem x xs 

type family In x xs :: Constraint where ... Source #

In x xs is a constraint that proves that x is in xs.

Equations

In x xs = If (Elem x xs) (() :: Constraint) (TypeError ((ShowType x :<>: Text "is not in ") :<>: ShowType xs)) 

type family Length (xs :: [k]) :: Nat where ... Source #

Calculate the Length of a type level list

>>> :kind! Length '[Char,String,Bool,Double]
Length '[Char,String,Bool,Double] :: Nat
= 4

Equations

Length (x ': xs) = 1 + Length xs 
Length '[] = 0