graphs-0.7.1: A simple monadic graph library

Copyright (C) 2011 Edward Kmett BSD-style (see the file LICENSE) Edward Kmett experimental type families Safe Haskell98

Data.Graph.Algorithm

Description

Functions and data structures common to graph search algorithms

Synopsis

# Documentation

data GraphSearch g m Source #

Graph search visitor

Constructors

 GraphSearch FieldsenterVertex :: Vertex g -> g mCalled the first time a vertex is discoveredenterEdge :: Edge g -> g mCalled the first time an edge is discovered, before enterVertexgrayTarget :: Edge g -> g mCalled when we encounter a back edge to a vertex we're still processingexitVertex :: Vertex g -> g mCalled once we have processed all descendants of a vertexblackTarget :: Edge g -> g mCalled when we encounter a cross edge to a vertex we've already finished

Instances

 Graph g => Monad (GraphSearch g) Source # Methods(>>=) :: GraphSearch g a -> (a -> GraphSearch g b) -> GraphSearch g b #(>>) :: GraphSearch g a -> GraphSearch g b -> GraphSearch g b #return :: a -> GraphSearch g a #fail :: String -> GraphSearch g a # Graph g => Functor (GraphSearch g) Source # Methodsfmap :: (a -> b) -> GraphSearch g a -> GraphSearch g b #(<\$) :: a -> GraphSearch g b -> GraphSearch g a # Graph g => Applicative (GraphSearch g) Source # Methodspure :: a -> GraphSearch g a #(<*>) :: GraphSearch g (a -> b) -> GraphSearch g a -> GraphSearch g b #liftA2 :: (a -> b -> c) -> GraphSearch g a -> GraphSearch g b -> GraphSearch g c #(*>) :: GraphSearch g a -> GraphSearch g b -> GraphSearch g b #(<*) :: GraphSearch g a -> GraphSearch g b -> GraphSearch g a # (Graph g, Semigroup m) => Semigroup (GraphSearch g m) Source # Methods(<>) :: GraphSearch g m -> GraphSearch g m -> GraphSearch g m #sconcat :: NonEmpty (GraphSearch g m) -> GraphSearch g m #stimes :: Integral b => b -> GraphSearch g m -> GraphSearch g m # (Graph g, Monoid m) => Monoid (GraphSearch g m) Source # Methodsmempty :: GraphSearch g m #mappend :: GraphSearch g m -> GraphSearch g m -> GraphSearch g m #mconcat :: [GraphSearch g m] -> GraphSearch g m #