Copyright | 2013-2017 Kei Hibino |
---|---|

License | BSD3 |

Maintainer | ex8k.hibino@gmail.com |

Stability | experimental |

Portability | unknown |

Safe Haskell | None |

Language | Haskell2010 |

This module defines set operations on monadic Relation operations.

## Synopsis

- type JoinRestriction a b = Record Flat a -> Record Flat b -> Predicate Flat
- inner' :: Relation pa a -> Relation pb b -> [JoinRestriction a b] -> Relation (pa, pb) (a, b)
- left' :: Relation pa a -> Relation pb b -> [JoinRestriction a (Maybe b)] -> Relation (pa, pb) (a, Maybe b)
- right' :: Relation pa a -> Relation pb b -> [JoinRestriction (Maybe a) b] -> Relation (pa, pb) (Maybe a, b)
- full' :: Relation pa a -> Relation pb b -> [JoinRestriction (Maybe a) (Maybe b)] -> Relation (pa, pb) (Maybe a, Maybe b)
- inner :: Relation () a -> Relation () b -> [JoinRestriction a b] -> Relation () (a, b)
- left :: Relation () a -> Relation () b -> [JoinRestriction a (Maybe b)] -> Relation () (a, Maybe b)
- right :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) b] -> Relation () (Maybe a, b)
- full :: Relation () a -> Relation () b -> [JoinRestriction (Maybe a) (Maybe b)] -> Relation () (Maybe a, Maybe b)
- on' :: ([JoinRestriction a b] -> Relation pc (a, b)) -> [JoinRestriction a b] -> Relation pc (a, b)
- union :: Relation () a -> Relation () a -> Relation () a
- except :: Relation () a -> Relation () a -> Relation () a
- intersect :: Relation () a -> Relation () a -> Relation () a
- unionAll :: Relation () a -> Relation () a -> Relation () a
- exceptAll :: Relation () a -> Relation () a -> Relation () a
- intersectAll :: Relation () a -> Relation () a -> Relation () a
- union' :: Relation p a -> Relation q a -> Relation (p, q) a
- except' :: Relation p a -> Relation q a -> Relation (p, q) a
- intersect' :: Relation p a -> Relation q a -> Relation (p, q) a
- unionAll' :: Relation p a -> Relation q a -> Relation (p, q) a
- exceptAll' :: Relation p a -> Relation q a -> Relation (p, q) a
- intersectAll' :: Relation p a -> Relation q a -> Relation (p, q) a

# Direct style join

:: Relation pa a | Left query to join |

-> Relation pb b | Right query to join |

-> [JoinRestriction a b] | Join restrictions |

-> Relation (pa, pb) (a, b) | Result joined relation |

Direct inner join with place-holder parameters.

:: Relation pa a | Left query to join |

-> Relation pb b | Right query to join |

-> [JoinRestriction a (Maybe b)] | Join restrictions |

-> Relation (pa, pb) (a, Maybe b) | Result joined relation |

Direct left outer join with place-holder parameters.

:: Relation pa a | Left query to join |

-> Relation pb b | Right query to join |

-> [JoinRestriction (Maybe a) b] | Join restrictions |

-> Relation (pa, pb) (Maybe a, b) | Result joined relation |

Direct right outer join with place-holder parameters.

:: Relation pa a | Left query to join |

-> Relation pb b | Right query to join |

-> [JoinRestriction (Maybe a) (Maybe b)] | Join restrictions |

-> Relation (pa, pb) (Maybe a, Maybe b) | Result joined relation |

Direct full outer join with place-holder parameters.

:: Relation () a | Left query to join |

-> Relation () b | Right query to join |

-> [JoinRestriction a b] | Join restrictions |

-> Relation () (a, b) | Result joined relation |

Direct inner join.

:: Relation () a | Left query to join |

-> Relation () b | Right query to join |

-> [JoinRestriction a (Maybe b)] | Join restrictions |

-> Relation () (a, Maybe b) | Result joined relation |

Direct left outer join.

:: Relation () a | Left query to join |

-> Relation () b | Right query to join |

-> [JoinRestriction (Maybe a) b] | Join restrictions |

-> Relation () (Maybe a, b) | Result joined relation |

Direct right outer join.

:: Relation () a | Left query to join |

-> Relation () b | Right query to join |

-> [JoinRestriction (Maybe a) (Maybe b)] | Join restrictions |

-> Relation () (Maybe a, Maybe b) | Result joined relation |

Direct full outer join.

on' :: ([JoinRestriction a b] -> Relation pc (a, b)) -> [JoinRestriction a b] -> Relation pc (a, b) infixl 8 Source #

Apply restriction for direct join style.

# Relation append

except :: Relation () a -> Relation () a -> Relation () a infixl 7 Source #

Subtraction of two relations.

intersect :: Relation () a -> Relation () a -> Relation () a infixl 8 Source #

Intersection of two relations.

unionAll :: Relation () a -> Relation () a -> Relation () a infixl 7 Source #

Union of two relations. Not distinct.

exceptAll :: Relation () a -> Relation () a -> Relation () a infixl 7 Source #

Subtraction of two relations. Not distinct.

intersectAll :: Relation () a -> Relation () a -> Relation () a infixl 8 Source #

Intersection of two relations. Not distinct.

union' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 Source #

Union of two relations with place-holder parameters.

except' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 Source #

Subtraction of two relations with place-holder parameters.

intersect' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 8 Source #

Intersection of two relations with place-holder parameters.

unionAll' :: Relation p a -> Relation q a -> Relation (p, q) a infixl 7 Source #

Union of two relations with place-holder parameters. Not distinct.