Copyright | Originals (c) 2011 Patrick Bahr; modifications (c) 2017 Jmase koppel |
---|---|

License | BSD3 |

Safe Haskell | None |

Language | Haskell98 |

This module defines the infrastructure necessary to use
*Generalised Compositional Data Types*. Generalised Compositional Data Types
is an extension of Compositional Data Types with mutually recursive
data types, and more generally GADTs. Examples of usage are bundled with the
package in the library `examples/Examples/Multi`

.

This is a fork of Patrick Bahrs `compdata`

package. The chief differences
are that the representation of sums has been replaced with a version that uses constant memory,
and the portions of the library for single-sorted terms have been removed to speed compilation times.
There are several minor changes and additions to the utility functions of this library.

## Synopsis

- module Data.Comp.Multi.Algebra
- module Data.Comp.Multi.Annotation
- module Data.Comp.Multi.Equality
- module Data.Comp.Multi.Generic
- module Data.Comp.Multi.HFoldable
- module Data.Comp.Multi.HFunctor
- module Data.Comp.Multi.HTraversable
- module Data.Comp.Multi.Ops
- module Data.Comp.Multi.Ordering
- module Data.Comp.Multi.Show
- module Data.Comp.Multi.Sum
- module Data.Comp.Multi.Term
- data Dict (c :: k -> Constraint) (a :: k) where
- class All (c :: k -> Constraint) (fs :: [k])
- withDict :: Dict c a -> (c a => r) -> r
- (\\) :: (c a => r) -> Dict c a -> r
- dictFor :: forall c f fs. All c fs => Elem f fs -> Dict c f

# Documentation

module Data.Comp.Multi.Algebra

module Data.Comp.Multi.Annotation

module Data.Comp.Multi.Equality

module Data.Comp.Multi.Generic

module Data.Comp.Multi.HFoldable

module Data.Comp.Multi.HFunctor

module Data.Comp.Multi.HTraversable

module Data.Comp.Multi.Ops

module Data.Comp.Multi.Ordering

module Data.Comp.Multi.Show

module Data.Comp.Multi.Sum

module Data.Comp.Multi.Term

data Dict (c :: k -> Constraint) (a :: k) where Source #

A reified `Constraint`

. Similar in spirit to `Dict`

from ekmett's `constraints`

package,
but that definition has a kind of @Constraint -> */

class All (c :: k -> Constraint) (fs :: [k]) Source #

An instance of `All c fs`

holds if `c f`

holds for all `f`

in `fs`

.

Example: `All `

holds if there are `HFunctor`

'[Add, Mul]`HFunctor`

instances for signatures
`Add`

and `Mul`

.

The primary way to consume an `All`

instance is with the `caseCxt`

function. E.g.:

class Pretty f where pretty :: f e l -> String instance (All Pretty fs) => Pretty (Sum fs) where pretty x = caseCxt (Proxy @Pretty) pretty x

dicts

#### Instances

All (c :: k -> Constraint) ('[] :: [k]) Source # | |

Defined in Data.Comp.Dict | |

(All c fs, c f) => All (c :: a -> Constraint) (f ': fs :: [a]) Source # | |

Defined in Data.Comp.Dict |