-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Bindings to Graphviz for graph visualisation.
--   
--   This library provides bindings for the Dot language used by the
--   Graphviz (http://graphviz.org/) suite of programs for
--   visualising graphs, as well as functions to call those programs.
--   
--   Main features of the graphviz library include:
--   
--   
--   
- Almost complete coverage of all Graphviz attributes and
--   syntax.
--   
- Support for specifying clusters.
--   
- The ability to use a custom node type.
--   
- Functions for running a Graphviz layout tool with all specified
--   output types.
--   
- The ability to not only generate but also parse Dot code with two
--   options: strict and liberal (in terms of ordering of statements).
--   
- Functions to convert FGL graphs and other graph-like data
--   structures to Dot code - including support to group them into clusters
--   - with a high degree of customisation by specifying which attributes
--   to use and limited support for the inverse operation.
--   
- Round-trip support for passing an FGL graph through Graphviz to
--   augment node and edge labels with positional information, etc.
--   
@package graphviz
@version 2999.20.2.1

module Data.GraphViz.Exception

-- | Exceptions that arise from using this library fall into four
--   categories:
--   
--   
--   
- Unable to parse provided Dot code.
--   
- Dot code is not valid UTF-8.
--   
- An error when trying to run an external program (e.g.
--   dot).
--   
- Treating a non-custom Attribute as a custom one.
--   
data GraphvizException
NotDotCode :: String -> GraphvizException
NotUTF8Dot :: String -> GraphvizException
GVProgramExc :: String -> GraphvizException
NotCustomAttr :: String -> GraphvizException

-- | This function maps one exception into another as proposed in the paper
--   "A semantics for imprecise exceptions".
mapException :: (Exception e1, Exception e2) => (e1 -> e2) -> a -> a

-- | Throw an exception. Exceptions may be thrown from purely functional
--   code, but may only be caught within the IO monad.
--   
--   WARNING: You may want to use throwIO instead so that your
--   pure code stays exception-free.
throw :: forall a e. (HasCallStack, Exception e) => e -> a

-- | A variant of throw that can only be used within the IO
--   monad.
--   
--   Although throwIO has a type that is an instance of the type of
--   throw, the two functions are subtly different:
--   
--   
--   throw e   `seq` ()  ===> throw e
--   throwIO e `seq` ()  ===> ()
--   
--   
--   The first example will cause the exception e to be raised,
--   whereas the second one won't. In fact, throwIO will only cause
--   an exception to be raised when it is used within the IO monad.
--   
--   The throwIO variant should be used in preference to
--   throw to raise an exception within the IO monad because
--   it guarantees ordering with respect to other operations, whereas
--   throw does not. We say that throwIO throws *precise*
--   exceptions and throw, error, etc. all throw *imprecise*
--   exceptions. For example
--   
--   
--   throw e + error "boom" ===> error "boom"
--   throw e + error "boom" ===> throw e
--   
--   
--   are both valid reductions and the compiler may pick any (loop, even),
--   whereas
--   
--   
--   throwIO e >> error "boom" ===> throwIO e
--   
--   
--   will always throw e when executed.
--   
--   See also the GHC wiki page on precise exceptions for a more
--   technical introduction to how GHC optimises around precise vs.
--   imprecise exceptions.
throwIO :: (HasCallStack, Exception e) => e -> IO a

-- | A version of catch with the arguments swapped around; useful in
--   situations where the code for the handler is shorter. For example:
--   
--   
--   do handle (\NonTermination -> exitWith (ExitFailure 1)) $
--      ...
--   
handle :: Exception e => (e -> IO a) -> IO a -> IO a

-- | When you want to acquire a resource, do some work with it, and then
--   release the resource, it is a good idea to use bracket, because
--   bracket will install the necessary exception handler to release
--   the resource in the event that an exception is raised during the
--   computation. If an exception is raised, then bracket will
--   re-raise the exception (after performing the release).
--   
--   A common example is opening a file:
--   
--   
--   bracket
--     (openFile "filename" ReadMode)
--     (hClose)
--     (\fileHandle -> do { ... })
--   
--   
--   The arguments to bracket are in this order so that we can
--   partially apply it, e.g.:
--   
--   
--   withFile name mode = bracket (openFile name mode) hClose
--   
--   
--   Bracket wraps the release action with mask, which is sufficient
--   to ensure that the release action executes to completion when it does
--   not invoke any interruptible actions, even in the presence of
--   asynchronous exceptions. For example, hClose is
--   uninterruptible when it is not racing other uses of the handle.
--   Similarly, closing a socket (from "network" package) is also
--   uninterruptible under similar conditions. An example of an
--   interruptible action is killThread. Completion of interruptible
--   release actions can be ensured by wrapping them in
--   uninterruptibleMask_, but this risks making the program
--   non-responsive to Control-C, or timeouts. Another option is
--   to run the release action asynchronously in its own thread:
--   
--   
--   void $ uninterruptibleMask_ $ forkIO $ do { ... }
--   
--   
--   The resource will be released as soon as possible, but the thread that
--   invoked bracket will not block in an uninterruptible state.
bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
instance GHC.Classes.Eq Data.GraphViz.Exception.GraphvizException
instance GHC.Internal.Exception.Type.Exception Data.GraphViz.Exception.GraphvizException
instance GHC.Classes.Ord Data.GraphViz.Exception.GraphvizException
instance GHC.Internal.Show.Show Data.GraphViz.Exception.GraphvizException

-- | This module defines simple helper functions for use with
--   Text.ParserCombinators.Poly.Lazy.
--   
--   Note that the ParseDot instances for Bool, etc. match
--   those specified for use with Graphviz (e.g. non-zero integers are
--   equivalent to True).
--   
--   You should not be using this module; rather, it is here for
--   informative/documentative reasons. If you want to parse a
--   DotRepr, you should use parseDotGraph
--   rather than its ParseDot instance.
module Data.GraphViz.Parsing

-- | A functor with application, providing operations to
--   
--   
--   
- embed pure expressions (pure), and
--   
- sequence computations and combine their results (<*>
--   and liftA2).
--   
--   
--   A minimal complete definition must include implementations of
--   pure and of either <*> or liftA2. If it
--   defines both, then they must behave the same as their default
--   definitions:
--   
--   
--   (<*>) = liftA2 id
--   
--   
--   
--   liftA2 f x y = f <$> x <*> y
--   
--   
--   Further, any definition must satisfy the following:
--   
--   
--   
- Identity 
pure id <*> v =
--   v

--   
- Composition 
pure (.) <*> u
--   <*> v <*> w = u <*> (v
--   <*> w)

--   
- Homomorphism 
pure f <*>
--   pure x = pure (f x)

--   
- Interchange 
u <*> pure y =
--   pure ($ y) <*> u

--   
--   
--   The other methods have the following default definitions, which may be
--   overridden with equivalent specialized implementations:
--   
--   
--   
- 
u *> v = (id <$ u)
--   <*> v

--   
- 
u <* v = liftA2 const u v

--   
--   
--   As a consequence of these laws, the Functor instance for
--   f will satisfy
--   
--   
--   
- 
fmap f x = pure f <*> x

--   
--   
--   It may be useful to note that supposing
--   
--   
--   forall x y. p (q x y) = f x . g y
--   
--   
--   it follows from the above that
--   
--   
--   liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v
--   
--   
--   If f is also a Monad, it should satisfy
--   
--   
--   
- 
pure = return

--   
- 
m1 <*> m2 = m1 >>= (\x1 -> m2
--   >>= (\x2 -> return (x1 x2)))

--   
- 
(*>) = (>>)

--   
--   
--   (which implies that pure and <*> satisfy the
--   applicative functor laws).
class Functor f => Applicative (f :: Type -> Type)

-- | Lift a value into the Structure.
--   
--   
Examples
--   
--   
--   >>> pure 1 :: Maybe Int
--   Just 1
--   
--   
--   
--   >>> pure 'z' :: [Char]
--   "z"
--   
--   
--   
--   >>> pure (pure ":D") :: Maybe [String]
--   Just [":D"]
--   
pure :: Applicative f => a -> f a

-- | Sequential application.
--   
--   A few functors support an implementation of <*> that is
--   more efficient than the default one.
--   
--   
Example
--   
--   Used in combination with (<$>),
--   (<*>) can be used to build a record.
--   
--   
--   >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
--   
--   
--   
--   >>> produceFoo :: Applicative f => f Foo
--   
--   >>> produceBar :: Applicative f => f Bar
--   
--   >>> produceBaz :: Applicative f => f Baz
--   
--   
--   
--   >>> mkState :: Applicative f => f MyState
--   
--   >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
--   
(<*>) :: Applicative f => f (a -> b) -> f a -> f b

-- | Lift a binary function to actions.
--   
--   Some functors support an implementation of liftA2 that is more
--   efficient than the default one. In particular, if fmap is an
--   expensive operation, it is likely better to use liftA2 than to
--   fmap over the structure and then use <*>.
--   
--   This became a typeclass method in 4.10.0.0. Prior to that, it was a
--   function defined in terms of <*> and fmap.
--   
--   
Example
--   
--   
--   >>> liftA2 (,) (Just 3) (Just 5)
--   Just (3,5)
--   
--   
--   
--   >>> liftA2 (+) [1, 2, 3] [4, 5, 6]
--   [5,6,7,6,7,8,7,8,9]
--   
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c

-- | Sequence actions, discarding the value of the first argument.
--   
--   
Examples
--   
--   If used in conjunction with the Applicative instance for Maybe,
--   you can chain Maybe computations, with a possible "early return" in
--   case of Nothing.
--   
--   
--   >>> Just 2 *> Just 3
--   Just 3
--   
--   
--   
--   >>> Nothing *> Just 3
--   Nothing
--   
--   
--   Of course a more interesting use case would be to have effectful
--   computations instead of just returning pure values.
--   
--   
--   >>> import Data.Char
--   
--   >>> import GHC.Internal.Text.ParserCombinators.ReadP
--   
--   >>> let p = string "my name is " *> munch1 isAlpha <* eof
--   
--   >>> readP_to_S p "my name is Simon"
--   [("Simon","")]
--   
(*>) :: Applicative f => f a -> f b -> f b

-- | Sequence actions, discarding the value of the second argument.
(<*) :: Applicative f => f a -> f b -> f a
infixl 4 <*>
infixl 4 *>
infixl 4 <*

-- | A monoid on applicative functors.
--   
--   If defined, some and many should be the least solutions
--   of the equations:
--   
--   
--   
- 
some v = (:) <$> v <*>
--   many v

--   
- 
many v = some v <|> pure
--   []

--   
--   
--   
Examples
--   
--   
--   >>> Nothing <|> Just 42
--   Just 42
--   
--   
--   
--   >>> [1, 2] <|> [3, 4]
--   [1,2,3,4]
--   
--   
--   
--   >>> empty <|> print (2^15)
--   32768
--   
class Applicative f => Alternative (f :: Type -> Type)

-- | An associative binary operation
(<|>) :: Alternative f => f a -> f a -> f a

-- | One or more.
--   
--   
Examples
--   
--   
--   >>> some (putStr "la")
--   lalalalalalalalala... * goes on forever *
--   
--   
--   
--   >>> some Nothing
--   nothing
--   
--   
--   
--   >>> take 5 <$> some (Just 1)
--   * hangs forever *
--   
--   
--   Note that this function can be used with Parsers based on
--   Applicatives. In that case some parser will attempt to parse
--   parser one or more times until it fails.
some :: Alternative f => f a -> f [a]

-- | Zero or more.
--   
--   
Examples
--   
--   
--   >>> many (putStr "la")
--   lalalalalalalalala... * goes on forever *
--   
--   
--   
--   >>> many Nothing
--   Just []
--   
--   
--   
--   >>> take 5 <$> many (Just 1)
--   * hangs forever *
--   
--   
--   Note that this function can be used with Parsers based on
--   Applicatives. In that case many parser will attempt to parse
--   parser zero or more times until it fails.
many :: Alternative f => f a -> f [a]
infixl 3 <|>

-- | Replace all locations in the input with the same value. The default
--   definition is fmap . const, but this may be
--   overridden with a more efficient version.
--   
--   
Examples
--   
--   Perform a computation with Maybe and replace the result with a
--   constant value if it is Just:
--   
--   
--   >>> 'a' <$ Just 2
--   Just 'a'
--   
--   >>> 'a' <$ Nothing
--   Nothing
--   
(<$) :: Functor f => a -> f b -> f a
infixl 4 <$

-- | A variant of <*> with the types of the arguments
--   reversed. It differs from flip (<*>) in
--   that the effects are resolved in the order the arguments are
--   presented.
--   
--   
Examples
--   
--   
--   >>> (<**>) (print 1) (id <$ print 2)
--   1
--   2
--   
--   
--   
--   >>> flip (<*>) (print 1) (id <$ print 2)
--   2
--   1
--   
--   
--   
--   >>> ZipList [4, 5, 6] <**> ZipList [(+1), (*2), (/3)]
--   ZipList {getZipList = [5.0,10.0,2.0]}
--   
(<**>) :: Applicative f => f a -> f (a -> b) -> f b
infixl 4 <**>

-- | Lift a function to actions. Equivalent to Functor's fmap but
--   implemented using only Applicative's methods: liftA
--   f a = pure f <*> a
--   
--   As such this function may be used to implement a Functor
--   instance from an Applicative one.
--   
--   
Examples
--   
--   Using the Applicative instance for Lists:
--   
--   
--   >>> liftA (+1) [1, 2]
--   [2,3]
--   
--   
--   Or the Applicative instance for Maybe
--   
--   
--   >>> liftA (+1) (Just 3)
--   Just 4
--   
liftA :: Applicative f => (a -> b) -> f a -> f b

-- | Lift a ternary function to actions.
liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d

-- | An infix synonym for fmap.
--   
--   The name of this operator is an allusion to $. Note the
--   similarities between their types:
--   
--   
--    ($)  ::              (a -> b) ->   a ->   b
--   (<$>) :: Functor f => (a -> b) -> f a -> f b
--   
--   
--   Whereas $ is function application, <$> is function
--   application lifted over a Functor.
--   
--   
Examples
--   
--   Convert from a Maybe Int to a Maybe
--   String using show:
--   
--   
--   >>> show <$> Nothing
--   Nothing
--   
--   
--   
--   >>> show <$> Just 3
--   Just "3"
--   
--   
--   Convert from an Either Int Int to an
--   Either Int String using show:
--   
--   
--   >>> show <$> Left 17
--   Left 17
--   
--   
--   
--   >>> show <$> Right 17
--   Right "17"
--   
--   
--   Double each element of a list:
--   
--   
--   >>> (*2) <$> [1,2,3]
--   [2,4,6]
--   
--   
--   Apply even to the second element of a pair:
--   
--   
--   >>> even <$> (2,2)
--   (2,True)
--   
(<$>) :: Functor f => (a -> b) -> f a -> f b
infixl 4 <$>

-- | Return the next token if it satisfies the given predicate.
satisfy :: (Char -> Bool) -> Parser s Char

-- | Succeed if the end of file/input has been reached, fail otherwise.
eof :: Parser s ()

-- | One or none.
--   
--   It is useful for modelling any computation that is allowed to fail.
--   
--   
Examples
--   
--   Using the Alternative instance of Control.Monad.Except,
--   the following functions:
--   
--   
--   >>> import Control.Monad.Except
--   
--   
--   
--   >>> canFail = throwError "it failed" :: Except String Int
--   
--   >>> final = return 42                :: Except String Int
--   
--   
--   Can be combined by allowing the first function to fail:
--   
--   
--   >>> runExcept $ canFail *> final
--   Left "it failed"
--   
--   
--   
--   >>> runExcept $ optional canFail *> final
--   Right 42
--   
optional :: Alternative f => f a -> f (Maybe a)

-- | Parse a non-empty list of items.
many1 :: PolyParse p => p a -> p [a]

-- | Parse a list of items separated by discarded junk.
sepBy :: PolyParse p => p a -> p sep -> p [a]

-- | Parse a non-empty list of items separated by discarded junk.
sepBy1 :: PolyParse p => p a -> p sep -> p [a]

-- | Apply a parsed function to a parsed value. Rather like ordinary
--   function application lifted into parsers.
apply :: PolyParse p => p (a -> b) -> p a -> p b
infixl 3 `apply`

-- | The sum of a collection of actions using (<|>),
--   generalizing concat.
--   
--   asum is just like msum, but generalised to
--   Alternative.
--   
--   
Examples
--   
--   Basic usage:
--   
--   
--   >>> asum [Just "Hello", Nothing, Just "World"]
--   Just "Hello"
--   
asum :: (Foldable t, Alternative f) => t (f a) -> f a

-- | The Const functor.
--   
--   
Examples
--   
--   
--   >>> fmap (++ "World") (Const "Hello")
--   Const "Hello"
--   
--   
--   Because we ignore the second type parameter to Const, the
--   Applicative instance, which has (<*>) :: Monoid m
--   => Const m (a -> b) -> Const m a -> Const m b
--   essentially turns into Monoid m => m -> m -> m,
--   which is (<>)
--   
--   
--   >>> Const [1, 2, 3] <*> Const [4, 5, 6]
--   Const [1,2,3,4,5,6]
--   
newtype Const a (b :: k)
Const :: a -> Const a (b :: k)
[getConst] :: Const a (b :: k) -> a

-- | Parse a bracketed item, discarding the brackets. If everything matches
--   except the closing bracket, the whole parse fails soft, which
--   can give less-than-satisfying error messages. If you want better error
--   messages, try calling with e.g. bracket open (commit close)
--   item
bracket :: PolyParse p => p bra -> p ket -> p a -> p a

-- | Lists, but with an Applicative functor based on zipping.
--   
--   
Examples
--   
--   In contrast to the Applicative for List:
--   
--   
--   >>> (+) <$> [1, 2, 3] <*> [4, 5, 6]
--   [5,6,7,6,7,8,7,8,9]
--   
--   
--   The Applicative instance of ZipList applies the operation by pairing
--   up the elements, analogous to zipWithN
--   
--   
--   >>> (+) <$> ZipList [1, 2, 3] <*> ZipList [4, 5, 6]
--   ZipList {getZipList = [5,7,9]}
--   
--   
--   
--   >>> (,,,) <$> ZipList [1, 2] <*> ZipList [3, 4] <*> ZipList [5, 6] <*> ZipList [7, 8]
--   ZipList {getZipList = [(1,3,5,7),(2,4,6,8)]}
--   
--   
--   
--   >>> ZipList [(+1), (^2), (/ 2)] <*> ZipList [5, 5, 5]
--   ZipList {getZipList = [6.0,25.0,2.5]}
--   
newtype ZipList a
ZipList :: [a] -> ZipList a
[getZipList] :: ZipList a -> [a]
newtype WrappedArrow (a :: Type -> Type -> Type) b c
WrapArrow :: a b c -> WrappedArrow (a :: Type -> Type -> Type) b c
[unwrapArrow] :: WrappedArrow (a :: Type -> Type -> Type) b c -> a b c
newtype WrappedMonad (m :: Type -> Type) a
WrapMonad :: m a -> WrappedMonad (m :: Type -> Type) a
[unwrapMonad] :: WrappedMonad (m :: Type -> Type) a -> m a

-- | This Parser datatype is a specialised parsing monad with
--   error reporting. Whereas the standard version can be used for
--   arbitrary token types, this version is specialised to Text input only.
newtype Parser s a
P :: (s -> Text -> Result (Text, s) a) -> Parser s a

-- | A return type like Either, that distinguishes not only between right
--   and wrong answers, but also has commitment, so that a failure cannot
--   be undone. This should only be used for writing very primitive parsers
--   - really it is an internal detail of the library. The z type is the
--   remaining unconsumed input.
data Result z a
Success :: z -> a -> Result z a
Failure :: z -> String -> Result z a
Committed :: Result z a -> Result z a

-- | Push some tokens back onto the front of the input stream and reparse.
--   This is useful e.g. for recursively expanding macros. When the
--   user-parser recognises a macro use, it can lookup the macro expansion
--   from the parse state, lex it, and then stuff the lexed expansion back
--   down into the parser.
reparse :: Text -> Parser s ()

-- | The PolyParse class is an abstraction gathering all of the
--   common features that a two-level error-handling parser requires: the
--   applicative parsing interface, the monadic interface, and commitment.
--   
--   There are two additional basic combinators that we expect to be
--   implemented afresh for every concrete type, but which (for technical
--   reasons) cannot be class methods. They are next and
--   satisfy.
class (Functor p, Monad p, MonadFail p, Applicative p, Alternative p, Commitment p) => PolyParse (p :: Type -> Type)

-- | The Commitment class is an abstraction over all the current
--   concrete representations of monadic/applicative parser combinators in
--   this package. The common feature is two-level error-handling. Some
--   primitives must be implemented specific to each parser type (e.g.
--   depending on whether the parser has a running state, or whether it is
--   lazy). But given those primitives, large numbers of combinators do not
--   depend any further on the internal structure of the particular parser.
class Commitment (p :: Type -> Type)

-- | Commit is a way of raising the severity of any errors found within its
--   argument. Used in the middle of a parser definition, it means that any
--   operations prior to commitment fail softly, but after commitment, they
--   fail hard.
commit :: Commitment p => p a -> p a

-- | p adjustErr f applies the transformation f to
--   any error message generated in p, having no effect if
--   p succeeds.
adjustErr :: Commitment p => p a -> (String -> String) -> p a

-- | Parse the first alternative that succeeds, but if none succeed, report
--   only the severe errors, and if none of those, then report all the soft
--   errors.
oneOf' :: Commitment p => [(String, p a)] -> p a

-- | x discard y parses both x and y, but discards the
--   result of y. Rather like const lifted into parsers.
discard :: PolyParse p => p a -> p b -> p a
infixl 3 `discard`

-- | When a simple fail is not strong enough, use failBad for emphasis. An
--   emphasised (severe) error cannot be overridden by choice operators.
failBad :: PolyParse p => String -> p a

-- | adjustErrBad is just like adjustErr except it also
--   raises the severity of the error.
adjustErrBad :: PolyParse p => p a -> (String -> String) -> p a

-- | Parse the first alternative in the list that succeeds.
oneOf :: PolyParse p => [p a] -> p a

-- | 'exactly n p' parses precisely n items, using the parser p, in
--   sequence.
exactly :: PolyParse p => Int -> p a -> p [a]

-- | 'upto n p' parses n or fewer items, using the parser p, in sequence.
upto :: PolyParse p => Int -> p a -> p [a]

-- | Parse a list of items, discarding the start, end, and separator items.
bracketSep :: PolyParse p => p bra -> p sep -> p ket -> p a -> p [a]

-- | manyFinally e t parses a possibly-empty sequence of
--   e's, terminated by a t. The final t is
--   discarded. Any parse failures could be due either to a badly-formed
--   terminator or a badly-formed element, so it raises both possible
--   errors.
manyFinally :: PolyParse p => p a -> p z -> p [a]

-- | manyFinally' is like manyFinally, except when the
--   terminator parser overlaps with the element parser. In manyFinally
--   e t, the parser t is tried only when parser e
--   fails, whereas in manyFinally' e t, the parser t is
--   always tried first, then parser e only if the terminator is
--   not found. For instance, manyFinally (accept "01") (accept
--   "0") on input "0101010" returns
--   ["01","01","01"], whereas manyFinally' with the same
--   arguments and input returns [].
manyFinally' :: (PolyParse p, Show a) => p a -> p z -> p [a]

-- | p onFail q means parse p, unless p fails, in which
--   case parse q instead. Can be chained together to give multiple
--   attempts to parse something. (Note that q could itself be a failing
--   parser, e.g. to change the error message from that defined in p to
--   something different.) However, a severe failure in p cannot be
--   ignored.
onFail :: Parser s a -> Parser s a -> Parser s a

-- | Simply return the next token in the input tokenstream.
next :: Parser s Char

-- | manySatisfy p is a more efficient fused version of many
--   (satisfy p)
manySatisfy :: (Char -> Bool) -> Parser s Text

-- | many1Satisfy p is a more efficient fused version of many1
--   (satisfy p)
many1Satisfy :: (Char -> Bool) -> Parser s Text

-- | Update the internal state.
stUpdate :: (s -> s) -> Parser s ()

-- | Query the internal state.
stQuery :: (s -> a) -> Parser s a

-- | Deliver the entire internal state.
stGet :: Parser s s

-- | A ReadS-like type alias.
type Parse a = Parser GraphvizState a
class ParseDot a
parseUnqt :: ParseDot a => Parse a
parse :: ParseDot a => Parse a
parseUnqtList :: ParseDot a => Parse [a]
parseList :: ParseDot a => Parse [a]

-- | Parse the required value, returning also the rest of the input
--   Text that hasn't been parsed (for debugging purposes).
parseIt :: ParseDot a => Text -> (a, Text)

-- | Parse the required value with the assumption that it will parse all of
--   the input Text.
parseIt' :: ParseDot a => Text -> a
runParser :: Parse a -> Text -> (Either String a, Text)

-- | A variant of runParser where it is assumed that the provided
--   parsing function consumes all of the Text input (with the
--   exception of whitespace at the end).
runParser' :: Parse a -> Text -> a
runParserWith :: (GraphvizState -> GraphvizState) -> Parse a -> Text -> (Either String a, Text)
parseLiberally :: GraphvizState -> GraphvizState

-- | If unable to parse Dot code properly, throw a
--   GraphvizException.
checkValidParse :: Either String a -> a

-- | If unable to parse Dot code properly, throw a
--   GraphvizException, with the error containing the remaining
--   unparsed code..
checkValidParseWithRest :: (Either String a, Text) -> a

-- | The opposite of bracket.
ignoreSep :: (a -> b -> c) -> Parse a -> Parse sep -> Parse b -> Parse c

-- | Use this when you do not want numbers to be treated as Bool
--   values.
onlyBool :: Parse Bool

-- | Parse a Text that doesn't need to be quoted.
quotelessString :: Parse Text
stringBlock :: Parse Text
numString :: Bool -> Parse Text

-- | Determine if this String represents a number. Boolean parameter
--   determines if exponents are considered part of numbers for this.
isNumString :: Bool -> Text -> Bool
isIntString :: Text -> Bool

-- | Used when quotes are explicitly required;
quotedString :: Parse Text

-- | Parse a Text where the provided Chars (as well as
--   " and \) are escaped and the second list of
--   Chars are those that are not permitted. Note: does not parse
--   surrounding quotes. The Bool value indicates whether empty
--   Texts are allowed or not.
parseEscaped :: Bool -> [Char] -> [Char] -> Parse Text
parseAndSpace :: Parse a -> Parse a
string :: String -> Parse ()
strings :: [String] -> Parse ()

-- | Assumes that any letter is ASCII for case-insensitive comparisons.
character :: Char -> Parse Char

-- | Parse a floating point number that actually contains decimals. Bool
--   flag indicates whether values that need to be quoted are parsed.
parseStrictFloat :: Bool -> Parse Double
parseSignedFloat :: Bool -> Parse Double
noneOf :: [Char] -> Parse Char

-- | Parses at least one whitespace character.
whitespace1 :: Parse ()

-- | Parses zero or more whitespace characters.
whitespace :: Parse ()

-- | Parse and discard optional surrounding whitespace.
wrapWhitespace :: Parse a -> Parse a
optionalQuotedString :: String -> Parse ()
optionalQuoted :: Parse a -> Parse a
quotedParse :: Parse a -> Parse a
orQuote :: Parse Char -> Parse Char
quoteChar :: Char

-- | Parses a newline.
newline :: Parse ()

-- | Consume all whitespace and newlines until a line with non-whitespace
--   is reached. The whitespace on that line is not consumed.
newline' :: Parse ()
parseComma :: Parse ()
parseEq :: Parse ()

-- | Try to parse a list of the specified type; returns an empty list if
--   parsing fails.
tryParseList :: ParseDot a => Parse [a]

-- | Return an empty list if parsing a list fails.
tryParseList' :: Parse [a] -> Parse [a]

-- | Parses and returns all characters up till the end of the line, but
--   does not touch the newline characters.
consumeLine :: Parse Text
commaSep :: (ParseDot a, ParseDot b) => Parse (a, b)
commaSepUnqt :: (ParseDot a, ParseDot b) => Parse (a, b)
commaSep' :: Parse a -> Parse b -> Parse (a, b)
stringRep :: a -> String -> Parse a
stringReps :: a -> [String] -> Parse a
stringParse :: [(String, Parse a)] -> Parse a
stringValue :: [(String, a)] -> Parse a
parseAngled :: Parse a -> Parse a
parseBraced :: Parse a -> Parse a
parseColorScheme :: Bool -> Parse ColorScheme
instance Data.GraphViz.Parsing.ParseDot GHC.Types.Bool
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.ColorScheme.BrewerName
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.ColorScheme.BrewerScheme
instance Data.GraphViz.Parsing.ParseDot GHC.Types.Char
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.ColorScheme.ColorScheme
instance Data.GraphViz.Parsing.ParseDot GHC.Types.Double
instance Data.GraphViz.Parsing.ParseDot GHC.Types.Int
instance Data.GraphViz.Parsing.ParseDot GHC.Num.Integer.Integer
instance Data.GraphViz.Parsing.ParseDot a => Data.GraphViz.Parsing.ParseDot [a]
instance Data.GraphViz.Parsing.ParseDot Data.Text.Internal.Text
instance Data.GraphViz.Parsing.ParseDot Data.Text.Internal.Lazy.Text
instance Data.GraphViz.Parsing.ParseDot GHC.Internal.Data.Version.Version
instance Data.GraphViz.Parsing.ParseDot GHC.Internal.Word.Word16
instance Data.GraphViz.Parsing.ParseDot GHC.Internal.Word.Word8

-- | "Real life" Dot code contains various items that are not directly
--   parseable by this library. This module defines the preProcess
--   function to remove these components, which include:
--   
--   
--   
- Comments (both /* ... */ style and // ... 
--   style);
--   
- Pre-processor lines (lines starting with a #);
--   
- Split lines (by inserting a \ the rest of that "line" is
--   continued on the next line).
--   
- Strings concatenated together using "..." + "..."; these
--   are concatenated into one big string.
--   
module Data.GraphViz.PreProcessing

-- | Remove unparseable features of Dot, such as comments and multi-line
--   strings (which are converted to single-line strings).
preProcess :: Text -> Text

-- | This module defines simple helper functions for use with
--   Text.PrettyPrint. It also re-exports all the pretty-printing
--   combinators from that module.
--   
--   Note that the PrintDot instances for Bool, etc. match
--   those specified for use with Graphviz.
--   
--   You should only be using this module if you are writing custom node
--   types for use with Data.GraphViz.Types. For actual printing of
--   code, use printDotGraph (which produces a Text
--   value).
--   
--   The Dot language specification specifies that any identifier is in one
--   of four forms:
--   
--   
--   
- Any string of alphabetic ([a-zA-Z\200-\377]) characters,
--   underscores ('_') or digits ([0-9]), not beginning with a digit;
--   
- a number [-]?(.[0-9]+ | [0-9]+(.[0-9]*)? );
--   
- any double-quoted string ("...") possibly containing escaped
--   quotes (\");
--   
- an HTML string (<...>).
--   
--   
--   (Note that the first restriction is referring to a byte-by-byte
--   comparison using octal values; when using UTF-8 this corresponds to
--   all characters c where ord c >= 128.)
--   
--   Due to these restrictions, you should only use text when you
--   are sure that the Text in question is static and quotes are
--   definitely needed/unneeded; it is better to use the Text
--   instance for PrintDot. For more information, see the
--   specification page: http://graphviz.org/doc/info/lang.html
module Data.GraphViz.Printing

-- | The document (text s) contains the literal string s.
--   The string shouldn't contain any newline ('n') characters. If
--   the string contains newline characters, the function string
--   should be used.
text :: Applicative m => Text -> m Doc

-- | The empty document is, indeed, empty. Although empty has no
--   content, it does have a 'height' of 1 and behaves exactly like
--   (text "") (and is therefore not a unit of
--   <$>).
empty :: Applicative m => m Doc

-- | The document (fill i x) renders document x. It then
--   appends spaces until the width is equal to i. If the
--   width of x is already larger, nothing is appended. This
--   combinator is quite useful in practice to output a list of bindings.
--   The following example demonstrates this.
--   
--   
--   types = [("empty","Doc")
--            ,("nest","Int -> Doc -> Doc")
--            ,("linebreak","Doc")]
--   
--   ptype (name,tp)
--   = fill 6 (text name) <+> text "::" <+> text tp
--   
--   test = text "let" <+> align (vcat (map ptype types))
--   
--   
--   Which is laid out as:
--   
--   
--   let empty  :: Doc
--       nest   :: Int -> Doc -> Doc
--       linebreak :: Doc
--   
--   
fill :: Functor m => Int -> m Doc -> m Doc

-- | The document (char c) contains the literal character
--   c. The character shouldn't be a newline ('n'), the
--   function line should be used for line breaks.
char :: Applicative m => Char -> m Doc

-- | Document (parens x) encloses document x in
--   parenthesis, "(" and ")".
parens :: Functor m => m Doc -> m Doc

-- | The document (list xs) comma separates the documents
--   xs and encloses them in square brackets. The documents are
--   rendered horizontally if that fits the page. Otherwise they are
--   aligned vertically. All comma separators are put in front of the
--   elements.
list :: Functor m => m [Doc] -> m Doc

-- | The group combinator is used to specify alternative layouts.
--   The document (group x) undoes all line breaks in document
--   x. The resulting line is added to the current line if that
--   fits the page. Otherwise, the document x is rendered without
--   any changes.
group :: Functor m => m Doc -> m Doc

-- | The document (x <+> y) concatenates document x
--   and y with a space in between. (infixr 6)
(<+>) :: Applicative m => m Doc -> m Doc -> m Doc
infixr 6 <+>

-- | The document (x </> y) concatenates document x
--   and y with a softline in between. This effectively
--   puts x and y either next to each other (with a
--   space in between) or underneath each other. (infixr 5)
(</>) :: Applicative m => m Doc -> m Doc -> m Doc
infixr 5 </>

-- | The document (int i) shows the literal integer i
--   using text.
int :: Applicative m => Int -> m Doc

-- | The document (integer i) shows the literal integer i
--   using text.
integer :: Applicative m => Integer -> m Doc

-- | The document (indent i x) indents document x with
--   i spaces.
--   
--   
--   test = indent 4 (fillSep (map text
--           (words "the indent combinator indents these words !")))
--   
--   
--   Which lays out with a page width of 20 as:
--   
--   
--   the indent
--   combinator
--   indents these
--   words !
--   
--   
indent :: Functor m => Int -> m Doc -> m Doc

-- | The abstract data type Doc represents pretty documents.
--   
--   Doc is an instance of the Show class. (show
--   doc) pretty prints document doc with a page width of 100
--   characters and a ribbon width of 40 characters.
--   
--   
--   show (text "hello" <$> text "world")
--   
--   
--   Which would return the string "hello\nworld", i.e.
--   
--   
--   hello
--   world
--   
--   
data Doc

-- | The document semi contains a semi colon, ";".
semi :: Applicative m => m Doc

-- | The document comma contains a comma, ",".
comma :: Applicative m => m Doc

-- | The document colon contains a colon, ":".
colon :: Applicative m => m Doc

-- | The document space contains a single space, " ".
--   
--   
--   x <+> y = x `beside` space `beside` y
--   
space :: Applicative m => m Doc

-- | The document equals contains an equal sign, "=".
equals :: Applicative m => m Doc

-- | The document lparen contains a left parenthesis, "(".
lparen :: Applicative m => m Doc

-- | The document rparen contains a right parenthesis, ")".
rparen :: Applicative m => m Doc

-- | The document lbrace contains a left brace, "{".
lbrace :: Applicative m => m Doc

-- | The document rbrace contains a right brace, "}".
rbrace :: Applicative m => m Doc

-- | The document (float f) shows the literal float f
--   using text.
float :: Applicative m => Float -> m Doc

-- | The document (double d) shows the literal double d
--   using text.
double :: Applicative m => Double -> m Doc

-- | The document (rational r) shows the literal rational
--   r using text.
rational :: Applicative m => Rational -> m Doc

-- | Document (brackets x) encloses document x in square
--   brackets, "[" and "]".
brackets :: Functor m => m Doc -> m Doc

-- | Document (braces x) encloses document x in braces,
--   "{" and "}".
braces :: Functor m => m Doc -> m Doc

-- | The document (hcat xs) concatenates all documents xs
--   horizontally with (<>).
hcat :: Functor m => m [Doc] -> m Doc

-- | The document (hsep xs) concatenates all documents xs
--   horizontally with (<+>).
hsep :: Functor m => m [Doc] -> m Doc

-- | The document (vcat xs) concatenates all documents xs
--   vertically with (<$$>). If a group undoes the
--   line breaks inserted by vcat, all documents are directly
--   concatenated.
vcat :: Functor m => m [Doc] -> m Doc

-- | The document (nest i x) renders document x with the
--   current indentation level increased by i (See also
--   hang, align and indent).
--   
--   
--   nest 2 (text "hello" <$> text "world") <$> text "!"
--   
--   
--   outputs as:
--   
--   
--   hello
--     world
--   !
--   
--   
nest :: Functor m => Int -> m Doc -> m Doc

-- | The hang combinator implements hanging indentation. The document
--   (hang i x) renders document x with a nesting level
--   set to the current column plus i. The following example uses
--   hanging indentation for some text:
--   
--   
--   test = hang 4 (fillSep (map text
--           (words "the hang combinator indents these words !")))
--   
--   
--   Which lays out on a page with a width of 20 characters as:
--   
--   
--   the hang combinator
--       indents these
--       words !
--   
--   
--   
--   The hang combinator is implemented as:
--   
--   
--   hang i x = align (nest i x)
--   
hang :: Functor m => Int -> m Doc -> m Doc

-- | (punctuate p xs) concatenates all documents in xs
--   with document p except for the last document.
--   
--   
--   someText = map text ["words","in","a","tuple"]
--   test = parens (align (cat (punctuate comma someText)))
--   
--   
--   This is laid out on a page width of 20 as:
--   
--   
--   (words,in,a,tuple)
--   
--   
--   
--   But when the page width is 15, it is laid out as:
--   
--   
--   (words,
--    in,
--    a,
--    tuple)
--   
--   
--   
--   (If you want put the commas in front of their elements instead of at
--   the end, you should use tupled or, in general,
--   encloseSep.)
punctuate :: Applicative m => m Doc -> m [Doc] -> m [Doc]

-- | The document (sep xs) concatenates all documents xs
--   either horizontally with (<+>), if it fits the page, or
--   vertically with (<$>).
--   
--   
--   sep xs = group (vsep xs)
--   
sep :: Functor m => m [Doc] -> m Doc

-- | The document (cat xs) concatenates all documents xs
--   either horizontally with (<>), if it fits the page, or
--   vertically with (<$$>).
--   
--   
--   cat xs = group (vcat xs)
--   
cat :: Functor m => m [Doc] -> m Doc

-- | The document (x <++> y) concatenates document
--   x and y with a spacebreak in between. (infixr
--   6)
(<++>) :: Applicative m => m Doc -> m Doc -> m Doc
infixr 6 <++>

-- | The document (tupled xs) comma separates the documents
--   xs and encloses them in parenthesis. The documents are
--   rendered horizontally if that fits the page. Otherwise they are
--   aligned vertically. All comma separators are put in front of the
--   elements.
tupled :: Functor m => m [Doc] -> m Doc

-- | The document (semiBraces xs) separates the documents
--   xs with semi colons and encloses them in braces. The
--   documents are rendered horizontally if that fits the page. Otherwise
--   they are aligned vertically. All semi colons are put in front of the
--   elements.
semiBraces :: Functor m => m [Doc] -> m Doc

-- | The document (encloseSep l r sep xs) concatenates the
--   documents xs separated by sep and encloses the
--   resulting document by l and r. The documents are
--   rendered horizontally if that fits the page. Otherwise they are
--   aligned vertically. All separators are put in front of the elements.
--   For example, the combinator list can be defined with
--   encloseSep:
--   
--   
--   list xs = encloseSep lbracket rbracket comma xs
--   test = text "list" <+> (list (map int [10,200,3000]))
--   
--   
--   Which is laid out with a page width of 20 as:
--   
--   
--   list [10,200,3000]
--   
--   
--   
--   But when the page width is 15, it is laid out as:
--   
--   
--   list [10
--        ,200
--        ,3000]
--   
--   
encloseSep :: Applicative m => m Doc -> m Doc -> m Doc -> m [Doc] -> m Doc

-- | The document (fillSep xs) concatenates documents xs
--   horizontally with (<+>) as long as its fits the page,
--   then inserts a line and continues doing that for all
--   documents in xs.
--   
--   
--   fillSep xs = foldr (</>) empty xs
--   
fillSep :: Functor m => m [Doc] -> m Doc

-- | The document (vsep xs) concatenates all documents xs
--   vertically with (<$>). If a group undoes the
--   line breaks inserted by vsep, all documents are separated
--   with a space.
--   
--   
--   someText = map text (words ("text to lay out"))
--   
--   test = text "some" <+> vsep someText
--   
--   
--   This is laid out as:
--   
--   
--   some text
--   to
--   lay
--   out
--   
--   
--   
--   The align combinator can be used to align the documents under
--   their first element
--   
--   
--   test = text "some" <+> align (vsep someText)
--   
--   
--   Which is printed as:
--   
--   
--   some text
--        to
--        lay
--        out
--   
--   
vsep :: Functor m => m [Doc] -> m Doc

-- | The document (fillCat xs) concatenates documents xs
--   horizontally with (<>) as long as its fits the page,
--   then inserts a linebreak and continues doing that for all
--   documents in xs.
--   
--   
--   fillCat xs = foldr (<//>) empty xs
--   
fillCat :: Functor m => m [Doc] -> m Doc

-- | The document (x <//> y) concatenates document
--   x and y with a softbreak in between. This
--   effectively puts x and y either right next to each
--   other or underneath each other. (infixr 5)
(<//>) :: Applicative m => m Doc -> m Doc -> m Doc
infixr 5 <//>

-- | The document (x <$$> y) concatenates document
--   x and y with a linebreak in between. (infixr
--   5)
(<$$>) :: Applicative m => m Doc -> m Doc -> m Doc
infixr 5 <$$>

-- | The document softline behaves like space if the
--   resulting output fits the page, otherwise it behaves like line.
softline :: Applicative m => m Doc

-- | The document softbreak behaves like empty if the
--   resulting output fits the page, otherwise it behaves like line.
softbreak :: Applicative m => m Doc

-- | The document spacebreak behaves like space when
--   rendered normally but like empty when using
--   renderCompact or renderOneLine.
spacebreak :: Applicative m => m Doc

-- | Document (squotes x) encloses document x with single
--   quotes "'".
squotes :: Functor m => m Doc -> m Doc

-- | Document (dquotes x) encloses document x with double
--   quotes '"'.
dquotes :: Functor m => m Doc -> m Doc

-- | Document (angles x) encloses document x in angles,
--   "<" and ">".
angles :: Functor m => m Doc -> m Doc

-- | The document (enclose l r x) encloses document x
--   between documents l and r using
--   beside.
--   
--   
--   enclose l r x = l `beside` x `beside` r
--   
enclose :: Applicative m => m Doc -> m Doc -> m Doc -> m Doc

-- | The document langle contains a left angle, "<".
langle :: Applicative m => m Doc

-- | The document rangle contains a right angle, ">".
rangle :: Applicative m => m Doc

-- | The document lbracket contains a left square bracket, "[".
lbracket :: Applicative m => m Doc

-- | The document rbracket contains a right square bracket, "]".
rbracket :: Applicative m => m Doc

-- | The document squote contains a single quote, "'".
squote :: Applicative m => m Doc

-- | The document dquote contains a double quote, '"'.
dquote :: Applicative m => m Doc

-- | The document dot contains a single dot, ".".
dot :: Applicative m => m Doc

-- | The document backslash contains a back slash, "\".
backslash :: Applicative m => m Doc
stringStrict :: Monad m => Text -> m Doc

-- | The document (fillBreak i x) first renders document
--   x. It then appends spaces until the width is equal
--   to i. If the width of x is already larger than
--   i, the nesting level is increased by i and a
--   line is appended. When we redefine ptype in the
--   previous example to use fillBreak, we get a useful variation
--   of the previous output:
--   
--   
--   ptype (name,tp)
--   = fillBreak 6 (text name) <+> text "::" <+> text tp
--   
--   
--   The output will now be:
--   
--   
--   let empty  :: Doc
--       nest   :: Int -> Doc -> Doc
--       linebreak
--              :: Doc
--   
--   
fillBreak :: Functor m => Int -> m Doc -> m Doc

-- | The document (align x) renders document x with the
--   nesting level set to the current column. It is used for example to
--   implement hang.
--   
--   As an example, we will put a document right above another one,
--   regardless of the current nesting level:
--   
--   
--   x $$ y = align (x <$> y)
--   
--   
--   
--   test = text "hi" <+> (text "nice" $$ text "world")
--   
--   
--   which will be laid out as:
--   
--   
--   hi nice
--      world
--   
--   
align :: Functor m => m Doc -> m Doc
textStrict :: Monad m => Text -> m Doc

-- | The line document advances to the next line and indents to
--   the current nesting level. Document line behaves like
--   (text " ") if the line break is undone by group or if
--   rendered with renderOneLine.
line :: Applicative m => m Doc

-- | The linebreak document advances to the next line and indents
--   to the current nesting level. Document linebreak behaves like
--   empty if the line break is undone by group.
linebreak :: Applicative m => m Doc

-- | The document (x beside y) concatenates document
--   x and document y. It is an associative operation
--   having empty as a left and right unit. (infixr 6)
beside :: Applicative m => m Doc -> m Doc -> m Doc
infixr 6 `beside`

-- | Specifies how to create the document based upon which column it is in.
column :: Functor m => m (Int -> Doc) -> m Doc

-- | Specifies how to nest the document based upon which column it is being
--   nested in.
nesting :: Functor m => m (Int -> Doc) -> m Doc

-- | (renderOneLine x) renders document x without adding
--   any indentation or newlines.
renderOneLine :: Doc -> SimpleDoc

-- | (displayB simpleDoc) takes the output simpleDoc from
--   a rendering function and transforms it to a Builder type (for
--   further manipulation before converting to a lazy Text).
displayB :: SimpleDoc -> Builder
displayTStrict :: SimpleDoc -> Text

-- | A monadic version of pretty; this is to allow you to use the
--   Pretty class without having to create extra instances.
--   Alternatively, you may wish to make a variant of Pretty using
--   the actual Monad to be used.
prettyM :: (Pretty a, Applicative m) => a -> m Doc
type DotCode = DotCodeM Doc

-- | A type alias to indicate what is being produced.
data DotCodeM a
runDotCode :: DotCode -> Doc

-- | Correctly render Graphviz output.
renderDot :: DotCode -> Text

-- | A class used to correctly print parts of the Graphviz Dot language.
--   Minimal implementation is unqtDot.
class PrintDot a

-- | The unquoted representation, for use when composing values to produce
--   a larger printing value.
unqtDot :: PrintDot a => a -> DotCode

-- | The actual quoted representation; this should be quoted if it contains
--   characters not permitted a plain ID String, a number or it is not an
--   HTML string. Defaults to unqtDot.
toDot :: PrintDot a => a -> DotCode

-- | The correct way of representing a list of this value when printed; not
--   all Dot values require this to be implemented. Defaults to
--   Haskell-like list representation.
unqtListToDot :: PrintDot a => [a] -> DotCode

-- | The quoted form of unqtListToDot; defaults to wrapping double
--   quotes around the result of unqtListToDot (since the default
--   implementation has characters that must be quoted).
listToDot :: PrintDot a => [a] -> DotCode

-- | For use with OverloadedStrings to avoid ambiguous type
--   variable errors.
unqtText :: Text -> DotCode

-- | For use with OverloadedStrings to avoid ambiguous type
--   variable errors.
dotText :: Text -> DotCode

-- | Convert to DotCode; note that this has no indentation, as we can only
--   have one of indentation and (possibly) infinite line lengths.
printIt :: PrintDot a => a -> Text
addQuotes :: Text -> DotCode -> DotCode

-- | Escape the specified chars as well as ".
unqtEscaped :: [Char] -> Text -> DotCode

-- | Escape the specified chars as well as " and then wrap the
--   result in quotes.
printEscaped :: [Char] -> Text -> DotCode
wrap :: DotCode -> DotCode -> DotCode -> DotCode
commaDel :: (PrintDot a, PrintDot b) => a -> b -> DotCode
printField :: PrintDot a => Text -> a -> DotCode
angled :: DotCode -> DotCode
fslash :: DotCode
printColorScheme :: Bool -> ColorScheme -> DotCode
instance GHC.Internal.Base.Applicative Data.GraphViz.Printing.DotCodeM
instance GHC.Internal.Base.Functor Data.GraphViz.Printing.DotCodeM
instance Data.GraphViz.Internal.State.GraphvizStateM Data.GraphViz.Printing.DotCodeM
instance GHC.Internal.Data.String.IsString Data.GraphViz.Printing.DotCode
instance GHC.Internal.Base.Monad Data.GraphViz.Printing.DotCodeM
instance Control.Monad.State.Class.MonadState Data.GraphViz.Internal.State.GraphvizState Data.GraphViz.Printing.DotCodeM
instance GHC.Internal.Base.Monoid Data.GraphViz.Printing.DotCode
instance Data.GraphViz.Printing.PrintDot GHC.Types.Bool
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.ColorScheme.BrewerName
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.ColorScheme.BrewerScheme
instance Data.GraphViz.Printing.PrintDot GHC.Types.Char
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.ColorScheme.ColorScheme
instance Data.GraphViz.Printing.PrintDot GHC.Types.Double
instance Data.GraphViz.Printing.PrintDot GHC.Types.Int
instance Data.GraphViz.Printing.PrintDot GHC.Num.Integer.Integer
instance Data.GraphViz.Printing.PrintDot a => Data.GraphViz.Printing.PrintDot [a]
instance Data.GraphViz.Printing.PrintDot Data.Text.Internal.Text
instance Data.GraphViz.Printing.PrintDot Data.Text.Internal.Lazy.Text
instance Data.GraphViz.Printing.PrintDot GHC.Internal.Data.Version.Version
instance Data.GraphViz.Printing.PrintDot GHC.Internal.Word.Word16
instance Data.GraphViz.Printing.PrintDot GHC.Internal.Word.Word32
instance Data.GraphViz.Printing.PrintDot GHC.Internal.Word.Word64
instance Data.GraphViz.Printing.PrintDot GHC.Internal.Word.Word8
instance GHC.Internal.Base.Semigroup Data.GraphViz.Printing.DotCode
instance GHC.Internal.Show.Show Data.GraphViz.Printing.DotCode

-- | Graphviz's definition of X11 colors differs from the "normal" list
--   installed on many systems at
--   usrshareX11rgb.txt. For example,
--   Crimson is not a usual X11 color.
--   
--   Furthermore, all Gray* colors are duplicated with
--   Grey* names. To simplify this, these duplicates have been
--   removed but all X11Colors with "Gray" (whether
--   they have the duplicate spelling or not) in their name are also
--   parseable as if they were spelt with "grey".
--   
--   The complete list of X11 colors can be found at
--   http://www.graphviz.org/doc/info/colors.html#x11.
module Data.GraphViz.Attributes.Colors.X11

-- | The X11 colors that Graphviz uses. Note that these are slightly
--   different from the "normal" X11 colors used (e.g. the inclusion of
--   Crimson). Graphviz's list of colors also duplicated almost
--   all Gray colors with Grey ones; parsing of an
--   X11Color which is specified using "grey" will succeed, even for
--   those that don't have the duplicate spelling (e.g.
--   DarkSlateGray1).
data X11Color
AliceBlue :: X11Color
AntiqueWhite :: X11Color
AntiqueWhite1 :: X11Color
AntiqueWhite2 :: X11Color
AntiqueWhite3 :: X11Color
AntiqueWhite4 :: X11Color
Aquamarine :: X11Color
Aquamarine1 :: X11Color
Aquamarine2 :: X11Color
Aquamarine3 :: X11Color
Aquamarine4 :: X11Color
Azure :: X11Color
Azure1 :: X11Color
Azure2 :: X11Color
Azure3 :: X11Color
Azure4 :: X11Color
Beige :: X11Color
Bisque :: X11Color
Bisque1 :: X11Color
Bisque2 :: X11Color
Bisque3 :: X11Color
Bisque4 :: X11Color
Black :: X11Color
BlanchedAlmond :: X11Color
Blue :: X11Color
Blue1 :: X11Color
Blue2 :: X11Color
Blue3 :: X11Color
Blue4 :: X11Color
BlueViolet :: X11Color
Brown :: X11Color
Brown1 :: X11Color
Brown2 :: X11Color
Brown3 :: X11Color
Brown4 :: X11Color
Burlywood :: X11Color
Burlywood1 :: X11Color
Burlywood2 :: X11Color
Burlywood3 :: X11Color
Burlywood4 :: X11Color
CadetBlue :: X11Color
CadetBlue1 :: X11Color
CadetBlue2 :: X11Color
CadetBlue3 :: X11Color
CadetBlue4 :: X11Color
Chartreuse :: X11Color
Chartreuse1 :: X11Color
Chartreuse2 :: X11Color
Chartreuse3 :: X11Color
Chartreuse4 :: X11Color
Chocolate :: X11Color
Chocolate1 :: X11Color
Chocolate2 :: X11Color
Chocolate3 :: X11Color
Chocolate4 :: X11Color
Coral :: X11Color
Coral1 :: X11Color
Coral2 :: X11Color
Coral3 :: X11Color
Coral4 :: X11Color
CornFlowerBlue :: X11Color
CornSilk :: X11Color
CornSilk1 :: X11Color
CornSilk2 :: X11Color
CornSilk3 :: X11Color
CornSilk4 :: X11Color
Crimson :: X11Color
Cyan :: X11Color
Cyan1 :: X11Color
Cyan2 :: X11Color
Cyan3 :: X11Color
Cyan4 :: X11Color
DarkGoldenrod :: X11Color
DarkGoldenrod1 :: X11Color
DarkGoldenrod2 :: X11Color
DarkGoldenrod3 :: X11Color
DarkGoldenrod4 :: X11Color
DarkGreen :: X11Color
Darkkhaki :: X11Color
DarkOliveGreen :: X11Color
DarkOliveGreen1 :: X11Color
DarkOliveGreen2 :: X11Color
DarkOliveGreen3 :: X11Color
DarkOliveGreen4 :: X11Color
DarkOrange :: X11Color
DarkOrange1 :: X11Color
DarkOrange2 :: X11Color
DarkOrange3 :: X11Color
DarkOrange4 :: X11Color
DarkOrchid :: X11Color
DarkOrchid1 :: X11Color
DarkOrchid2 :: X11Color
DarkOrchid3 :: X11Color
DarkOrchid4 :: X11Color
DarkSalmon :: X11Color
DarkSeaGreen :: X11Color
DarkSeaGreen1 :: X11Color
DarkSeaGreen2 :: X11Color
DarkSeaGreen3 :: X11Color
DarkSeaGreen4 :: X11Color
DarkSlateBlue :: X11Color
DarkSlateGray :: X11Color
DarkSlateGray1 :: X11Color
DarkSlateGray2 :: X11Color
DarkSlateGray3 :: X11Color
DarkSlateGray4 :: X11Color
DarkTurquoise :: X11Color
DarkViolet :: X11Color
DeepPink :: X11Color
DeepPink1 :: X11Color
DeepPink2 :: X11Color
DeepPink3 :: X11Color
DeepPink4 :: X11Color
DeepSkyBlue :: X11Color
DeepSkyBlue1 :: X11Color
DeepSkyBlue2 :: X11Color
DeepSkyBlue3 :: X11Color
DeepSkyBlue4 :: X11Color
DimGray :: X11Color
DodgerBlue :: X11Color
DodgerBlue1 :: X11Color
DodgerBlue2 :: X11Color
DodgerBlue3 :: X11Color
DodgerBlue4 :: X11Color
Firebrick :: X11Color
Firebrick1 :: X11Color
Firebrick2 :: X11Color
Firebrick3 :: X11Color
Firebrick4 :: X11Color
FloralWhite :: X11Color
ForestGreen :: X11Color
Gainsboro :: X11Color
GhostWhite :: X11Color
Gold :: X11Color
Gold1 :: X11Color
Gold2 :: X11Color
Gold3 :: X11Color
Gold4 :: X11Color
Goldenrod :: X11Color
Goldenrod1 :: X11Color
Goldenrod2 :: X11Color
Goldenrod3 :: X11Color
Goldenrod4 :: X11Color
Gray :: X11Color
Gray0 :: X11Color
Gray1 :: X11Color
Gray2 :: X11Color
Gray3 :: X11Color
Gray4 :: X11Color
Gray5 :: X11Color
Gray6 :: X11Color
Gray7 :: X11Color
Gray8 :: X11Color
Gray9 :: X11Color
Gray10 :: X11Color
Gray11 :: X11Color
Gray12 :: X11Color
Gray13 :: X11Color
Gray14 :: X11Color
Gray15 :: X11Color
Gray16 :: X11Color
Gray17 :: X11Color
Gray18 :: X11Color
Gray19 :: X11Color
Gray20 :: X11Color
Gray21 :: X11Color
Gray22 :: X11Color
Gray23 :: X11Color
Gray24 :: X11Color
Gray25 :: X11Color
Gray26 :: X11Color
Gray27 :: X11Color
Gray28 :: X11Color
Gray29 :: X11Color
Gray30 :: X11Color
Gray31 :: X11Color
Gray32 :: X11Color
Gray33 :: X11Color
Gray34 :: X11Color
Gray35 :: X11Color
Gray36 :: X11Color
Gray37 :: X11Color
Gray38 :: X11Color
Gray39 :: X11Color
Gray40 :: X11Color
Gray41 :: X11Color
Gray42 :: X11Color
Gray43 :: X11Color
Gray44 :: X11Color
Gray45 :: X11Color
Gray46 :: X11Color
Gray47 :: X11Color
Gray48 :: X11Color
Gray49 :: X11Color
Gray50 :: X11Color
Gray51 :: X11Color
Gray52 :: X11Color
Gray53 :: X11Color
Gray54 :: X11Color
Gray55 :: X11Color
Gray56 :: X11Color
Gray57 :: X11Color
Gray58 :: X11Color
Gray59 :: X11Color
Gray60 :: X11Color
Gray61 :: X11Color
Gray62 :: X11Color
Gray63 :: X11Color
Gray64 :: X11Color
Gray65 :: X11Color
Gray66 :: X11Color
Gray67 :: X11Color
Gray68 :: X11Color
Gray69 :: X11Color
Gray70 :: X11Color
Gray71 :: X11Color
Gray72 :: X11Color
Gray73 :: X11Color
Gray74 :: X11Color
Gray75 :: X11Color
Gray76 :: X11Color
Gray77 :: X11Color
Gray78 :: X11Color
Gray79 :: X11Color
Gray80 :: X11Color
Gray81 :: X11Color
Gray82 :: X11Color
Gray83 :: X11Color
Gray84 :: X11Color
Gray85 :: X11Color
Gray86 :: X11Color
Gray87 :: X11Color
Gray88 :: X11Color
Gray89 :: X11Color
Gray90 :: X11Color
Gray91 :: X11Color
Gray92 :: X11Color
Gray93 :: X11Color
Gray94 :: X11Color
Gray95 :: X11Color
Gray96 :: X11Color
Gray97 :: X11Color
Gray98 :: X11Color
Gray99 :: X11Color
Gray100 :: X11Color
Green :: X11Color
Green1 :: X11Color
Green2 :: X11Color
Green3 :: X11Color
Green4 :: X11Color
GreenYellow :: X11Color
HoneyDew :: X11Color
HoneyDew1 :: X11Color
HoneyDew2 :: X11Color
HoneyDew3 :: X11Color
HoneyDew4 :: X11Color
HotPink :: X11Color
HotPink1 :: X11Color
HotPink2 :: X11Color
HotPink3 :: X11Color
HotPink4 :: X11Color
IndianRed :: X11Color
IndianRed1 :: X11Color
IndianRed2 :: X11Color
IndianRed3 :: X11Color
IndianRed4 :: X11Color
Indigo :: X11Color
Ivory :: X11Color
Ivory1 :: X11Color
Ivory2 :: X11Color
Ivory3 :: X11Color
Ivory4 :: X11Color
Khaki :: X11Color
Khaki1 :: X11Color
Khaki2 :: X11Color
Khaki3 :: X11Color
Khaki4 :: X11Color
Lavender :: X11Color
LavenderBlush :: X11Color
LavenderBlush1 :: X11Color
LavenderBlush2 :: X11Color
LavenderBlush3 :: X11Color
LavenderBlush4 :: X11Color
LawnGreen :: X11Color
LemonChiffon :: X11Color
LemonChiffon1 :: X11Color
LemonChiffon2 :: X11Color
LemonChiffon3 :: X11Color
LemonChiffon4 :: X11Color
LightBlue :: X11Color
LightBlue1 :: X11Color
LightBlue2 :: X11Color
LightBlue3 :: X11Color
LightBlue4 :: X11Color
LightCoral :: X11Color
LightCyan :: X11Color
LightCyan1 :: X11Color
LightCyan2 :: X11Color
LightCyan3 :: X11Color
LightCyan4 :: X11Color
LightGoldenrod :: X11Color
LightGoldenrod1 :: X11Color
LightGoldenrod2 :: X11Color
LightGoldenrod3 :: X11Color
LightGoldenrod4 :: X11Color
LightGoldenrodYellow :: X11Color
LightGray :: X11Color
LightPink :: X11Color
LightPink1 :: X11Color
LightPink2 :: X11Color
LightPink3 :: X11Color
LightPink4 :: X11Color
LightSalmon :: X11Color
LightSalmon1 :: X11Color
LightSalmon2 :: X11Color
LightSalmon3 :: X11Color
LightSalmon4 :: X11Color
LightSeaGreen :: X11Color
LightSkyBlue :: X11Color
LightSkyBlue1 :: X11Color
LightSkyBlue2 :: X11Color
LightSkyBlue3 :: X11Color
LightSkyBlue4 :: X11Color
LightSlateBlue :: X11Color
LightSlateGray :: X11Color
LightSteelBlue :: X11Color
LightSteelBlue1 :: X11Color
LightSteelBlue2 :: X11Color
LightSteelBlue3 :: X11Color
LightSteelBlue4 :: X11Color
LightYellow :: X11Color
LightYellow1 :: X11Color
LightYellow2 :: X11Color
LightYellow3 :: X11Color
LightYellow4 :: X11Color
LimeGreen :: X11Color
Linen :: X11Color
Magenta :: X11Color
Magenta1 :: X11Color
Magenta2 :: X11Color
Magenta3 :: X11Color
Magenta4 :: X11Color
Maroon :: X11Color
Maroon1 :: X11Color
Maroon2 :: X11Color
Maroon3 :: X11Color
Maroon4 :: X11Color
MediumAquamarine :: X11Color
MediumBlue :: X11Color
MediumOrchid :: X11Color
MediumOrchid1 :: X11Color
MediumOrchid2 :: X11Color
MediumOrchid3 :: X11Color
MediumOrchid4 :: X11Color
MediumPurple :: X11Color
MediumPurple1 :: X11Color
MediumPurple2 :: X11Color
MediumPurple3 :: X11Color
MediumPurple4 :: X11Color
MediumSeaGreen :: X11Color
MediumSlateBlue :: X11Color
MediumSpringGreen :: X11Color
MediumTurquoise :: X11Color
MediumVioletRed :: X11Color
MidnightBlue :: X11Color
MintCream :: X11Color
MistyRose :: X11Color
MistyRose1 :: X11Color
MistyRose2 :: X11Color
MistyRose3 :: X11Color
MistyRose4 :: X11Color
Moccasin :: X11Color
NavajoWhite :: X11Color
NavajoWhite1 :: X11Color
NavajoWhite2 :: X11Color
NavajoWhite3 :: X11Color
NavajoWhite4 :: X11Color
Navy :: X11Color
NavyBlue :: X11Color
OldLace :: X11Color
OliveDrab :: X11Color
OliveDrab1 :: X11Color
OliveDrab2 :: X11Color
OliveDrab3 :: X11Color
OliveDrab4 :: X11Color
Orange :: X11Color
Orange1 :: X11Color
Orange2 :: X11Color
Orange3 :: X11Color
Orange4 :: X11Color
OrangeRed :: X11Color
OrangeRed1 :: X11Color
OrangeRed2 :: X11Color
OrangeRed3 :: X11Color
OrangeRed4 :: X11Color
Orchid :: X11Color
Orchid1 :: X11Color
Orchid2 :: X11Color
Orchid3 :: X11Color
Orchid4 :: X11Color
PaleGoldenrod :: X11Color
PaleGreen :: X11Color
PaleGreen1 :: X11Color
PaleGreen2 :: X11Color
PaleGreen3 :: X11Color
PaleGreen4 :: X11Color
PaleTurquoise :: X11Color
PaleTurquoise1 :: X11Color
PaleTurquoise2 :: X11Color
PaleTurquoise3 :: X11Color
PaleTurquoise4 :: X11Color
PaleVioletRed :: X11Color
PaleVioletRed1 :: X11Color
PaleVioletRed2 :: X11Color
PaleVioletRed3 :: X11Color
PaleVioletRed4 :: X11Color
PapayaWhip :: X11Color
PeachPuff :: X11Color
PeachPuff1 :: X11Color
PeachPuff2 :: X11Color
PeachPuff3 :: X11Color
PeachPuff4 :: X11Color
Peru :: X11Color
Pink :: X11Color
Pink1 :: X11Color
Pink2 :: X11Color
Pink3 :: X11Color
Pink4 :: X11Color
Plum :: X11Color
Plum1 :: X11Color
Plum2 :: X11Color
Plum3 :: X11Color
Plum4 :: X11Color
PowderBlue :: X11Color
Purple :: X11Color
Purple1 :: X11Color
Purple2 :: X11Color
Purple3 :: X11Color
Purple4 :: X11Color
Red :: X11Color
Red1 :: X11Color
Red2 :: X11Color
Red3 :: X11Color
Red4 :: X11Color
RosyBrown :: X11Color
RosyBrown1 :: X11Color
RosyBrown2 :: X11Color
RosyBrown3 :: X11Color
RosyBrown4 :: X11Color
RoyalBlue :: X11Color
RoyalBlue1 :: X11Color
RoyalBlue2 :: X11Color
RoyalBlue3 :: X11Color
RoyalBlue4 :: X11Color
SaddleBrown :: X11Color
Salmon :: X11Color
Salmon1 :: X11Color
Salmon2 :: X11Color
Salmon3 :: X11Color
Salmon4 :: X11Color
SandyBrown :: X11Color
SeaGreen :: X11Color
SeaGreen1 :: X11Color
SeaGreen2 :: X11Color
SeaGreen3 :: X11Color
SeaGreen4 :: X11Color
SeaShell :: X11Color
SeaShell1 :: X11Color
SeaShell2 :: X11Color
SeaShell3 :: X11Color
SeaShell4 :: X11Color
Sienna :: X11Color
Sienna1 :: X11Color
Sienna2 :: X11Color
Sienna3 :: X11Color
Sienna4 :: X11Color
SkyBlue :: X11Color
SkyBlue1 :: X11Color
SkyBlue2 :: X11Color
SkyBlue3 :: X11Color
SkyBlue4 :: X11Color
SlateBlue :: X11Color
SlateBlue1 :: X11Color
SlateBlue2 :: X11Color
SlateBlue3 :: X11Color
SlateBlue4 :: X11Color
SlateGray :: X11Color
SlateGray1 :: X11Color
SlateGray2 :: X11Color
SlateGray3 :: X11Color
SlateGray4 :: X11Color
Snow :: X11Color
Snow1 :: X11Color
Snow2 :: X11Color
Snow3 :: X11Color
Snow4 :: X11Color
SpringGreen :: X11Color
SpringGreen1 :: X11Color
SpringGreen2 :: X11Color
SpringGreen3 :: X11Color
SpringGreen4 :: X11Color
SteelBlue :: X11Color
SteelBlue1 :: X11Color
SteelBlue2 :: X11Color
SteelBlue3 :: X11Color
SteelBlue4 :: X11Color
Tan :: X11Color
Tan1 :: X11Color
Tan2 :: X11Color
Tan3 :: X11Color
Tan4 :: X11Color
Thistle :: X11Color
Thistle1 :: X11Color
Thistle2 :: X11Color
Thistle3 :: X11Color
Thistle4 :: X11Color
Tomato :: X11Color
Tomato1 :: X11Color
Tomato2 :: X11Color
Tomato3 :: X11Color
Tomato4 :: X11Color

-- | Equivalent to setting Style [SItem Invisible []].
Transparent :: X11Color
Turquoise :: X11Color
Turquoise1 :: X11Color
Turquoise2 :: X11Color
Turquoise3 :: X11Color
Turquoise4 :: X11Color
Violet :: X11Color
VioletRed :: X11Color
VioletRed1 :: X11Color
VioletRed2 :: X11Color
VioletRed3 :: X11Color
VioletRed4 :: X11Color
Wheat :: X11Color
Wheat1 :: X11Color
Wheat2 :: X11Color
Wheat3 :: X11Color
Wheat4 :: X11Color
White :: X11Color
WhiteSmoke :: X11Color
Yellow :: X11Color
Yellow1 :: X11Color
Yellow2 :: X11Color
Yellow3 :: X11Color
Yellow4 :: X11Color
YellowGreen :: X11Color

-- | Convert an X11Color to its equivalent Colour value.
--   Note that it uses AlphaColour because of Transparent;
--   all other X11Color values are completely opaque.
x11Colour :: X11Color -> AlphaColour Double
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.Colors.X11.X11Color
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.Colors.X11.X11Color
instance GHC.Classes.Eq Data.GraphViz.Attributes.Colors.X11.X11Color
instance GHC.Classes.Ord Data.GraphViz.Attributes.Colors.X11.X11Color
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.Colors.X11.X11Color
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.Colors.X11.X11Color
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.Colors.X11.X11Color
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.Colors.X11.X11Color

-- | Graphviz comes with an SVG color scheme:
--   http://www.graphviz.org/doc/info/colors.html#svg
--   
--   However, in general use you probably want to use
--   Data.GraphViz.Attributes.Colors.X11 instead, unless you are
--   only generating SVG images.
module Data.GraphViz.Attributes.Colors.SVG

-- | The SVG colors that Graphviz uses. Graphviz's list of colors also
--   duplicated all *Gray* colors with *Grey* ones;
--   parsing of an SVGColor which is specified using "grey" will
--   succeed.
data SVGColor
AliceBlue :: SVGColor
AntiqueWhite :: SVGColor
Aqua :: SVGColor
Aquamarine :: SVGColor
Azure :: SVGColor
Beige :: SVGColor
Bisque :: SVGColor
Black :: SVGColor
BlanchedAlmond :: SVGColor
Blue :: SVGColor
BlueViolet :: SVGColor
Brown :: SVGColor
Burlywood :: SVGColor
CadetBlue :: SVGColor
Chartreuse :: SVGColor
Chocolate :: SVGColor
Coral :: SVGColor
CornflowerBlue :: SVGColor
Cornsilk :: SVGColor
Crimson :: SVGColor
Cyan :: SVGColor
DarkBlue :: SVGColor
DarkCyan :: SVGColor
DarkGoldenrod :: SVGColor
DarkGray :: SVGColor
DarkGreen :: SVGColor
DarkKhaki :: SVGColor
DarkMagenta :: SVGColor
DarkOliveGreen :: SVGColor
DarkOrange :: SVGColor
DarkOrchid :: SVGColor
DarkRed :: SVGColor
DarkSalmon :: SVGColor
DarkSeaGreen :: SVGColor
DarkSlateBlue :: SVGColor
DarkSlateGray :: SVGColor
DarkTurquoise :: SVGColor
DarkViolet :: SVGColor
DeepPink :: SVGColor
DeepSkyBlue :: SVGColor
DimGray :: SVGColor
DodgerBlue :: SVGColor
Firebrick :: SVGColor
FloralWhite :: SVGColor
ForestGreen :: SVGColor
Fuchsia :: SVGColor
Gainsboro :: SVGColor
GhostWhite :: SVGColor
Gold :: SVGColor
Goldenrod :: SVGColor
Gray :: SVGColor
Green :: SVGColor
GreenYellow :: SVGColor
Honeydew :: SVGColor
HotPink :: SVGColor
IndianRed :: SVGColor
Indigo :: SVGColor
Ivory :: SVGColor
Khaki :: SVGColor
Lavender :: SVGColor
LavenderBlush :: SVGColor
LawnGreen :: SVGColor
LemonChiffon :: SVGColor
LightBlue :: SVGColor
LightCoral :: SVGColor
LightCyan :: SVGColor
LightGoldenrodYellow :: SVGColor
LightGray :: SVGColor
LightGreen :: SVGColor
LightPink :: SVGColor
LightSalmon :: SVGColor
LightSeaGreen :: SVGColor
LightSkyBlue :: SVGColor
LightSlateGray :: SVGColor
LightSteelBlue :: SVGColor
LightYellow :: SVGColor
Lime :: SVGColor
LimeGreen :: SVGColor
Linen :: SVGColor
Magenta :: SVGColor
Maroon :: SVGColor
MediumAquamarine :: SVGColor
MediumBlue :: SVGColor
MediumOrchid :: SVGColor
MediumPurple :: SVGColor
MediumSeaGreen :: SVGColor
MediumSlateBlue :: SVGColor
MediumSpringGreen :: SVGColor
MediumTurquoise :: SVGColor
MediumVioletRed :: SVGColor
MidnightBlue :: SVGColor
MintCream :: SVGColor
MistyRose :: SVGColor
Moccasin :: SVGColor
NavajoWhite :: SVGColor
Navy :: SVGColor
OldLace :: SVGColor
Olive :: SVGColor
OliveDrab :: SVGColor
Orange :: SVGColor
OrangeRed :: SVGColor
Orchid :: SVGColor
PaleGoldenrod :: SVGColor
PaleGreen :: SVGColor
PaleTurquoise :: SVGColor
PaleVioletRed :: SVGColor
PapayaWhip :: SVGColor
PeachPuff :: SVGColor
Peru :: SVGColor
Pink :: SVGColor
Plum :: SVGColor
PowderBlue :: SVGColor
Purple :: SVGColor
Red :: SVGColor
RosyBrown :: SVGColor
RoyalBlue :: SVGColor
SaddleBrown :: SVGColor
Salmon :: SVGColor
SandyBrown :: SVGColor
SeaGreen :: SVGColor
SeaShell :: SVGColor
Sienna :: SVGColor
Silver :: SVGColor
SkyBlue :: SVGColor
SlateBlue :: SVGColor
SlateGray :: SVGColor
Snow :: SVGColor
SpringGreen :: SVGColor
SteelBlue :: SVGColor
Tan :: SVGColor
Teal :: SVGColor
Thistle :: SVGColor
Tomato :: SVGColor
Turquoise :: SVGColor
Violet :: SVGColor
Wheat :: SVGColor
White :: SVGColor
WhiteSmoke :: SVGColor
Yellow :: SVGColor
YellowGreen :: SVGColor

-- | Convert an SVGColor to its equivalent Colour value.
svgColour :: SVGColor -> Colour Double
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.Colors.SVG.SVGColor
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.Colors.SVG.SVGColor
instance GHC.Classes.Eq Data.GraphViz.Attributes.Colors.SVG.SVGColor
instance GHC.Classes.Ord Data.GraphViz.Attributes.Colors.SVG.SVGColor
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.Colors.SVG.SVGColor
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.Colors.SVG.SVGColor
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.Colors.SVG.SVGColor
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.Colors.SVG.SVGColor

-- | You almost definitely do not want to use this module. It is
--   only defined for completeness when parsing existing Dot code.
--   
--   Graphviz contains a list of colors known as the /Brewer color
--   schemes/.
--   
--   These colors are available under an Apache-style license:
--   http://www.graphviz.org/doc/info/colors.html#brewer_license. As
--   such, they are not recommended for general use, and have only been
--   included in this package for completeness.
--   
--   The complete list of Brewer colors can be found at
--   http://www.graphviz.org/doc/info/colors.html#brewer.
module Data.GraphViz.Attributes.Colors.Brewer

-- | Specify which colour palette and how many colours it has. Note the
--   allowed values for the different BrewerNames.
data BrewerScheme
BScheme :: BrewerName -> Word8 -> BrewerScheme

-- | All of these have a minimum level value of 3, with a maximum
--   of 9 unless otherwise specified.
data BrewerName

-- | Maximum of 8.
Accent :: BrewerName
Blues :: BrewerName

-- | Maximum of 11.
Brbg :: BrewerName
Bugn :: BrewerName
Bupu :: BrewerName

-- | Maximum of 8.
Dark2 :: BrewerName
Gnbu :: BrewerName
Greens :: BrewerName
Greys :: BrewerName
Oranges :: BrewerName
Orrd :: BrewerName

-- | Maximum of 12.
Paired :: BrewerName
Pastel1 :: BrewerName

-- | Maximum of 8.
Pastel2 :: BrewerName

-- | Maximum of 11.
Piyg :: BrewerName

-- | Maximum of 11.
Prgn :: BrewerName
Pubu :: BrewerName
Pubugn :: BrewerName

-- | Maximum of 11; note that the last two are listed after the
--   Purd values in the documentation.
Puor :: BrewerName
Purd :: BrewerName
Purples :: BrewerName

-- | Maximum of 11; note that the last two are listed first.
Rdbu :: BrewerName

-- | Maximum of 11; note that the last two are listed after the
--   Rdpu values in the documentation.
Rdgy :: BrewerName
Rdpu :: BrewerName

-- | Maximum of 11.
Rdylbu :: BrewerName

-- | Maximum of 11.
Rdylgn :: BrewerName
Reds :: BrewerName
Set1 :: BrewerName

-- | Maximum of 8.
Set2 :: BrewerName

-- | Maximum of 12.
Set3 :: BrewerName

-- | Maximum of 11.
Spectral :: BrewerName
Ylgn :: BrewerName
Ylgnbu :: BrewerName
Ylorbr :: BrewerName
Ylorrd :: BrewerName

-- | This value should be between 1 and the level of the
--   BrewerScheme being used.
data BrewerColor
BC :: BrewerScheme -> Word8 -> BrewerColor
instance GHC.Classes.Eq Data.GraphViz.Attributes.Colors.Brewer.BrewerColor
instance GHC.Classes.Ord Data.GraphViz.Attributes.Colors.Brewer.BrewerColor
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.Colors.Brewer.BrewerColor
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.Colors.Brewer.BrewerColor

-- | This module defines the various colors, etc. for Graphviz. For
--   information on colors in general, see:
--   http://graphviz.org/doc/info/attrs.html#k:color For named
--   colors, see: http://graphviz.org/doc/info/colors.html
--   
--   Note that the ColorBrewer Color Schemes (shortened to just "Brewer"
--   for the rest of this module) are covered by the following license
--   (also available in the LICENSE file of this library):
--   http://graphviz.org/doc/info/colors.html#brewer_license
module Data.GraphViz.Attributes.Colors

-- | This represents the color schemes that Graphviz accepts.
data ColorScheme
X11 :: ColorScheme
SVG :: ColorScheme
Brewer :: BrewerScheme -> ColorScheme

-- | Defining a color for use with Graphviz. Note that named colors have
--   been split up into X11Colors and those based upon the Brewer
--   color schemes.
data Color
RGB :: Word8 -> Word8 -> Word8 -> Color
[red] :: Color -> Word8
[green] :: Color -> Word8
[blue] :: Color -> Word8
RGBA :: Word8 -> Word8 -> Word8 -> Word8 -> Color
[red] :: Color -> Word8
[green] :: Color -> Word8
[blue] :: Color -> Word8
[alpha] :: Color -> Word8

-- | The hue, saturation and value values must all be
--   0 <= x <=1.
HSV :: Double -> Double -> Double -> Color
[hue] :: Color -> Double
[saturation] :: Color -> Double
[value] :: Color -> Double
X11Color :: X11Color -> Color
SVGColor :: SVGColor -> Color
BrewerColor :: BrewerColor -> Color

-- | The sum of the optional weightings must sum to at most
--   1.
type ColorList = [WeightedColor]

-- | A Color tagged with an optional weighting.
data WeightedColor
WC :: Color -> Maybe Double -> WeightedColor
[wColor] :: WeightedColor -> Color

-- | Must be in range 0 <= W <= 1.
[weighting] :: WeightedColor -> Maybe Double

-- | For colors without weightings.
toWC :: Color -> WeightedColor

-- | For a list of colors without weightings.
toColorList :: [Color] -> ColorList

-- | More easily convert named colors to an overall Color value.
class NamedColor nc
toColor :: NamedColor nc => nc -> Color
toWColor :: NamedColor nc => nc -> WeightedColor

-- | Attempt to convert a Color into a Colour value with an
--   alpha channel. The use of Maybe is because the RGB values of
--   the BrewerColors haven't been stored here (primarily for
--   licensing reasons).
toColour :: Color -> Maybe (AlphaColour Double)

-- | Convert a Colour value to an RGB Color.
fromColour :: Colour Double -> Color

-- | Convert an AlphaColour to an RGBA Color. The
--   exception to this is for any AlphaColour which has
--   alphaChannel ac == 0; these are converted to X11Color
--   Transparent (note that the Show instance for such
--   an AlphaColour is "transparent").
fromAColour :: AlphaColour Double -> Color
instance GHC.Classes.Eq Data.GraphViz.Attributes.Colors.Color
instance GHC.Classes.Eq Data.GraphViz.Attributes.Colors.WeightedColor
instance Data.GraphViz.Attributes.Colors.NamedColor Data.GraphViz.Attributes.Colors.Brewer.BrewerColor
instance Data.GraphViz.Attributes.Colors.NamedColor Data.GraphViz.Attributes.Colors.SVG.SVGColor
instance Data.GraphViz.Attributes.Colors.NamedColor Data.GraphViz.Attributes.Colors.X11.X11Color
instance GHC.Classes.Ord Data.GraphViz.Attributes.Colors.Color
instance GHC.Classes.Ord Data.GraphViz.Attributes.Colors.WeightedColor
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.Colors.Color
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.Colors.WeightedColor
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.Colors.Color
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.Colors.WeightedColor
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.Colors.Color
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.Colors.WeightedColor
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.Colors.Color
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.Colors.WeightedColor

-- | This module is written to be imported qualified. It defines the syntax
--   for HTML-like values for use in Graphviz. Please note that these
--   values are not really HTML, but the term "HTML" is used
--   throughout as it is less cumbersome than "HTML-like". To be able to
--   use this, the version of Graphviz must be at least 1.10. For more
--   information, please see:
--   http://graphviz.org/doc/info/shapes.html#html
--   
--   The actual definition of the syntax specifies that these types must be
--   valid XML syntax. As such, this assumed when printing and parsing,
--   though the correct escape/descaping for ", &,
--   < and > are automatically done when printing
--   and parsing.
--   
--   Differences from how Graphviz treats HTML-like values:
--   
--   
--   
- Graphviz only specifies the above-listed characters must be
--   escaped; however, internally it also escapes -, '
--   and multiple sequences of spaces. This library attempts to match this
--   behaviour. Please let me know if this behaviour (especially about
--   escaping multiple spaces) is unwanted.
--   
- When parsing escaped HTML characters, numeric escapes are
--   converted to the corresponding character as are the various characters
--   listed above; all other escaped characters (apart from those listed
--   above) are silently ignored and removed from the input (since
--   technically these must be valid XML, which doesn't recognise as
--   many named escape characters as does HTML).
--   
- All whitespace read in is kept (even if Graphviz would ignore
--   multiple whitespace characters); when printing them, however, they are
--   replaced with non-breaking spaces. As such, if multiple literal
--   whitespace characters are used in a sequence, then the result of
--   parsing and then printing some Dot code will not be the same as
--   the initial Dot code. Furthermore, all whitespace characters are
--   printed as spaces.
--   
- It is assumed that all parsed & values are the
--   beginning of an XML escape sequence (which must finish with a
--   ; character).
--   
- There should be no pre-escaped characters in values; when
--   printing, the & will get escaped without considering if
--   that is an escaped character.
--   
module Data.GraphViz.Attributes.HTML

-- | The overall type for HTML-like labels. Fundamentally, HTML-like values
--   in Graphviz are either textual (i.e. a single element with formatting)
--   or a table. Note that Label values can be nested via
--   LabelCell.
data Label
Text :: Text -> Label
Table :: Table -> Label

-- | Represents a textual component of an HTML-like label. It is assumed
--   that a Text list is non-empty. It is preferable to "group"
--   Str values together rather than have individual ones. Note that
--   when printing, the individual values are concatenated together without
--   spaces, and when parsing anything that isn't a tag is assumed to be a
--   Str: that is, something like "<BR/> <BR/>"
--   is parsed as:
--   
--   
--   [Newline [], Str " ", Newline []]
--   
type Text = [TextItem]

-- | Textual items in HTML-like labels.
data TextItem
Str :: Text -> TextItem

-- | Only accepts an optional Align Attribute; defined this
--   way for ease of printing/parsing.
Newline :: Attributes -> TextItem
Font :: Attributes -> Text -> TextItem

-- | Only available in Graphviz >= 2.28.0.
Format :: Format -> Text -> TextItem
data Format
Italics :: Format
Bold :: Format
Underline :: Format

-- | Requires Graphviz >= 2.38.0.
Overline :: Format
Subscript :: Format
Superscript :: Format

-- | A table in HTML-like labels. Tables are optionally wrapped in overall
--   FONT tags.
data Table
HTable :: Maybe Attributes -> Attributes -> [Row] -> Table

-- | Optional FONT attributes. Just [] denotes
--   empty FONT tags; Nothing denotes no such
--   tags.
[tableFontAttrs] :: Table -> Maybe Attributes
[tableAttrs] :: Table -> Attributes

-- | This list is assumed to be non-empty.
[tableRows] :: Table -> [Row]

-- | A row in a Table. The list of Cell values is assumed to
--   be non-empty.
data Row
Cells :: [Cell] -> Row

-- | Should be between Cells values, requires Graphviz >= 2.29.0
HorizontalRule :: Row

-- | Cells either recursively contain another Label or else a path
--   to an image file.
data Cell
LabelCell :: Attributes -> Label -> Cell
ImgCell :: Attributes -> Img -> Cell

-- | Should be between LabelCell or ImgCell values, requires
--   Graphviz >= 2.29.0
VerticalRule :: Cell

-- | The path to an image; accepted Attributes are Scale and
--   Src.
newtype Img
Img :: Attributes -> Img

-- | The various HTML-like label-specific attributes being used.
type Attributes = [Attribute]

-- | Note that not all Attribute values are valid everywhere: see
--   the comments for each one on where it is valid.
data Attribute

-- | Valid for: Table, Cell, Newline.
Align :: Align -> Attribute

-- | Valid for: Cell.
BAlign :: Align -> Attribute

-- | Valid for: Table (including tableFontAttrs),
--   Cell, Font.
BGColor :: Color -> Attribute

-- | Valid for: Table, Cell. Default is 1;
--   0 represents no border.
Border :: Word8 -> Attribute

-- | Valid for: Table. Default is 1; 0 represents
--   no border.
CellBorder :: Word8 -> Attribute

-- | Valid for: Table, Cell. Default is 2.
CellPadding :: Word8 -> Attribute

-- | Valid for: Table, Cell. Default is 2; maximum
--   is 127.
CellSpacing :: Word8 -> Attribute

-- | Valid for: Table, Cell.
Color :: Color -> Attribute

-- | Valid for: Cell. Default is 1.
ColSpan :: Word16 -> Attribute

-- | Valid for: Table. Requires Graphviz >= 2.40.1
Columns :: CellFormat -> Attribute

-- | Valid for: tableFontAttrs, Font.
Face :: Text -> Attribute

-- | Valid for: Table, Cell. Default is
--   False.
FixedSize :: Bool -> Attribute

-- | Valid for: Table, Cell. Default is 0. Requires
--   Graphviz >= 2.40.1
GradientAngle :: Int -> Attribute

-- | Valid for: Table, Cell.
Height :: Word16 -> Attribute

-- | Valid for: Table, Cell.
HRef :: Text -> Attribute

-- | Valid for: Table, Cell. Requires Graphviz >= 2.29.0
ID :: Text -> Attribute

-- | Valid for: tableFontAttrs, Font.
PointSize :: Double -> Attribute

-- | Valid for: Table, Cell.
Port :: PortName -> Attribute

-- | Valid for: Table. Requires Graphviz >= 2.40.1
Rows :: CellFormat -> Attribute

-- | Valid for: Cell.
RowSpan :: Word16 -> Attribute

-- | Valid for: Img.
Scale :: Scale -> Attribute

-- | Valid for: Table, Cell. Default is [LeftSide,
--   TopSide, RightSide, BottomSide]. Requires
--   Graphviz >= 2.40.1
Sides :: [Side] -> Attribute

-- | Valid for: Img.
Src :: FilePath -> Attribute

-- | Valid for: Table, Cell. Requires Graphviz >= 2.40.1
Style :: Style -> Attribute

-- | Valid for: Table, Cell.
Target :: Text -> Attribute

-- | Valid for: Table, Cell. Has an alias of
--   TOOLTIP.
Title :: Text -> Attribute

-- | Valid for: Table, Cell.
VAlign :: VAlign -> Attribute

-- | Valid for: Table, Cell.
Width :: Word16 -> Attribute

-- | Specifies horizontal placement. When an object is allocated more space
--   than required, this value determines where the extra space is placed
--   left and right of the object.
data Align
HLeft :: Align

-- | Default value.
HCenter :: Align
HRight :: Align

-- | LabelCell values only; aligns lines of text using the full cell
--   width. The alignment of a line is determined by its (possibly
--   implicit) associated Newline element.
HText :: Align

-- | Specifies vertical placement. When an object is allocated more space
--   than required, this value determines where the extra space is placed
--   above and below the object.
data VAlign
HTop :: VAlign

-- | Default value.
HMiddle :: VAlign
HBottom :: VAlign
data CellFormat
RuleBetween :: CellFormat

-- | Specifies how an image will use any extra space available in its cell.
--   If undefined, the image inherits the value of the ImageScale
--   attribute.
data Scale

-- | Default value.
NaturalSize :: Scale
ScaleUniformly :: Scale
ExpandWidth :: Scale
ExpandHeight :: Scale
ExpandBoth :: Scale

-- | Which sides of a border in a cell or table should be drawn, if a
--   border is drawn.
data Side
LeftSide :: Side
RightSide :: Side
TopSide :: Side
BottomSide :: Side
data Style

-- | Valid for Table
Rounded :: Style

-- | Valid for Table, Cell.
Radial :: Style
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.HTML.Align
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.HTML.CellFormat
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.HTML.Format
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.HTML.Scale
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.HTML.Side
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.HTML.Style
instance GHC.Internal.Enum.Bounded Data.GraphViz.Attributes.HTML.VAlign
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.HTML.Align
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.HTML.CellFormat
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.HTML.Format
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.HTML.Scale
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.HTML.Side
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.HTML.Style
instance GHC.Internal.Enum.Enum Data.GraphViz.Attributes.HTML.VAlign
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Align
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Attribute
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Cell
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.CellFormat
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Format
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Img
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Label
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Row
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Scale
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Side
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Style
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.Table
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.TextItem
instance GHC.Classes.Eq Data.GraphViz.Attributes.HTML.VAlign
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Align
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Attribute
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Cell
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.CellFormat
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Format
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Img
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Label
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Row
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Scale
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Side
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Style
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.Table
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.TextItem
instance GHC.Classes.Ord Data.GraphViz.Attributes.HTML.VAlign
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Align
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Attribute
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Cell
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.CellFormat
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Format
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Img
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Label
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Row
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Scale
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Side
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Style
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.Table
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.TextItem
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.HTML.VAlign
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Align
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Attribute
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Cell
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.CellFormat
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Format
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Img
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Label
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Row
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Scale
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Side
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Style
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.Table
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.TextItem
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.HTML.VAlign
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Align
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Attribute
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Cell
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.CellFormat
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Format
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Img
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Label
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Row
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Scale
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Side
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Style
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.Table
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.TextItem
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.HTML.VAlign
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Align
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Attribute
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Cell
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.CellFormat
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Format
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Img
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Label
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Row
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Scale
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Side
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Style
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.Table
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.TextItem
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.HTML.VAlign

-- | If you are just using graphviz to create basic Dot graphs, then you
--   probably want to use Data.GraphViz.Attributes rather than this
--   module.
--   
--   This module defines the various attributes that different parts of a
--   Graphviz graph can have. These attributes are based on the
--   documentation found at: http://graphviz.org/doc/info/attrs.html
--   
--   For more information on usage, etc. please see that document.
--   
--   A summary of known current constraints/limitations/differences:
--   
--   
--   
- Note that for an edge, in Dot parlance if the edge goes
--   from A to B, then A is the tail node and B
--   is the head node (since A is at the tail end of the
--   arrow).
--   
- ColorList, DoubleList and PointfList
--   are defined as actual lists (LayerList needs a newtype
--   for other reasons). All of these are assumed to be non-empty
--   lists.
--   
- For the various *Color attributes that take in a list of
--   Color values, usually only one color is used. The
--   Color attribute for edges allows multiple values; for other
--   attributes, two values are supported for gradient fills in Graphviz
--   >= 2.29.0.
--   
- Style is implemented as a list of StyleItem values; note
--   that empty lists are not allowed.
--   
- A lot of values have a possible value of none. These now
--   have custom constructors. In fact, most constructors have been
--   expanded upon to give an idea of what they represent rather than using
--   generic terms.
--   
- Rect uses two Point values to denote the lower-left
--   and top-right corners.
--   
- The two LabelLoc attributes have been combined.
--   
- SplineType has been replaced with
--   [Spline].
--   
- Only polygon-based Shapes are available.
--   
- Not every Attribute is fully documented/described. However,
--   all those which have specific allowed values should be covered.
--   
- Deprecated Overlap algorithms are not defined. Furthermore,
--   the ability to specify an integer prefix for use with the fdp layout
--   is not supported.
--   
- The global Orientation attribute is not defined, as it is
--   difficult to distinguish from the node-based Orientation
--   Attribute; also, its behaviour is duplicated by
--   Rotate.
--   
- The charset attribute is not available, as graphviz only
--   supports UTF-8 encoding (as it is not currently feasible nor needed to
--   also support Latin1 encoding).
--   
- In Graphviz, when a node or edge has a list of attributes, the
--   colorscheme which is used to identify a color can be set after
--   that color (e.g. [colorscheme=x11,color=grey,colorscheme=svg]
--   uses the svg colorscheme's definition of grey, which is different from
--   the x11 one. Instead, graphviz parses them in order.
--   
module Data.GraphViz.Attributes.Complete

-- | Attributes are used to customise the layout and design of Dot graphs.
--   Care must be taken to ensure that the attribute you use is valid, as
--   not all attributes can be used everywhere.
data Attribute

-- | Valid for: G; Default: 0.99; Minimum:
--   0.0; Notes: Neato only
Damping :: Double -> Attribute

-- | Valid for: GC; Default: 0.3; Minimum:
--   0; Notes: Sfdp, Fdp only
K :: Double -> Attribute

-- | Valid for: ENGC; Default: none; Notes: svg,
--   postscript, map only
URL :: EscString -> Attribute

-- | Valid for: NC; Default: 1.0; Minimum:
--   >0; Notes: Patchwork only, requires Graphviz
--   >= 2.30.0
Area :: Double -> Attribute

-- | Valid for: E; Default: normal
ArrowHead :: ArrowType -> Attribute

-- | Valid for: E; Default: 1.0; Minimum:
--   0.0
ArrowSize :: Double -> Attribute

-- | Valid for: E; Default: normal
ArrowTail :: ArrowType -> Attribute

-- | Valid for: G; Default: none; Notes: xdot only
Background :: Text -> Attribute

-- | Valid for: G; Notes: write only
BoundingBox :: Rect -> Attribute

-- | Valid for: GC; Default: []
BgColor :: ColorList -> Attribute

-- | Valid for: G; Default: False; Parsing
--   Default: True
Center :: Bool -> Attribute

-- | Valid for: G; Default: Local;
--   Notes: Dot only
ClusterRank :: ClusterMode -> Attribute

-- | Valid for: ENC; Default: [WC (X11Color
--   Black) Nothing]
Color :: ColorList -> Attribute

-- | Valid for: ENCG; Default: X11
ColorScheme :: ColorScheme -> Attribute

-- | Valid for: ENG; Default: ""
Comment :: Text -> Attribute

-- | Valid for: G; Default: False; Parsing
--   Default: True; Notes: Dot only
Compound :: Bool -> Attribute

-- | Valid for: G; Default: False; Parsing
--   Default: True
Concentrate :: Bool -> Attribute

-- | Valid for: E; Default: True; Parsing
--   Default: True; Notes: Dot only
Constraint :: Bool -> Attribute

-- | Valid for: E; Default: False; Parsing
--   Default: True
Decorate :: Bool -> Attribute

-- | Valid for: G; Default: 1+(avg.
--   len)*sqrt(abs(V)) (unable to statically define); Minimum:
--   The value of Epsilon.; Notes: Neato only, only if
--   Pack DontPack
DefaultDist :: Double -> Attribute

-- | Valid for: G; Default: 2; Minimum:
--   2; Notes: maximum of 10; Sfdp,
--   Fdp, Neato only
Dim :: Int -> Attribute

-- | Valid for: G; Default: 2; Minimum:
--   2; Notes: maximum of 10; Sfdp,
--   Fdp, Neato only
Dimen :: Int -> Attribute

-- | Valid for: E; Default: Forward
--   (directed), NoDir (undirected)
Dir :: DirType -> Attribute

-- | Valid for: G; Default: NoConstraints;
--   Parsing Default: EdgeConstraints; Notes:
--   Neato only
DirEdgeConstraints :: DEConstraints -> Attribute

-- | Valid for: N; Default: 0.0; Minimum:
--   -100.0
Distortion :: Double -> Attribute

-- | Valid for: G; Default: 96.0, 0.0;
--   Notes: svg, bitmap output only; "resolution" is a synonym
DPI :: Double -> Attribute

-- | Valid for: E; Default: ""; Notes: svg,
--   map only
EdgeURL :: EscString -> Attribute

-- | Valid for: E; Default: none; Notes: svg, map only
EdgeTarget :: EscString -> Attribute

-- | Valid for: E; Default: ""; Notes: svg,
--   cmap only
EdgeTooltip :: EscString -> Attribute

-- | Valid for: G; Default: .0001 * # nodes
--   (mode == KK), .0001 (mode ==
--   Major); Notes: Neato only
Epsilon :: Double -> Attribute

-- | Valid for: G; Default: DVal 3;
--   Notes: not Dot
ESep :: DPoint -> Attribute

-- | Valid for: NEC; Default: [WC (X11Color
--   LightGray) Nothing] (nodes), [WC
--   (X11Color Black) Nothing] (clusters)
FillColor :: ColorList -> Attribute

-- | Valid for: N; Default: GrowAsNeeded;
--   Parsing Default: SetNodeSize
FixedSize :: NodeSize -> Attribute

-- | Valid for: ENGC; Default: X11Color
--   Black
FontColor :: Color -> Attribute

-- | Valid for: ENGC; Default: "Times-Roman"
FontName :: Text -> Attribute

-- | Valid for: G; Default: SvgNames;
--   Notes: svg only
FontNames :: SVGFontNames -> Attribute

-- | Valid for: G; Default: system dependent
FontPath :: Paths -> Attribute

-- | Valid for: ENGC; Default: 14.0; Minimum:
--   1.0
FontSize :: Double -> Attribute

-- | Valid for: G; Default: True; Parsing
--   Default: True; Notes: only for XLabel
--   attributes, requires Graphviz >= 2.29.0
ForceLabels :: Bool -> Attribute

-- | Valid for: NCG; Default: 0; Notes: requires
--   Graphviz >= 2.29.0
GradientAngle :: Int -> Attribute

-- | Valid for: N; Default: ""; Notes:
--   Dot only
Group :: Text -> Attribute

-- | Valid for: E; Default: ""; Notes: svg,
--   map only
HeadURL :: EscString -> Attribute

-- | Valid for: E; Notes: write only, requires Graphviz >=
--   2.30.0
Head_LP :: Point -> Attribute

-- | Valid for: E; Default: True; Parsing
--   Default: True
HeadClip :: Bool -> Attribute

-- | Valid for: E; Default: StrLabel ""
HeadLabel :: Label -> Attribute

-- | Valid for: E; Default: CompassPoint
--   CenterPoint
HeadPort :: PortPos -> Attribute

-- | Valid for: E; Default: none; Notes: svg, map only
HeadTarget :: EscString -> Attribute

-- | Valid for: E; Default: ""; Notes: svg,
--   cmap only
HeadTooltip :: EscString -> Attribute

-- | Valid for: N; Default: 0.5; Minimum:
--   0.02
Height :: Double -> Attribute

-- | Valid for: GNE; Default: ""; Notes: svg,
--   postscript, map only
ID :: EscString -> Attribute

-- | Valid for: N; Default: ""
Image :: Text -> Attribute

-- | Valid for: G; Default: Paths [];
--   Notes: Printing and parsing is OS-specific, requires Graphviz
--   >= 2.29.0
ImagePath :: Paths -> Attribute

-- | Valid for: N; Default: NoScale;
--   Parsing Default: UniformScale
ImageScale :: ScaleType -> Attribute

-- | Valid for: N; Default: none; Notes: Fdp,
--   Neato only, a value of 0 is equivalent to being
--   72, requires Graphviz >= 2.36.0
InputScale :: Double -> Attribute

-- | Valid for: ENGC; Default: StrLabel "\N"
--   (nodes), StrLabel "" (otherwise)
Label :: Label -> Attribute

-- | Valid for: E; Default: ""; Notes: svg,
--   map only
LabelURL :: EscString -> Attribute

-- | Valid for: G; Default: NotEdgeLabel;
--   Notes: Sfdp only, requires Graphviz >= 2.28.0
LabelScheme :: LabelScheme -> Attribute

-- | Valid for: E; Default: -25.0; Minimum:
--   -180.0
LabelAngle :: Double -> Attribute

-- | Valid for: E; Default: 1.0; Minimum:
--   0.0
LabelDistance :: Double -> Attribute

-- | Valid for: E; Default: False; Parsing
--   Default: True
LabelFloat :: Bool -> Attribute

-- | Valid for: E; Default: X11Color
--   Black
LabelFontColor :: Color -> Attribute

-- | Valid for: E; Default: "Times-Roman"
LabelFontName :: Text -> Attribute

-- | Valid for: E; Default: 14.0; Minimum:
--   1.0
LabelFontSize :: Double -> Attribute

-- | Valid for: GC; Default: JCenter
LabelJust :: Justification -> Attribute

-- | Valid for: GCN; Default: VTop
--   (clusters), VBottom (root graphs),
--   VCenter (nodes)
LabelLoc :: VerticalPlacement -> Attribute

-- | Valid for: E; Default: none; Notes: svg, map only
LabelTarget :: EscString -> Attribute

-- | Valid for: E; Default: ""; Notes: svg,
--   cmap only
LabelTooltip :: EscString -> Attribute

-- | Valid for: G; Default: False; Parsing
--   Default: True
Landscape :: Bool -> Attribute

-- | Valid for: ENC; Default: []
Layer :: LayerRange -> Attribute

-- | Valid for: G; Default: LLSep ",";
--   Notes: requires Graphviz >= 2.30.0
LayerListSep :: LayerListSep -> Attribute

-- | Valid for: G; Default: LL []
Layers :: LayerList -> Attribute

-- | Valid for: G; Default: []
LayerSelect :: LayerRange -> Attribute

-- | Valid for: G; Default: LSep " :t"
LayerSep :: LayerSep -> Attribute

-- | Valid for: G
Layout :: GraphvizCommand -> Attribute

-- | Valid for: E; Default: 1.0 (Neato),
--   0.3 (Fdp); Notes: Fdp, Neato only
Len :: Double -> Attribute

-- | Valid for: G; Default: maxBound;
--   Minimum: 0; Notes: Sfdp only
Levels :: Int -> Attribute

-- | Valid for: G; Default: 0.0; Notes:
--   Neato only
LevelsGap :: Double -> Attribute

-- | Valid for: E; Default: ""; Notes:
--   Dot only
LHead :: Text -> Attribute

-- | Valid for: GC; Notes: write only, requires Graphviz
--   >= 2.28.0
LHeight :: Double -> Attribute

-- | Valid for: EGC; Notes: write only
LPos :: Point -> Attribute

-- | Valid for: E; Default: ""; Notes:
--   Dot only
LTail :: Text -> Attribute

-- | Valid for: GC; Notes: write only, requires Graphviz
--   >= 2.28.0
LWidth :: Double -> Attribute

-- | Valid for: NGC; Default: device dependent
Margin :: DPoint -> Attribute

-- | Valid for: G; Default: 100 * # nodes (mode
--   == KK), 200 (mode == Major),
--   600 (Fdp); Notes: Fdp, Neato only
MaxIter :: Int -> Attribute

-- | Valid for: G; Default: 1.0; Notes:
--   Dot only
MCLimit :: Double -> Attribute

-- | Valid for: G; Default: 1.0; Minimum:
--   0.0; Notes: Circo only
MinDist :: Double -> Attribute

-- | Valid for: E; Default: 1; Minimum:
--   0; Notes: Dot only
MinLen :: Int -> Attribute

-- | Valid for: G; Default: Major (actually
--   Spring for Sfdp, but this isn't used as a
--   default in this library); Notes: Neato, Sfdp only
Mode :: ModeType -> Attribute

-- | Valid for: G; Default: ShortPath;
--   Notes: Neato only
Model :: Model -> Attribute

-- | Valid for: G; Default: False; Parsing
--   Default: True; Notes: Neato only; requires
--   the Mosek software
Mosek :: Bool -> Attribute

-- | Valid for: G; Default: 0.25; Minimum:
--   0.02
NodeSep :: Double -> Attribute

-- | Valid for: GCNE; Default: False;
--   Parsing Default: True
NoJustify :: Bool -> Attribute

-- | Valid for: G; Default: NotNormalized;
--   Parsing Default: IsNormalized; Notes: not
--   Dot
Normalize :: Normalized -> Attribute

-- | Valid for: G; Default: False; Parsing
--   Default: True; Notes: Neato only, requires
--   Graphviz >= 2.38.0
NoTranslate :: Bool -> Attribute

-- | Valid for: G; Notes: Dot only
Nslimit :: Double -> Attribute

-- | Valid for: G; Notes: Dot only
Nslimit1 :: Double -> Attribute

-- | Valid for: GN; Default: none; Notes: Dot
--   only
Ordering :: Order -> Attribute

-- | Valid for: N; Default: 0.0; Minimum:
--   360.0
Orientation :: Double -> Attribute

-- | Valid for: G; Default: BreadthFirst
OutputOrder :: OutputMode -> Attribute

-- | Valid for: G; Default: KeepOverlaps;
--   Parsing Default: KeepOverlaps; Notes: not
--   Dot
Overlap :: Overlap -> Attribute

-- | Valid for: G; Default: -4; Minimum:
--   -1.0e10; Notes: PrismOverlap only
OverlapScaling :: Double -> Attribute

-- | Valid for: G; Default: True; Parsing
--   Default: True; Notes: PrismOverlap only,
--   requires Graphviz >= 2.36.0
OverlapShrink :: Bool -> Attribute

-- | Valid for: G; Default: DontPack;
--   Parsing Default: DoPack
Pack :: Pack -> Attribute

-- | Valid for: G; Default: PackNode
PackMode :: PackMode -> Attribute

-- | Valid for: G; Default: DVal 0.0555 (4
--   points)
Pad :: DPoint -> Attribute

-- | Valid for: G
Page :: Point -> Attribute

-- | Valid for: G; Default: Bl
PageDir :: PageDir -> Attribute

-- | Valid for: C; Default: X11Color
--   Black
PenColor :: Color -> Attribute

-- | Valid for: CNE; Default: 1.0; Minimum:
--   0.0
PenWidth :: Double -> Attribute

-- | Valid for: NC; Default: shape default (nodes),
--   1 (clusters); Minimum: 0
Peripheries :: Int -> Attribute

-- | Valid for: N; Default: False; Parsing
--   Default: True; Notes: Fdp, Neato only
Pin :: Bool -> Attribute

-- | Valid for: EN
Pos :: Pos -> Attribute

-- | Valid for: G; Default: NormalQT;
--   Parsing Default: NormalQT; Notes: Sfdp
--   only
QuadTree :: QuadType -> Attribute

-- | Valid for: G; Default: 0.0; Minimum:
--   0.0
Quantum :: Double -> Attribute

-- | Valid for: S; Notes: Dot only
Rank :: RankType -> Attribute

-- | Valid for: G; Default: FromTop;
--   Notes: Dot only
RankDir :: RankDir -> Attribute

-- | Valid for: G; Default: [0.5] (Dot),
--   [1.0] (Twopi); Minimum: [0.02];
--   Notes: Twopi, Dot only
RankSep :: [Double] -> Attribute

-- | Valid for: G
Ratio :: Ratios -> Attribute

-- | Valid for: N; Notes: write only
Rects :: [Rect] -> Attribute

-- | Valid for: N; Default: False; Parsing
--   Default: True
Regular :: Bool -> Attribute

-- | Valid for: G; Default: False; Parsing
--   Default: True; Notes: Dot only
ReMinCross :: Bool -> Attribute

-- | Valid for: G; Default: 1.0; Minimum:
--   0.0; Notes: Sfdp only
RepulsiveForce :: Double -> Attribute

-- | Valid for: GN; Default: NodeName ""
--   (graphs), NotCentral (nodes); Parsing Default:
--   IsCentral; Notes: Circo, Twopi only
Root :: Root -> Attribute

-- | Valid for: G; Default: 0
Rotate :: Int -> Attribute

-- | Valid for: G; Default: 0; Notes:
--   Sfdp only, requires Graphviz >= 2.28.0
Rotation :: Double -> Attribute

-- | Valid for: E; Default: ""; Notes:
--   Dot only
SameHead :: Text -> Attribute

-- | Valid for: E; Default: ""; Notes:
--   Dot only
SameTail :: Text -> Attribute

-- | Valid for: N; Default: 8 (output), 20
--   (overlap and image maps)
SamplePoints :: Int -> Attribute

-- | Valid for: G; Notes: Not Dot, requires Graphviz
--   >= 2.28.0 (>= 2.38.0 for anything except TwoPi)
Scale :: DPoint -> Attribute

-- | Valid for: G; Default: 30; Notes:
--   Dot only
SearchSize :: Int -> Attribute

-- | Valid for: G; Default: DVal 4;
--   Notes: not Dot
Sep :: DPoint -> Attribute

-- | Valid for: N; Default: Ellipse
Shape :: Shape -> Attribute

-- | Valid for: ENG; Default: 0; Minimum:
--   0; Notes: Dot only; used for debugging by
--   printing PostScript guide boxes
ShowBoxes :: Int -> Attribute

-- | Valid for: N; Default: 4; Minimum:
--   0
Sides :: Int -> Attribute

-- | Valid for: G
Size :: GraphSize -> Attribute

-- | Valid for: N; Default: 0.0; Minimum:
--   -100.0
Skew :: Double -> Attribute

-- | Valid for: G; Default: NoSmooth;
--   Notes: Sfdp only
Smoothing :: SmoothType -> Attribute

-- | Valid for: GCN; Default: 0; Minimum:
--   0
SortV :: Word16 -> Attribute

-- | Valid for: G; Default: SplineEdges
--   (Dot), LineEdges (other); Parsing
--   Default: SplineEdges
Splines :: EdgeType -> Attribute

-- | Valid for: G; Default: StartStyleSeed
--   RandomStyle seed for some unknown fixed seed.;
--   Notes: Fdp, Neato only
Start :: StartType -> Attribute

-- | Valid for: ENCG
Style :: [StyleItem] -> Attribute

-- | Valid for: G; Default: ""; Notes: svg
--   only
StyleSheet :: Text -> Attribute

-- | Valid for: E; Default: ""; Notes: svg,
--   map only
TailURL :: EscString -> Attribute

-- | Valid for: E; Notes: write only, requires Graphviz >=
--   2.30.0
Tail_LP :: Point -> Attribute

-- | Valid for: E; Default: True; Parsing
--   Default: True
TailClip :: Bool -> Attribute

-- | Valid for: E; Default: StrLabel ""
TailLabel :: Label -> Attribute

-- | Valid for: E; Default: CompassPoint
--   CenterPoint
TailPort :: PortPos -> Attribute

-- | Valid for: E; Default: none; Notes: svg, map only
TailTarget :: EscString -> Attribute

-- | Valid for: E; Default: ""; Notes: svg,
--   cmap only
TailTooltip :: EscString -> Attribute

-- | Valid for: ENGC; Default: none; Notes: svg, map
--   only
Target :: EscString -> Attribute

-- | Valid for: NEC; Default: ""; Notes: svg,
--   cmap only
Tooltip :: EscString -> Attribute

-- | Valid for: G; Parsing Default: True;
--   Notes: bitmap output only
TrueColor :: Bool -> Attribute

-- | Valid for: N; Notes: write only
Vertices :: [Point] -> Attribute

-- | Valid for: G; Default: none
ViewPort :: ViewPort -> Attribute

-- | Valid for: G; Default: 0.05; Minimum:
--   0.0; Notes: not Dot
VoroMargin :: Double -> Attribute

-- | Valid for: E; Default: Int 1;
--   Minimum: Int 0 (Dot), Int
--   1 (Neato,Fdp,Sfdp); Notes: as of
--   Graphviz 2.30: weights for dot need to be Ints
Weight :: Number -> Attribute

-- | Valid for: N; Default: 0.75; Minimum:
--   0.01
Width :: Double -> Attribute

-- | Valid for: G; Notes: xdot only, requires Graphviz >=
--   2.34.0, equivalent to specifying version of xdot to be used
XDotVersion :: Version -> Attribute

-- | Valid for: EN; Default: StrLabel "";
--   Notes: requires Graphviz >= 2.29.0
XLabel :: Label -> Attribute

-- | Valid for: EN; Notes: write only, requires Graphviz
--   >= 2.29.0
XLP :: Point -> Attribute

-- | Valid for: Assumed valid for all; the fields are
--   Attribute name and value respectively.
UnknownAttribute :: AttributeName -> Text -> Attribute
type Attributes = [Attribute]

-- | Determine if two Attributes are the same type of
--   Attribute.
sameAttribute :: Attribute -> Attribute -> Bool

-- | Return the default value for a specific Attribute if possible;
--   graphcluster values are preferred over nodeedge values.
defaultAttributeValue :: Attribute -> Maybe Attribute

-- | Remove attributes that we don't want to consider:
--   
--   
--   
- Those that are defaults
--   
- colorscheme (as the colors embed it anyway)
--   
rmUnwantedAttributes :: Attributes -> Attributes

-- | Determine if this Attribute is valid for use with Graphs.
usedByGraphs :: Attribute -> Bool

-- | Determine if this Attribute is valid for use with SubGraphs.
usedBySubGraphs :: Attribute -> Bool

-- | Determine if this Attribute is valid for use with Clusters.
usedByClusters :: Attribute -> Bool

-- | Determine if this Attribute is valid for use with Nodes.
usedByNodes :: Attribute -> Bool

-- | Determine if this Attribute is valid for use with Edges.
usedByEdges :: Attribute -> Bool

-- | Determine if the provided Text value is a valid name for an
--   UnknownAttribute.
validUnknown :: AttributeName -> Bool

-- | The name for an UnknownAttribute; must satisfy validUnknown.
type AttributeName = Text

-- | If performing any custom pre-/post-processing on Dot code, you may
--   wish to utilise some custom Attributes. These are wrappers
--   around the UnknownAttribute constructor (and thus
--   CustomAttribute is just an alias for Attribute).
--   
--   You should ensure that validUnknown is True for any
--   potential custom attribute name.
type CustomAttribute = Attribute

-- | Create a custom attribute.
customAttribute :: AttributeName -> Text -> CustomAttribute

-- | Determines whether or not this is a custom attribute.
isCustom :: Attribute -> Bool
isSpecifiedCustom :: AttributeName -> Attribute -> Bool

-- | The value of a custom attribute. Will throw a GraphvizException
--   if the provided Attribute isn't a custom one.
customValue :: CustomAttribute -> Text

-- | The name of a custom attribute. Will throw a GraphvizException
--   if the provided Attribute isn't a custom one.
customName :: CustomAttribute -> AttributeName

-- | Returns all custom attributes and the list of non-custom Attributes.
findCustoms :: Attributes -> ([CustomAttribute], Attributes)

-- | Find the (first instance of the) specified custom attribute and
--   returns it along with all other Attributes.
findSpecifiedCustom :: AttributeName -> Attributes -> Maybe (CustomAttribute, Attributes)

-- | Delete all custom attributes (actually, this will delete all
--   UnknownAttribute values; as such it can also be used to remove
--   legacy attributes).
deleteCustomAttributes :: Attributes -> Attributes

-- | Removes all instances of the specified custom attribute.
deleteSpecifiedCustom :: AttributeName -> Attributes -> Attributes

-- | A numeric type with an explicit separation between integers and
--   floating-point values.
data Number
Int :: Int -> Number
Dbl :: Double -> Number

-- | Some Attributes (mainly label-like ones) take a String
--   argument that allows for extra escape codes. This library doesn't do
--   any extra checks or special parsing for these escape codes, but usage
--   of EscString rather than Text indicates that the
--   Graphviz tools will recognise these extra escape codes for these
--   Attributes.
--   
--   The extra escape codes include (note that these are all Strings):
--   
--   
--   
- \N Replace with the name of the node (for Node
--   Attributes).
--   
- \G Replace with the name of the graph (for Node
--   Attributes) or the name of the graph or cluster, whichever is
--   applicable (for Graph, Cluster and Edge Attributes).
--   
- \E Replace with the name of the edge, formed by
--   the two adjoining nodes and the edge type (for Edge
--   Attributes).
--   
- \T Replace with the name of the tail node (for
--   Edge Attributes).
--   
- \H Replace with the name of the head node (for
--   Edge Attributes).
--   
- \L Replace with the object's label (for all
--   Attributes).
--   
--   
--   Also, if the Attribute in question is Label,
--   HeadLabel or TailLabel, then \n,
--   \l and \r split the label into lines centered,
--   left-justified and right-justified respectively.
type EscString = Text
data Label
StrLabel :: EscString -> Label

-- | If PlainText is used, the Label value is the entire
--   "shape"; if anything else except PointShape is used then the
--   Label is embedded within the shape.
HtmlLabel :: Label -> Label

-- | For nodes only; requires either Record or MRecord as the
--   shape.
RecordLabel :: RecordFields -> Label
data VerticalPlacement
VTop :: VerticalPlacement

-- | Only valid for Nodes.
VCenter :: VerticalPlacement
VBottom :: VerticalPlacement

-- | How to treat a node whose name is of the form "|edgelabel|*"
--   as a special node representing an edge label.
data LabelScheme

-- | No effect
NotEdgeLabel :: LabelScheme

-- | Make node close to center of neighbor
CloseToCenter :: LabelScheme

-- | Make node close to old center of neighbor
CloseToOldCenter :: LabelScheme

-- | Use a two-step process.
RemoveAndStraighten :: LabelScheme

-- | The mapping used for FontName values in SVG output.
--   
--   More information can be found at
--   http://www.graphviz.org/doc/fontfaq.txt.
data SVGFontNames

-- | Use the legal generic SVG font names.
SvgNames :: SVGFontNames

-- | Use PostScript font names.
PostScriptNames :: SVGFontNames

-- | Use fontconfig font conventions.
FontConfigNames :: SVGFontNames

-- | A RecordFields value should never be empty.
type RecordFields = [RecordField]

-- | Specifies the sub-values of a record-based label. By default, the
--   cells are laid out horizontally; use FlipFields to change the
--   orientation of the fields (can be applied recursively). To change the
--   default orientation, use RankDir.
data RecordField
LabelledTarget :: PortName -> EscString -> RecordField

-- | Will result in no label for that cell.
PortName :: PortName -> RecordField
FieldLabel :: EscString -> RecordField
FlipFields :: RecordFields -> RecordField

-- | Should only have 2D points (i.e. created with createPoint).
data Rect
Rect :: Point -> Point -> Rect
data Justification
JLeft :: Justification
JRight :: Justification
JCenter :: Justification

-- | Geometries of shapes are affected by the attributes Regular,
--   Peripheries and Orientation.
data Shape

-- | Has synonyms of rect and rectangle.
BoxShape :: Shape

-- | Also affected by Sides, Skew and
--   Distortion.
Polygon :: Shape

-- | Has synonym of oval.
Ellipse :: Shape
Circle :: Shape

-- | Only affected by Peripheries, Width and
--   Height.
PointShape :: Shape
Egg :: Shape
Triangle :: Shape

-- | Has synonym of none. Recommended for HtmlLabels.
PlainText :: Shape
DiamondShape :: Shape
Trapezium :: Shape
Parallelogram :: Shape
House :: Shape
Pentagon :: Shape
Hexagon :: Shape
Septagon :: Shape
Octagon :: Shape
DoubleCircle :: Shape
DoubleOctagon :: Shape
TripleOctagon :: Shape
InvTriangle :: Shape
InvTrapezium :: Shape
InvHouse :: Shape
MDiamond :: Shape
MSquare :: Shape
MCircle :: Shape
Square :: Shape

-- | Requires Graphviz >= 2.32.0.
Star :: Shape

-- | Requires Graphviz >= 2.36.0.
Underline :: Shape
Note :: Shape
Tab :: Shape
Folder :: Shape
Box3D :: Shape
Component :: Shape

-- | Requires Graphviz >= 2.30.0.
Promoter :: Shape

-- | Requires Graphviz >= 2.30.0.
CDS :: Shape

-- | Requires Graphviz >= 2.30.0.
Terminator :: Shape

-- | Requires Graphviz >= 2.30.0.
UTR :: Shape

-- | Requires Graphviz >= 2.30.0.
PrimerSite :: Shape

-- | Requires Graphviz >= 2.30.0.
RestrictionSite :: Shape

-- | Requires Graphviz >= 2.30.0.
FivePovOverhang :: Shape

-- | Requires Graphviz >= 2.30.0.
ThreePovOverhang :: Shape

-- | Requires Graphviz >= 2.30.0.
NoOverhang :: Shape

-- | Requires Graphviz >= 2.30.0.
Assembly :: Shape

-- | Requires Graphviz >= 2.30.0.
Signature :: Shape

-- | Requires Graphviz >= 2.30.0.
Insulator :: Shape

-- | Requires Graphviz >= 2.30.0.
Ribosite :: Shape

-- | Requires Graphviz >= 2.30.0.
RNAStab :: Shape

-- | Requires Graphviz >= 2.30.0.
ProteaseSite :: Shape

-- | Requires Graphviz >= 2.30.0.
ProteinStab :: Shape

-- | Requires Graphviz >= 2.30.0.
RPromoter :: Shape

-- | Requires Graphviz >= 2.30.0.
RArrow :: Shape

-- | Requires Graphviz >= 2.30.0.
LArrow :: Shape

-- | Requires Graphviz >= 2.30.0.
LPromoter :: Shape

-- | Must specify the record shape with a Label.
Record :: Shape

-- | Must specify the record shape with a Label.
MRecord :: Shape

-- | A list of search paths.
newtype Paths
Paths :: [FilePath] -> Paths
[paths] :: Paths -> [FilePath]
data ScaleType
UniformScale :: ScaleType
NoScale :: ScaleType
FillWidth :: ScaleType
FillHeight :: ScaleType
FillBoth :: ScaleType

-- | Determine how the Width and Height attributes
--   specify the size of nodes.
data NodeSize

-- | Nodes will be the smallest width and height needed to contain the
--   label and any possible image. Width and Height are
--   the minimum allowed sizes.
GrowAsNeeded :: NodeSize

-- | Width and Height dictate the size of the node with a
--   warning if the label cannot fit in this.
SetNodeSize :: NodeSize

-- | Width and Height dictate the size of the shape only
--   and the label can expand out of the shape (with a warning). Requires
--   Graphviz >= 2.38.0.
SetShapeSize :: NodeSize

-- | Specify where to place arrow heads on an edge.
data DirType

-- | Draw a directed edge with an arrow to the node it's pointing go.
Forward :: DirType

-- | Draw a reverse directed edge with an arrow to the node it's coming
--   from.
Back :: DirType

-- | Draw arrows on both ends of the edge.
Both :: DirType

-- | Draw an undirected edge.
NoDir :: DirType

-- | Controls how (and if) edges are represented.
--   
--   For Dot, the default is SplineEdges; for all other
--   layouts the default is LineEdges.
data EdgeType

-- | Except for Dot, requires non-overlapping nodes (see
--   Overlap).
SplineEdges :: EdgeType
LineEdges :: EdgeType
NoEdges :: EdgeType
PolyLine :: EdgeType

-- | Does not handle ports or edge labels in Dot.
Ortho :: EdgeType

-- | Requires Graphviz >= 2.30.0.
Curved :: EdgeType

-- | Fdp only
CompoundEdge :: EdgeType

-- | Specifies a name for ports (used also in record-based and HTML-like
--   labels). Note that it is not valid for a PortName value to
--   contain a colon (:) character; it is assumed that it doesn't.
newtype PortName
PN :: Text -> PortName
[portName] :: PortName -> Text
data PortPos
LabelledPort :: PortName -> Maybe CompassPoint -> PortPos
CompassPoint :: CompassPoint -> PortPos
data CompassPoint
North :: CompassPoint
NorthEast :: CompassPoint
East :: CompassPoint
SouthEast :: CompassPoint
South :: CompassPoint
SouthWest :: CompassPoint
West :: CompassPoint
NorthWest :: CompassPoint
CenterPoint :: CompassPoint
NoCP :: CompassPoint

-- | Dot has a basic grammar of arrow shapes which allows usage of
--   up to 1,544,761 different shapes from 9 different basic
--   ArrowShapes. Note that whilst an explicit list is used in the
--   definition of ArrowType, there must be at least one tuple and a
--   maximum of 4 (since that is what is required by Dot). For more
--   information, see: http://graphviz.org/doc/info/arrows.html
--   
--   The 19 basic arrows shown on the overall attributes page have been
--   defined below as a convenience. Parsing of the 5 backward-compatible
--   special cases is also supported.
newtype ArrowType
AType :: [(ArrowModifier, ArrowShape)] -> ArrowType
data ArrowShape
Box :: ArrowShape
Crow :: ArrowShape
Diamond :: ArrowShape
DotArrow :: ArrowShape
Inv :: ArrowShape
NoArrow :: ArrowShape
Normal :: ArrowShape
Tee :: ArrowShape
Vee :: ArrowShape

-- | What modifications to apply to an ArrowShape.
data ArrowModifier
ArrMod :: ArrowFill -> ArrowSide -> ArrowModifier
[arrowFill] :: ArrowModifier -> ArrowFill
[arrowSide] :: ArrowModifier -> ArrowSide
data ArrowFill
OpenArrow :: ArrowFill
FilledArrow :: ArrowFill

-- | Represents which side (when looking towards the node the arrow is
--   pointing to) is drawn.
data ArrowSide
LeftSide :: ArrowSide
RightSide :: ArrowSide
BothSides :: ArrowSide

-- | Apply no modifications to an ArrowShape.
noMods :: ArrowModifier

-- | OpenArrow and BothSides
openMod :: ArrowModifier
data Point
Point :: Double -> Double -> Maybe Double -> Bool -> Point
[xCoord] :: Point -> Double
[yCoord] :: Point -> Double

-- | Can only be Just for Dim 3 or greater.
[zCoord] :: Point -> Maybe Double

-- | Input to Graphviz only: specify that the node position should not
--   change.
[forcePos] :: Point -> Bool

-- | Create a point with only x and y values.
createPoint :: Double -> Double -> Point
data Pos
PointPos :: Point -> Pos
SplinePos :: [Spline] -> Pos

-- | The number of points in the list must be equivalent to 1 mod 3; note
--   that this is not checked.
data Spline
Spline :: Maybe Point -> Maybe Point -> [Point] -> Spline
[endPoint] :: Spline -> Maybe Point
[startPoint] :: Spline -> Maybe Point
[splinePoints] :: Spline -> [Point]

-- | Either a Double or a (2D) Point (i.e. created with
--   createPoint).
--   
--   Whilst it is possible to create a Point value with either a
--   third co-ordinate or a forced position, these are ignored for
--   printing/parsing.
--   
--   An optional prefix of '+' is allowed when parsing.
data DPoint
DVal :: Double -> DPoint
PVal :: Point -> DPoint

-- | If set, normalizes coordinates such that the first point is at the
--   origin and the first edge is at the angle if specified.
data Normalized

-- | Equivalent to NormalizedAngle 0.
IsNormalized :: Normalized
NotNormalized :: Normalized

-- | Angle of first edge when normalized. Requires Graphviz >= 2.32.0.
NormalizedAngle :: Double -> Normalized

-- | The available Graphviz commands. The following directions are based
--   upon those in the Graphviz man page (available online at
--   http://graphviz.org/pdf/dot.1.pdf, or if installed on your
--   system man graphviz). Note that any command can be used on
--   both directed and undirected graphs.
--   
--   When used with the Layout attribute, it overrides any actual
--   command called on the dot graph.
data GraphvizCommand

-- | For hierachical graphs (ideal for directed graphs).
Dot :: GraphvizCommand

-- | For symmetric layouts of graphs (ideal for undirected graphs).
Neato :: GraphvizCommand

-- | For radial layout of graphs.
TwoPi :: GraphvizCommand

-- | For circular layout of graphs.
Circo :: GraphvizCommand

-- | Spring-model approach for undirected graphs.
Fdp :: GraphvizCommand

-- | As with Fdp, but ideal for large graphs.
Sfdp :: GraphvizCommand

-- | Filter for drawing clustered graphs, requires Graphviz >= 2.28.0.
Osage :: GraphvizCommand

-- | Draw clustered graphs as treemaps, requires Graphviz >= 2.28.0.
Patchwork :: GraphvizCommand

-- | Maximum width and height of drawing in inches.
data GraphSize
GSize :: Double -> Maybe Double -> Bool -> GraphSize
[width] :: GraphSize -> Double

-- | If Nothing, then the height is the same as the width.
[height] :: GraphSize -> Maybe Double

-- | If drawing is smaller than specified size, this value determines
--   whether it is scaled up.
[desiredSize] :: GraphSize -> Bool

-- | If Local, then sub-graphs that are clusters are given special
--   treatment. Global and NoCluster currently appear to be
--   identical and turn off the special cluster processing.
data ClusterMode
Local :: ClusterMode
Global :: ClusterMode
NoCluster :: ClusterMode
data Model
ShortPath :: Model
SubSet :: Model
Circuit :: Model
MDS :: Model

-- | How to deal with node overlaps.
--   
--   Defaults to KeepOverlaps except for Fdp and
--   Sfdp.
--   
--   The ability to specify the number of tries for Fdp's initial
--   force-directed technique is not supported (by default,
--   Fdp uses 9 passes of its in-built technique, and
--   then PrismOverlap Nothing).
--   
--   For Sfdp, the default is PrismOverlap (Just
--   0).
data Overlap
KeepOverlaps :: Overlap

-- | Remove overlaps by uniformly scaling in x and y.
ScaleOverlaps :: Overlap

-- | Remove overlaps by separately scaling x and y.
ScaleXYOverlaps :: Overlap

-- | Requires the Prism library to be available (if not, this is equivalent
--   to VoronoiOverlap). Nothing is equivalent to
--   Just 1000. Influenced by OverlapScaling.
PrismOverlap :: Maybe Word16 -> Overlap

-- | Requires Graphviz >= 2.30.0.
VoronoiOverlap :: Overlap

-- | Scale layout down as much as possible without introducing overlaps,
--   assuming none to begin with.
CompressOverlap :: Overlap

-- | Uses quadratic optimization to minimize node displacement.
VpscOverlap :: Overlap

-- | Only when mode == IpSep
IpsepOverlap :: Overlap

-- | Specify the root node either as a Node attribute or a Graph attribute.
data Root

-- | For Nodes only
IsCentral :: Root

-- | For Nodes only
NotCentral :: Root

-- | For Graphs only
NodeName :: Text -> Root
data Order

-- | Draw outgoing edges in order specified.
OutEdges :: Order

-- | Draw incoming edges in order specified.
InEdges :: Order
data OutputMode
BreadthFirst :: OutputMode
NodesFirst :: OutputMode
EdgesFirst :: OutputMode
data Pack
DoPack :: Pack
DontPack :: Pack

-- | If non-negative, then packs; otherwise doesn't.
PackMargin :: Int -> Pack
data PackMode
PackNode :: PackMode
PackClust :: PackMode
PackGraph :: PackMode

-- | Sort by cols, sort by user, number of rows/cols
PackArray :: Bool -> Bool -> Maybe Int -> PackMode

-- | Upper-case first character is major order; lower-case second character
--   is minor order.
data PageDir
Bl :: PageDir
Br :: PageDir
Tl :: PageDir
Tr :: PageDir
Rb :: PageDir
Rt :: PageDir
Lb :: PageDir
Lt :: PageDir
data QuadType
NormalQT :: QuadType
FastQT :: QuadType
NoQT :: QuadType
data RankType
SameRank :: RankType
MinRank :: RankType
SourceRank :: RankType
MaxRank :: RankType
SinkRank :: RankType
data RankDir
FromTop :: RankDir
FromLeft :: RankDir
FromBottom :: RankDir
FromRight :: RankDir
data StartType
StartStyle :: STStyle -> StartType
StartSeed :: Int -> StartType
StartStyleSeed :: STStyle -> Int -> StartType
data ViewPort
VP :: Double -> Double -> Double -> Maybe FocusType -> ViewPort
[wVal] :: ViewPort -> Double
[hVal] :: ViewPort -> Double
[zVal] :: ViewPort -> Double
[focus] :: ViewPort -> Maybe FocusType

-- | For use with ViewPort.
data FocusType
XY :: Point -> FocusType
NodeFocus :: Text -> FocusType
data Ratios
AspectRatio :: Double -> Ratios
FillRatio :: Ratios
CompressRatio :: Ratios
ExpandRatio :: Ratios
AutoRatio :: Ratios

-- | For Neato unless indicated otherwise.
data ModeType
Major :: ModeType
KK :: ModeType
Hier :: ModeType
IpSep :: ModeType

-- | For Sfdp, requires Graphviz >= 2.32.0.
SpringMode :: ModeType

-- | For Sfdp, requires Graphviz >= 2.32.0.
MaxEnt :: ModeType

-- | Only when mode == IpSep.
data DEConstraints
EdgeConstraints :: DEConstraints
NoConstraints :: DEConstraints
HierConstraints :: DEConstraints
newtype LayerSep
LSep :: Text -> LayerSep
newtype LayerListSep
LLSep :: Text -> LayerListSep
type LayerRange = [LayerRangeElem]
data LayerRangeElem
LRID :: LayerID -> LayerRangeElem
LRS :: LayerID -> LayerID -> LayerRangeElem

-- | You should not have any layer separator characters for the
--   LRName option, as they won't be parseable.
data LayerID
AllLayers :: LayerID
LRInt :: Int -> LayerID

-- | Should not be a number or "all".
LRName :: Text -> LayerID

-- | A list of layer names. The names should all be unique LRName
--   values, and when printed will use an arbitrary character from
--   defLayerSep. The values in the list are implicitly numbered
--   1, 2, ....
newtype LayerList
LL :: [LayerID] -> LayerList
data SmoothType
NoSmooth :: SmoothType
AvgDist :: SmoothType
GraphDist :: SmoothType
PowerDist :: SmoothType
RNG :: SmoothType
Spring :: SmoothType
TriangleSmooth :: SmoothType
data STStyle
RegularStyle :: STStyle
SelfStyle :: STStyle
RandomStyle :: STStyle

-- | An individual style item. Except for DD, the
--   [String] should be empty.
data StyleItem
SItem :: StyleName -> [Text] -> StyleItem
data StyleName

-- | Nodes and Edges
Dashed :: StyleName

-- | Nodes and Edges
Dotted :: StyleName

-- | Nodes and Edges
Solid :: StyleName

-- | Nodes and Edges
Bold :: StyleName

-- | Nodes and Edges
Invisible :: StyleName

-- | Nodes and Clusters
Filled :: StyleName

-- | Rectangularly-shaped Nodes and Clusters; requires Graphviz >=
--   2.30.0
Striped :: StyleName

-- | Elliptically-shaped Nodes only; requires Graphviz >= 2.30.0
Wedged :: StyleName

-- | Nodes only
Diagonals :: StyleName

-- | Nodes and Clusters
Rounded :: StyleName

-- | Edges only; requires Graphviz >= 2.29.0
Tapered :: StyleName

-- | Nodes, Clusters and Graphs, for use with GradientAngle;
--   requires Graphviz >= 2.29.0
Radial :: StyleName

-- | Device Dependent
DD :: Text -> StyleName
instance GHC.Classes.Eq Data.GraphViz.Attributes.Complete.Attribute
instance GHC.Classes.Ord Data.GraphViz.Attributes.Complete.Attribute
instance Data.GraphViz.Parsing.ParseDot Data.GraphViz.Attributes.Complete.Attribute
instance Data.GraphViz.Printing.PrintDot Data.GraphViz.Attributes.Complete.Attribute
instance GHC.Internal.Read.Read Data.GraphViz.Attributes.Complete.Attribute
instance GHC.Internal.Show.Show Data.GraphViz.Attributes.Complete.Attribute

-- | There are almost 150 possible attributes available for Dot graphs, and
--   it can be difficult to know which ones to use. This module provides
--   helper functions for the most commonly used ones.
--   
--   The complete list of all possible attributes can be found in
--   Data.GraphViz.Attributes.Complete; it is possible to use both
--   of these modules if you require specific extra attributes that are not
--   provided here.
module Data.GraphViz.Attributes

-- | Attributes are used to customise the layout and design of Dot graphs.
--   Care must be taken to ensure that the attribute you use is valid, as
--   not all attributes can be used everywhere.
data Attribute
type Attributes = [Attribute]

-- | Equivalent to Label . toLabelValue; the most
--   common label Attribute.
toLabel :: Labellable a => a -> Attribute

-- | An alias for toLabel for use with the
--   OverloadedStrings extension.
textLabel :: Text -> Attribute

-- | Create a label outside of a node/edge. Currently only in the
--   Graphviz development branch (2.29.*).
xLabel :: Labellable a => a -> Attribute

-- | An alias for xLabel for use with the OverloadedStrings
--   extension.
xTextLabel :: Text -> Attribute

-- | Force the positioning of xLabels, even when it will cause
--   overlaps.
forceLabels :: Attribute

-- | An alias for toLabelValue for use with the
--   OverloadedStrings extension.
textLabelValue :: Text -> Label

-- | A convenience class to make it easier to create labels. It is highly
--   recommended that you make any other types that you wish to create
--   labels from an instance of this class, preferably via the
--   String or Text instances.
class Labellable a

-- | This function only creates a Label value to enable you to use
--   it for Attributes such as HeadLabel, etc.
toLabelValue :: Labellable a => a -> Label

-- | The X11 colors that Graphviz uses. Note that these are slightly
--   different from the "normal" X11 colors used (e.g. the inclusion of
--   Crimson). Graphviz's list of colors also duplicated almost
--   all Gray colors with Grey ones; parsing of an
--   X11Color which is specified using "grey" will succeed, even for
--   those that don't have the duplicate spelling (e.g.
--   DarkSlateGray1).
data X11Color
AliceBlue :: X11Color
AntiqueWhite :: X11Color
AntiqueWhite1 :: X11Color
AntiqueWhite2 :: X11Color
AntiqueWhite3 :: X11Color
AntiqueWhite4 :: X11Color
Aquamarine :: X11Color
Aquamarine1 :: X11Color
Aquamarine2 :: X11Color
Aquamarine3 :: X11Color
Aquamarine4 :: X11Color
Azure :: X11Color
Azure1 :: X11Color
Azure2 :: X11Color
Azure3 :: X11Color
Azure4 :: X11Color
Beige :: X11Color
Bisque :: X11Color
Bisque1 :: X11Color
Bisque2 :: X11Color
Bisque3 :: X11Color
Bisque4 :: X11Color
Black :: X11Color
BlanchedAlmond :: X11Color
Blue :: X11Color
Blue1 :: X11Color
Blue2 :: X11Color
Blue3 :: X11Color
Blue4 :: X11Color
BlueViolet :: X11Color
Brown :: X11Color
Brown1 :: X11Color
Brown2 :: X11Color
Brown3 :: X11Color
Brown4 :: X11Color
Burlywood :: X11Color
Burlywood1 :: X11Color
Burlywood2 :: X11Color
Burlywood3 :: X11Color
Burlywood4 :: X11Color
CadetBlue :: X11Color
CadetBlue1 :: X11Color
CadetBlue2 :: X11Color
CadetBlue3 :: X11Color
CadetBlue4 :: X11Color
Chartreuse :: X11Color
Chartreuse1 :: X11Color
Chartreuse2 :: X11Color
Chartreuse3 :: X11Color
Chartreuse4 :: X11Color
Chocolate :: X11Color
Chocolate1 :: X11Color
Chocolate2 :: X11Color
Chocolate3 :: X11Color
Chocolate4 :: X11Color
Coral :: X11Color
Coral1 :: X11Color
Coral2 :: X11Color
Coral3 :: X11Color
Coral4 :: X11Color
CornFlowerBlue :: X11Color
CornSilk :: X11Color
CornSilk1 :: X11Color
CornSilk2 :: X11Color
CornSilk3 :: X11Color
CornSilk4 :: X11Color
Crimson :: X11Color
Cyan :: X11Color
Cyan1 :: X11Color
Cyan2 :: X11Color
Cyan3 :: X11Color
Cyan4 :: X11Color
DarkGoldenrod :: X11Color
DarkGoldenrod1 :: X11Color
DarkGoldenrod2 :: X11Color
DarkGoldenrod3 :: X11Color
DarkGoldenrod4 :: X11Color
DarkGreen :: X11Color
Darkkhaki :: X11Color
DarkOliveGreen :: X11Color
DarkOliveGreen1 :: X11Color
DarkOliveGreen2 :: X11Color
DarkOliveGreen3 :: X11Color
DarkOliveGreen4 :: X11Color
DarkOrange :: X11Color
DarkOrange1 :: X11Color
DarkOrange2 :: X11Color
DarkOrange3 :: X11Color
DarkOrange4 :: X11Color
DarkOrchid :: X11Color
DarkOrchid1 :: X11Color
DarkOrchid2 :: X11Color
DarkOrchid3 :: X11Color
DarkOrchid4 :: X11Color
DarkSalmon :: X11Color
DarkSeaGreen :: X11Color
DarkSeaGreen1 :: X11Color
DarkSeaGreen2 :: X11Color
DarkSeaGreen3 :: X11Color
DarkSeaGreen4 :: X11Color
DarkSlateBlue :: X11Color
DarkSlateGray :: X11Color
DarkSlateGray1 :: X11Color
DarkSlateGray2 :: X11Color
DarkSlateGray3 :: X11Color
DarkSlateGray4 :: X11Color
DarkTurquoise :: X11Color
DarkViolet :: X11Color
DeepPink :: X11Color
DeepPink1 :: X11Color
DeepPink2 :: X11Color
DeepPink3 :: X11Color
DeepPink4 :: X11Color
DeepSkyBlue :: X11Color
DeepSkyBlue1 :: X11Color
DeepSkyBlue2 :: X11Color
DeepSkyBlue3 :: X11Color
DeepSkyBlue4 :: X11Color
DimGray :: X11Color
DodgerBlue :: X11Color
DodgerBlue1 :: X11Color
DodgerBlue2 :: X11Color
DodgerBlue3 :: X11Color
DodgerBlue4 :: X11Color
Firebrick :: X11Color
Firebrick1 :: X11Color
Firebrick2 :: X11Color
Firebrick3 :: X11Color
Firebrick4 :: X11Color
FloralWhite :: X11Color
ForestGreen :: X11Color
Gainsboro :: X11Color
GhostWhite :: X11Color
Gold :: X11Color
Gold1 :: X11Color
Gold2 :: X11Color
Gold3 :: X11Color
Gold4 :: X11Color
Goldenrod :: X11Color
Goldenrod1 :: X11Color
Goldenrod2 :: X11Color
Goldenrod3 :: X11Color
Goldenrod4 :: X11Color
Gray :: X11Color
Gray0 :: X11Color
Gray1 :: X11Color
Gray2 :: X11Color
Gray3 :: X11Color
Gray4 :: X11Color
Gray5 :: X11Color
Gray6 :: X11Color
Gray7 :: X11Color
Gray8 :: X11Color
Gray9 :: X11Color
Gray10 :: X11Color
Gray11 :: X11Color
Gray12 :: X11Color
Gray13 :: X11Color
Gray14 :: X11Color
Gray15 :: X11Color
Gray16 :: X11Color
Gray17 :: X11Color
Gray18 :: X11Color
Gray19 :: X11Color
Gray20 :: X11Color
Gray21 :: X11Color
Gray22 :: X11Color
Gray23 :: X11Color
Gray24 :: X11Color
Gray25 :: X11Color
Gray26 :: X11Color
Gray27 :: X11Color
Gray28 :: X11Color
Gray29 :: X11Color
Gray30 :: X11Color
Gray31 :: X11Color
Gray32 :: X11Color
Gray33 :: X11Color
Gray34 :: X11Color
Gray35 :: X11Color
Gray36 :: X11Color
Gray37 :: X11Color
Gray38 :: X11Color
Gray39 :: X11Color
Gray40 :: X11Color
Gray41 :: X11Color
Gray42 :: X11Color
Gray43 :: X11Color
Gray44 :: X11Color
Gray45 :: X11Color
Gray46 :: X11Color
Gray47 :: X11Color
Gray48 :: X11Color
Gray49 :: X11Color
Gray50 :: X11Color
Gray51 :: X11Color
Gray52 :: X11Color
Gray53 :: X11Color
Gray54 :: X11Color
Gray55 :: X11Color
Gray56 :: X11Color
Gray57 :: X11Color
Gray58 :: X11Color
Gray59 :: X11Color
Gray60 :: X11Color
Gray61 :: X11Color
Gray62 :: X11Color
Gray63 :: X11Color
Gray64 :: X11Color
Gray65 :: X11Color
Gray66 :: X11Color
Gray67 :: X11Color
Gray68 :: X11Color
Gray69 :: X11Color
Gray70 :: X11Color
Gray71 :: X11Color
Gray72 :: X11Color
Gray73 :: X11Color
Gray74 :: X11Color
Gray75 :: X11Color
Gray76 :: X11Color
Gray77 :: X11Color
Gray78 :: X11Color
Gray79 :: X11Color
Gray80 :: X11Color
Gray81 :: X11Color
Gray82 :: X11Color
Gray83 :: X11Color
Gray84 :: X11Color
Gray85 :: X11Color
Gray86 :: X11Color
Gray87 :: X11Color
Gray88 :: X11Color
Gray89 :: X11Color
Gray90 :: X11Color
Gray91 :: X11Color
Gray92 :: X11Color
Gray93 :: X11Color
Gray94 :: X11Color
Gray95 :: X11Color
Gray96 :: X11Color
Gray97 :: X11Color
Gray98 :: X11Color
Gray99 :: X11Color
Gray100 :: X11Color
Green :: X11Color
Green1 :: X11Color
Green2 :: X11Color
Green3 :: X11Color
Green4 :: X11Color
GreenYellow :: X11Color
HoneyDew :: X11Color
HoneyDew1 :: X11Color
HoneyDew2 :: X11Color
HoneyDew3 :: X11Color
HoneyDew4 :: X11Color
HotPink :: X11Color
HotPink1 :: X11Color
HotPink2 :: X11Color
HotPink3 :: X11Color
HotPink4 :: X11Color
IndianRed :: X11Color
IndianRed1 :: X11Color
IndianRed2 :: X11Color
IndianRed3 :: X11Color
IndianRed4 :: X11Color
Indigo :: X11Color
Ivory :: X11Color
Ivory1 :: X11Color
Ivory2 :: X11Color
Ivory3 :: X11Color
Ivory4 :: X11Color
Khaki :: X11Color
Khaki1 :: X11Color
Khaki2 :: X11Color
Khaki3 :: X11Color
Khaki4 :: X11Color
Lavender :: X11Color
LavenderBlush :: X11Color
LavenderBlush1 :: X11Color
LavenderBlush2 :: X11Color
LavenderBlush3 :: X11Color
LavenderBlush4 :: X11Color
LawnGreen :: X11Color
LemonChiffon :: X11Color
LemonChiffon1 :: X11Color
LemonChiffon2 :: X11Color
LemonChiffon3 :: X11Color
LemonChiffon4 :: X11Color
LightBlue :: X11Color
LightBlue1 :: X11Color
LightBlue2 :: X11Color
LightBlue3 :: X11Color
LightBlue4 :: X11Color
LightCoral :: X11Color
LightCyan :: X11Color
LightCyan1 :: X11Color
LightCyan2 :: X11Color
LightCyan3 :: X11Color
LightCyan4 :: X11Color
LightGoldenrod :: X11Color
LightGoldenrod1 :: X11Color
LightGoldenrod2 :: X11Color
LightGoldenrod3 :: X11Color
LightGoldenrod4 :: X11Color
LightGoldenrodYellow :: X11Color
LightGray :: X11Color
LightPink :: X11Color
LightPink1 :: X11Color
LightPink2 :: X11Color
LightPink3 :: X11Color
LightPink4 :: X11Color
LightSalmon :: X11Color
LightSalmon1 :: X11Color
LightSalmon2 :: X11Color
LightSalmon3 :: X11Color
LightSalmon4 :: X11Color
LightSeaGreen :: X11Color
LightSkyBlue :: X11Color
LightSkyBlue1 :: X11Color
LightSkyBlue2 :: X11Color
LightSkyBlue3 :: X11Color
LightSkyBlue4 :: X11Color
LightSlateBlue :: X11Color
LightSlateGray :: X11Color
LightSteelBlue :: X11Color
LightSteelBlue1 :: X11Color
LightSteelBlue2 :: X11Color
LightSteelBlue3 :: X11Color
LightSteelBlue4 :: X11Color
LightYellow :: X11Color
LightYellow1 :: X11Color
LightYellow2 :: X11Color
LightYellow3 :: X11Color
LightYellow4 :: X11Color
LimeGreen :: X11Color
Linen :: X11Color
Magenta :: X11Color
Magenta1 :: X11Color
Magenta2 :: X11Color
Magenta3 :: X11Color
Magenta4 :: X11Color
Maroon :: X11Color
Maroon1 :: X11Color
Maroon2 :: X11Color
Maroon3 :: X11Color
Maroon4 :: X11Color
MediumAquamarine :: X11Color
MediumBlue :: X11Color
MediumOrchid :: X11Color
MediumOrchid1 :: X11Color
MediumOrchid2 :: X11Color
MediumOrchid3 :: X11Color
MediumOrchid4 :: X11Color
MediumPurple :: X11Color
MediumPurple1 :: X11Color
MediumPurple2 :: X11Color
MediumPurple3 :: X11Color
MediumPurple4 :: X11Color
MediumSeaGreen :: X11Color
MediumSlateBlue :: X11Color
MediumSpringGreen :: X11Color
MediumTurquoise :: X11Color
MediumVioletRed :: X11Color
MidnightBlue :: X11Color
MintCream :: X11Color
MistyRose :: X11Color
MistyRose1 :: X11Color
MistyRose2 :: X11Color
MistyRose3 :: X11Color
MistyRose4 :: X11Color
Moccasin :: X11Color
NavajoWhite :: X11Color
NavajoWhite1 :: X11Color
NavajoWhite2 :: X11Color
NavajoWhite3 :: X11Color
NavajoWhite4 :: X11Color
Navy :: X11Color
NavyBlue :: X11Color
OldLace :: X11Color
OliveDrab :: X11Color
OliveDrab1 :: X11Color
OliveDrab2 :: X11Color
OliveDrab3 :: X11Color
OliveDrab4 :: X11Color
Orange :: X11Color
Orange1 :: X11Color
Orange2 :: X11Color
Orange3 :: X11Color
Orange4 :: X11Color
OrangeRed :: X11Color
OrangeRed1 :: X11Color
OrangeRed2 :: X11Color
OrangeRed3 :: X11Color
OrangeRed4 :: X11Color
Orchid :: X11Color
Orchid1 :: X11Color
Orchid2 :: X11Color
Orchid3 :: X11Color
Orchid4 :: X11Color
PaleGoldenrod :: X11Color
PaleGreen :: X11Color
PaleGreen1 :: X11Color
PaleGreen2 :: X11Color
PaleGreen3 :: X11Color
PaleGreen4 :: X11Color
PaleTurquoise :: X11Color
PaleTurquoise1 :: X11Color
PaleTurquoise2 :: X11Color
PaleTurquoise3 :: X11Color
PaleTurquoise4 :: X11Color
PaleVioletRed :: X11Color
PaleVioletRed1 :: X11Color
PaleVioletRed2 :: X11Color
PaleVioletRed3 :: X11Color
PaleVioletRed4 :: X11Color
PapayaWhip :: X11Color
PeachPuff :: X11Color
PeachPuff1 :: X11Color
PeachPuff2 :: X11Color
PeachPuff3 :: X11Color
PeachPuff4 :: X11Color
Peru :: X11Color
Pink :: X11Color
Pink1 :: X11Color
Pink2 :: X11Color
Pink3 :: X11Color
Pink4 :: X11Color
Plum :: X11Color
Plum1 :: X11Color
Plum2 :: X11Color
Plum3 :: X11Color
Plum4 :: X11Color
PowderBlue :: X11Color
Purple :: X11Color
Purple1 :: X11Color
Purple2 :: X11Color
Purple3 :: X11Color
Purple4 :: X11Color
Red :: X11Color
Red1 :: X11Color
Red2 :: X11Color
Red3 :: X11Color
Red4 :: X11Color
RosyBrown :: X11Color
RosyBrown1 :: X11Color
RosyBrown2 :: X11Color
RosyBrown3 :: X11Color
RosyBrown4 :: X11Color
RoyalBlue :: X11Color
RoyalBlue1 :: X11Color
RoyalBlue2 :: X11Color
RoyalBlue3 :: X11Color
RoyalBlue4 :: X11Color
SaddleBrown :: X11Color
Salmon :: X11Color
Salmon1 :: X11Color
Salmon2 :: X11Color
Salmon3 :: X11Color
Salmon4 :: X11Color
SandyBrown :: X11Color
SeaGreen :: X11Color
SeaGreen1 :: X11Color
SeaGreen2 :: X11Color
SeaGreen3 :: X11Color
SeaGreen4 :: X11Color
SeaShell :: X11Color
SeaShell1 :: X11Color
SeaShell2 :: X11Color
SeaShell3 :: X11Color
SeaShell4 :: X11Color
Sienna :: X11Color
Sienna1 :: X11Color
Sienna2 :: X11Color
Sienna3 :: X11Color
Sienna4 :: X11Color
SkyBlue :: X11Color
SkyBlue1 :: X11Color
SkyBlue2 :: X11Color
SkyBlue3 :: X11Color
SkyBlue4 :: X11Color
SlateBlue :: X11Color
SlateBlue1 :: X11Color
SlateBlue2 :: X11Color
SlateBlue3 :: X11Color
SlateBlue4 :: X11Color
SlateGray :: X11Color
SlateGray1 :: X11Color
SlateGray2 :: X11Color
SlateGray3 :: X11Color
SlateGray4 :: X11Color
Snow :: X11Color
Snow1 :: X11Color
Snow2 :: X11Color
Snow3 :: X11Color
Snow4 :: X11Color
SpringGreen :: X11Color
SpringGreen1 :: X11Color
SpringGreen2 :: X11Color
SpringGreen3 :: X11Color
SpringGreen4 :: X11Color
SteelBlue :: X11Color
SteelBlue1 :: X11Color
SteelBlue2 :: X11Color
SteelBlue3 :: X11Color
SteelBlue4 :: X11Color
Tan :: X11Color
Tan1 :: X11Color
Tan2 :: X11Color
Tan3 :: X11Color
Tan4 :: X11Color
Thistle :: X11Color
Thistle1 :: X11Color
Thistle2 :: X11Color
Thistle3 :: X11Color
Thistle4 :: X11Color
Tomato :: X11Color
Tomato1 :: X11Color
Tomato2 :: X11Color
Tomato3 :: X11Color
Tomato4 :: X11Color

-- | Equivalent to setting Style [SItem Invisible []].
Transparent :: X11Color
Turquoise :: X11Color
Turquoise1 :: X11Color
Turquoise2 :: X11Color
Turquoise3 :: X11Color
Turquoise4 :: X11Color
Violet :: X11Color
VioletRed :: X11Color
VioletRed1 :: X11Color
VioletRed2 :: X11Color
VioletRed3 :: X11Color
VioletRed4 :: X11Color
Wheat :: X11Color
Wheat1 :: X11Color
Wheat2 :: X11Color
Wheat3 :: X11Color
Wheat4 :: X11Color
White :: X11Color
WhiteSmoke :: X11Color
Yellow :: X11Color
Yellow1 :: X11Color
Yellow2 :: X11Color
Yellow3 :: X11Color
Yellow4 :: X11Color
YellowGreen :: X11Color

-- | Specify the background color of a graph or cluster. For clusters, if
--   style filled is used, then fillColor
--   will override it.
bgColor :: NamedColor nc => nc -> Attribute

-- | As with bgColor, but add a second color to create a gradient
--   effect. Requires Graphviz >= 2.29.0.
bgColors :: NamedColor nc => nc -> nc -> Attribute

-- | Specify the fill color of a node, cluster or arrowhead. Requires
--   style filled for nodes and clusters. For nodes
--   and edges, if this isn't set then the color value is used
--   instead; for clusters, bgColor is used.
fillColor :: NamedColor nc => nc -> Attribute

-- | As with fillColor, but add a second color to create a gradient
--   effect. Requires Graphviz >= 2.29.0.
fillColors :: NamedColor nc => nc -> nc -> Attribute

-- | Specify the color of text.
fontColor :: NamedColor nc => nc -> Attribute

-- | Specify the color of the bounding box of a cluster.
penColor :: NamedColor nc => nc -> Attribute

-- | The color attribute serves several purposes. As such care
--   must be taken when using it, and it is preferable to use those
--   alternatives that are available when they exist.
--   
--   
--   
- The color of edges;
--   
- The bounding color of nodes;
--   
- The bounding color of clusters (i.e. equivalent to
--   penColor);
--   
- If the filled Style is set, then it defines the
--   background color of nodes and clusters unless fillColor or
--   bgColor respectively is set.
--   
color :: NamedColor nc => nc -> Attribute

-- | Specify the width of lines. Valid for clusters, nodes and edges.
penWidth :: Double -> Attribute

-- | Specify the angle at which gradient fills are drawn; for use with
--   bgColors and fillColors. Requires Graphviz >= 2.29.0.
gradientAngle :: Int -> Attribute
style :: Style -> Attribute
styles :: [Style] -> Attribute

-- | A particular style type to be used.
type Style = StyleItem

-- | Also available for edges.
dashed :: Style

-- | Also available for edges.
dotted :: Style

-- | Also available for edges.
solid :: Style

-- | Also available for edges.
bold :: Style

-- | Also available for edges.
invis :: Style

-- | Also available for clusters.
filled :: Style

-- | Only available for nodes.
diagonals :: Style

-- | Only available for rectangularly-shaped nodes and clusters. Requires
--   Graphviz >= 2.30.0.
striped :: Style

-- | Only available for elliptically-shaped nodes. Requires Graphviz >=
--   2.30.0.
wedged :: Style

-- | Also available for clusters.
rounded :: Style

-- | Only available for edges; creates a tapered edge between the two
--   nodes. Requires Graphviz >= 2.29.0.
tapered :: Style

-- | Available for nodes, clusters and edges. When using
--   gradientAngle, indicates that a radial gradient should be used.
--   Requires Graphviz >= 2.29.0.
radial :: Style

-- | The shape of a node.
shape :: Shape -> Attribute

-- | Geometries of shapes are affected by the attributes Regular,
--   Peripheries and Orientation.
data Shape

-- | Has synonyms of rect and rectangle.
BoxShape :: Shape

-- | Also affected by Sides, Skew and
--   Distortion.
Polygon :: Shape

-- | Has synonym of oval.
Ellipse :: Shape
Circle :: Shape

-- | Only affected by Peripheries, Width and
--   Height.
PointShape :: Shape
Egg :: Shape
Triangle :: Shape

-- | Has synonym of none. Recommended for HtmlLabels.
PlainText :: Shape
DiamondShape :: Shape
Trapezium :: Shape
Parallelogram :: Shape
House :: Shape
Pentagon :: Shape
Hexagon :: Shape
Septagon :: Shape
Octagon :: Shape
DoubleCircle :: Shape
DoubleOctagon :: Shape
TripleOctagon :: Shape
InvTriangle :: Shape
InvTrapezium :: Shape
InvHouse :: Shape
MDiamond :: Shape
MSquare :: Shape
MCircle :: Shape
Square :: Shape

-- | Requires Graphviz >= 2.32.0.
Star :: Shape

-- | Requires Graphviz >= 2.36.0.
Underline :: Shape
Note :: Shape
Tab :: Shape
Folder :: Shape
Box3D :: Shape
Component :: Shape

-- | Requires Graphviz >= 2.30.0.
Promoter :: Shape

-- | Requires Graphviz >= 2.30.0.
CDS :: Shape

-- | Requires Graphviz >= 2.30.0.
Terminator :: Shape

-- | Requires Graphviz >= 2.30.0.
UTR :: Shape

-- | Requires Graphviz >= 2.30.0.
PrimerSite :: Shape

-- | Requires Graphviz >= 2.30.0.
RestrictionSite :: Shape

-- | Requires Graphviz >= 2.30.0.
FivePovOverhang :: Shape

-- | Requires Graphviz >= 2.30.0.
ThreePovOverhang :: Shape

-- | Requires Graphviz >= 2.30.0.
NoOverhang :: Shape

-- | Requires Graphviz >= 2.30.0.
Assembly :: Shape

-- | Requires Graphviz >= 2.30.0.
Signature :: Shape

-- | Requires Graphviz >= 2.30.0.
Insulator :: Shape

-- | Requires Graphviz >= 2.30.0.
Ribosite :: Shape

-- | Requires Graphviz >= 2.30.0.
RNAStab :: Shape

-- | Requires Graphviz >= 2.30.0.
ProteaseSite :: Shape

-- | Requires Graphviz >= 2.30.0.
ProteinStab :: Shape

-- | Requires Graphviz >= 2.30.0.
RPromoter :: Shape

-- | Requires Graphviz >= 2.30.0.
RArrow :: Shape

-- | Requires Graphviz >= 2.30.0.
LArrow :: Shape

-- | Requires Graphviz >= 2.30.0.
LPromoter :: Shape

-- | Must specify the record shape with a Label.
Record :: Shape

-- | Must specify the record shape with a Label.
MRecord :: Shape

-- | How to draw the arrow at the node the edge is pointing to. For an
--   undirected graph, requires either edgeEnds
--   Forward or edgeEnds Both.
arrowTo :: Arrow -> Attribute

-- | How to draw the arrow at the node the edge is coming from. Requires
--   either edgeEnds Back or edgeEnds
--   Both.
arrowFrom :: Arrow -> Attribute

-- | Specify where to place arrows on an edge.
edgeEnds :: DirType -> Attribute

-- | Specify where to place arrow heads on an edge.
data DirType

-- | Draw a directed edge with an arrow to the node it's pointing go.
Forward :: DirType

-- | Draw a reverse directed edge with an arrow to the node it's coming
--   from.
Back :: DirType

-- | Draw arrows on both ends of the edge.
Both :: DirType

-- | Draw an undirected edge.
NoDir :: DirType

-- | A particular way of drawing the end of an edge.
type Arrow = ArrowType
box :: Arrow
crow :: Arrow
diamond :: Arrow
dotArrow :: Arrow
inv :: Arrow
noArrow :: Arrow
normal :: ArrowType
tee :: Arrow
vee :: Arrow
oDot :: Arrow
invDot :: Arrow
invODot :: Arrow
oBox :: Arrow
oDiamond :: Arrow

-- | Specify an ordering of edges of a node: either the outgoing or the
--   incoming edges of a node must appear left-to-right in the same order
--   in which they are defined in the input.
--   
--   When specified as both a global graph or sub-graph level attribute,
--   then it takes precedence over an attribute specified for an individual
--   node.
ordering :: Order -> Attribute
data Order

-- | Draw outgoing edges in order specified.
OutEdges :: Order

-- | Draw incoming edges in order specified.
InEdges :: Order

-- | When using dot, this allows you to control relative placement
--   of sub-graphs and clusters.
rank :: RankType -> Attribute
data RankType
SameRank :: RankType
MinRank :: RankType
SourceRank :: RankType
MaxRank :: RankType
SinkRank :: RankType
instance Data.GraphViz.Attributes.Labellable GHC.Types.Bool
instance Data.GraphViz.Attributes.Labellable GHC.Types.Char
instance Data.GraphViz.Attributes.Labellable GHC.Types.Double
instance Data.GraphViz.Attributes.Labellable GHC.Types.Int
instance Data.GraphViz.Attributes.Labellable Data.GraphViz.Attributes.HTML.Label
instance Data.GraphViz.Attributes.Labellable GHC.Internal.Base.String
instance Data.GraphViz.Attributes.Labellable Data.GraphViz.Attributes.HTML.Text
instance Data.GraphViz.Attributes.Labellable Data.GraphViz.Attributes.Values.RecordFields
instance Data.GraphViz.Attributes.Labellable Data.GraphViz.Attributes.Internal.PortName
instance Data.GraphViz.Attributes.Labellable Data.GraphViz.Attributes.Values.RecordField
instance Data.GraphViz.Attributes.Labellable Data.GraphViz.Attributes.HTML.Table
instance Data.GraphViz.Attributes.Labellable Data.Text.Internal.Text
instance Data.GraphViz.Attributes.Labellable Data.Text.Internal.Lazy.Text
instance Data.GraphViz.Attributes.Labellable (Data.GraphViz.Attributes.Internal.PortName, Data.GraphViz.Attributes.Values.EscString)

-- | A canonical Dot graph requires that within each graph/sub-graph, the
--   statements are in the following order:
--   
--   
--   
- global attributes
--   
- sub-graphs/clusters
--   
- nodes
--   
- edges
--   
--   
--   This Dot graph representation is ideally suited for converting other
--   data structures to Dot form (especially with the help of
--   graphElemsToDot from Data.GraphViz).
--   
--   If you require arbitrary ordering of statements, then use
--   Data.GraphViz.Types.Generalised.
--   
--   The sample graph could be implemented (this is actually the result of
--   calling canonicalise from Data.GraphViz.Algorithms on
--   the generalised one) as:
--   
--   
--   DotGraph { strictGraph = False
--            , directedGraph = True
--            , graphID = Just (Str "G")
--            , graphStatements = DotStmts { attrStmts = []
--                                         , subGraphs = [ DotSG { isCluster = True
--                                                               , subGraphID = Just (Num (Int 0))
--                                                               , subGraphStmts = DotStmts { attrStmts = [ GraphAttrs [ style filled
--                                                                                                                     , color LightGray
--                                                                                                                     , textLabel "process #1"]
--                                                                                                        , NodeAttrs [style filled, color White]]
--                                                                                          , subGraphs = []
--                                                                                          , nodeStmts = [ DotNode "a0" []
--                                                                                                        , DotNode "a1" []
--                                                                                                        , DotNode "a2" []
--                                                                                                        , DotNode "a3" []]
--                                                                                          , edgeStmts = [ DotEdge "a0" "a1" []
--                                                                                                        , DotEdge "a1" "a2" []
--                                                                                                        , DotEdge "a2" "a3" []
--                                                                                                        , DotEdge "a3" "a0" []]}}
--                                                       , DotSG { isCluster = True
--                                                               , subGraphID = Just (Num (Int 1))
--                                                               , subGraphStmts = DotStmts { attrStmts = [ GraphAttrs [textLabel "process #2", color Blue]
--                                                                                                        , NodeAttrs [style filled]]
--                                                                                          , subGraphs = []
--                                                                                          , nodeStmts = [ DotNode "b0" []
--                                                                                                        , DotNode "b1" []
--                                                                                                        , DotNode "b2" []
--                                                                                                        , DotNode "b3" []]
--                                                                                          , edgeStmts = [ DotEdge "b0" "b1" []
--                                                                                                        , DotEdge "b1" "b2" []
--                                                                                                        , DotEdge "b2" "b3" []]}}]
--                                         , nodeStmts = [ DotNode "end" [shape MSquare]
--                                                       , DotNode "start" [shape MDiamond]]
--                                         , edgeStmts = [ DotEdge "start" "a0" []
--                                                       , DotEdge "start" "b0" []
--                                                       , DotEdge "a1" "b3" []
--                                                       , DotEdge "b2" "a3" []
--                                                       , DotEdge "a3" "end" []
--                                                       , DotEdge "b3" "end" []]}}
--   
--   
--   Note that whilst the above graph represents the same Dot graph as
--   specified in Data.GraphViz.Types.Generalised, etc., it
--   may be drawn slightly differently by the various Graphviz
--   tools.
module Data.GraphViz.Types.Canonical

-- | A Dot graph in canonical form.
data DotGraph n
DotGraph :: Bool -> Bool -> Maybe GraphID -> DotStatements n -> DotGraph n

-- | If True, no multiple edges are drawn.
[strictGraph] :: DotGraph n -> Bool
[directedGraph] :: DotGraph n -> Bool
[graphID] :: DotGraph n -> Maybe GraphID
[graphStatements] :: DotGraph n -> DotStatements n
data DotStatements n
DotStmts :: [GlobalAttributes] -> [DotSubGraph n] -> [DotNode n] -> [DotEdge n] -> DotStatements n
[attrStmts] :: DotStatements n -> [GlobalAttributes]
[subGraphs] :: DotStatements n -> [DotSubGraph n]
[nodeStmts] :: DotStatements n -> [DotNode n]
[edgeStmts] :: DotStatements n -> [DotEdge n]
data DotSubGraph n
DotSG :: Bool -> Maybe GraphID -> DotStatements n -> DotSubGraph n
[isCluster] :: DotSubGraph n -> Bool
[subGraphID] :: DotSubGraph n -> Maybe GraphID
[subGraphStmts] :: DotSubGraph n -> DotStatements n

-- | A polymorphic type that covers all possible ID values allowed by Dot
--   syntax. Note that whilst the ParseDot and PrintDot
--   instances for String will properly take care of the special
--   cases for numbers, they are treated differently here.
data GraphID
Str :: Text -> GraphID
Num :: Number -> GraphID

-- | Represents a list of top-level list of Attributes for the
--   entire graph/sub-graph. Note that GraphAttrs also applies to
--   DotSubGraphs.
--   
--   Note that Dot allows a single Attribute to be listed on a line;
--   if this is the case then when parsing, the type of Attribute it
--   is determined and that type of GlobalAttribute is created.
data GlobalAttributes
GraphAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes
NodeAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes
EdgeAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes

-- | A node in DotGraph.
data DotNode n
DotNode :: n -> Attributes -> DotNode n
[nodeID] :: DotNode n -> n
[nodeAttributes] :: DotNode n -> Attributes

-- | An edge in DotGraph.
data DotEdge n
DotEdge :: n -> n -> Attributes -> DotEdge n
[fromNode] :: DotEdge n -> n
[toNode] :: DotEdge n -> n
[edgeAttributes] :: DotEdge n -> Attributes
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Canonical.DotGraph n)
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Canonical.DotStatements n)
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Canonical.DotSubGraph n)
instance GHC.Internal.Base.Functor Data.GraphViz.Types.Canonical.DotGraph
instance GHC.Internal.Base.Functor Data.GraphViz.Types.Canonical.DotStatements
instance GHC.Internal.Base.Functor Data.GraphViz.Types.Canonical.DotSubGraph
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Canonical.DotGraph n)
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Canonical.DotStatements n)
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Canonical.DotSubGraph n)
instance Data.GraphViz.Parsing.ParseDot n => Data.GraphViz.Parsing.ParseDot (Data.GraphViz.Types.Canonical.DotGraph n)
instance Data.GraphViz.Parsing.ParseDot n => Data.GraphViz.Parsing.ParseDot (Data.GraphViz.Types.Canonical.DotStatements n)
instance Data.GraphViz.Parsing.ParseDot n => Data.GraphViz.Parsing.ParseDot (Data.GraphViz.Types.Canonical.DotSubGraph n)
instance Data.GraphViz.Printing.PrintDot n => Data.GraphViz.Printing.PrintDot (Data.GraphViz.Types.Canonical.DotGraph n)
instance Data.GraphViz.Printing.PrintDot n => Data.GraphViz.Printing.PrintDot (Data.GraphViz.Types.Canonical.DotStatements n)
instance Data.GraphViz.Printing.PrintDot n => Data.GraphViz.Printing.PrintDot (Data.GraphViz.Types.Canonical.DotSubGraph n)
instance GHC.Internal.Read.Read n => GHC.Internal.Read.Read (Data.GraphViz.Types.Canonical.DotGraph n)
instance GHC.Internal.Read.Read n => GHC.Internal.Read.Read (Data.GraphViz.Types.Canonical.DotStatements n)
instance GHC.Internal.Read.Read n => GHC.Internal.Read.Read (Data.GraphViz.Types.Canonical.DotSubGraph n)
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Canonical.DotGraph n)
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Canonical.DotStatements n)
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Canonical.DotSubGraph n)

-- | Four different representations of Dot graphs are available, all of
--   which are based loosely upon the specifications at:
--   http://graphviz.org/doc/info/lang.html. The DotRepr
--   class provides a common interface for them (the PrintDotRepr,
--   ParseDotRepr and PPDotRepr classes are used until class
--   aliases are implemented).
--   
--   Every representation takes in a type parameter: this indicates the
--   node type (e.g. DotGraph Int is a Dot graph with integer
--   nodes). Sum types are allowed, though care must be taken when
--   specifying their ParseDot instances if there is the possibility
--   of overlapping definitions. The GraphID type is an existing sum
--   type that allows textual and numeric values.
--   
--   If you require using more than one Dot representation, you will most
--   likely need to import at least one of them qualified, as they
--   typically all use the same names.
--   
--   As a comparison, all four representations provide how you would define
--   the following Dot graph (or at least one isomorphic to it) (the
--   original of which can be found at
--   http://graphviz.org/content/cluster). Note that in all the
--   examples, they are not necessarily done the best way (variables rather
--   than repeated constants, etc.); they are just there to provide a
--   comparison on the structure of each representation.
--   
--   
--   digraph G {
--   
--     subgraph cluster_0 {
--       style=filled;
--       color=lightgrey;
--       node [style=filled,color=white];
--       a0 -> a1 -> a2 -> a3;
--       label = "process #1";
--     }
--   
--     subgraph cluster_1 {
--       node [style=filled];
--       b0 -> b1 -> b2 -> b3;
--       label = "process #2";
--       color=blue
--     }
--     start -> a0;
--     start -> b0;
--     a1 -> b3;
--     b2 -> a3;
--     a3 -> a0;
--     a3 -> end;
--     b3 -> end;
--   
--     start [shape=Mdiamond];
--     end [shape=Msquare];
--   }
--   
--   
--   Each representation is suited for different things:
--   
--   
--   
- Data.GraphViz.Types.Canonical is ideal for
--   converting other graph-like data structures into Dot graphs (the
--   Data.GraphViz module provides some functions for this). It is a
--   structured representation of Dot code.
--   
- Data.GraphViz.Types.Generalised matches the actual
--   structure of Dot code. As such, it is suited for parsing in existing
--   Dot code.
--   
- Data.GraphViz.Types.Graph provides graph operations
--   for manipulating Dot graphs; this is suited when you want to edit
--   existing Dot code. It uses generalised Dot graphs for parsing and
--   canonical Dot graphs for printing.
--   
- Data.GraphViz.Types.Monadic is a much easier
--   representation to use when defining relatively static Dot graphs in
--   Haskell code, and looks vaguely like actual Dot code if you squint a
--   bit.
--   
--   
--   Please also read the limitations section at the end for advice on how
--   to properly use these Dot representations.
module Data.GraphViz.Types

-- | This class is used to provide a common interface to different ways of
--   representing a graph in Dot form.
--   
--   You will most probably not need to create your own instances of
--   this class.
--   
--   The type variable represents the current node type of the Dot graph,
--   and the Ord restriction is there because in practice most
--   implementations of some of these methods require it.
class Ord n => DotRepr (dg :: Type -> Type) n

-- | Convert from a graph in canonical form. This is especially useful when
--   using the functions from Data.GraphViz.Algorithms.
--   
--   See FromGeneralisedDot in
--   Data.GraphViz.Types.Generalised for a semi-inverse of this
--   function.
fromCanonical :: DotRepr dg n => DotGraph n -> dg n

-- | Return the ID of the graph.
getID :: DotRepr dg n => dg n -> Maybe GraphID

-- | Set the ID of the graph.
setID :: DotRepr dg n => GraphID -> dg n -> dg n

-- | Is this graph directed?
graphIsDirected :: DotRepr dg n => dg n -> Bool

-- | Set whether a graph is directed or not.
setIsDirected :: DotRepr dg n => Bool -> dg n -> dg n

-- | Is this graph strict? Strict graphs disallow multiple edges.
graphIsStrict :: DotRepr dg n => dg n -> Bool

-- | A strict graph disallows multiple edges.
setStrictness :: DotRepr dg n => Bool -> dg n -> dg n

-- | Change the node values. This function is assumed to be
--   injective, otherwise the resulting graph will not be identical
--   to the original (modulo labels).
mapDotGraph :: (DotRepr dg n, DotRepr dg n') => (n -> n') -> dg n -> dg n'

-- | Return information on all the clusters contained within this
--   DotRepr, as well as the top-level GraphAttrs for the
--   overall graph.
graphStructureInformation :: DotRepr dg n => dg n -> (GlobalAttributes, ClusterLookup)

-- | Return information on the DotNodes contained within this
--   DotRepr. The Bool parameter indicates if applicable
--   NodeAttrs should be included.
nodeInformation :: DotRepr dg n => Bool -> dg n -> NodeLookup n

-- | Return information on the DotEdges contained within this
--   DotRepr. The Bool parameter indicates if applicable
--   EdgeAttrs should be included.
edgeInformation :: DotRepr dg n => Bool -> dg n -> [DotEdge n]

-- | Give any anonymous sub-graphs or clusters a unique identifier (i.e.
--   there will be no Nothing key in the ClusterLookup from
--   graphStructureInformation).
unAnonymise :: DotRepr dg n => dg n -> dg n

-- | A class used to correctly print parts of the Graphviz Dot language.
--   Minimal implementation is unqtDot.
class PrintDot a

-- | The unquoted representation, for use when composing values to produce
--   a larger printing value.
unqtDot :: PrintDot a => a -> DotCode

-- | The actual quoted representation; this should be quoted if it contains
--   characters not permitted a plain ID String, a number or it is not an
--   HTML string. Defaults to unqtDot.
toDot :: PrintDot a => a -> DotCode

-- | The correct way of representing a list of this value when printed; not
--   all Dot values require this to be implemented. Defaults to
--   Haskell-like list representation.
unqtListToDot :: PrintDot a => [a] -> DotCode

-- | The quoted form of unqtListToDot; defaults to wrapping double
--   quotes around the result of unqtListToDot (since the default
--   implementation has characters that must be quoted).
listToDot :: PrintDot a => [a] -> DotCode
class ParseDot a
parseUnqt :: ParseDot a => Parse a
parse :: ParseDot a => Parse a
parseUnqtList :: ParseDot a => Parse [a]
parseList :: ParseDot a => Parse [a]

-- | This class exists just to make type signatures nicer; all instances of
--   DotRepr should also be an instance of PrintDotRepr.
class (DotRepr dg n, PrintDot dg n) => PrintDotRepr (dg :: Type -> Type) n

-- | This class exists just to make type signatures nicer; all instances of
--   DotRepr should also be an instance of ParseDotRepr.
class (DotRepr dg n, ParseDot dg n) => ParseDotRepr (dg :: Type -> Type) n

-- | This class exists just to make type signatures nicer; all instances of
--   DotRepr should also be an instance of PPDotRepr.
class (PrintDotRepr dg n, ParseDotRepr dg n) => PPDotRepr (dg :: Type -> Type) n

-- | A polymorphic type that covers all possible ID values allowed by Dot
--   syntax. Note that whilst the ParseDot and PrintDot
--   instances for String will properly take care of the special
--   cases for numbers, they are treated differently here.
data GraphID
Str :: Text -> GraphID
Num :: Number -> GraphID

-- | A numeric type with an explicit separation between integers and
--   floating-point values.
data Number
Int :: Int -> Number
Dbl :: Double -> Number

-- | A convenience class to make it easier to convert data types to
--   GraphID values, e.g. for cluster identifiers.
--   
--   In most cases, conversion would be via the Text or
--   String instances (e.g. using show).
class ToGraphID a
toGraphID :: ToGraphID a => a -> GraphID

-- | An alias for toGraphID for use with the
--   OverloadedStrings extension.
textGraphID :: Text -> GraphID

-- | Represents a list of top-level list of Attributes for the
--   entire graph/sub-graph. Note that GraphAttrs also applies to
--   DotSubGraphs.
--   
--   Note that Dot allows a single Attribute to be listed on a line;
--   if this is the case then when parsing, the type of Attribute it
--   is determined and that type of GlobalAttribute is created.
data GlobalAttributes
GraphAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes
NodeAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes
EdgeAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes

-- | A node in DotGraph.
data DotNode n
DotNode :: n -> Attributes -> DotNode n
[nodeID] :: DotNode n -> n
[nodeAttributes] :: DotNode n -> Attributes

-- | An edge in DotGraph.
data DotEdge n
DotEdge :: n -> n -> Attributes -> DotEdge n
[fromNode] :: DotEdge n -> n
[toNode] :: DotEdge n -> n
[edgeAttributes] :: DotEdge n -> Attributes

-- | The available information for each cluster; the [Path]
--   denotes all locations where that particular cluster is located (more
--   than one location can indicate possible problems).
type ClusterLookup = Map Maybe GraphID ([Path], GlobalAttributes)

-- | The available information on each DotNode (both explicit and
--   implicit).
type NodeLookup n = Map n (Path, Attributes)

-- | The path of clusters that must be traversed to reach this spot.
type Path = Seq Maybe GraphID

-- | A variant of graphStructureInformation with default attributes
--   removed and only attributes usable by graph/cluster kept (where
--   applicable).
graphStructureInformationClean :: DotRepr dg n => dg n -> (GlobalAttributes, ClusterLookup)

-- | A variant of nodeInformation with default attributes removed
--   and only attributes used by nodes kept.
nodeInformationClean :: DotRepr dg n => Bool -> dg n -> NodeLookup n

-- | A variant of edgeInformation with default attributes removed
--   and only attributes used by edges kept.
edgeInformationClean :: DotRepr dg n => Bool -> dg n -> [DotEdge n]

-- | Returns all resultant DotNodes in the DotRepr (not
--   including NodeAttrs).
graphNodes :: DotRepr dg n => dg n -> [DotNode n]

-- | Returns all resultant DotEdges in the DotRepr (not
--   including EdgeAttrs).
graphEdges :: DotRepr dg n => dg n -> [DotEdge n]

-- | The actual Dot code for an instance of DotRepr. Note
--   that it is expected that parseDotGraph .
--   printDotGraph == id (this might not be true the
--   other way around due to un-parseable components).
printDotGraph :: PrintDotRepr dg n => dg n -> Text

-- | Parse a limited subset of the Dot language to form an instance of
--   DotRepr. Each instance may have its own limitations on what may
--   or may not be parseable Dot code.
--   
--   Also removes any comments, etc. before parsing.
parseDotGraph :: ParseDotRepr dg n => Text -> dg n

-- | As with parseDotGraph, but if an Attribute cannot be
--   parsed strictly according to the known rules, let it fall back to
--   being parsed as an UnknownAttribute. This is especially
--   useful for when using a version of Graphviz that is either newer
--   (especially for the XDot attributes) or older (when some attributes
--   have changed) but you'd still prefer it to parse rather than throwing
--   an error.
parseDotGraphLiberally :: ParseDotRepr dg n => Text -> dg n
instance GHC.Classes.Ord n => Data.GraphViz.Types.DotRepr Data.GraphViz.Types.Canonical.DotGraph n
instance (GHC.Classes.Ord n, Data.GraphViz.Printing.PrintDot n, Data.GraphViz.Parsing.ParseDot n) => Data.GraphViz.Types.PPDotRepr Data.GraphViz.Types.Canonical.DotGraph n
instance (GHC.Classes.Ord n, Data.GraphViz.Parsing.ParseDot n) => Data.GraphViz.Types.ParseDotRepr Data.GraphViz.Types.Canonical.DotGraph n
instance (GHC.Classes.Ord n, Data.GraphViz.Printing.PrintDot n) => Data.GraphViz.Types.PrintDotRepr Data.GraphViz.Types.Canonical.DotGraph n
instance Data.GraphViz.Types.ToGraphID GHC.Types.Char
instance Data.GraphViz.Types.ToGraphID GHC.Types.Double
instance Data.GraphViz.Types.ToGraphID GHC.Types.Int
instance Data.GraphViz.Types.ToGraphID GHC.Num.Integer.Integer
instance Data.GraphViz.Types.ToGraphID GHC.Internal.Base.String
instance Data.GraphViz.Types.ToGraphID Data.Text.Internal.Lazy.Text

-- | Various utility functions to help with custom I/O of Dot code.
module Data.GraphViz.Commands.IO

-- | Explicitly convert a (lazy) ByteString to a Text value
--   using UTF-8 encoding, throwing a GraphvizException if there is
--   a decoding error.
toUTF8 :: ByteString -> Text

-- | Write the specified DotRepr to file.
writeDotFile :: PrintDotRepr dg n => FilePath -> dg n -> IO ()

-- | Read in and parse a DotRepr value from a file.
readDotFile :: ParseDotRepr dg n => FilePath -> IO (dg n)

-- | Output the DotRepr to the specified Handle.
hPutDot :: PrintDotRepr dg n => Handle -> dg n -> IO ()

-- | Output the DotRepr to the spcified Handle in a more
--   compact, machine-oriented form.
hPutCompactDot :: PrintDotRepr dg n => Handle -> dg n -> IO ()

-- | Read in and parse a DotRepr value from the specified
--   Handle.
hGetDot :: ParseDotRepr dg n => Handle -> IO (dg n)

-- | Strictly read in a Text value using an appropriate encoding.
hGetStrict :: Handle -> IO Text

-- | Print the specified DotRepr to stdout.
putDot :: PrintDotRepr dg n => dg n -> IO ()

-- | Read in and parse a DotRepr value from stdin.
readDot :: ParseDotRepr dg n => IO (dg n)

-- | Run an external command on the specified DotRepr. Remember to
--   use hSetBinaryMode on the Handle for the output
--   function if necessary.
--   
--   If the command was unsuccessful, then a GraphvizException is
--   thrown.
--   
--   For performance reasons, a temporary file is used to store the
--   generated Dot code. As such, this is only suitable for local commands.
runCommand :: PrintDotRepr dg n => String -> [String] -> (Handle -> IO a) -> dg n -> IO a

-- | This module defines functions to call the various Graphviz commands.
--   
--   Whilst various output formats are supported (see GraphvizOutput
--   for a complete list), it is not yet possible to choose a desired
--   renderer and formatter. Being able to determine which renderers and
--   formatters are applicable for a specific GraphvizOutput is not
--   easy (there is no listing of available renderers or formatters on the
--   Graphviz website), and for the most part the default ones do the job
--   well.
--   
--   Please note that for GraphvizOutput and GraphvizCanvas,
--   you will see that they are instances of a GraphvizResult
--   class; this is an internal class that should not be visible outside
--   this module, but Haddock is being too helpful for its own good.
module Data.GraphViz.Commands

-- | The available Graphviz commands. The following directions are based
--   upon those in the Graphviz man page (available online at
--   http://graphviz.org/pdf/dot.1.pdf, or if installed on your
--   system man graphviz). Note that any command can be used on
--   both directed and undirected graphs.
--   
--   When used with the Layout attribute, it overrides any actual
--   command called on the dot graph.
data GraphvizCommand

-- | For hierachical graphs (ideal for directed graphs).
Dot :: GraphvizCommand

-- | For symmetric layouts of graphs (ideal for undirected graphs).
Neato :: GraphvizCommand

-- | For radial layout of graphs.
TwoPi :: GraphvizCommand

-- | For circular layout of graphs.
Circo :: GraphvizCommand

-- | Spring-model approach for undirected graphs.
Fdp :: GraphvizCommand

-- | As with Fdp, but ideal for large graphs.
Sfdp :: GraphvizCommand

-- | Filter for drawing clustered graphs, requires Graphviz >= 2.28.0.
Osage :: GraphvizCommand

-- | Draw clustered graphs as treemaps, requires Graphviz >= 2.28.0.
Patchwork :: GraphvizCommand

-- | The default command for directed graphs.
dirCommand :: GraphvizCommand

-- | The default command for undirected graphs.
undirCommand :: GraphvizCommand

-- | The appropriate (default) Graphviz command for the given graph.
commandFor :: DotRepr dg n => dg n -> GraphvizCommand

-- | The possible Graphviz output formats (that is, those that actually
--   produce a file).
data GraphvizOutput

-- | Windows Bitmap Format.
Bmp :: GraphvizOutput

-- | Pretty-printed Dot output with no layout performed.
Canon :: GraphvizOutput

-- | Reproduces the input along with layout information.
DotOutput :: GraphvizOutput

-- | As with DotOutput, but provides even more information on how
--   the graph is drawn. The optional Version is the same as
--   specifying the XDotVersion attribute.
XDot :: Maybe Version -> GraphvizOutput

-- | Encapsulated PostScript.
Eps :: GraphvizOutput

-- | FIG graphics language.
Fig :: GraphvizOutput

-- | Internal GD library format.
Gd :: GraphvizOutput

-- | Compressed version of Gd.
Gd2 :: GraphvizOutput

-- | Graphics Interchange Format.
Gif :: GraphvizOutput

-- | Icon image file format.
Ico :: GraphvizOutput

-- | Server-side imagemap.
Imap :: GraphvizOutput

-- | Client-side imagemap.
Cmapx :: GraphvizOutput

-- | As for Imap, except only rectangles are used as active areas.
ImapNP :: GraphvizOutput

-- | As for Cmapx, except only rectangles are used as active areas.
CmapxNP :: GraphvizOutput

-- | The JPEG image format.
Jpeg :: GraphvizOutput

-- | Portable Document Format.
Pdf :: GraphvizOutput

-- | Simple text format.
Plain :: GraphvizOutput

-- | As for Plain, but provides port names on head and tail nodes
--   when applicable.
PlainExt :: GraphvizOutput

-- | Portable Network Graphics format.
Png :: GraphvizOutput

-- | PostScript.
Ps :: GraphvizOutput

-- | PostScript for PDF.
Ps2 :: GraphvizOutput

-- | Scalable Vector Graphics format.
Svg :: GraphvizOutput

-- | Compressed SVG format.
SvgZ :: GraphvizOutput

-- | Tagged Image File Format.
Tiff :: GraphvizOutput

-- | Vector Markup Language; Svg is usually preferred.
Vml :: GraphvizOutput

-- | Compressed VML format; SvgZ is usually preferred.
VmlZ :: GraphvizOutput

-- | Virtual Reality Modeling Language format; requires nodes to have a
--   third dimension set via the Pos attribute (and with a
--   Dim value of at least 3).
Vrml :: GraphvizOutput

-- | Wireless BitMap format; monochrome format usually used for mobile
--   computing devices.
WBmp :: GraphvizOutput

-- | Google's WebP format; requires Graphviz >= 2.29.0.
WebP :: GraphvizOutput

-- | Unlike GraphvizOutput, these items do not produce an output
--   file; instead, they directly draw a canvas (i.e. a window) with the
--   resulting image.
data GraphvizCanvas
Gtk :: GraphvizCanvas
Xlib :: GraphvizCanvas

-- | Run the recommended Graphviz command on this graph, saving the result
--   to the file provided (note: file extensions are not checked).
runGraphviz :: PrintDotRepr dg n => dg n -> GraphvizOutput -> FilePath -> IO FilePath

-- | Run the chosen Graphviz command on this graph, saving the result to
--   the file provided (note: file extensions are not checked).
runGraphvizCommand :: PrintDotRepr dg n => GraphvizCommand -> dg n -> GraphvizOutput -> FilePath -> IO FilePath

-- | Append the default extension for the provided GraphvizOutput to
--   the provided FilePath for the output file.
addExtension :: (GraphvizOutput -> FilePath -> a) -> GraphvizOutput -> FilePath -> a

-- | Run the chosen Graphviz command on this graph and render it using the
--   given canvas type.
runGraphvizCanvas :: PrintDotRepr dg n => GraphvizCommand -> dg n -> GraphvizCanvas -> IO ()

-- | Run the recommended Graphviz command on this graph and render it using
--   the given canvas type.
runGraphvizCanvas' :: PrintDotRepr dg n => dg n -> GraphvizCanvas -> IO ()

-- | Run the chosen Graphviz command on this graph, but send the result to
--   the given handle rather than to a file.
--   
--   Note that the Handle -> IO a function
--   must fully consume the input from the Handle; e.g. use
--   strict ByteStrings rather than lazy ones.
--   
--   If the command was unsuccessful, then a GraphvizException is
--   thrown.
graphvizWithHandle :: PrintDotRepr dg n => GraphvizCommand -> dg n -> GraphvizOutput -> (Handle -> IO a) -> IO a

-- | Is the Graphviz suite of tools installed? This is determined by
--   whether dot is available in the PATH.
isGraphvizInstalled :: IO Bool

-- | If Graphviz does not seem to be available, print the provided error
--   message and then exit fatally.
quitWithoutGraphviz :: String -> IO ()
instance GHC.Internal.Enum.Bounded Data.GraphViz.Commands.GraphvizCanvas
instance GHC.Internal.Enum.Enum Data.GraphViz.Commands.GraphvizCanvas
instance GHC.Classes.Eq Data.GraphViz.Commands.GraphvizCanvas
instance GHC.Classes.Eq Data.GraphViz.Commands.GraphvizOutput
instance Data.GraphViz.Commands.GraphvizResult Data.GraphViz.Commands.GraphvizCanvas
instance Data.GraphViz.Commands.GraphvizResult Data.GraphViz.Commands.GraphvizOutput
instance GHC.Classes.Ord Data.GraphViz.Commands.GraphvizCanvas
instance GHC.Classes.Ord Data.GraphViz.Commands.GraphvizOutput
instance GHC.Internal.Read.Read Data.GraphViz.Commands.GraphvizCanvas
instance GHC.Internal.Read.Read Data.GraphViz.Commands.GraphvizOutput
instance GHC.Internal.Show.Show Data.GraphViz.Commands.GraphvizCanvas
instance GHC.Internal.Show.Show Data.GraphViz.Commands.GraphvizOutput

-- | Defines various algorithms for use on DotRepr graphs. These are
--   typically re-implementations of behaviour found in existing Graphviz
--   tools but without the I/O requirement.
--   
--   Note that one way that these algorithms differ from those found in
--   Graphviz is that the order of clusters is not maintained, which
--   may affect layout in some cases.
module Data.GraphViz.Algorithms
data CanonicaliseOptions
COpts :: Bool -> Bool -> CanonicaliseOptions

-- | Place edges in the clusters where their nodes are rather than in the
--   top-level graph.
[edgesInClusters] :: CanonicaliseOptions -> Bool

-- | Put common Attributes as top-level GlobalAttributes.
[groupAttributes] :: CanonicaliseOptions -> Bool
defaultCanonOptions :: CanonicaliseOptions

-- | Options that are more like how dot -Tcanon works.
dotLikeOptions :: CanonicaliseOptions

-- | Canonicalise with some sensible defaults.
canonicalise :: DotRepr dg n => dg n -> DotGraph n

-- | As with canonicalise, but allow custom
--   CanonicaliseOptions.
canonicaliseOptions :: DotRepr dg n => CanonicaliseOptions -> dg n -> DotGraph n
transitiveReduction :: DotRepr dg n => dg n -> DotGraph n
transitiveReductionOptions :: DotRepr dg n => CanonicaliseOptions -> dg n -> DotGraph n
instance GHC.Classes.Eq Data.GraphViz.Algorithms.CanonicaliseOptions
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Algorithms.TaggedValues n)
instance GHC.Classes.Ord Data.GraphViz.Algorithms.CanonicaliseOptions
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Algorithms.TaggedValues n)
instance GHC.Internal.Read.Read Data.GraphViz.Algorithms.CanonicaliseOptions
instance GHC.Internal.Read.Read n => GHC.Internal.Read.Read (Data.GraphViz.Algorithms.TaggedValues n)
instance GHC.Internal.Show.Show Data.GraphViz.Algorithms.CanonicaliseOptions
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Algorithms.TaggedValues n)

-- | The generalised Dot representation most closely matches the
--   implementation of actual Dot code, as it places no restrictions on
--   ordering of elements, etc. As such it should be able to parse any
--   existing Dot code (taking into account the parsing
--   limitations/assumptions).
--   
--   The sample graph could be implemented (this is actually a prettied
--   version of parsing in the Dot code) as:
--   
--   
--   DotGraph { strictGraph = False
--            , directedGraph = True
--            , graphID = Just (Str "G")
--            , graphStatements = Seq.fromList [ SG $ DotSG { isCluster = True
--                                                          , subGraphID = Just (Int 0)
--                                                          , subGraphStmts = Seq.fromList [ GA $ GraphAttrs [style filled]
--                                                                                         , GA $ GraphAttrs [color LightGray]
--                                                                                         , GA $ NodeAttrs [style filled, color White]
--                                                                                         , DE $ DotEdge "a0" "a1" []
--                                                                                         , DE $ DotEdge "a1" "a2" []
--                                                                                         , DE $ DotEdge "a2" "a3" []
--                                                                                         , GA $ GraphAttrs [textLabel "process #1"]]}
--                                             , SG $ DotSG { isCluster = True
--                                                          , subGraphID = Just (Int 1)
--                                                          , subGraphStmts = fromList [ GA $ NodeAttrs [style filled]
--                                                                                     , DE $ DotEdge "b0" "b1" []
--                                                                                     , DE $ DotEdge "b1" "b2" []
--                                                                                     , DE $ DotEdge "b2" "b3" []
--                                                                                     , GA $ GraphAttrs [textLabel "process #2"]
--                                                                                     , GA $ GraphAttrs [color Blue]]}
--                                             , DE $ DotEdge "start" "a0" []
--                                             , DE $ DotEdge "start" "b0" []
--                                             , DE $ DotEdge "a1" "b3" []
--                                             , DE $ DotEdge "b2" "a3" []
--                                             , DE $ DotEdge "a3" "a0" []
--                                             , DE $ DotEdge "a3" "end" []
--                                             , DE $ DotEdge "b3" "end" []
--                                             , DN $ DotNode "start" [shape MDiamond]
--                                             , DN $ DotNode "end" [shape MSquare]]}
--   
module Data.GraphViz.Types.Generalised

-- | The internal representation of a generalised graph in Dot form.
data DotGraph n
DotGraph :: Bool -> Bool -> Maybe GraphID -> DotStatements n -> DotGraph n

-- | If True, no multiple edges are drawn.
[strictGraph] :: DotGraph n -> Bool
[directedGraph] :: DotGraph n -> Bool
[graphID] :: DotGraph n -> Maybe GraphID
[graphStatements] :: DotGraph n -> DotStatements n

-- | This class is useful for being able to parse in a dot graph as a
--   generalised one, and then convert it to your preferred representation.
--   
--   This can be seen as a semi-inverse of fromCanonical.
class DotRepr dg n => FromGeneralisedDot (dg :: Type -> Type) n
fromGeneralised :: FromGeneralisedDot dg n => DotGraph n -> dg n
type DotStatements n = Seq DotStatement n
data DotStatement n
GA :: GlobalAttributes -> DotStatement n
SG :: DotSubGraph n -> DotStatement n
DN :: DotNode n -> DotStatement n
DE :: DotEdge n -> DotStatement n
data DotSubGraph n
DotSG :: Bool -> Maybe GraphID -> DotStatements n -> DotSubGraph n
[isCluster] :: DotSubGraph n -> Bool
[subGraphID] :: DotSubGraph n -> Maybe GraphID
[subGraphStmts] :: DotSubGraph n -> DotStatements n

-- | A polymorphic type that covers all possible ID values allowed by Dot
--   syntax. Note that whilst the ParseDot and PrintDot
--   instances for String will properly take care of the special
--   cases for numbers, they are treated differently here.
data GraphID
Str :: Text -> GraphID
Num :: Number -> GraphID

-- | Represents a list of top-level list of Attributes for the
--   entire graph/sub-graph. Note that GraphAttrs also applies to
--   DotSubGraphs.
--   
--   Note that Dot allows a single Attribute to be listed on a line;
--   if this is the case then when parsing, the type of Attribute it
--   is determined and that type of GlobalAttribute is created.
data GlobalAttributes
GraphAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes
NodeAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes
EdgeAttrs :: Attributes -> GlobalAttributes
[attrs] :: GlobalAttributes -> Attributes

-- | A node in DotGraph.
data DotNode n
DotNode :: n -> Attributes -> DotNode n
[nodeID] :: DotNode n -> n
[nodeAttributes] :: DotNode n -> Attributes

-- | An edge in DotGraph.
data DotEdge n
DotEdge :: n -> n -> Attributes -> DotEdge n
[fromNode] :: DotEdge n -> n
[toNode] :: DotEdge n -> n
[edgeAttributes] :: DotEdge n -> Attributes
instance GHC.Classes.Ord n => Data.GraphViz.Types.DotRepr Data.GraphViz.Types.Generalised.DotGraph n
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Generalised.DotGraph n)
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Generalised.DotStatement n)
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Generalised.DotSubGraph n)
instance GHC.Classes.Ord n => Data.GraphViz.Types.Generalised.FromGeneralisedDot Data.GraphViz.Types.Generalised.DotGraph n
instance GHC.Classes.Ord n => Data.GraphViz.Types.Generalised.FromGeneralisedDot Data.GraphViz.Types.Canonical.DotGraph n
instance GHC.Internal.Base.Functor Data.GraphViz.Types.Generalised.DotGraph
instance GHC.Internal.Base.Functor Data.GraphViz.Types.Generalised.DotStatement
instance GHC.Internal.Base.Functor Data.GraphViz.Types.Generalised.DotSubGraph
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Generalised.DotGraph n)
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Generalised.DotStatement n)
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Generalised.DotSubGraph n)
instance (GHC.Classes.Ord n, Data.GraphViz.Printing.PrintDot n, Data.GraphViz.Parsing.ParseDot n) => Data.GraphViz.Types.PPDotRepr Data.GraphViz.Types.Generalised.DotGraph n
instance Data.GraphViz.Parsing.ParseDot n => Data.GraphViz.Parsing.ParseDot (Data.GraphViz.Types.Generalised.DotGraph n)
instance Data.GraphViz.Parsing.ParseDot n => Data.GraphViz.Parsing.ParseDot (Data.GraphViz.Types.Generalised.DotStatement n)
instance Data.GraphViz.Parsing.ParseDot n => Data.GraphViz.Parsing.ParseDot (Data.GraphViz.Types.Generalised.DotSubGraph n)
instance (GHC.Classes.Ord n, Data.GraphViz.Parsing.ParseDot n) => Data.GraphViz.Types.ParseDotRepr Data.GraphViz.Types.Generalised.DotGraph n
instance Data.GraphViz.Printing.PrintDot n => Data.GraphViz.Printing.PrintDot (Data.GraphViz.Types.Generalised.DotGraph n)
instance Data.GraphViz.Printing.PrintDot n => Data.GraphViz.Printing.PrintDot (Data.GraphViz.Types.Generalised.DotStatement n)
instance Data.GraphViz.Printing.PrintDot n => Data.GraphViz.Printing.PrintDot (Data.GraphViz.Types.Generalised.DotSubGraph n)
instance (GHC.Classes.Ord n, Data.GraphViz.Printing.PrintDot n) => Data.GraphViz.Types.PrintDotRepr Data.GraphViz.Types.Generalised.DotGraph n
instance GHC.Internal.Read.Read n => GHC.Internal.Read.Read (Data.GraphViz.Types.Generalised.DotGraph n)
instance GHC.Internal.Read.Read n => GHC.Internal.Read.Read (Data.GraphViz.Types.Generalised.DotStatement n)
instance GHC.Internal.Read.Read n => GHC.Internal.Read.Read (Data.GraphViz.Types.Generalised.DotSubGraph n)
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Generalised.DotGraph n)
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Generalised.DotStatement n)
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Generalised.DotSubGraph n)

-- | This module is based upon the dotgen library by Andy Gill:
--   http://hackage.haskell.org/package/dotgen
--   
--   It provides a monadic interface for constructing generalised Dot
--   graphs. Note that this does not have an instance for
--   DotRepr (e.g. what would be the point of the
--   fromCanonical function, as you can't do anything with the
--   result): it is purely for construction purposes. Use the generalised
--   Dot graph instance for printing, etc.
--   
--   Note that the generalised Dot graph types are not re-exported,
--   in case it causes a clash with other modules you may choose to import.
--   
--   The example graph in Data.GraphViz.Types can be written as:
--   
--   
--   digraph (Str "G") $ do
--   
--      cluster (Int 0) $ do
--          graphAttrs [style filled, color LightGray]
--          nodeAttrs [style filled, color White]
--          "a0" --> "a1"
--          "a1" --> "a2"
--          "a2" --> "a3"
--          graphAttrs [textLabel "process #1"]
--   
--      cluster (Int 1) $ do
--          nodeAttrs [style filled]
--          "b0" --> "b1"
--          "b1" --> "b2"
--          "b2" --> "b3"
--          graphAttrs [textLabel "process #2", color Blue]
--   
--      "start" --> "a0"
--      "start" --> "b0"
--      "a1" --> "b3"
--      "b2" --> "a3"
--      "a3" --> "end"
--      "b3" --> "end"
--   
--      node "start" [shape MDiamond]
--      node "end" [shape MSquare]
--   
module Data.GraphViz.Types.Monadic

-- | The monadic representation of a Dot graph.
type Dot n = DotM n ()

-- | The actual monad; as with Dot but allows you to return a value
--   within the do-block. The actual implementation is based upon the
--   Writer monad.
data DotM n a

-- | A polymorphic type that covers all possible ID values allowed by Dot
--   syntax. Note that whilst the ParseDot and PrintDot
--   instances for String will properly take care of the special
--   cases for numbers, they are treated differently here.
data GraphID
Str :: Text -> GraphID
Num :: Number -> GraphID

-- | Create a directed dot graph with the specified graph ID.
digraph :: GraphID -> DotM n a -> DotGraph n

-- | Create a directed dot graph with no graph ID.
digraph' :: DotM n a -> DotGraph n

-- | Create a undirected dot graph with the specified graph ID.
graph :: GraphID -> DotM n a -> DotGraph n

-- | Create a undirected dot graph with no graph ID.
graph' :: DotM n a -> DotGraph n

-- | Add graph/sub-graph/cluster attributes.
graphAttrs :: Attributes -> Dot n

-- | Add global node attributes.
nodeAttrs :: Attributes -> Dot n

-- | Add global edge attributes
edgeAttrs :: Attributes -> Dot n

-- | Add a named subgraph to the graph.
subgraph :: GraphID -> DotM n a -> Dot n

-- | Add an anonymous subgraph to the graph.
--   
--   It is highly recommended you use subgraph instead.
anonSubgraph :: DotM n a -> Dot n

-- | Add a named cluster to the graph.
cluster :: GraphID -> DotM n a -> Dot n

-- | Add a node to the graph.
node :: n -> Attributes -> Dot n

-- | Add a node with no attributes to the graph.
node' :: n -> Dot n

-- | Add an edge to the graph.
edge :: n -> n -> Attributes -> Dot n

-- | Add an edge with no attributes.
(-->) :: n -> n -> Dot n
infixr 9 -->

-- | An alias for --> to make edges look more undirected.
(<->) :: n -> n -> Dot n
infixr 9 <->
instance GHC.Internal.Base.Applicative (Data.GraphViz.Types.Monadic.DotM n)
instance GHC.Internal.Base.Functor (Data.GraphViz.Types.Monadic.DotM n)
instance GHC.Internal.Base.Monad (Data.GraphViz.Types.Monadic.DotM n)
instance GHC.Internal.Control.Monad.Fix.MonadFix (Data.GraphViz.Types.Monadic.DotM n)
instance GHC.Internal.Base.Monoid a => GHC.Internal.Base.Monoid (Data.GraphViz.Types.Monadic.DotM n a)
instance GHC.Internal.Base.Semigroup a => GHC.Internal.Base.Semigroup (Data.GraphViz.Types.Monadic.DotM n a)

-- | It is sometimes useful to be able to manipulate a Dot graph as
--   an actual graph. This representation lets you do so, using an
--   inductive approach based upon that from FGL (note that DotGraph
--   is not an instance of the FGL classes due to having the wrong
--   kind). Note, however, that the API is not as complete as proper graph
--   implementations.
--   
--   For purposes of manipulation, all edges are found in the root graph
--   and not in a cluster; as such, having EdgeAttrs in a cluster's
--   GlobalAttributes is redundant.
--   
--   Printing is achieved via Data.GraphViz.Types.Canonical (using
--   toCanonical) and parsing via
--   Data.GraphViz.Types.Generalised (so any piece of Dot
--   code can be parsed in).
--   
--   This representation doesn't allow non-cluster sub-graphs. Also, all
--   clusters must have a unique identifier. For those functions
--   (with the exception of DotRepr methods) that take or return a
--   "Maybe GraphID", a value of "Nothing" refers to the
--   root graph; "Just clust" refers to the cluster with the
--   identifier "clust".
--   
--   You would not typically explicitly create these values, instead
--   converting existing Dot graphs (via fromDotRepr). However, one
--   way of constructing the sample graph would be:
--   
--   
--   setID (Str "G")
--   . setStrictness False
--   . setIsDirected True
--   . setClusterAttributes (Int 0) [GraphAttrs [style filled, color LightGray, textLabel "process #1"], NodeAttrs [style filled, color White]]
--   . setClusterAttributes (Int 1) [GraphAttrs [textLabel "process #2", color Blue], NodeAttrs [style filled]]
--   $ composeList [ Cntxt "a0"    (Just $ Int 0)   []               [("a3",[]),("start",[])] [("a1",[])]
--                 , Cntxt "a1"    (Just $ Int 0)   []               []                       [("a2",[]),("b3",[])]
--                 , Cntxt "a2"    (Just $ Int 0)   []               []                       [("a3",[])]
--                 , Cntxt "a3"    (Just $ Int 0)   []               [("b2",[])]              [("end",[])]
--                 , Cntxt "b0"    (Just $ Int 1)   []               [("start",[])]           [("b1",[])]
--                 , Cntxt "b1"    (Just $ Int 1)   []               []                       [("b2",[])]
--                 , Cntxt "b2"    (Just $ Int 1)   []               []                       [("b3",[])]
--                 , Cntxt "b3"    (Just $ Int 1)   []               []                       [("end",[])]
--                 , Cntxt "end"   Nothing          [shape MSquare]  []                       []
--                 , Cntxt "start" Nothing          [shape MDiamond] []                       []]
--   
module Data.GraphViz.Types.Graph

-- | A Dot graph that allows graph operations on it.
data DotGraph n

-- | A polymorphic type that covers all possible ID values allowed by Dot
--   syntax. Note that whilst the ParseDot and PrintDot
--   instances for String will properly take care of the special
--   cases for numbers, they are treated differently here.
data GraphID
Str :: Text -> GraphID
Num :: Number -> GraphID

-- | The decomposition of a node from a dot graph. Any loops should be
--   found in successors rather than predecessors. Note also
--   that these are created/consumed as if for directed graphs.
data Context n
Cntxt :: !n -> !Maybe GraphID -> !Attributes -> ![(n, Attributes)] -> ![(n, Attributes)] -> Context n
[node] :: Context n -> !n

-- | The cluster this node can be found in; Nothing indicates the
--   node can be found in the root graph.
[inCluster] :: Context n -> !Maybe GraphID
[attributes] :: Context n -> !Attributes
[predecessors] :: Context n -> ![(n, Attributes)]
[successors] :: Context n -> ![(n, Attributes)]

-- | Convert this DotGraph into canonical form. All edges are found in the
--   outer graph rather than in clusters.
toCanonical :: DotGraph n -> DotGraph n

-- | Convert a canonical Dot graph to a graph-based one. This assumes that
--   the canonical graph is the same format as returned by
--   toCanonical. The "unsafeness" is that:
--   
--   
--   
- All clusters must have a unique identifier (unAnonymise can
--   be used to make sure all clusters have an identifier, but it
--   doesn't ensure uniqueness).
--   
- All nodes are assumed to be explicitly listed precisely once.
--   
- Only edges found in the root graph are considered.
--   
--   
--   If this isn't the case, use fromCanonical instead.
--   
--   The graphToDot function from Data.GraphViz produces
--   output suitable for this function (assuming all clusters are provided
--   with a unique identifier); graphElemsToDot is suitable if all
--   nodes are specified in the input list (rather than just the edges).
unsafeFromCanonical :: Ord n => DotGraph n -> DotGraph n

-- | Convert any existing DotRepr instance to a DotGraph.
fromDotRepr :: DotRepr dg n => dg n -> DotGraph n

-- | Does this graph have any nodes?
isEmpty :: DotGraph n -> Bool

-- | Does this graph have any clusters?
hasClusters :: DotGraph n -> Bool

-- | Determine if this graph has nodes or clusters.
isEmptyGraph :: DotGraph n -> Bool
graphAttributes :: DotGraph n -> [GlobalAttributes]

-- | Which cluster (or the root graph) is this cluster in?
parentOf :: DotGraph n -> GraphID -> Maybe GraphID
clusterAttributes :: DotGraph n -> GraphID -> [GlobalAttributes]

-- | Return the ID for the cluster the node is in.
foundInCluster :: Ord n => DotGraph n -> n -> Maybe GraphID

-- | Return the attributes for the node.
attributesOf :: Ord n => DotGraph n -> n -> Attributes

-- | Predecessor edges for the specified node. For undirected graphs
--   equivalent to adjacentTo.
predecessorsOf :: Ord n => DotGraph n -> n -> [DotEdge n]

-- | Successor edges for the specified node. For undirected graphs
--   equivalent to adjacentTo.
successorsOf :: Ord n => DotGraph n -> n -> [DotEdge n]

-- | All edges involving this node.
adjacentTo :: Ord n => DotGraph n -> n -> [DotEdge n]
adjacent :: Context n -> [DotEdge n]

-- | Create a graph with no clusters.
mkGraph :: Ord n => [DotNode n] -> [DotEdge n] -> DotGraph n
emptyGraph :: DotGraph n

-- | Merge the Context into the graph. Assumes that the specified
--   node is not in the graph but that all endpoints in the
--   successors and predecessors (with the exception of
--   loops) are. If the cluster is not present in the graph, then it will
--   be added with no attributes with a parent of the root graph.
--   
--   Note that & and decompose are not
--   quite inverses, as this function will add in the cluster if it does
--   not yet exist in the graph, but decompose will not delete it.
(&) :: Ord n => Context n -> DotGraph n -> DotGraph n
infixr 5 &

-- | Recursively merge the list of contexts.
--   
--   
--   composeList = foldr (&) emptyGraph
--   
composeList :: Ord n => [Context n] -> DotGraph n

-- | Add a node to the current graph. Merges attributes and edges if the
--   node already exists in the graph.
--   
--   If the specified cluster does not yet exist in the graph, then it will
--   be added (as a sub-graph of the overall graph and no attributes).
addNode :: Ord n => n -> Maybe GraphID -> Attributes -> DotGraph n -> DotGraph n

-- | A node in DotGraph.
data DotNode n
DotNode :: n -> Attributes -> DotNode n
[nodeID] :: DotNode n -> n
[nodeAttributes] :: DotNode n -> Attributes

-- | A variant of addNode that takes in a DotNode (not in a
--   cluster).
addDotNode :: Ord n => DotNode n -> DotGraph n -> DotGraph n

-- | Add the specified edge to the graph; assumes both node values are
--   already present in the graph. If the graph is undirected then the
--   order of nodes doesn't matter.
addEdge :: Ord n => n -> n -> Attributes -> DotGraph n -> DotGraph n

-- | An edge in DotGraph.
data DotEdge n
DotEdge :: n -> n -> Attributes -> DotEdge n
[fromNode] :: DotEdge n -> n
[toNode] :: DotEdge n -> n
[edgeAttributes] :: DotEdge n -> Attributes

-- | A variant of addEdge that takes a DotEdge value.
addDotEdge :: Ord n => DotEdge n -> DotGraph n -> DotGraph n

-- | Add a new cluster to the graph; throws an error if the cluster already
--   exists. Assumes that it doesn't match the identifier of the overall
--   graph. If the parent cluster doesn't already exist in the graph then
--   it will be added.
addCluster :: GraphID -> Maybe GraphID -> [GlobalAttributes] -> DotGraph n -> DotGraph n

-- | Specify the parent of the cluster; adds both in if not already
--   present.
setClusterParent :: GraphID -> Maybe GraphID -> DotGraph n -> DotGraph n

-- | Specify the attributes of the cluster; adds it if not already present.
setClusterAttributes :: GraphID -> [GlobalAttributes] -> DotGraph n -> DotGraph n

-- | A partial inverse of &, in that if a node exists
--   in a graph then it will be decomposed, but will not remove the cluster
--   that it was in even if it was the only node in that cluster.
decompose :: Ord n => n -> DotGraph n -> Maybe (Context n, DotGraph n)

-- | As with decompose, but do not specify which node to
--   decompose.
decomposeAny :: Ord n => DotGraph n -> Maybe (Context n, DotGraph n)

-- | Recursively decompose the Dot graph into a list of contexts such that
--   if (c:cs) = decomposeList dg, then dg = c &
--   composeList cs.
--   
--   Note that all global attributes are lost, so this is not
--   suitable for representing a Dot graph on its own.
decomposeList :: Ord n => DotGraph n -> [Context n]

-- | Delete the specified node from the graph; returns the original graph
--   if that node isn't present.
deleteNode :: Ord n => n -> DotGraph n -> DotGraph n

-- | Delete all edges between the two nodes; returns the original graph if
--   there are no edges.
deleteAllEdges :: Ord n => n -> n -> DotGraph n -> DotGraph n

-- | Deletes the specified edge from the DotGraph (note: for unordered
--   graphs both orientations are considered).
deleteEdge :: Ord n => n -> n -> Attributes -> DotGraph n -> DotGraph n

-- | As with deleteEdge but takes a DotEdge rather than
--   individual values.
deleteDotEdge :: Ord n => DotEdge n -> DotGraph n -> DotGraph n

-- | Delete the specified cluster, and makes any clusters or nodes within
--   it be in its root cluster (or the overall graph if required).
deleteCluster :: GraphID -> DotGraph n -> DotGraph n

-- | Remove clusters with no sub-clusters and no nodes within them.
removeEmptyClusters :: DotGraph n -> DotGraph n
instance GHC.Classes.Ord n => Data.GraphViz.Types.DotRepr Data.GraphViz.Types.Graph.DotGraph n
instance GHC.Classes.Eq Data.GraphViz.Types.Graph.ClusterInfo
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Graph.Context n)
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Graph.DotGraph n)
instance GHC.Classes.Eq Data.GraphViz.Types.Graph.GlobAttrs
instance GHC.Classes.Eq n => GHC.Classes.Eq (Data.GraphViz.Types.Graph.NodeInfo n)
instance GHC.Classes.Ord n => Data.GraphViz.Types.Generalised.FromGeneralisedDot Data.GraphViz.Types.Graph.DotGraph n
instance GHC.Classes.Ord Data.GraphViz.Types.Graph.ClusterInfo
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Graph.Context n)
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Graph.DotGraph n)
instance GHC.Classes.Ord Data.GraphViz.Types.Graph.GlobAttrs
instance GHC.Classes.Ord n => GHC.Classes.Ord (Data.GraphViz.Types.Graph.NodeInfo n)
instance (GHC.Classes.Ord n, Data.GraphViz.Printing.PrintDot n, Data.GraphViz.Parsing.ParseDot n) => Data.GraphViz.Types.PPDotRepr Data.GraphViz.Types.Graph.DotGraph n
instance (GHC.Classes.Ord n, Data.GraphViz.Parsing.ParseDot n) => Data.GraphViz.Parsing.ParseDot (Data.GraphViz.Types.Graph.DotGraph n)
instance (GHC.Classes.Ord n, Data.GraphViz.Parsing.ParseDot n) => Data.GraphViz.Types.ParseDotRepr Data.GraphViz.Types.Graph.DotGraph n
instance Data.GraphViz.Printing.PrintDot n => Data.GraphViz.Printing.PrintDot (Data.GraphViz.Types.Graph.DotGraph n)
instance (GHC.Classes.Ord n, Data.GraphViz.Printing.PrintDot n) => Data.GraphViz.Types.PrintDotRepr Data.GraphViz.Types.Graph.DotGraph n
instance GHC.Internal.Read.Read Data.GraphViz.Types.Graph.ClusterInfo
instance GHC.Internal.Read.Read n => GHC.Internal.Read.Read (Data.GraphViz.Types.Graph.Context n)
instance (GHC.Classes.Ord n, GHC.Internal.Read.Read n) => GHC.Internal.Read.Read (Data.GraphViz.Types.Graph.DotGraph n)
instance GHC.Internal.Read.Read Data.GraphViz.Types.Graph.GlobAttrs
instance (GHC.Classes.Ord n, GHC.Internal.Read.Read n) => GHC.Internal.Read.Read (Data.GraphViz.Types.Graph.NodeInfo n)
instance GHC.Internal.Show.Show Data.GraphViz.Types.Graph.ClusterInfo
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Graph.Context n)
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Graph.DotGraph n)
instance GHC.Internal.Show.Show Data.GraphViz.Types.Graph.GlobAttrs
instance GHC.Internal.Show.Show n => GHC.Internal.Show.Show (Data.GraphViz.Types.Graph.NodeInfo n)

-- | This is the top-level module for the graphviz library. It provides
--   functions to convert Graphs into the Dot language used
--   by the Graphviz suite of programs (as well as a limited ability
--   to perform the reverse operation).
--   
--   If you wish to construct a Haskell representation of a Dot graph
--   yourself rather than using the conversion functions here, please see
--   the Data.GraphViz.Types module as a starting point for how to
--   do so.
--   
--   Information about Graphviz and the Dot language can be found at:
--   http://graphviz.org/
module Data.GraphViz

-- | Defines the parameters used to convert a Graph into a
--   DotRepr.
--   
--   A value of type GraphvizParams n nl el cl l indicates
--   that the Graph has a node type of n, node labels of
--   type nl, edge labels of type el, corresponding
--   clusters of type cl and after clustering the nodes have a
--   label of type l (which may or may not be the same as
--   nl).
--   
--   The tuples in the function types represent labelled nodes (for
--   (n,nl) and (n,l)) and labelled edges
--   ((n,n,el); the value (f,t,ftl) is an edge from
--   f to l with a label of ftl). These
--   correspond to LNode and LEdge in FGL graphs.
--   
--   The clustering in clusterBy can be to arbitrary depth.
--   
--   Note that the term "cluster" is slightly conflated here: in terms of
--   GraphvizParams values, a cluster is a grouping of nodes; the
--   isDotCluster function lets you specify whether it is a cluster
--   in the Dot sense or just a sub-graph.
data GraphvizParams n nl el cl l
Params :: Bool -> [GlobalAttributes] -> ((n, nl) -> NodeCluster cl (n, l)) -> (cl -> Bool) -> (cl -> GraphID) -> (cl -> [GlobalAttributes]) -> ((n, l) -> Attributes) -> ((n, n, el) -> Attributes) -> GraphvizParams n nl el cl l

-- | True if the graph is directed; False otherwise.
[isDirected] :: GraphvizParams n nl el cl l -> Bool

-- | The top-level global Attributes for the entire graph.
[globalAttributes] :: GraphvizParams n nl el cl l -> [GlobalAttributes]

-- | A function to specify which cluster a particular node is in.
[clusterBy] :: GraphvizParams n nl el cl l -> (n, nl) -> NodeCluster cl (n, l)

-- | Is this "cluster" actually a cluster, or just a sub-graph?
[isDotCluster] :: GraphvizParams n nl el cl l -> cl -> Bool

-- | The name/identifier for a cluster.
[clusterID] :: GraphvizParams n nl el cl l -> cl -> GraphID

-- | Specify which global attributes are applied in the given cluster.
[fmtCluster] :: GraphvizParams n nl el cl l -> cl -> [GlobalAttributes]

-- | The specific Attributes for a node.
[fmtNode] :: GraphvizParams n nl el cl l -> (n, l) -> Attributes

-- | The specific Attributes for an edge.
[fmtEdge] :: GraphvizParams n nl el cl l -> (n, n, el) -> Attributes

-- | Especially useful for quick explorations in ghci, this is a "do what I
--   mean" set of parameters that prints the specified labels of a
--   non-clustered graph.
quickParams :: (Labellable nl, Labellable el) => GraphvizParams n nl el () nl

-- | A default GraphvizParams value which assumes the graph is
--   directed, contains no clusters and has no Attributes set.
--   
--   If you wish to have the labels of the nodes to have a different type
--   after applying clusterBy from before clustering, then you will
--   have to specify your own GraphvizParams value from scratch (or
--   use blankParams).
--   
--   If you use a custom clusterBy function (which if you actually
--   want clusters you should) then you should also override the
--   (nonsensical) default clusterID.
defaultParams :: GraphvizParams n nl el cl nl

-- | A variant of defaultParams that enforces that the clustering
--   type is () (i.e.: no clustering); this avoids
--   problems when using defaultParams internally within a function
--   without any constraint on what the clustering type is.
nonClusteredParams :: GraphvizParams n nl el () nl

-- | A GraphvizParams value where every field is set to
--   undefined. This is useful when you have a function
--   that will set some of the values for you (e.g. setDirectedness)
--   but you don't want to bother thinking of default values to set in the
--   meantime. This is especially useful when you are programmatically
--   setting the clustering function (and as such do not know what the
--   types might be).
blankParams :: GraphvizParams n nl el cl l

-- | Determine if the provided Graph is directed or not and set the
--   value of isDirected appropriately.
setDirectedness :: (Ord el, Graph gr) => (GraphvizParams Node nl el cl l -> gr nl el -> a) -> GraphvizParams Node nl el cl l -> gr nl el -> a

-- | Define into which cluster a particular node belongs. Clusters can be
--   nested to arbitrary depth.
data NodeCluster c a

-- | Indicates the actual Node in the Graph.
N :: a -> NodeCluster c a

-- | Indicates that the NodeCluster is in the Cluster c.
C :: c -> NodeCluster c a -> NodeCluster c a

-- | An alias for NodeCluster when dealing with FGL graphs.
type LNodeCluster cl l = NodeCluster cl (Node, l)

-- | Convert a graph to Dot format, using the specified parameters
--   to cluster the graph, etc.
graphToDot :: (Ord cl, Graph gr) => GraphvizParams Node nl el cl l -> gr nl el -> DotGraph Node

-- | As with graphToDot, but this allows you to easily convert other
--   graph-like formats to a Dot graph as long as you can get a list of
--   nodes and edges from it.
graphElemsToDot :: (Ord cl, Ord n) => GraphvizParams n nl el cl l -> [(n, nl)] -> [(n, n, el)] -> DotGraph n

-- | A pseudo-inverse to graphToDot; "pseudo" in the sense that the
--   original node and edge labels aren't able to be reconstructed.
dotToGraph :: (DotRepr dg Node, Graph gr) => dg Node -> gr Attributes Attributes

-- | Augment the current node label type with the Attributes applied
--   to that node.
type AttributeNode nl = (Attributes, nl)

-- | Augment the current edge label type with the Attributes applied
--   to that edge.
type AttributeEdge el = (Attributes, el)

-- | Run the appropriate Graphviz command on the graph to get positional
--   information and then combine that information back into the original
--   graph.
graphToGraph :: (Ord cl, Graph gr) => GraphvizParams Node nl el cl l -> gr nl el -> IO (gr (AttributeNode nl) (AttributeEdge el))

-- | This is a "quick-and-dirty" graph augmentation function that sets no
--   Attributes and thus should be referentially transparent and is
--   wrapped in unsafePerformIO.
--   
--   Note that the provided GraphvizParams is only used for
--   isDirected, clusterBy and clusterID.
dotizeGraph :: (Ord cl, Graph gr) => GraphvizParams Node nl el cl l -> gr nl el -> gr (AttributeNode nl) (AttributeEdge el)

-- | Used to augment an edge label with a unique identifier.
data EdgeID el

-- | Add unique edge identifiers to each label. This is useful for when
--   multiple edges between two nodes need to be distinguished.
addEdgeIDs :: Graph gr => gr nl el -> gr nl (EdgeID el)

-- | Add a custom attribute to the list of attributes containing the value
--   of the unique edge identifier.
setEdgeIDAttribute :: (LEdge el -> Attributes) -> LEdge (EdgeID el) -> Attributes

-- | Pass the DotRepr through the relevant command and then augment
--   the Graph that it came from.
dotAttributes :: (Graph gr, PPDotRepr dg Node, FromGeneralisedDot dg Node) => Bool -> gr nl (EdgeID el) -> dg Node -> IO (gr (AttributeNode nl) (AttributeEdge el))

-- | Use the Attributes in the provided DotGraph to augment
--   the node and edge labels in the provided Graph. The unique
--   identifiers on the edges are also stripped off.
--   
--   Please note that the behaviour for this function is undefined if the
--   DotGraph does not come from the original Graph (either
--   by using a conversion function or by passing the result of a
--   conversion function through a GraphvizCommand via the
--   DotOutput or similar).
augmentGraph :: (Graph gr, DotRepr dg Node) => gr nl (EdgeID el) -> dg Node -> gr (AttributeNode nl) (AttributeEdge el)

-- | Quickly visualise a graph using the Xlib GraphvizCanvas.
--   If your label types are not (and cannot) be instances of
--   Labellable, you may wish to use gmap, nmap or
--   emap to set them to a value such as "".
preview :: (Ord el, Graph gr, Labellable nl, Labellable el) => gr nl el -> IO ()

-- | A Dot graph in canonical form.
data DotGraph n
DotGraph :: Bool -> Bool -> Maybe GraphID -> DotStatements n -> DotGraph n

-- | If True, no multiple edges are drawn.
[strictGraph] :: DotGraph n -> Bool
[directedGraph] :: DotGraph n -> Bool
[graphID] :: DotGraph n -> Maybe GraphID
[graphStatements] :: DotGraph n -> DotStatements n
data DotStatements n
DotStmts :: [GlobalAttributes] -> [DotSubGraph n] -> [DotNode n] -> [DotEdge n] -> DotStatements n
[attrStmts] :: DotStatements n -> [GlobalAttributes]
[subGraphs] :: DotStatements n -> [DotSubGraph n]
[nodeStmts] :: DotStatements n -> [DotNode n]
[edgeStmts] :: DotStatements n -> [DotEdge n]
data DotSubGraph n
DotSG :: Bool -> Maybe GraphID -> DotStatements n -> DotSubGraph n
[isCluster] :: DotSubGraph n -> Bool
[subGraphID] :: DotSubGraph n -> Maybe GraphID
[subGraphStmts] :: DotSubGraph n -> DotStatements n
instance GHC.Classes.Eq el => GHC.Classes.Eq (Data.GraphViz.EdgeID el)
instance GHC.Classes.Ord el => GHC.Classes.Ord (Data.GraphViz.EdgeID el)
instance GHC.Internal.Show.Show el => GHC.Internal.Show.Show (Data.GraphViz.EdgeID el)
