rel8-internal
Safe HaskellNone
LanguageHaskell2010

Rel8.Internal.Table.NonEmpty

Synopsis

Documentation

newtype NonEmptyTable (context :: Context) a Source #

A NonEmptyTable value contains one or more instances of a. You construct NonEmptyTables with some or nonEmptyAgg.

Instances

Instances details
(Table context a, context ~ context') => Table context' (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

Associated Types

type Columns (NonEmptyTable context a) 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type Context (NonEmptyTable context a) 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type Context (NonEmptyTable context a) = Context a
type FromExprs (NonEmptyTable context a) 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type FromExprs (NonEmptyTable context a) = NonEmpty (FromExprs a)

Methods

toColumns :: NonEmptyTable context a -> Columns (NonEmptyTable context a) context' Source #

fromColumns :: Columns (NonEmptyTable context a) context' -> NonEmptyTable context a Source #

fromResult :: Columns (NonEmptyTable context a) Result -> FromExprs (NonEmptyTable context a) Source #

toResult :: FromExprs (NonEmptyTable context a) -> Columns (NonEmptyTable context a) Result Source #

context ~ Expr => AltTable (NonEmptyTable context) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

Methods

(<|>:) :: Table Expr a => NonEmptyTable context a -> NonEmptyTable context a -> NonEmptyTable context a 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 #

(Table Expr a, context ~ Expr) => Semigroup (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

Methods

(<>) :: NonEmptyTable context a -> NonEmptyTable context a -> NonEmptyTable context a #

sconcat :: NonEmpty (NonEmptyTable context a) -> NonEmptyTable context a #

stimes :: Integral b => b -> NonEmptyTable context a -> NonEmptyTable context a #

(EqTable a, context ~ Expr) => EqTable (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

Methods

eqTable :: Columns (NonEmptyTable context a) (Dict (Sql DBEq)) Source #

(OrdTable a, context ~ Expr) => OrdTable (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

Methods

ordTable :: Columns (NonEmptyTable context a) (Dict (Sql DBOrd)) Source #

(ToExprs exprs a, context ~ Expr) => ToExprs (NonEmptyTable context exprs) (NonEmpty a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type Transpose to (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type Transpose to (NonEmptyTable context a) = NonEmptyTable to (Transpose to a)
type Columns (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type Context (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type Context (NonEmptyTable context a) = Context a
type FromExprs (NonEmptyTable context a) Source # 
Instance details

Defined in Rel8.Internal.Table.NonEmpty

type FromExprs (NonEmptyTable context a) = NonEmpty (FromExprs a)

($+) :: Projecting a (Expr b) => Projection a (Expr b) -> NonEmptyTable Expr a -> Expr (NonEmpty b) infixl 4 Source #

Project a single expression out of a NonEmptyTable.

nonEmptyTable :: Table Expr a => NonEmpty a -> NonEmptyTable Expr a Source #

Construct a NonEmptyTable from a non-empty list of expressions.

nameNonEmptyTable Source #

Arguments

:: Table Name a 
=> a

The names of the columns of elements of the list.

-> NonEmptyTable Name a 

Construct a NonEmptyTable in the Name context. This can be useful if you have a NonEmptyTable that you are storing in a table and need to construct a TableSchema.

head1 :: Table Expr a => NonEmptyTable Expr a -> a Source #

Get the first element of a NonEmptyTable.

index1 :: Table Expr a => Expr Int32 -> NonEmptyTable Expr a -> NullTable Expr a Source #

index1 i as extracts a single element from as, returning nullTable if i is out of range. Note that although PostgreSQL array indexes are 1-based (by default), this function is always 0-based.

last1 :: Table Expr a => NonEmptyTable Expr a -> a Source #

Get the last element of a NonEmptyTable.