graphs-0.7.1: A simple monadic graph library

Copyright(C) 2011 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitytype families
Safe HaskellSafe
LanguageHaskell98

Data.Graph.AdjacencyList

Description

 

Synopsis

Documentation

newtype AdjacencyList i a Source #

Constructors

AdjacencyList 

Fields

Instances

Monad (AdjacencyList i) Source # 

Methods

(>>=) :: AdjacencyList i a -> (a -> AdjacencyList i b) -> AdjacencyList i b #

(>>) :: AdjacencyList i a -> AdjacencyList i b -> AdjacencyList i b #

return :: a -> AdjacencyList i a #

fail :: String -> AdjacencyList i a #

Functor (AdjacencyList i) Source # 

Methods

fmap :: (a -> b) -> AdjacencyList i a -> AdjacencyList i b #

(<$) :: a -> AdjacencyList i b -> AdjacencyList i a #

Applicative (AdjacencyList i) Source # 

Methods

pure :: a -> AdjacencyList i a #

(<*>) :: AdjacencyList i (a -> b) -> AdjacencyList i a -> AdjacencyList i b #

liftA2 :: (a -> b -> c) -> AdjacencyList i a -> AdjacencyList i b -> AdjacencyList i c #

(*>) :: AdjacencyList i a -> AdjacencyList i b -> AdjacencyList i b #

(<*) :: AdjacencyList i a -> AdjacencyList i b -> AdjacencyList i a #

Ord i => Graph (AdjacencyList i) Source # 

Associated Types

type Vertex (AdjacencyList i :: * -> *) :: * Source #

type Edge (AdjacencyList i :: * -> *) :: * Source #

Ix i => AdjacencyListGraph (AdjacencyList i) Source # 
type Vertex (AdjacencyList i) Source # 
type Vertex (AdjacencyList i) = i
type Edge (AdjacencyList i) Source # 
type Edge (AdjacencyList i) = (i, i)

class Graph g => AdjacencyListGraph g Source #

Minimal definition: source, target, and either adjacentVertices with outEdges = defaultOutEdges or outEdges

Minimal complete definition

source, target, outEdges

Instances

AdjacencyListGraph Identity Source # 
AdjacencyListGraph g => AdjacencyListGraph (MaybeT g) Source # 
BidirectionalGraph g => AdjacencyListGraph (Dual g) Source # 

Methods

source :: Edge (Dual g) -> Dual g (Vertex (Dual g)) Source #

target :: Edge (Dual g) -> Dual g (Vertex (Dual g)) Source #

outEdges :: Vertex (Dual g) -> Dual g [Edge (Dual g)] Source #

outDegree :: Vertex (Dual g) -> Dual g Int Source #

adjacentVertices :: Vertex (Dual g) -> Dual g [Vertex (Dual g)] Source #

Ix i => AdjacencyListGraph (AdjacencyList i) Source # 
(AdjacencyListGraph g, Monoid m) => AdjacencyListGraph (WriterT m g) Source # 

Methods

source :: Edge (WriterT m g) -> WriterT m g (Vertex (WriterT m g)) Source #

target :: Edge (WriterT m g) -> WriterT m g (Vertex (WriterT m g)) Source #

outEdges :: Vertex (WriterT m g) -> WriterT m g [Edge (WriterT m g)] Source #

outDegree :: Vertex (WriterT m g) -> WriterT m g Int Source #

adjacentVertices :: Vertex (WriterT m g) -> WriterT m g [Vertex (WriterT m g)] Source #

(AdjacencyListGraph g, Monoid m) => AdjacencyListGraph (WriterT m g) Source # 

Methods

source :: Edge (WriterT m g) -> WriterT m g (Vertex (WriterT m g)) Source #

target :: Edge (WriterT m g) -> WriterT m g (Vertex (WriterT m g)) Source #

outEdges :: Vertex (WriterT m g) -> WriterT m g [Edge (WriterT m g)] Source #

outDegree :: Vertex (WriterT m g) -> WriterT m g Int Source #

adjacentVertices :: Vertex (WriterT m g) -> WriterT m g [Vertex (WriterT m g)] Source #

AdjacencyListGraph g => AdjacencyListGraph (StateT s g) Source # 

Methods

source :: Edge (StateT s g) -> StateT s g (Vertex (StateT s g)) Source #

target :: Edge (StateT s g) -> StateT s g (Vertex (StateT s g)) Source #

outEdges :: Vertex (StateT s g) -> StateT s g [Edge (StateT s g)] Source #

outDegree :: Vertex (StateT s g) -> StateT s g Int Source #

adjacentVertices :: Vertex (StateT s g) -> StateT s g [Vertex (StateT s g)] Source #

AdjacencyListGraph g => AdjacencyListGraph (StateT s g) Source # 

Methods

source :: Edge (StateT s g) -> StateT s g (Vertex (StateT s g)) Source #

target :: Edge (StateT s g) -> StateT s g (Vertex (StateT s g)) Source #

outEdges :: Vertex (StateT s g) -> StateT s g [Edge (StateT s g)] Source #

outDegree :: Vertex (StateT s g) -> StateT s g Int Source #

adjacentVertices :: Vertex (StateT s g) -> StateT s g [Vertex (StateT s g)] Source #

AdjacencyListGraph g => AdjacencyListGraph (IdentityT * g) Source # 
(AdjacencyListGraph g, Error e) => AdjacencyListGraph (ErrorT e g) Source # 

Methods

source :: Edge (ErrorT e g) -> ErrorT e g (Vertex (ErrorT e g)) Source #

target :: Edge (ErrorT e g) -> ErrorT e g (Vertex (ErrorT e g)) Source #

outEdges :: Vertex (ErrorT e g) -> ErrorT e g [Edge (ErrorT e g)] Source #

outDegree :: Vertex (ErrorT e g) -> ErrorT e g Int Source #

adjacentVertices :: Vertex (ErrorT e g) -> ErrorT e g [Vertex (ErrorT e g)] Source #

AdjacencyListGraph g => AdjacencyListGraph (ReaderT * e g) Source # 

Methods

source :: Edge (ReaderT * e g) -> ReaderT * e g (Vertex (ReaderT * e g)) Source #

target :: Edge (ReaderT * e g) -> ReaderT * e g (Vertex (ReaderT * e g)) Source #

outEdges :: Vertex (ReaderT * e g) -> ReaderT * e g [Edge (ReaderT * e g)] Source #

outDegree :: Vertex (ReaderT * e g) -> ReaderT * e g Int Source #

adjacentVertices :: Vertex (ReaderT * e g) -> ReaderT * e g [Vertex (ReaderT * e g)] Source #

(AdjacencyListGraph g, Monoid m) => AdjacencyListGraph (RWST r m s g) Source # 

Methods

source :: Edge (RWST r m s g) -> RWST r m s g (Vertex (RWST r m s g)) Source #

target :: Edge (RWST r m s g) -> RWST r m s g (Vertex (RWST r m s g)) Source #

outEdges :: Vertex (RWST r m s g) -> RWST r m s g [Edge (RWST r m s g)] Source #

outDegree :: Vertex (RWST r m s g) -> RWST r m s g Int Source #

adjacentVertices :: Vertex (RWST r m s g) -> RWST r m s g [Vertex (RWST r m s g)] Source #

(AdjacencyListGraph g, Monoid m) => AdjacencyListGraph (RWST r m s g) Source # 

Methods

source :: Edge (RWST r m s g) -> RWST r m s g (Vertex (RWST r m s g)) Source #

target :: Edge (RWST r m s g) -> RWST r m s g (Vertex (RWST r m s g)) Source #

outEdges :: Vertex (RWST r m s g) -> RWST r m s g [Edge (RWST r m s g)] Source #

outDegree :: Vertex (RWST r m s g) -> RWST r m s g Int Source #

adjacentVertices :: Vertex (RWST r m s g) -> RWST r m s g [Vertex (RWST r m s g)] Source #