Safe Haskell | None |
---|---|

Language | Haskell2010 |

## Synopsis

- class Decidable f => Discriminating f where
- disc :: f a -> [(a, b)] -> [[b]]

- joining :: Discriminating f => f d -> ([a] -> [b] -> c) -> (a -> d) -> (b -> d) -> [a] -> [b] -> [c]
- inner :: Discriminating f => f d -> (a -> b -> c) -> (a -> d) -> (b -> d) -> [a] -> [b] -> [[c]]
- outer :: Discriminating f => f d -> (a -> b -> c) -> (a -> c) -> (b -> c) -> (a -> d) -> (b -> d) -> [a] -> [b] -> [[c]]
- leftOuter :: Discriminating f => f d -> (a -> b -> c) -> (a -> c) -> (a -> d) -> (b -> d) -> [a] -> [b] -> [[c]]
- rightOuter :: Discriminating f => f d -> (a -> b -> c) -> (b -> c) -> (a -> d) -> (b -> d) -> [a] -> [b] -> [[c]]

# Documentation

class Decidable f => Discriminating f where Source #

#### Instances

Discriminating Group Source # | |

Defined in Data.Discrimination.Class | |

Discriminating Sort Source # | |

Defined in Data.Discrimination.Class |

# Joins

:: Discriminating f | |

=> f d | the discriminator to use |

-> ([a] -> [b] -> c) | how to join two tables |

-> (a -> d) | selector for the left table |

-> (b -> d) | selector for the right table |

-> [a] | left table |

-> [b] | right table |

-> [c] |

*O(n)*. Perform a full outer join while explicit merging of the two result tables a table at a time.

The results are grouped by the discriminator.

:: Discriminating f | |

=> f d | the discriminator to use |

-> (a -> b -> c) | how to join two rows |

-> (a -> d) | selector for the left table |

-> (b -> d) | selector for the right table |

-> [a] | left table |

-> [b] | right table |

-> [[c]] |

*O(n)*. Perform an inner join, with operations defined one row at a time.

The results are grouped by the discriminator.

This takes operation time linear in both the input and result sets.

:: Discriminating f | |

=> f d | the discriminator to use |

-> (a -> b -> c) | how to join two rows |

-> (a -> c) | row present on the left, missing on the right |

-> (b -> c) | row present on the right, missing on the left |

-> (a -> d) | selector for the left table |

-> (b -> d) | selector for the right table |

-> [a] | left table |

-> [b] | right table |

-> [[c]] |

*O(n)*. Perform a full outer join with operations defined one row at a time.

The results are grouped by the discriminator.

This takes operation time linear in both the input and result sets.

:: Discriminating f | |

=> f d | the discriminator to use |

-> (a -> b -> c) | how to join two rows |

-> (a -> c) | row present on the left, missing on the right |

-> (a -> d) | selector for the left table |

-> (b -> d) | selector for the right table |

-> [a] | left table |

-> [b] | right table |

-> [[c]] |

*O(n)*. Perform a left outer join with operations defined one row at a time.

The results are grouped by the discriminator.

This takes operation time linear in both the input and result sets.

:: Discriminating f | |

=> f d | the discriminator to use |

-> (a -> b -> c) | how to join two rows |

-> (b -> c) | row present on the right, missing on the left |

-> (a -> d) | selector for the left table |

-> (b -> d) | selector for the right table |

-> [a] | left table |

-> [b] | right table |

-> [[c]] |

*O(n)*. Perform a right outer join with operations defined one row at a time.

The results are grouped by the discriminator.

This takes operation time linear in both the input and result sets.