diagrams-core-1.5.1.1: Core libraries for diagrams EDSL

Copyright | (c) 2011-2015 diagrams-core team (see LICENSE)
License | BSD-style (see LICENSE)
Maintainer | diagrams-discuss@googlegroups.com
Safe Haskell | None
Language | Haskell2010

Diagrams.Core.Query

Description

The `Query` module defines a type for "queries" on diagrams, which are functions from points in a vector space to some monoid.

Synopsis

- newtype Query (v :: Type -> Type) n m = Query {
  - runQuery :: Point v n -> m
  }

# Documentation

newtype Query (v :: Type -> Type) n m Source #

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.

Constructors

Query |

Fields

- runQuery :: Point v n -> m

#### Instances

Instances details

Action Name (Query v n m) Source # |
Instance details Defined in Diagrams.Core.Types Methods act :: Name -> Query v n m -> Query v n m Source #
Functor v => Closed (Query v) Source # |
Instance details Defined in Diagrams.Core.Query Methods closed :: Query v a b -> Query v (x -> a) (x -> b) Source #
Functor v => Corepresentable (Query v) Source # |

Instance details

Defined in Diagrams.Core.Query

Associated Types

type Corep (Query v) |
Instance details Defined in Diagrams.Core.Query type Corep (Query v) = Point v

Methods

cotabulate :: (Corep (Query v) d -> c) -> Query v d c Source #

Functor v => Costrong (Query v) Source # |
Instance details Defined in Diagrams.Core.Query Methods unfirst :: Query v (a, d) (b, d) -> Query v a b Source # unsecond :: Query v (d, a) (d, b) -> Query v a b Source #
Functor v => Profunctor (Query v) Source # |

Instance details

Defined in Diagrams.Core.Query

Methods

dimap :: (a -> b) -> (c -> d) -> Query v b c -> Query v a d Source #

lmap :: (a -> b) -> Query v b c -> Query v a c Source #

rmap :: (b -> c) -> Query v a b -> Query v a c Source #

(#.) :: forall a b c q. Coercible c b => q b c -> Query v a b -> Query v a c Source #

(.#) :: forall a b c q. Coercible b a => Query v b c -> q a b -> Query v a c Source #

Functor v => Cosieve (Query v) (Point v) Source # |
Instance details Defined in Diagrams.Core.Query Methods cosieve :: Query v a b -> Point v a -> b Source #
Representable (Query v n) Source # |

Instance details

Defined in Diagrams.Core.Query

Associated Types

type Rep (Query v n) |
Instance details Defined in Diagrams.Core.Query type Rep (Query v n) = Point v n

Methods

tabulate :: (Rep (Query v n) -> a) -> Query v n a Source #

index :: Query v n a -> Rep (Query v n) -> a Source #

Distributive (Query v n) Source # |
Instance details Defined in Diagrams.Core.Query Methods distribute :: Functor f => f (Query v n a) -> Query v n (f a) Source # collect :: Functor f => (a -> Query v n b) -> f a -> Query v n (f b) Source # distributeM :: Monad m => m (Query v n a) -> Query v n (m a) Source # collectM :: Monad m => (a -> Query v n b) -> m a -> Query v n (m b) Source #
Applicative (Query v n) Source # |
Instance details Defined in Diagrams.Core.Query Methods pure :: a -> Query v n a Source # (<*>) :: Query v n (a -> b) -> Query v n a -> Query v n b Source # liftA2 :: (a -> b -> c) -> Query v n a -> Query v n b -> Query v n c Source # (*>) :: Query v n a -> Query v n b -> Query v n b Source # (<*) :: Query v n a -> Query v n b -> Query v n a Source #
Functor (Query v n) Source # |
Instance details Defined in Diagrams.Core.Query Methods fmap :: (a -> b) -> Query v n a -> Query v n b Source # (<$) :: a -> Query v n b -> Query v n a Source #
Monad (Query v n) Source # |
Instance details Defined in Diagrams.Core.Query Methods (>>=) :: Query v n a -> (a -> Query v n b) -> Query v n b Source # (>>) :: Query v n a -> Query v n b -> Query v n b Source # return :: a -> Query v n a Source #
(Additive v, Num n) => HasOrigin (Query v n m) Source # |
Instance details Defined in Diagrams.Core.Query Methods moveOriginTo :: Point (V (Query v n m)) (N (Query v n m)) -> Query v n m -> Query v n m Source #
(Additive v, Num n) => Transformable (Query v n m) Source # |
Instance details Defined in Diagrams.Core.Query Methods transform :: Transformation (V (Query v n m)) (N (Query v n m)) -> Query v n m -> Query v n m Source #
Monoid m => Monoid (Query v n m) Source # |
Instance details Defined in Diagrams.Core.Query Methods mempty :: Query v n m Source # mappend :: Query v n m -> Query v n m -> Query v n m Source # mconcat :: [Query v n m] -> Query v n m Source #
Semigroup m => Semigroup (Query v n m) Source # |
Instance details Defined in Diagrams.Core.Query Methods (<>) :: Query v n m -> Query v n m -> Query v n m Source # sconcat :: NonEmpty (Query v n m) -> Query v n m Source # stimes :: Integral b => b -> Query v n m -> Query v n m Source #
Wrapped (Query v n m) Source # |

Instance details

Defined in Diagrams.Core.Query

Associated Types

type Unwrapped (Query v n m) |
Instance details Defined in Diagrams.Core.Query type Unwrapped (Query v n m) = Point v n -> m

Methods

_Wrapped' :: Iso' (Query v n m) (Unwrapped (Query v n m)) Source #

Rewrapped (Query v a m) (Query v' a' m') Source # |
Instance details Defined in Diagrams.Core.Query
type Corep (Query v) Source # |
Instance details Defined in Diagrams.Core.Query type Corep (Query v) = Point v
type Rep (Query v n) Source # |
Instance details Defined in Diagrams.Core.Query type Rep (Query v n) = Point v n
type N (Query v n m) Source # |
Instance details Defined in Diagrams.Core.Query type N (Query v n m) = n
type V (Query v n m) Source # |
Instance details Defined in Diagrams.Core.Query type V (Query v n m) = v
type Unwrapped (Query v n m) Source # |
Instance details Defined in Diagrams.Core.Query type Unwrapped (Query v n m) = Point v n -> m