hgeometry-combinatorial-0.12.0.2: Data structures, and Data types.
Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.PlanarGraph.Dart

Description

Data type for representing Darts (edges) in a planar graph.

Synopsis

Documentation

>>> :{
let dart i s = Dart (Arc i) (read s)
:}

newtype Arc s Source #

An Arc is a directed edge in a planar graph. The type s is used to tie this arc to a particular graph.

Constructors

Arc 

Fields

Instances

Instances details
Bounded (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

minBound :: Arc s #

maxBound :: Arc s #

Enum (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

succ :: Arc s -> Arc s #

pred :: Arc s -> Arc s #

toEnum :: Int -> Arc s #

fromEnum :: Arc s -> Int #

enumFrom :: Arc s -> [Arc s] #

enumFromThen :: Arc s -> Arc s -> [Arc s] #

enumFromTo :: Arc s -> Arc s -> [Arc s] #

enumFromThenTo :: Arc s -> Arc s -> Arc s -> [Arc s] #

Eq (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

(==) :: Arc s -> Arc s -> Bool #

(/=) :: Arc s -> Arc s -> Bool #

Ord (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

compare :: Arc s -> Arc s -> Ordering #

(<) :: Arc s -> Arc s -> Bool #

(<=) :: Arc s -> Arc s -> Bool #

(>) :: Arc s -> Arc s -> Bool #

(>=) :: Arc s -> Arc s -> Bool #

max :: Arc s -> Arc s -> Arc s #

min :: Arc s -> Arc s -> Arc s #

Show (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

showsPrec :: Int -> Arc s -> ShowS #

show :: Arc s -> String #

showList :: [Arc s] -> ShowS #

Generic (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Associated Types

type Rep (Arc s) :: Type -> Type #

Methods

from :: Arc s -> Rep (Arc s) x #

to :: Rep (Arc s) x -> Arc s #

Arbitrary (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

arbitrary :: Gen (Arc s) #

shrink :: Arc s -> [Arc s] #

NFData (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

rnf :: Arc s -> () #

type Rep (Arc s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

type Rep (Arc s) = D1 ('MetaData "Arc" "Data.PlanarGraph.Dart" "hgeometry-combinatorial-0.12.0.2-BPOszceZMWb3Na6sqXbM08" 'True) (C1 ('MetaCons "Arc" 'PrefixI 'True) (S1 ('MetaSel ('Just "_unArc") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

data Direction Source #

Darts have a direction which is either Positive or Negative (shown as +1 or -1, respectively).

Constructors

Negative 
Positive 

Instances

Instances details
Bounded Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Enum Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Eq Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Ord Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Read Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Show Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Generic Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Associated Types

type Rep Direction :: Type -> Type #

Arbitrary Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

NFData Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

rnf :: Direction -> () #

type Rep Direction Source # 
Instance details

Defined in Data.PlanarGraph.Dart

type Rep Direction = D1 ('MetaData "Direction" "Data.PlanarGraph.Dart" "hgeometry-combinatorial-0.12.0.2-BPOszceZMWb3Na6sqXbM08" 'False) (C1 ('MetaCons "Negative" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Positive" 'PrefixI 'False) (U1 :: Type -> Type))

rev :: Direction -> Direction Source #

Reverse the direcion

data Dart s Source #

A dart represents a bi-directed edge. I.e. a dart has a direction, however the dart of the oposite direction is always present in the planar graph as well.

Constructors

Dart 

Fields

Instances

Instances details
Enum (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

succ :: Dart s -> Dart s #

pred :: Dart s -> Dart s #

toEnum :: Int -> Dart s #

fromEnum :: Dart s -> Int #

enumFrom :: Dart s -> [Dart s] #

enumFromThen :: Dart s -> Dart s -> [Dart s] #

enumFromTo :: Dart s -> Dart s -> [Dart s] #

enumFromThenTo :: Dart s -> Dart s -> Dart s -> [Dart s] #

Eq (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

(==) :: Dart s -> Dart s -> Bool #

(/=) :: Dart s -> Dart s -> Bool #

Ord (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

compare :: Dart s -> Dart s -> Ordering #

(<) :: Dart s -> Dart s -> Bool #

(<=) :: Dart s -> Dart s -> Bool #

(>) :: Dart s -> Dart s -> Bool #

(>=) :: Dart s -> Dart s -> Bool #

max :: Dart s -> Dart s -> Dart s #

min :: Dart s -> Dart s -> Dart s #

Show (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

showsPrec :: Int -> Dart s -> ShowS #

show :: Dart s -> String #

showList :: [Dart s] -> ShowS #

Generic (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Associated Types

type Rep (Dart s) :: Type -> Type #

Methods

from :: Dart s -> Rep (Dart s) x #

to :: Rep (Dart s) x -> Dart s #

Arbitrary (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

arbitrary :: Gen (Dart s) #

shrink :: Dart s -> [Dart s] #

NFData (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

Methods

rnf :: Dart s -> () #

HasDataOf (PlanarGraph s w v e f) (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Core

Associated Types

type DataOf (PlanarGraph s w v e f) (Dart s) Source #

Methods

dataOf :: Dart s -> Lens' (PlanarGraph s w v e f) (DataOf (PlanarGraph s w v e f) (Dart s)) Source #

type Rep (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Dart

type Rep (Dart s) = D1 ('MetaData "Dart" "Data.PlanarGraph.Dart" "hgeometry-combinatorial-0.12.0.2-BPOszceZMWb3Na6sqXbM08" 'False) (C1 ('MetaCons "Dart" 'PrefixI 'True) (S1 ('MetaSel ('Just "_arc") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Arc s)) :*: S1 ('MetaSel ('Just "_direction") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Direction)))
type DataOf (PlanarGraph s w v e f) (Dart s) Source # 
Instance details

Defined in Data.PlanarGraph.Core

type DataOf (PlanarGraph s w v e f) (Dart s) = e

arc :: Lens' (Dart s) (Arc s) Source #

Arc lens.

direction :: Lens' (Dart s) Direction Source #

Direction lens.

twin :: Dart s -> Dart s Source #

Get the twin of this dart (edge)

>>> twin (dart 0 "+1")
Dart (Arc 0) -1
>>> twin (dart 0 "-1")
Dart (Arc 0) +1

isPositive :: Dart s -> Bool Source #

test if a dart is Positive

allDarts :: [Dart s] Source #

Enumerates all darts such that allDarts !! i = d = i == fromEnum d