| Copyright | (C) Frank Staals |
|---|---|
| License | see the LICENSE file |
| Maintainer | Frank Staals |
| Safe Haskell | None |
| Language | GHC2021 |
Hiraffe.PlanarGraph.Dart
Description
Data type for representing Darts (edges) in a planar graph.
Synopsis
- data Dart (s :: k) = Dart !(Arc s) !Direction
- arc :: forall {k} (s :: k) f. Functor f => (Arc s -> f (Arc s)) -> Dart s -> f (Dart s)
- direction :: forall {k} (s :: k) f. Functor f => (Direction -> f Direction) -> Dart s -> f (Dart s)
- twin :: forall {k} (s :: k). Dart s -> Dart s
- isPositive :: forall {k} (s :: k). Dart s -> Bool
- asPositive :: forall {k} (s :: k). Dart s -> Dart s
- allDarts :: forall {k} (s :: k). [Dart s]
- newtype Arc (s :: k) = Arc Int
- data Direction
- rev :: Direction -> Direction
Documentation
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.
Instances
arc :: forall {k} (s :: k) f. Functor f => (Arc s -> f (Arc s)) -> Dart s -> f (Dart s) Source #
Arc lens.
direction :: forall {k} (s :: k) f. Functor f => (Direction -> f Direction) -> Dart s -> f (Dart s) Source #
Direction lens.
twin :: forall {k} (s :: k). 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 :: forall {k} (s :: k). Dart s -> Bool Source #
test if a dart is Positive
asPositive :: forall {k} (s :: k). Dart s -> Dart s Source #
Returrns the psoitive version of this this ard.
allDarts :: forall {k} (s :: k). [Dart s] Source #
Enumerates all darts such that allDarts !! i = d = i == fromEnum d
An Arc is a directed edge in a planar graph. The type s is used to tie this arc to a particular graph.
Instances
| NFData (Arc s) Source # | |||||
Defined in Hiraffe.PlanarGraph.Dart | |||||
| Bounded (Arc s) Source # | |||||
| Enum (Arc s) Source # | |||||
Defined in Hiraffe.PlanarGraph.Dart | |||||
| Generic (Arc s) Source # | |||||
Defined in Hiraffe.PlanarGraph.Dart Associated Types
| |||||
| Show (Arc s) Source # | |||||
| Eq (Arc s) Source # | |||||
| Ord (Arc s) Source # | |||||
| type Rep (Arc s) Source # | |||||
Defined in Hiraffe.PlanarGraph.Dart | |||||
Darts have a direction which is either Positive or Negative (shown as +1 or -1, respectively).
Instances
| NFData Direction Source # | |
Defined in Hiraffe.PlanarGraph.Dart | |
| Bounded Direction Source # | |
| Enum Direction Source # | |
Defined in Hiraffe.PlanarGraph.Dart Methods succ :: Direction -> Direction # pred :: Direction -> Direction # fromEnum :: Direction -> Int # enumFrom :: Direction -> [Direction] # enumFromThen :: Direction -> Direction -> [Direction] # enumFromTo :: Direction -> Direction -> [Direction] # enumFromThenTo :: Direction -> Direction -> Direction -> [Direction] # | |
| Generic Direction Source # | |
Defined in Hiraffe.PlanarGraph.Dart | |
| Read Direction Source # | |
| Show Direction Source # | |
| Eq Direction Source # | |
| Ord Direction Source # | |
| type Rep Direction Source # | |