rel8-internal
Safe HaskellNone
LanguageHaskell2010

Rel8.Internal.Table.Projection

Synopsis

Documentation

type Projection a b = Transpose (Field a) a -> Transpose (Field a) b Source #

A Projection a bs is a special type of function a -> b whereby the resulting b is guaranteed to be composed only from columns contained in a.

class Projectable (f :: Type -> Type) where Source #

Projectable f means that f is a kind of functor on Tables that allows the mapping of a Projection over its underlying columns.

Methods

project :: Projecting a b => Projection a b -> f a -> f b Source #

Map a Projection over f.

Instances

Instances details
Projectable Query Source # 
Instance details

Defined in Rel8.Internal.Query

Methods

project :: Projecting a b => Projection a b -> Query a -> Query b Source #

Projectable (ListTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.List

Methods

project :: Projecting a b => Projection a b -> ListTable context a -> ListTable context b Source #

Projectable (MaybeTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.Maybe

Methods

project :: Projecting a b => Projection a b -> MaybeTable context a -> MaybeTable context b Source #

Projectable (NonEmptyTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

Methods

project :: Projecting a b => Projection a b -> NonEmptyTable context a -> NonEmptyTable context b Source #

Projectable (NullTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.Null

Methods

project :: Projecting a b => Projection a b -> NullTable context a -> NullTable context b Source #

Projectable (Nullify context) Source # 
Instance details

Defined in Rel8.Internal.Table.Nullify

Methods

project :: Projecting a b => Projection a b -> Nullify context a -> Nullify context b Source #

Projectable (EitherTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.Either

Methods

project :: Projecting a0 b => Projection a0 b -> EitherTable context a a0 -> EitherTable context a b Source #

Projectable (TheseTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.These

Methods

project :: Projecting a0 b => Projection a0 b -> TheseTable context a a0 -> TheseTable context a b Source #

class Biprojectable (p :: Type -> Type -> Type) where Source #

Biprojectable p means that p is a kind of bifunctor on Tables that allows the mapping of a pair of Projections over its underlying columns.

Methods

biproject :: (Projecting a b, Projecting c d) => Projection a b -> Projection c d -> p a c -> p b d Source #

Map a pair of Projections over p.

Instances

Instances details
Biprojectable (EitherTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.Either

Methods

biproject :: (Projecting a b, Projecting c d) => Projection a b -> Projection c d -> EitherTable context a c -> EitherTable context b d Source #

Biprojectable (TheseTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.These

Methods

biproject :: (Projecting a b, Projecting c d) => Projection a b -> Projection c d -> TheseTable context a c -> TheseTable context b d Source #

class (Transposes (Context a) (Field a) a (Transpose (Field a) a), Transposes (Context a) (Field a) b (Transpose (Field a) b)) => Projecting a b Source #

The constraint Projecting a b ensures that Projection a b is a usable Projection.

Instances

Instances details
(Transposes (Context a) (Field a) a (Transpose (Field a) a), Transposes (Context a) (Field a) b (Transpose (Field a) b)) => Projecting a b Source # 
Instance details

Defined in Rel8.Internal.Table.Projection

apply :: forall a b (context :: Context). Projecting a b => Projection a b -> Columns a context -> Columns b context Source #