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 n m :: (* -> *) -> * -> * -> * = Query {}
- class HasQuery t m | t -> m where
- sample :: HasQuery t m => t -> Point (V t) (N t) -> m
- inquire :: HasQuery t Any => t -> Point (V t) (N t) -> Bool
- query :: Monoid m => QDiagram b v n m -> Query v n m
- value :: Monoid m => m -> QDiagram b v n Any -> QDiagram b v n m
- resetValue :: (Eq m, Monoid m) => QDiagram b v n m -> QDiagram b v n Any
- clearValue :: QDiagram b v n m -> QDiagram b v n Any
Queries
newtype Query v n 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.
Functor v => Corepresentable (Query v) | |
Functor v => Profunctor (Query v) | |
Functor v => Closed (Query v) | |
Functor v => Costrong (Query v) | |
Functor v => Cosieve (Query v) (Point v) | |
Monad (Query v n) | |
Functor (Query v n) | |
Applicative (Query v n) | |
Distributive (Query v n) | |
Representable (Query v n) | |
Semigroup m => Semigroup (Query v n m) | |
Monoid m => Monoid (Query v n m) | |
(Additive v, Num n) => Transformable (Query v n m) | |
(Additive v, Num n) => HasOrigin (Query v n m) | |
Wrapped (Query v n m) | |
HasQuery (Query v n m) m Source # | |
Rewrapped (Query v a m) (Query v' a' m') | |
type Corep (Query v) | |
type Rep (Query v n) | |
type V (Query v n m) | |
type N (Query v n m) | |
type Unwrapped (Query v n m) | |
class HasQuery t m | t -> m where Source #
Types which can answer a Query
about points inside the geometric
object.
If t
and m
are both a Semigroup
s, getQuery
should satisfy
getQuery
(t1 <> t2) =getQuery
t1 <>getQuery
t2
(Floating n, Ord n) => HasQuery (CSG n) Any Source # | |
OrderedField n => HasQuery (Frustum n) Any Source # | |
(Num n, Ord n) => HasQuery (Box n) Any Source # | |
(Num n, Ord n) => HasQuery (Ellipsoid n) Any Source # | |
RealFloat n => HasQuery (Clip n) All Source # | A point inside a clip if the point is in |
(Additive v, Foldable v, Ord n) => HasQuery (BoundingBox v n) Any Source # | |
RealFloat n => HasQuery (DImage n a) Any Source # | |
HasQuery (Query v n m) m Source # | |
Monoid m => HasQuery (QDiagram b v n m) m Source # | |
Queries on diagrams
query :: Monoid m => QDiagram b v n m -> Query v n m #
Get the query function associated with a diagram.