graphviz-2999.20.0.2: Bindings to Graphviz for graph visualisation.

Copyright | (c) Matthew Sackman Ivan Lazar Miljenovic
License | 3-Clause BSD-style
Maintainer | Ivan.Miljenovic@gmail.com
Safe Haskell | Safe
Language | Haskell2010

Data.GraphViz.Parsing

Contents

- Re-exporting pertinent parts of Polyparse.
- The ParseDot class.
- Convenience parsing combinators.

Description

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.

Synopsis

- (<$) :: Functor f => a -> f b -> f a
- class Functor f => Applicative (f :: * -> *) where
- optional :: Alternative f => f a -> f (Maybe a)
- newtype WrappedMonad (m :: * -> *) a = WrapMonad {
  - unwrapMonad :: m a
  }
- newtype WrappedArrow (a :: * -> * -> *) b c = WrapArrow {
  - unwrapArrow :: a b c
  }
- newtype ZipList a = ZipList {
  - getZipList :: [a]
  }
- newtype Const a (b :: k) :: forall k. * -> k -> * = Const {
  - getConst :: a
  }
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- liftA :: Applicative f => (a -> b) -> f a -> f b
- (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- class Applicative f => Alternative (f :: * -> *) where
- reparse :: Text -> Parser s ()
- stGet :: Parser s s
- stQuery :: (s -> a) -> Parser s a
- stUpdate :: (s -> s) -> Parser s ()
- many1Satisfy :: (Char -> Bool) -> Parser s Text
- manySatisfy :: (Char -> Bool) -> Parser s Text
- onFail :: Parser s a -> Parser s a -> Parser s a
- satisfy :: (Char -> Bool) -> Parser s Char
- eof :: Parser s ()
- next :: Parser s Char
- newtype Parser s a = P (s -> Text -> Result (Text, s) a)
- data Result z a
  - = Success z a
  - | Failure z String
  - | Committed (Result z a)
- manyFinally' :: (PolyParse p, Show a) => p a -> p z -> p [a]
- manyFinally :: PolyParse p => p a -> p z -> p [a]
- bracket :: PolyParse p => p bra -> p ket -> p a -> p a
- bracketSep :: PolyParse p => p bra -> p sep -> p ket -> p a -> p [a]
- sepBy1 :: PolyParse p => p a -> p sep -> p [a]
- sepBy :: PolyParse p => p a -> p sep -> p [a]
- many1 :: PolyParse p => p a -> p [a]
- upto :: PolyParse p => Int -> p a -> p [a]
- exactly :: PolyParse p => Int -> p a -> p [a]
- oneOf :: PolyParse p => [p a] -> p a
- adjustErrBad :: PolyParse p => p a -> (String -> String) -> p a
- failBad :: PolyParse p => String -> p a
- discard :: PolyParse p => p a -> p b -> p a
- apply :: PolyParse p => p (a -> b) -> p a -> p b
- class Commitment (p :: * -> *) where
- class (Functor p, Monad p, Applicative p, Alternative p, Commitment p) => PolyParse (p :: * -> *)
- type Parse a = Parser GraphvizState a
- class ParseDot a where
- parseIt :: ParseDot a => Text -> (a, Text)
- parseIt' :: ParseDot a => Text -> a
- runParser :: Parse a -> Text -> (Either String a, Text)
- runParser' :: Parse a -> Text -> a
- runParserWith :: (GraphvizState -> GraphvizState) -> Parse a -> Text -> (Either String a, Text)
- parseLiberally :: GraphvizState -> GraphvizState
- checkValidParse :: Either String a -> a
- checkValidParseWithRest :: (Either String a, Text) -> a
- ignoreSep :: (a -> b -> c) -> Parse a -> Parse sep -> Parse b -> Parse c
- onlyBool :: Parse Bool
- quotelessString :: Parse Text
- stringBlock :: Parse Text
- numString :: Bool -> Parse Text
- isNumString :: Bool -> Text -> Bool
- isIntString :: Text -> Bool
- quotedString :: Parse Text
- parseEscaped :: Bool -> [Char] -> [Char] -> Parse Text
- parseAndSpace :: Parse a -> Parse a
- string :: String -> Parse ()
- strings :: [String] -> Parse ()
- character :: Char -> Parse Char
- parseStrictFloat :: Bool -> Parse Double
- parseSignedFloat :: Bool -> Parse Double
- noneOf :: [Char] -> Parse Char
- whitespace1 :: Parse ()
- whitespace :: Parse ()
- 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
- newline :: Parse ()
- newline' :: Parse ()
- parseComma :: Parse ()
- parseEq :: Parse ()
- tryParseList :: ParseDot a => Parse [a]
- tryParseList' :: Parse [a] -> Parse [a]
- 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

# Re-exporting pertinent parts of Polyparse.

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

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.

class Functor f => Applicative (f :: * -> *) 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 <$> 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

-     (<*>) = ap

-     (*>) = (>>)

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

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a #

Lift a value.

(<*>) :: f (a -> b) -> f a -> f b infixl 4 #

Sequential application.

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

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 `<*>`.

(*>) :: f a -> f b -> f b infixl 4 #

Sequence actions, discarding the value of the first argument.

(<*) :: f a -> f b -> f a infixl 4 #

Sequence actions, discarding the value of the second argument.

Instances

Applicative [] | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> [a] # (<*>) :: [a -> b] -> [a] -> [b] # liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] # (*>) :: [a] -> [b] -> [b] # (<*) :: [a] -> [b] -> [a] #
Applicative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> Maybe a # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c # (*>) :: Maybe a -> Maybe b -> Maybe b # (<*) :: Maybe a -> Maybe b -> Maybe a #
Applicative IO | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> IO a # (<*>) :: IO (a -> b) -> IO a -> IO b # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c # (*>) :: IO a -> IO b -> IO b # (<*) :: IO a -> IO b -> IO a #
Applicative Par1 | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Par1 a # (<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b # liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c # (*>) :: Par1 a -> Par1 b -> Par1 b # (<*) :: Par1 a -> Par1 b -> Par1 a #
Applicative Q |
Instance details Defined in Language.Haskell.TH.Syntax Methods pure :: a -> Q a # (<*>) :: Q (a -> b) -> Q a -> Q b # liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c # (*>) :: Q a -> Q b -> Q b # (<*) :: Q a -> Q b -> Q a #
Applicative Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Min a # (<*>) :: Min (a -> b) -> Min a -> Min b # liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c # (*>) :: Min a -> Min b -> Min b # (<*) :: Min a -> Min b -> Min a #
Applicative Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Max a # (<*>) :: Max (a -> b) -> Max a -> Max b # liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c # (*>) :: Max a -> Max b -> Max b # (<*) :: Max a -> Max b -> Max a #
Applicative First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> First a # (<*>) :: First (a -> b) -> First a -> First b # liftA2 :: (a -> b -> c) -> First a -> First b -> First c # (*>) :: First a -> First b -> First b # (<*) :: First a -> First b -> First a #
Applicative Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Last a # (<*>) :: Last (a -> b) -> Last a -> Last b # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c # (*>) :: Last a -> Last b -> Last b # (<*) :: Last a -> Last b -> Last a #
Applicative Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Option a # (<*>) :: Option (a -> b) -> Option a -> Option b # liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c # (*>) :: Option a -> Option b -> Option b # (<*) :: Option a -> Option b -> Option a #
Applicative 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"]}
Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> ZipList a # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c # (*>) :: ZipList a -> ZipList b -> ZipList b # (<*) :: ZipList a -> ZipList b -> ZipList a #
Applicative Identity | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods pure :: a -> Identity a # (<*>) :: Identity (a -> b) -> Identity a -> Identity b # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c # (*>) :: Identity a -> Identity b -> Identity b # (<*) :: Identity a -> Identity b -> Identity a #
Applicative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods pure :: a -> STM a # (<*>) :: STM (a -> b) -> STM a -> STM b # liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c # (*>) :: STM a -> STM b -> STM b # (<*) :: STM a -> STM b -> STM a #
Applicative First |
Instance details Defined in Data.Monoid Methods pure :: a -> First a # (<*>) :: First (a -> b) -> First a -> First b # liftA2 :: (a -> b -> c) -> First a -> First b -> First c # (*>) :: First a -> First b -> First b # (<*) :: First a -> First b -> First a #
Applicative Last |
Instance details Defined in Data.Monoid Methods pure :: a -> Last a # (<*>) :: Last (a -> b) -> Last a -> Last b # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c # (*>) :: Last a -> Last b -> Last b # (<*) :: Last a -> Last b -> Last a #
Applicative Dual | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Dual a # (<*>) :: Dual (a -> b) -> Dual a -> Dual b # liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c # (*>) :: Dual a -> Dual b -> Dual b # (<*) :: Dual a -> Dual b -> Dual a #
Applicative Sum | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Sum a # (<*>) :: Sum (a -> b) -> Sum a -> Sum b # liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c # (*>) :: Sum a -> Sum b -> Sum b # (<*) :: Sum a -> Sum b -> Sum a #
Applicative Product | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Product a # (<*>) :: Product (a -> b) -> Product a -> Product b # liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c # (*>) :: Product a -> Product b -> Product b # (<*) :: Product a -> Product b -> Product a #
Applicative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods pure :: a -> ReadPrec a # (<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b # liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c # (*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b # (<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a #
Applicative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> ReadP a # (<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b # liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c # (*>) :: ReadP a -> ReadP b -> ReadP b # (<*) :: ReadP a -> ReadP b -> ReadP a #
Applicative NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods pure :: a -> NonEmpty a # (<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b # liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c # (*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b # (<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a #
Applicative Put |
Instance details Defined in Data.ByteString.Builder.Internal Methods pure :: a -> Put a # (<*>) :: Put (a -> b) -> Put a -> Put b # liftA2 :: (a -> b -> c) -> Put a -> Put b -> Put c # (*>) :: Put a -> Put b -> Put b # (<*) :: Put a -> Put b -> Put a #
Applicative RGB |
Instance details Defined in Data.Colour.RGB Methods pure :: a -> RGB a # (<*>) :: RGB (a -> b) -> RGB a -> RGB b # liftA2 :: (a -> b -> c) -> RGB a -> RGB b -> RGB c # (*>) :: RGB a -> RGB b -> RGB b # (<*) :: RGB a -> RGB b -> RGB a #
Applicative Tree |
Instance details Defined in Data.Tree Methods pure :: a -> Tree a # (<*>) :: Tree (a -> b) -> Tree a -> Tree b # liftA2 :: (a -> b -> c) -> Tree a -> Tree b -> Tree c # (*>) :: Tree a -> Tree b -> Tree b # (<*) :: Tree a -> Tree b -> Tree a #
Applicative Seq | Since: containers-0.5.4
Instance details Defined in Data.Sequence.Internal Methods pure :: a -> Seq a # (<*>) :: Seq (a -> b) -> Seq a -> Seq b # liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c # (*>) :: Seq a -> Seq b -> Seq b # (<*) :: Seq a -> Seq b -> Seq a #
Applicative DList |
Instance details Defined in Data.DList Methods pure :: a -> DList a # (<*>) :: DList (a -> b) -> DList a -> DList b # liftA2 :: (a -> b -> c) -> DList a -> DList b -> DList c # (*>) :: DList a -> DList b -> DList b # (<*) :: DList a -> DList b -> DList a #
Applicative P | Since: base-4.5.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> P a # (<*>) :: P (a -> b) -> P a -> P b # liftA2 :: (a -> b -> c) -> P a -> P b -> P c # (*>) :: P a -> P b -> P b # (<*) :: P a -> P b -> P a #
Applicative DotCodeM # |
Instance details Defined in Data.GraphViz.Printing Methods pure :: a -> DotCodeM a # (<*>) :: DotCodeM (a -> b) -> DotCodeM a -> DotCodeM b # liftA2 :: (a -> b -> c) -> DotCodeM a -> DotCodeM b -> DotCodeM c # (*>) :: DotCodeM a -> DotCodeM b -> DotCodeM b # (<*) :: DotCodeM a -> DotCodeM b -> DotCodeM a #
Applicative (Either e) | Since: base-3.0
Instance details Defined in Data.Either Methods pure :: a -> Either e a # (<*>) :: Either e (a -> b) -> Either e a -> Either e b # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c # (*>) :: Either e a -> Either e b -> Either e b # (<*) :: Either e a -> Either e b -> Either e a #
Applicative (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> U1 a # (<*>) :: U1 (a -> b) -> U1 a -> U1 b # liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c # (*>) :: U1 a -> U1 b -> U1 b # (<*) :: U1 a -> U1 b -> U1 a #
Monoid a => Applicative ((,) a) | For tuples, the `Monoid` constraint on `a` determines how the first values merge. For example, `String`s concatenate:
    ("hello ", (+15)) <*> ("world!", 2002)
    ("hello world!",2017)
Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a0 -> (a, a0) # (<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) # liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) # (*>) :: (a, a0) -> (a, b) -> (a, b) # (<*) :: (a, a0) -> (a, b) -> (a, a0) #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> WrappedMonad m a # (<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b # liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c # (*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # (<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a #
Arrow a => Applicative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 #
Applicative (Proxy :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods pure :: a -> Proxy a # (<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b # liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c # (*>) :: Proxy a -> Proxy b -> Proxy b # (<*) :: Proxy a -> Proxy b -> Proxy a #
(Functor m, Monad m) => Applicative (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods pure :: a -> MaybeT m a # (<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b # liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c # (*>) :: MaybeT m a -> MaybeT m b -> MaybeT m b # (<*) :: MaybeT m a -> MaybeT m b -> MaybeT m a #
Applicative m => Applicative (ListT m) |
Instance details Defined in Control.Monad.Trans.List Methods pure :: a -> ListT m a # (<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b # liftA2 :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c # (*>) :: ListT m a -> ListT m b -> ListT m b # (<*) :: ListT m a -> ListT m b -> ListT m a #
Applicative (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods pure :: a -> Parser s a # (<*>) :: Parser s (a -> b) -> Parser s a -> Parser s b # liftA2 :: (a -> b -> c) -> Parser s a -> Parser s b -> Parser s c # (*>) :: Parser s a -> Parser s b -> Parser s b # (<*) :: Parser s a -> Parser s b -> Parser s a #
Applicative (IParser t) |
Instance details Defined in Data.Text.Internal.Read Methods pure :: a -> IParser t a # (<*>) :: IParser t (a -> b) -> IParser t a -> IParser t b # liftA2 :: (a -> b -> c) -> IParser t a -> IParser t b -> IParser t c # (*>) :: IParser t a -> IParser t b -> IParser t b # (<*) :: IParser t a -> IParser t b -> IParser t a #
Applicative (DotM n) # |
Instance details Defined in Data.GraphViz.Types.Monadic Methods pure :: a -> DotM n a # (<*>) :: DotM n (a -> b) -> DotM n a -> DotM n b # liftA2 :: (a -> b -> c) -> DotM n a -> DotM n b -> DotM n c # (*>) :: DotM n a -> DotM n b -> DotM n b # (<*) :: DotM n a -> DotM n b -> DotM n a #
Applicative f => Applicative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Rec1 f a # (<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b # liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c # (*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b # (<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
Monoid m => Applicative (Const m :: * -> *) | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a # (<*>) :: Const m (a -> b) -> Const m a -> Const m b # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c # (*>) :: Const m a -> Const m b -> Const m b # (<*) :: Const m a -> Const m b -> Const m a #
Applicative f => Applicative (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Alt f a # (<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b # liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c # (*>) :: Alt f a -> Alt f b -> Alt f b # (<*) :: Alt f a -> Alt f b -> Alt f a #
(Applicative f, Monad f) => Applicative (WhenMissing f x) | Equivalent to `ReaderT k (ReaderT x (MaybeT f))`. Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods pure :: a -> WhenMissing f x a # (<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b # liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c # (*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b # (<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a #
(Functor m, Monad m) => Applicative (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods pure :: a -> ExceptT e m a # (<*>) :: ExceptT e m (a -> b) -> ExceptT e m a -> ExceptT e m b # liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c # (*>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b # (<*) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m a #
Applicative m => Applicative (IdentityT m) |
Instance details Defined in Control.Monad.Trans.Identity Methods pure :: a -> IdentityT m a # (<*>) :: IdentityT m (a -> b) -> IdentityT m a -> IdentityT m b # liftA2 :: (a -> b -> c) -> IdentityT m a -> IdentityT m b -> IdentityT m c # (*>) :: IdentityT m a -> IdentityT m b -> IdentityT m b # (<*) :: IdentityT m a -> IdentityT m b -> IdentityT m a #
(Functor m, Monad m) => Applicative (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods pure :: a -> ErrorT e m a # (<*>) :: ErrorT e m (a -> b) -> ErrorT e m a -> ErrorT e m b # liftA2 :: (a -> b -> c) -> ErrorT e m a -> ErrorT e m b -> ErrorT e m c # (*>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b # (<*) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m a #
(Functor m, Monad m) => Applicative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods pure :: a -> StateT s m a # (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b # liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c # (*>) :: StateT s m a -> StateT s m b -> StateT s m b # (<*) :: StateT s m a -> StateT s m b -> StateT s m a #
(Functor m, Monad m) => Applicative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods pure :: a -> StateT s m a # (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b # liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c # (*>) :: StateT s m a -> StateT s m b -> StateT s m b # (<*) :: StateT s m a -> StateT s m b -> StateT s m a #
(Monoid w, Applicative m) => Applicative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods pure :: a -> WriterT w m a # (<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b # liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c # (*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b # (<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a #
(Monoid w, Applicative m) => Applicative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods pure :: a -> WriterT w m a # (<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b # liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c # (*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b # (<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a #
Applicative ((->) a :: * -> *) | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a0 -> a -> a0 # (<*>) :: (a -> a0 -> b) -> (a -> a0) -> a -> b # liftA2 :: (a0 -> b -> c) -> (a -> a0) -> (a -> b) -> a -> c # (*>) :: (a -> a0) -> (a -> b) -> a -> b # (<*) :: (a -> a0) -> (a -> b) -> a -> a0 #
(Applicative f, Applicative g) => Applicative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :*: g) a # (<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b # liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c # (*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b # (<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a #
(Monad f, Applicative f) => Applicative (WhenMatched f x y) | Equivalent to `ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))` Since: containers-0.5.9
Instance details Defined in Data.IntMap.Internal Methods pure :: a -> WhenMatched f x y a # (<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b # liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c # (*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b # (<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a #
(Applicative f, Monad f) => Applicative (WhenMissing f k x) | Equivalent to `ReaderT k (ReaderT x (MaybeT f))` . Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods pure :: a -> WhenMissing f k x a # (<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b # liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c # (*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b # (<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a #
Applicative (ContT r m) |
Instance details Defined in Control.Monad.Trans.Cont Methods pure :: a -> ContT r m a # (<*>) :: ContT r m (a -> b) -> ContT r m a -> ContT r m b # liftA2 :: (a -> b -> c) -> ContT r m a -> ContT r m b -> ContT r m c # (*>) :: ContT r m a -> ContT r m b -> ContT r m b # (<*) :: ContT r m a -> ContT r m b -> ContT r m a #
Applicative m => Applicative (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods pure :: a -> ReaderT r m a # (<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b # liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c # (*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b # (<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a #
Applicative f => Applicative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> M1 i c f a # (<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b # liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 # (*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b # (<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a #
(Applicative f, Applicative g) => Applicative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :.: g) a # (<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b # liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c # (*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b # (<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a #
(Monad f, Applicative f) => Applicative (WhenMatched f k x y) | Equivalent to `ReaderT k (ReaderT x (ReaderT y (MaybeT f)))` Since: containers-0.5.9
Instance details Defined in Data.Map.Internal Methods pure :: a -> WhenMatched f k x y a # (<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b # liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c # (*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b # (<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a #
(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.Lazy Methods pure :: a -> RWST r w s m a # (<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b # liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c # (*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b # (<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a #
(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.Strict Methods pure :: a -> RWST r w s m a # (<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b # liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c # (*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b # (<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a #

optional :: Alternative f => f a -> f (Maybe a) #

One or none.

newtype WrappedMonad (m :: * -> *) a #

Constructors

WrapMonad |
Fields unwrapMonad :: m a

Instances

Monad m => Monad (WrappedMonad m) |
Instance details Defined in Control.Applicative Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # return :: a -> WrappedMonad m a # fail :: String -> WrappedMonad m a #
Monad m => Functor (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> WrappedMonad m a # (<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b # liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c # (*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # (<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a #
MonadPlus m => Alternative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedMonad m a # (<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a # some :: WrappedMonad m a -> WrappedMonad m [a] # many :: WrappedMonad m a -> WrappedMonad m [a] #
Generic1 (WrappedMonad m :: * -> *) |
Instance details Defined in Control.Applicative Associated Types type Rep1 (WrappedMonad m) :: k -> * # Methods from1 :: WrappedMonad m a -> Rep1 (WrappedMonad m) a # to1 :: Rep1 (WrappedMonad m) a -> WrappedMonad m a #
Generic (WrappedMonad m a) |
Instance details Defined in Control.Applicative Associated Types type Rep (WrappedMonad m a) :: * -> * # Methods from :: WrappedMonad m a -> Rep (WrappedMonad m a) x # to :: Rep (WrappedMonad m a) x -> WrappedMonad m a #
type Rep1 (WrappedMonad m :: * -> *) |
Instance details Defined in Control.Applicative type Rep1 (WrappedMonad m :: * -> *) = D1 (MetaData "WrappedMonad" "Control.Applicative" "base" True) (C1 (MetaCons "WrapMonad" PrefixI True) (S1 (MetaSel (Just "unwrapMonad") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 m)))
type Rep (WrappedMonad m a) |
Instance details Defined in Control.Applicative type Rep (WrappedMonad m a) = D1 (MetaData "WrappedMonad" "Control.Applicative" "base" True) (C1 (MetaCons "WrapMonad" PrefixI True) (S1 (MetaSel (Just "unwrapMonad") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (m a))))

newtype WrappedArrow (a :: * -> * -> *) b c #

Constructors

WrapArrow |
Fields unwrapArrow :: a b c

Instances

Generic1 (WrappedArrow a b :: * -> *) |
Instance details Defined in Control.Applicative Associated Types type Rep1 (WrappedArrow a b) :: k -> * # Methods from1 :: WrappedArrow a b a0 -> Rep1 (WrappedArrow a b) a0 # to1 :: Rep1 (WrappedArrow a b) a0 -> WrappedArrow a b a0 #
Arrow a => Functor (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] #
Generic (WrappedArrow a b c) |
Instance details Defined in Control.Applicative Associated Types type Rep (WrappedArrow a b c) :: * -> * # Methods from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x # to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c #
type Rep1 (WrappedArrow a b :: * -> *) |
Instance details Defined in Control.Applicative type Rep1 (WrappedArrow a b :: * -> *) = D1 (MetaData "WrappedArrow" "Control.Applicative" "base" True) (C1 (MetaCons "WrapArrow" PrefixI True) (S1 (MetaSel (Just "unwrapArrow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 (a b))))
type Rep (WrappedArrow a b c) |
Instance details Defined in Control.Applicative type Rep (WrappedArrow a b c) = D1 (MetaData "WrappedArrow" "Control.Applicative" "base" True) (C1 (MetaCons "WrapArrow" PrefixI True) (S1 (MetaSel (Just "unwrapArrow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (a b c))))

newtype ZipList a #

Lists, but with an `Applicative` functor based on zipping.

Constructors

ZipList |
Fields getZipList :: [a]

Instances

Functor ZipList |
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> ZipList a -> ZipList b # (<$) :: a -> ZipList b -> ZipList a #
Applicative 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"]}
Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> ZipList a # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c # (*>) :: ZipList a -> ZipList b -> ZipList b # (<*) :: ZipList a -> ZipList b -> ZipList a #
Foldable ZipList |
Instance details Defined in Control.Applicative Methods fold :: Monoid m => ZipList m -> m # foldMap :: Monoid m => (a -> m) -> ZipList a -> m # foldr :: (a -> b -> b) -> b -> ZipList a -> b # foldr' :: (a -> b -> b) -> b -> ZipList a -> b # foldl :: (b -> a -> b) -> b -> ZipList a -> b # foldl' :: (b -> a -> b) -> b -> ZipList a -> b # foldr1 :: (a -> a -> a) -> ZipList a -> a # foldl1 :: (a -> a -> a) -> ZipList a -> a # toList :: ZipList a -> [a] # null :: ZipList a -> Bool # length :: ZipList a -> Int # elem :: Eq a => a -> ZipList a -> Bool # maximum :: Ord a => ZipList a -> a # minimum :: Ord a => ZipList a -> a # sum :: Num a => ZipList a -> a # product :: Num a => ZipList a -> a #
Traversable ZipList | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) # sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) # mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) # sequence :: Monad m => ZipList (m a) -> m (ZipList a) #
Alternative ZipList | Since: base-4.11.0.0
Instance details Defined in Control.Applicative Methods empty :: ZipList a # (<|>) :: ZipList a -> ZipList a -> ZipList a # some :: ZipList a -> ZipList [a] # many :: ZipList a -> ZipList [a] #
Eq a => Eq (ZipList a) |
Instance details Defined in Control.Applicative Methods (==) :: ZipList a -> ZipList a -> Bool # (/=) :: ZipList a -> ZipList a -> Bool #
Ord a => Ord (ZipList a) |
Instance details Defined in Control.Applicative Methods compare :: ZipList a -> ZipList a -> Ordering # (<) :: ZipList a -> ZipList a -> Bool # (<=) :: ZipList a -> ZipList a -> Bool # (>) :: ZipList a -> ZipList a -> Bool # (>=) :: ZipList a -> ZipList a -> Bool # max :: ZipList a -> ZipList a -> ZipList a # min :: ZipList a -> ZipList a -> ZipList a #
Read a => Read (ZipList a) |
Instance details Defined in Control.Applicative Methods readsPrec :: Int -> ReadS (ZipList a) # readList :: ReadS [ZipList a] # readPrec :: ReadPrec (ZipList a) # readListPrec :: ReadPrec [ZipList a] #
Show a => Show (ZipList a) |
Instance details Defined in Control.Applicative Methods showsPrec :: Int -> ZipList a -> ShowS # show :: ZipList a -> String # showList :: [ZipList a] -> ShowS #
Generic (ZipList a) |
Instance details Defined in Control.Applicative Associated Types type Rep (ZipList a) :: * -> * # Methods from :: ZipList a -> Rep (ZipList a) x # to :: Rep (ZipList a) x -> ZipList a #
Generic1 ZipList |
Instance details Defined in Control.Applicative Associated Types type Rep1 ZipList :: k -> * # Methods from1 :: ZipList a -> Rep1 ZipList a # to1 :: Rep1 ZipList a -> ZipList a #
type Rep (ZipList a) |
Instance details Defined in Control.Applicative type Rep (ZipList a) = D1 (MetaData "ZipList" "Control.Applicative" "base" True) (C1 (MetaCons "ZipList" PrefixI True) (S1 (MetaSel (Just "getZipList") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [a])))
type Rep1 ZipList |
Instance details Defined in Control.Applicative type Rep1 ZipList = D1 (MetaData "ZipList" "Control.Applicative" "base" True) (C1 (MetaCons "ZipList" PrefixI True) (S1 (MetaSel (Just "getZipList") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 [])))

newtype Const a (b :: k) :: forall k. * -> k -> * #

The `Const` functor.

Constructors

Const |
Fields getConst :: a

Instances

Generic1 (Const a :: k -> *) |
Instance details Defined in Data.Functor.Const Associated Types type Rep1 (Const a) :: k -> * # Methods from1 :: Const a a0 -> Rep1 (Const a) a0 # to1 :: Rep1 (Const a) a0 -> Const a a0 #
Eq2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Const a c -> Const b d -> Bool #
Ord2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Const a c -> Const b d -> Ordering #
Read2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Const a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Const a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Const a b] #
Show2 (Const :: * -> * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Const a b -> ShowS # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Const a b] -> ShowS #
Functor (Const m :: * -> *) | Since: base-2.1
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b # (<$) :: a -> Const m b -> Const m a #
Monoid m => Applicative (Const m :: * -> *) | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a # (<*>) :: Const m (a -> b) -> Const m a -> Const m b # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c # (*>) :: Const m a -> Const m b -> Const m b # (<*) :: Const m a -> Const m b -> Const m a #
Foldable (Const m :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Functor.Const Methods fold :: Monoid m0 => Const m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldr :: (a -> b -> b) -> b -> Const m a -> b # foldr' :: (a -> b -> b) -> b -> Const m a -> b # foldl :: (b -> a -> b) -> b -> Const m a -> b # foldl' :: (b -> a -> b) -> b -> Const m a -> b # foldr1 :: (a -> a -> a) -> Const m a -> a # foldl1 :: (a -> a -> a) -> Const m a -> a # toList :: Const m a -> [a] # null :: Const m a -> Bool # length :: Const m a -> Int # elem :: Eq a => a -> Const m a -> Bool # maximum :: Ord a => Const m a -> a # minimum :: Ord a => Const m a -> a # sum :: Num a => Const m a -> a # product :: Num a => Const m a -> a #
Traversable (Const m :: * -> *) | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) # sequenceA :: Applicative f => Const m (f a) -> f (Const m a) # mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) # sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) #
Eq a => Eq1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Const a a0 -> Const a b -> Bool #
Ord a => Ord1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Const a a0 -> Const a b -> Ordering #
Read a => Read1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Const a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Const a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Const a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Const a a0] #
Show a => Show1 (Const a :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Const a a0 -> ShowS # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Const a a0] -> ShowS #
Bounded a => Bounded (Const a b) |
Instance details Defined in Data.Functor.Const Methods minBound :: Const a b # maxBound :: Const a b #
Enum a => Enum (Const a b) |
Instance details Defined in Data.Functor.Const Methods succ :: Const a b -> Const a b # pred :: Const a b -> Const a b # toEnum :: Int -> Const a b # fromEnum :: Const a b -> Int # enumFrom :: Const a b -> [Const a b] # enumFromThen :: Const a b -> Const a b -> [Const a b] # enumFromTo :: Const a b -> Const a b -> [Const a b] # enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] #
Eq a => Eq (Const a b) |
Instance details Defined in Data.Functor.Const Methods (==) :: Const a b -> Const a b -> Bool # (/=) :: Const a b -> Const a b -> Bool #
Floating a => Floating (Const a b) |
Instance details Defined in Data.Functor.Const Methods pi :: Const a b # exp :: Const a b -> Const a b # log :: Const a b -> Const a b # sqrt :: Const a b -> Const a b # (**) :: Const a b -> Const a b -> Const a b # logBase :: Const a b -> Const a b -> Const a b # sin :: Const a b -> Const a b # cos :: Const a b -> Const a b # tan :: Const a b -> Const a b # asin :: Const a b -> Const a b # acos :: Const a b -> Const a b # atan :: Const a b -> Const a b # sinh :: Const a b -> Const a b # cosh :: Const a b -> Const a b # tanh :: Const a b -> Const a b # asinh :: Const a b -> Const a b # acosh :: Const a b -> Const a b # atanh :: Const a b -> Const a b # log1p :: Const a b -> Const a b # expm1 :: Const a b -> Const a b # log1pexp :: Const a b -> Const a b # log1mexp :: Const a b -> Const a b #
Fractional a => Fractional (Const a b) |
Instance details Defined in Data.Functor.Const Methods (/) :: Const a b -> Const a b -> Const a b # recip :: Const a b -> Const a b # fromRational :: Rational -> Const a b #
Integral a => Integral (Const a b) |
Instance details Defined in Data.Functor.Const Methods quot :: Const a b -> Const a b -> Const a b # rem :: Const a b -> Const a b -> Const a b # div :: Const a b -> Const a b -> Const a b # mod :: Const a b -> Const a b -> Const a b # quotRem :: Const a b -> Const a b -> (Const a b, Const a b) # divMod :: Const a b -> Const a b -> (Const a b, Const a b) # toInteger :: Const a b -> Integer #
Num a => Num (Const a b) |
Instance details Defined in Data.Functor.Const Methods (+) :: Const a b -> Const a b -> Const a b # (-) :: Const a b -> Const a b -> Const a b # (*) :: Const a b -> Const a b -> Const a b # negate :: Const a b -> Const a b # abs :: Const a b -> Const a b # signum :: Const a b -> Const a b # fromInteger :: Integer -> Const a b #
Ord a => Ord (Const a b) |
Instance details Defined in Data.Functor.Const Methods compare :: Const a b -> Const a b -> Ordering # (<) :: Const a b -> Const a b -> Bool # (<=) :: Const a b -> Const a b -> Bool # (>) :: Const a b -> Const a b -> Bool # (>=) :: Const a b -> Const a b -> Bool # max :: Const a b -> Const a b -> Const a b # min :: Const a b -> Const a b -> Const a b #
Read a => Read (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `runConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods readsPrec :: Int -> ReadS (Const a b) # readList :: ReadS [Const a b] # readPrec :: ReadPrec (Const a b) # readListPrec :: ReadPrec [Const a b] #
Real a => Real (Const a b) |
Instance details Defined in Data.Functor.Const Methods toRational :: Const a b -> Rational #
RealFloat a => RealFloat (Const a b) |
Instance details Defined in Data.Functor.Const Methods floatRadix :: Const a b -> Integer # floatDigits :: Const a b -> Int # floatRange :: Const a b -> (Int, Int) # decodeFloat :: Const a b -> (Integer, Int) # encodeFloat :: Integer -> Int -> Const a b # exponent :: Const a b -> Int # significand :: Const a b -> Const a b # scaleFloat :: Int -> Const a b -> Const a b # isNaN :: Const a b -> Bool # isInfinite :: Const a b -> Bool # isDenormalized :: Const a b -> Bool # isNegativeZero :: Const a b -> Bool # isIEEE :: Const a b -> Bool # atan2 :: Const a b -> Const a b -> Const a b #
RealFrac a => RealFrac (Const a b) |
Instance details Defined in Data.Functor.Const Methods properFraction :: Integral b0 => Const a b -> (b0, Const a b) # truncate :: Integral b0 => Const a b -> b0 # round :: Integral b0 => Const a b -> b0 # ceiling :: Integral b0 => Const a b -> b0 # floor :: Integral b0 => Const a b -> b0 #
Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `runConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods showsPrec :: Int -> Const a b -> ShowS # show :: Const a b -> String # showList :: [Const a b] -> ShowS #
Ix a => Ix (Const a b) |
Instance details Defined in Data.Functor.Const Methods range :: (Const a b, Const a b) -> [Const a b] # index :: (Const a b, Const a b) -> Const a b -> Int # unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int inRange :: (Const a b, Const a b) -> Const a b -> Bool # rangeSize :: (Const a b, Const a b) -> Int # unsafeRangeSize :: (Const a b, Const a b) -> Int
IsString a => IsString (Const a b) | Since: base-4.9.0.0
Instance details Defined in Data.String Methods fromString :: String -> Const a b #
Generic (Const a b) |
Instance details Defined in Data.Functor.Const Associated Types type Rep (Const a b) :: * -> * # Methods from :: Const a b -> Rep (Const a b) x # to :: Rep (Const a b) x -> Const a b #
Semigroup a => Semigroup (Const a b) |
Instance details Defined in Data.Functor.Const Methods (<>) :: Const a b -> Const a b -> Const a b # sconcat :: NonEmpty (Const a b) -> Const a b # stimes :: Integral b0 => b0 -> Const a b -> Const a b #
Monoid a => Monoid (Const a b) |
Instance details Defined in Data.Functor.Const Methods mempty :: Const a b # mappend :: Const a b -> Const a b -> Const a b # mconcat :: [Const a b] -> Const a b #
Storable a => Storable (Const a b) |
Instance details Defined in Data.Functor.Const Methods sizeOf :: Const a b -> Int # alignment :: Const a b -> Int # peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) # pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () # peekByteOff :: Ptr b0 -> Int -> IO (Const a b) # pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () # peek :: Ptr (Const a b) -> IO (Const a b) # poke :: Ptr (Const a b) -> Const a b -> IO () #
Bits a => Bits (Const a b) |
Instance details Defined in Data.Functor.Const Methods (.&.) :: Const a b -> Const a b -> Const a b # (.|.) :: Const a b -> Const a b -> Const a b # xor :: Const a b -> Const a b -> Const a b # complement :: Const a b -> Const a b # shift :: Const a b -> Int -> Const a b # rotate :: Const a b -> Int -> Const a b # zeroBits :: Const a b # bit :: Int -> Const a b # setBit :: Const a b -> Int -> Const a b # clearBit :: Const a b -> Int -> Const a b # complementBit :: Const a b -> Int -> Const a b # testBit :: Const a b -> Int -> Bool # bitSizeMaybe :: Const a b -> Maybe Int # bitSize :: Const a b -> Int # isSigned :: Const a b -> Bool # shiftL :: Const a b -> Int -> Const a b # unsafeShiftL :: Const a b -> Int -> Const a b # shiftR :: Const a b -> Int -> Const a b # unsafeShiftR :: Const a b -> Int -> Const a b # rotateL :: Const a b -> Int -> Const a b # rotateR :: Const a b -> Int -> Const a b # popCount :: Const a b -> Int #
FiniteBits a => FiniteBits (Const a b) |
Instance details Defined in Data.Functor.Const Methods finiteBitSize :: Const a b -> Int # countLeadingZeros :: Const a b -> Int # countTrailingZeros :: Const a b -> Int #
type Rep1 (Const a :: k -> *) |
Instance details Defined in Data.Functor.Const type Rep1 (Const a :: k -> *) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep (Const a b) |
Instance details Defined in Data.Functor.Const type Rep (Const a b) = D1 (MetaData "Const" "Data.Functor.Const" "base" True) (C1 (MetaCons "Const" PrefixI True) (S1 (MetaSel (Just "getConst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))

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

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

Expand

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)

liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d #

Lift a ternary function to actions.

liftA :: Applicative f => (a -> b) -> f a -> f b #

Lift a function to actions. This function may be used as a value for `fmap` in a `Functor` instance.

(<**>) :: Applicative f => f a -> f (a -> b) -> f b infixl 4 #

A variant of `<*>` with the arguments reversed.

class Applicative f => Alternative (f :: * -> *) where #

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 []

Minimal complete definition

empty, (<|>)

Methods

(<|>) :: f a -> f a -> f a infixl 3 #

An associative binary operation

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

One or more.

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

Zero or more.

Instances

Alternative [] | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: [a] # (<|>) :: [a] -> [a] -> [a] # some :: [a] -> [[a]] # many :: [a] -> [[a]] #
Alternative Maybe | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: Maybe a # (<|>) :: Maybe a -> Maybe a -> Maybe a # some :: Maybe a -> Maybe [a] # many :: Maybe a -> Maybe [a] #
Alternative IO | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods empty :: IO a # (<|>) :: IO a -> IO a -> IO a # some :: IO a -> IO [a] # many :: IO a -> IO [a] #
Alternative Option | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods empty :: Option a # (<|>) :: Option a -> Option a -> Option a # some :: Option a -> Option [a] # many :: Option a -> Option [a] #
Alternative ZipList | Since: base-4.11.0.0
Instance details Defined in Control.Applicative Methods empty :: ZipList a # (<|>) :: ZipList a -> ZipList a -> ZipList a # some :: ZipList a -> ZipList [a] # many :: ZipList a -> ZipList [a] #
Alternative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods empty :: STM a # (<|>) :: STM a -> STM a -> STM a # some :: STM a -> STM [a] # many :: STM a -> STM [a] #
Alternative ReadPrec | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods empty :: ReadPrec a # (<|>) :: ReadPrec a -> ReadPrec a -> ReadPrec a # some :: ReadPrec a -> ReadPrec [a] # many :: ReadPrec a -> ReadPrec [a] #
Alternative ReadP | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods empty :: ReadP a # (<|>) :: ReadP a -> ReadP a -> ReadP a # some :: ReadP a -> ReadP [a] # many :: ReadP a -> ReadP [a] #
Alternative Seq | Since: containers-0.5.4
Instance details Defined in Data.Sequence.Internal Methods empty :: Seq a # (<|>) :: Seq a -> Seq a -> Seq a # some :: Seq a -> Seq [a] # many :: Seq a -> Seq [a] #
Alternative DList |
Instance details Defined in Data.DList Methods empty :: DList a # (<|>) :: DList a -> DList a -> DList a # some :: DList a -> DList [a] # many :: DList a -> DList [a] #
Alternative P | Since: base-4.5.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods empty :: P a # (<|>) :: P a -> P a -> P a # some :: P a -> P [a] # many :: P a -> P [a] #
Alternative (U1 :: * -> *) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: U1 a # (<|>) :: U1 a -> U1 a -> U1 a # some :: U1 a -> U1 [a] # many :: U1 a -> U1 [a] #
MonadPlus m => Alternative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedMonad m a # (<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a # some :: WrappedMonad m a -> WrappedMonad m [a] # many :: WrappedMonad m a -> WrappedMonad m [a] #
ArrowPlus a => Alternative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods empty :: ArrowMonad a a0 # (<|>) :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 # some :: ArrowMonad a a0 -> ArrowMonad a [a0] # many :: ArrowMonad a a0 -> ArrowMonad a [a0] #
Alternative (Proxy :: * -> *) | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods empty :: Proxy a # (<|>) :: Proxy a -> Proxy a -> Proxy a # some :: Proxy a -> Proxy [a] # many :: Proxy a -> Proxy [a] #
(Functor m, Monad m) => Alternative (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods empty :: MaybeT m a # (<|>) :: MaybeT m a -> MaybeT m a -> MaybeT m a # some :: MaybeT m a -> MaybeT m [a] # many :: MaybeT m a -> MaybeT m [a] #
Applicative m => Alternative (ListT m) |
Instance details Defined in Control.Monad.Trans.List Methods empty :: ListT m a # (<|>) :: ListT m a -> ListT m a -> ListT m a # some :: ListT m a -> ListT m [a] # many :: ListT m a -> ListT m [a] #
Alternative (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods empty :: Parser s a # (<|>) :: Parser s a -> Parser s a -> Parser s a # some :: Parser s a -> Parser s [a] # many :: Parser s a -> Parser s [a] #
Alternative f => Alternative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: Rec1 f a # (<|>) :: Rec1 f a -> Rec1 f a -> Rec1 f a # some :: Rec1 f a -> Rec1 f [a] # many :: Rec1 f a -> Rec1 f [a] #
(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] #
Alternative f => Alternative (Alt f) |
Instance details Defined in Data.Semigroup.Internal Methods empty :: Alt f a # (<|>) :: Alt f a -> Alt f a -> Alt f a # some :: Alt f a -> Alt f [a] # many :: Alt f a -> Alt f [a] #
(Functor m, Monad m, Monoid e) => Alternative (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods empty :: ExceptT e m a # (<|>) :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a # some :: ExceptT e m a -> ExceptT e m [a] # many :: ExceptT e m a -> ExceptT e m [a] #
Alternative m => Alternative (IdentityT m) |
Instance details Defined in Control.Monad.Trans.Identity Methods empty :: IdentityT m a # (<|>) :: IdentityT m a -> IdentityT m a -> IdentityT m a # some :: IdentityT m a -> IdentityT m [a] # many :: IdentityT m a -> IdentityT m [a] #
(Functor m, Monad m, Error e) => Alternative (ErrorT e m) |
Instance details Defined in Control.Monad.Trans.Error Methods empty :: ErrorT e m a # (<|>) :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a # some :: ErrorT e m a -> ErrorT e m [a] # many :: ErrorT e m a -> ErrorT e m [a] #
(Functor m, MonadPlus m) => Alternative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods empty :: StateT s m a # (<|>) :: StateT s m a -> StateT s m a -> StateT s m a # some :: StateT s m a -> StateT s m [a] # many :: StateT s m a -> StateT s m [a] #
(Functor m, MonadPlus m) => Alternative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods empty :: StateT s m a # (<|>) :: StateT s m a -> StateT s m a -> StateT s m a # some :: StateT s m a -> StateT s m [a] # many :: StateT s m a -> StateT s m [a] #
(Monoid w, Alternative m) => Alternative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods empty :: WriterT w m a # (<|>) :: WriterT w m a -> WriterT w m a -> WriterT w m a # some :: WriterT w m a -> WriterT w m [a] # many :: WriterT w m a -> WriterT w m [a] #
(Monoid w, Alternative m) => Alternative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods empty :: WriterT w m a # (<|>) :: WriterT w m a -> WriterT w m a -> WriterT w m a # some :: WriterT w m a -> WriterT w m [a] # many :: WriterT w m a -> WriterT w m [a] #
(Alternative f, Alternative g) => Alternative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: (f :*: g) a # (<|>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a # some :: (f :*: g) a -> (f :*: g) [a] # many :: (f :*: g) a -> (f :*: g) [a] #
Alternative m => Alternative (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods empty :: ReaderT r m a # (<|>) :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a # some :: ReaderT r m a -> ReaderT r m [a] # many :: ReaderT r m a -> ReaderT r m [a] #
Alternative f => Alternative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: M1 i c f a # (<|>) :: M1 i c f a -> M1 i c f a -> M1 i c f a # some :: M1 i c f a -> M1 i c f [a] # many :: M1 i c f a -> M1 i c f [a] #
(Alternative f, Applicative g) => Alternative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods empty :: (f :.: g) a # (<|>) :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a # some :: (f :.: g) a -> (f :.: g) [a] # many :: (f :.: g) a -> (f :.: g) [a] #
(Monoid w, Functor m, MonadPlus m) => Alternative (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.Lazy Methods empty :: RWST r w s m a # (<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a # some :: RWST r w s m a -> RWST r w s m [a] # many :: RWST r w s m a -> RWST r w s m [a] #
(Monoid w, Functor m, MonadPlus m) => Alternative (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.Strict Methods empty :: RWST r w s m a # (<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a # some :: RWST r w s m a -> RWST r w s m [a] # many :: RWST r w s m a -> RWST r w s m [a] #

reparse :: 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.

stGet :: Parser s s #

Deliver the entire internal state.

stQuery :: (s -> a) -> Parser s a #

Query the internal state.

stUpdate :: (s -> s) -> Parser s () #

Update the internal state.

many1Satisfy :: (Char -> Bool) -> Parser s Text #

`many1Satisfy p` is a more efficient fused version of `many1 (satisfy p)`

manySatisfy :: (Char -> Bool) -> Parser s Text #

`manySatisfy p` is a more efficient fused version of `many (satisfy p)`

onFail :: 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.

satisfy :: (Char -> Bool) -> Parser s Char #

Return the next token if it satisfies the given predicate.

eof :: Parser s () #

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

next :: Parser s Char #

Simply return the next token in the input tokenstream.

newtype 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

P (s -> Text -> Result (Text, s) a) |

Instances

Monad (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods (>>=) :: Parser s a -> (a -> Parser s b) -> Parser s b # (>>) :: Parser s a -> Parser s b -> Parser s b # return :: a -> Parser s a # fail :: String -> Parser s a #
Functor (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods fmap :: (a -> b) -> Parser s a -> Parser s b # (<$) :: a -> Parser s b -> Parser s a #
Applicative (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods pure :: a -> Parser s a # (<*>) :: Parser s (a -> b) -> Parser s a -> Parser s b # liftA2 :: (a -> b -> c) -> Parser s a -> Parser s b -> Parser s c # (*>) :: Parser s a -> Parser s b -> Parser s b # (<*) :: Parser s a -> Parser s b -> Parser s a #
Alternative (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods empty :: Parser s a # (<|>) :: Parser s a -> Parser s a -> Parser s a # some :: Parser s a -> Parser s [a] # many :: Parser s a -> Parser s [a] #
Commitment (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods commit :: Parser s a -> Parser s a # adjustErr :: Parser s a -> (String -> String) -> Parser s a # oneOf' :: [(String, Parser s a)] -> Parser s a #
PolyParse (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText

data 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

Success z a |
Failure z String |
Committed (Result z a) |

Instances

Functor (Result z) |
Instance details Defined in Text.ParserCombinators.Poly.Result Methods fmap :: (a -> b) -> Result z a -> Result z b # (<$) :: a -> Result z b -> Result z a #

manyFinally' :: (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 `[]`.

manyFinally :: 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.

bracket :: 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`

bracketSep :: PolyParse p => p bra -> p sep -> p ket -> p a -> p [a] #

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

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

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

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

Parse a list of items separated by discarded junk.

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

Parse a non-empty list of items.

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

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

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

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

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

Parse the first alternative in the list that succeeds.

adjustErrBad :: PolyParse p => p a -> (String -> String) -> p a #

`adjustErrBad` is just like `adjustErr` except it also raises the severity of the error.

failBad :: 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.

discard :: PolyParse p => p a -> p b -> p a infixl 3 #

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

apply :: PolyParse p => p (a -> b) -> p a -> p b infixl 3 #

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

class Commitment (p :: * -> *) 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.

Minimal complete definition

commit, adjustErr, oneOf'

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.

Instances

Commitment (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods commit :: Parser s a -> Parser s a # adjustErr :: Parser s a -> (String -> String) -> Parser s a # oneOf' :: [(String, Parser s a)] -> Parser s a #

class (Functor p, Monad p, Applicative p, Alternative p, Commitment p) => PolyParse (p :: * -> *) #

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

Instances

PolyParse (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText

# The ParseDot class.

type Parse a = Parser GraphvizState a #

A `ReadS`-like type alias.

class ParseDot a where #

Minimal complete definition

parseUnqt

Methods

parseUnqt :: Parse a #

parse :: Parse a #

parseUnqtList :: Parse [a] #

parseList :: Parse [a] #

Instances

ParseDot Bool # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Bool # parse :: Parse Bool # parseUnqtList :: Parse [Bool] # parseList :: Parse [Bool] #
ParseDot Char # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Char # parse :: Parse Char # parseUnqtList :: Parse [Char] # parseList :: Parse [Char] #
ParseDot Double # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Double # parse :: Parse Double # parseUnqtList :: Parse [Double] # parseList :: Parse [Double] #
ParseDot Int # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Int # parse :: Parse Int # parseUnqtList :: Parse [Int] # parseList :: Parse [Int] #
ParseDot Integer # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Integer # parse :: Parse Integer # parseUnqtList :: Parse [Integer] # parseList :: Parse [Integer] #
ParseDot Word8 # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Word8 # parse :: Parse Word8 # parseUnqtList :: Parse [Word8] # parseList :: Parse [Word8] #
ParseDot Word16 # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Word16 # parse :: Parse Word16 # parseUnqtList :: Parse [Word16] # parseList :: Parse [Word16] #
ParseDot Version # | Ignores `versionTags` and assumes 'not . null . versionBranch' (usually you want 'length . versionBranch == 2') and that all such values are non-negative.
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Version # parse :: Parse Version # parseUnqtList :: Parse [Version] # parseList :: Parse [Version] #
ParseDot Text # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Text # parse :: Parse Text # parseUnqtList :: Parse [Text] # parseList :: Parse [Text] #
ParseDot Text # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Text # parse :: Parse Text # parseUnqtList :: Parse [Text] # parseList :: Parse [Text] #
ParseDot BrewerName # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse BrewerName # parse :: Parse BrewerName # parseUnqtList :: Parse [BrewerName] # parseList :: Parse [BrewerName] #
ParseDot BrewerScheme # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse BrewerScheme # parse :: Parse BrewerScheme # parseUnqtList :: Parse [BrewerScheme] # parseList :: Parse [BrewerScheme] #
ParseDot ColorScheme # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse ColorScheme # parse :: Parse ColorScheme # parseUnqtList :: Parse [ColorScheme] # parseList :: Parse [ColorScheme] #
ParseDot GraphvizCommand # |
Instance details Defined in Data.GraphViz.Commands.Available Methods parseUnqt :: Parse GraphvizCommand # parse :: Parse GraphvizCommand # parseUnqtList :: Parse [GraphvizCommand] # parseList :: Parse [GraphvizCommand] #
ParseDot CompassPoint # |
Instance details Defined in Data.GraphViz.Attributes.Internal Methods parseUnqt :: Parse CompassPoint # parse :: Parse CompassPoint # parseUnqtList :: Parse [CompassPoint] # parseList :: Parse [CompassPoint] #
ParseDot PortPos # |
Instance details Defined in Data.GraphViz.Attributes.Internal Methods parseUnqt :: Parse PortPos # parse :: Parse PortPos # parseUnqtList :: Parse [PortPos] # parseList :: Parse [PortPos] #
ParseDot PortName # |
Instance details Defined in Data.GraphViz.Attributes.Internal Methods parseUnqt :: Parse PortName # parse :: Parse PortName # parseUnqtList :: Parse [PortName] # parseList :: Parse [PortName] #
ParseDot X11Color # |
Instance details Defined in Data.GraphViz.Attributes.Colors.X11 Methods parseUnqt :: Parse X11Color # parse :: Parse X11Color # parseUnqtList :: Parse [X11Color] # parseList :: Parse [X11Color] #
ParseDot SVGColor # |
Instance details Defined in Data.GraphViz.Attributes.Colors.SVG Methods parseUnqt :: Parse SVGColor # parse :: Parse SVGColor # parseUnqtList :: Parse [SVGColor] # parseList :: Parse [SVGColor] #
ParseDot WeightedColor # |
Instance details Defined in Data.GraphViz.Attributes.Colors Methods parseUnqt :: Parse WeightedColor # parse :: Parse WeightedColor # parseUnqtList :: Parse [WeightedColor] # parseList :: Parse [WeightedColor] #
ParseDot Color # |
Instance details Defined in Data.GraphViz.Attributes.Colors Methods parseUnqt :: Parse Color # parse :: Parse Color # parseUnqtList :: Parse [Color] # parseList :: Parse [Color] #
ParseDot Style # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Style # parse :: Parse Style # parseUnqtList :: Parse [Style] # parseList :: Parse [Style] #
ParseDot Side # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Side # parse :: Parse Side # parseUnqtList :: Parse [Side] # parseList :: Parse [Side] #
ParseDot Scale # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Scale # parse :: Parse Scale # parseUnqtList :: Parse [Scale] # parseList :: Parse [Scale] #
ParseDot CellFormat # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse CellFormat # parse :: Parse CellFormat # parseUnqtList :: Parse [CellFormat] # parseList :: Parse [CellFormat] #
ParseDot VAlign # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse VAlign # parse :: Parse VAlign # parseUnqtList :: Parse [VAlign] # parseList :: Parse [VAlign] #
ParseDot Align # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Align # parse :: Parse Align # parseUnqtList :: Parse [Align] # parseList :: Parse [Align] #
ParseDot Attribute # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Attribute # parse :: Parse Attribute # parseUnqtList :: Parse [Attribute] # parseList :: Parse [Attribute] #
ParseDot Img # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Img # parse :: Parse Img # parseUnqtList :: Parse [Img] # parseList :: Parse [Img] #
ParseDot Cell # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Cell # parse :: Parse Cell # parseUnqtList :: Parse [Cell] # parseList :: Parse [Cell] #
ParseDot Row # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Row # parse :: Parse Row # parseUnqtList :: Parse [Row] # parseList :: Parse [Row] #
ParseDot Table # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Table # parse :: Parse Table # parseUnqtList :: Parse [Table] # parseList :: Parse [Table] #
ParseDot Format # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Format # parse :: Parse Format # parseUnqtList :: Parse [Format] # parseList :: Parse [Format] #
ParseDot TextItem # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse TextItem # parse :: Parse TextItem # parseUnqtList :: Parse [TextItem] # parseList :: Parse [TextItem] #
ParseDot Label # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Label # parse :: Parse Label # parseUnqtList :: Parse [Label] # parseList :: Parse [Label] #
ParseDot NodeSize # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse NodeSize # parse :: Parse NodeSize # parseUnqtList :: Parse [NodeSize] # parseList :: Parse [NodeSize] #
ParseDot Normalized # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Normalized # parse :: Parse Normalized # parseUnqtList :: Parse [Normalized] # parseList :: Parse [Normalized] #
ParseDot Number # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Number # parse :: Parse Number # parseUnqtList :: Parse [Number] # parseList :: Parse [Number] #
ParseDot Ratios # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Ratios # parse :: Parse Ratios # parseUnqtList :: Parse [Ratios] # parseList :: Parse [Ratios] #
ParseDot Justification # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Justification # parse :: Parse Justification # parseUnqtList :: Parse [Justification] # parseList :: Parse [Justification] #
ParseDot ScaleType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse ScaleType # parse :: Parse ScaleType # parseUnqtList :: Parse [ScaleType] # parseList :: Parse [ScaleType] #
ParseDot Paths # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Paths # parse :: Parse Paths # parseUnqtList :: Parse [Paths] # parseList :: Parse [Paths] #
ParseDot VerticalPlacement # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse VerticalPlacement # parse :: Parse VerticalPlacement # parseUnqtList :: Parse [VerticalPlacement] # parseList :: Parse [VerticalPlacement] #
ParseDot FocusType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse FocusType # parse :: Parse FocusType # parseUnqtList :: Parse [FocusType] # parseList :: Parse [FocusType] #
ParseDot ViewPort # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse ViewPort # parse :: Parse ViewPort # parseUnqtList :: Parse [ViewPort] # parseList :: Parse [ViewPort] #
ParseDot StyleName # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse StyleName # parse :: Parse StyleName # parseUnqtList :: Parse [StyleName] # parseList :: Parse [StyleName] #
ParseDot StyleItem # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse StyleItem # parse :: Parse StyleItem # parseUnqtList :: Parse [StyleItem] # parseList :: Parse [StyleItem] #
ParseDot STStyle # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse STStyle # parse :: Parse STStyle # parseUnqtList :: Parse [STStyle] # parseList :: Parse [STStyle] #
ParseDot StartType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse StartType # parse :: Parse StartType # parseUnqtList :: Parse [StartType] # parseList :: Parse [StartType] #
ParseDot SmoothType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse SmoothType # parse :: Parse SmoothType # parseUnqtList :: Parse [SmoothType] # parseList :: Parse [SmoothType] #
ParseDot Shape # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Shape # parse :: Parse Shape # parseUnqtList :: Parse [Shape] # parseList :: Parse [Shape] #
ParseDot RankDir # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse RankDir # parse :: Parse RankDir # parseUnqtList :: Parse [RankDir] # parseList :: Parse [RankDir] #
ParseDot RankType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse RankType # parse :: Parse RankType # parseUnqtList :: Parse [RankType] # parseList :: Parse [RankType] #
ParseDot Root # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Root # parse :: Parse Root # parseUnqtList :: Parse [Root] # parseList :: Parse [Root] #
ParseDot QuadType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse QuadType # parse :: Parse QuadType # parseUnqtList :: Parse [QuadType] # parseList :: Parse [QuadType] #
ParseDot Spline # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Spline # parse :: Parse Spline # parseUnqtList :: Parse [Spline] # parseList :: Parse [Spline] #
ParseDot PageDir # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse PageDir # parse :: Parse PageDir # parseUnqtList :: Parse [PageDir] # parseList :: Parse [PageDir] #
ParseDot EdgeType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse EdgeType # parse :: Parse EdgeType # parseUnqtList :: Parse [EdgeType] # parseList :: Parse [EdgeType] #
ParseDot Pos # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Pos # parse :: Parse Pos # parseUnqtList :: Parse [Pos] # parseList :: Parse [Pos] #
ParseDot PackMode # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse PackMode # parse :: Parse PackMode # parseUnqtList :: Parse [PackMode] # parseList :: Parse [PackMode] #
ParseDot Pack # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Pack # parse :: Parse Pack # parseUnqtList :: Parse [Pack] # parseList :: Parse [Pack] #
ParseDot OutputMode # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse OutputMode # parse :: Parse OutputMode # parseUnqtList :: Parse [OutputMode] # parseList :: Parse [OutputMode] #
ParseDot Order # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Order # parse :: Parse Order # parseUnqtList :: Parse [Order] # parseList :: Parse [Order] #
ParseDot LayerList # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerList # parse :: Parse LayerList # parseUnqtList :: Parse [LayerList] # parseList :: Parse [LayerList] #
ParseDot LayerID # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerID # parse :: Parse LayerID # parseUnqtList :: Parse [LayerID] # parseList :: Parse [LayerID] #
ParseDot LayerRangeElem # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerRangeElem # parse :: Parse LayerRangeElem # parseUnqtList :: Parse [LayerRangeElem] # parseList :: Parse [LayerRangeElem] #
ParseDot LayerListSep # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerListSep # parse :: Parse LayerListSep # parseUnqtList :: Parse [LayerListSep] # parseList :: Parse [LayerListSep] #
ParseDot LayerSep # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerSep # parse :: Parse LayerSep # parseUnqtList :: Parse [LayerSep] # parseList :: Parse [LayerSep] #
ParseDot Overlap # | Note that `overlap=false` defaults to ``PrismOverlap` Nothing`, but if the Prism library isn't available then it is equivalent to `VoronoiOverlap`.
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Overlap # parse :: Parse Overlap # parseUnqtList :: Parse [Overlap] # parseList :: Parse [Overlap] #
ParseDot Point # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Point # parse :: Parse Point # parseUnqtList :: Parse [Point] # parseList :: Parse [Point] #
ParseDot LabelScheme # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LabelScheme # parse :: Parse LabelScheme # parseUnqtList :: Parse [LabelScheme] # parseList :: Parse [LabelScheme] #
ParseDot RecordField # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse RecordField # parse :: Parse RecordField # parseUnqtList :: Parse [RecordField] # parseList :: Parse [RecordField] #
ParseDot Label # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Label # parse :: Parse Label # parseUnqtList :: Parse [Label] # parseList :: Parse [Label] #
ParseDot Model # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Model # parse :: Parse Model # parseUnqtList :: Parse [Model] # parseList :: Parse [Model] #
ParseDot ModeType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse ModeType # parse :: Parse ModeType # parseUnqtList :: Parse [ModeType] # parseList :: Parse [ModeType] #
ParseDot GraphSize # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse GraphSize # parse :: Parse GraphSize # parseUnqtList :: Parse [GraphSize] # parseList :: Parse [GraphSize] #
ParseDot SVGFontNames # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse SVGFontNames # parse :: Parse SVGFontNames # parseUnqtList :: Parse [SVGFontNames] # parseList :: Parse [SVGFontNames] #
ParseDot DPoint # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse DPoint # parse :: Parse DPoint # parseUnqtList :: Parse [DPoint] # parseList :: Parse [DPoint] #
ParseDot DEConstraints # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse DEConstraints # parse :: Parse DEConstraints # parseUnqtList :: Parse [DEConstraints] # parseList :: Parse [DEConstraints] #
ParseDot DirType # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse DirType # parse :: Parse DirType # parseUnqtList :: Parse [DirType] # parseList :: Parse [DirType] #
ParseDot ClusterMode # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse ClusterMode # parse :: Parse ClusterMode # parseUnqtList :: Parse [ClusterMode] # parseList :: Parse [ClusterMode] #
ParseDot Rect # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Rect # parse :: Parse Rect # parseUnqtList :: Parse [Rect] # parseList :: Parse [Rect] #
ParseDot ArrowSide # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowSide # parse :: Parse ArrowSide # parseUnqtList :: Parse [ArrowSide] # parseList :: Parse [ArrowSide] #
ParseDot ArrowFill # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowFill # parse :: Parse ArrowFill # parseUnqtList :: Parse [ArrowFill] # parseList :: Parse [ArrowFill] #
ParseDot ArrowModifier # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowModifier # parse :: Parse ArrowModifier # parseUnqtList :: Parse [ArrowModifier] # parseList :: Parse [ArrowModifier] #
ParseDot ArrowShape # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowShape # parse :: Parse ArrowShape # parseUnqtList :: Parse [ArrowShape] # parseList :: Parse [ArrowShape] #
ParseDot ArrowType # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowType # parse :: Parse ArrowType # parseUnqtList :: Parse [ArrowType] # parseList :: Parse [ArrowType] #
ParseDot Attribute # |
Instance details Defined in Data.GraphViz.Attributes.Complete Methods parseUnqt :: Parse Attribute # parse :: Parse Attribute # parseUnqtList :: Parse [Attribute] # parseList :: Parse [Attribute] #
ParseDot GlobalAttributes # |
Instance details Defined in Data.GraphViz.Types.Internal.Common Methods parseUnqt :: Parse GlobalAttributes # parse :: Parse GlobalAttributes # parseUnqtList :: Parse [GlobalAttributes] # parseList :: Parse [GlobalAttributes] #
ParseDot GraphID # |
Instance details Defined in Data.GraphViz.Types.Internal.Common Methods parseUnqt :: Parse GraphID # parse :: Parse GraphID # parseUnqtList :: Parse [GraphID] # parseList :: Parse [GraphID] #
ParseDot a => ParseDot [a] # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse [a] # parse :: Parse [a] # parseUnqtList :: Parse [[a]] # parseList :: Parse [[a]] #
ParseDot n => ParseDot (DotEdge n) # |
Instance details Defined in Data.GraphViz.Types.Internal.Common Methods parseUnqt :: Parse (DotEdge n) # parse :: Parse (DotEdge n) # parseUnqtList :: Parse [DotEdge n] # parseList :: Parse [DotEdge n] #
ParseDot n => ParseDot (DotNode n) # |
Instance details Defined in Data.GraphViz.Types.Internal.Common Methods parseUnqt :: Parse (DotNode n) # parse :: Parse (DotNode n) # parseUnqtList :: Parse [DotNode n] # parseList :: Parse [DotNode n] #
ParseDot n => ParseDot (DotSubGraph n) # |
Instance details Defined in Data.GraphViz.Types.Canonical Methods parseUnqt :: Parse (DotSubGraph n) # parse :: Parse (DotSubGraph n) # parseUnqtList :: Parse [DotSubGraph n] # parseList :: Parse [DotSubGraph n] #
ParseDot n => ParseDot (DotStatements n) # |
Instance details Defined in Data.GraphViz.Types.Canonical Methods parseUnqt :: Parse (DotStatements n) # parse :: Parse (DotStatements n) # parseUnqtList :: Parse [DotStatements n] # parseList :: Parse [DotStatements n] #
ParseDot n => ParseDot (DotGraph n) # |
Instance details Defined in Data.GraphViz.Types.Canonical Methods parseUnqt :: Parse (DotGraph n) # parse :: Parse (DotGraph n) # parseUnqtList :: Parse [DotGraph n] # parseList :: Parse [DotGraph n] #
ParseDot n => ParseDot (DotSubGraph n) # |
Instance details Defined in Data.GraphViz.Types.Generalised Methods parseUnqt :: Parse (DotSubGraph n) # parse :: Parse (DotSubGraph n) # parseUnqtList :: Parse [DotSubGraph n] # parseList :: Parse [DotSubGraph n] #
ParseDot n => ParseDot (DotStatement n) # |
Instance details Defined in Data.GraphViz.Types.Generalised Methods parseUnqt :: Parse (DotStatement n) # parse :: Parse (DotStatement n) # parseUnqtList :: Parse [DotStatement n] # parseList :: Parse [DotStatement n] #
ParseDot n => ParseDot (DotGraph n) # |
Instance details Defined in Data.GraphViz.Types.Generalised Methods parseUnqt :: Parse (DotGraph n) # parse :: Parse (DotGraph n) # parseUnqtList :: Parse [DotGraph n] # parseList :: Parse [DotGraph n] #
(Ord n, ParseDot n) => ParseDot (DotGraph n) # | Uses the ParseDot instance for generalised `DotGraph`s.
Instance details Defined in Data.GraphViz.Types.Graph Methods parseUnqt :: Parse (DotGraph n) # parse :: Parse (DotGraph n) # parseUnqtList :: Parse [DotGraph n] # parseList :: Parse [DotGraph n] #

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

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

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

runParser :: Parse a -> Text -> (Either String a, Text) #

runParser' :: 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).

runParserWith :: (GraphvizState -> GraphvizState) -> Parse a -> Text -> (Either String a, Text) #

parseLiberally :: GraphvizState -> GraphvizState #

checkValidParse :: Either String a -> a #

If unable to parse Dot code properly, `throw` a `GraphvizException`.

checkValidParseWithRest :: (Either String a, Text) -> a #

If unable to parse Dot code properly, `throw` a `GraphvizException`, with the error containing the remaining unparsed code..

# Convenience parsing combinators.

ignoreSep :: (a -> b -> c) -> Parse a -> Parse sep -> Parse b -> Parse c #

The opposite of `bracket`.

onlyBool :: Parse Bool #

Use this when you do not want numbers to be treated as `Bool` values.

quotelessString :: Parse Text #

Parse a `Text` that doesn't need to be quoted.

stringBlock :: Parse Text #

numString :: Bool -> Parse Text #

isNumString :: Bool -> Text -> Bool #

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

isIntString :: Text -> Bool #

quotedString :: Parse Text #

Used when quotes are explicitly required;

parseEscaped :: Bool -> [Char] -> [Char] -> Parse Text #

Parse a `Text` where the provided `Char`s (as well as `"` and `\`) are escaped and the second list of `Char`s are those that are not permitted. Note: does not parse surrounding quotes. The `Bool` value indicates whether empty `Text`s are allowed or not.

parseAndSpace :: Parse a -> Parse a #

string :: String -> Parse () #

strings :: [String] -> Parse () #

character :: Char -> Parse Char #

Assumes that any letter is ASCII for case-insensitive comparisons.

parseStrictFloat :: Bool -> Parse Double #

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

parseSignedFloat :: Bool -> Parse Double #

noneOf :: [Char] -> Parse Char #

whitespace1 :: Parse () #

Parses at least one whitespace character.

whitespace :: Parse () #

Parses zero or more whitespace characters.

wrapWhitespace :: Parse a -> Parse a #

Parse and discard optional surrounding whitespace.

optionalQuotedString :: String -> Parse () #

optionalQuoted :: Parse a -> Parse a #

quotedParse :: Parse a -> Parse a #

orQuote :: Parse Char -> Parse Char #

quoteChar :: Char #

newline :: Parse () #

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.

parseComma :: Parse () #

parseEq :: Parse () #

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

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

tryParseList' :: Parse [a] -> Parse [a] #

Return an empty list if parsing a list fails.

consumeLine :: Parse Text #

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

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 #