postgresql-tx-squeal-0.1.0.0: postgresql-tx interfacing for use with squeal-postgresql.

Safe HaskellNone
LanguageHaskell2010

Database.PostgreSQL.Tx.Squeal.Internal.Reexport

Synopsis

Documentation

class IsLabel (x :: Symbol) a where #

Methods

fromLabel :: a #

Instances
alias1 ~ alias2 => IsLabel alias1 (Alias alias2) 
Instance details

Defined in Squeal.PostgreSQL.Type.Alias

Methods

fromLabel :: Alias alias2 #

FromValue ty (Maybe y) => IsLabel fld (MaybeT (DecodeRow ((fld ::: ty) ': row)) y) 
Instance details

Defined in Squeal.PostgreSQL.Session.Decode

Methods

fromLabel :: MaybeT (DecodeRow ((fld ::: ty) ': row)) y #

IsLabel fld (MaybeT (DecodeRow row) y) => IsLabel fld (MaybeT (DecodeRow (field ': row)) y) 
Instance details

Defined in Squeal.PostgreSQL.Session.Decode

Methods

fromLabel :: MaybeT (DecodeRow (field ': row)) y #

FromValue ty y => IsLabel fld (DecodeRow ((fld ::: ty) ': row) y) 
Instance details

Defined in Squeal.PostgreSQL.Session.Decode

Methods

fromLabel :: DecodeRow ((fld ::: ty) ': row) y #

IsLabel fld (DecodeRow row y) => IsLabel fld (DecodeRow (field ': row) y) 
Instance details

Defined in Squeal.PostgreSQL.Session.Decode

Methods

fromLabel :: DecodeRow (field ': row) y #

(HasUnique rel rels cols, Has col cols ty, by ~ (,) rel col) => IsLabel col (By rels by) 
Instance details

Defined in Squeal.PostgreSQL.Query.Table

Methods

fromLabel :: By rels by #

(q' ~ "public", a ~ a') => IsLabel a (QualifiedAlias q' a') 
Instance details

Defined in Squeal.PostgreSQL.Type.Alias

Methods

fromLabel :: QualifiedAlias q' a' #

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

Defined in Squeal.PostgreSQL.Query.Table

Methods

fromLabel :: NP (By rels) bys #

(HasUnique tab (Join lat from) row, Has col row ty, tys ~ (ty ': ([] :: [NullType]))) => IsLabel col (NP (Expression Ungrouped lat with db params from) tys) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Expression Ungrouped lat with db params from) tys #

(HasUnique tab (Join lat from) row, Has col row ty, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullType)]))) => IsLabel col (NP (Aliased (Expression Ungrouped lat with db params from)) columns) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Aliased (Expression Ungrouped lat with db params from)) columns #

(HasUnique tab (Join lat from) row, Has col row ty, GroupedBy tab col bys, tys ~ (ty ': ([] :: [NullType]))) => IsLabel col (NP (Expression (Grouped bys) lat with db params from) tys) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Expression (Grouped bys) lat with db params from) tys #

(HasUnique tab (Join lat from) row, Has col row ty, GroupedBy tab col bys, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullType)]))) => IsLabel col (NP (Aliased (Expression (Grouped bys) lat with db params from)) columns) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Aliased (Expression (Grouped bys) lat with db params from)) columns #

(HasUnique tab (Join lat from) row, Has col row ty, column ~ (col ::: ty)) => IsLabel col (Aliased (Expression Ungrouped lat with db params from) column) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: Aliased (Expression Ungrouped lat with db params from) column #

(HasUnique tab (Join lat from) row, Has col row ty, GroupedBy tab col bys, column ~ (col ::: ty)) => IsLabel col (Aliased (Expression (Grouped bys) lat with db params from) column) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: Aliased (Expression (Grouped bys) lat with db params from) column #

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

Defined in Squeal.PostgreSQL.Type.Alias

Methods

fromLabel :: NP Alias aliases #

(alias0 ~ alias1, alias0 ~ alias2, KnownSymbol alias2) => IsLabel alias0 (Aliased Alias (alias1 ::: alias2)) 
Instance details

Defined in Squeal.PostgreSQL.Type.Alias

Methods

fromLabel :: Aliased Alias (alias1 ::: alias2) #

(q ~ "public", a0 ~ a1, a1 ~ a2, KnownSymbol a2) => IsLabel a0 (Aliased (QualifiedAlias q) (a1 ::: a2)) 
Instance details

Defined in Squeal.PostgreSQL.Type.Alias

Methods

fromLabel :: Aliased (QualifiedAlias q) (a1 ::: a2) #

(HasUnique tab (Join lat from) row0, Has col row0 ty, row1 ~ ((col ::: ty) ': ([] :: [(Symbol, NullType)]))) => IsLabel col (Selection Ungrouped lat with db params from row1) 
Instance details

Defined in Squeal.PostgreSQL.Query.Select

Methods

fromLabel :: Selection Ungrouped lat with db params from row1 #

(HasUnique tab (Join lat from) row0, Has col row0 ty, row1 ~ ((col ::: ty) ': ([] :: [(Symbol, NullType)])), GroupedBy tab col bys) => IsLabel col (Selection (Grouped bys) lat with db params from row1) 
Instance details

Defined in Squeal.PostgreSQL.Query.Select

Methods

fromLabel :: Selection (Grouped bys) lat with db params from row1 #

(HasUnique tab (Join lat from) row, Has col row ty) => IsLabel col (Expression Ungrouped lat with db params from ty) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: Expression Ungrouped lat with db params from ty #

(HasUnique tab (Join lat from) row, Has col row ty, GroupedBy tab col bys) => IsLabel col (Expression (Grouped bys) lat with db params from ty) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: Expression (Grouped bys) lat with db params from ty #

(>>>) :: Category cat => cat a b -> cat b c -> cat a c infixr 1 #

Left-to-right composition

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

newtype ExceptT e (m :: Type -> Type) a #

A monad transformer that adds exceptions to other monads.

ExceptT constructs a monad parameterized over two things:

  • e - The exception type.
  • m - The inner monad.

The return function yields a computation that produces the given value, while >>= sequences two subcomputations, exiting on the first exception.

Constructors

ExceptT (m (Either e a)) 
Instances
MonadBaseControl b m => MonadBaseControl b (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Control

Associated Types

type StM (ExceptT e m) a :: Type #

Methods

liftBaseWith :: (RunInBase (ExceptT e m) b -> b a) -> ExceptT e m a #

restoreM :: StM (ExceptT e m) a -> ExceptT e m a #

MonadPQ db m => MonadPQ db (ExceptT e m) 
Instance details

Defined in Squeal.PostgreSQL.Session.Monad

Methods

executeParams :: Statement db x y -> x -> ExceptT e m (Result y) #

executeParams_ :: Statement db x () -> x -> ExceptT e m () #

execute :: Statement db () y -> ExceptT e m (Result y) #

execute_ :: Statement db () () -> ExceptT e m () #

executePrepared :: Traversable list => Statement db x y -> list x -> ExceptT e m (list (Result y)) #

executePrepared_ :: Foldable list => Statement db x () -> list x -> ExceptT e m () #

MonadTrans (ExceptT e) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

lift :: Monad m => m a -> ExceptT e m a #

MonadTransControl (ExceptT e) 
Instance details

Defined in Control.Monad.Trans.Control

Associated Types

type StT (ExceptT e) a :: Type #

Methods

liftWith :: Monad m => (Run (ExceptT e) -> m a) -> ExceptT e m a #

restoreT :: Monad m => m (StT (ExceptT e) a) -> ExceptT e m a #

Monad m => Monad (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

(>>=) :: ExceptT e m a -> (a -> ExceptT e m b) -> ExceptT e m b #

(>>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b #

return :: a -> ExceptT e m a #

fail :: String -> ExceptT e m a #

Functor m => Functor (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

fmap :: (a -> b) -> ExceptT e m a -> ExceptT e m b #

(<$) :: a -> ExceptT e m b -> ExceptT e m a #

MonadFix m => MonadFix (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

mfix :: (a -> ExceptT e m a) -> ExceptT e m a #

MonadFail m => MonadFail (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

fail :: String -> ExceptT e m a #

(Functor m, Monad m) => Applicative (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

pure :: a -> ExceptT e m a #

(<*>) :: ExceptT e m (a -> b) -> ExceptT e m a -> ExceptT e m b #

liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c #

(*>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b #

(<*) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m a #

Foldable f => Foldable (ExceptT e f) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

fold :: Monoid m => ExceptT e f m -> m #

foldMap :: Monoid m => (a -> m) -> ExceptT e f a -> m #

foldr :: (a -> b -> b) -> b -> ExceptT e f a -> b #

foldr' :: (a -> b -> b) -> b -> ExceptT e f a -> b #

foldl :: (b -> a -> b) -> b -> ExceptT e f a -> b #

foldl' :: (b -> a -> b) -> b -> ExceptT e f a -> b #

foldr1 :: (a -> a -> a) -> ExceptT e f a -> a #

foldl1 :: (a -> a -> a) -> ExceptT e f a -> a #

toList :: ExceptT e f a -> [a] #

null :: ExceptT e f a -> Bool #

length :: ExceptT e f a -> Int #

elem :: Eq a => a -> ExceptT e f a -> Bool #

maximum :: Ord a => ExceptT e f a -> a #

minimum :: Ord a => ExceptT e f a -> a #

sum :: Num a => ExceptT e f a -> a #

product :: Num a => ExceptT e f a -> a #

Traversable f => Traversable (ExceptT e f) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ExceptT e f a -> f0 (ExceptT e f b) #

sequenceA :: Applicative f0 => ExceptT e f (f0 a) -> f0 (ExceptT e f a) #

mapM :: Monad m => (a -> m b) -> ExceptT e f a -> m (ExceptT e f b) #

sequence :: Monad m => ExceptT e f (m a) -> m (ExceptT e f a) #

(Functor m, Monad m, Monoid e) => Alternative (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

empty :: ExceptT e m a #

(<|>) :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

some :: ExceptT e m a -> ExceptT e m [a] #

many :: ExceptT e m a -> ExceptT e m [a] #

(Monad m, Monoid e) => MonadPlus (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

mzero :: ExceptT e m a #

mplus :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

Contravariant m => Contravariant (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

contramap :: (a -> b) -> ExceptT e m b -> ExceptT e m a #

(>$) :: b -> ExceptT e m b -> ExceptT e m a #

(Eq e, Eq1 m) => Eq1 (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

liftEq :: (a -> b -> Bool) -> ExceptT e m a -> ExceptT e m b -> Bool #

(Ord e, Ord1 m) => Ord1 (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

liftCompare :: (a -> b -> Ordering) -> ExceptT e m a -> ExceptT e m b -> Ordering #

(Read e, Read1 m) => Read1 (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (ExceptT e m a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [ExceptT e m a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (ExceptT e m a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [ExceptT e m a] #

(Show e, Show1 m) => Show1 (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> ExceptT e m a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [ExceptT e m a] -> ShowS #

MonadZip m => MonadZip (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

mzip :: ExceptT e m a -> ExceptT e m b -> ExceptT e m (a, b) #

mzipWith :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c #

munzip :: ExceptT e m (a, b) -> (ExceptT e m a, ExceptT e m b) #

MonadIO m => MonadIO (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

liftIO :: IO a -> ExceptT e m a #

PrimMonad m => PrimMonad (ExceptT e m) 
Instance details

Defined in Control.Monad.Primitive

Associated Types

type PrimState (ExceptT e m) :: Type #

Methods

primitive :: (State# (PrimState (ExceptT e m)) -> (#State# (PrimState (ExceptT e m)), a#)) -> ExceptT e m a #

(Eq e, Eq1 m, Eq a) => Eq (ExceptT e m a) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

(==) :: ExceptT e m a -> ExceptT e m a -> Bool #

(/=) :: ExceptT e m a -> ExceptT e m a -> Bool #

(Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

compare :: ExceptT e m a -> ExceptT e m a -> Ordering #

(<) :: ExceptT e m a -> ExceptT e m a -> Bool #

(<=) :: ExceptT e m a -> ExceptT e m a -> Bool #

(>) :: ExceptT e m a -> ExceptT e m a -> Bool #

(>=) :: ExceptT e m a -> ExceptT e m a -> Bool #

max :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

min :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #

(Read e, Read1 m, Read a) => Read (ExceptT e m a) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

readsPrec :: Int -> ReadS (ExceptT e m a) #

readList :: ReadS [ExceptT e m a] #

readPrec :: ReadPrec (ExceptT e m a) #

readListPrec :: ReadPrec [ExceptT e m a] #

(Show e, Show1 m, Show a) => Show (ExceptT e m a) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

showsPrec :: Int -> ExceptT e m a -> ShowS #

show :: ExceptT e m a -> String #

showList :: [ExceptT e m a] -> ShowS #

type StT (ExceptT e) a 
Instance details

Defined in Control.Monad.Trans.Control

type StT (ExceptT e) a = Either e a
type PrimState (ExceptT e m) 
Instance details

Defined in Control.Monad.Primitive

type PrimState (ExceptT e m) = PrimState m
type StM (ExceptT e m) a 
Instance details

Defined in Control.Monad.Trans.Control

type StM (ExceptT e m) a = ComposeSt (ExceptT e) m a

data Path (p :: k -> k -> Type) (x :: k) (y :: k) :: forall k. (k -> k -> Type) -> k -> k -> Type where #

A Path with steps in p is a singly linked list of "type-aligned" constructions of p.

>>> :{
let
  path :: Path (->) String Int
  path = length :>> (\x -> x^2) :>> Done
in
  qfold path "hello"
:}
25

Constructors

Done :: forall k (p :: k -> k -> Type) (x :: k) (y :: k). Path p x x 
(:>>) :: forall k (p :: k -> k -> Type) (x :: k) (y :: k) (y1 :: k). p x y1 -> Path p y1 y -> Path p x y infixr 7 
Instances
QFunctor (Path :: (k -> k -> Type) -> k -> k -> Type) 
Instance details

Defined in Control.Category.Free

Methods

qmap :: (forall (x1 :: k0) (y1 :: k1). p x1 y1 -> q x1 y1) -> Path p x y -> Path q x y #

QPointed (Path :: (k -> k -> Type) -> k -> k -> Type) 
Instance details

Defined in Control.Category.Free

Methods

qsingle :: p x y -> Path p x y #

QMonad (Path :: (k -> k -> Type) -> k -> k -> Type) 
Instance details

Defined in Control.Category.Free

Methods

qjoin :: Path (Path p) x y -> Path p x y #

qbind :: (forall (x1 :: k0) (y1 :: k1). p x1 y1 -> Path q x1 y1) -> Path p x y -> Path q x y #

CFree (Path :: (k -> k -> Type) -> k -> k -> Type) 
Instance details

Defined in Control.Category.Free

QFoldable (Path :: (k -> k -> Type) -> k -> k -> Type) 
Instance details

Defined in Control.Category.Free

Methods

qfoldMap :: Category q => (forall (x1 :: k0) (y1 :: k0). p x1 y1 -> q x1 y1) -> Path p x y -> q x y #

qfold :: Category q => Path q x y -> q x y #

qfoldr :: (forall (x1 :: k0) (y1 :: k0) (z1 :: k1). p x1 y1 -> q y1 z1 -> q x1 z1) -> q y z -> Path p x y -> q x z #

qfoldl :: (forall (x1 :: k1) (y1 :: k0) (z1 :: k0). q x1 y1 -> p y1 z1 -> q x1 z1) -> q x y -> Path p y z -> q x z #

qtoMonoid :: Monoid m => (forall (x1 :: k0) (y1 :: k0). p x1 y1 -> m) -> Path p x y -> m #

qtoList :: (forall (x1 :: k0) (y1 :: k0). p x1 y1 -> a) -> Path p x y -> [a] #

qtraverse_ :: (Applicative m, Category q) => (forall (x1 :: k0) (y1 :: k0). p x1 y1 -> m (q x1 y1)) -> Path p x y -> m (q x y) #

QTraversable (Path :: (k -> k -> Type) -> k -> k -> Type) 
Instance details

Defined in Control.Category.Free

Methods

qtraverse :: Applicative m => (forall (x1 :: k0) (y1 :: k0). p x1 y1 -> m (q x1 y1)) -> Path p x y -> m (Path q x y) #

Category (Path p :: k -> k -> Type) 
Instance details

Defined in Control.Category.Free

Methods

id :: Path p a a #

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

(KnownSymbol cte, with1 ~ ((cte ::: common) ': with)) => Aliasable cte (statement with db params common) (Path (CommonTableExpression statement db params) with with1) 
Instance details

Defined in Squeal.PostgreSQL.Query.With

Methods

as :: statement with db params common -> Alias cte -> Path (CommonTableExpression statement db params) with with1 #

(forall (x1 :: k) (y1 :: k). Show (p x1 y1)) => Show (Path p x y) 
Instance details

Defined in Control.Category.Free

Methods

showsPrec :: Int -> Path p x y -> ShowS #

show :: Path p x y -> String #

showList :: [Path p x y] -> ShowS #

x ~ y => Semigroup (Path p x y) 
Instance details

Defined in Control.Category.Free

Methods

(<>) :: Path p x y -> Path p x y -> Path p x y #

sconcat :: NonEmpty (Path p x y) -> Path p x y #

stimes :: Integral b => b -> Path p x y -> Path p x y #

x ~ y => Monoid (Path p x y) 
Instance details

Defined in Control.Category.Free

Methods

mempty :: Path p x y #

mappend :: Path p x y -> Path p x y -> Path p x y #

mconcat :: [Path p x y] -> Path p x y #

data IsoQ (c :: k -> k -> Type) (x :: k) (y :: k) :: forall k. (k -> k -> Type) -> k -> k -> Type #

Arrows of IsoQ are bidirectional edges.

Constructors

IsoQ 

Fields

Instances
Category c => Category (IsoQ c :: k -> k -> Type) 
Instance details

Defined in Data.Quiver

Methods

id :: IsoQ c a a #

(.) :: IsoQ c b c0 -> IsoQ c a b -> IsoQ c a c0 #

Migratory (IsoQ (Indexed PQ IO ())) (IsoQ (Indexed PQ IO ()))

impure rewindable migrations

Instance details

Defined in Squeal.PostgreSQL.Session.Migration

Methods

runMigrations :: Path (Migration (IsoQ (Indexed PQ IO ()))) db0 db1 -> IsoQ (Indexed PQ IO ()) db0 db1 #

Migratory (IsoQ Definition) (IsoQ (Indexed PQ IO ()))

pure rewindable migrations

Instance details

Defined in Squeal.PostgreSQL.Session.Migration

Methods

runMigrations :: Path (Migration (IsoQ Definition)) db0 db1 -> IsoQ (Indexed PQ IO ()) db0 db1 #

(Eq (c x y), Eq (c y x)) => Eq (IsoQ c x y) 
Instance details

Defined in Data.Quiver

Methods

(==) :: IsoQ c x y -> IsoQ c x y -> Bool #

(/=) :: IsoQ c x y -> IsoQ c x y -> Bool #

(Ord (c x y), Ord (c y x)) => Ord (IsoQ c x y) 
Instance details

Defined in Data.Quiver

Methods

compare :: IsoQ c x y -> IsoQ c x y -> Ordering #

(<) :: IsoQ c x y -> IsoQ c x y -> Bool #

(<=) :: IsoQ c x y -> IsoQ c x y -> Bool #

(>) :: IsoQ c x y -> IsoQ c x y -> Bool #

(>=) :: IsoQ c x y -> IsoQ c x y -> Bool #

max :: IsoQ c x y -> IsoQ c x y -> IsoQ c x y #

min :: IsoQ c x y -> IsoQ c x y -> IsoQ c x y #

(Show (c x y), Show (c y x)) => Show (IsoQ c x y) 
Instance details

Defined in Data.Quiver

Methods

showsPrec :: Int -> IsoQ c x y -> ShowS #

show :: IsoQ c x y -> String #

showList :: [IsoQ c x y] -> ShowS #

(Category c, x ~ y) => Semigroup (IsoQ c x y) 
Instance details

Defined in Data.Quiver

Methods

(<>) :: IsoQ c x y -> IsoQ c x y -> IsoQ c x y #

sconcat :: NonEmpty (IsoQ c x y) -> IsoQ c x y #

stimes :: Integral b => b -> IsoQ c x y -> IsoQ c x y #

(Category c, x ~ y) => Monoid (IsoQ c x y) 
Instance details

Defined in Data.Quiver

Methods

mempty :: IsoQ c x y #

mappend :: IsoQ c x y -> IsoQ c x y -> IsoQ c x y #

mconcat :: [IsoQ c x y] -> IsoQ c x y #

newtype K a (b :: k) :: forall k. Type -> k -> Type #

The constant type functor.

Like Constant, but kind-polymorphic in its second argument and with a shorter name.

Constructors

K a 
Instances
Eq2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

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

Ord2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

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

Read2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

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

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

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

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [K a b] #

Show2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

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

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

NFData2 (K :: Type -> Type -> Type)

Since: sop-core-0.2.5.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftRnf2 :: (a -> ()) -> (b -> ()) -> K a b -> () #

Functor (K a :: Type -> Type) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

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

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

Monoid a => Applicative (K a :: Type -> Type) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

pure :: a0 -> K a a0 #

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

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

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

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

Foldable (K a :: Type -> Type) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

fold :: Monoid m => K a m -> m #

foldMap :: Monoid m => (a0 -> m) -> K a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> K a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> K a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> K a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> K a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> K a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> K a a0 -> a0 #

toList :: K a a0 -> [a0] #

null :: K a a0 -> Bool #

length :: K a a0 -> Int #

elem :: Eq a0 => a0 -> K a a0 -> Bool #

maximum :: Ord a0 => K a a0 -> a0 #

minimum :: Ord a0 => K a a0 -> a0 #

sum :: Num a0 => K a a0 -> a0 #

product :: Num a0 => K a a0 -> a0 #

Traversable (K a :: Type -> Type) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

traverse :: Applicative f => (a0 -> f b) -> K a a0 -> f (K a b) #

sequenceA :: Applicative f => K a (f a0) -> f (K a a0) #

mapM :: Monad m => (a0 -> m b) -> K a a0 -> m (K a b) #

sequence :: Monad m => K a (m a0) -> m (K a a0) #

Eq a => Eq1 (K a :: Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftEq :: (a0 -> b -> Bool) -> K a a0 -> K a b -> Bool #

Ord a => Ord1 (K a :: Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftCompare :: (a0 -> b -> Ordering) -> K a a0 -> K a b -> Ordering #

Read a => Read1 (K a :: Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (K a a0) #

liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [K a a0] #

liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (K a a0) #

liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [K a a0] #

Show a => Show1 (K a :: Type -> Type)

Since: sop-core-0.2.4.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> K a a0 -> ShowS #

liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [K a a0] -> ShowS #

NFData a => NFData1 (K a :: Type -> Type)

Since: sop-core-0.2.5.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

liftRnf :: (a0 -> ()) -> K a a0 -> () #

Eq a => Eq (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

(==) :: K a b -> K a b -> Bool #

(/=) :: K a b -> K a b -> Bool #

Ord a => Ord (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

compare :: K a b -> K a b -> Ordering #

(<) :: K a b -> K a b -> Bool #

(<=) :: K a b -> K a b -> Bool #

(>) :: K a b -> K a b -> Bool #

(>=) :: K a b -> K a b -> Bool #

max :: K a b -> K a b -> K a b #

min :: K a b -> K a b -> K a b #

Read a => Read (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

readsPrec :: Int -> ReadS (K a b) #

readList :: ReadS [K a b] #

readPrec :: ReadPrec (K a b) #

readListPrec :: ReadPrec [K a b] #

Show a => Show (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Methods

showsPrec :: Int -> K a b -> ShowS #

show :: K a b -> String #

showList :: [K a b] -> ShowS #

Generic (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

Associated Types

type Rep (K a b) :: Type -> Type #

Methods

from :: K a b -> Rep (K a b) x #

to :: Rep (K a b) x -> K a b #

Semigroup a => Semigroup (K a b)

Since: sop-core-0.4.0.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

(<>) :: K a b -> K a b -> K a b #

sconcat :: NonEmpty (K a b) -> K a b #

stimes :: Integral b0 => b0 -> K a b -> K a b #

Monoid a => Monoid (K a b)

Since: sop-core-0.4.0.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

mempty :: K a b #

mappend :: K a b -> K a b -> K a b #

mconcat :: [K a b] -> K a b #

NFData a => NFData (K a b)

Since: sop-core-0.2.5.0

Instance details

Defined in Data.SOP.BasicFunctors

Methods

rnf :: K a b -> () #

type Rep (K a b) 
Instance details

Defined in Data.SOP.BasicFunctors

type Rep (K a b) = D1 (MetaData "K" "Data.SOP.BasicFunctors" "sop-core-0.5.0.1-CJJL01S53WkJifrHVaTMB5" True) (C1 (MetaCons "K" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Code (K a b) 
Instance details

Defined in Generics.SOP.Instances

type Code (K a b) = (a ': ([] :: [Type])) ': ([] :: [[Type]])
type DatatypeInfoOf (K a b) 
Instance details

Defined in Generics.SOP.Instances

type DatatypeInfoOf (K a b) = Newtype "Data.SOP.BasicFunctors" "K" (Constructor "K")

unK :: K a b -> a #

Extract the contents of a K value.

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 rel rels cols, Has col cols ty, bys ~ ((,) rel col ': ([] :: [(Symbol, Symbol)]))) => IsQualified rel col (NP (By rels) bys) 
Instance details

Defined in Squeal.PostgreSQL.Query.Table

Methods

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

(Has tab (Join lat from) row, Has col row ty, tys ~ (ty ': ([] :: [NullType]))) => IsQualified tab col (NP (Expression Ungrouped lat with db params from) tys) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Expression Ungrouped lat with db params from) tys #

(Has tab (Join lat from) row, Has col row ty, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullType)]))) => IsQualified tab col (NP (Aliased (Expression Ungrouped lat with db params from)) columns) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Aliased (Expression Ungrouped lat with db params from)) columns #

(Has tab (Join lat from) row, Has col row ty, GroupedBy tab col bys, tys ~ (ty ': ([] :: [NullType]))) => IsQualified tab col (NP (Expression (Grouped bys) lat with db params from) tys) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Expression (Grouped bys) lat with db params from) tys #

(Has tab (Join lat from) row, Has col row ty, GroupedBy tab col bys, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullType)]))) => IsQualified tab col (NP (Aliased (Expression (Grouped bys) lat with db params from)) columns) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

(!) :: Alias tab -> Alias col -> NP (Aliased (Expression (Grouped bys) lat with db params from)) columns #

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 => 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) 
Instance details

Defined in Squeal.PostgreSQL.Type.Alias

Methods

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

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

Defined in Squeal.PostgreSQL.Type.List

Methods

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

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

Defined in Squeal.PostgreSQL.Query.Table

Methods

fromLabel :: NP (By rels) bys #

(HasUnique tab (Join lat from) row, Has col row ty, tys ~ (ty ': ([] :: [NullType]))) => IsLabel col (NP (Expression Ungrouped lat with db params from) tys) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Expression Ungrouped lat with db params from) tys #

(HasUnique tab (Join lat from) row, Has col row ty, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullType)]))) => IsLabel col (NP (Aliased (Expression Ungrouped lat with db params from)) columns) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Aliased (Expression Ungrouped lat with db params from)) columns #

(HasUnique tab (Join lat from) row, Has col row ty, GroupedBy tab col bys, tys ~ (ty ': ([] :: [NullType]))) => IsLabel col (NP (Expression (Grouped bys) lat with db params from) tys) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Expression (Grouped bys) lat with db params from) tys #

(HasUnique tab (Join lat from) row, Has col row ty, GroupedBy tab col bys, columns ~ ((col ::: ty) ': ([] :: [(Symbol, NullType)]))) => IsLabel col (NP (Aliased (Expression (Grouped bys) lat with db params from)) columns) 
Instance details

Defined in Squeal.PostgreSQL.Expression

Methods

fromLabel :: NP (Aliased (Expression (Grouped bys) lat with db params from)) columns #

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

Defined in Squeal.PostgreSQL.Type.Alias

Methods

fromLabel :: NP Alias aliases #

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

Defined in Squeal.PostgreSQL.Type.Schema

Methods

label :: NP PGlabel labels #

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 labels => RenderSQL (NP PGlabel labels) 
Instance details

Defined in Squeal.PostgreSQL.Type.Schema

Methods

renderSQL :: NP PGlabel labels -> ByteString #

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

Defined in Squeal.PostgreSQL.Type.Alias

Methods

renderSQL :: NP Alias aliases -> ByteString #

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

newtype StateT s (m :: Type -> Type) a #

A state transformer monad parameterized by:

  • s - The state.
  • m - The inner monad.

The return function leaves the state unchanged, while >>= uses the final state of the first computation as the initial state of the second.

Constructors

StateT 

Fields

Instances
MonadBaseControl b m => MonadBaseControl b (StateT s m) 
Instance details

Defined in Control.Monad.Trans.Control

Associated Types

type StM (StateT s m) a :: Type #

Methods

liftBaseWith :: (RunInBase (StateT s m) b -> b a) -> StateT s m a #

restoreM :: StM (StateT s m) a -> StateT s m a #

MonadPQ db m => MonadPQ db (StateT s m) 
Instance details

Defined in Squeal.PostgreSQL.Session.Monad

Methods

executeParams :: Statement db x y -> x -> StateT s m (Result y) #

executeParams_ :: Statement db x () -> x -> StateT s m () #

execute :: Statement db () y -> StateT s m (Result y) #

execute_ :: Statement db () () -> StateT s m () #

executePrepared :: Traversable list => Statement db x y -> list x -> StateT s m (list (Result y)) #

executePrepared_ :: Foldable list => Statement db x () -> list x -> StateT s m () #

MonadTrans (StateT s) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

lift :: Monad m => m a -> StateT s m a #

MonadTransControl (StateT s) 
Instance details

Defined in Control.Monad.Trans.Control

Associated Types

type StT (StateT s) a :: Type #

Methods

liftWith :: Monad m => (Run (StateT s) -> m a) -> StateT s m a #

restoreT :: Monad m => m (StT (StateT s) a) -> StateT s m a #

Monad m => Monad (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

(>>=) :: StateT s m a -> (a -> StateT s m b) -> StateT s m b #

(>>) :: StateT s m a -> StateT s m b -> StateT s m b #

return :: a -> StateT s m a #

fail :: String -> StateT s m a #

Functor m => Functor (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

fmap :: (a -> b) -> StateT s m a -> StateT s m b #

(<$) :: a -> StateT s m b -> StateT s m a #

MonadFix m => MonadFix (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

mfix :: (a -> StateT s m a) -> StateT s m a #

MonadFail m => MonadFail (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

fail :: String -> StateT s m a #

(Functor m, Monad m) => Applicative (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

pure :: a -> StateT s m a #

(<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b #

liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c #

(*>) :: StateT s m a -> StateT s m b -> StateT s m b #

(<*) :: StateT s m a -> StateT s m b -> StateT s m a #

(Functor m, MonadPlus m) => Alternative (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

empty :: StateT s m a #

(<|>) :: StateT s m a -> StateT s m a -> StateT s m a #

some :: StateT s m a -> StateT s m [a] #

many :: StateT s m a -> StateT s m [a] #

MonadPlus m => MonadPlus (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

mzero :: StateT s m a #

mplus :: StateT s m a -> StateT s m a -> StateT s m a #

Contravariant m => Contravariant (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

contramap :: (a -> b) -> StateT s m b -> StateT s m a #

(>$) :: b -> StateT s m b -> StateT s m a #

MonadIO m => MonadIO (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

liftIO :: IO a -> StateT s m a #

PrimMonad m => PrimMonad (StateT s m) 
Instance details

Defined in Control.Monad.Primitive

Associated Types

type PrimState (StateT s m) :: Type #

Methods

primitive :: (State# (PrimState (StateT s m)) -> (#State# (PrimState (StateT s m)), a#)) -> StateT s m a #

type StT (StateT s) a 
Instance details

Defined in Control.Monad.Trans.Control

type StT (StateT s) a = (a, s)
type PrimState (StateT s m) 
Instance details

Defined in Control.Monad.Primitive

type PrimState (StateT s m) = PrimState m
type StM (StateT s m) a 
Instance details

Defined in Control.Monad.Trans.Control

type StM (StateT s m) a = ComposeSt (StateT s) m a

data Oid #

Instances
Eq Oid 
Instance details

Defined in Database.PostgreSQL.LibPQ

Methods

(==) :: Oid -> Oid -> Bool #

(/=) :: Oid -> Oid -> Bool #

Ord Oid 
Instance details

Defined in Database.PostgreSQL.LibPQ

Methods

compare :: Oid -> Oid -> Ordering #

(<) :: Oid -> Oid -> Bool #

(<=) :: Oid -> Oid -> Bool #

(>) :: Oid -> Oid -> Bool #

(>=) :: Oid -> Oid -> Bool #

max :: Oid -> Oid -> Oid #

min :: Oid -> Oid -> Oid #

Read Oid 
Instance details

Defined in Database.PostgreSQL.LibPQ

Show Oid 
Instance details

Defined in Database.PostgreSQL.LibPQ

Methods

showsPrec :: Int -> Oid -> ShowS #

show :: Oid -> String #

showList :: [Oid] -> ShowS #

Storable Oid 
Instance details

Defined in Database.PostgreSQL.LibPQ

Methods

sizeOf :: Oid -> Int #

alignment :: Oid -> Int #

peekElemOff :: Ptr Oid -> Int -> IO Oid #

pokeElemOff :: Ptr Oid -> Int -> Oid -> IO () #

peekByteOff :: Ptr b -> Int -> IO Oid #

pokeByteOff :: Ptr b -> Int -> Oid -> IO () #

peek :: Ptr Oid -> IO Oid #

poke :: Ptr Oid -> Oid -> IO () #

Inline Oid 
Instance details

Defined in Squeal.PostgreSQL.Expression.Inline

Methods

inline :: Oid -> Expr (null (PG Oid)) #

FromPG Oid 
Instance details

Defined in Squeal.PostgreSQL.Session.Decode

IsPG Oid

PGint2

Instance details

Defined in Squeal.PostgreSQL.Type.PG

Associated Types

type PG Oid :: PGType #

ToPG db Oid 
Instance details

Defined in Squeal.PostgreSQL.Session.Encode

Methods

toPG :: Oid -> ReaderT (K Connection db) IO Encoding #

type PG Oid 
Instance details

Defined in Squeal.PostgreSQL.Type.PG

type PG Oid = PGoid

data ExecStatus #

Constructors

EmptyQuery

The string sent to the server was empty.

CommandOk

Successful completion of a command returning no data.

TuplesOk

Successful completion of a command returning data (such as a SELECT or SHOW).

CopyOut

Copy Out (from server) data transfer started.

CopyIn

Copy In (to server) data transfer started.

CopyBoth

Copy In/Out data transfer started.

BadResponse

The server's response was not understood.

NonfatalError

A nonfatal error (a notice or warning) occurred.

FatalError

A fatal error occurred.

SingleTuple

The PGresult contains a single result tuple from the current command. This status occurs only when single-row mode has been selected for the query.

data Connection #

Connection encapsulates a connection to the backend.

Instances
Eq Connection 
Instance details

Defined in Database.PostgreSQL.LibPQ.Internal

dropFunctionIfExists #

Arguments

:: (Has sch db schema, KnownSymbol fun) 
=> QualifiedAlias sch fun

function alias

-> Definition db (Alter sch (DropSchemumIfExists fun Function schema) db) 

Drop a function.

>>> type Fn = 'Function ( '[ 'Null 'PGint4, 'Null 'PGint4] :=> 'Returns ( 'Null 'PGint4))
>>> :{
let
  definition :: Definition (Public '[]) (Public '[])
  definition = dropFunctionIfExists #fn
in printSQL definition
:}
DROP FUNCTION IF EXISTS "fn";

dropFunction #

Arguments

:: (Has sch db schema, KnownSymbol fun) 
=> QualifiedAlias sch fun

function alias

-> Definition db (Alter sch (DropSchemum fun Function schema) db) 

Drop a function.

>>> type Fn = 'Function ( '[ 'Null 'PGint4, 'Null 'PGint4] :=> 'Returns ( 'Null 'PGint4))
>>> :{
let
  definition :: Definition (Public '["fn" ::: Fn]) (Public '[])
  definition = dropFunction #fn
in printSQL definition
:}
DROP FUNCTION "fn";

createOrReplaceSetFunction #

Arguments

:: (Has sch db schema, KnownSymbol fun, SListI args, SListI rets) 
=> QualifiedAlias sch fun

function alias

-> NP (TypeExpression db) args

arguments

-> NP (Aliased (TypeExpression db)) rets

return type

-> FunctionDefinition db args (ReturnsTable rets)

function definition

-> Definition db (Alter sch (CreateOrReplace fun (Function (args :=> ReturnsTable rets)) schema) db) 

Create or replace a set function.

>>> type Tab = 'Table ('[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4])
>>> type Fn = 'Function ('[ 'Null 'PGint4, 'Null 'PGint4] :=> 'ReturnsTable '["ret" ::: 'Null 'PGint4])
>>> :{
let
  definition :: Definition (Public '["tab" ::: Tab, "fn" ::: Fn]) (Public '["tab" ::: Tab, "fn" ::: Fn])
  definition = createOrReplaceSetFunction #fn (int4 *: int4) (int4 `as` #ret) $
    languageSqlQuery (select_ ((param @1 * param @2 + #col) `as` #ret) (from (table #tab)))
in printSQL definition
:}
CREATE OR REPLACE FUNCTION "fn" (int4, int4) RETURNS TABLE ("ret" int4) language sql as $$ SELECT ((($1 :: int4) * ($2 :: int4)) + "col") AS "ret" FROM "tab" AS "tab" $$;

createSetFunction #

Arguments

:: (Has sch db schema, KnownSymbol fun, SListI args, SListI rets) 
=> QualifiedAlias sch fun

function alias

-> NP (TypeExpression db) args

arguments

-> NP (Aliased (TypeExpression db)) rets

return type

-> FunctionDefinition db args (ReturnsTable rets)

function definition

-> Definition db (Alter sch (Create fun (Function (args :=> ReturnsTable rets)) schema) db) 

Create a set function.

>>> type Tab = 'Table ('[] :=> '["col" ::: 'NoDef :=> 'Null 'PGint4])
>>> type Fn = 'Function ('[ 'Null 'PGint4, 'Null 'PGint4] :=> 'ReturnsTable '["ret" ::: 'Null 'PGint4])
>>> :{
let
  definition :: Definition (Public '["tab" ::: Tab]) (Public '["tab" ::: Tab, "fn" ::: Fn])
  definition = createSetFunction #fn (int4 *: int4) (int4 `as` #ret) $
    languageSqlQuery (select_ ((param @1 * param @2 + #col) `as` #ret) (from (table #tab)))
in printSQL definition
:}
CREATE FUNCTION "fn" (int4, int4) RETURNS TABLE ("ret" int4) language sql as $$ SELECT ((($1 :: int4) * ($2 :: int4)) + "col") AS "ret" FROM "tab" AS "tab" $$;

languageSqlQuery #

Arguments

:: Query ([] :: [(Symbol, RowType)]) ([] :: [(Symbol, RowType)]) db args rets

function body

-> FunctionDefinition db args (ReturnsTable rets) 

Use a parametrized Query as a function body

languageSqlExpr #

Arguments

:: Expression Ungrouped ([] :: [(Symbol, RowType)]) ([] :: [(Symbol, RowType)]) db args ([] :: [(Symbol, RowType)]) ret

function body

-> FunctionDefinition db args (Returns ret) 

Use a parameterized Expression as a function body

createOrReplaceFunction #

Arguments

:: (Has sch db schema, KnownSymbol fun, SListI args) 
=> QualifiedAlias sch fun

function alias

-> NP (TypeExpression db) args

arguments

-> TypeExpression db ret

return type

-> FunctionDefinition db args (Returns ret)

function definition

-> Definition db (Alter sch (CreateOrReplace fun (Function (args :=> Returns ret)) schema) db) 

Create or replace a function. It is not possible to change the name or argument types or return type of a function this way.

>>> type Fn = 'Function ( '[ 'Null 'PGint4, 'Null 'PGint4] :=> 'Returns ( 'Null 'PGint4))
>>> :{
let
  definition :: Definition (Public '["fn" ::: Fn]) (Public '["fn" ::: Fn])
  definition =
    createOrReplaceFunction #fn
      (int4 *: int4) int4 $
      languageSqlExpr (param @1 @('Null 'PGint4) * param @2 @('Null 'PGint4) + 1)
in printSQL definition
:}
CREATE OR REPLACE FUNCTION "fn" (int4, int4) RETURNS int4 language sql as $$ SELECT * FROM (VALUES (((($1 :: int4) * ($2 :: int4)) + (1 :: int4)))) AS t ("ret") $$;

createFunction #

Arguments

:: (Has sch db schema, KnownSymbol fun, SListI args) 
=> QualifiedAlias sch fun

function alias

-> NP (TypeExpression db) args

arguments

-> TypeExpression db ret

return type

-> FunctionDefinition db args (Returns ret)

function definition

-> Definition db (Alter sch (Create fun (Function (args :=> Returns ret)) schema) db) 

Create a function.

>>> type Fn = 'Function ( '[ 'Null 'PGint4, 'Null 'PGint4] :=> 'Returns ( 'Null 'PGint4))
>>> :{
let
  definition :: Definition (Public '[]) (Public '["fn" ::: Fn])
  definition = createFunction #fn (int4 *: int4) int4 $
    languageSqlExpr (param @1 * param @2 + 1)
in printSQL definition
:}
CREATE FUNCTION "fn" (int4, int4) RETURNS int4 language sql as $$ SELECT * FROM (VALUES (((($1 :: int4) * ($2 :: int4)) + (1 :: int4)))) AS t ("ret") $$;

newtype FunctionDefinition (db :: k) (args :: k1) (ret :: k2) :: forall k k1 k2. k -> k1 -> k2 -> Type #

Body of a user defined function

Instances
Eq (FunctionDefinition db args ret) 
Instance details

Defined in Squeal.PostgreSQL.Definition.Function

Methods

(==) :: FunctionDefinition db args ret -> FunctionDefinition db args ret -> Bool #

(/=) :: FunctionDefinition db args ret -> FunctionDefinition db args ret -> Bool #

Show (FunctionDefinition db args ret) 
Instance details

Defined in Squeal.PostgreSQL.Definition.Function

Methods

showsPrec :: Int -> FunctionDefinition db args ret -> ShowS #

show :: FunctionDefinition db args ret -> String #

showList :: [FunctionDefinition db args ret] -> ShowS #

Generic (FunctionDefinition db args ret) 
Instance details

Defined in Squeal.PostgreSQL.Definition.Function

Associated Types

type Rep (FunctionDefinition db args ret) :: Type -> Type #

Methods

from :: FunctionDefinition db args ret -> Rep (FunctionDefinition db args ret) x #

to ::