Copyright | 2013-2017 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | ex8k.hibino@gmail.com |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
This module defines typed projection path objects. Contains internal structure and unsafe interfaces.
- data Pi r0 r1
- width' :: PersistableWidth r => Pi r ct -> PersistableRecordWidth ct
- width :: PersistableWidth r => Pi r a -> Int
- (<.>) :: Pi a b -> Pi b c -> Pi a c
- (<?.>) :: Pi a (Maybe b) -> Pi b c -> Pi a (Maybe c)
- (<?.?>) :: Pi a (Maybe b) -> Pi b (Maybe c) -> Pi a (Maybe c)
- pi :: PersistableRecordWidth r0 -> Pi r0 r1 -> [a] -> [a]
- definePi :: PersistableWidth r1 => Int -> Pi r0 r1
- defineDirectPi' :: PersistableRecordWidth r1 -> [Int] -> Pi r0 r1
- defineDirectPi :: PersistableWidth r1 => [Int] -> Pi r0 r1
- unsafeExpandIndexes' :: PersistableRecordWidth a -> Pi a b -> [Int]
- unsafeExpandIndexes :: PersistableWidth a => Pi a b -> [Int]
Projection path
Projection path from type r0
into type r1
.
This type also indicate key object which type is r1
for record type r0
.
ProductIsoFunctor (Pi a) Source # | Map projection path |
ProductIsoApplicative (Pi a) Source # | Compose projection path |
Category * Pi Source # | |
ProductIsoEmpty (Pi a) () Source # | |
PersistableWidth r0 => Show (Pi r0 r1) Source # | |
width' :: PersistableWidth r => Pi r ct -> PersistableRecordWidth ct Source #
Get record width proof object.
(<?.?>) :: 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.
:: 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
.
:: 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
.
:: 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.