-- 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.0 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 -- | The class of monad transformers. Instances should satisfy the -- following laws, which state that lift is a monad -- transformation: -- -- class MonadTrans (t :: (* -> *) -> * -> *) -- | Lift a computation from the argument monad to the constructed monad. lift :: (MonadTrans t, Monad m) => m a -> t m a -- | Class of monad transformers which are bifunctors. -- -- You can implement a BifunctorTrans by either defining -- bimapT or by defining both firstT and secondT. -- -- If you supply bimapT, you should ensure that: -- --
-- bimapT id id ≡ id ---- -- If you supply first and second, ensure: -- --
-- firstT id ≡ id -- secondT id ≡ id ---- -- If you supply both, you should also ensure: -- --
-- bimapT f g ≡ firstT f . secondT g ---- -- These ensure by parametricity: -- --
-- bimapT (f . g) (h . i) ≡ bimapT f h . bimapT g i -- firstT (f . g) ≡ firstT f . firstT g -- secondT (f . g) ≡ secondT f . secondT g --class BifunctorTrans (t :: * -> (* -> *) -> * -> *) -- | Map over both arguments at the same time. -- --
-- bimap f g ≡ first f . second g --bimapT :: (BifunctorTrans t, Functor f) => (x -> y) -> (a -> b) -> t x f a -> t y f b -- | Map covariantly over the first argument. -- --
-- firstT f ≡ bimapT f id --firstT :: (BifunctorTrans t, Functor f) => (x -> y) -> t x f a -> t y f a -- | Map covariantly over the second argument. -- --
-- second ≡ bimap id --secondT :: (BifunctorTrans t, Functor f) => (a -> b) -> t x f a -> t x f b -- | 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 type EitherT = ExceptT runEitherT :: EitherT e m a -> m (Either e a) left :: Monad m => x -> EitherT x m a right :: Monad m => a -> EitherT x m a -- | 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 -- | The parameterizable maybe monad, obtained by composing an arbitrary -- monad with the Maybe monad. -- -- Computations are actions that may produce a value or exit. -- -- The return function yields a computation that produces that -- value, while >>= sequences two subcomputations, exiting -- if either computation does. newtype MaybeT (m :: * -> *) a :: (* -> *) -> * -> * MaybeT :: m (Maybe a) -> MaybeT a [runMaybeT] :: MaybeT a -> m (Maybe a) nothing :: Monad m => MaybeT m a -- | 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_auFs e_auFt l_auFx e_auFy. Iso (GenLocated l_auFx e_auFy) (GenLocated l_auFs e_auFt) (l_auFx, e_auFy) (l_auFs, e_auFt) _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 _HsModule :: forall name_av7d name_avQe. Iso (HsModule name_avQe) (HsModule name_av7d) (Maybe (Located ModuleName), Maybe (Located [LIE name_avQe]), [LImportDecl name_avQe], [LHsDecl name_avQe], Maybe (Located WarningTxt), Maybe LHsDocString) (Maybe (Located ModuleName), Maybe (Located [LIE name_av7d]), [LImportDecl name_av7d], [LHsDecl name_av7d], Maybe (Located WarningTxt), Maybe LHsDocString) _hsmodName :: forall name_av7d. Lens' (HsModule name_av7d) (Maybe (Located ModuleName)) _hsmodImports :: forall name_av7d. Lens' (HsModule name_av7d) [LImportDecl name_av7d] _hsmodHaddockModHeader :: forall name_av7d. Lens' (HsModule name_av7d) (Maybe LHsDocString) _hsmodExports :: forall name_av7d. Lens' (HsModule name_av7d) (Maybe (Located [LIE name_av7d])) _hsmodDeprecMessage :: forall name_av7d. Lens' (HsModule name_av7d) (Maybe (Located WarningTxt)) _hsmodDecls :: forall name_av7d. Lens' (HsModule name_av7d) [LHsDecl name_av7d] _RoleAnnotD :: forall id_avR4. Prism' (HsDecl id_avR4) (RoleAnnotDecl id_avR4) _DocD :: forall id_avR4. Prism' (HsDecl id_avR4) DocDecl _SpliceD :: forall id_avR4. Prism' (HsDecl id_avR4) (SpliceDecl id_avR4) _VectD :: forall id_avR4. Prism' (HsDecl id_avR4) (VectDecl id_avR4) _RuleD :: forall id_avR4. Prism' (HsDecl id_avR4) (RuleDecls id_avR4) _AnnD :: forall id_avR4. Prism' (HsDecl id_avR4) (AnnDecl id_avR4) _WarningD :: forall id_avR4. Prism' (HsDecl id_avR4) (WarnDecls id_avR4) _ForD :: forall id_avR4. Prism' (HsDecl id_avR4) (ForeignDecl id_avR4) _DefD :: forall id_avR4. Prism' (HsDecl id_avR4) (DefaultDecl id_avR4) _SigD :: forall id_avR4. Prism' (HsDecl id_avR4) (Sig id_avR4) _ValD :: forall id_avR4. Prism' (HsDecl id_avR4) (HsBind id_avR4) _DerivD :: forall id_avR4. Prism' (HsDecl id_avR4) (DerivDecl id_avR4) _InstD :: forall id_avR4. Prism' (HsDecl id_avR4) (InstDecl id_avR4) _TyClD :: forall id_avR4. Prism' (HsDecl id_avR4) (TyClDecl id_avR4) _ClassDecl :: forall name_avUN. Prism' (TyClDecl name_avUN) (LHsContext name_avUN, Located name_avUN, LHsQTyVars name_avUN, [Located (FunDep (Located name_avUN))], [LSig name_avUN], LHsBinds name_avUN, [LFamilyDecl name_avUN], [LTyFamDefltEqn name_avUN], [LDocDecl], PostRn name_avUN NameSet) _DataDecl :: forall name_avUN. Prism' (TyClDecl name_avUN) (Located name_avUN, LHsQTyVars name_avUN, HsDataDefn name_avUN, PostRn name_avUN Bool, PostRn name_avUN NameSet) _SynDecl :: forall name_avUN. Prism' (TyClDecl name_avUN) (Located name_avUN, LHsQTyVars name_avUN, LHsType name_avUN, PostRn name_avUN NameSet) _FamDecl :: forall name_avUN. Prism' (TyClDecl name_avUN) (FamilyDecl name_avUN) _tcdTyVars :: forall name_avUN. Traversal' (TyClDecl name_avUN) (LHsQTyVars name_avUN) _tcdSigs :: forall name_avUN. Traversal' (TyClDecl name_avUN) [LSig name_avUN] _tcdRhs :: forall name_avUN. Traversal' (TyClDecl name_avUN) (LHsType name_avUN) _tcdMeths :: forall name_avUN. Traversal' (TyClDecl name_avUN) (LHsBinds name_avUN) _tcdLName :: forall name_avUN. Traversal' (TyClDecl name_avUN) (Located name_avUN) _tcdFam :: forall name_avUN. Traversal' (TyClDecl name_avUN) (FamilyDecl name_avUN) _tcdFVs :: forall name_avUN. Traversal' (TyClDecl name_avUN) (PostRn name_avUN NameSet) _tcdFDs :: forall name_avUN. Traversal' (TyClDecl name_avUN) [Located (FunDep (Located name_avUN))] _tcdDocs :: forall name_avUN. Traversal' (TyClDecl name_avUN) [LDocDecl] _tcdDataDefn :: forall name_avUN. Traversal' (TyClDecl name_avUN) (HsDataDefn name_avUN) _tcdDataCusk :: forall name_avUN. Traversal' (TyClDecl name_avUN) (PostRn name_avUN Bool) _tcdCtxt :: forall name_avUN. Traversal' (TyClDecl name_avUN) (LHsContext name_avUN) _tcdATs :: forall name_avUN. Traversal' (TyClDecl name_avUN) [LFamilyDecl name_avUN] _tcdATDefs :: forall name_avUN. Traversal' (TyClDecl name_avUN) [LTyFamDefltEqn name_avUN] _TyFamInstD :: forall name_avV0. Prism' (InstDecl name_avV0) (TyFamInstDecl name_avV0) _DataFamInstD :: forall name_avV0. Prism' (InstDecl name_avV0) (DataFamInstDecl name_avV0) _ClsInstD :: forall name_avV0. Prism' (InstDecl name_avV0) (ClsInstDecl name_avV0) _tfid_inst :: forall name_avV0. Traversal' (InstDecl name_avV0) (TyFamInstDecl name_avV0) _dfid_inst :: forall name_avV0. Traversal' (InstDecl name_avV0) (DataFamInstDecl name_avV0) _cid_inst :: forall name_avV0. Traversal' (InstDecl name_avV0) (ClsInstDecl name_avV0) _DerivDecl :: forall name_avVa name_ax6D. Iso (DerivDecl name_ax6D) (DerivDecl name_avVa) (LHsSigType name_ax6D, Maybe (Located OverlapMode)) (LHsSigType name_avVa, Maybe (Located OverlapMode)) _deriv_type :: forall name_avVa name_ax6u. Lens (DerivDecl name_avVa) (DerivDecl name_ax6u) (LHsSigType name_avVa) (LHsSigType name_ax6u) _deriv_overlap_mode :: forall name_avVa. Lens' (DerivDecl name_avVa) (Maybe (Located OverlapMode)) _MinimalSig :: forall name_avVg. Prism' (Sig name_avVg) (SourceText, LBooleanFormula (Located name_avVg)) _SpecInstSig :: forall name_avVg. Prism' (Sig name_avVg) (SourceText, LHsSigType name_avVg) _SpecSig :: forall name_avVg. Prism' (Sig name_avVg) (Located name_avVg, [LHsSigType name_avVg], InlinePragma) _InlineSig :: forall name_avVg. Prism' (Sig name_avVg) (Located name_avVg, InlinePragma) _FixSig :: forall name_avVg. Prism' (Sig name_avVg) (FixitySig name_avVg) _IdSig :: forall name_avVg. Prism' (Sig name_avVg) Id _ClassOpSig :: forall name_avVg. Prism' (Sig name_avVg) (Bool, [Located name_avVg], LHsSigType name_avVg) _PatSynSig :: forall name_avVg. Prism' (Sig name_avVg) (Located name_avVg, LHsSigType name_avVg) _TypeSig :: forall name_avVg. Prism' (Sig name_avVg) ([Located name_avVg], LHsSigWcType name_avVg) _DefaultDecl :: forall name_avVI name_axke. Iso (DefaultDecl name_axke) (DefaultDecl name_avVI) [LHsType name_axke] [LHsType name_avVI] _ForeignExport :: forall name_avVM. Prism' (ForeignDecl name_avVM) (Located name_avVM, LHsSigType name_avVM, PostTc name_avVM Coercion, ForeignExport) _ForeignImport :: forall name_avVM. Prism' (ForeignDecl name_avVM) (Located name_avVM, LHsSigType name_avVM, PostTc name_avVM Coercion, ForeignImport) _fd_sig_ty :: forall name_avVM. Lens' (ForeignDecl name_avVM) (LHsSigType name_avVM) _fd_name :: forall name_avVM. Lens' (ForeignDecl name_avVM) (Located name_avVM) _fd_fi :: forall name_avVM. Traversal' (ForeignDecl name_avVM) ForeignImport _fd_fe :: forall name_avVM. Traversal' (ForeignDecl name_avVM) ForeignExport _fd_co :: forall name_avVM. Lens' (ForeignDecl name_avVM) (PostTc name_avVM Coercion) _Warnings :: forall name_avVT name_axrE. Iso (WarnDecls name_axrE) (WarnDecls name_avVT) (SourceText, [LWarnDecl name_axrE]) (SourceText, [LWarnDecl name_avVT]) _wd_warnings :: forall name_avVT name_axrv. Lens (WarnDecls name_avVT) (WarnDecls name_axrv) [LWarnDecl name_avVT] [LWarnDecl name_axrv] _wd_src :: forall name_avVT. Lens' (WarnDecls name_avVT) SourceText _HsAnnotation :: forall name_avVX name_axvW. Iso (AnnDecl name_axvW) (AnnDecl name_avVX) (SourceText, AnnProvenance name_axvW, Located (HsExpr name_axvW)) (SourceText, AnnProvenance name_avVX, Located (HsExpr name_avVX)) _HsRules :: forall name_avW1 name_axx3. Iso (RuleDecls name_axx3) (RuleDecls name_avW1) (SourceText, [LRuleDecl name_axx3]) (SourceText, [LRuleDecl name_avW1]) _rds_src :: forall name_avW1. Lens' (RuleDecls name_avW1) SourceText _rds_rules :: forall name_avW1 name_axwU. Lens (RuleDecls name_avW1) (RuleDecls name_axwU) [LRuleDecl name_avW1] [LRuleDecl name_axwU] _HsVectInstOut :: forall name_avW5. Prism' (VectDecl name_avW5) ClsInst _HsVectInstIn :: forall name_avW5. Prism' (VectDecl name_avW5) (LHsSigType name_avW5) _HsVectClassOut :: forall name_avW5. Prism' (VectDecl name_avW5) Class _HsVectClassIn :: forall name_avW5. Prism' (VectDecl name_avW5) (SourceText, Located name_avW5) _HsVectTypeOut :: forall name_avW5. Prism' (VectDecl name_avW5) (Bool, TyCon, Maybe TyCon) _HsVectTypeIn :: forall name_avW5. Prism' (VectDecl name_avW5) (SourceText, Bool, Located name_avW5, Maybe (Located name_avW5)) _HsNoVect :: forall name_avW5. Prism' (VectDecl name_avW5) (SourceText, Located name_avW5) _HsVect :: forall name_avW5. Prism' (VectDecl name_avW5) (SourceText, Located name_avW5, LHsExpr name_avW5) _SpliceDecl :: forall id_avWu id_axXk. Iso (SpliceDecl id_axXk) (SpliceDecl id_avWu) (Located (HsSplice id_axXk), SpliceExplicitFlag) (Located (HsSplice id_avWu), SpliceExplicitFlag) _DocGroup :: Prism' DocDecl (Int, HsDocString) _DocCommentNamed :: Prism' DocDecl (String, HsDocString) _DocCommentPrev :: Prism' DocDecl HsDocString _DocCommentNext :: Prism' DocDecl HsDocString _RoleAnnotDecl :: forall name_avWK name_ayaw. Iso (RoleAnnotDecl name_ayaw) (RoleAnnotDecl name_avWK) (Located name_ayaw, [Located (Maybe Role)]) (Located name_avWK, [Located (Maybe Role)]) _PatSynBind :: forall idL_aw18 idR_aw19. Prism' (HsBindLR idL_aw18 idR_aw19) (PatSynBind idL_aw18 idR_aw19) _AbsBindsSig :: forall idL_aw18 idR_aw19. Prism' (HsBindLR idL_aw18 idR_aw19) ([TyVar], [EvVar], idL_aw18, TcSpecPrags, TcEvBinds, LHsBind idL_aw18) _AbsBinds :: forall idL_aw18 idR_aw19. Prism' (HsBindLR idL_aw18 idR_aw19) ([TyVar], [EvVar], [ABExport idL_aw18], [TcEvBinds], LHsBinds idL_aw18) _VarBind :: forall idL_aw18 idR_aw19. Prism' (HsBindLR idL_aw18 idR_aw19) (idL_aw18, LHsExpr idR_aw19, Bool) _PatBind :: forall idL_aw18 idR_aw19. Prism' (HsBindLR idL_aw18 idR_aw19) (LPat idL_aw18, GRHSs idR_aw19 (LHsExpr idR_aw19), PostTc idR_aw19 Type, PostRn idL_aw18 NameSet, ([Tickish Id], [[Tickish Id]])) _FunBind :: forall idL_aw18 idR_aw19. Prism' (HsBindLR idL_aw18 idR_aw19) (Located idL_aw18, MatchGroup idR_aw19 (LHsExpr idR_aw19), HsWrapper, PostRn idL_aw18 NameSet, [Tickish Id]) _var_rhs :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (LHsExpr idR_aw19) _var_inline :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) Bool _var_id :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) idL_aw18 _pat_ticks :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) ([Tickish Id], [[Tickish Id]]) _pat_rhs_ty :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (PostTc idR_aw19 Type) _pat_rhs :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (GRHSs idR_aw19 (LHsExpr idR_aw19)) _pat_lhs :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (LPat idL_aw18) _fun_tick :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) [Tickish Id] _fun_matches :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (MatchGroup idR_aw19 (LHsExpr idR_aw19)) _fun_id :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (Located idL_aw18) _fun_co_fn :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) HsWrapper _bind_fvs :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (PostRn idL_aw18 NameSet) _abs_tvs :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) [TyVar] _abs_sig_prags :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) TcSpecPrags _abs_sig_export :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) idL_aw18 _abs_sig_ev_bind :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) TcEvBinds _abs_sig_bind :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (LHsBind idL_aw18) _abs_exports :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) [ABExport idL_aw18] _abs_ev_vars :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) [EvVar] _abs_ev_binds :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) [TcEvBinds] _abs_binds :: forall idL_aw18 idR_aw19. Traversal' (HsBindLR idL_aw18 idR_aw19) (LHsBinds idL_aw18) _HsWrap :: forall id_axty. Prism' (HsExpr id_axty) (HsWrapper, HsExpr id_axty) _ELazyPat :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty) _EViewPat :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsExpr id_axty) _EAsPat :: forall id_axty. Prism' (HsExpr id_axty) (Located id_axty, LHsExpr id_axty) _EWildPat :: forall id_axty. Prism' (HsExpr id_axty) () _HsTickPragma :: forall id_axty. Prism' (HsExpr id_axty) (SourceText, (StringLiteral, (Int, Int), (Int, Int)), ((SourceText, SourceText), (SourceText, SourceText)), LHsExpr id_axty) _HsBinTick :: forall id_axty. Prism' (HsExpr id_axty) (Int, Int, LHsExpr id_axty) _HsTick :: forall id_axty. Prism' (HsExpr id_axty) (Tickish id_axty, LHsExpr id_axty) _HsArrForm :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, Maybe Fixity, [LHsCmdTop id_axty]) _HsArrApp :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsExpr id_axty, PostTc id_axty Type, HsArrAppType, Bool) _HsStatic :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty) _HsProc :: forall id_axty. Prism' (HsExpr id_axty) (LPat id_axty, LHsCmdTop id_axty) _HsSpliceE :: forall id_axty. Prism' (HsExpr id_axty) (HsSplice id_axty) _HsTcBracketOut :: forall id_axty. Prism' (HsExpr id_axty) (HsBracket Name, [PendingTcSplice]) _HsRnBracketOut :: forall id_axty. Prism' (HsExpr id_axty) (HsBracket Name, [PendingRnSplice]) _HsBracket :: forall id_axty. Prism' (HsExpr id_axty) (HsBracket id_axty) _HsCoreAnn :: forall id_axty. Prism' (HsExpr id_axty) (SourceText, StringLiteral, LHsExpr id_axty) _HsSCC :: forall id_axty. Prism' (HsExpr id_axty) (SourceText, StringLiteral, LHsExpr id_axty) _PArrSeq :: forall id_axty. Prism' (HsExpr id_axty) (PostTcExpr, ArithSeqInfo id_axty) _ArithSeq :: forall id_axty. Prism' (HsExpr id_axty) (PostTcExpr, Maybe (SyntaxExpr id_axty), ArithSeqInfo id_axty) _ExprWithTySigOut :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsSigWcType Name) _ExprWithTySig :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsSigWcType id_axty) _RecordUpd :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, [LHsRecUpdField id_axty], PostTc id_axty [ConLike], PostTc id_axty [Type], PostTc id_axty [Type], PostTc id_axty HsWrapper) _RecordCon :: forall id_axty. Prism' (HsExpr id_axty) (Located id_axty, PostTc id_axty ConLike, PostTcExpr, HsRecordBinds id_axty) _ExplicitPArr :: forall id_axty. Prism' (HsExpr id_axty) (PostTc id_axty Type, [LHsExpr id_axty]) _ExplicitList :: forall id_axty. Prism' (HsExpr id_axty) (PostTc id_axty Type, Maybe (SyntaxExpr id_axty), [LHsExpr id_axty]) _HsDo :: forall id_axty. Prism' (HsExpr id_axty) (HsStmtContext Name, Located [ExprLStmt id_axty], PostTc id_axty Type) _HsLet :: forall id_axty. Prism' (HsExpr id_axty) (Located (HsLocalBinds id_axty), LHsExpr id_axty) _HsMultiIf :: forall id_axty. Prism' (HsExpr id_axty) (PostTc id_axty Type, [LGRHS id_axty (LHsExpr id_axty)]) _HsIf :: forall id_axty. Prism' (HsExpr id_axty) (Maybe (SyntaxExpr id_axty), LHsExpr id_axty, LHsExpr id_axty, LHsExpr id_axty) _HsCase :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, MatchGroup id_axty (LHsExpr id_axty)) _ExplicitTuple :: forall id_axty. Prism' (HsExpr id_axty) ([LHsTupArg id_axty], Boxity) _SectionR :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsExpr id_axty) _SectionL :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsExpr id_axty) _HsPar :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty) _NegApp :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, SyntaxExpr id_axty) _OpApp :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsExpr id_axty, PostRn id_axty Fixity, LHsExpr id_axty) _HsAppTypeOut :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsWcType Name) _HsAppType :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsWcType id_axty) _HsApp :: forall id_axty. Prism' (HsExpr id_axty) (LHsExpr id_axty, LHsExpr id_axty) _HsLamCase :: forall id_axty. Prism' (HsExpr id_axty) (PostTc id_axty Type, MatchGroup id_axty (LHsExpr id_axty)) _HsLam :: forall id_axty. Prism' (HsExpr id_axty) (MatchGroup id_axty (LHsExpr id_axty)) _HsLit :: forall id_axty. Prism' (HsExpr id_axty) HsLit _HsOverLit :: forall id_axty. Prism' (HsExpr id_axty) (HsOverLit id_axty) _HsIPVar :: forall id_axty. Prism' (HsExpr id_axty) HsIPName _HsOverLabel :: forall id_axty. Prism' (HsExpr id_axty) FastString _HsRecFld :: forall id_axty. Prism' (HsExpr id_axty) (AmbiguousFieldOcc id_axty) _HsUnboundVar :: forall id_axty. Prism' (HsExpr id_axty) UnboundVar _HsVar :: forall id_axty. Prism' (HsExpr id_axty) (Located id_axty) _rupd_wrap :: forall id_axty. Traversal' (HsExpr id_axty) (PostTc id_axty HsWrapper) _rupd_out_tys :: forall id_axty. Traversal' (HsExpr id_axty) (PostTc id_axty [Type]) _rupd_in_tys :: forall id_axty. Traversal' (HsExpr id_axty) (PostTc id_axty [Type]) _rupd_flds :: forall id_axty. Traversal' (HsExpr id_axty) [LHsRecUpdField id_axty] _rupd_expr :: forall id_axty. Traversal' (HsExpr id_axty) (LHsExpr id_axty) _rupd_cons :: forall id_axty. Traversal' (HsExpr id_axty) (PostTc id_axty [ConLike]) _rcon_flds :: forall id_axty. Traversal' (HsExpr id_axty) (HsRecordBinds id_axty) _rcon_con_name :: forall id_axty. Traversal' (HsExpr id_axty) (Located id_axty) _rcon_con_like :: forall id_axty. Traversal' (HsExpr id_axty) (PostTc id_axty ConLike) _rcon_con_expr :: forall id_axty. Traversal' (HsExpr id_axty) PostTcExpr _SyntaxExpr :: forall id_azdT id_aAOY. Iso (SyntaxExpr id_aAOY) (SyntaxExpr id_azdT) (HsExpr id_aAOY, [HsWrapper], HsWrapper) (HsExpr id_azdT, [HsWrapper], HsWrapper) _syn_res_wrap :: forall id_azdT. Lens' (SyntaxExpr id_azdT) HsWrapper _syn_expr :: forall id_azdT id_aAOI. Lens (SyntaxExpr id_azdT) (SyntaxExpr id_aAOI) (HsExpr id_azdT) (HsExpr id_aAOI) _syn_arg_wraps :: forall id_azdT. Lens' (SyntaxExpr id_azdT) [HsWrapper] _MG :: forall id_ayyE body_ayyF id_aARD body_aARE. Iso (MatchGroup id_aARD body_aARE) (MatchGroup id_ayyE body_ayyF) (Located [LMatch id_aARD body_aARE], [PostTc id_aARD Type], PostTc id_aARD Type, Origin) (Located [LMatch id_ayyE body_ayyF], [PostTc id_ayyE Type], PostTc id_ayyE Type, Origin) _mg_res_ty :: forall id_ayyE body_ayyF. Lens' (MatchGroup id_ayyE body_ayyF) (PostTc id_ayyE Type) _mg_origin :: forall id_ayyE body_ayyF. Lens' (MatchGroup id_ayyE body_ayyF) Origin _mg_arg_tys :: forall id_ayyE body_ayyF. Lens' (MatchGroup id_ayyE body_ayyF) [PostTc id_ayyE Type] _mg_alts :: forall id_ayyE body_ayyF body_aARe. Lens (MatchGroup id_ayyE body_ayyF) (MatchGroup id_ayyE body_aARe) (Located [LMatch id_ayyE body_ayyF]) (Located [LMatch id_ayyE body_aARe]) _RecStmt :: forall idL_azLv idR_azLw body_azLx. Prism' (StmtLR idL_azLv idR_azLw body_azLx) ([LStmtLR idL_azLv idR_azLw body_azLx], [idR_azLw], [idR_azLw], SyntaxExpr idR_azLw, SyntaxExpr idR_azLw, SyntaxExpr idR_azLw, PostTc idR_azLw Type, [PostTcExpr], [PostTcExpr], PostTc idR_azLw Type) _TransStmt :: forall idL_azLv idR_azLw body_azLx. Prism' (StmtLR idL_azLv idR_azLw body_azLx) (TransForm, [ExprLStmt idL_azLv], [(idR_azLw, idR_azLw)], LHsExpr idR_azLw, Maybe (LHsExpr idR_azLw), SyntaxExpr idR_azLw, SyntaxExpr idR_azLw, PostTc idR_azLw Type, HsExpr idR_azLw) _ParStmt :: forall idL_azLv idR_azLw body_azLx. Prism' (StmtLR idL_azLv idR_azLw body_azLx) ([ParStmtBlock idL_azLv idR_azLw], HsExpr idR_azLw, SyntaxExpr idR_azLw, PostTc idR_azLw Type) _LetStmt :: forall idL_azLv idR_azLw body_azLx. Prism' (StmtLR idL_azLv idR_azLw body_azLx) (Located (HsLocalBindsLR idL_azLv idR_azLw)) _BodyStmt :: forall idL_azLv idR_azLw body_azLx. Prism' (StmtLR idL_azLv idR_azLw body_azLx) (body_azLx, SyntaxExpr idR_azLw, SyntaxExpr idR_azLw, PostTc idR_azLw Type) _ApplicativeStmt :: forall idL_azLv idR_azLw body_azLx. Prism' (StmtLR idL_azLv idR_azLw body_azLx) ([(SyntaxExpr idR_azLw, ApplicativeArg idL_azLv idR_azLw)], Maybe (SyntaxExpr idR_azLw), PostTc idR_azLw Type) _BindStmt :: forall idL_azLv idR_azLw body_azLx. Prism' (StmtLR idL_azLv idR_azLw body_azLx) (LPat idL_azLv, body_azLx, SyntaxExpr idR_azLw, SyntaxExpr idR_azLw, PostTc idR_azLw Type) _LastStmt :: forall idL_azLv idR_azLw body_azLx. Prism' (StmtLR idL_azLv idR_azLw body_azLx) (body_azLx, Bool, SyntaxExpr idR_azLw) _trS_using :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (LHsExpr idR_azLw) _trS_stmts :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) [ExprLStmt idL_azLv] _trS_ret :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (SyntaxExpr idR_azLw) _trS_form :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) TransForm _trS_fmap :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (HsExpr idR_azLw) _trS_by :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (Maybe (LHsExpr idR_azLw)) _trS_bndrs :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) [(idR_azLw, idR_azLw)] _trS_bind_arg_ty :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (PostTc idR_azLw Type) _trS_bind :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (SyntaxExpr idR_azLw) _recS_stmts :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) [LStmtLR idL_azLv idR_azLw body_azLx] _recS_ret_ty :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (PostTc idR_azLw Type) _recS_ret_fn :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (SyntaxExpr idR_azLw) _recS_rec_rets :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) [PostTcExpr] _recS_rec_ids :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) [idR_azLw] _recS_mfix_fn :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (SyntaxExpr idR_azLw) _recS_later_rets :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) [PostTcExpr] _recS_later_ids :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) [idR_azLw] _recS_bind_ty :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (PostTc idR_azLw Type) _recS_bind_fn :: forall idL_azLv idR_azLw body_azLx. Traversal' (StmtLR idL_azLv idR_azLw body_azLx) (SyntaxExpr idR_azLw) _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_awNO. Prism' (HsType name_awNO) (HsWildCardInfo name_awNO) _HsTyLit :: forall name_awNO. Prism' (HsType name_awNO) HsTyLit _HsExplicitTupleTy :: forall name_awNO. Prism' (HsType name_awNO) ([PostTc name_awNO Kind], [LHsType name_awNO]) _HsExplicitListTy :: forall name_awNO. Prism' (HsType name_awNO) (PostTc name_awNO Kind, [LHsType name_awNO]) _HsCoreTy :: forall name_awNO. Prism' (HsType name_awNO) Type _HsRecTy :: forall name_awNO. Prism' (HsType name_awNO) [LConDeclField name_awNO] _HsBangTy :: forall name_awNO. Prism' (HsType name_awNO) (HsSrcBang, LHsType name_awNO) _HsDocTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO, LHsDocString) _HsSpliceTy :: forall name_awNO. Prism' (HsType name_awNO) (HsSplice name_awNO, PostTc name_awNO Kind) _HsKindSig :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO, LHsKind name_awNO) _HsEqTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO, LHsType name_awNO) _HsIParamTy :: forall name_awNO. Prism' (HsType name_awNO) (HsIPName, LHsType name_awNO) _HsParTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO) _HsOpTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO, Located name_awNO, LHsType name_awNO) _HsTupleTy :: forall name_awNO. Prism' (HsType name_awNO) (HsTupleSort, [LHsType name_awNO]) _HsPArrTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO) _HsListTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO) _HsFunTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO, LHsType name_awNO) _HsAppTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsType name_awNO, LHsType name_awNO) _HsAppsTy :: forall name_awNO. Prism' (HsType name_awNO) [LHsAppType name_awNO] _HsTyVar :: forall name_awNO. Prism' (HsType name_awNO) (Located name_awNO) _HsQualTy :: forall name_awNO. Prism' (HsType name_awNO) (LHsContext name_awNO, LHsType name_awNO) _HsForAllTy :: forall name_awNO. Prism' (HsType name_awNO) ([LHsTyVarBndr name_awNO], LHsType name_awNO) _hst_ctxt :: forall name_awNO. Traversal' (HsType name_awNO) (LHsContext name_awNO) _hst_body :: forall name_awNO. Traversal' (HsType name_awNO) (LHsType name_awNO) _hst_bndrs :: forall name_awNO. Traversal' (HsType name_awNO) [LHsTyVarBndr name_awNO] 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]) type Query = [Char] 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 module Language.Haskell.HGrep.Print printSearchResult :: PrintOpts -> SearchResult -> [Char] printSearchResultLocation :: PrintOpts -> SearchResult -> [Char] module Language.Haskell.HGrep.Query findTypeDecl :: [Char] -> ParsedSource -> [SearchResult] findValueDecl :: [Char] -> ParsedSource -> [SearchResult] module Language.Haskell.HGrep data ParsedSource parseModule :: FilePath -> IO (Either ParseError ParsedSource) type Query = [Char] 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]