-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Search Haskell source code from the command line -- -- Search Haskell source code from the command line. -- -- Powered by ghc-exactprint. @package hgrep @version 0.1 module Language.Haskell.HGrep.Prelude data Bool :: * False :: Bool True :: Bool -- | Case analysis for the Bool type. bool x y p -- evaluates to x when p is False, and evaluates -- to y when p is True. -- -- This is equivalent to if p then y else x; that is, one can -- think of it as an if-then-else construct with its arguments reordered. -- --
-- >>> bool "foo" "bar" True -- "bar" -- -- >>> bool "foo" "bar" False -- "foo" ---- -- Confirm that bool x y p and if p then y else -- x are equivalent: -- --
-- >>> let p = True; x = "bar"; y = "foo" -- -- >>> bool x y p == if p then y else x -- True -- -- >>> let p = False -- -- >>> bool x y p == if p then y else x -- True --bool :: a -> a -> Bool -> a -- | Boolean "and" (&&) :: Bool -> Bool -> Bool infixr 3 && -- | Boolean "or" (||) :: Bool -> Bool -> Bool infixr 2 || -- | Boolean "not" not :: Bool -> Bool -- | otherwise is defined as the value True. It helps to make -- guards more readable. eg. -- --
-- f x | x < 0 = ... -- | otherwise = ... --otherwise :: Bool -- | The character type Char is an enumeration whose values -- represent Unicode (or equivalently ISO/IEC 10646) characters (see -- http://www.unicode.org/ for details). This set extends the ISO -- 8859-1 (Latin-1) character set (the first 256 characters), which is -- itself an extension of the ASCII character set (the first 128 -- characters). A character literal in Haskell has type Char. -- -- To convert a Char to or from the corresponding Int value -- defined by Unicode, use toEnum and fromEnum from the -- Enum class respectively (or equivalently ord and -- chr). data Char :: * -- | Invariant: Jn# and Jp# are used iff value doesn't fit in -- S# -- -- Useful properties resulting from the invariants: -- -- data Integer :: * -- | A fixed-precision integer type with at least the range [-2^29 .. -- 2^29-1]. The exact range for a given implementation can be -- determined by using minBound and maxBound from the -- Bounded class. data Int :: * -- | 8-bit signed integer type data Int8 :: * -- | 16-bit signed integer type data Int16 :: * -- | 32-bit signed integer type data Int32 :: * -- | 64-bit signed integer type data Int64 :: * -- | 64-bit unsigned integer type data Word64 :: * -- | general coercion from integral types fromIntegral :: (Integral a, Num b) => a -> b -- | Conversion from a Rational (that is Ratio -- Integer). A floating literal stands for an application of -- fromRational to a value of type Rational, so such -- literals have type (Fractional a) => a. fromRational :: Fractional a => Rational -> a -- | The class of monoids (types with an associative binary operation that -- has an identity). Instances should satisfy the following laws: -- --
mappend mempty x = x
mappend x mempty = x
mappend x (mappend y z) = mappend (mappend x y) z
mconcat = foldr mappend mempty
-- fmap id == id -- fmap (f . g) == fmap f . fmap g ---- -- The instances of Functor for lists, Maybe and IO -- satisfy these laws. class Functor (f :: * -> *) fmap :: Functor f => (a -> b) -> f a -> f b -- | 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. (<$) :: Functor f => a -> f b -> f a -- | 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. -- --
-- >>> show <$> Nothing -- Nothing -- -- >>> show <$> Just 3 -- Just "3" ---- -- Convert from an Either Int Int to -- an Either Int String using -- show: -- --
-- >>> show <$> Left 17 -- Left 17 -- -- >>> show <$> Right 17 -- Right "17" ---- -- Double each element of a list: -- --
-- >>> (*2) <$> [1,2,3] -- [2,4,6] ---- -- Apply even to the second element of a pair: -- --
-- >>> even <$> (2,2) -- (2,True) --(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 <$> -- | Flipped version of <$. -- --
-- >>> Nothing $> "foo" -- Nothing -- -- >>> Just 90210 $> "foo" -- Just "foo" ---- -- Replace the contents of an Either Int -- Int with a constant String, resulting in an -- Either Int String: -- --
-- >>> Left 8675309 $> "foo" -- Left 8675309 -- -- >>> Right 8675309 $> "foo" -- Right "foo" ---- -- Replace each element of a list with a constant String: -- --
-- >>> [1,2,3] $> "foo" -- ["foo","foo","foo"] ---- -- Replace the second element of a pair with a constant String: -- --
-- >>> (1,2) $> "foo" -- (1,"foo") --($>) :: Functor f => f a -> b -> f b infixl 4 $> -- | void value discards or ignores the result of -- evaluation, such as the return value of an IO action. -- --
-- >>> void Nothing -- Nothing -- -- >>> void (Just 3) -- Just () ---- -- Replace the contents of an Either Int -- Int with unit, resulting in an Either -- Int '()': -- --
-- >>> void (Left 8675309) -- Left 8675309 -- -- >>> void (Right 8675309) -- Right () ---- -- Replace every element of a list with unit: -- --
-- >>> void [1,2,3] -- [(),(),()] ---- -- Replace the second element of a pair with unit: -- --
-- >>> void (1,2) -- (1,()) ---- -- Discard the result of an IO action: -- --
-- >>> mapM print [1,2] -- 1 -- 2 -- [(),()] -- -- >>> void $ mapM print [1,2] -- 1 -- 2 --void :: Functor f => f a -> f () with :: Functor f => f a -> (a -> b) -> f b -- | Formally, the class Bifunctor represents a bifunctor from -- Hask -> Hask. -- -- Intuitively it is a bifunctor where both the first and second -- arguments are covariant. -- -- You can define a Bifunctor by either defining bimap or -- by defining both first and second. -- -- If you supply bimap, you should ensure that: -- --
-- bimap id id ≡ id ---- -- If you supply first and second, ensure: -- --
-- first id ≡ id -- second id ≡ id ---- -- If you supply both, you should also ensure: -- --
-- bimap f g ≡ first f . second g ---- -- These ensure by parametricity: -- --
-- bimap (f . g) (h . i) ≡ bimap f h . bimap g i -- first (f . g) ≡ first f . first g -- second (f . g) ≡ second f . second g --class Bifunctor (p :: * -> * -> *) -- | Map over both arguments at the same time. -- --
-- bimap f g ≡ first f . second g --bimap :: Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d -- | Map covariantly over the first argument. -- --
-- first f ≡ bimap f id --first :: Bifunctor p => (a -> b) -> p a c -> p b c -- | Map covariantly over the second argument. -- --
-- second ≡ bimap id --second :: Bifunctor p => (b -> c) -> p a b -> p a c -- | A functor with application, providing operations to -- --
pure id <*> -- v = v
pure (.) <*> u -- <*> v <*> w = u <*> (v -- <*> w)
pure f <*> -- pure x = pure (f x)
u <*> pure y = -- pure ($ y) <*> u
-- mzero >>= f = mzero -- v >> mzero = mzero --mzero :: MonadPlus m => m a -- | an associative operation mplus :: MonadPlus m => m a -> m a -> m a -- | guard b is pure () if b is -- True, and empty if b is False. guard :: Alternative f => Bool -> f () -- | The sum of a collection of actions, generalizing concat. As of -- base 4.8.0.0, msum is just asum, specialized to -- MonadPlus. msum :: (Foldable t, MonadPlus m) => t (m a) -> m a -- | Monads in which IO computations may be embedded. Any monad -- built by applying a sequence of monad transformers to the IO -- monad will be an instance of this class. -- -- Instances should satisfy the following laws, which state that -- liftIO is a transformer of monads: -- -- class Monad m => MonadIO (m :: * -> *) -- | Lift a computation from the IO monad. liftIO :: MonadIO m => IO a -> m a -- | The Either type represents values with two possibilities: a -- value of type Either a b is either Left -- a or Right b. -- -- The Either type is sometimes used to represent a value which is -- either correct or an error; by convention, the Left constructor -- is used to hold an error value and the Right constructor is -- used to hold a correct value (mnemonic: "right" also means "correct"). -- --
-- >>> let s = Left "foo" :: Either String Int -- -- >>> s -- Left "foo" -- -- >>> let n = Right 3 :: Either String Int -- -- >>> n -- Right 3 -- -- >>> :type s -- s :: Either String Int -- -- >>> :type n -- n :: Either String Int ---- -- The fmap from our Functor instance will ignore -- Left values, but will apply the supplied function to values -- contained in a Right: -- --
-- >>> let s = Left "foo" :: Either String Int -- -- >>> let n = Right 3 :: Either String Int -- -- >>> fmap (*2) s -- Left "foo" -- -- >>> fmap (*2) n -- Right 6 ---- -- The Monad instance for Either allows us to chain -- together multiple actions which may fail, and fail overall if any of -- the individual steps failed. First we'll write a function that can -- either parse an Int from a Char, or fail. -- --
-- >>> import Data.Char ( digitToInt, isDigit )
--
-- >>> :{
-- let parseEither :: Char -> Either String Int
-- parseEither c
-- | isDigit c = Right (digitToInt c)
-- | otherwise = Left "parse error"
--
-- >>> :}
--
--
-- The following should work, since both '1' and '2'
-- can be parsed as Ints.
--
--
-- >>> :{
-- let parseMultiple :: Either String Int
-- parseMultiple = do
-- x <- parseEither '1'
-- y <- parseEither '2'
-- return (x + y)
--
-- >>> :}
--
--
-- -- >>> parseMultiple -- Right 3 ---- -- But the following should fail overall, since the first operation where -- we attempt to parse 'm' as an Int will fail: -- --
-- >>> :{
-- let parseMultiple :: Either String Int
-- parseMultiple = do
-- x <- parseEither 'm'
-- y <- parseEither '2'
-- return (x + y)
--
-- >>> :}
--
--
-- -- >>> parseMultiple -- Left "parse error" --data Either a b :: * -> * -> * Left :: a -> Either a b Right :: b -> Either a b -- | Case analysis for the Either type. If the value is -- Left a, apply the first function to a; if it -- is Right b, apply the second function to b. -- --
-- >>> let s = Left "foo" :: Either String Int -- -- >>> let n = Right 3 :: Either String Int -- -- >>> either length (*2) s -- 3 -- -- >>> either length (*2) n -- 6 --either :: (a -> c) -> (b -> c) -> Either a b -> c -- | Tag a Nothing. note :: a -> Maybe b -> Either a b -- | The Maybe type encapsulates an optional value. A value of type -- Maybe a either contains a value of type a -- (represented as Just a), or it is empty (represented -- as Nothing). Using Maybe is a good way to deal with -- errors or exceptional cases without resorting to drastic measures such -- as error. -- -- The Maybe type is also a monad. It is a simple kind of error -- monad, where all errors are represented by Nothing. A richer -- error monad can be built using the Either type. data Maybe a :: * -> * Nothing :: Maybe a Just :: a -> Maybe a -- | The fromMaybe function takes a default value and and -- Maybe value. If the Maybe is Nothing, it returns -- the default values; otherwise, it returns the value contained in the -- Maybe. -- --
-- >>> fromMaybe "" (Just "Hello, World!") -- "Hello, World!" ---- --
-- >>> fromMaybe "" Nothing -- "" ---- -- Read an integer from a string using readMaybe. If we fail to -- parse an integer, we want to return 0 by default: -- --
-- >>> import Text.Read ( readMaybe ) -- -- >>> fromMaybe 0 (readMaybe "5") -- 5 -- -- >>> fromMaybe 0 (readMaybe "") -- 0 --fromMaybe :: a -> Maybe a -> a -- | The maybe function takes a default value, a function, and a -- Maybe value. If the Maybe value is Nothing, the -- function returns the default value. Otherwise, it applies the function -- to the value inside the Just and returns the result. -- --
-- >>> maybe False odd (Just 3) -- True ---- --
-- >>> maybe False odd Nothing -- False ---- -- Read an integer from a string using readMaybe. If we succeed, -- return twice the integer; that is, apply (*2) to it. If -- instead we fail to parse an integer, return 0 by default: -- --
-- >>> import Text.Read ( readMaybe ) -- -- >>> maybe 0 (*2) (readMaybe "5") -- 10 -- -- >>> maybe 0 (*2) (readMaybe "") -- 0 ---- -- Apply show to a Maybe Int. If we have Just -- n, we want to show the underlying Int n. But if -- we have Nothing, we return the empty string instead of (for -- example) "Nothing": -- --
-- >>> maybe "" show (Just 5) -- "5" -- -- >>> maybe "" show Nothing -- "" --maybe :: b -> (a -> b) -> Maybe a -> b -- | Eliminate a Left. hush :: Either a b -> Maybe b -- | Extract the first component of a pair. fst :: (a, b) -> a -- | Extract the second component of a pair. snd :: (a, b) -> b -- | curry converts an uncurried function to a curried function. curry :: ((a, b) -> c) -> a -> b -> c -- | uncurry converts a curried function to a function on pairs. uncurry :: (a -> b -> c) -> (a, b) -> c -- | Class Enum defines operations on sequentially ordered types. -- -- The enumFrom... methods are used in Haskell's translation of -- arithmetic sequences. -- -- Instances of Enum may be derived for any enumeration type -- (types whose constructors have no fields). The nullary constructors -- are assumed to be numbered left-to-right by fromEnum from -- 0 through n-1. See Chapter 10 of the Haskell -- Report for more details. -- -- For any type that is an instance of class Bounded as well as -- Enum, the following should hold: -- --
-- enumFrom x = enumFromTo x maxBound -- enumFromThen x y = enumFromThenTo x y bound -- where -- bound | fromEnum y >= fromEnum x = maxBound -- | otherwise = minBound --class Enum a -- | the successor of a value. For numeric types, succ adds 1. succ :: Enum a => a -> a -- | the predecessor of a value. For numeric types, pred subtracts -- 1. pred :: Enum a => a -> a -- | Convert from an Int. toEnum :: Enum a => Int -> a -- | Convert to an Int. It is implementation-dependent what -- fromEnum returns when applied to a value that is too large to -- fit in an Int. fromEnum :: Enum a => a -> Int -- | Used in Haskell's translation of [n..]. enumFrom :: Enum a => a -> [a] -- | Used in Haskell's translation of [n,n'..]. enumFromThen :: Enum a => a -> a -> [a] -- | Used in Haskell's translation of [n..m]. enumFromTo :: Enum a => a -> a -> [a] -- | Used in Haskell's translation of [n,n'..m]. enumFromThenTo :: Enum a => a -> a -> a -> [a] -- | The Eq class defines equality (==) and inequality -- (/=). All the basic datatypes exported by the Prelude -- are instances of Eq, and Eq may be derived for any -- datatype whose constituents are also instances of Eq. -- -- Minimal complete definition: either == or /=. class Eq a (==) :: Eq a => a -> a -> Bool (/=) :: Eq a => a -> a -> Bool -- | Parsing of Strings, producing values. -- -- Derived instances of Read make the following assumptions, which -- derived instances of Show obey: -- --
-- infixr 5 :^: -- data Tree a = Leaf a | Tree a :^: Tree a ---- -- the derived instance of Read in Haskell 2010 is equivalent to -- --
-- instance (Read a) => Read (Tree a) where
--
-- readsPrec d r = readParen (d > app_prec)
-- (\r -> [(Leaf m,t) |
-- ("Leaf",s) <- lex r,
-- (m,t) <- readsPrec (app_prec+1) s]) r
--
-- ++ readParen (d > up_prec)
-- (\r -> [(u:^:v,w) |
-- (u,s) <- readsPrec (up_prec+1) r,
-- (":^:",t) <- lex s,
-- (v,w) <- readsPrec (up_prec+1) t]) r
--
-- where app_prec = 10
-- up_prec = 5
--
--
-- Note that right-associativity of :^: is unused.
--
-- The derived instance in GHC is equivalent to
--
-- -- instance (Read a) => Read (Tree a) where -- -- readPrec = parens $ (prec app_prec $ do -- Ident "Leaf" <- lexP -- m <- step readPrec -- return (Leaf m)) -- -- +++ (prec up_prec $ do -- u <- step readPrec -- Symbol ":^:" <- lexP -- v <- step readPrec -- return (u :^: v)) -- -- where app_prec = 10 -- up_prec = 5 -- -- readListPrec = readListPrecDefault --class Read a -- | attempts to parse a value from the front of the string, returning a -- list of (parsed value, remaining string) pairs. If there is no -- successful parse, the returned list is empty. -- -- Derived instances of Read and Show satisfy the -- following: -- -- -- -- That is, readsPrec parses the string produced by -- showsPrec, and delivers the value that showsPrec started -- with. readsPrec :: Read a => Int -> ReadS a -- | The method readList is provided to allow the programmer to give -- a specialised way of parsing lists of values. For example, this is -- used by the predefined Read instance of the Char type, -- where values of type String should be are expected to use -- double quotes, rather than square brackets. readList :: Read a => ReadS [a] -- | Proposed replacement for readsPrec using new-style parsers (GHC -- only). readPrec :: Read a => ReadPrec a -- | Proposed replacement for readList using new-style parsers (GHC -- only). The default definition uses readList. Instances that -- define readPrec should also define readListPrec as -- readListPrecDefault. readListPrec :: Read a => ReadPrec [a] -- | Parse a string using the Read instance. Succeeds if there is -- exactly one valid result. A Left value indicates a parse error. readEither :: Read a => String -> Either String a -- | Parse a string using the Read instance. Succeeds if there is -- exactly one valid result. readMaybe :: Read a => String -> Maybe a -- | Conversion of values to readable Strings. -- -- Derived instances of Show have the following properties, which -- are compatible with derived instances of Read: -- --
-- infixr 5 :^: -- data Tree a = Leaf a | Tree a :^: Tree a ---- -- the derived instance of Show is equivalent to -- --
-- instance (Show a) => Show (Tree a) where -- -- showsPrec d (Leaf m) = showParen (d > app_prec) $ -- showString "Leaf " . showsPrec (app_prec+1) m -- where app_prec = 10 -- -- showsPrec d (u :^: v) = showParen (d > up_prec) $ -- showsPrec (up_prec+1) u . -- showString " :^: " . -- showsPrec (up_prec+1) v -- where up_prec = 5 ---- -- Note that right-associativity of :^: is ignored. For example, -- --
-- showsPrec d x r ++ s == showsPrec d x (r ++ s) ---- -- Derived instances of Read and Show satisfy the -- following: -- -- -- -- That is, readsPrec parses the string produced by -- showsPrec, and delivers the value that showsPrec started -- with. showsPrec :: Show a => Int -> a -> ShowS -- | A specialised variant of showsPrec, using precedence context -- zero, and returning an ordinary String. show :: Show a => a -> String -- | The method showList is provided to allow the programmer to give -- a specialised way of showing lists of values. For example, this is -- used by the predefined Show instance of the Char type, -- where values of type String should be shown in double quotes, -- rather than between square brackets. showList :: Show a => [a] -> ShowS -- | The shows functions return a function that prepends the -- output String to an existing String. This allows -- constant-time concatenation of results using function composition. type ShowS = String -> String -- | utility function converting a String to a show function that -- simply prepends the string unchanged. showString :: String -> ShowS -- | Data structures that can be folded. -- -- For example, given a data type -- --
-- data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) ---- -- a suitable instance would be -- --
-- instance Foldable Tree where -- foldMap f Empty = mempty -- foldMap f (Leaf x) = f x -- foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r ---- -- This is suitable even for abstract types, as the monoid is assumed to -- satisfy the monoid laws. Alternatively, one could define -- foldr: -- --
-- instance Foldable Tree where -- foldr f z Empty = z -- foldr f z (Leaf x) = f x z -- foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l ---- -- Foldable instances are expected to satisfy the following -- laws: -- --
-- foldr f z t = appEndo (foldMap (Endo . f) t ) z ---- --
-- foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z ---- --
-- fold = foldMap id ---- -- sum, product, maximum, and minimum -- should all be essentially equivalent to foldMap forms, such -- as -- --
-- sum = getSum . foldMap Sum ---- -- but may be less defined. -- -- If the type is also a Functor instance, it should satisfy -- --
-- foldMap f = fold . fmap f ---- -- which implies that -- --
-- foldMap f . fmap g = foldMap (f . g) --class Foldable (t :: * -> *) -- | Combine the elements of a structure using a monoid. fold :: (Foldable t, Monoid m) => t m -> m -- | Map each element of the structure to a monoid, and combine the -- results. foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m -- | Right-associative fold of a structure. -- -- In the case of lists, foldr, when applied to a binary operator, -- a starting value (typically the right-identity of the operator), and a -- list, reduces the list using the binary operator, from right to left: -- --
-- foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...) ---- -- Note that, since the head of the resulting expression is produced by -- an application of the operator to the first element of the list, -- foldr can produce a terminating expression from an infinite -- list. -- -- For a general Foldable structure this should be semantically -- identical to, -- --
-- foldr f z = foldr f z . toList --foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b -- | Right-associative fold of a structure, but with strict application of -- the operator. foldr' :: Foldable t => (a -> b -> b) -> b -> t a -> b -- | Left-associative fold of a structure. -- -- In the case of lists, foldl, when applied to a binary operator, -- a starting value (typically the left-identity of the operator), and a -- list, reduces the list using the binary operator, from left to right: -- --
-- foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn ---- -- Note that to produce the outermost application of the operator the -- entire input list must be traversed. This means that foldl' -- will diverge if given an infinite list. -- -- Also note that if you want an efficient left-fold, you probably want -- to use foldl' instead of foldl. The reason for this is -- that latter does not force the "inner" results (e.g. z f -- x1 in the above example) before applying them to the operator -- (e.g. to (f x2)). This results in a thunk chain -- O(n) elements long, which then must be evaluated from the -- outside-in. -- -- For a general Foldable structure this should be semantically -- identical to, -- --
-- foldl f z = foldl f z . toList --foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b -- | Left-associative fold of a structure but with strict application of -- the operator. -- -- This ensures that each step of the fold is forced to weak head normal -- form before being applied, avoiding the collection of thunks that -- would otherwise occur. This is often what you want to strictly reduce -- a finite list to a single, monolithic result (e.g. length). -- -- For a general Foldable structure this should be semantically -- identical to, -- --
-- foldl f z = foldl' f z . toList --foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b -- | A variant of foldr that has no base case, and thus may only be -- applied to non-empty structures. -- --
-- foldr1 f = foldr1 f . toList --foldr1 :: Foldable t => (a -> a -> a) -> t a -> a -- | A variant of foldl that has no base case, and thus may only be -- applied to non-empty structures. -- --
-- foldl1 f = foldl1 f . toList --foldl1 :: Foldable t => (a -> a -> a) -> t a -> a -- | List of elements of a structure, from left to right. toList :: Foldable t => t a -> [a] -- | Test whether the structure is empty. The default implementation is -- optimized for structures that are similar to cons-lists, because there -- is no general way to do better. null :: Foldable t => t a -> Bool -- | Returns the size/length of a finite structure as an Int. The -- default implementation is optimized for structures that are similar to -- cons-lists, because there is no general way to do better. length :: Foldable t => t a -> Int -- | Does the element occur in the structure? elem :: (Foldable t, Eq a) => a -> t a -> Bool -- | The largest element of a non-empty structure. maximum :: (Foldable t, Ord a) => t a -> a -- | The least element of a non-empty structure. minimum :: (Foldable t, Ord a) => t a -> a -- | The sum function computes the sum of the numbers of a -- structure. sum :: (Foldable t, Num a) => t a -> a -- | The product function computes the product of the numbers of a -- structure. product :: (Foldable t, Num a) => t a -> a -- | for_ is traverse_ with its arguments flipped. For a -- version that doesn't ignore the results see for. -- --
-- >>> for_ [1..4] print -- 1 -- 2 -- 3 -- 4 --for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f () -- | The Ord class is used for totally ordered datatypes. -- -- Instances of Ord can be derived for any user-defined datatype -- whose constituent types are in Ord. The declared order of the -- constructors in the data declaration determines the ordering in -- derived Ord instances. The Ordering datatype allows a -- single comparison to determine the precise ordering of two objects. -- -- Minimal complete definition: either compare or <=. -- Using compare can be more efficient for complex types. class Eq a => Ord a compare :: Ord a => a -> a -> Ordering (<) :: Ord a => a -> a -> Bool (<=) :: Ord a => a -> a -> Bool (>) :: Ord a => a -> a -> Bool (>=) :: Ord a => a -> a -> Bool max :: Ord a => a -> a -> a min :: Ord a => a -> a -> a data Ordering :: * LT :: Ordering EQ :: Ordering GT :: Ordering -- |
-- comparing p x y = compare (p x) (p y) ---- -- Useful combinator for use in conjunction with the xxxBy -- family of functions from Data.List, for example: -- --
-- ... sortBy (comparing fst) ... --comparing :: Ord a => (b -> a) -> b -> b -> Ordering -- | Functors representing data structures that can be traversed from left -- to right. -- -- A definition of traverse must satisfy the following laws: -- --
-- t :: (Applicative f, Applicative g) => f a -> g a ---- -- preserving the Applicative operations, i.e. -- -- -- -- and the identity functor Identity and composition of functors -- Compose are defined as -- --
-- newtype Identity a = Identity a -- -- instance Functor Identity where -- fmap f (Identity x) = Identity (f x) -- -- instance Applicative Identity where -- pure x = Identity x -- Identity f <*> Identity x = Identity (f x) -- -- newtype Compose f g a = Compose (f (g a)) -- -- instance (Functor f, Functor g) => Functor (Compose f g) where -- fmap f (Compose x) = Compose (fmap (fmap f) x) -- -- instance (Applicative f, Applicative g) => Applicative (Compose f g) where -- pure x = Compose (pure (pure x)) -- Compose f <*> Compose x = Compose ((<*>) <$> f <*> x) ---- -- (The naturality law is implied by parametricity.) -- -- Instances are similar to Functor, e.g. given a data type -- --
-- data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a) ---- -- a suitable instance would be -- --
-- instance Traversable Tree where -- traverse f Empty = pure Empty -- traverse f (Leaf x) = Leaf <$> f x -- traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r ---- -- This is suitable even for abstract types, as the laws for -- <*> imply a form of associativity. -- -- The superclass instances should satisfy the following: -- --
-- f $ g $ h x = f (g (h x)) ---- -- It is also useful in higher-order situations, such as map -- ($ 0) xs, or zipWith ($) fs xs. ($) :: (a -> b) -> a -> b infixr 0 $ -- | Strict (call-by-value) application operator. It takes a function and -- an argument, evaluates the argument to weak head normal form (WHNF), -- then calls the function with that value. ($!) :: (a -> b) -> a -> b infixr 0 $! -- | & is a reverse application operator. This provides -- notational convenience. Its precedence is one higher than that of the -- forward application operator $, which allows & to be -- nested in $. (&) :: a -> (a -> b) -> b infixl 1 & -- | const x is a unary function which evaluates to x for -- all inputs. -- -- For instance, -- --
-- >>> map (const 42) [0..3] -- [42,42,42,42] --const :: a -> b -> a -- | flip f takes its (first) two arguments in the reverse -- order of f. flip :: (a -> b -> c) -> b -> a -> c -- | fix f is the least fixed point of the function -- f, i.e. the least defined x such that f x = -- x. fix :: (a -> a) -> a -- | (*) `on` f = \x y -> f x * f y. -- -- Typical usage: sortBy (compare `on` -- fst). -- -- Algebraic properties: -- -- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c infixl 0 `on` -- | The value of seq a b is bottom if a is bottom, and -- otherwise equal to b. seq is usually introduced to -- improve performance by avoiding unneeded laziness. -- -- A note on evaluation order: the expression seq a b does -- not guarantee that a will be evaluated before -- b. The only guarantee given by seq is that the both -- a and b will be evaluated before seq -- returns a value. In particular, this means that b may be -- evaluated before a. If you need to guarantee a specific order -- of evaluation, you must use the function pseq from the -- "parallel" package. seq :: a -> b -> b -- | A value of type IO a is a computation which, when -- performed, does some I/O before returning a value of type a. -- -- There is really only one way to "perform" an I/O action: bind it to -- Main.main in your program. When your program is run, the I/O -- will be performed. It isn't possible to perform I/O from an arbitrary -- function, unless that function is itself in the IO monad and -- called at some point, directly or indirectly, from Main.main. -- -- IO is a monad, so IO actions can be combined using -- either the do-notation or the >> and >>= -- operations from the Monad class. data IO a :: * -> * -- | File and directory names are values of type String, whose -- precise meaning is operating system dependent. Files can be opened, -- yielding a handle which can then be used to operate on the contents of -- that file. type FilePath = String -- | Warning: undefined is unsafe undefined :: HasCallStack => a -- | Warning: error is unsafe error :: HasCallStack => [Char] -> a -- | Warning: trace should only be used while debugging trace :: [Char] -> a -> a -- | Warning: traceM should only be used while debugging traceM :: Applicative f => [Char] -> f () -- | Warning: traceIO should only be used while debugging traceIO :: [Char] -> IO () module Language.Haskell.HGrep.Internal.Lens.Rules rules :: LensRules namer :: FieldNamer makeOptics :: Name -> DecsQ module Language.Haskell.HGrep.Internal.Lens _L :: forall l_aukr e_auks l_aukw e_aukx. Iso (GenLocated l_aukw e_aukx) (GenLocated l_aukr e_auks) (l_aukw, e_aukx) (l_aukr, e_auks) _loc :: Lens' (Located e) SrcSpan _unloc :: Lens' (Located e) e _OccName :: Iso' OccName (NameSpace, FastString) _occNameSpace :: Lens' OccName NameSpace _occNameFS :: Lens' OccName FastString _Exact :: Prism' RdrName Name _Orig :: Prism' RdrName (Module, OccName) _Qual :: Prism' RdrName (ModuleName, OccName) _Unqual :: Prism' RdrName OccName _Name :: Iso' Name (NameSort, OccName, Int, SrcSpan) _n_uniq :: Lens' Name Int _n_sort :: Lens' Name NameSort _n_occ :: Lens' Name OccName _n_loc :: Lens' Name SrcSpan _HsModule :: forall name_auY4 name_avH5. Iso (HsModule name_avH5) (HsModule name_auY4) (Maybe (Located ModuleName), Maybe (Located [LIE name_avH5]), [LImportDecl name_avH5], [LHsDecl name_avH5], Maybe (Located WarningTxt), Maybe LHsDocString) (Maybe (Located ModuleName), Maybe (Located [LIE name_auY4]), [LImportDecl name_auY4], [LHsDecl name_auY4], Maybe (Located WarningTxt), Maybe LHsDocString) _hsmodName :: forall name_auY4. Lens' (HsModule name_auY4) (Maybe (Located ModuleName)) _hsmodImports :: forall name_auY4. Lens' (HsModule name_auY4) [LImportDecl name_auY4] _hsmodHaddockModHeader :: forall name_auY4. Lens' (HsModule name_auY4) (Maybe LHsDocString) _hsmodExports :: forall name_auY4. Lens' (HsModule name_auY4) (Maybe (Located [LIE name_auY4])) _hsmodDeprecMessage :: forall name_auY4. Lens' (HsModule name_auY4) (Maybe (Located WarningTxt)) _hsmodDecls :: forall name_auY4. Lens' (HsModule name_auY4) [LHsDecl name_auY4] _RoleAnnotD :: forall id_avHV. Prism' (HsDecl id_avHV) (RoleAnnotDecl id_avHV) _DocD :: forall id_avHV. Prism' (HsDecl id_avHV) DocDecl _SpliceD :: forall id_avHV. Prism' (HsDecl id_avHV) (SpliceDecl id_avHV) _VectD :: forall id_avHV. Prism' (HsDecl id_avHV) (VectDecl id_avHV) _RuleD :: forall id_avHV. Prism' (HsDecl id_avHV) (RuleDecls id_avHV) _AnnD :: forall id_avHV. Prism' (HsDecl id_avHV) (AnnDecl id_avHV) _WarningD :: forall id_avHV. Prism' (HsDecl id_avHV) (WarnDecls id_avHV) _ForD :: forall id_avHV. Prism' (HsDecl id_avHV) (ForeignDecl id_avHV) _DefD :: forall id_avHV. Prism' (HsDecl id_avHV) (DefaultDecl id_avHV) _SigD :: forall id_avHV. Prism' (HsDecl id_avHV) (Sig id_avHV) _ValD :: forall id_avHV. Prism' (HsDecl id_avHV) (HsBind id_avHV) _DerivD :: forall id_avHV. Prism' (HsDecl id_avHV) (DerivDecl id_avHV) _InstD :: forall id_avHV. Prism' (HsDecl id_avHV) (InstDecl id_avHV) _TyClD :: forall id_avHV. Prism' (HsDecl id_avHV) (TyClDecl id_avHV) _ClassDecl :: forall name_avLE. Prism' (TyClDecl name_avLE) (LHsContext name_avLE, Located name_avLE, LHsQTyVars name_avLE, [Located (FunDep (Located name_avLE))], [LSig name_avLE], LHsBinds name_avLE, [LFamilyDecl name_avLE], [LTyFamDefltEqn name_avLE], [LDocDecl], PostRn name_avLE NameSet) _DataDecl :: forall name_avLE. Prism' (TyClDecl name_avLE) (Located name_avLE, LHsQTyVars name_avLE, HsDataDefn name_avLE, PostRn name_avLE Bool, PostRn name_avLE NameSet) _SynDecl :: forall name_avLE. Prism' (TyClDecl name_avLE) (Located name_avLE, LHsQTyVars name_avLE, LHsType name_avLE, PostRn name_avLE NameSet) _FamDecl :: forall name_avLE. Prism' (TyClDecl name_avLE) (FamilyDecl name_avLE) _tcdTyVars :: forall name_avLE. Traversal' (TyClDecl name_avLE) (LHsQTyVars name_avLE) _tcdSigs :: forall name_avLE. Traversal' (TyClDecl name_avLE) [LSig name_avLE] _tcdRhs :: forall name_avLE. Traversal' (TyClDecl name_avLE) (LHsType name_avLE) _tcdMeths :: forall name_avLE. Traversal' (TyClDecl name_avLE) (LHsBinds name_avLE) _tcdLName :: forall name_avLE. Traversal' (TyClDecl name_avLE) (Located name_avLE) _tcdFam :: forall name_avLE. Traversal' (TyClDecl name_avLE) (FamilyDecl name_avLE) _tcdFVs :: forall name_avLE. Traversal' (TyClDecl name_avLE) (PostRn name_avLE NameSet) _tcdFDs :: forall name_avLE. Traversal' (TyClDecl name_avLE) [Located (FunDep (Located name_avLE))] _tcdDocs :: forall name_avLE. Traversal' (TyClDecl name_avLE) [LDocDecl] _tcdDataDefn :: forall name_avLE. Traversal' (TyClDecl name_avLE) (HsDataDefn name_avLE) _tcdDataCusk :: forall name_avLE. Traversal' (TyClDecl name_avLE) (PostRn name_avLE Bool) _tcdCtxt :: forall name_avLE. Traversal' (TyClDecl name_avLE) (LHsContext name_avLE) _tcdATs :: forall name_avLE. Traversal' (TyClDecl name_avLE) [LFamilyDecl name_avLE] _tcdATDefs :: forall name_avLE. Traversal' (TyClDecl name_avLE) [LTyFamDefltEqn name_avLE] _TyFamInstD :: forall name_avLR. Prism' (InstDecl name_avLR) (TyFamInstDecl name_avLR) _DataFamInstD :: forall name_avLR. Prism' (InstDecl name_avLR) (DataFamInstDecl name_avLR) _ClsInstD :: forall name_avLR. Prism' (InstDecl name_avLR) (ClsInstDecl name_avLR) _tfid_inst :: forall name_avLR. Traversal' (InstDecl name_avLR) (TyFamInstDecl name_avLR) _dfid_inst :: forall name_avLR. Traversal' (InstDecl name_avLR) (DataFamInstDecl name_avLR) _cid_inst :: forall name_avLR. Traversal' (InstDecl name_avLR) (ClsInstDecl name_avLR) _DerivDecl :: forall name_avM1 name_awXu. Iso (DerivDecl name_awXu) (DerivDecl name_avM1) (LHsSigType name_awXu, Maybe (Located OverlapMode)) (LHsSigType name_avM1, Maybe (Located OverlapMode)) _deriv_type :: forall name_avM1 name_awXl. Lens (DerivDecl name_avM1) (DerivDecl name_awXl) (LHsSigType name_avM1) (LHsSigType name_awXl) _deriv_overlap_mode :: forall name_avM1. Lens' (DerivDecl name_avM1) (Maybe (Located OverlapMode)) _MinimalSig :: forall name_avM7. Prism' (Sig name_avM7) (SourceText, LBooleanFormula (Located name_avM7)) _SpecInstSig :: forall name_avM7. Prism' (Sig name_avM7) (SourceText, LHsSigType name_avM7) _SpecSig :: forall name_avM7. Prism' (Sig name_avM7) (Located name_avM7, [LHsSigType name_avM7], InlinePragma) _InlineSig :: forall name_avM7. Prism' (Sig name_avM7) (Located name_avM7, InlinePragma) _FixSig :: forall name_avM7. Prism' (Sig name_avM7) (FixitySig name_avM7) _IdSig :: forall name_avM7. Prism' (Sig name_avM7) Id _ClassOpSig :: forall name_avM7. Prism' (Sig name_avM7) (Bool, [Located name_avM7], LHsSigType name_avM7) _PatSynSig :: forall name_avM7. Prism' (Sig name_avM7) (Located name_avM7, LHsSigType name_avM7) _TypeSig :: forall name_avM7. Prism' (Sig name_avM7) ([Located name_avM7], LHsSigWcType name_avM7) _DefaultDecl :: forall name_avMz name_axb5. Iso (DefaultDecl name_axb5) (DefaultDecl name_avMz) [LHsType name_axb5] [LHsType name_avMz] _ForeignExport :: forall name_avMD. Prism' (ForeignDecl name_avMD) (Located name_avMD, LHsSigType name_avMD, PostTc name_avMD Coercion, ForeignExport) _ForeignImport :: forall name_avMD. Prism' (ForeignDecl name_avMD) (Located name_avMD, LHsSigType name_avMD, PostTc name_avMD Coercion, ForeignImport) _fd_sig_ty :: forall name_avMD. Lens' (ForeignDecl name_avMD) (LHsSigType name_avMD) _fd_name :: forall name_avMD. Lens' (ForeignDecl name_avMD) (Located name_avMD) _fd_fi :: forall name_avMD. Traversal' (ForeignDecl name_avMD) ForeignImport _fd_fe :: forall name_avMD. Traversal' (ForeignDecl name_avMD) ForeignExport _fd_co :: forall name_avMD. Lens' (ForeignDecl name_avMD) (PostTc name_avMD Coercion) _Warnings :: forall name_avMK name_axiv. Iso (WarnDecls name_axiv) (WarnDecls name_avMK) (SourceText, [LWarnDecl name_axiv]) (SourceText, [LWarnDecl name_avMK]) _wd_warnings :: forall name_avMK name_axim. Lens (WarnDecls name_avMK) (WarnDecls name_axim) [LWarnDecl name_avMK] [LWarnDecl name_axim] _wd_src :: forall name_avMK. Lens' (WarnDecls name_avMK) SourceText _HsAnnotation :: forall name_avMO name_axmN. Iso (AnnDecl name_axmN) (AnnDecl name_avMO) (SourceText, AnnProvenance name_axmN, Located (HsExpr name_axmN)) (SourceText, AnnProvenance name_avMO, Located (HsExpr name_avMO)) _HsRules :: forall name_avMS name_axnU. Iso (RuleDecls name_axnU) (RuleDecls name_avMS) (SourceText, [LRuleDecl name_axnU]) (SourceText, [LRuleDecl name_avMS]) _rds_src :: forall name_avMS. Lens' (RuleDecls name_avMS) SourceText _rds_rules :: forall name_avMS name_axnL. Lens (RuleDecls name_avMS) (RuleDecls name_axnL) [LRuleDecl name_avMS] [LRuleDecl name_axnL] _HsVectInstOut :: forall name_avMW. Prism' (VectDecl name_avMW) ClsInst _HsVectInstIn :: forall name_avMW. Prism' (VectDecl name_avMW) (LHsSigType name_avMW) _HsVectClassOut :: forall name_avMW. Prism' (VectDecl name_avMW) Class _HsVectClassIn :: forall name_avMW. Prism' (VectDecl name_avMW) (SourceText, Located name_avMW) _HsVectTypeOut :: forall name_avMW. Prism' (VectDecl name_avMW) (Bool, TyCon, Maybe TyCon) _HsVectTypeIn :: forall name_avMW. Prism' (VectDecl name_avMW) (SourceText, Bool, Located name_avMW, Maybe (Located name_avMW)) _HsNoVect :: forall name_avMW. Prism' (VectDecl name_avMW) (SourceText, Located name_avMW) _HsVect :: forall name_avMW. Prism' (VectDecl name_avMW) (SourceText, Located name_avMW, LHsExpr name_avMW) _SpliceDecl :: forall id_avNl id_axOb. Iso (SpliceDecl id_axOb) (SpliceDecl id_avNl) (Located (HsSplice id_axOb), SpliceExplicitFlag) (Located (HsSplice id_avNl), SpliceExplicitFlag) _DocGroup :: Prism' DocDecl (Int, HsDocString) _DocCommentNamed :: Prism' DocDecl (String, HsDocString) _DocCommentPrev :: Prism' DocDecl HsDocString _DocCommentNext :: Prism' DocDecl HsDocString _RoleAnnotDecl :: forall name_avNB name_ay1n. Iso (RoleAnnotDecl name_ay1n) (RoleAnnotDecl name_avNB) (Located name_ay1n, [Located (Maybe Role)]) (Located name_avNB, [Located (Maybe Role)]) _PatSynBind :: forall idL_avRZ idR_avS0. Prism' (HsBindLR idL_avRZ idR_avS0) (PatSynBind idL_avRZ idR_avS0) _AbsBindsSig :: forall idL_avRZ idR_avS0. Prism' (HsBindLR idL_avRZ idR_avS0) ([TyVar], [EvVar], idL_avRZ, TcSpecPrags, TcEvBinds, LHsBind idL_avRZ) _AbsBinds :: forall idL_avRZ idR_avS0. Prism' (HsBindLR idL_avRZ idR_avS0) ([TyVar], [EvVar], [ABExport idL_avRZ], [TcEvBinds], LHsBinds idL_avRZ) _VarBind :: forall idL_avRZ idR_avS0. Prism' (HsBindLR idL_avRZ idR_avS0) (idL_avRZ, LHsExpr idR_avS0, Bool) _PatBind :: forall idL_avRZ idR_avS0. Prism' (HsBindLR idL_avRZ idR_avS0) (LPat idL_avRZ, GRHSs idR_avS0 (LHsExpr idR_avS0), PostTc idR_avS0 Type, PostRn idL_avRZ NameSet, ([Tickish Id], [[Tickish Id]])) _FunBind :: forall idL_avRZ idR_avS0. Prism' (HsBindLR idL_avRZ idR_avS0) (Located idL_avRZ, MatchGroup idR_avS0 (LHsExpr idR_avS0), HsWrapper, PostRn idL_avRZ NameSet, [Tickish Id]) _var_rhs :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (LHsExpr idR_avS0) _var_inline :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) Bool _var_id :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) idL_avRZ _pat_ticks :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) ([Tickish Id], [[Tickish Id]]) _pat_rhs_ty :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (PostTc idR_avS0 Type) _pat_rhs :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (GRHSs idR_avS0 (LHsExpr idR_avS0)) _pat_lhs :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (LPat idL_avRZ) _fun_tick :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) [Tickish Id] _fun_matches :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (MatchGroup idR_avS0 (LHsExpr idR_avS0)) _fun_id :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (Located idL_avRZ) _fun_co_fn :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) HsWrapper _bind_fvs :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (PostRn idL_avRZ NameSet) _abs_tvs :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) [TyVar] _abs_sig_prags :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) TcSpecPrags _abs_sig_export :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) idL_avRZ _abs_sig_ev_bind :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) TcEvBinds _abs_sig_bind :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (LHsBind idL_avRZ) _abs_exports :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) [ABExport idL_avRZ] _abs_ev_vars :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) [EvVar] _abs_ev_binds :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) [TcEvBinds] _abs_binds :: forall idL_avRZ idR_avS0. Traversal' (HsBindLR idL_avRZ idR_avS0) (LHsBinds idL_avRZ) _HsWrap :: forall id_axkp. Prism' (HsExpr id_axkp) (HsWrapper, HsExpr id_axkp) _ELazyPat :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp) _EViewPat :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsExpr id_axkp) _EAsPat :: forall id_axkp. Prism' (HsExpr id_axkp) (Located id_axkp, LHsExpr id_axkp) _EWildPat :: forall id_axkp. Prism' (HsExpr id_axkp) () _HsTickPragma :: forall id_axkp. Prism' (HsExpr id_axkp) (SourceText, (StringLiteral, (Int, Int), (Int, Int)), ((SourceText, SourceText), (SourceText, SourceText)), LHsExpr id_axkp) _HsBinTick :: forall id_axkp. Prism' (HsExpr id_axkp) (Int, Int, LHsExpr id_axkp) _HsTick :: forall id_axkp. Prism' (HsExpr id_axkp) (Tickish id_axkp, LHsExpr id_axkp) _HsArrForm :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, Maybe Fixity, [LHsCmdTop id_axkp]) _HsArrApp :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsExpr id_axkp, PostTc id_axkp Type, HsArrAppType, Bool) _HsStatic :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp) _HsProc :: forall id_axkp. Prism' (HsExpr id_axkp) (LPat id_axkp, LHsCmdTop id_axkp) _HsSpliceE :: forall id_axkp. Prism' (HsExpr id_axkp) (HsSplice id_axkp) _HsTcBracketOut :: forall id_axkp. Prism' (HsExpr id_axkp) (HsBracket Name, [PendingTcSplice]) _HsRnBracketOut :: forall id_axkp. Prism' (HsExpr id_axkp) (HsBracket Name, [PendingRnSplice]) _HsBracket :: forall id_axkp. Prism' (HsExpr id_axkp) (HsBracket id_axkp) _HsCoreAnn :: forall id_axkp. Prism' (HsExpr id_axkp) (SourceText, StringLiteral, LHsExpr id_axkp) _HsSCC :: forall id_axkp. Prism' (HsExpr id_axkp) (SourceText, StringLiteral, LHsExpr id_axkp) _PArrSeq :: forall id_axkp. Prism' (HsExpr id_axkp) (PostTcExpr, ArithSeqInfo id_axkp) _ArithSeq :: forall id_axkp. Prism' (HsExpr id_axkp) (PostTcExpr, Maybe (SyntaxExpr id_axkp), ArithSeqInfo id_axkp) _ExprWithTySigOut :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsSigWcType Name) _ExprWithTySig :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsSigWcType id_axkp) _RecordUpd :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, [LHsRecUpdField id_axkp], PostTc id_axkp [ConLike], PostTc id_axkp [Type], PostTc id_axkp [Type], PostTc id_axkp HsWrapper) _RecordCon :: forall id_axkp. Prism' (HsExpr id_axkp) (Located id_axkp, PostTc id_axkp ConLike, PostTcExpr, HsRecordBinds id_axkp) _ExplicitPArr :: forall id_axkp. Prism' (HsExpr id_axkp) (PostTc id_axkp Type, [LHsExpr id_axkp]) _ExplicitList :: forall id_axkp. Prism' (HsExpr id_axkp) (PostTc id_axkp Type, Maybe (SyntaxExpr id_axkp), [LHsExpr id_axkp]) _HsDo :: forall id_axkp. Prism' (HsExpr id_axkp) (HsStmtContext Name, Located [ExprLStmt id_axkp], PostTc id_axkp Type) _HsLet :: forall id_axkp. Prism' (HsExpr id_axkp) (Located (HsLocalBinds id_axkp), LHsExpr id_axkp) _HsMultiIf :: forall id_axkp. Prism' (HsExpr id_axkp) (PostTc id_axkp Type, [LGRHS id_axkp (LHsExpr id_axkp)]) _HsIf :: forall id_axkp. Prism' (HsExpr id_axkp) (Maybe (SyntaxExpr id_axkp), LHsExpr id_axkp, LHsExpr id_axkp, LHsExpr id_axkp) _HsCase :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, MatchGroup id_axkp (LHsExpr id_axkp)) _ExplicitTuple :: forall id_axkp. Prism' (HsExpr id_axkp) ([LHsTupArg id_axkp], Boxity) _SectionR :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsExpr id_axkp) _SectionL :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsExpr id_axkp) _HsPar :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp) _NegApp :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, SyntaxExpr id_axkp) _OpApp :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsExpr id_axkp, PostRn id_axkp Fixity, LHsExpr id_axkp) _HsAppTypeOut :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsWcType Name) _HsAppType :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsWcType id_axkp) _HsApp :: forall id_axkp. Prism' (HsExpr id_axkp) (LHsExpr id_axkp, LHsExpr id_axkp) _HsLamCase :: forall id_axkp. Prism' (HsExpr id_axkp) (PostTc id_axkp Type, MatchGroup id_axkp (LHsExpr id_axkp)) _HsLam :: forall id_axkp. Prism' (HsExpr id_axkp) (MatchGroup id_axkp (LHsExpr id_axkp)) _HsLit :: forall id_axkp. Prism' (HsExpr id_axkp) HsLit _HsOverLit :: forall id_axkp. Prism' (HsExpr id_axkp) (HsOverLit id_axkp) _HsIPVar :: forall id_axkp. Prism' (HsExpr id_axkp) HsIPName _HsOverLabel :: forall id_axkp. Prism' (HsExpr id_axkp) FastString _HsRecFld :: forall id_axkp. Prism' (HsExpr id_axkp) (AmbiguousFieldOcc id_axkp) _HsUnboundVar :: forall id_axkp. Prism' (HsExpr id_axkp) UnboundVar _HsVar :: forall id_axkp. Prism' (HsExpr id_axkp) (Located id_axkp) _rupd_wrap :: forall id_axkp. Traversal' (HsExpr id_axkp) (PostTc id_axkp HsWrapper) _rupd_out_tys :: forall id_axkp. Traversal' (HsExpr id_axkp) (PostTc id_axkp [Type]) _rupd_in_tys :: forall id_axkp. Traversal' (HsExpr id_axkp) (PostTc id_axkp [Type]) _rupd_flds :: forall id_axkp. Traversal' (HsExpr id_axkp) [LHsRecUpdField id_axkp] _rupd_expr :: forall id_axkp. Traversal' (HsExpr id_axkp) (LHsExpr id_axkp) _rupd_cons :: forall id_axkp. Traversal' (HsExpr id_axkp) (PostTc id_axkp [ConLike]) _rcon_flds :: forall id_axkp. Traversal' (HsExpr id_axkp) (HsRecordBinds id_axkp) _rcon_con_name :: forall id_axkp. Traversal' (HsExpr id_axkp) (Located id_axkp) _rcon_con_like :: forall id_axkp. Traversal' (HsExpr id_axkp) (PostTc id_axkp ConLike) _rcon_con_expr :: forall id_axkp. Traversal' (HsExpr id_axkp) PostTcExpr _SyntaxExpr :: forall id_az4K id_aAFP. Iso (SyntaxExpr id_aAFP) (SyntaxExpr id_az4K) (HsExpr id_aAFP, [HsWrapper], HsWrapper) (HsExpr id_az4K, [HsWrapper], HsWrapper) _syn_res_wrap :: forall id_az4K. Lens' (SyntaxExpr id_az4K) HsWrapper _syn_expr :: forall id_az4K id_aAFz. Lens (SyntaxExpr id_az4K) (SyntaxExpr id_aAFz) (HsExpr id_az4K) (HsExpr id_aAFz) _syn_arg_wraps :: forall id_az4K. Lens' (SyntaxExpr id_az4K) [HsWrapper] _MG :: forall id_aypv body_aypw id_aAIu body_aAIv. Iso (MatchGroup id_aAIu body_aAIv) (MatchGroup id_aypv body_aypw) (Located [LMatch id_aAIu body_aAIv], [PostTc id_aAIu Type], PostTc id_aAIu Type, Origin) (Located [LMatch id_aypv body_aypw], [PostTc id_aypv Type], PostTc id_aypv Type, Origin) _mg_res_ty :: forall id_aypv body_aypw. Lens' (MatchGroup id_aypv body_aypw) (PostTc id_aypv Type) _mg_origin :: forall id_aypv body_aypw. Lens' (MatchGroup id_aypv body_aypw) Origin _mg_arg_tys :: forall id_aypv body_aypw. Lens' (MatchGroup id_aypv body_aypw) [PostTc id_aypv Type] _mg_alts :: forall id_aypv body_aypw body_aAI5. Lens (MatchGroup id_aypv body_aypw) (MatchGroup id_aypv body_aAI5) (Located [LMatch id_aypv body_aypw]) (Located [LMatch id_aypv body_aAI5]) _RecStmt :: forall idL_azCm idR_azCn body_azCo. Prism' (StmtLR idL_azCm idR_azCn body_azCo) ([LStmtLR idL_azCm idR_azCn body_azCo], [idR_azCn], [idR_azCn], SyntaxExpr idR_azCn, SyntaxExpr idR_azCn, SyntaxExpr idR_azCn, PostTc idR_azCn Type, [PostTcExpr], [PostTcExpr], PostTc idR_azCn Type) _TransStmt :: forall idL_azCm idR_azCn body_azCo. Prism' (StmtLR idL_azCm idR_azCn body_azCo) (TransForm, [ExprLStmt idL_azCm], [(idR_azCn, idR_azCn)], LHsExpr idR_azCn, Maybe (LHsExpr idR_azCn), SyntaxExpr idR_azCn, SyntaxExpr idR_azCn, PostTc idR_azCn Type, HsExpr idR_azCn) _ParStmt :: forall idL_azCm idR_azCn body_azCo. Prism' (StmtLR idL_azCm idR_azCn body_azCo) ([ParStmtBlock idL_azCm idR_azCn], HsExpr idR_azCn, SyntaxExpr idR_azCn, PostTc idR_azCn Type) _LetStmt :: forall idL_azCm idR_azCn body_azCo. Prism' (StmtLR idL_azCm idR_azCn body_azCo) (Located (HsLocalBindsLR idL_azCm idR_azCn)) _BodyStmt :: forall idL_azCm idR_azCn body_azCo. Prism' (StmtLR idL_azCm idR_azCn body_azCo) (body_azCo, SyntaxExpr idR_azCn, SyntaxExpr idR_azCn, PostTc idR_azCn Type) _ApplicativeStmt :: forall idL_azCm idR_azCn body_azCo. Prism' (StmtLR idL_azCm idR_azCn body_azCo) ([(SyntaxExpr idR_azCn, ApplicativeArg idL_azCm idR_azCn)], Maybe (SyntaxExpr idR_azCn), PostTc idR_azCn Type) _BindStmt :: forall idL_azCm idR_azCn body_azCo. Prism' (StmtLR idL_azCm idR_azCn body_azCo) (LPat idL_azCm, body_azCo, SyntaxExpr idR_azCn, SyntaxExpr idR_azCn, PostTc idR_azCn Type) _LastStmt :: forall idL_azCm idR_azCn body_azCo. Prism' (StmtLR idL_azCm idR_azCn body_azCo) (body_azCo, Bool, SyntaxExpr idR_azCn) _trS_using :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (LHsExpr idR_azCn) _trS_stmts :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) [ExprLStmt idL_azCm] _trS_ret :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (SyntaxExpr idR_azCn) _trS_form :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) TransForm _trS_fmap :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (HsExpr idR_azCn) _trS_by :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (Maybe (LHsExpr idR_azCn)) _trS_bndrs :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) [(idR_azCn, idR_azCn)] _trS_bind_arg_ty :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (PostTc idR_azCn Type) _trS_bind :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (SyntaxExpr idR_azCn) _recS_stmts :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) [LStmtLR idL_azCm idR_azCn body_azCo] _recS_ret_ty :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (PostTc idR_azCn Type) _recS_ret_fn :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (SyntaxExpr idR_azCn) _recS_rec_rets :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) [PostTcExpr] _recS_rec_ids :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) [idR_azCn] _recS_mfix_fn :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (SyntaxExpr idR_azCn) _recS_later_rets :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) [PostTcExpr] _recS_later_ids :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) [idR_azCn] _recS_bind_ty :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (PostTc idR_azCn Type) _recS_bind_fn :: forall idL_azCm idR_azCn body_azCo. Traversal' (StmtLR idL_azCm idR_azCn body_azCo) (SyntaxExpr idR_azCn) _HsDoublePrim :: Prism' HsLit FractionalLit _HsFloatPrim :: Prism' HsLit FractionalLit _HsRat :: Prism' HsLit (FractionalLit, Type) _HsInteger :: Prism' HsLit (SourceText, Integer, Type) _HsWord64Prim :: Prism' HsLit (SourceText, Integer) _HsInt64Prim :: Prism' HsLit (SourceText, Integer) _HsWordPrim :: Prism' HsLit (SourceText, Integer) _HsIntPrim :: Prism' HsLit (SourceText, Integer) _HsInt :: Prism' HsLit (SourceText, Integer) _HsStringPrim :: Prism' HsLit (SourceText, ByteString) _HsString :: Prism' HsLit (SourceText, FastString) _HsCharPrim :: Prism' HsLit (SourceText, Char) _HsChar :: Prism' HsLit (SourceText, Char) _HsWildCardTy :: forall name_awEF. Prism' (HsType name_awEF) (HsWildCardInfo name_awEF) _HsTyLit :: forall name_awEF. Prism' (HsType name_awEF) HsTyLit _HsExplicitTupleTy :: forall name_awEF. Prism' (HsType name_awEF) ([PostTc name_awEF Kind], [LHsType name_awEF]) _HsExplicitListTy :: forall name_awEF. Prism' (HsType name_awEF) (PostTc name_awEF Kind, [LHsType name_awEF]) _HsCoreTy :: forall name_awEF. Prism' (HsType name_awEF) Type _HsRecTy :: forall name_awEF. Prism' (HsType name_awEF) [LConDeclField name_awEF] _HsBangTy :: forall name_awEF. Prism' (HsType name_awEF) (HsSrcBang, LHsType name_awEF) _HsDocTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF, LHsDocString) _HsSpliceTy :: forall name_awEF. Prism' (HsType name_awEF) (HsSplice name_awEF, PostTc name_awEF Kind) _HsKindSig :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF, LHsKind name_awEF) _HsEqTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF, LHsType name_awEF) _HsIParamTy :: forall name_awEF. Prism' (HsType name_awEF) (HsIPName, LHsType name_awEF) _HsParTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF) _HsOpTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF, Located name_awEF, LHsType name_awEF) _HsTupleTy :: forall name_awEF. Prism' (HsType name_awEF) (HsTupleSort, [LHsType name_awEF]) _HsPArrTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF) _HsListTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF) _HsFunTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF, LHsType name_awEF) _HsAppTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsType name_awEF, LHsType name_awEF) _HsAppsTy :: forall name_awEF. Prism' (HsType name_awEF) [LHsAppType name_awEF] _HsTyVar :: forall name_awEF. Prism' (HsType name_awEF) (Located name_awEF) _HsQualTy :: forall name_awEF. Prism' (HsType name_awEF) (LHsContext name_awEF, LHsType name_awEF) _HsForAllTy :: forall name_awEF. Prism' (HsType name_awEF) ([LHsTyVarBndr name_awEF], LHsType name_awEF) _hst_ctxt :: forall name_awEF. Traversal' (HsType name_awEF) (LHsContext name_awEF) _hst_body :: forall name_awEF. Traversal' (HsType name_awEF) (LHsType name_awEF) _hst_bndrs :: forall name_awEF. Traversal' (HsType name_awEF) [LHsTyVarBndr name_awEF] module Language.Haskell.HGrep.Internal.Data newtype ParsedSource ParsedSource :: (Anns, Located (HsModule RdrName)) -> ParsedSource [unParsedSource] :: ParsedSource -> (Anns, Located (HsModule RdrName)) newtype ParseError ParseError :: (SrcSpan, [Char]) -> ParseError [unParseError] :: ParseError -> (SrcSpan, [Char]) data Query MatchSimple :: [Char] -> Query MatchRegex :: Regex -> Query newtype Regex Regex :: Regex -> Regex [unRegex] :: Regex -> Regex compileRegex :: [Char] -> Either [Char] Regex data SearchResult SearchResult :: Anns -> (Located ast) -> SearchResult data PrintOpts PrintOpts :: ColourOpts -> PrintOpts [poColourOpts] :: PrintOpts -> ColourOpts defaultPrintOpts :: PrintOpts data ColourOpts DefaultColours :: ColourOpts NoColours :: ColourOpts instance GHC.Show.Show Language.Haskell.HGrep.Internal.Data.PrintOpts instance GHC.Classes.Ord Language.Haskell.HGrep.Internal.Data.PrintOpts instance GHC.Classes.Eq Language.Haskell.HGrep.Internal.Data.PrintOpts instance GHC.Show.Show Language.Haskell.HGrep.Internal.Data.ColourOpts instance GHC.Classes.Ord Language.Haskell.HGrep.Internal.Data.ColourOpts instance GHC.Classes.Eq Language.Haskell.HGrep.Internal.Data.ColourOpts instance GHC.Show.Show Language.Haskell.HGrep.Internal.Data.Query instance GHC.Classes.Ord Language.Haskell.HGrep.Internal.Data.Query instance GHC.Classes.Eq Language.Haskell.HGrep.Internal.Data.Query instance GHC.Show.Show Language.Haskell.HGrep.Internal.Data.Regex instance GHC.Classes.Ord Language.Haskell.HGrep.Internal.Data.Regex instance GHC.Classes.Eq Language.Haskell.HGrep.Internal.Data.Regex module Language.Haskell.HGrep.Print printParseError :: ParseError -> [Char] printSearchResult :: PrintOpts -> SearchResult -> [Char] printSearchResultLocation :: PrintOpts -> SearchResult -> [Char] module Language.Haskell.HGrep.Query findTypeDecl :: Query -> ParsedSource -> [SearchResult] findValueDecl :: Query -> ParsedSource -> [SearchResult] module Language.Haskell.HGrep data ParsedSource parseModule :: FilePath -> IO (Either ParseError ParsedSource) data ParseError printParseError :: ParseError -> [Char] data Query MatchSimple :: [Char] -> Query MatchRegex :: Regex -> Query data Regex compileRegex :: [Char] -> Either [Char] Regex data SearchResult queryModule :: Query -> ParsedSource -> [SearchResult] data PrintOpts PrintOpts :: ColourOpts -> PrintOpts [poColourOpts] :: PrintOpts -> ColourOpts defaultPrintOpts :: PrintOpts data ColourOpts DefaultColours :: ColourOpts NoColours :: ColourOpts printResults :: PrintOpts -> [SearchResult] -> IO () printSearchResult :: PrintOpts -> SearchResult -> [Char] printSearchResultLocation :: PrintOpts -> SearchResult -> [Char]