relational-query-0.12.0.0: Typeful, Modular, Relational, algebraic query engine

Copyright2013-2017 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Pi.Unsafe

Contents

Description

This module defines typed projection path objects. Contains internal structure and unsafe interfaces.

Synopsis

Projection path

data Pi r0 r1 Source #

Projection path from type r0 into type r1. This type also indicate key object which type is r1 for record type r0.

Instances

ProductIsoFunctor (Pi a) Source #

Map projection path Pi which has record result type.

Methods

(|$|) :: ProductConstructor (a -> b) => (a -> b) -> Pi a a -> Pi a b #

ProductIsoApplicative (Pi a) Source #

Compose projection path Pi which has record result type using applicative style.

Methods

pureP :: ProductConstructor a => a -> Pi a a #

(|*|) :: Pi a (a -> b) -> Pi a a -> Pi a b #

Category * Pi Source # 

Methods

id :: cat a a #

(.) :: cat b c -> cat a b -> cat a c #

ProductIsoEmpty (Pi a) () Source # 

Methods

pureE :: Pi a () #

peRight :: Pi a (a, ()) -> Pi a a #

peLeft :: Pi a ((), a) -> Pi a a #

PersistableWidth r0 => Show (Pi r0 r1) Source # 

Methods

showsPrec :: Int -> Pi r0 r1 -> ShowS #

show :: Pi r0 r1 -> String #

showList :: [Pi r0 r1] -> ShowS #

width' :: PersistableWidth r => Pi r ct -> PersistableRecordWidth ct Source #

Get record width proof object.

width :: PersistableWidth r => Pi r a -> Int Source #

Get record width.

(<.>) :: Pi a b -> Pi b c -> Pi a c infixl 8 Source #

Compose projection path.

(<?.>) :: Pi a (Maybe b) -> Pi b c -> Pi a (Maybe c) infixl 8 Source #

Compose projection path. Maybe phantom functor is map-ed.

(<?.?>) :: Pi a (Maybe b) -> Pi b (Maybe c) -> Pi a (Maybe c) infixl 8 Source #

Compose projection path. Maybe phantom functors are join-ed like >=>.

pi :: PersistableRecordWidth r0 -> Pi r0 r1 -> [a] -> [a] Source #

Unsafely project untyped value list.

definePi Source #

Arguments

:: PersistableWidth r1 
=> Int

Index of flat SQL value list

-> Pi r0 r1

Result projection path

Unsafely define projection path from type r0 into type r1. Use inferred PersistableRecordWidth.

defineDirectPi' Source #

Arguments

:: PersistableRecordWidth r1 
-> [Int]

Indexes of flat SQL value list

-> Pi r0 r1

Result projection path

Unsafely define projection path from type r0 into type r1.

defineDirectPi Source #

Arguments

:: PersistableWidth r1 
=> [Int]

Indexes of flat SQL value list

-> Pi r0 r1

Result projection path

Unsafely define projection path from type r0 into type r1. Use inferred PersistableRecordWidth.

unsafeExpandIndexes' :: PersistableRecordWidth a -> Pi a b -> [Int] Source #

Unsafely expand indexes from key.

unsafeExpandIndexes :: PersistableWidth a => Pi a b -> [Int] Source #

Unsafely expand indexes from key. Infered width version.