| Maintainer | diagrams-discuss@googlegroups.com |
|---|---|
| Safe Haskell | None |
Diagrams.Core.Names
Contents
Description
This module defines a type of names which can be used for referring to locations within diagrams, and related types.
Names
Atomic names
Names
A (qualified) name is a (possibly empty) sequence of atomic names.
Instances
| Eq Name | |
| Ord Name | |
| Show Name | |
| Typeable Name | |
| Monoid Name | |
| Semigroup Name | |
| Qualifiable Name | Of course, names can be qualified using |
| IsName Name | |
| Action Name a | Names don't act on anything else. |
| Action Name (SubMap b v m) | A name acts on a name map by qualifying every name in it. |
| Newtype (SubMap b v m) (Map Name [Subdiagram b v m]) | |
| Newtype (QDiagram b v m) (DUALTree (DownAnnots v) (UpAnnots b v m) () (Prim b v)) |
class (Typeable a, Ord a, Show a) => IsName a whereSource
Class for those types which can be used as names. They must
support Typeable (to facilitate extracting them from
existential wrappers), Ord (for comparison and efficient
storage) and Show.
Instances
| IsName Bool | |
| IsName Char | |
| IsName Double | |
| IsName Float | |
| IsName Int | |
| IsName Integer | |
| IsName String | |
| IsName () | |
| IsName Name | |
| IsName AName | |
| (Typeable [a], Ord [a], Show [a], IsName a) => IsName [a] | |
| (Typeable (a, b), Ord (a, b), Show (a, b), IsName a, IsName b) => IsName (a, b) | |
| (Typeable (a, b, c), Ord (a, b, c), Show (a, b, c), IsName a, IsName b, IsName c) => IsName (a, b, c) |
(.>) :: (IsName a1, IsName a2) => a1 -> a2 -> NameSource
Convenient operator for writing qualified names with atomic
components of different types. Instead of writing toName a1 <>
toName a2 <> toName a3 you can just write a1 .> a2 .> a3.
Qualifiable
class Qualifiable q whereSource
Instances of Qualifiable are things which can be qualified by
prefixing them with a name.
Instances
| Qualifiable Name | Of course, names can be qualified using |
| Qualifiable (SubMap b v m) |
|
| (HasLinearMap v, InnerSpace v, OrderedField (Scalar v), Semigroup m) => Qualifiable (QDiagram b v m) | Diagrams can be qualified so that all their named points can now be referred to using the qualification prefix. |