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

Portabilityunknown
Stabilityexperimental
Maintainerex8k.hibino@gmail.com
Safe HaskellNone

Database.Relational.Query.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

ProjectableApplicative (Pi a)

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

ProjectableFunctor (Pi a)

Compose seed of projection path Pi which has record result type.

pfmap :: ProductConstructor (a -> b) => (a -> b) -> Pi r a -> Pi r bSource

Projectable fmap of Pi type.

pap :: Pi r (a -> b) -> Pi r a -> Pi r bSource

Projectable ap of Pi type.

width :: Pi r a -> IntSource

Get record width.

(<.>) :: Pi a b -> Pi b c -> Pi a cSource

Compose projection path.

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

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

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

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

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

Unsafely project untyped value list.

definePiSource

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 infered 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.

defineDirectPiSource

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 infered PersistableRecordWidth.

unsafeExpandIndexes :: Pi a b -> [Int]Source

Unsafely untype key to expand indexes.