hgeometry-combinatorial-0.10.0.0: Data structures, and Data types.

Copyright(C) Frank Staals
Licensesee the LICENSE file
MaintainerFrank Staals
Safe HaskellNone
LanguageHaskell2010

Data.PlanarGraph.AdjRep

Description

Data types that to represent a planar graph as Adjacency Lists. The main purpose is to help encodedecode a PlanarGraph as a JSONYAML file.

Synopsis

Documentation

data Gr v f Source #

Data type representing the graph in its JSON/Yaml format

Constructors

Gr 

Fields

Instances
Bifunctor Gr Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Methods

bimap :: (a -> b) -> (c -> d) -> Gr a c -> Gr b d #

first :: (a -> b) -> Gr a c -> Gr b c #

second :: (b -> c) -> Gr a b -> Gr a c #

Generic (Gr v f) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Associated Types

type Rep (Gr v f) :: Type -> Type #

Methods

from :: Gr v f -> Rep (Gr v f) x #

to :: Rep (Gr v f) x -> Gr v f #

(ToJSON v, ToJSON f) => ToJSON (Gr v f) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Methods

toJSON :: Gr v f -> Value #

toEncoding :: Gr v f -> Encoding #

toJSONList :: [Gr v f] -> Value #

toEncodingList :: [Gr v f] -> Encoding #

(FromJSON v, FromJSON f) => FromJSON (Gr v f) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Methods

parseJSON :: Value -> Parser (Gr v f) #

parseJSONList :: Value -> Parser [Gr v f] #

type Rep (Gr v f) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

type Rep (Gr v f) = D1 (MetaData "Gr" "Data.PlanarGraph.AdjRep" "hgeometry-combinatorial-0.10.0.0-KBhA9TX8xzkAsPm57THGXk" False) (C1 (MetaCons "Gr" PrefixI True) (S1 (MetaSel (Just "adjacencies") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [v]) :*: S1 (MetaSel (Just "faces") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [f])))

data Vtx v e Source #

A vertex, represented by an id, its adjacencies, and its data.

Constructors

Vtx 

Fields

  • id :: Int
     
  • adj :: [(Int, e)]

    adjacent vertices + data on the edge. Some functions, like fromAdjRep may assume that the adjacencies are given in counterclockwise order around the vertices. This is not (yet) enforced by the data type.

  • vData :: v
     
Instances
Bifunctor Vtx Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Methods

bimap :: (a -> b) -> (c -> d) -> Vtx a c -> Vtx b d #

first :: (a -> b) -> Vtx a c -> Vtx b c #

second :: (b -> c) -> Vtx a b -> Vtx a c #

Generic (Vtx v e) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Associated Types

type Rep (Vtx v e) :: Type -> Type #

Methods

from :: Vtx v e -> Rep (Vtx v e) x #

to :: Rep (Vtx v e) x -> Vtx v e #

(ToJSON v, ToJSON e) => ToJSON (Vtx v e) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Methods

toJSON :: Vtx v e -> Value #

toEncoding :: Vtx v e -> Encoding #

toJSONList :: [Vtx v e] -> Value #

toEncodingList :: [Vtx v e] -> Encoding #

(FromJSON v, FromJSON e) => FromJSON (Vtx v e) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Methods

parseJSON :: Value -> Parser (Vtx v e) #

parseJSONList :: Value -> Parser [Vtx v e] #

type Rep (Vtx v e) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

type Rep (Vtx v e) = D1 (MetaData "Vtx" "Data.PlanarGraph.AdjRep" "hgeometry-combinatorial-0.10.0.0-KBhA9TX8xzkAsPm57THGXk" False) (C1 (MetaCons "Vtx" PrefixI True) (S1 (MetaSel (Just "id") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int) :*: (S1 (MetaSel (Just "adj") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [(Int, e)]) :*: S1 (MetaSel (Just "vData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 v))))

data Face f Source #

Faces

Constructors

Face 

Fields

Instances
Functor Face Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Methods

fmap :: (a -> b) -> Face a -> Face b #

(<$) :: a -> Face b -> Face a #

Generic (Face f) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

Associated Types

type Rep (Face f) :: Type -> Type #

Methods

from :: Face f -> Rep (Face f) x #

to :: Rep (Face f) x -> Face f #

ToJSON f => ToJSON (Face f) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

FromJSON f => FromJSON (Face f) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

type Rep (Face f) Source # 
Instance details

Defined in Data.PlanarGraph.AdjRep

type Rep (Face f) = D1 (MetaData "Face" "Data.PlanarGraph.AdjRep" "hgeometry-combinatorial-0.10.0.0-KBhA9TX8xzkAsPm57THGXk" False) (C1 (MetaCons "Face" PrefixI True) (S1 (MetaSel (Just "incidentEdge") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Int, Int)) :*: S1 (MetaSel (Just "fData") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 f)))