| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
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
- newtype Graph g e v = Graph {
- getGraphInternal :: SomeGraph e v
- data SomeGraph e v = SomeGraph {
- graphVertices :: !(Vector v)
- graphOutboundNeighborVertices :: !(Vector (Vector Int))
- graphOutboundNeighborEdges :: !(Vector (Vector e))
- newtype Size g = Size {}
- newtype Vertex g = Vertex {}
- newtype Vertices g v = Vertices {}
- newtype MVertices s g v = MVertices {
- getMVerticesInternal :: MVector s v
- newtype MUVertices s g v = MUVertices {
- getMUVerticesInternal :: MVector s v
- data IntPair = IntPair !Int !Int
- data MGraph s g e v = MGraph {
- mgraphVertexIndex :: !(MHashMap s v Int)
- mgraphCurrentId :: !(MutVar s Int)
- mgraphEdges :: !(MHashMap s IntPair e)
- type IOGraph = MGraph RealWorld
- type STGraph s = MGraph s
Documentation
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 | |
Fields
| |
This is a Graph without the phantom type variable. Very few
functions work with this type.
Constructors
| SomeGraph | |
Fields
| |
Instances
| Functor (SomeGraph e) Source # | |
| (Eq v, Eq e) => Eq (SomeGraph e v) Source # | |
| (Ord v, Ord e) => Ord (SomeGraph e v) Source # | |
Defined in Data.Graph.Types.Internal 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 # | |
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 | |
Fields | |
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 | |
Fields
| |
newtype MUVertices s g v Source #
Constructors
| MUVertices | |
Fields
| |
A strict pair of Ints. This is used internally.
Instances
| Eq IntPair Source # | |
| Ord IntPair Source # | |
Defined in Data.Graph.Types.Internal | |
| Read IntPair Source # | |
| Show IntPair Source # | |
| Generic IntPair Source # | |
| Hashable IntPair Source # | |
Defined in Data.Graph.Types.Internal | |
| type Rep IntPair Source # | |
Defined in Data.Graph.Types.Internal type Rep IntPair = D1 (MetaData "IntPair" "Data.Graph.Types.Internal" "impure-containers-0.5.1-DbosB0iVtXMA8RrcTl3qHF" False) (C1 (MetaCons "IntPair" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int))) | |
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 | |
Fields
| |