pg-store-0.5.0: Simple storage interface to PostgreSQL

Copyright(c) Ole Krüger 2016
LicenseBSD3
MaintainerOle Krüger <ole@vprsm.de>
Safe HaskellSafe
LanguageHaskell2010

Database.PostgreSQL.Store.Tuple

Description

 

Synopsis

Documentation

data Tuple ts where Source #

Generic product type

Constructors

Nil :: Tuple '[] 
Cons :: t -> !(Tuple ts) -> Tuple (t ': ts) 

Instances

ShowElement ts => Show (Tuple ts) Source # 

Methods

showsPrec :: Int -> Tuple ts -> ShowS #

show :: Tuple ts -> String #

showList :: [Tuple ts] -> ShowS #

class HasElement n ts r | n ts -> r where Source #

Helper class to extract an element from a Tuple.

Minimal complete definition

getElement

Methods

getElement :: Tuple ts -> Tagged n r Source #

Extract the n-th element from the product.

Instances

((<=) 1 n, HasElement ((-) n 1) ts r) => HasElement n ((:) Type t ts) r Source #

Extract element that is not the head

Methods

getElement :: Tuple ((Type ': t) ts) -> Tagged Nat n r Source #

HasElement 0 ((:) Type t ts) t Source #

Extract head element

Methods

getElement :: Tuple ((Type ': t) ts) -> Tagged Nat 0 t Source #

getElement0 :: Tuple (r ': ts) -> r Source #

Extract element at index 0.

getElement1 :: Tuple (t0 ': (r ': ts)) -> r Source #

Extract element at index 1.

getElement2 :: Tuple (t0 ': (t1 ': (r ': ts))) -> r Source #

Extract element at index 2.

getElement3 :: Tuple (t0 ': (t1 ': (t2 ': (r ': ts)))) -> r Source #

Extract element at index 3.

getElement4 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (r ': ts))))) -> r Source #

Extract element at index 4.

getElement5 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (r ': ts)))))) -> r Source #

Extract element at index 5.

getElement6 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (r ': ts))))))) -> r Source #

Extract element at index 6.

getElement7 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (r ': ts)))))))) -> r Source #

Extract element at index 7.

getElement8 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (r ': ts))))))))) -> r Source #

Extract element at index 8.

getElement9 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (t8 ': (r ': ts)))))))))) -> r Source #

Extract element at index 9.

type family Function (ps :: [Type]) r where ... Source #

Build a function type using the given parameter types and return type.

Equations

Function '[] r = r 
Function (p ': ps) r = p -> Function ps r 

class WithTuple ts where Source #

Generate a function which collects the parameters and packs then into a 'Tuple.

Minimal complete definition

withTuple

Methods

withTuple :: (Tuple ts -> r) -> Function ts r Source #

Instances

WithTuple ([] Type) Source # 

Methods

withTuple :: (Tuple [Type] -> r) -> Function [Type] r Source #

WithTuple ts => WithTuple ((:) Type t ts) Source # 

Methods

withTuple :: (Tuple ((Type ': t) ts) -> r) -> Function ((Type ': t) ts) r Source #

withTuple :: WithTuple ts => (Tuple ts -> r) -> Function ts r Source #