hgeometry-polyLine
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageGHC2024

HGeometry.PolyLine

Description

A Polyline and some basic functions to interact with them.

Synopsis

Documentation

newtype PolyLineF (f :: k -> Type) (point :: k) Source #

Simple polygons just store their vertices in CCCW order

Constructors

PolyLine (f point) 

Instances

Instances details
Foldable1 f => Foldable1 (PolyLineF f) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

fold1 :: Semigroup m => PolyLineF f m -> m Source #

foldMap1 :: Semigroup m => (a -> m) -> PolyLineF f a -> m Source #

foldMap1' :: Semigroup m => (a -> m) -> PolyLineF f a -> m Source #

toNonEmpty :: PolyLineF f a -> NonEmpty a Source #

maximum :: Ord a => PolyLineF f a -> a Source #

minimum :: Ord a => PolyLineF f a -> a Source #

head :: PolyLineF f a -> a Source #

last :: PolyLineF f a -> a Source #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> PolyLineF f a -> b Source #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> PolyLineF f a -> b Source #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> PolyLineF f a -> b Source #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> PolyLineF f a -> b Source #

Eq1 f => Eq1 (PolyLineF f) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

liftEq :: (a -> b -> Bool) -> PolyLineF f a -> PolyLineF f b -> Bool Source #

Ord1 f => Ord1 (PolyLineF f) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

liftCompare :: (a -> b -> Ordering) -> PolyLineF f a -> PolyLineF f b -> Ordering Source #

Functor f => Functor (PolyLineF f) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

fmap :: (a -> b) -> PolyLineF f a -> PolyLineF f b Source #

(<$) :: a -> PolyLineF f b -> PolyLineF f a Source #

Foldable f => Foldable (PolyLineF f) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

fold :: Monoid m => PolyLineF f m -> m Source #

foldMap :: Monoid m => (a -> m) -> PolyLineF f a -> m Source #

foldMap' :: Monoid m => (a -> m) -> PolyLineF f a -> m Source #

foldr :: (a -> b -> b) -> b -> PolyLineF f a -> b Source #

foldr' :: (a -> b -> b) -> b -> PolyLineF f a -> b Source #

foldl :: (b -> a -> b) -> b -> PolyLineF f a -> b Source #

foldl' :: (b -> a -> b) -> b -> PolyLineF f a -> b Source #

foldr1 :: (a -> a -> a) -> PolyLineF f a -> a Source #

foldl1 :: (a -> a -> a) -> PolyLineF f a -> a Source #

toList :: PolyLineF f a -> [a] Source #

null :: PolyLineF f a -> Bool Source #

length :: PolyLineF f a -> Int Source #

elem :: Eq a => a -> PolyLineF f a -> Bool Source #

maximum :: Ord a => PolyLineF f a -> a Source #

minimum :: Ord a => PolyLineF f a -> a Source #

sum :: Num a => PolyLineF f a -> a Source #

product :: Num a => PolyLineF f a -> a Source #

Traversable f => Traversable (PolyLineF f) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

traverse :: Applicative f0 => (a -> f0 b) -> PolyLineF f a -> f0 (PolyLineF f b) Source #

sequenceA :: Applicative f0 => PolyLineF f (f0 a) -> f0 (PolyLineF f a) Source #

mapM :: Monad m => (a -> m b) -> PolyLineF f a -> m (PolyLineF f b) Source #

sequence :: Monad m => PolyLineF f (m a) -> m (PolyLineF f a) Source #

Traversable1 f => Traversable1 (PolyLineF f) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

traverse1 :: Apply f0 => (a -> f0 b) -> PolyLineF f a -> f0 (PolyLineF f b) Source #

sequence1 :: Apply f0 => PolyLineF f (f0 b) -> f0 (PolyLineF f b) Source #

NFData (f point) => NFData (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

rnf :: PolyLineF f point -> () Source #

Generic (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Associated Types

type Rep (PolyLineF f point) 
Instance details

Defined in HGeometry.PolyLine

type Rep (PolyLineF f point) = D1 ('MetaData "PolyLineF" "HGeometry.PolyLine" "hgeometry-polyLine-1.0.0.0-inplace" 'True) (C1 ('MetaCons "PolyLine" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f point))))

Methods

from :: PolyLineF f point -> Rep (PolyLineF f point) x Source #

to :: Rep (PolyLineF f point) x -> PolyLineF f point Source #

Read (f point) => Read (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Show (f point) => Show (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

showsPrec :: Int -> PolyLineF f point -> ShowS Source #

show :: PolyLineF f point -> String Source #

showList :: [PolyLineF f point] -> ShowS Source #

Eq (f point) => Eq (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

(==) :: PolyLineF f point -> PolyLineF f point -> Bool Source #

(/=) :: PolyLineF f point -> PolyLineF f point -> Bool Source #

Ord (f point) => Ord (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

compare :: PolyLineF f point -> PolyLineF f point -> Ordering Source #

(<) :: PolyLineF f point -> PolyLineF f point -> Bool Source #

(<=) :: PolyLineF f point -> PolyLineF f point -> Bool Source #

(>) :: PolyLineF f point -> PolyLineF f point -> Bool Source #

(>=) :: PolyLineF f point -> PolyLineF f point -> Bool Source #

max :: PolyLineF f point -> PolyLineF f point -> PolyLineF f point Source #

min :: PolyLineF f point -> PolyLineF f point -> PolyLineF f point Source #

(Traversable1 f, IxValue (f point) ~ point, Index (f point) ~ Int, Ixed (f point), Point_ point 2 r) => IsBoxable (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

boundingBox :: forall (d :: Nat) r0. (d ~ Dimension (PolyLineF f point), r0 ~ NumType (PolyLineF f point), Ord r0) => PolyLineF f point -> Box (Point d r0) Source #

(Traversable1 f, IxValue (f point) ~ point, Index (f point) ~ Int, Ixed (f point), DefaultTransformByConstraints (PolyLineF f point) 2 r, Point_ point 2 r) => IsTransformable (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

transformBy :: Transformation (Dimension (PolyLineF f point)) (NumType (PolyLineF f point)) -> PolyLineF f point -> PolyLineF f point Source #

(TraversableWithIndex Int f, Traversable1 f, Ixed (f point), IxValue (f point) ~ point, Index (f point) ~ Int) => HasVertices' (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Associated Types

type Vertex (PolyLineF f point) 
Instance details

Defined in HGeometry.PolyLine

type Vertex (PolyLineF f point) = point
type VertexIx (PolyLineF f point) 
Instance details

Defined in HGeometry.PolyLine

type VertexIx (PolyLineF f point) = Int

Methods

vertexAt :: VertexIx (PolyLineF f point) -> IndexedTraversal' (VertexIx (PolyLineF f point)) (PolyLineF f point) (Vertex (PolyLineF f point)) Source #

numVertices :: PolyLineF f point -> Int Source #

Reversing (f point) => Reversing (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

reversing :: PolyLineF f point -> PolyLineF f point Source #

Traversable1 f => HasEnd (PolyLineF f point) point Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

end :: Lens' (PolyLineF f point) point Source #

Traversable1 f => HasStart (PolyLineF f point) point Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

start :: Lens' (PolyLineF f point) point Source #

(Traversable1 f, IxValue (f point) ~ point, Index (f point) ~ Int, Ixed (f point), HasFromFoldable1 f, Point_ point d r, TraversableWithIndex Int f) => ConstructablePolyLine_ (PolyLineF f point) point Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

polyLineFromPoints :: Foldable1 f0 => f0 point -> PolyLineF f point Source #

(Traversable1 f, IxValue (f point) ~ point, Index (f point) ~ Int, Ixed (f point), HasFromFoldable1 f, Point_ point d r, TraversableWithIndex Int f) => PolyLine_ (PolyLineF f point) point Source # 
Instance details

Defined in HGeometry.PolyLine

(TraversableWithIndex Int f, Traversable1 f, IxValue (f point) ~ point, Index (f point) ~ Int, Ixed (f point)) => HasVertices (PolyLineF f point) (PolyLineF f point') Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

vertices :: IndexedTraversal1 (VertexIx (PolyLineF f point)) (PolyLineF f point) (PolyLineF f point') (Vertex (PolyLineF f point)) (Vertex (PolyLineF f point')) Source #

(Traversable1 f, IxValue (f point) ~ point, Index (f point) ~ Int, Ixed (f point)) => HasPoints (PolyLineF f point) (PolyLineF f point') point point' Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

allPoints :: forall (d :: Nat) r r'. (Point_ point d r, Point_ point' d r', NumType (PolyLineF f point) ~ r, NumType (PolyLineF f point') ~ r', Dimension (PolyLineF f point) ~ d, Dimension (PolyLineF f point') ~ d) => Traversal1 (PolyLineF f point) (PolyLineF f point') point point' Source #

type Rep (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

type Rep (PolyLineF f point) = D1 ('MetaData "PolyLineF" "HGeometry.PolyLine" "hgeometry-polyLine-1.0.0.0-inplace" 'True) (C1 ('MetaCons "PolyLine" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f point))))
type Dimension (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

type Dimension (PolyLineF f point) = Dimension point
type NumType (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

type NumType (PolyLineF f point) = NumType point
type Vertex (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

type Vertex (PolyLineF f point) = point
type VertexIx (PolyLineF f point) Source # 
Instance details

Defined in HGeometry.PolyLine

type VertexIx (PolyLineF f point) = Int

type PolyLine = PolyLineF NonEmptyVector Source #

By default we store simple poylline as non-empty vectors.

_PolyLineF :: forall {k1} {k2} f1 (point :: k1) f' (point' :: k2) p f2. (Profunctor p, Functor f2) => p (f1 point) (f2 (f' point')) -> p (PolyLineF f1 point) (f2 (PolyLineF f' point')) Source #

Access the container

class HasVertices' graph => HasVertices graph graph' where Source #

Class that expresses that we have a non-empty type changing traversal of all vertices.

Methods

vertices :: IndexedTraversal1 (VertexIx graph) graph graph' (Vertex graph) (Vertex graph') Source #

Traversal of all vertices in the graph

Instances

Instances details
HasVertices Graph Graph Source # 
Instance details

Defined in Hiraffe.Graph.Class

HasVertices (Triangle point) (Triangle point') Source # 
Instance details

Defined in HGeometry.Triangle

Methods

vertices :: IndexedTraversal1 (VertexIx (Triangle point)) (Triangle point) (Triangle point') (Vertex (Triangle point)) (Vertex (Triangle point')) Source #

HasVertices graph graph' => HasVertices (graph :+ extra) (graph' :+ extra) Source # 
Instance details

Defined in Hiraffe.Graph.Class

Methods

vertices :: IndexedTraversal1 (VertexIx (graph :+ extra)) (graph :+ extra) (graph' :+ extra) (Vertex (graph :+ extra)) (Vertex (graph' :+ extra)) Source #

(Traversable1 endPoint, EndPoint_ (endPoint v), IxValue (endPoint v) ~ v) => HasVertices (LineSegment endPoint v) (LineSegment endPoint v') Source # 
Instance details

Defined in HGeometry.LineSegment.Internal

Methods

vertices :: IndexedTraversal1 (VertexIx (LineSegment endPoint v)) (LineSegment endPoint v) (LineSegment endPoint v') (Vertex (LineSegment endPoint v)) (Vertex (LineSegment endPoint v')) Source #

(TraversableWithIndex Int f, Traversable1 f, IxValue (f point) ~ point, Index (f point) ~ Int, Ixed (f point)) => HasVertices (PolyLineF f point) (PolyLineF f point') Source # 
Instance details

Defined in HGeometry.PolyLine

Methods

vertices :: IndexedTraversal1 (VertexIx (PolyLineF f point)) (PolyLineF f point) (PolyLineF f point') (Vertex (PolyLineF f point)) (Vertex (PolyLineF f point')) Source #

HasVertices (GGraph f v e) (GGraph f v' e) Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep

Methods

vertices :: IndexedTraversal1 (VertexIx (GGraph f v e)) (GGraph f v e) (GGraph f v' e) (Vertex (GGraph f v e)) (Vertex (GGraph f v' e)) Source #

Ord i => HasVertices (GGraph f i v e) (GGraph f i v' e) Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

Methods

vertices :: IndexedTraversal1 (VertexIx (GGraph f i v e)) (GGraph f i v e) (GGraph f i v' e) (Vertex (GGraph f i v e)) (Vertex (GGraph f i v' e)) Source #

HasVertices (PlanarGraph w s v e f) (PlanarGraph w s v' e f) Source # 
Instance details

Defined in Hiraffe.PlanarGraph.Type

Methods

vertices :: IndexedTraversal1 (VertexIx (PlanarGraph w s v e f)) (PlanarGraph w s v e f) (PlanarGraph w s v' e f) (Vertex (PlanarGraph w s v e f)) (Vertex (PlanarGraph w s v' e f)) Source #

class HasEdges' graph => HasEdges graph graph' where Source #

Class for types that have a type changing traversal of the edges

Methods

edges :: IndexedTraversal (EdgeIx graph) graph graph' (Edge graph) (Edge graph') Source #

Traversal of all edges in the graph

Instances

Instances details
HasEdges Graph Graph Source # 
Instance details

Defined in Hiraffe.Graph.Class

HasEdges graph graph' => HasEdges (graph :+ extra) (graph' :+ extra) Source # 
Instance details

Defined in Hiraffe.Graph.Class

Methods

edges :: IndexedTraversal (EdgeIx (graph :+ extra)) (graph :+ extra) (graph' :+ extra) (Edge (graph :+ extra)) (Edge (graph' :+ extra)) Source #

HasEdges (GGraph f v e) (GGraph f v e') Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep

Methods

edges :: IndexedTraversal (EdgeIx (GGraph f v e)) (GGraph f v e) (GGraph f v e') (Edge (GGraph f v e)) (Edge (GGraph f v e')) Source #

Ord i => HasEdges (GGraph f i v e) (GGraph f i v e') Source # 
Instance details

Defined in Hiraffe.AdjacencyListRep.Map

Methods

edges :: IndexedTraversal (EdgeIx (GGraph f i v e)) (GGraph f i v e) (GGraph f i v e') (Edge (GGraph f i v e)) (Edge (GGraph f i v e')) Source #

HasEdges (PlanarGraph w s v e f) (PlanarGraph w s v e' f) Source # 
Instance details

Defined in Hiraffe.PlanarGraph.Type

Methods

edges :: IndexedTraversal (EdgeIx (PlanarGraph w s v e f)) (PlanarGraph w s v e f) (PlanarGraph w s v e' f) (Edge (PlanarGraph w s v e f)) (Edge (PlanarGraph w s v e' f)) Source #