HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulegraphviz-2999.20.2.0Haskell2010

Data.GraphViz.Parsing

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.

  • 7 types
  • 5 classes
  • 79 values

Re-exporting pertinent parts of Polyparse.

41 declarations
classclass Commitment (p :: Type -> Type) where
#

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.

Methods

  • commit :: p a -> p a

    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.

  • adjustErr :: p a -> (String -> String) -> p a

    p adjustErr f applies the transformation f to any error message generated in p, having no effect if p succeeds.

  • oneOf' :: [(String, p a)] -> 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.

Instances9Commitment, …
  • Commitment ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.ByteString
  • Commitment ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.ByteStringChar
  • Commitment ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.Text
  • Commitment (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.Lazy
  • Commitment (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.Lex
  • Commitment (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.Parser
  • Commitment (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • Commitment (Parser s t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateLazy
  • Commitment (Parser s t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateParser
classclass Functor f => Applicative (f :: Type -> Type) where
#

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 Prelude.<$> 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:

As a consequence of these laws, the Functor instance for f will satisfy

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

(which implies that pure and <*> satisfy the applicative functor laws).

Methods

  • pure :: a -> f a

    Lift a value into the Structure.

    Examples
    Example1 expression
    pure 1 :: Maybe IntJust 1
    Example1 expression
    pure 'z' :: [Char]"z"
    Example1 expression
    pure (pure ":D") :: Maybe [String]Just [":D"]
  • (<*>) :: f (a -> b) -> f a -> f binfixl 4

    Sequential application.

    A few functors support an implementation of <*> that is more efficient than the default one.

    Example

    Used in combination with (Data.Functor.<$>), (<*>) can be used to build a record.

    Example1 expression
    data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
    Example3 expressions
    produceFoo :: Applicative f => f FooproduceBar :: Applicative f => f BarproduceBaz :: Applicative f => f Baz
    Example2 expressions
    mkState :: Applicative f => f MyStatemkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
  • liftA2 :: (a -> b -> c) -> f a -> f b -> f c

    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
    Example1 expression
    liftA2 (,) (Just 3) (Just 5)Just (3,5)
    Example1 expression
    liftA2 (+) [1, 2, 3] [4, 5, 6][5,6,7,6,7,8,7,8,9]
  • (*>) :: f a -> f b -> f binfixl 4

    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.

    Example1 expression
    Just 2 *> Just 3Just 3
    Example1 expression
    Nothing *> Just 3Nothing

    Of course a more interesting use case would be to have effectful computations instead of just returning pure values.

    Example4 expressions
    import Data.Charimport GHC.Internal.Text.ParserCombinators.ReadPlet p = string "my name is " *> munch1 isAlpha <* eofreadP_to_S p "my name is Simon"[("Simon","")]
  • (<*) :: f a -> f b -> f ainfixl 4

    Sequence actions, discarding the value of the second argument.

Instances105Applicative, …
classclass Applicative f => Alternative (f :: Type -> Type) where
#

A monoid on applicative functors.

If defined, some and many should be the least solutions of the equations:

Examples
Example1 expression
Nothing <|> Just 42Just 42
Example1 expression
[1, 2] <|> [3, 4][1,2,3,4]
Example1 expression
empty <|> print (2^15)32768

Methods

  • (<|>) :: f a -> f a -> f ainfixl 3

    An associative binary operation

  • some :: f a -> f [a]

    One or more.

    Examples
    Example1 expression
    some (putStr "la")lalalalalalalalala... * goes on forever *
    Example1 expression
    some Nothingnothing
    Example1 expression
    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.

  • many :: f a -> f [a]

    Zero or more.

    Examples
    Example1 expression
    many (putStr "la")lalalalalalalalala... * goes on forever *
    Example1 expression
    many NothingJust []
    Example1 expression
    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.

Instances55Alternative, …
newtypenewtype Parser s 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.

Constructors

Instances8Monad, Functor, MonadFail, Applicative, Alternative, Commitment, …
  • Monad (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • Functor (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • MonadFail (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • Applicative (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • Alternative (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • Commitment (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • PolyParse (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • GraphvizStateM (Parser GraphvizState)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Internal.State
value(<$>) :: Functor f => (a -> b) -> f a -> f b
#

An infix synonym for fmap.

The name of this operator is an allusion to Prelude.$. Note the similarities between their types:

 ($)  ::              (a -> b) ->   a ->   b
(<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas Prelude.$ is function application, <$> is function application lifted over a Functor.

Examples

Convert from a Maybe Int to a Maybe String using show:

Example1 expression
show <$> NothingNothing
Example1 expression
show <$> Just 3Just "3"

Convert from an Either Int Int to an Either Int String using show:

Example1 expression
show <$> Left 17Left 17
Example1 expression
show <$> Right 17Right "17"

Double each element of a list:

Example1 expression
(*2) <$> [1,2,3][2,4,6]

Apply even to the second element of a pair:

Example1 expression
even <$> (2,2)(2,True)
valuebracket :: PolyParse p => p bra -> p ket -> p a -> p 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

method(<$) :: a -> f b -> f a
#

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:

Example2 expressions
'a' <$ Just 2Just 'a''a' <$ NothingNothing
value(<**>) :: Applicative f => f a -> f (a -> b) -> f b
#

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
Example1 expression
(<**>) (print 1) (id <$ print 2)12
Example1 expression
flip (<*>) (print 1) (id <$ print 2)21
Example1 expression
ZipList [4, 5, 6] <**> ZipList [(+1), (*2), (/3)]ZipList {getZipList = [5.0,10.0,2.0]}
valueliftA :: Applicative f => (a -> b) -> f a -> f b
#

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:

Example1 expression
liftA (+1) [1, 2][2,3]

Or the Applicative instance for Maybe

Example1 expression
liftA (+1) (Just 3)Just 4
valueliftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
#

Lift a ternary function to actions.

valuenext :: Parser s Char
#

Simply return the next token in the input tokenstream.

datadata Result z 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.

Constructors

Instances1Functor
  • Functor (Result z)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.Result
valueoptional :: Alternative f => f a -> f (Maybe a)
#

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:

Example1 expression
import Control.Monad.Except
Example2 expressions
canFail = throwError "it failed" :: Except String Intfinal = return 42                :: Except String Int

Can be combined by allowing the first function to fail:

Example1 expression
runExcept $ canFail *> finalLeft "it failed"
Example1 expression
runExcept $ optional canFail *> finalRight 42
valuesepBy1 :: PolyParse p => p a -> p sep -> p [a]
#

Parse a non-empty list of items separated by discarded junk.

newtypenewtype Const a (b :: k)
#

The Const functor.

Examples
Example1 expression
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 (<>)

Example1 expression
Const [1, 2, 3] <*> Const [4, 5, 6]Const [1,2,3,4,5,6]

Constructors

Instances45Generic1, Bifoldable, Bifoldable1, Bifunctor, Bitraversable, Eq2, …
valueasum :: (Foldable t, Alternative f) => t (f a) -> f a
#

The sum of a collection of actions using (<|>), generalizing concat.

asum is just like msum, but generalised to Alternative.

Examples

Basic usage:

Example1 expression
asum [Just "Hello", Nothing, Just "World"]Just "Hello"
valueapply :: PolyParse p => p (a -> b) -> p a -> p b
#

Apply a parsed function to a parsed value. Rather like ordinary function application lifted into parsers.

valueeof :: Parser s ()
#

Succeed if the end of file/input has been reached, fail otherwise.

valuemany1 :: PolyParse p => p a -> p [a]
#

Parse a non-empty list of items.

valuesepBy :: PolyParse p => p a -> p sep -> p [a]
#

Parse a list of items separated by discarded junk.

valueexactly :: PolyParse p => Int -> p a -> p [a]
#

'exactly n p' parses precisely n items, using the parser p, in sequence.

classclass (Functor p, Monad p, MonadFail p, Applicative p, Alternative p, Commitment p) => PolyParse (p :: Type -> Type)
#

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.

Instances9PolyParse, …
  • PolyParse ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.ByteString
  • PolyParse ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.ByteStringChar
  • PolyParse ParserDefined in polyparse-1.13 · Text.ParserCombinators.Poly.Text
  • PolyParse (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.Lazy
  • PolyParse (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.Lex
  • PolyParse (Parser t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.Parser
  • PolyParse (Parser s)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateText
  • PolyParse (Parser s t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateLazy
  • PolyParse (Parser s t)Defined in polyparse-1.13 · Text.ParserCombinators.Poly.StateParser
valuebracketSep :: PolyParse p => p bra -> p sep -> p ket -> p a -> p [a]
#

Parse a list of items, discarding the start, end, and separator items.

valuediscard :: PolyParse p => p a -> p b -> p a
#

x discard y parses both x and y, but discards the result of y. Rather like const lifted into parsers.

valuefailBad :: PolyParse p => String -> p a
#

When a simple fail is not strong enough, use failBad for emphasis. An emphasised (severe) error cannot be overridden by choice operators.

valuemanyFinally :: PolyParse p => p a -> p z -> 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.

valuemanyFinally' :: (PolyParse p, Show a) => 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 [].

valueoneOf :: PolyParse p => [p a] -> p a
#

Parse the first alternative in the list that succeeds.

valueupto :: PolyParse p => Int -> p a -> p [a]
#

'upto n p' parses n or fewer items, using the parser p, in sequence.

valueonFail :: Parser s a -> Parser s a -> Parser s 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.

valuereparse :: Text -> Parser s ()
#

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.

valuestGet :: Parser s s
#

Deliver the entire internal state.

newtypenewtype WrappedArrow (a :: Type -> Type -> Type) b c
#

Constructors

Instances8Generic1, Functor, Applicative, Alternative, Data, Generic, …
newtypenewtype WrappedMonad (m :: Type -> Type) a
#

Constructors

Instances9Generic1, Monad, Functor, Applicative, Alternative, Data, …
newtypenewtype ZipList a
#

Lists, but with an Applicative functor based on zipping.

Examples

In contrast to the Applicative for GHC.List.List:

Example1 expression
(+) <$> [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

Example1 expression
(+) <$> ZipList [1, 2, 3] <*> ZipList [4, 5, 6]ZipList {getZipList = [5,7,9]}
Example1 expression
(,,,) <$> ZipList [1, 2] <*> ZipList [3, 4] <*> ZipList [5, 6] <*> ZipList [7, 8]ZipList {getZipList = [(1,3,5,7),(2,4,6,8)]}
Example1 expression
ZipList [(+1), (^2), (/ 2)] <*> ZipList [5, 5, 5]ZipList {getZipList = [6.0,25.0,2.5]}

Constructors

Instances18Functor, Applicative, Foldable, Traversable, Alternative, NFData1, …
  • Functor ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Applicative ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
    f <$> ZipList xs1 <*> ... <*> ZipList xsN
        = ZipList (zipWithN f xs1 ... xsN)

    where zipWithN refers to the zipWith function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example:

    (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
        = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
        = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}
  • Foldable ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Traversable ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Alternative ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • NFData1 ZipListDefined in deepseq-1.5.0.0 · Control.DeepSeq
  • Generic1 ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • IsList (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.IsList
  • Eq a => Eq (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Data a => Data (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Ord a => Ord (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Read a => Read (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Show a => Show (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Generic (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • NFData a => NFData (ZipList a)Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • type Rep (ZipList a) = D1 ('MetaData "ZipList" "GHC.Internal.Functor.ZipList" "ghc-internal" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • type Rep1 ZipList = D1 ('MetaData "ZipList" "GHC.Internal.Functor.ZipList" "ghc-internal" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 [])))Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • type Item (ZipList a) = aDefined in ghc-internal-9.1003.0 · GHC.Internal.IsList

The ParseDot class.

10 declarations
typetype Parse a = Parser GraphvizState a
#

A ReadS-like type alias.

classclass ParseDot a where
#
Instances100ParseDot, …
  • ParseDot IntegerDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot VersionDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing

    Ignores versionTags and assumes 'not . null . versionBranch' (usually you want 'length . versionBranch == 2') and that all such values are non-negative.

  • ParseDot Word16Defined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot Word8Defined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot BoolDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot CharDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot DoubleDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot IntDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot ArrowFillDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Arrows
  • ParseDot ArrowModifierDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Arrows
  • ParseDot ArrowShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Arrows
  • ParseDot ArrowSideDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Arrows
  • ParseDot ArrowTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Arrows
  • ParseDot BrewerNameDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot BrewerSchemeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot ColorSchemeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors
  • ParseDot WeightedColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors
  • ParseDot SVGColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.SVG
  • ParseDot X11ColorDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Colors.X11
  • ParseDot AttributeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Complete
  • ParseDot AlignDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot AttributeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot CellDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot CellFormatDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot FormatDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot ImgDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot LabelDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot RowDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot ScaleDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot SideDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot StyleDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot TableDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot TextItemDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot VAlignDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.HTML
  • ParseDot CompassPointDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Internal
  • ParseDot PortNameDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Internal
  • ParseDot PortPosDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Internal
  • ParseDot ClusterModeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot DEConstraintsDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot DPointDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot DirTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot EdgeTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot FocusTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot GraphSizeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot JustificationDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot LabelDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot LabelSchemeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot LayerIDDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot LayerListDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot LayerListSepDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot LayerRangeElemDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot LayerSepDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot ModeTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot ModelDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot NodeSizeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot NormalizedDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot NumberDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot OrderDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot OutputModeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot OverlapDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values

    Note that overlap=false defaults to PrismOverlap Nothing, but if the Prism library isn't available then it is equivalent to VoronoiOverlap.

  • ParseDot PackDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot PackModeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot PageDirDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot PathsDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot PointDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot PosDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot QuadTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot RankDirDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot RankTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot RatiosDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot RecordFieldDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot RectDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot RootDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot STStyleDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot SVGFontNamesDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot ScaleTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot ShapeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot SmoothTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot SplineDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot StartTypeDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot StyleItemDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot StyleNameDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot VerticalPlacementDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot ViewPortDefined in graphviz-2999.20.2.0 · Data.GraphViz.Attributes.Values
  • ParseDot GraphvizCommandDefined in graphviz-2999.20.2.0 · Data.GraphViz.Commands.Available
  • ParseDot GlobalAttributesDefined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Internal.Common
  • ParseDot GraphIDDefined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Internal.Common
  • ParseDot TextDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot TextDefined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot a => ParseDot [a]Defined in graphviz-2999.20.2.0 · Data.GraphViz.Parsing
  • ParseDot n => ParseDot (DotGraph n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Canonical
  • ParseDot n => ParseDot (DotStatements n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Canonical
  • ParseDot n => ParseDot (DotSubGraph n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Canonical
  • ParseDot n => ParseDot (DotGraph n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Generalised
  • ParseDot n => ParseDot (DotStatement n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Generalised
  • ParseDot n => ParseDot (DotSubGraph n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Generalised
  • ParseDot n => ParseDot (DotEdge n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Internal.Common
  • ParseDot n => ParseDot (DotNode n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Internal.Common
  • (Ord n, ParseDot n) => ParseDot (DotGraph n)Defined in graphviz-2999.20.2.0 · Data.GraphViz.Types.Graph

    Uses the ParseDot instance for generalised DotGraphs.

valueparseIt :: ParseDot a => Text -> (a, Text)
#

Parse the required value, returning also the rest of the input Text that hasn't been parsed (for debugging purposes).

valueparseIt' :: ParseDot a => Text -> a
#

Parse the required value with the assumption that it will parse all of the input Text.

valuerunParser' :: Parse a -> Text -> a
#

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).

Convenience parsing combinators.

41 declarations
valueisNumString :: Bool -> Text -> Bool
#

Determine if this String represents a number. Boolean parameter determines if exponents are considered part of numbers for this.

valueparseEscaped :: Bool -> [Char] -> [Char] -> 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.

Parse a floating point number that actually contains decimals. Bool flag indicates whether values that need to be quoted are parsed.

valuenewline' :: Parse ()
#

Consume all whitespace and newlines until a line with non-whitespace is reached. The whitespace on that line is not consumed.

valuetryParseList :: ParseDot a => Parse [a]
#

Try to parse a list of the specified type; returns an empty list if parsing fails.

valueconsumeLine :: Parse Text
#

Parses and returns all characters up till the end of the line, but does not touch the newline characters.