impure-containers-0.4.1: Mutable containers in haskell

Safe HaskellNone
LanguageHaskell2010

Data.Graph.Types.Internal

Description

Unsafe Internals

The internals provided here do not constitute part of the stable API. Additionally, they are unsafe. Using these data constructors directly can cause other functions in this library to segfault. If you find that you need something from this module, consider opening up an issue on github so that the functionality you need can be provided by the safe API instead.

Synopsis

Documentation

newtype Graph g e v Source #

A Graph with edges labeled by e and vertices labeled by v. The g type variable is a phatom type that associates a Graph with vertices that belong to it.

Constructors

Graph 

Instances

Functor (Graph g e) Source # 

Methods

fmap :: (a -> b) -> Graph g e a -> Graph g e b #

(<$) :: a -> Graph g e b -> Graph g e a #

data SomeGraph e v Source #

This is a Graph without the phantom type variable. Very few functions work with this type.

Instances

Functor (SomeGraph e) Source # 

Methods

fmap :: (a -> b) -> SomeGraph e a -> SomeGraph e b #

(<$) :: a -> SomeGraph e b -> SomeGraph e a #

(Eq e, Eq v) => Eq (SomeGraph e v) Source # 

Methods

(==) :: SomeGraph e v -> SomeGraph e v -> Bool #

(/=) :: SomeGraph e v -> SomeGraph e v -> Bool #

(Ord e, Ord v) => Ord (SomeGraph e v) Source # 

Methods

compare :: SomeGraph e v -> SomeGraph e v -> Ordering #

(<) :: SomeGraph e v -> SomeGraph e v -> Bool #

(<=) :: SomeGraph e v -> SomeGraph e v -> Bool #

(>) :: SomeGraph e v -> SomeGraph e v -> Bool #

(>=) :: SomeGraph e v -> SomeGraph e v -> Bool #

max :: SomeGraph e v -> SomeGraph e v -> SomeGraph e v #

min :: SomeGraph e v -> SomeGraph e v -> SomeGraph e v #

newtype Size g Source #

Constructors

Size 

Fields

newtype Vertex g Source #

A reference to a vertex in a Graph with matching type variable g. Vertex is a thin wrapper for Int and does not hold the label of the vertex.

Constructors

Vertex 

Instances

Eq (Vertex g) Source # 

Methods

(==) :: Vertex g -> Vertex g -> Bool #

(/=) :: Vertex g -> Vertex g -> Bool #

Ord (Vertex g) Source # 

Methods

compare :: Vertex g -> Vertex g -> Ordering #

(<) :: Vertex g -> Vertex g -> Bool #

(<=) :: Vertex g -> Vertex g -> Bool #

(>) :: Vertex g -> Vertex g -> Bool #

(>=) :: Vertex g -> Vertex g -> Bool #

max :: Vertex g -> Vertex g -> Vertex g #

min :: Vertex g -> Vertex g -> Vertex g #

Hashable (Vertex g) Source # 

Methods

hashWithSalt :: Int -> Vertex g -> Int #

hash :: Vertex g -> Int #

newtype Vertices g v Source #

All vertices in a Graph with matching type variable g.

Constructors

Vertices 

Instances

Functor (Vertices g) Source # 

Methods

fmap :: (a -> b) -> Vertices g a -> Vertices g b #

(<$) :: a -> Vertices g b -> Vertices g a #

newtype MVertices s g v Source #

Mutable vertices that have the same length as the vertices in a Graph. This is used to safely implement algorithms that need to mark vertices as they traverse a graph.

Constructors

MVertices 

newtype MUVertices s g v Source #

Mutable unboxed vertices that have the same length as the vertices in a Graph. See MVertices.

Constructors

MUVertices 

data IntPair Source #

A strict pair of Ints. This is used internally.

Constructors

IntPair !Int !Int 

data MGraph s g e v Source #

This is more accurately thought of as a graph builder rather than a mutable graph. You can add vertices and edges, and you can delete edges, but you cannot delete vertices.

Constructors

MGraph 

type STGraph s = MGraph s Source #