Copyright | 2013 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
- pfmap :: ProductConstructor (a -> b) => (a -> b) -> Pi r a -> Pi r b
- pap :: Pi r (a -> b) -> Pi r a -> Pi r b
- width :: 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 :: [a] -> Pi r0 r1 -> [a]
- definePi :: PersistableWidth r1 => Int -> Pi r0 r1
- defineDirectPi' :: PersistableRecordWidth r1 -> [Int] -> Pi r0 r1
- defineDirectPi :: PersistableWidth r1 => [Int] -> Pi r0 r1
- unsafeExpandIndexes :: 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`

.

ProjectableApplicative (Pi a) | Compose projection path |

ProjectableFunctor (Pi a) | Compose seed of projection path |

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

Projectable fmap of `Pi`

type.

(<?.?>) :: 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 `>=>`

.

:: 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 :: Pi a b -> [Int] Source

Unsafely untype key to expand indexes.