graphviz-2999.20.2.1: 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-Inferred
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

- class Functor f => Applicative (f :: Type -> Type) where
  - pure :: a -> f a
  - (<*>) :: f (a -> b) -> f a -> f b
  - liftA2 :: (a -> b -> c) -> f a -> f b -> f c
  - (*>) :: f a -> f b -> f b
  - (<*) :: f a -> f b -> f a
- class Applicative f => Alternative (f :: Type -> Type) where
  - (<|>) :: f a -> f a -> f a
  - some :: f a -> f [a]
  - many :: f a -> f [a]
- (<$) :: Functor f => a -> f b -> f a
- (<**>) :: Applicative f => f a -> f (a -> b) -> f b
- liftA :: Applicative f => (a -> b) -> f a -> f b
- liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- satisfy :: (Char -> Bool) -> Parser s Char
- eof :: Parser s ()
- optional :: Alternative f => f a -> f (Maybe a)
- many1 :: PolyParse p => p a -> p [a]
- sepBy :: PolyParse p => p a -> p sep -> p [a]
- sepBy1 :: PolyParse p => p a -> p sep -> p [a]
- apply :: PolyParse p => p (a -> b) -> p a -> p b
- asum :: (Foldable t, Alternative f) => t (f a) -> f a
- newtype Const a (b :: k) = Const {
  - getConst :: a
  }
- bracket :: PolyParse p => p bra -> p ket -> p a -> p a
- newtype ZipList a = ZipList {
  - getZipList :: [a]
  }
- newtype WrappedArrow (a :: Type -> Type -> Type) b c = WrapArrow {
  - unwrapArrow :: a b c
  }
- newtype WrappedMonad (m :: Type -> Type) a = WrapMonad {
  - unwrapMonad :: m a
  }
- 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)
- reparse :: Text -> Parser s ()
- class (Functor p, Monad p, MonadFail p, Applicative p, Alternative p, Commitment p) => PolyParse (p :: Type -> Type)
- class Commitment (p :: Type -> Type) where
  - commit :: p a -> p a
  - adjustErr :: p a -> (String -> String) -> p a
  - oneOf' :: [(String, p a)] -> p a
- discard :: PolyParse p => p a -> p b -> p a
- failBad :: PolyParse p => String -> p a
- adjustErrBad :: PolyParse p => p a -> (String -> String) -> p a
- oneOf :: PolyParse p => [p a] -> p a
- exactly :: PolyParse p => Int -> p a -> p [a]
- upto :: PolyParse p => Int -> p a -> p [a]
- bracketSep :: PolyParse p => p bra -> p sep -> p ket -> p a -> p [a]
- manyFinally :: PolyParse p => p a -> p z -> p [a]
- manyFinally' :: (PolyParse p, Show a) => p a -> p z -> p [a]
- onFail :: Parser s a -> Parser s a -> Parser s a
- next :: Parser s Char
- manySatisfy :: (Char -> Bool) -> Parser s Text
- many1Satisfy :: (Char -> Bool) -> Parser s Text
- stUpdate :: (s -> s) -> Parser s ()
- stQuery :: (s -> a) -> Parser s a
- stGet :: Parser s s
- type Parse a = Parser GraphvizState a
- class ParseDot a where
  - parseUnqt :: Parse a
  - parse :: Parse a
  - parseUnqtList :: Parse [a]
  - parseList :: Parse [a]
- 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.

class Functor f => Applicative (f :: Type -> Type) where Source #

A functor with application, providing operations to

- embed pure expressions (`pure`), and
- sequence computations and combine their results (`<*>` and `liftA2`).

A minimal complete definition must include implementations of `pure` and of either `<*>` or `liftA2`. If it defines both, then they must behave the same as their default definitions:

    (<*>) = liftA2 id

    liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

Identity

      pure id <*> v = v

Composition

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

Homomorphism

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

Interchange

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

The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:

-     u *> v = (id <$ u) <*> v

-     u <* v = liftA2 const u v

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

-     fmap f x = pure f <*> x

It may be useful to note that supposing

    forall x y. p (q x y) = f x . g y

it follows from the above that

    liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v

If `f` is also a `Monad`, it should satisfy

-     pure = return

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

-     (*>) = (>>)

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

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a Source #

Lift a value into the Structure.

#### Examples

Expand

    >>> pure 1 :: Maybe Int
    Just 1

    >>> pure 'z' :: [Char]
    "z"

    >>> pure (pure ":D") :: Maybe [String]
    Just [":D"]

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

Sequential application.

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

#### Example

Expand

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

    >>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}

    >>> produceFoo :: Applicative f => f Foo
    >>> produceBar :: Applicative f => f Bar
    >>> produceBaz :: Applicative f => f Baz

    >>> mkState :: Applicative f => f MyState
    >>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz

liftA2 :: (a -> b -> c) -> f a -> f b -> f c Source #

Lift a binary function to actions.

Some functors support an implementation of `liftA2` that is more efficient than the default one. In particular, if `fmap` is an expensive operation, it is likely better to use `liftA2` than to `fmap` over the structure and then use `<*>`.

This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of `<*>` and `fmap`.

#### Example

Expand

    >>> liftA2 (,) (Just 3) (Just 5)
    Just (3,5)

    >>> liftA2 (+) [1, 2, 3] [4, 5, 6]
    [5,6,7,6,7,8,7,8,9]

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

Sequence actions, discarding the value of the first argument.

#### Examples

Expand

If used in conjunction with the Applicative instance for `Maybe`, you can chain Maybe computations, with a possible "early return" in case of `Nothing`.

    >>> Just 2 *> Just 3
    Just 3

    >>> Nothing *> Just 3
    Nothing

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

    >>> import Data.Char
    >>> import GHC.Internal.Text.ParserCombinators.ReadP
    >>> let p = string "my name is " *> munch1 isAlpha <* eof
    >>> readP_to_S p "my name is Simon"
    [("Simon","")]

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

Sequence actions, discarding the value of the second argument.

#### Instances

Instances details

Applicative Complex | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods pure :: a -> Complex a Source # (<*>) :: Complex (a -> b) -> Complex a -> Complex b Source # liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c Source # (*>) :: Complex a -> Complex b -> Complex b Source # (<*) :: Complex a -> Complex b -> Complex a Source #
Applicative First | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> First a Source # (<*>) :: First (a -> b) -> First a -> First b Source # liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source # (*>) :: First a -> First b -> First b Source # (<*) :: First a -> First b -> First a Source #
Applicative Last | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Last a Source # (<*>) :: Last (a -> b) -> Last a -> Last b Source # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source # (*>) :: Last a -> Last b -> Last b Source # (<*) :: Last a -> Last b -> Last a Source #
Applicative Max | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Max a Source # (<*>) :: Max (a -> b) -> Max a -> Max b Source # liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c Source # (*>) :: Max a -> Max b -> Max b Source # (<*) :: Max a -> Max b -> Max a Source #
Applicative Min | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Min a Source # (<*>) :: Min (a -> b) -> Min a -> Min b Source # liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c Source # (*>) :: Min a -> Min b -> Min b Source # (<*) :: Min a -> Min b -> Min a Source #
Applicative Put |
Instance details Defined in Data.ByteString.Builder.Internal Methods pure :: a -> Put a Source # (<*>) :: Put (a -> b) -> Put a -> Put b Source # liftA2 :: (a -> b -> c) -> Put a -> Put b -> Put c Source # (*>) :: Put a -> Put b -> Put b Source # (<*) :: Put a -> Put b -> Put a Source #
Applicative RGB |
Instance details Defined in Data.Colour.RGB Methods pure :: a -> RGB a Source # (<*>) :: RGB (a -> b) -> RGB a -> RGB b Source # liftA2 :: (a -> b -> c) -> RGB a -> RGB b -> RGB c Source # (*>) :: RGB a -> RGB b -> RGB b Source # (<*) :: RGB a -> RGB b -> RGB a Source #
Applicative Seq | Since: containers-0.5.4
Instance details Defined in Data.Sequence.Internal Methods pure :: a -> Seq a Source # (<*>) :: Seq (a -> b) -> Seq a -> Seq b Source # liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c Source # (*>) :: Seq a -> Seq b -> Seq b Source # (<*) :: Seq a -> Seq b -> Seq a Source #
Applicative Tree |
Instance details Defined in Data.Tree Methods pure :: a -> Tree a Source # (<*>) :: Tree (a -> b) -> Tree a -> Tree b Source # liftA2 :: (a -> b -> c) -> Tree a -> Tree b -> Tree c Source # (*>) :: Tree a -> Tree b -> Tree b Source # (<*) :: Tree a -> Tree b -> Tree a Source #
Applicative DList |
Instance details Defined in Data.DList.Internal Methods pure :: a -> DList a Source # (<*>) :: DList (a -> b) -> DList a -> DList b Source # liftA2 :: (a -> b -> c) -> DList a -> DList b -> DList c Source # (*>) :: DList a -> DList b -> DList b Source # (<*) :: DList a -> DList b -> DList a Source #
Applicative NonEmpty | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Base Methods pure :: a -> NonEmpty a Source # (<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b Source # liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c Source # (*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b Source # (<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a Source #
Applicative STM | Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Conc.Sync Methods pure :: a -> STM a Source # (<*>) :: STM (a -> b) -> STM a -> STM b Source # liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c Source # (*>) :: STM a -> STM b -> STM b Source # (<*) :: STM a -> STM b -> STM a Source #
Applicative Identity | Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Functor.Identity Methods pure :: a -> Identity a Source # (<*>) :: Identity (a -> b) -> Identity a -> Identity b Source # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source # (*>) :: Identity a -> Identity b -> Identity b Source # (<*) :: Identity a -> Identity b -> Identity a Source #

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 GHC.Internal.Functor.ZipList Methods pure :: a -> ZipList a Source # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b Source # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source # (*>) :: ZipList a -> ZipList b -> ZipList b Source # (<*) :: ZipList a -> ZipList b -> ZipList a Source #
Applicative Par1 | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods pure :: a -> Par1 a Source # (<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b Source # liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c Source # (*>) :: Par1 a -> Par1 b -> Par1 b Source # (<*) :: Par1 a -> Par1 b -> Par1 a Source #
Applicative P | Since: base-4.5.0.0
Instance details Defined in GHC.Internal.Text.ParserCombinators.ReadP Methods pure :: a -> P a Source # (<*>) :: P (a -> b) -> P a -> P b Source # liftA2 :: (a -> b -> c) -> P a -> P b -> P c Source # (*>) :: P a -> P b -> P b Source # (<*) :: P a -> P b -> P a Source #
Applicative ReadP | Since: base-4.6.0.0
Instance details Defined in GHC.Internal.Text.ParserCombinators.ReadP Methods pure :: a -> ReadP a Source # (<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b Source # liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c Source # (*>) :: ReadP a -> ReadP b -> ReadP b Source # (<*) :: ReadP a -> ReadP b -> ReadP a Source #
Applicative ReadPrec | Since: base-4.6.0.0
Instance details Defined in GHC.Internal.Text.ParserCombinators.ReadPrec Methods pure :: a -> ReadPrec a Source # (<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b Source # liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c Source # (*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b Source # (<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a Source #
Applicative IO | Since: base-2.1
Instance details Defined in GHC.Internal.Base Methods pure :: a -> IO a Source # (<*>) :: IO (a -> b) -> IO a -> IO b Source # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c Source # (*>) :: IO a -> IO b -> IO b Source # (<*) :: IO a -> IO b -> IO a Source #
Applicative DotCodeM Source # |
Instance details Defined in Data.GraphViz.Printing Methods pure :: a -> DotCodeM a Source # (<*>) :: DotCodeM (a -> b) -> DotCodeM a -> DotCodeM b Source # liftA2 :: (a -> b -> c) -> DotCodeM a -> DotCodeM b -> DotCodeM c Source # (*>) :: DotCodeM a -> DotCodeM b -> DotCodeM b Source # (<*) :: DotCodeM a -> DotCodeM b -> DotCodeM a Source #
Applicative Parser |
Instance details Defined in Text.ParserCombinators.HuttonMeijer Methods pure :: a -> Parser a Source # (<*>) :: Parser (a -> b) -> Parser a -> Parser b Source # liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c Source # (*>) :: Parser a -> Parser b -> Parser b Source # (<*) :: Parser a -> Parser b -> Parser a Source #
Applicative Parser |
Instance details Defined in Text.ParserCombinators.Poly.ByteString Methods pure :: a -> Parser a Source # (<*>) :: Parser (a -> b) -> Parser a -> Parser b Source # liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c Source # (*>) :: Parser a -> Parser b -> Parser b Source # (<*) :: Parser a -> Parser b -> Parser a Source #
Applicative Parser |
Instance details Defined in Text.ParserCombinators.Poly.ByteStringChar Methods pure :: a -> Parser a Source # (<*>) :: Parser (a -> b) -> Parser a -> Parser b Source # liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c Source # (*>) :: Parser a -> Parser b -> Parser b Source # (<*) :: Parser a -> Parser b -> Parser a Source #
Applicative Parser |
Instance details Defined in Text.ParserCombinators.Poly.Text Methods pure :: a -> Parser a Source # (<*>) :: Parser (a -> b) -> Parser a -> Parser b Source # liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c Source # (*>) :: Parser a -> Parser b -> Parser b Source # (<*) :: Parser a -> Parser b -> Parser a Source #
Applicative Q |
Instance details Defined in Language.Haskell.TH.Syntax Methods pure :: a -> Q a Source # (<*>) :: Q (a -> b) -> Q a -> Q b Source # liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c Source # (*>) :: Q a -> Q b -> Q b Source # (<*) :: Q a -> Q b -> Q a Source #
Applicative Maybe | Since: base-2.1
Instance details Defined in GHC.Internal.Base Methods pure :: a -> Maybe a Source # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b Source # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c Source # (*>) :: Maybe a -> Maybe b -> Maybe b Source # (<*) :: Maybe a -> Maybe b -> Maybe a Source #
Applicative Solo | Since: base-4.15
Instance details Defined in GHC.Internal.Base Methods pure :: a -> Solo a Source # (<*>) :: Solo (a -> b) -> Solo a -> Solo b Source # liftA2 :: (a -> b -> c) -> Solo a -> Solo b -> Solo c Source # (*>) :: Solo a -> Solo b -> Solo b Source # (<*) :: Solo a -> Solo b -> Solo a Source #
Applicative [] | Since: base-2.1
Instance details Defined in GHC.Internal.Base Methods pure :: a -> [a] Source # (<*>) :: [a -> b] -> [a] -> [b] Source # liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] Source # (*>) :: [a] -> [b] -> [b] Source # (<*) :: [a] -> [b] -> [a] Source #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> WrappedMonad m a Source #

(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source #

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source #

(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source #

(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a Source #

Applicative (SetM s) |
Instance details Defined in Data.Graph Methods pure :: a -> SetM s a Source # (<*>) :: SetM s (a -> b) -> SetM s a -> SetM s b Source # liftA2 :: (a -> b -> c) -> SetM s a -> SetM s b -> SetM s c Source # (*>) :: SetM s a -> SetM s b -> SetM s b Source # (<*) :: SetM s a -> SetM s b -> SetM s a Source #
Arrow a => Applicative (ArrowMonad a) | Since: base-4.6.0.0

Instance details

Defined in GHC.Internal.Control.Arrow

Methods

pure :: a0 -> ArrowMonad a a0 Source #

(<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b Source #

liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c Source #

(*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source #

(<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 Source #

Applicative (Either e) | Since: base-3.0
Instance details Defined in GHC.Internal.Data.Either Methods pure :: a -> Either e a Source # (<*>) :: Either e (a -> b) -> Either e a -> Either e b Source # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c Source # (*>) :: Either e a -> Either e b -> Either e b Source # (<*) :: Either e a -> Either e b -> Either e a Source #
Applicative (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods pure :: a -> U1 a Source # (<*>) :: U1 (a -> b) -> U1 a -> U1 b Source # liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c Source # (*>) :: U1 a -> U1 b -> U1 b Source # (<*) :: U1 a -> U1 b -> U1 a Source #
Applicative (DotM n) Source # |
Instance details Defined in Data.GraphViz.Types.Monadic Methods pure :: a -> DotM n a Source # (<*>) :: DotM n (a -> b) -> DotM n a -> DotM n b Source # liftA2 :: (a -> b -> c) -> DotM n a -> DotM n b -> DotM n c Source # (*>) :: DotM n a -> DotM n b -> DotM n b Source # (<*) :: DotM n a -> DotM n b -> DotM n a Source #
Applicative (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Lazy Methods pure :: a -> Parser t a Source # (<*>) :: Parser t (a -> b) -> Parser t a -> Parser t b Source # liftA2 :: (a -> b -> c) -> Parser t a -> Parser t b -> Parser t c Source # (*>) :: Parser t a -> Parser t b -> Parser t b Source # (<*) :: Parser t a -> Parser t b -> Parser t a Source #
Applicative (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Lex Methods pure :: a -> Parser t a Source # (<*>) :: Parser t (a -> b) -> Parser t a -> Parser t b Source # liftA2 :: (a -> b -> c) -> Parser t a -> Parser t b -> Parser t c Source # (*>) :: Parser t a -> Parser t b -> Parser t b Source # (<*) :: Parser t a -> Parser t b -> Parser t a Source #
Applicative (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Parser Methods pure :: a -> Parser t a Source # (<*>) :: Parser t (a -> b) -> Parser t a -> Parser t b Source # liftA2 :: (a -> b -> c) -> Parser t a -> Parser t b -> Parser t c Source # (*>) :: Parser t a -> Parser t b -> Parser t b Source # (<*) :: Parser t a -> Parser t b -> Parser t a Source #
Applicative (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods pure :: a -> Parser s a Source # (<*>) :: Parser s (a -> b) -> Parser s a -> Parser s b Source # liftA2 :: (a -> b -> c) -> Parser s a -> Parser s b -> Parser s c Source # (*>) :: Parser s a -> Parser s b -> Parser s b Source # (<*) :: Parser s a -> Parser s b -> Parser s a Source #
Applicative (IParser t) |
Instance details Defined in Data.Text.Internal.Read Methods pure :: a -> IParser t a Source # (<*>) :: IParser t (a -> b) -> IParser t a -> IParser t b Source # liftA2 :: (a -> b -> c) -> IParser t a -> IParser t b -> IParser t c Source # (*>) :: IParser t a -> IParser t b -> IParser t b Source # (<*) :: IParser t a -> IParser t b -> IParser t a Source #
(Functor m, Monad m) => Applicative (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods pure :: a -> MaybeT m a Source # (<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b Source # liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c Source # (*>) :: MaybeT m a -> MaybeT m b -> MaybeT m b Source # (<*) :: MaybeT m a -> MaybeT m b -> MaybeT m a Source #

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.Internal.Base Methods pure :: a0 -> (a, a0) Source # (<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) Source # liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) Source # (*>) :: (a, a0) -> (a, b) -> (a, b) Source # (<*) :: (a, a0) -> (a, b) -> (a, a0) Source #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a0 -> WrappedArrow a b a0 Source #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #

(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 Source #

(<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b Source #

liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c Source #

(*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b Source #

(<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a Source #

Monad m => Applicative (GT m g) |
Instance details Defined in Data.Graph.Inductive.Query.Monad Methods pure :: a -> GT m g a Source # (<*>) :: GT m g (a -> b) -> GT m g a -> GT m g b Source # liftA2 :: (a -> b -> c) -> GT m g a -> GT m g b -> GT m g c Source # (*>) :: GT m g a -> GT m g b -> GT m g b Source # (<*) :: GT m g a -> GT m g b -> GT m g a Source #
Applicative m => Applicative (Kleisli m a) | Since: base-4.14.0.0
Instance details Defined in GHC.Internal.Control.Arrow Methods pure :: a0 -> Kleisli m a a0 Source # (<*>) :: Kleisli m a (a0 -> b) -> Kleisli m a a0 -> Kleisli m a b Source # liftA2 :: (a0 -> b -> c) -> Kleisli m a a0 -> Kleisli m a b -> Kleisli m a c Source # (*>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b Source # (<*) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a a0 Source #
Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1
Instance details Defined in GHC.Internal.Data.Functor.Const Methods pure :: a -> Const m a Source # (<*>) :: Const m (a -> b) -> Const m a -> Const m b Source # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source # (*>) :: Const m a -> Const m b -> Const m b Source # (<*) :: Const m a -> Const m b -> Const m a Source #
(Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f) | Since: base-4.17.0.0

Instance details

Defined in GHC.Internal.Generics

Methods

pure :: a -> Generically1 f a Source #

(<*>) :: Generically1 f (a -> b) -> Generically1 f a -> Generically1 f b Source #

liftA2 :: (a -> b -> c) -> Generically1 f a -> Generically1 f b -> Generically1 f c Source #

(*>) :: Generically1 f a -> Generically1 f b -> Generically1 f b Source #

(<*) :: Generically1 f a -> Generically1 f b -> Generically1 f a Source #

Applicative f => Applicative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods pure :: a -> Rec1 f a Source # (<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b Source # liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c Source # (*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b Source # (<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a Source #
Applicative (t m) => Applicative (LiftingAccum t m) | Since: mtl-2.3

Instance details

Defined in Control.Monad.Accum

Methods

pure :: a -> LiftingAccum t m a Source #

(<*>) :: LiftingAccum t m (a -> b) -> LiftingAccum t m a -> LiftingAccum t m b Source #

liftA2 :: (a -> b -> c) -> LiftingAccum t m a -> LiftingAccum t m b -> LiftingAccum t m c Source #

(*>) :: LiftingAccum t m a -> LiftingAccum t m b -> LiftingAccum t m b Source #

(<*) :: LiftingAccum t m a -> LiftingAccum t m b -> LiftingAccum t m a Source #

Applicative (t m) => Applicative (LiftingSelect t m) | Since: mtl-2.3

Instance details

Defined in Control.Monad.Select

Methods

pure :: a -> LiftingSelect t m a Source #

(<*>) :: LiftingSelect t m (a -> b) -> LiftingSelect t m a -> LiftingSelect t m b Source #

liftA2 :: (a -> b -> c) -> LiftingSelect t m a -> LiftingSelect t m b -> LiftingSelect t m c Source #

(*>) :: LiftingSelect t m a -> LiftingSelect t m b -> LiftingSelect t m b Source #

(<*) :: LiftingSelect t m a -> LiftingSelect t m b -> LiftingSelect t m a Source #

Applicative (Parser s t) |
Instance details Defined in Text.ParserCombinators.Poly.StateLazy Methods pure :: a -> Parser s t a Source # (<*>) :: Parser s t (a -> b) -> Parser s t a -> Parser s t b Source # liftA2 :: (a -> b -> c) -> Parser s t a -> Parser s t b -> Parser s t c Source # (*>) :: Parser s t a -> Parser s t b -> Parser s t b Source # (<*) :: Parser s t a -> Parser s t b -> Parser s t a Source #
Applicative (Parser s t) |
Instance details Defined in Text.ParserCombinators.Poly.StateParser Methods pure :: a -> Parser s t a Source # (<*>) :: Parser s t (a -> b) -> Parser s t a -> Parser s t b Source # liftA2 :: (a -> b -> c) -> Parser s t a -> Parser s t b -> Parser s t c Source # (*>) :: Parser s t a -> Parser s t b -> Parser s t b Source # (<*) :: Parser s t a -> Parser s t b -> Parser s t a Source #
(Monoid w, Functor m, Monad m) => Applicative (AccumT w m) |
Instance details Defined in Control.Monad.Trans.Accum Methods pure :: a -> AccumT w m a Source # (<*>) :: AccumT w m (a -> b) -> AccumT w m a -> AccumT w m b Source # liftA2 :: (a -> b -> c) -> AccumT w m a -> AccumT w m b -> AccumT w m c Source # (*>) :: AccumT w m a -> AccumT w m b -> AccumT w m b Source # (<*) :: AccumT w m a -> AccumT w m b -> AccumT w m a Source #
(Functor m, Monad m) => Applicative (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods pure :: a -> ExceptT e m a Source # (<*>) :: ExceptT e m (a -> b) -> ExceptT e m a -> ExceptT e m b Source # liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c Source # (*>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b Source # (<*) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m a Source #
Applicative m => Applicative (IdentityT m) |
Instance details Defined in Control.Monad.Trans.Identity Methods pure :: a -> IdentityT m a Source # (<*>) :: IdentityT m (a -> b) -> IdentityT m a -> IdentityT m b Source # liftA2 :: (a -> b -> c) -> IdentityT m a -> IdentityT m b -> IdentityT m c Source # (*>) :: IdentityT m a -> IdentityT m b -> IdentityT m b Source # (<*) :: IdentityT m a -> IdentityT m b -> IdentityT m a Source #
Applicative m => Applicative (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods pure :: a -> ReaderT r m a Source # (<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b Source # liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c Source # (*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b Source # (<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a Source #
(Functor m, Monad m) => Applicative (SelectT r m) |
Instance details Defined in Control.Monad.Trans.Select Methods pure :: a -> SelectT r m a Source # (<*>) :: SelectT r m (a -> b) -> SelectT r m a -> SelectT r m b Source # liftA2 :: (a -> b -> c) -> SelectT r m a -> SelectT r m b -> SelectT r m c Source # (*>) :: SelectT r m a -> SelectT r m b -> SelectT r m b Source # (<*) :: SelectT r m a -> SelectT r m b -> SelectT r m a Source #
(Functor m, Monad m) => Applicative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods pure :: a -> StateT s m a Source # (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b Source # liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c Source # (*>) :: StateT s m a -> StateT s m b -> StateT s m b Source # (<*) :: StateT s m a -> StateT s m b -> StateT s m a Source #
(Functor m, Monad m) => Applicative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods pure :: a -> StateT s m a Source # (<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b Source # liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c Source # (*>) :: StateT s m a -> StateT s m b -> StateT s m b Source # (<*) :: StateT s m a -> StateT s m b -> StateT s m a Source #
(Functor m, Monad m) => Applicative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.CPS Methods pure :: a -> WriterT w m a Source # (<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b Source # liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c Source # (*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b Source # (<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a Source #
(Monoid w, Applicative m) => Applicative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods pure :: a -> WriterT w m a Source # (<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b Source # liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c Source # (*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b Source # (<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a Source #
(Monoid w, Applicative m) => Applicative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods pure :: a -> WriterT w m a Source # (<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b Source # liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c Source # (*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b Source # (<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a Source #
(Monoid a, Monoid b) => Applicative ((,,) a b) | Since: base-4.14.0.0
Instance details Defined in GHC.Internal.Base Methods pure :: a0 -> (a, b, a0) Source # (<*>) :: (a, b, a0 -> b0) -> (a, b, a0) -> (a, b, b0) Source # liftA2 :: (a0 -> b0 -> c) -> (a, b, a0) -> (a, b, b0) -> (a, b, c) Source # (*>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) Source # (<*) :: (a, b, a0) -> (a, b, b0) -> (a, b, a0) Source #
(Applicative f, Applicative g) => Applicative (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods pure :: a -> Product f g a Source # (<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b Source # liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c Source # (*>) :: Product f g a -> Product f g b -> Product f g b Source # (<*) :: Product f g a -> Product f g b -> Product f g a Source #
(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 Source #

(<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b Source #

liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c Source #

(*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b Source #

(<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a Source #

(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 Source #

(<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b Source #

liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c Source #

(*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b Source #

(<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a Source #

(Applicative f, Applicative g) => Applicative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods pure :: a -> (f :*: g) a Source # (<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b Source # liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c Source # (*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b Source # (<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a Source #
Monoid c => Applicative (K1 i c :: Type -> Type) | Since: base-4.12.0.0
Instance details Defined in GHC.Internal.Generics Methods pure :: a -> K1 i c a Source # (<*>) :: K1 i c (a -> b) -> K1 i c a -> K1 i c b Source # liftA2 :: (a -> b -> c0) -> K1 i c a -> K1 i c b -> K1 i c c0 Source # (*>) :: K1 i c a -> K1 i c b -> K1 i c b Source # (<*) :: K1 i c a -> K1 i c b -> K1 i c a Source #
Applicative (Parser s t e) |

Instance details

Defined in Text.ParserCombinators.HuttonMeijerWallace

Methods

pure :: a -> Parser s t e a Source #

(<*>) :: Parser s t e (a -> b) -> Parser s t e a -> Parser s t e b Source #

liftA2 :: (a -> b -> c) -> Parser s t e a -> Parser s t e b -> Parser s t e c Source #

(*>) :: Parser s t e a -> Parser s t e b -> Parser s t e b Source #

(<*) :: Parser s t e a -> Parser s t e b -> Parser s t e a Source #

Applicative (ContT r m) |
Instance details Defined in Control.Monad.Trans.Cont Methods pure :: a -> ContT r m a Source # (<*>) :: ContT r m (a -> b) -> ContT r m a -> ContT r m b Source # liftA2 :: (a -> b -> c) -> ContT r m a -> ContT r m b -> ContT r m c Source # (*>) :: ContT r m a -> ContT r m b -> ContT r m b Source # (<*) :: ContT r m a -> ContT r m b -> ContT r m a Source #
(Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c) | Since: base-4.14.0.0
Instance details Defined in GHC.Internal.Base Methods pure :: a0 -> (a, b, c, a0) Source # (<*>) :: (a, b, c, a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) Source # liftA2 :: (a0 -> b0 -> c0) -> (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, c0) Source # (*>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) Source # (<*) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, a0) Source #
Applicative ((->) r) | Since: base-2.1
Instance details Defined in GHC.Internal.Base Methods pure :: a -> r -> a Source # (<*>) :: (r -> (a -> b)) -> (r -> a) -> r -> b Source # liftA2 :: (a -> b -> c) -> (r -> a) -> (r -> b) -> r -> c Source # (*>) :: (r -> a) -> (r -> b) -> r -> b Source # (<*) :: (r -> a) -> (r -> b) -> r -> a Source #
(Applicative f, Applicative g) => Applicative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods pure :: a -> Compose f g a Source # (<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b Source # liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c Source # (*>) :: Compose f g a -> Compose f g b -> Compose f g b Source # (<*) :: Compose f g a -> Compose f g b -> Compose f g a Source #
(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 Source #

(<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b Source #

liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c Source #

(*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b Source #

(<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a Source #

(Applicative f, Applicative g) => Applicative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods pure :: a -> (f :.: g) a Source # (<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b Source # liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c Source # (*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b Source # (<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a Source #
Applicative f => Applicative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods pure :: a -> M1 i c f a Source # (<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b Source # liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 Source # (*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source # (<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a Source #
(Functor m, Monad m) => Applicative (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.CPS Methods pure :: a -> RWST r w s m a Source # (<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b Source # liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c Source # (*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b Source # (<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a Source #
(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 Source # (<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b Source # liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c Source # (*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b Source # (<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a Source #
(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 Source #

(<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b Source #

liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c Source #

(*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b Source #

(<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a Source #

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

A monoid on applicative functors.

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

-     some v = (:) <$> v <*> many v

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

#### Examples

Expand

    >>> Nothing <|> Just 42
    Just 42

    >>> [1, 2] <|> [3, 4]
    [1,2,3,4]

    >>> empty <|> print (2^15)
    32768

Minimal complete definition

empty, (<|>)

Methods

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

An associative binary operation

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

One or more.

#### Examples

Expand

    >>> some (putStr "la")
    lalalalalalalalala... * goes on forever *

    >>> some Nothing
    nothing

    >>> take 5 <$> some (Just 1)
    * hangs forever *

Note that this function can be used with Parsers based on Applicatives. In that case `some parser` will attempt to parse `parser` one or more times until it fails.

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

Zero or more.

#### Examples

Expand

    >>> many (putStr "la")
    lalalalalalalalala... * goes on forever *

    >>> many Nothing
    Just []

    >>> take 5 <$> many (Just 1)
    * hangs forever *

Note that this function can be used with Parsers based on Applicatives. In that case `many parser` will attempt to parse `parser` zero or more times until it fails.

#### Instances

Instances details

Alternative Seq | Since: containers-0.5.4
Instance details Defined in Data.Sequence.Internal Methods empty :: Seq a Source # (<|>) :: Seq a -> Seq a -> Seq a Source # some :: Seq a -> Seq [a] Source # many :: Seq a -> Seq [a] Source #
Alternative DList |
Instance details Defined in Data.DList.Internal Methods empty :: DList a Source # (<|>) :: DList a -> DList a -> DList a Source # some :: DList a -> DList [a] Source # many :: DList a -> DList [a] Source #
Alternative STM | Takes the first non-`retry`ing `STM` action. Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Conc.Sync Methods empty :: STM a Source # (<|>) :: STM a -> STM a -> STM a Source # some :: STM a -> STM [a] Source # many :: STM a -> STM [a] Source #
Alternative ZipList | Since: base-4.11.0.0
Instance details Defined in GHC.Internal.Functor.ZipList Methods empty :: ZipList a Source # (<|>) :: ZipList a -> ZipList a -> ZipList a Source # some :: ZipList a -> ZipList [a] Source # many :: ZipList a -> ZipList [a] Source #
Alternative P | Since: base-4.5.0.0
Instance details Defined in GHC.Internal.Text.ParserCombinators.ReadP Methods empty :: P a Source # (<|>) :: P a -> P a -> P a Source # some :: P a -> P [a] Source # many :: P a -> P [a] Source #
Alternative ReadP | Since: base-4.6.0.0
Instance details Defined in GHC.Internal.Text.ParserCombinators.ReadP Methods empty :: ReadP a Source # (<|>) :: ReadP a -> ReadP a -> ReadP a Source # some :: ReadP a -> ReadP [a] Source # many :: ReadP a -> ReadP [a] Source #
Alternative ReadPrec | Since: base-4.6.0.0
Instance details Defined in GHC.Internal.Text.ParserCombinators.ReadPrec Methods empty :: ReadPrec a Source # (<|>) :: ReadPrec a -> ReadPrec a -> ReadPrec a Source # some :: ReadPrec a -> ReadPrec [a] Source # many :: ReadPrec a -> ReadPrec [a] Source #
Alternative IO | Takes the first non-throwing `IO` action's result. `empty` throws an exception. Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Base Methods empty :: IO a Source # (<|>) :: IO a -> IO a -> IO a Source # some :: IO a -> IO [a] Source # many :: IO a -> IO [a] Source #
Alternative Parser |
Instance details Defined in Text.ParserCombinators.HuttonMeijer Methods empty :: Parser a Source # (<|>) :: Parser a -> Parser a -> Parser a Source # some :: Parser a -> Parser [a] Source # many :: Parser a -> Parser [a] Source #
Alternative Parser |
Instance details Defined in Text.ParserCombinators.Poly.ByteString Methods empty :: Parser a Source # (<|>) :: Parser a -> Parser a -> Parser a Source # some :: Parser a -> Parser [a] Source # many :: Parser a -> Parser [a] Source #
Alternative Parser |
Instance details Defined in Text.ParserCombinators.Poly.ByteStringChar Methods empty :: Parser a Source # (<|>) :: Parser a -> Parser a -> Parser a Source # some :: Parser a -> Parser [a] Source # many :: Parser a -> Parser [a] Source #
Alternative Parser |
Instance details Defined in Text.ParserCombinators.Poly.Text Methods empty :: Parser a Source # (<|>) :: Parser a -> Parser a -> Parser a Source # some :: Parser a -> Parser [a] Source # many :: Parser a -> Parser [a] Source #
Alternative Maybe | Picks the leftmost `Just` value, or, alternatively, `Nothing`. Since: base-2.1
Instance details Defined in GHC.Internal.Base Methods empty :: Maybe a Source # (<|>) :: Maybe a -> Maybe a -> Maybe a Source # some :: Maybe a -> Maybe [a] Source # many :: Maybe a -> Maybe [a] Source #
Alternative [] | Combines lists by concatenation, starting from the empty list. Since: base-2.1
Instance details Defined in GHC.Internal.Base Methods empty :: [a] Source # (<|>) :: [a] -> [a] -> [a] Source # some :: [a] -> [[a]] Source # many :: [a] -> [[a]] Source #
MonadPlus m => Alternative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedMonad m a Source # (<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a Source # some :: WrappedMonad m a -> WrappedMonad m [a] Source # many :: WrappedMonad m a -> WrappedMonad m [a] Source #
ArrowPlus a => Alternative (ArrowMonad a) | Since: base-4.6.0.0
Instance details Defined in GHC.Internal.Control.Arrow Methods empty :: ArrowMonad a a0 Source # (<|>) :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 Source # some :: ArrowMonad a a0 -> ArrowMonad a [a0] Source # many :: ArrowMonad a a0 -> ArrowMonad a [a0] Source #
Alternative (U1 :: Type -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods empty :: U1 a Source # (<|>) :: U1 a -> U1 a -> U1 a Source # some :: U1 a -> U1 [a] Source # many :: U1 a -> U1 [a] Source #
Alternative (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Lazy Methods empty :: Parser t a Source # (<|>) :: Parser t a -> Parser t a -> Parser t a Source # some :: Parser t a -> Parser t [a] Source # many :: Parser t a -> Parser t [a] Source #
Alternative (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Lex Methods empty :: Parser t a Source # (<|>) :: Parser t a -> Parser t a -> Parser t a Source # some :: Parser t a -> Parser t [a] Source # many :: Parser t a -> Parser t [a] Source #
Alternative (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Parser Methods empty :: Parser t a Source # (<|>) :: Parser t a -> Parser t a -> Parser t a Source # some :: Parser t a -> Parser t [a] Source # many :: Parser t a -> Parser t [a] Source #
Alternative (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods empty :: Parser s a Source # (<|>) :: Parser s a -> Parser s a -> Parser s a Source # some :: Parser s a -> Parser s [a] Source # many :: Parser s a -> Parser s [a] Source #
(Functor m, Monad m) => Alternative (MaybeT m) |
Instance details Defined in Control.Monad.Trans.Maybe Methods empty :: MaybeT m a Source # (<|>) :: MaybeT m a -> MaybeT m a -> MaybeT m a Source # some :: MaybeT m a -> MaybeT m [a] Source # many :: MaybeT m a -> MaybeT m [a] Source #
(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 Source # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 Source # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] Source # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] Source #
Alternative m => Alternative (Kleisli m a) | Since: base-4.14.0.0
Instance details Defined in GHC.Internal.Control.Arrow Methods empty :: Kleisli m a a0 Source # (<|>) :: Kleisli m a a0 -> Kleisli m a a0 -> Kleisli m a a0 Source # some :: Kleisli m a a0 -> Kleisli m a [a0] Source # many :: Kleisli m a a0 -> Kleisli m a [a0] Source #
(Generic1 f, Alternative (Rep1 f)) => Alternative (Generically1 f) | Since: base-4.17.0.0
Instance details Defined in GHC.Internal.Generics Methods empty :: Generically1 f a Source # (<|>) :: Generically1 f a -> Generically1 f a -> Generically1 f a Source # some :: Generically1 f a -> Generically1 f [a] Source # many :: Generically1 f a -> Generically1 f [a] Source #
Alternative f => Alternative (Rec1 f) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods empty :: Rec1 f a Source # (<|>) :: Rec1 f a -> Rec1 f a -> Rec1 f a Source # some :: Rec1 f a -> Rec1 f [a] Source # many :: Rec1 f a -> Rec1 f [a] Source #
Alternative (Parser s t) |
Instance details Defined in Text.ParserCombinators.Poly.StateLazy Methods empty :: Parser s t a Source # (<|>) :: Parser s t a -> Parser s t a -> Parser s t a Source # some :: Parser s t a -> Parser s t [a] Source # many :: Parser s t a -> Parser s t [a] Source #
Alternative (Parser s t) |
Instance details Defined in Text.ParserCombinators.Poly.StateParser Methods empty :: Parser s t a Source # (<|>) :: Parser s t a -> Parser s t a -> Parser s t a Source # some :: Parser s t a -> Parser s t [a] Source # many :: Parser s t a -> Parser s t [a] Source #
(Monoid w, Functor m, MonadPlus m) => Alternative (AccumT w m) |
Instance details Defined in Control.Monad.Trans.Accum Methods empty :: AccumT w m a Source # (<|>) :: AccumT w m a -> AccumT w m a -> AccumT w m a Source # some :: AccumT w m a -> AccumT w m [a] Source # many :: AccumT w m a -> AccumT w m [a] Source #
(Functor m, Monad m, Monoid e) => Alternative (ExceptT e m) |
Instance details Defined in Control.Monad.Trans.Except Methods empty :: ExceptT e m a Source # (<|>) :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a Source # some :: ExceptT e m a -> ExceptT e m [a] Source # many :: ExceptT e m a -> ExceptT e m [a] Source #
Alternative m => Alternative (IdentityT m) |
Instance details Defined in Control.Monad.Trans.Identity Methods empty :: IdentityT m a Source # (<|>) :: IdentityT m a -> IdentityT m a -> IdentityT m a Source # some :: IdentityT m a -> IdentityT m [a] Source # many :: IdentityT m a -> IdentityT m [a] Source #
Alternative m => Alternative (ReaderT r m) |
Instance details Defined in Control.Monad.Trans.Reader Methods empty :: ReaderT r m a Source # (<|>) :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a Source # some :: ReaderT r m a -> ReaderT r m [a] Source # many :: ReaderT r m a -> ReaderT r m [a] Source #
(Functor m, MonadPlus m) => Alternative (SelectT r m) |
Instance details Defined in Control.Monad.Trans.Select Methods empty :: SelectT r m a Source # (<|>) :: SelectT r m a -> SelectT r m a -> SelectT r m a Source # some :: SelectT r m a -> SelectT r m [a] Source # many :: SelectT r m a -> SelectT r m [a] Source #
(Functor m, MonadPlus m) => Alternative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Lazy Methods empty :: StateT s m a Source # (<|>) :: StateT s m a -> StateT s m a -> StateT s m a Source # some :: StateT s m a -> StateT s m [a] Source # many :: StateT s m a -> StateT s m [a] Source #
(Functor m, MonadPlus m) => Alternative (StateT s m) |
Instance details Defined in Control.Monad.Trans.State.Strict Methods empty :: StateT s m a Source # (<|>) :: StateT s m a -> StateT s m a -> StateT s m a Source # some :: StateT s m a -> StateT s m [a] Source # many :: StateT s m a -> StateT s m [a] Source #
(Functor m, MonadPlus m) => Alternative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.CPS Methods empty :: WriterT w m a Source # (<|>) :: WriterT w m a -> WriterT w m a -> WriterT w m a Source # some :: WriterT w m a -> WriterT w m [a] Source # many :: WriterT w m a -> WriterT w m [a] Source #
(Monoid w, Alternative m) => Alternative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Lazy Methods empty :: WriterT w m a Source # (<|>) :: WriterT w m a -> WriterT w m a -> WriterT w m a Source # some :: WriterT w m a -> WriterT w m [a] Source # many :: WriterT w m a -> WriterT w m [a] Source #
(Monoid w, Alternative m) => Alternative (WriterT w m) |
Instance details Defined in Control.Monad.Trans.Writer.Strict Methods empty :: WriterT w m a Source # (<|>) :: WriterT w m a -> WriterT w m a -> WriterT w m a Source # some :: WriterT w m a -> WriterT w m [a] Source # many :: WriterT w m a -> WriterT w m [a] Source #
(Alternative f, Alternative g) => Alternative (Product f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods empty :: Product f g a Source # (<|>) :: Product f g a -> Product f g a -> Product f g a Source # some :: Product f g a -> Product f g [a] Source # many :: Product f g a -> Product f g [a] Source #
(Alternative f, Alternative g) => Alternative (f :*: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods empty :: (f :*: g) a Source # (<|>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a Source # some :: (f :*: g) a -> (f :*: g) [a] Source # many :: (f :*: g) a -> (f :*: g) [a] Source #
Alternative (Parser s t e) |
Instance details Defined in Text.ParserCombinators.HuttonMeijerWallace Methods empty :: Parser s t e a Source # (<|>) :: Parser s t e a -> Parser s t e a -> Parser s t e a Source # some :: Parser s t e a -> Parser s t e [a] Source # many :: Parser s t e a -> Parser s t e [a] Source #
(Alternative f, Applicative g) => Alternative (Compose f g) | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods empty :: Compose f g a Source # (<|>) :: Compose f g a -> Compose f g a -> Compose f g a Source # some :: Compose f g a -> Compose f g [a] Source # many :: Compose f g a -> Compose f g [a] Source #
(Alternative f, Applicative g) => Alternative (f :.: g) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods empty :: (f :.: g) a Source # (<|>) :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a Source # some :: (f :.: g) a -> (f :.: g) [a] Source # many :: (f :.: g) a -> (f :.: g) [a] Source #
Alternative f => Alternative (M1 i c f) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Generics Methods empty :: M1 i c f a Source # (<|>) :: M1 i c f a -> M1 i c f a -> M1 i c f a Source # some :: M1 i c f a -> M1 i c f [a] Source # many :: M1 i c f a -> M1 i c f [a] Source #
(Functor m, MonadPlus m) => Alternative (RWST r w s m) |
Instance details Defined in Control.Monad.Trans.RWS.CPS Methods empty :: RWST r w s m a Source # (<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source # some :: RWST r w s m a -> RWST r w s m [a] Source # many :: RWST r w s m a -> RWST r w s m [a] Source #
(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 Source # (<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source # some :: RWST r w s m a -> RWST r w s m [a] Source # many :: RWST r w s m a -> RWST r w s m [a] Source #
(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 Source # (<|>) :: RWST r w s m a -> RWST r w s m a -> RWST r w s m a Source # some :: RWST r w s m a -> RWST r w s m [a] Source # many :: RWST r w s m a -> RWST r w s m [a] Source #

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

Replace all locations in the input with the same value. The default definition is ``fmap` . `const``, but this may be overridden with a more efficient version.

#### Examples

Expand

Perform a computation with `Maybe` and replace the result with a constant value if it is `Just`:

    >>> 'a' <$ Just 2
    Just 'a'
    >>> 'a' <$ Nothing
    Nothing

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

A variant of `<*>` with the types of the arguments reversed. It differs from ``flip` `(<*>)`` in that the effects are resolved in the order the arguments are presented.

#### Examples

Expand

    >>> (<**>) (print 1) (id <$ print 2)
    1
    2

    >>> flip (<*>) (print 1) (id <$ print 2)
    2
    1

    >>> ZipList [4, 5, 6] <**> ZipList [(+1), (*2), (/3)]
    ZipList {getZipList = [5.0,10.0,2.0]}

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

Lift a function to actions. Equivalent to Functor's `fmap` but implemented using only `Applicative`'s methods: ``liftA` f a = `pure` f `<*>` a`

As such this function may be used to implement a `Functor` instance from an `Applicative` one.

#### Examples

Expand

Using the Applicative instance for Lists:

    >>> liftA (+1) [1, 2]
    [2,3]

Or the Applicative instance for `Maybe`

    >>> liftA (+1) (Just 3)
    Just 4

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

Lift a ternary function to actions.

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

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)

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

Return the next token if it satisfies the given predicate.

eof :: Parser s () Source #

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

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

One or none.

It is useful for modelling any computation that is allowed to fail.

#### Examples

Expand

Using the `Alternative` instance of Control.Monad.Except, the following functions:

    >>> import Control.Monad.Except

    >>> canFail = throwError "it failed" :: Except String Int
    >>> final = return 42                :: Except String Int

Can be combined by allowing the first function to fail:

    >>> runExcept $ canFail *> final
    Left "it failed"

    >>> runExcept $ optional canFail *> final
    Right 42

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

Parse a non-empty list of items.

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

Parse a list of items separated by discarded junk.

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

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

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

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

asum :: (Foldable t, Alternative f) => t (f a) -> f a Source #

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

`asum` is just like `msum`, but generalised to `Alternative`.

#### Examples

Expand

Basic usage:

    >>> asum [Just "Hello", Nothing, Just "World"]
    Just "Hello"

newtype Const a (b :: k) Source #

The `Const` functor.

#### Examples

Expand

    >>> fmap (++ "World") (Const "Hello")
    Const "Hello"

Because we ignore the second type parameter to `Const`, the Applicative instance, which has ``(<*>)` :: Monoid m => Const m (a -> b) -> Const m a -> Const m b` essentially turns into `Monoid m => m -> m -> m`, which is `(<>)`

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

Constructors

Const |

Fields

- getConst :: a

#### Instances

Instances details

Generic1 (Const a :: k -> Type) |

Instance details

Defined in GHC.Internal.Data.Functor.Const

Associated Types

type Rep1 (Const a :: k -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const type Rep1 (Const a :: k -> Type) = D1 ('MetaData "Const" "GHC.Internal.Data.Functor.Const" "ghc-internal" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

Methods

from1 :: forall (a0 :: k). Const a a0 -> Rep1 (Const a :: k -> Type) a0 Source #

to1 :: forall (a0 :: k). Rep1 (Const a :: k -> Type) a0 -> Const a a0 Source #

Bifoldable (Const :: Type -> Type -> Type) | Since: base-4.10.0.0
Instance details Defined in Data.Bifoldable Methods bifold :: Monoid m => Const m m -> m Source # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Const a b -> m Source # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Const a b -> c Source # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Const a b -> c Source #
Bifoldable1 (Const :: Type -> Type -> Type) |
Instance details Defined in Data.Bifoldable1 Methods bifold1 :: Semigroup m => Const m m -> m Source # bifoldMap1 :: Semigroup m => (a -> m) -> (b -> m) -> Const a b -> m Source #
Bifunctor (Const :: Type -> Type -> Type) | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d Source # first :: (a -> b) -> Const a c -> Const b c Source # second :: (b -> c) -> Const a b -> Const a c Source #
Bitraversable (Const :: Type -> Type -> Type) | Since: base-4.10.0.0
Instance details Defined in Data.Bitraversable Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Const a b -> f (Const c d) Source #
Eq2 (Const :: Type -> Type -> Type) | 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 Source #
Ord2 (Const :: Type -> Type -> Type) | 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 Source #
Read2 (Const :: Type -> Type -> Type) | 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) Source #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Const a b] Source #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Const a b) Source #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Const a b] Source #

Show2 (Const :: Type -> Type -> Type) | 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 Source # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Const a b] -> ShowS Source #
NFData2 (Const :: Type -> Type -> Type) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf2 :: (a -> ()) -> (b -> ()) -> Const a b -> () Source #
Eq a => Eq1 (Const a :: Type -> Type) | 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 Source #
Ord a => Ord1 (Const a :: Type -> Type) | 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 Source #
Read a => Read1 (Const a :: Type -> Type) | 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) Source # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Const a a0] Source # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Const a a0) Source # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Const a a0] Source #
Show a => Show1 (Const a :: Type -> Type) | 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 Source # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Const a a0] -> ShowS Source #
Contravariant (Const a :: Type -> Type) |
Instance details Defined in Data.Functor.Contravariant Methods contramap :: (a' -> a0) -> Const a a0 -> Const a a' Source # (>$) :: b -> Const a b -> Const a a0 Source #
NFData a => NFData1 (Const a :: Type -> Type) | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a0 -> ()) -> Const a a0 -> () Source #
Monoid m => Applicative (Const m :: Type -> Type) | Since: base-2.0.1
Instance details Defined in GHC.Internal.Data.Functor.Const Methods pure :: a -> Const m a Source # (<*>) :: Const m (a -> b) -> Const m a -> Const m b Source # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source # (*>) :: Const m a -> Const m b -> Const m b Source # (<*) :: Const m a -> Const m b -> Const m a Source #
Functor (Const m :: Type -> Type) | Since: base-2.1
Instance details Defined in GHC.Internal.Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b Source # (<$) :: a -> Const m b -> Const m a Source #
Foldable (Const m :: Type -> Type) | Since: base-4.7.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

fold :: Monoid m0 => Const m m0 -> m0 Source #

foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #

foldMap' :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #

foldr :: (a -> b -> b) -> b -> Const m a -> b Source #

foldr' :: (a -> b -> b) -> b -> Const m a -> b Source #

foldl :: (b -> a -> b) -> b -> Const m a -> b Source #

foldl' :: (b -> a -> b) -> b -> Const m a -> b Source #

foldr1 :: (a -> a -> a) -> Const m a -> a Source #

foldl1 :: (a -> a -> a) -> Const m a -> a Source #

toList :: Const m a -> [a] Source #

null :: Const m a -> Bool Source #

length :: Const m a -> Int Source #

elem :: Eq a => a -> Const m a -> Bool Source #

maximum :: Ord a => Const m a -> a Source #

minimum :: Ord a => Const m a -> a Source #

sum :: Num a => Const m a -> a Source #

product :: Num a => Const m a -> a Source #

Traversable (Const m :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) Source # sequenceA :: Applicative f => Const m (f a) -> f (Const m a) Source # mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) Source # sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) Source #
NFData a => NFData (Const a b) | Since: deepseq-1.4.0.0
Instance details Defined in Control.DeepSeq Methods rnf :: Const a b -> () Source #
Monoid a => Monoid (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods mempty :: Const a b Source # mappend :: Const a b -> Const a b -> Const a b Source # mconcat :: [Const a b] -> Const a b Source #
Semigroup a => Semigroup (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods (<>) :: Const a b -> Const a b -> Const a b Source # sconcat :: NonEmpty (Const a b) -> Const a b Source # stimes :: Integral b0 => b0 -> Const a b -> Const a b Source #
Bits a => Bits (Const a b) | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

(.&.) :: Const a b -> Const a b -> Const a b Source #

(.|.) :: Const a b -> Const a b -> Const a b Source #

xor :: Const a b -> Const a b -> Const a b Source #

complement :: Const a b -> Const a b Source #

shift :: Const a b -> Int -> Const a b Source #

rotate :: Const a b -> Int -> Const a b Source #

zeroBits :: Const a b Source #

bit :: Int -> Const a b Source #

setBit :: Const a b -> Int -> Const a b Source #

clearBit :: Const a b -> Int -> Const a b Source #

complementBit :: Const a b -> Int -> Const a b Source #

testBit :: Const a b -> Int -> Bool Source #

bitSizeMaybe :: Const a b -> Maybe Int Source #

bitSize :: Const a b -> Int Source #

isSigned :: Const a b -> Bool Source #

shiftL :: Const a b -> Int -> Const a b Source #

unsafeShiftL :: Const a b -> Int -> Const a b Source #

shiftR :: Const a b -> Int -> Const a b Source #

unsafeShiftR :: Const a b -> Int -> Const a b Source #

rotateL :: Const a b -> Int -> Const a b Source #

rotateR :: Const a b -> Int -> Const a b Source #

popCount :: Const a b -> Int Source #

FiniteBits a => FiniteBits (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods finiteBitSize :: Const a b -> Int Source # countLeadingZeros :: Const a b -> Int Source # countTrailingZeros :: Const a b -> Int Source #
IsString a => IsString (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.String Methods fromString :: String -> Const a b Source #
Bounded a => Bounded (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods minBound :: Const a b Source # maxBound :: Const a b Source #
Enum a => Enum (Const a b) | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

succ :: Const a b -> Const a b Source #

pred :: Const a b -> Const a b Source #

toEnum :: Int -> Const a b Source #

fromEnum :: Const a b -> Int Source #

enumFrom :: Const a b -> [Const a b] Source #

enumFromThen :: Const a b -> Const a b -> [Const a b] Source #

enumFromTo :: Const a b -> Const a b -> [Const a b] Source #

enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] Source #

Floating a => Floating (Const a b) | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

pi :: Const a b Source #

exp :: Const a b -> Const a b Source #

log :: Const a b -> Const a b Source #

sqrt :: Const a b -> Const a b Source #

(**) :: Const a b -> Const a b -> Const a b Source #

logBase :: Const a b -> Const a b -> Const a b Source #

sin :: Const a b -> Const a b Source #

cos :: Const a b -> Const a b Source #

tan :: Const a b -> Const a b Source #

asin :: Const a b -> Const a b Source #

acos :: Const a b -> Const a b Source #

atan :: Const a b -> Const a b Source #

sinh :: Const a b -> Const a b Source #

cosh :: Const a b -> Const a b Source #

tanh :: Const a b -> Const a b Source #

asinh :: Const a b -> Const a b Source #

acosh :: Const a b -> Const a b Source #

atanh :: Const a b -> Const a b Source #

log1p :: Const a b -> Const a b Source #

expm1 :: Const a b -> Const a b Source #

log1pexp :: Const a b -> Const a b Source #

log1mexp :: Const a b -> Const a b Source #

RealFloat a => RealFloat (Const a b) | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

floatRadix :: Const a b -> Integer Source #

floatDigits :: Const a b -> Int Source #

floatRange :: Const a b -> (Int, Int) Source #

decodeFloat :: Const a b -> (Integer, Int) Source #

encodeFloat :: Integer -> Int -> Const a b Source #

exponent :: Const a b -> Int Source #

significand :: Const a b -> Const a b Source #

scaleFloat :: Int -> Const a b -> Const a b Source #

isNaN :: Const a b -> Bool Source #

isInfinite :: Const a b -> Bool Source #

isDenormalized :: Const a b -> Bool Source #

isNegativeZero :: Const a b -> Bool Source #

isIEEE :: Const a b -> Bool Source #

atan2 :: Const a b -> Const a b -> Const a b Source #

Storable a => Storable (Const a b) | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

sizeOf :: Const a b -> Int Source #

alignment :: Const a b -> Int Source #

peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) Source #

pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () Source #

peekByteOff :: Ptr b0 -> Int -> IO (Const a b) Source #

pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () Source #

peek :: Ptr (Const a b) -> IO (Const a b) Source #

poke :: Ptr (Const a b) -> Const a b -> IO () Source #

Generic (Const a b) |

Instance details

Defined in GHC.Internal.Data.Functor.Const

Associated Types

type Rep (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const type Rep (Const a b) = D1 ('MetaData "Const" "GHC.Internal.Data.Functor.Const" "ghc-internal" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

Methods

from :: Const a b -> Rep (Const a b) x Source #

to :: Rep (Const a b) x -> Const a b Source #

Ix a => Ix (Const a b) | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

range :: (Const a b, Const a b) -> [Const a b] Source #

index :: (Const a b, Const a b) -> Const a b -> Int Source #

unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int Source #

inRange :: (Const a b, Const a b) -> Const a b -> Bool Source #

rangeSize :: (Const a b, Const a b) -> Int Source #

unsafeRangeSize :: (Const a b, Const a b) -> Int Source #

Num a => Num (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods (+) :: Const a b -> Const a b -> Const a b Source # (-) :: Const a b -> Const a b -> Const a b Source # (*) :: Const a b -> Const a b -> Const a b Source # negate :: Const a b -> Const a b Source # abs :: Const a b -> Const a b Source # signum :: Const a b -> Const a b Source # fromInteger :: Integer -> Const a b Source #
Read a => Read (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `getConst` field were removed Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods readsPrec :: Int -> ReadS (Const a b) Source # readList :: ReadS [Const a b] Source # readPrec :: ReadPrec (Const a b) Source # readListPrec :: ReadPrec [Const a b] Source #
Fractional a => Fractional (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods (/) :: Const a b -> Const a b -> Const a b Source # recip :: Const a b -> Const a b Source # fromRational :: Rational -> Const a b Source #
Integral a => Integral (Const a b) | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

quot :: Const a b -> Const a b -> Const a b Source #

rem :: Const a b -> Const a b -> Const a b Source #

div :: Const a b -> Const a b -> Const a b Source #

mod :: Const a b -> Const a b -> Const a b Source #

quotRem :: Const a b -> Const a b -> (Const a b, Const a b) Source #

divMod :: Const a b -> Const a b -> (Const a b, Const a b) Source #

toInteger :: Const a b -> Integer Source #

Real a => Real (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods toRational :: Const a b -> Rational Source #
RealFrac a => RealFrac (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods properFraction :: Integral b0 => Const a b -> (b0, Const a b) Source # truncate :: Integral b0 => Const a b -> b0 Source # round :: Integral b0 => Const a b -> b0 Source # ceiling :: Integral b0 => Const a b -> b0 Source # floor :: Integral b0 => Const a b -> b0 Source #
Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the `Const` newtype if the `getConst` field were removed Since: base-4.8.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods showsPrec :: Int -> Const a b -> ShowS Source # show :: Const a b -> String Source # showList :: [Const a b] -> ShowS Source #
Eq a => Eq (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const Methods (==) :: Const a b -> Const a b -> Bool Source # (/=) :: Const a b -> Const a b -> Bool Source #
Ord a => Ord (Const a b) | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Data.Functor.Const

Methods

compare :: Const a b -> Const a b -> Ordering Source #

(<) :: Const a b -> Const a b -> Bool Source #

(<=) :: Const a b -> Const a b -> Bool Source #

(>) :: Const a b -> Const a b -> Bool Source #

(>=) :: Const a b -> Const a b -> Bool Source #

max :: Const a b -> Const a b -> Const a b Source #

min :: Const a b -> Const a b -> Const a b Source #

type Rep1 (Const a :: k -> Type) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const type Rep1 (Const a :: k -> Type) = D1 ('MetaData "Const" "GHC.Internal.Data.Functor.Const" "ghc-internal" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
type Rep (Const a b) | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Data.Functor.Const type Rep (Const a b) = D1 ('MetaData "Const" "GHC.Internal.Data.Functor.Const" "ghc-internal" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

bracket :: PolyParse p => p bra -> p ket -> p a -> p a Source #

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`

newtype ZipList a Source #

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

#### Examples

Expand

In contrast to the `Applicative` for `List`:

    >>> (+) <$> [1, 2, 3] <*> [4, 5, 6]
    [5,6,7,6,7,8,7,8,9]

The Applicative instance of ZipList applies the operation by pairing up the elements, analogous to `zipWith`N

    >>> (+) <$> ZipList [1, 2, 3] <*> ZipList [4, 5, 6]
    ZipList {getZipList = [5,7,9]}

    >>> (,,,) <$> ZipList [1, 2] <*> ZipList [3, 4] <*> ZipList [5, 6] <*> ZipList [7, 8]
    ZipList {getZipList = [(1,3,5,7),(2,4,6,8)]}

    >>> ZipList [(+1), (^2), (/ 2)] <*> ZipList [5, 5, 5]
    ZipList {getZipList = [6.0,25.0,2.5]}

Constructors

ZipList |

Fields

- getZipList :: [a]

#### Instances

Instances details

NFData1 ZipList | Since: deepseq-1.4.3.0
Instance details Defined in Control.DeepSeq Methods liftRnf :: (a -> ()) -> ZipList a -> () Source #
Alternative ZipList | Since: base-4.11.0.0
Instance details Defined in GHC.Internal.Functor.ZipList Methods empty :: ZipList a Source # (<|>) :: ZipList a -> ZipList a -> ZipList a Source # some :: ZipList a -> ZipList [a] Source # many :: ZipList a -> ZipList [a] Source #

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 GHC.Internal.Functor.ZipList Methods pure :: a -> ZipList a Source # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b Source # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source # (*>) :: ZipList a -> ZipList b -> ZipList b Source # (<*) :: ZipList a -> ZipList b -> ZipList a Source #
Functor ZipList | Since: base-2.1
Instance details Defined in GHC.Internal.Functor.ZipList Methods fmap :: (a -> b) -> ZipList a -> ZipList b Source # (<$) :: a -> ZipList b -> ZipList a Source #
Foldable ZipList | Since: base-4.9.0.0

Instance details

Defined in GHC.Internal.Functor.ZipList

Methods

fold :: Monoid m => ZipList m -> m Source #

foldMap :: Monoid m => (a -> m) -> ZipList a -> m Source #

foldMap' :: Monoid m => (a -> m) -> ZipList a -> m Source #

foldr :: (a -> b -> b) -> b -> ZipList a -> b Source #

foldr' :: (a -> b -> b) -> b -> ZipList a -> b Source #

foldl :: (b -> a -> b) -> b -> ZipList a -> b Source #

foldl' :: (b -> a -> b) -> b -> ZipList a -> b Source #

foldr1 :: (a -> a -> a) -> ZipList a -> a Source #

foldl1 :: (a -> a -> a) -> ZipList a -> a Source #

toList :: ZipList a -> [a] Source #

null :: ZipList a -> Bool Source #

length :: ZipList a -> Int Source #

elem :: Eq a => a -> ZipList a -> Bool Source #

maximum :: Ord a => ZipList a -> a Source #

minimum :: Ord a => ZipList a -> a Source #

sum :: Num a => ZipList a -> a Source #

product :: Num a => ZipList a -> a Source #

Traversable ZipList | Since: base-4.9.0.0
Instance details Defined in GHC.Internal.Functor.ZipList Methods traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) Source # sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) Source # mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) Source # sequence :: Monad m => ZipList (m a) -> m (ZipList a) Source #
Generic1 ZipList |

Instance details

Defined in GHC.Internal.Functor.ZipList

Associated Types

type Rep1 ZipList | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Functor.ZipList type Rep1 ZipList = D1 ('MetaData "ZipList" "GHC.Internal.Functor.ZipList" "ghc-internal" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 [])))

Methods

from1 :: ZipList a -> Rep1 ZipList a Source #

to1 :: Rep1 ZipList a -> ZipList a Source #

NFData a => NFData (ZipList a) | Since: deepseq-1.4.0.0
Instance details Defined in Control.DeepSeq Methods rnf :: ZipList a -> () Source #
Data a => Data (ZipList a) | Since: base-4.14.0.0

Instance details

Defined in GHC.Internal.Functor.ZipList

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ZipList a -> c (ZipList a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (ZipList a) Source #

toConstr :: ZipList a -> Constr Source #

dataTypeOf :: ZipList a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (ZipList a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (ZipList a)) Source #

gmapT :: (forall b. Data b => b -> b) -> ZipList a -> ZipList a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ZipList a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ZipList a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ZipList a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ZipList a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ZipList a -> m (ZipList a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ZipList a -> m (ZipList a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ZipList a -> m (ZipList a) Source #

Generic (ZipList a) |

Instance details

Defined in GHC.Internal.Functor.ZipList

Associated Types

type Rep (ZipList a) | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Functor.ZipList type Rep (ZipList a) = D1 ('MetaData "ZipList" "GHC.Internal.Functor.ZipList" "ghc-internal" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))

Methods

from :: ZipList a -> Rep (ZipList a) x Source #

to :: Rep (ZipList a) x -> ZipList a Source #

IsList (ZipList a) | Since: base-4.15.0.0

Instance details

Defined in GHC.Internal.IsList

Associated Types

type Item (ZipList a) |
Instance details Defined in GHC.Internal.IsList type Item (ZipList a) = a

Methods

fromList :: [Item (ZipList a)] -> ZipList a Source #

fromListN :: Int -> [Item (ZipList a)] -> ZipList a Source #

toList :: ZipList a -> [Item (ZipList a)] Source #

Read a => Read (ZipList a) | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Functor.ZipList Methods readsPrec :: Int -> ReadS (ZipList a) Source # readList :: ReadS [ZipList a] Source # readPrec :: ReadPrec (ZipList a) Source # readListPrec :: ReadPrec [ZipList a] Source #
Show a => Show (ZipList a) | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Functor.ZipList Methods showsPrec :: Int -> ZipList a -> ShowS Source # show :: ZipList a -> String Source # showList :: [ZipList a] -> ShowS Source #
Eq a => Eq (ZipList a) | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Functor.ZipList Methods (==) :: ZipList a -> ZipList a -> Bool Source # (/=) :: ZipList a -> ZipList a -> Bool Source #
Ord a => Ord (ZipList a) | Since: base-4.7.0.0

Instance details

Defined in GHC.Internal.Functor.ZipList

Methods

compare :: ZipList a -> ZipList a -> Ordering Source #

(<) :: ZipList a -> ZipList a -> Bool Source #

(<=) :: ZipList a -> ZipList a -> Bool Source #

(>) :: ZipList a -> ZipList a -> Bool Source #

(>=) :: ZipList a -> ZipList a -> Bool Source #

max :: ZipList a -> ZipList a -> ZipList a Source #

min :: ZipList a -> ZipList a -> ZipList a Source #

type Rep1 ZipList | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Functor.ZipList type Rep1 ZipList = D1 ('MetaData "ZipList" "GHC.Internal.Functor.ZipList" "ghc-internal" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 [])))
type Rep (ZipList a) | Since: base-4.7.0.0
Instance details Defined in GHC.Internal.Functor.ZipList type Rep (ZipList a) = D1 ('MetaData "ZipList" "GHC.Internal.Functor.ZipList" "ghc-internal" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))
type Item (ZipList a) |
Instance details Defined in GHC.Internal.IsList type Item (ZipList a) = a

newtype WrappedArrow (a :: Type -> Type -> Type) b c Source #

Constructors

WrapArrow |

Fields

- unwrapArrow :: a b c

#### Instances

Instances details

Generic1 (WrappedArrow a b :: Type -> Type) |

Instance details

Defined in Control.Applicative

Associated Types

type Rep1 (WrappedArrow a b :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep1 (WrappedArrow a b :: Type -> Type) = D1 ('MetaData "WrappedArrow" "Control.Applicative" "base" 'True) (C1 ('MetaCons "WrapArrow" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapArrow") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (a b))))

Methods

from1 :: WrappedArrow a b a0 -> Rep1 (WrappedArrow a b) a0 Source #

to1 :: Rep1 (WrappedArrow a b) a0 -> WrappedArrow a b a0 Source #

(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedArrow a b a0 Source # (<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 Source # some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] Source # many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] Source #
Arrow a => Applicative (WrappedArrow a b) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a0 -> WrappedArrow a b a0 Source #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #

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 Source # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #
(Typeable a, Typeable b, Typeable c, Data (a b c)) => Data (WrappedArrow a b c) | Since: base-4.14.0.0

Instance details

Defined in Control.Applicative

Methods

gfoldl :: (forall d b0. Data d => c0 (d -> b0) -> d -> c0 b0) -> (forall g. g -> c0 g) -> WrappedArrow a b c -> c0 (WrappedArrow a b c) Source #

gunfold :: (forall b0 r. Data b0 => c0 (b0 -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (WrappedArrow a b c) Source #

toConstr :: WrappedArrow a b c -> Constr Source #

dataTypeOf :: WrappedArrow a b c -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (WrappedArrow a b c)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (WrappedArrow a b c)) Source #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> WrappedArrow a b c -> WrappedArrow a b c Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WrappedArrow a b c -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WrappedArrow a b c -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> WrappedArrow a b c -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WrappedArrow a b c -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> WrappedArrow a b c -> m (WrappedArrow a b c) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> WrappedArrow a b c -> m (WrappedArrow a b c) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> WrappedArrow a b c -> m (WrappedArrow a b c) Source #

Generic (WrappedArrow a b c) |

Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedArrow a b c) | Since: base-4.7.0.0
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))))

Methods

from :: WrappedArrow a b c -> Rep (WrappedArrow a b c) x Source #

to :: Rep (WrappedArrow a b c) x -> WrappedArrow a b c Source #

type Rep1 (WrappedArrow a b :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep1 (WrappedArrow a b :: Type -> Type) = 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) | Since: base-4.7.0.0
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 WrappedMonad (m :: Type -> Type) a Source #

Constructors

WrapMonad |

Fields

- unwrapMonad :: m a

#### Instances

Instances details

Generic1 (WrappedMonad m :: Type -> Type) |

Instance details

Defined in Control.Applicative

Associated Types

type Rep1 (WrappedMonad m :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep1 (WrappedMonad m :: Type -> Type) = D1 ('MetaData "WrappedMonad" "Control.Applicative" "base" 'True) (C1 ('MetaCons "WrapMonad" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapMonad") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 m)))

Methods

from1 :: WrappedMonad m a -> Rep1 (WrappedMonad m) a Source #

to1 :: Rep1 (WrappedMonad m) a -> WrappedMonad m a Source #

MonadPlus m => Alternative (WrappedMonad m) | Since: base-2.1
Instance details Defined in Control.Applicative Methods empty :: WrappedMonad m a Source # (<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a Source # some :: WrappedMonad m a -> WrappedMonad m [a] Source # many :: WrappedMonad m a -> WrappedMonad m [a] Source #
Monad m => Applicative (WrappedMonad m) | Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> WrappedMonad m a Source #

(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source #

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source #

(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source #

(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a Source #

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 Source # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a Source #
Monad m => Monad (WrappedMonad m) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b Source # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source # return :: a -> WrappedMonad m a Source #
(Typeable m, Typeable a, Data (m a)) => Data (WrappedMonad m a) | Since: base-4.14.0.0

Instance details

Defined in Control.Applicative

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WrappedMonad m a -> c (WrappedMonad m a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WrappedMonad m a) Source #

toConstr :: WrappedMonad m a -> Constr Source #

dataTypeOf :: WrappedMonad m a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (WrappedMonad m a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (WrappedMonad m a)) Source #

gmapT :: (forall b. Data b => b -> b) -> WrappedMonad m a -> WrappedMonad m a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonad m a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonad m a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> WrappedMonad m a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> WrappedMonad m a -> u Source #

gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> WrappedMonad m a -> m0 (WrappedMonad m a) Source #

gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonad m a -> m0 (WrappedMonad m a) Source #

gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonad m a -> m0 (WrappedMonad m a) Source #

Generic (WrappedMonad m a) |

Instance details

Defined in Control.Applicative

Associated Types

type Rep (WrappedMonad m a) | Since: base-4.7.0.0
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))))

Methods

from :: WrappedMonad m a -> Rep (WrappedMonad m a) x Source #

to :: Rep (WrappedMonad m a) x -> WrappedMonad m a Source #

type Rep1 (WrappedMonad m :: Type -> Type) | Since: base-4.7.0.0
Instance details Defined in Control.Applicative type Rep1 (WrappedMonad m :: Type -> Type) = 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) | Since: base-4.7.0.0
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 Parser s a Source #

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

Instances details

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

data Result z a Source #

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

Instances details

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

reparse :: Text -> Parser s () Source #

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.

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

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

Instances details

PolyParse Parser |
Instance details Defined in Text.ParserCombinators.Poly.ByteString
PolyParse Parser |
Instance details Defined in Text.ParserCombinators.Poly.ByteStringChar
PolyParse Parser |
Instance details Defined in Text.ParserCombinators.Poly.Text
PolyParse (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Lazy
PolyParse (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Lex
PolyParse (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Parser
PolyParse (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText
PolyParse (Parser s t) |
Instance details Defined in Text.ParserCombinators.Poly.StateLazy
PolyParse (Parser s t) |
Instance details Defined in Text.ParserCombinators.Poly.StateParser

class Commitment (p :: Type -> Type) where Source #

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

Methods

commit :: p a -> p a Source #

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 Source #

`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 Source #

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

Instances details

Commitment Parser |
Instance details Defined in Text.ParserCombinators.Poly.ByteString Methods commit :: Parser a -> Parser a Source # adjustErr :: Parser a -> (String -> String) -> Parser a Source # oneOf' :: [(String, Parser a)] -> Parser a Source #
Commitment Parser |
Instance details Defined in Text.ParserCombinators.Poly.ByteStringChar Methods commit :: Parser a -> Parser a Source # adjustErr :: Parser a -> (String -> String) -> Parser a Source # oneOf' :: [(String, Parser a)] -> Parser a Source #
Commitment Parser |
Instance details Defined in Text.ParserCombinators.Poly.Text Methods commit :: Parser a -> Parser a Source # adjustErr :: Parser a -> (String -> String) -> Parser a Source # oneOf' :: [(String, Parser a)] -> Parser a Source #
Commitment (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Lazy Methods commit :: Parser t a -> Parser t a Source # adjustErr :: Parser t a -> (String -> String) -> Parser t a Source # oneOf' :: [(String, Parser t a)] -> Parser t a Source #
Commitment (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Lex Methods commit :: Parser t a -> Parser t a Source # adjustErr :: Parser t a -> (String -> String) -> Parser t a Source # oneOf' :: [(String, Parser t a)] -> Parser t a Source #
Commitment (Parser t) |
Instance details Defined in Text.ParserCombinators.Poly.Parser Methods commit :: Parser t a -> Parser t a Source # adjustErr :: Parser t a -> (String -> String) -> Parser t a Source # oneOf' :: [(String, Parser t a)] -> Parser t a Source #
Commitment (Parser s) |
Instance details Defined in Text.ParserCombinators.Poly.StateText Methods commit :: Parser s a -> Parser s a Source # adjustErr :: Parser s a -> (String -> String) -> Parser s a Source # oneOf' :: [(String, Parser s a)] -> Parser s a Source #
Commitment (Parser s t) |
Instance details Defined in Text.ParserCombinators.Poly.StateLazy Methods commit :: Parser s t a -> Parser s t a Source # adjustErr :: Parser s t a -> (String -> String) -> Parser s t a Source # oneOf' :: [(String, Parser s t a)] -> Parser s t a Source #
Commitment (Parser s t) |
Instance details Defined in Text.ParserCombinators.Poly.StateParser Methods commit :: Parser s t a -> Parser s t a Source # adjustErr :: Parser s t a -> (String -> String) -> Parser s t a Source # oneOf' :: [(String, Parser s t a)] -> Parser s t a Source #

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

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

failBad :: PolyParse p => String -> p a Source #

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

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

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

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

Parse the first alternative in the list that succeeds.

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

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

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

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

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

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

manyFinally :: PolyParse p => p a -> p z -> p [a] Source #

`manyFinally e t` parses a possibly-empty sequence of `e`'s, terminated by a `t`. The final `t` is discarded. Any parse failures could be due either to a badly-formed terminator or a badly-formed element, so it raises both possible errors.

manyFinally' :: (PolyParse p, Show a) => p a -> p z -> p [a] Source #

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

onFail :: Parser s a -> Parser s a -> Parser s a Source #

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

next :: Parser s Char Source #

Simply return the next token in the input tokenstream.

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

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

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

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

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

Update the internal state.

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

Query the internal state.

stGet :: Parser s s Source #

Deliver the entire internal state.

# The ParseDot class.

type Parse a = Parser GraphvizState a Source #

A `ReadS`-like type alias.

class ParseDot a where Source #

Minimal complete definition

parseUnqt

Methods

parseUnqt :: Parse a Source #

parse :: Parse a Source #

parseUnqtList :: Parse [a] Source #

parseList :: Parse [a] Source #

#### Instances

Instances details

ParseDot Version Source # | 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 Source # parse :: Parse Version Source # parseUnqtList :: Parse [Version] Source # parseList :: Parse [Version] Source #
ParseDot Word16 Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Word16 Source # parse :: Parse Word16 Source # parseUnqtList :: Parse [Word16] Source # parseList :: Parse [Word16] Source #
ParseDot Word8 Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Word8 Source # parse :: Parse Word8 Source # parseUnqtList :: Parse [Word8] Source # parseList :: Parse [Word8] Source #
ParseDot ArrowFill Source # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowFill Source # parse :: Parse ArrowFill Source # parseUnqtList :: Parse [ArrowFill] Source # parseList :: Parse [ArrowFill] Source #
ParseDot ArrowModifier Source # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowModifier Source # parse :: Parse ArrowModifier Source # parseUnqtList :: Parse [ArrowModifier] Source # parseList :: Parse [ArrowModifier] Source #
ParseDot ArrowShape Source # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowShape Source # parse :: Parse ArrowShape Source # parseUnqtList :: Parse [ArrowShape] Source # parseList :: Parse [ArrowShape] Source #
ParseDot ArrowSide Source # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowSide Source # parse :: Parse ArrowSide Source # parseUnqtList :: Parse [ArrowSide] Source # parseList :: Parse [ArrowSide] Source #
ParseDot ArrowType Source # |
Instance details Defined in Data.GraphViz.Attributes.Arrows Methods parseUnqt :: Parse ArrowType Source # parse :: Parse ArrowType Source # parseUnqtList :: Parse [ArrowType] Source # parseList :: Parse [ArrowType] Source #
ParseDot BrewerName Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse BrewerName Source # parse :: Parse BrewerName Source # parseUnqtList :: Parse [BrewerName] Source # parseList :: Parse [BrewerName] Source #
ParseDot BrewerScheme Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse BrewerScheme Source # parse :: Parse BrewerScheme Source # parseUnqtList :: Parse [BrewerScheme] Source # parseList :: Parse [BrewerScheme] Source #
ParseDot ColorScheme Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse ColorScheme Source # parse :: Parse ColorScheme Source # parseUnqtList :: Parse [ColorScheme] Source # parseList :: Parse [ColorScheme] Source #
ParseDot Color Source # |
Instance details Defined in Data.GraphViz.Attributes.Colors Methods parseUnqt :: Parse Color Source # parse :: Parse Color Source # parseUnqtList :: Parse [Color] Source # parseList :: Parse [Color] Source #
ParseDot WeightedColor Source # |
Instance details Defined in Data.GraphViz.Attributes.Colors Methods parseUnqt :: Parse WeightedColor Source # parse :: Parse WeightedColor Source # parseUnqtList :: Parse [WeightedColor] Source # parseList :: Parse [WeightedColor] Source #
ParseDot SVGColor Source # |
Instance details Defined in Data.GraphViz.Attributes.Colors.SVG Methods parseUnqt :: Parse SVGColor Source # parse :: Parse SVGColor Source # parseUnqtList :: Parse [SVGColor] Source # parseList :: Parse [SVGColor] Source #
ParseDot X11Color Source # |
Instance details Defined in Data.GraphViz.Attributes.Colors.X11 Methods parseUnqt :: Parse X11Color Source # parse :: Parse X11Color Source # parseUnqtList :: Parse [X11Color] Source # parseList :: Parse [X11Color] Source #
ParseDot Attribute Source # |
Instance details Defined in Data.GraphViz.Attributes.Complete Methods parseUnqt :: Parse Attribute Source # parse :: Parse Attribute Source # parseUnqtList :: Parse [Attribute] Source # parseList :: Parse [Attribute] Source #
ParseDot Align Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Align Source # parse :: Parse Align Source # parseUnqtList :: Parse [Align] Source # parseList :: Parse [Align] Source #
ParseDot Attribute Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Attribute Source # parse :: Parse Attribute Source # parseUnqtList :: Parse [Attribute] Source # parseList :: Parse [Attribute] Source #
ParseDot Cell Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Cell Source # parse :: Parse Cell Source # parseUnqtList :: Parse [Cell] Source # parseList :: Parse [Cell] Source #
ParseDot CellFormat Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse CellFormat Source # parse :: Parse CellFormat Source # parseUnqtList :: Parse [CellFormat] Source # parseList :: Parse [CellFormat] Source #
ParseDot Format Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Format Source # parse :: Parse Format Source # parseUnqtList :: Parse [Format] Source # parseList :: Parse [Format] Source #
ParseDot Img Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Img Source # parse :: Parse Img Source # parseUnqtList :: Parse [Img] Source # parseList :: Parse [Img] Source #
ParseDot Label Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Label Source # parse :: Parse Label Source # parseUnqtList :: Parse [Label] Source # parseList :: Parse [Label] Source #
ParseDot Row Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Row Source # parse :: Parse Row Source # parseUnqtList :: Parse [Row] Source # parseList :: Parse [Row] Source #
ParseDot Scale Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Scale Source # parse :: Parse Scale Source # parseUnqtList :: Parse [Scale] Source # parseList :: Parse [Scale] Source #
ParseDot Side Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Side Source # parse :: Parse Side Source # parseUnqtList :: Parse [Side] Source # parseList :: Parse [Side] Source #
ParseDot Style Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Style Source # parse :: Parse Style Source # parseUnqtList :: Parse [Style] Source # parseList :: Parse [Style] Source #
ParseDot Table Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse Table Source # parse :: Parse Table Source # parseUnqtList :: Parse [Table] Source # parseList :: Parse [Table] Source #
ParseDot TextItem Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse TextItem Source # parse :: Parse TextItem Source # parseUnqtList :: Parse [TextItem] Source # parseList :: Parse [TextItem] Source #
ParseDot VAlign Source # |
Instance details Defined in Data.GraphViz.Attributes.HTML Methods parseUnqt :: Parse VAlign Source # parse :: Parse VAlign Source # parseUnqtList :: Parse [VAlign] Source # parseList :: Parse [VAlign] Source #
ParseDot CompassPoint Source # |
Instance details Defined in Data.GraphViz.Attributes.Internal Methods parseUnqt :: Parse CompassPoint Source # parse :: Parse CompassPoint Source # parseUnqtList :: Parse [CompassPoint] Source # parseList :: Parse [CompassPoint] Source #
ParseDot PortName Source # |
Instance details Defined in Data.GraphViz.Attributes.Internal Methods parseUnqt :: Parse PortName Source # parse :: Parse PortName Source # parseUnqtList :: Parse [PortName] Source # parseList :: Parse [PortName] Source #
ParseDot PortPos Source # |
Instance details Defined in Data.GraphViz.Attributes.Internal Methods parseUnqt :: Parse PortPos Source # parse :: Parse PortPos Source # parseUnqtList :: Parse [PortPos] Source # parseList :: Parse [PortPos] Source #
ParseDot ClusterMode Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse ClusterMode Source # parse :: Parse ClusterMode Source # parseUnqtList :: Parse [ClusterMode] Source # parseList :: Parse [ClusterMode] Source #
ParseDot DEConstraints Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse DEConstraints Source # parse :: Parse DEConstraints Source # parseUnqtList :: Parse [DEConstraints] Source # parseList :: Parse [DEConstraints] Source #
ParseDot DPoint Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse DPoint Source # parse :: Parse DPoint Source # parseUnqtList :: Parse [DPoint] Source # parseList :: Parse [DPoint] Source #
ParseDot DirType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse DirType Source # parse :: Parse DirType Source # parseUnqtList :: Parse [DirType] Source # parseList :: Parse [DirType] Source #
ParseDot EdgeType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse EdgeType Source # parse :: Parse EdgeType Source # parseUnqtList :: Parse [EdgeType] Source # parseList :: Parse [EdgeType] Source #
ParseDot FocusType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse FocusType Source # parse :: Parse FocusType Source # parseUnqtList :: Parse [FocusType] Source # parseList :: Parse [FocusType] Source #
ParseDot GraphSize Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse GraphSize Source # parse :: Parse GraphSize Source # parseUnqtList :: Parse [GraphSize] Source # parseList :: Parse [GraphSize] Source #
ParseDot Justification Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Justification Source # parse :: Parse Justification Source # parseUnqtList :: Parse [Justification] Source # parseList :: Parse [Justification] Source #
ParseDot Label Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Label Source # parse :: Parse Label Source # parseUnqtList :: Parse [Label] Source # parseList :: Parse [Label] Source #
ParseDot LabelScheme Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LabelScheme Source # parse :: Parse LabelScheme Source # parseUnqtList :: Parse [LabelScheme] Source # parseList :: Parse [LabelScheme] Source #
ParseDot LayerID Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerID Source # parse :: Parse LayerID Source # parseUnqtList :: Parse [LayerID] Source # parseList :: Parse [LayerID] Source #
ParseDot LayerList Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerList Source # parse :: Parse LayerList Source # parseUnqtList :: Parse [LayerList] Source # parseList :: Parse [LayerList] Source #
ParseDot LayerListSep Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerListSep Source # parse :: Parse LayerListSep Source # parseUnqtList :: Parse [LayerListSep] Source # parseList :: Parse [LayerListSep] Source #
ParseDot LayerRangeElem Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerRangeElem Source # parse :: Parse LayerRangeElem Source # parseUnqtList :: Parse [LayerRangeElem] Source # parseList :: Parse [LayerRangeElem] Source #
ParseDot LayerSep Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse LayerSep Source # parse :: Parse LayerSep Source # parseUnqtList :: Parse [LayerSep] Source # parseList :: Parse [LayerSep] Source #
ParseDot ModeType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse ModeType Source # parse :: Parse ModeType Source # parseUnqtList :: Parse [ModeType] Source # parseList :: Parse [ModeType] Source #
ParseDot Model Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Model Source # parse :: Parse Model Source # parseUnqtList :: Parse [Model] Source # parseList :: Parse [Model] Source #
ParseDot NodeSize Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse NodeSize Source # parse :: Parse NodeSize Source # parseUnqtList :: Parse [NodeSize] Source # parseList :: Parse [NodeSize] Source #
ParseDot Normalized Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Normalized Source # parse :: Parse Normalized Source # parseUnqtList :: Parse [Normalized] Source # parseList :: Parse [Normalized] Source #
ParseDot Number Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Number Source # parse :: Parse Number Source # parseUnqtList :: Parse [Number] Source # parseList :: Parse [Number] Source #
ParseDot Order Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Order Source # parse :: Parse Order Source # parseUnqtList :: Parse [Order] Source # parseList :: Parse [Order] Source #
ParseDot OutputMode Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse OutputMode Source # parse :: Parse OutputMode Source # parseUnqtList :: Parse [OutputMode] Source # parseList :: Parse [OutputMode] Source #
ParseDot Overlap Source # | 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 Source # parse :: Parse Overlap Source # parseUnqtList :: Parse [Overlap] Source # parseList :: Parse [Overlap] Source #
ParseDot Pack Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Pack Source # parse :: Parse Pack Source # parseUnqtList :: Parse [Pack] Source # parseList :: Parse [Pack] Source #
ParseDot PackMode Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse PackMode Source # parse :: Parse PackMode Source # parseUnqtList :: Parse [PackMode] Source # parseList :: Parse [PackMode] Source #
ParseDot PageDir Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse PageDir Source # parse :: Parse PageDir Source # parseUnqtList :: Parse [PageDir] Source # parseList :: Parse [PageDir] Source #
ParseDot Paths Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Paths Source # parse :: Parse Paths Source # parseUnqtList :: Parse [Paths] Source # parseList :: Parse [Paths] Source #
ParseDot Point Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Point Source # parse :: Parse Point Source # parseUnqtList :: Parse [Point] Source # parseList :: Parse [Point] Source #
ParseDot Pos Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Pos Source # parse :: Parse Pos Source # parseUnqtList :: Parse [Pos] Source # parseList :: Parse [Pos] Source #
ParseDot QuadType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse QuadType Source # parse :: Parse QuadType Source # parseUnqtList :: Parse [QuadType] Source # parseList :: Parse [QuadType] Source #
ParseDot RankDir Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse RankDir Source # parse :: Parse RankDir Source # parseUnqtList :: Parse [RankDir] Source # parseList :: Parse [RankDir] Source #
ParseDot RankType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse RankType Source # parse :: Parse RankType Source # parseUnqtList :: Parse [RankType] Source # parseList :: Parse [RankType] Source #
ParseDot Ratios Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Ratios Source # parse :: Parse Ratios Source # parseUnqtList :: Parse [Ratios] Source # parseList :: Parse [Ratios] Source #
ParseDot RecordField Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse RecordField Source # parse :: Parse RecordField Source # parseUnqtList :: Parse [RecordField] Source # parseList :: Parse [RecordField] Source #
ParseDot Rect Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Rect Source # parse :: Parse Rect Source # parseUnqtList :: Parse [Rect] Source # parseList :: Parse [Rect] Source #
ParseDot Root Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Root Source # parse :: Parse Root Source # parseUnqtList :: Parse [Root] Source # parseList :: Parse [Root] Source #
ParseDot STStyle Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse STStyle Source # parse :: Parse STStyle Source # parseUnqtList :: Parse [STStyle] Source # parseList :: Parse [STStyle] Source #
ParseDot SVGFontNames Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse SVGFontNames Source # parse :: Parse SVGFontNames Source # parseUnqtList :: Parse [SVGFontNames] Source # parseList :: Parse [SVGFontNames] Source #
ParseDot ScaleType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse ScaleType Source # parse :: Parse ScaleType Source # parseUnqtList :: Parse [ScaleType] Source # parseList :: Parse [ScaleType] Source #
ParseDot Shape Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Shape Source # parse :: Parse Shape Source # parseUnqtList :: Parse [Shape] Source # parseList :: Parse [Shape] Source #
ParseDot SmoothType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse SmoothType Source # parse :: Parse SmoothType Source # parseUnqtList :: Parse [SmoothType] Source # parseList :: Parse [SmoothType] Source #
ParseDot Spline Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse Spline Source # parse :: Parse Spline Source # parseUnqtList :: Parse [Spline] Source # parseList :: Parse [Spline] Source #
ParseDot StartType Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse StartType Source # parse :: Parse StartType Source # parseUnqtList :: Parse [StartType] Source # parseList :: Parse [StartType] Source #
ParseDot StyleItem Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse StyleItem Source # parse :: Parse StyleItem Source # parseUnqtList :: Parse [StyleItem] Source # parseList :: Parse [StyleItem] Source #
ParseDot StyleName Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse StyleName Source # parse :: Parse StyleName Source # parseUnqtList :: Parse [StyleName] Source # parseList :: Parse [StyleName] Source #
ParseDot VerticalPlacement Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse VerticalPlacement Source # parse :: Parse VerticalPlacement Source # parseUnqtList :: Parse [VerticalPlacement] Source # parseList :: Parse [VerticalPlacement] Source #
ParseDot ViewPort Source # |
Instance details Defined in Data.GraphViz.Attributes.Values Methods parseUnqt :: Parse ViewPort Source # parse :: Parse ViewPort Source # parseUnqtList :: Parse [ViewPort] Source # parseList :: Parse [ViewPort] Source #
ParseDot GraphvizCommand Source # |
Instance details Defined in Data.GraphViz.Commands.Available Methods parseUnqt :: Parse GraphvizCommand Source # parse :: Parse GraphvizCommand Source # parseUnqtList :: Parse [GraphvizCommand] Source # parseList :: Parse [GraphvizCommand] Source #
ParseDot GlobalAttributes Source # |
Instance details Defined in Data.GraphViz.Types.Internal.Common Methods parseUnqt :: Parse GlobalAttributes Source # parse :: Parse GlobalAttributes Source # parseUnqtList :: Parse [GlobalAttributes] Source # parseList :: Parse [GlobalAttributes] Source #
ParseDot GraphID Source # |
Instance details Defined in Data.GraphViz.Types.Internal.Common Methods parseUnqt :: Parse GraphID Source # parse :: Parse GraphID Source # parseUnqtList :: Parse [GraphID] Source # parseList :: Parse [GraphID] Source #
ParseDot Text Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Text Source # parse :: Parse Text Source # parseUnqtList :: Parse [Text] Source # parseList :: Parse [Text] Source #
ParseDot Text Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Text Source # parse :: Parse Text Source # parseUnqtList :: Parse [Text] Source # parseList :: Parse [Text] Source #
ParseDot Integer Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Integer Source # parse :: Parse Integer Source # parseUnqtList :: Parse [Integer] Source # parseList :: Parse [Integer] Source #
ParseDot Bool Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Bool Source # parse :: Parse Bool Source # parseUnqtList :: Parse [Bool] Source # parseList :: Parse [Bool] Source #
ParseDot Char Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Char Source # parse :: Parse Char Source # parseUnqtList :: Parse [Char] Source # parseList :: Parse [Char] Source #
ParseDot Double Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Double Source # parse :: Parse Double Source # parseUnqtList :: Parse [Double] Source # parseList :: Parse [Double] Source #
ParseDot Int Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse Int Source # parse :: Parse Int Source # parseUnqtList :: Parse [Int] Source # parseList :: Parse [Int] Source #
ParseDot n => ParseDot (DotGraph n) Source # |
Instance details Defined in Data.GraphViz.Types.Canonical Methods parseUnqt :: Parse (DotGraph n) Source # parse :: Parse (DotGraph n) Source # parseUnqtList :: Parse [DotGraph n] Source # parseList :: Parse [DotGraph n] Source #
ParseDot n => ParseDot (DotStatements n) Source # |
Instance details Defined in Data.GraphViz.Types.Canonical Methods parseUnqt :: Parse (DotStatements n) Source # parse :: Parse (DotStatements n) Source # parseUnqtList :: Parse [DotStatements n] Source # parseList :: Parse [DotStatements n] Source #
ParseDot n => ParseDot (DotSubGraph n) Source # |
Instance details Defined in Data.GraphViz.Types.Canonical Methods parseUnqt :: Parse (DotSubGraph n) Source # parse :: Parse (DotSubGraph n) Source # parseUnqtList :: Parse [DotSubGraph n] Source # parseList :: Parse [DotSubGraph n] Source #
ParseDot n => ParseDot (DotGraph n) Source # |
Instance details Defined in Data.GraphViz.Types.Generalised Methods parseUnqt :: Parse (DotGraph n) Source # parse :: Parse (DotGraph n) Source # parseUnqtList :: Parse [DotGraph n] Source # parseList :: Parse [DotGraph n] Source #
ParseDot n => ParseDot (DotStatement n) Source # |
Instance details Defined in Data.GraphViz.Types.Generalised Methods parseUnqt :: Parse (DotStatement n) Source # parse :: Parse (DotStatement n) Source # parseUnqtList :: Parse [DotStatement n] Source # parseList :: Parse [DotStatement n] Source #
ParseDot n => ParseDot (DotSubGraph n) Source # |
Instance details Defined in Data.GraphViz.Types.Generalised Methods parseUnqt :: Parse (DotSubGraph n) Source # parse :: Parse (DotSubGraph n) Source # parseUnqtList :: Parse [DotSubGraph n] Source # parseList :: Parse [DotSubGraph n] Source #
(Ord n, ParseDot n) => ParseDot (DotGraph n) Source # | Uses the ParseDot instance for generalised `DotGraph`s.
Instance details Defined in Data.GraphViz.Types.Graph Methods parseUnqt :: Parse (DotGraph n) Source # parse :: Parse (DotGraph n) Source # parseUnqtList :: Parse [DotGraph n] Source # parseList :: Parse [DotGraph n] Source #
ParseDot n => ParseDot (DotEdge n) Source # |
Instance details Defined in Data.GraphViz.Types.Internal.Common Methods parseUnqt :: Parse (DotEdge n) Source # parse :: Parse (DotEdge n) Source # parseUnqtList :: Parse [DotEdge n] Source # parseList :: Parse [DotEdge n] Source #
ParseDot n => ParseDot (DotNode n) Source # |
Instance details Defined in Data.GraphViz.Types.Internal.Common Methods parseUnqt :: Parse (DotNode n) Source # parse :: Parse (DotNode n) Source # parseUnqtList :: Parse [DotNode n] Source # parseList :: Parse [DotNode n] Source #
ParseDot a => ParseDot [a] Source # |
Instance details Defined in Data.GraphViz.Parsing Methods parseUnqt :: Parse [a] Source # parse :: Parse [a] Source # parseUnqtList :: Parse [[a]] Source # parseList :: Parse [[a]] Source #

parseIt :: ParseDot a => Text -> (a, Text) Source #

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 Source #

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

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

runParser' :: Parse a -> Text -> a Source #

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) Source #

parseLiberally :: GraphvizState -> GraphvizState Source #

checkValidParse :: Either String a -> a Source #

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

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

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 Source #

The opposite of `bracket`.

onlyBool :: Parse Bool Source #

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

quotelessString :: Parse Text Source #

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

stringBlock :: Parse Text Source #

numString :: Bool -> Parse Text Source #

isNumString :: Bool -> Text -> Bool Source #

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

isIntString :: Text -> Bool Source #

quotedString :: Parse Text Source #

Used when quotes are explicitly required;

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

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 Source #

string :: String -> Parse () Source #

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

character :: Char -> Parse Char Source #

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

parseStrictFloat :: Bool -> Parse Double Source #

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 Source #

noneOf :: [Char] -> Parse Char Source #

whitespace1 :: Parse () Source #

Parses at least one whitespace character.

whitespace :: Parse () Source #

Parses zero or more whitespace characters.

wrapWhitespace :: Parse a -> Parse a Source #

Parse and discard optional surrounding whitespace.

optionalQuotedString :: String -> Parse () Source #

optionalQuoted :: Parse a -> Parse a Source #

quotedParse :: Parse a -> Parse a Source #

orQuote :: Parse Char -> Parse Char Source #

quoteChar :: Char Source #

newline :: Parse () Source #

Parses a newline.

newline' :: Parse () Source #

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

parseComma :: Parse () Source #

parseEq :: Parse () Source #

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

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

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

Return an empty list if parsing a list fails.

consumeLine :: Parse Text Source #

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) Source #

commaSepUnqt :: (ParseDot a, ParseDot b) => Parse (a, b) Source #

commaSep' :: Parse a -> Parse b -> Parse (a, b) Source #

stringRep :: a -> String -> Parse a Source #

stringReps :: a -> [String] -> Parse a Source #

stringParse :: [(String, Parse a)] -> Parse a Source #

stringValue :: [(String, a)] -> Parse a Source #

parseAngled :: Parse a -> Parse a Source #

parseBraced :: Parse a -> Parse a Source #

parseColorScheme :: Bool -> Parse ColorScheme Source #