Copyright | (c) 2013 diagrams-lib team (see LICENSE) |
---|---|

License | BSD-style (see LICENSE) |

Maintainer | diagrams-discuss@googlegroups.com |

Safe Haskell | None |

Language | Haskell2010 |

A query is a function that maps points in a vector space to values in some monoid. Queries naturally form a monoid, with two queries being combined pointwise.

- newtype Query v m :: * -> * -> * = Query {}
- query :: Monoid m => QDiagram b v m -> Query v m
- sample :: Monoid m => QDiagram b v m -> Point v -> m
- value :: Monoid m => m -> QDiagram b v Any -> QDiagram b v m
- resetValue :: (Eq m, Monoid m) => QDiagram b v m -> QDiagram b v Any
- clearValue :: QDiagram b v m -> QDiagram b v Any

# Documentation

newtype Query v m :: * -> * -> *

A query is a function that maps points in a vector space to values in some monoid. Queries naturally form a monoid, with two queries being combined pointwise.

The idea for annotating diagrams with monoidal queries came from the graphics-drawingcombinators package, http://hackage.haskell.org/package/graphics-drawingcombinators.

Action Name (Query v m) | |

Functor (Query v) | |

Applicative (Query v) | |

Semigroup m => Semigroup (Query v m) | |

Monoid m => Monoid (Query v m) | |

HasLinearMap v => Transformable (Query v m) | |

VectorSpace v => HasOrigin (Query v m) | |

Wrapped (Query v m) | |

Rewrapped (Query v m) (Query v' m') | |

type V (Query v m) = v | |

type Unwrapped (Query v m) = Point v -> m |

sample :: Monoid m => QDiagram b v m -> Point v -> m

Sample a diagram's query function at a given point.

clearValue :: QDiagram b v m -> QDiagram b v Any

Set all the query values of a diagram to `False`

.