haskell-tools-refactor-1.1.1.0: Refactoring Tool for Haskell

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.Tools.Refactor

Description

Defines the API for refactorings

Synopsis

Documentation

trace :: String -> a -> a #

The trace function outputs the trace message given as its first argument, before returning the second argument as its result.

For example, this returns the value of f x but first outputs the message.

>>> let x = 123; f = show
>>> trace ("calling f with x = " ++ show x) (f x)
"calling f with x = 123
123"

The trace function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message.

data Maybe 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.

Constructors

Nothing 
Just a 
Instances
Monad Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #

(>>) :: Maybe a -> Maybe b -> Maybe b #

return :: a -> Maybe a #

fail :: String -> Maybe a #

Functor Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> Maybe a -> Maybe b #

(<$) :: a -> Maybe b -> Maybe a #

MonadFix Maybe

Since: base-2.1

Instance details

Defined in Control.Monad.Fix

Methods

mfix :: (a -> Maybe a) -> Maybe a #

Applicative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> Maybe a #

(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b #

liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #

(*>) :: Maybe a -> Maybe b -> Maybe b #

(<*) :: Maybe a -> Maybe b -> Maybe a #

Foldable Maybe

Since: base-2.1

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Maybe m -> m #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m #

foldr :: (a -> b -> b) -> b -> Maybe a -> b #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b #

foldl :: (b -> a -> b) -> b -> Maybe a -> b #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b #

foldr1 :: (a -> a -> a) -> Maybe a -> a #

foldl1 :: (a -> a -> a) -> Maybe a -> a #

toList :: Maybe a -> [a] #

null :: Maybe a -> Bool #

length :: Maybe a -> Int #

elem :: Eq a => a -> Maybe a -> Bool #

maximum :: Ord a => Maybe a -> a #

minimum :: Ord a => Maybe a -> a #

sum :: Num a => Maybe a -> a #

product :: Num a => Maybe a -> a #

Traversable Maybe

Since: base-2.1

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) #

sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) #

mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) #

sequence :: Monad m => Maybe (m a) -> m (Maybe a) #

MonadPlus Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mzero :: Maybe a #

mplus :: Maybe a -> Maybe a -> Maybe a #

Alternative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

empty :: Maybe a #

(<|>) :: Maybe a -> Maybe a -> Maybe a #

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

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

Eq1 Maybe

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool #

Ord1 Maybe

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering #

Read1 Maybe

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Maybe a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Maybe a] #

Show1 Maybe

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS #

Hashable1 Maybe 
Instance details

Defined in Data.Hashable.Class

Methods

liftHashWithSalt :: (Int -> a -> Int) -> Int -> Maybe a -> Int

FromJSON1 Maybe 
Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (Maybe a)

liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [Maybe a]

ToJSON1 Maybe 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> Maybe a -> Value

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [Maybe a] -> Value

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> Maybe a -> Encoding

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [Maybe a] -> Encoding

(Selector s, GToJSON enc arity (K1 i (Maybe a) :: Type -> Type), KeyValuePair enc pairs, Monoid pairs) => RecordToPairs enc pairs arity (S1 s (K1 i (Maybe a) :: Type -> Type)) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

recordToPairs :: Options -> ToArgs enc arity a0 -> S1 s (K1 i (Maybe a)) a0 -> pairs

(Selector s, FromJSON a) => FromRecord arity (S1 s (K1 i (Maybe a) :: Type -> Type)) 
Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

parseRecord :: Options -> FromArgs arity a0 -> Object -> Parser (S1 s (K1 i (Maybe a)) a0)

Eq a => Eq (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Maybe

Methods

(==) :: Maybe a -> Maybe a -> Bool #

(/=) :: Maybe a -> Maybe a -> Bool #

Data a => Data (Maybe a)

Since: base-4.0.0.0

Instance details

Defined in Data.Data

Methods

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

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

toConstr :: Maybe a -> Constr #

dataTypeOf :: Maybe a -> DataType #

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

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

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

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

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

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

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

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

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

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

Ord a => Ord (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Maybe

Methods

compare :: Maybe a -> Maybe a -> Ordering #

(<) :: Maybe a -> Maybe a -> Bool #

(<=) :: Maybe a -> Maybe a -> Bool #

(>) :: Maybe a -> Maybe a -> Bool #

(>=) :: Maybe a -> Maybe a -> Bool #

max :: Maybe a -> Maybe a -> Maybe a #

min :: Maybe a -> Maybe a -> Maybe a #

Read a => Read (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Read

Show a => Show (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Maybe a -> ShowS #

show :: Maybe a -> String #

showList :: [Maybe a] -> ShowS #

Generic (Maybe a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Maybe a) :: Type -> Type #

Methods

from :: Maybe a -> Rep (Maybe a) x #

to :: Rep (Maybe a) x -> Maybe a #

Semigroup a => Semigroup (Maybe a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: Maybe a -> Maybe a -> Maybe a #

sconcat :: NonEmpty (Maybe a) -> Maybe a #

stimes :: Integral b => b -> Maybe a -> Maybe a #

Semigroup a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."

Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: Maybe a #

mappend :: Maybe a -> Maybe a -> Maybe a #

mconcat :: [Maybe a] -> Maybe a #

Lift a => Lift (Maybe a) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Maybe a -> Q Exp #

SingKind a => SingKind (Maybe a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type DemoteRep (Maybe a) :: Type

Methods

fromSing :: Sing a0 -> DemoteRep (Maybe a)

Outputable a => Outputable (Maybe a) 
Instance details

Defined in Outputable

Methods

ppr :: Maybe a -> SDoc #

pprPrec :: Rational -> Maybe a -> SDoc #

Hashable a => Hashable (Maybe a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Maybe a -> Int

hash :: Maybe a -> Int

FromJSON a => FromJSON (Maybe a) 
Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

parseJSON :: Value -> Parser (Maybe a)

parseJSONList :: Value -> Parser [Maybe a]

ToJSON a => ToJSON (Maybe a) 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

toJSON :: Maybe a -> Value

toEncoding :: Maybe a -> Encoding

toJSONList :: [Maybe a] -> Value

toEncodingList :: [Maybe a] -> Encoding

Generic1 Maybe 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Maybe :: k -> Type #

Methods

from1 :: Maybe a -> Rep1 Maybe a #

to1 :: Rep1 Maybe a -> Maybe a #

SingI (Nothing :: Maybe a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing Nothing

SingI a2 => SingI (Just a2 :: Maybe a1)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing (Just a2)

Eq a => Association (a -> Maybe b) 
Instance details

Defined in Control.Reference.Predefined.Containers

Associated Types

type AssocIndex (a -> Maybe b) :: Type

type AssocElem (a -> Maybe b) :: Type

Methods

element :: AssocIndex (a -> Maybe b) -> Simple Partial (a -> Maybe b) (AssocElem (a -> Maybe b))

Eq a => Mapping (a -> Maybe b) 
Instance details

Defined in Control.Reference.Predefined.Containers

Methods

at :: AssocIndex (a -> Maybe b) -> Simple Lens (a -> Maybe b) (Maybe (AssocElem (a -> Maybe b)))

type Rep (Maybe a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep (Maybe a) = D1 (MetaData "Maybe" "GHC.Maybe" "base" False) (C1 (MetaCons "Nothing" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Just" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
data Sing (b :: Maybe a) 
Instance details

Defined in GHC.Generics

data Sing (b :: Maybe a) where
type DemoteRep (Maybe a) 
Instance details

Defined in GHC.Generics

type DemoteRep (Maybe a) = Maybe (DemoteRep a)
type IgnoredFields (Maybe a) 
Instance details

Defined in Language.Haskell.Tools.AST.Instances.ClassyPlate

type IgnoredFields (Maybe a) = ([] :: [Either (Symbol, Nat) Symbol])
type Rep1 Maybe

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type AssocElem (a -> Maybe b) 
Instance details

Defined in Control.Reference.Predefined.Containers

type AssocElem (a -> Maybe b) = b
type AssocIndex (a -> Maybe b) 
Instance details

Defined in Control.Reference.Predefined.Containers

type AssocIndex (a -> Maybe b) = a

maybe :: b -> (a -> b) -> Maybe a -> b #

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.

Examples

Expand

Basic usage:

>>> 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
""

isJust :: Maybe a -> Bool #

The isJust function returns True iff its argument is of the form Just _.

Examples

Expand

Basic usage:

>>> isJust (Just 3)
True
>>> isJust (Just ())
True
>>> isJust Nothing
False

Only the outer constructor is taken into consideration:

>>> isJust (Just Nothing)
True

isNothing :: Maybe a -> Bool #

The isNothing function returns True iff its argument is Nothing.

Examples

Expand

Basic usage:

>>> isNothing (Just 3)
False
>>> isNothing (Just ())
False
>>> isNothing Nothing
True

Only the outer constructor is taken into consideration:

>>> isNothing (Just Nothing)
False

fromMaybe :: a -> Maybe a -> 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.

Examples

Expand

Basic usage:

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

maybeToList :: Maybe a -> [a] #

The maybeToList function returns an empty list when given Nothing or a singleton list when not given Nothing.

Examples

Expand

Basic usage:

>>> maybeToList (Just 7)
[7]
>>> maybeToList Nothing
[]

One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:

>>> import Text.Read ( readMaybe )
>>> sum $ maybeToList (readMaybe "3")
3
>>> sum $ maybeToList (readMaybe "")
0

listToMaybe :: [a] -> Maybe a #

The listToMaybe function returns Nothing on an empty list or Just a where a is the first element of the list.

Examples

Expand

Basic usage:

>>> listToMaybe []
Nothing
>>> listToMaybe [9]
Just 9
>>> listToMaybe [1,2,3]
Just 1

Composing maybeToList with listToMaybe should be the identity on singleton/empty lists:

>>> maybeToList $ listToMaybe [5]
[5]
>>> maybeToList $ listToMaybe []
[]

But not on lists with more than one element:

>>> maybeToList $ listToMaybe [1,2,3]
[1]

catMaybes :: [Maybe a] -> [a] #

The catMaybes function takes a list of Maybes and returns a list of all the Just values.

Examples

Expand

Basic usage:

>>> catMaybes [Just 1, Nothing, Just 3]
[1,3]

When constructing a list of Maybe values, catMaybes can be used to return all of the "success" results (if the list is the result of a map, then mapMaybe would be more appropriate):

>>> import Text.Read ( readMaybe )
>>> [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ]
[Just 1,Nothing,Just 3]
>>> catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ]
[1,3]

mapMaybe :: (a -> Maybe b) -> [a] -> [b] #

The mapMaybe function is a version of map which can throw out elements. In particular, the functional argument returns something of type Maybe b. If this is Nothing, no element is added on to the result list. If it is Just b, then b is included in the result list.

Examples

Expand

Using mapMaybe f x is a shortcut for catMaybes $ map f x in most cases:

>>> import Text.Read ( readMaybe )
>>> let readMaybeInt = readMaybe :: String -> Maybe Int
>>> mapMaybe readMaybeInt ["1", "Foo", "3"]
[1,3]
>>> catMaybes $ map readMaybeInt ["1", "Foo", "3"]
[1,3]

If we map the Just constructor, the entire list should be returned:

>>> mapMaybe Just [1,2,3]
[1,2,3]

traceMarkerIO :: String -> IO () #

The traceMarkerIO function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime.

Compared to traceMarker, traceMarkerIO sequences the event with respect to other IO actions.

Since: base-4.7.0.0

traceMarker :: String -> a -> a #

The traceMarker function emits a marker to the eventlog, if eventlog profiling is available and enabled at runtime. The String is the name of the marker. The name is just used in the profiling tools to help you keep clear which marker is which.

This function is suitable for use in pure code. In an IO context use traceMarkerIO instead.

Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses traceMarker.

Since: base-4.7.0.0

traceEventIO :: String -> IO () #

The traceEventIO function emits a message to the eventlog, if eventlog profiling is available and enabled at runtime.

Compared to traceEvent, traceEventIO sequences the event with respect to other IO actions.

Since: base-4.5.0.0

traceEvent :: String -> a -> a #

The traceEvent function behaves like trace with the difference that the message is emitted to the eventlog, if eventlog profiling is available and enabled at runtime.

It is suitable for use in pure code. In an IO context use traceEventIO instead.

Note that when using GHC's SMP runtime, it is possible (but rare) to get duplicate events emitted if two CPUs simultaneously evaluate the same thunk that uses traceEvent.

Since: base-4.5.0.0

traceStack :: String -> a -> a #

like trace, but additionally prints a call stack if one is available.

In the current GHC implementation, the call stack is only available if the program was compiled with -prof; otherwise traceStack behaves exactly like trace. Entries in the call stack correspond to SCC annotations, so it is a good idea to use -fprof-auto or -fprof-auto-calls to add SCC annotations automatically.

Since: base-4.5.0.0

traceShowM :: (Show a, Applicative f) => a -> f () #

Like traceM, but uses show on the argument to convert it to a String.

>>> :{
do
    x <- Just 3
    traceShowM x
    y <- pure 12
    traceShowM y
    pure (x*2 + y)
:}
3
12
Just 18

Since: base-4.7.0.0

traceM :: Applicative f => String -> f () #

Like trace but returning unit in an arbitrary Applicative context. Allows for convenient use in do-notation.

Note that the application of traceM is not an action in the Applicative context, as traceIO is in the IO type. While the fresh bindings in the following example will force the traceM expressions to be reduced every time the do-block is executed, traceM "not crashed" would only be reduced once, and the message would only be printed once. If your monad is in MonadIO, liftIO . traceIO may be a better option.

>>> :{
do
    x <- Just 3
    traceM ("x: " ++ show x)
    y <- pure 12
    traceM ("y: " ++ show y)
    pure (x*2 + y)
:}
x: 3
y: 12
Just 18

Since: base-4.7.0.0

traceShowId :: Show a => a -> a #

Like traceShow but returns the shown value instead of a third value.

>>> traceShowId (1+2+3, "hello" ++ "world")
(6,"helloworld")
(6,"helloworld")

Since: base-4.7.0.0

traceShow :: Show a => a -> b -> b #

Like trace, but uses show on the argument to convert it to a String.

This makes it convenient for printing the values of interesting variables or expressions inside a function. For example here we print the value of the variables x and y:

>>> let f x y = traceShow (x,y) (x + y) in f (1+2) 5
(3,5)
8

traceId :: String -> String #

Like trace but returns the message instead of a third value.

>>> traceId "hello"
"hello
hello"

Since: base-4.7.0.0

putTraceMsg :: String -> IO () #

 

traceIO :: String -> IO () #

The traceIO function outputs the trace message from the IO monad. This sequences the output with respect to other IO actions.

Since: base-4.5.0.0

fromJust :: Maybe a -> a #

The fromJust function extracts the element out of a Just and throws an error if its argument is Nothing.

Examples

Expand

Basic usage:

>>> fromJust (Just 1)
1
>>> 2 * (fromJust (Just 10))
20
>>> 2 * (fromJust Nothing)
*** Exception: Maybe.fromJust: Nothing

newtype MaybeT (m :: Type -> Type) a #

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.

Constructors

MaybeT 

Fields

Instances
MonadTrans MaybeT 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

lift :: Monad m => m a -> MaybeT m a #

MonadWriter w m => MonadWriter w (MaybeT m) 
Instance details

Defined in Control.Monad.Writer.Class

Methods

writer :: (a, w) -> MaybeT m a #

tell :: w -> MaybeT m () #

listen :: MaybeT m a -> MaybeT m (a, w) #

pass :: MaybeT m (a, w -> w) -> MaybeT m a #

MonadState s m => MonadState s (MaybeT m) 
Instance details

Defined in Control.Monad.State.Class

Methods

get :: MaybeT m s #

put :: s -> MaybeT m () #

state :: (s -> (a, s)) -> MaybeT m a #

MonadReader r m => MonadReader r (MaybeT m) 
Instance details

Defined in Control.Monad.Reader.Class

Methods

ask :: MaybeT m r #

local :: (r -> r) -> MaybeT m a -> MaybeT m a #

reader :: (r -> a) -> MaybeT m a #

Monad m => MorphControl m (MaybeT m) 
Instance details

Defined in Control.Reference.Types

Associated Types

data MSt m (MaybeT m) a :: Type

Methods

sink :: MaybeT m a -> m (MSt m (MaybeT m) a)

pullBack :: m (MSt m (MaybeT m) a) -> MaybeT m a

Monad m => Monad (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

(>>=) :: MaybeT m a -> (a -> MaybeT m b) -> MaybeT m b #

(>>) :: MaybeT m a -> MaybeT m b -> MaybeT m b #

return :: a -> MaybeT m a #

fail :: String -> MaybeT m a #

Functor m => Functor (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

fmap :: (a -> b) -> MaybeT m a -> MaybeT m b #

(<$) :: a -> MaybeT m b -> MaybeT m a #

MonadFix m => MonadFix (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

mfix :: (a -> MaybeT m a) -> MaybeT m a #

Monad m => MonadFail (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

fail :: String -> MaybeT m a #

(Functor m, Monad m) => Applicative (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

pure :: a -> MaybeT m a #

(<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b #

liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c #

(*>) :: MaybeT m a -> MaybeT m b -> MaybeT m b #

(<*) :: MaybeT m a -> MaybeT m b -> MaybeT m a #

Foldable f => Foldable (MaybeT f) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

fold :: Monoid m => MaybeT f m -> m #

foldMap :: Monoid m => (a -> m) -> MaybeT f a -> m #

foldr :: (a -> b -> b) -> b -> MaybeT f a -> b #

foldr' :: (a -> b -> b) -> b -> MaybeT f a -> b #

foldl :: (b -> a -> b) -> b -> MaybeT f a -> b #

foldl' :: (b -> a -> b) -> b -> MaybeT f a -> b #

foldr1 :: (a -> a -> a) -> MaybeT f a -> a #

foldl1 :: (a -> a -> a) -> MaybeT f a -> a #

toList :: MaybeT f a -> [a] #

null :: MaybeT f a -> Bool #

length :: MaybeT f a -> Int #

elem :: Eq a => a -> MaybeT f a -> Bool #

maximum :: Ord a => MaybeT f a -> a #

minimum :: Ord a => MaybeT f a -> a #

sum :: Num a => MaybeT f a -> a #

product :: Num a => MaybeT f a -> a #

Traversable f => Traversable (MaybeT f) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

traverse :: Applicative f0 => (a -> f0 b) -> MaybeT f a -> f0 (MaybeT f b) #

sequenceA :: Applicative f0 => MaybeT f (f0 a) -> f0 (MaybeT f a) #

mapM :: Monad m => (a -> m b) -> MaybeT f a -> m (MaybeT f b) #

sequence :: Monad m => MaybeT f (m a) -> m (MaybeT f a) #

Monad m => MonadPlus (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

mzero :: MaybeT m a #

mplus :: MaybeT m a -> MaybeT m a -> MaybeT m a #

(Functor m, Monad m) => Alternative (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

empty :: MaybeT m a #

(<|>) :: MaybeT m a -> MaybeT m a -> MaybeT m a #

some :: MaybeT m a -> MaybeT m [a] #

many :: MaybeT m a -> MaybeT m [a] #

Contravariant m => Contravariant (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

contramap :: (a -> b) -> MaybeT m b -> MaybeT m a #

(>$) :: b -> MaybeT m b -> MaybeT m a #

Eq1 m => Eq1 (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

liftEq :: (a -> b -> Bool) -> MaybeT m a -> MaybeT m b -> Bool #

Ord1 m => Ord1 (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

liftCompare :: (a -> b -> Ordering) -> MaybeT m a -> MaybeT m b -> Ordering #

Read1 m => Read1 (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (MaybeT m a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [MaybeT m a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (MaybeT m a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [MaybeT m a] #

Show1 m => Show1 (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> MaybeT m a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [MaybeT m a] -> ShowS #

MonadZip m => MonadZip (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

mzip :: MaybeT m a -> MaybeT m b -> MaybeT m (a, b) #

mzipWith :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c #

munzip :: MaybeT m (a, b) -> (MaybeT m a, MaybeT m b) #

MonadIO m => MonadIO (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

liftIO :: IO a -> MaybeT m a #

(Monad m, HasDynFlags m) => HasDynFlags (MaybeT m) 
Instance details

Defined in DynFlags

ExceptionMonad m => ExceptionMonad (MaybeT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Methods

gcatch :: Exception e => MaybeT m a -> (e -> MaybeT m a) -> MaybeT m a #

gmask :: ((MaybeT m a -> MaybeT m a) -> MaybeT m b) -> MaybeT m b #

gbracket :: MaybeT m a -> (a -> MaybeT m b) -> (a -> MaybeT m c) -> MaybeT m c #

gfinally :: MaybeT m a -> MaybeT m b -> MaybeT m a #

PrimMonad m => PrimMonad (MaybeT m) 
Instance details

Defined in Control.Monad.Primitive

Associated Types

type PrimState (MaybeT m) :: Type

Methods

primitive :: (State# (PrimState (MaybeT m)) -> (#State# (PrimState (MaybeT m)), a#)) -> MaybeT m a

(Eq1 m, Eq a) => Eq (MaybeT m a) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

(==) :: MaybeT m a -> MaybeT m a -> Bool #

(/=) :: MaybeT m a -> MaybeT m a -> Bool #

(Ord1 m, Ord a) => Ord (MaybeT m a) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

compare :: MaybeT m a -> MaybeT m a -> Ordering #

(<) :: MaybeT m a -> MaybeT m a -> Bool #

(<=) :: MaybeT m a -> MaybeT m a -> Bool #

(>) :: MaybeT m a -> MaybeT m a -> Bool #

(>=) :: MaybeT m a -> MaybeT m a -> Bool #

max :: MaybeT m a -> MaybeT m a -> MaybeT m a #

min :: MaybeT m a -> MaybeT m a -> MaybeT m a #

(Read1 m, Read a) => Read (MaybeT m a) 
Instance details

Defined in Control.Monad.Trans.Maybe

(Show1 m, Show a) => Show (MaybeT m a) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

showsPrec :: Int -> MaybeT m a -> ShowS #

show :: MaybeT m a -> String #

showList :: [MaybeT m a] -> ShowS #

newtype MSt m (MaybeT m) a 
Instance details

Defined in Control.Reference.Types

newtype MSt m (MaybeT m) a = MaybeMSt {}
type PrimState (MaybeT m) 
Instance details

Defined in Control.Monad.Primitive

type PrimState (MaybeT m) = PrimState m

compareRangeLength :: SrcSpan -> SrcSpan -> Ordering #

Compares two source spans based on their lengths. Can only used for NESTED spans.

getNodeContaining :: (Biplate (Ann node dom stage) (Ann inner dom stage), SourceInfo stage, HasRange (Ann inner dom stage)) => RealSrcSpan -> Ann node dom stage -> Maybe (Ann inner dom stage) #

Get the shortest source range that contains the given

nodesWithRange :: (Biplate (Ann node dom stage) (Ann inner dom stage), SourceInfo stage) => RealSrcSpan -> Simple Traversal (Ann node dom stage) (Ann inner dom stage) #

Get the nodes that have exactly the given range

isContained :: HasRange (inner dom stage) => RealSrcSpan -> inner dom stage -> Bool #

Return true if the node contains a given range

nodesContained :: (HasRange (inner dom stage), Biplate (node dom stage) (inner dom stage)) => RealSrcSpan -> Simple Traversal (node dom stage) (inner dom stage) #

Get all nodes that are contained in a given source range

isInside :: HasRange (inner dom stage) => RealSrcSpan -> inner dom stage -> Bool #

Return true if the node contains a given range

nodesContaining :: (HasRange (inner dom stage), Biplate (node dom stage) (inner dom stage)) => RealSrcSpan -> Simple Traversal (node dom stage) (inner dom stage) #

Get all nodes that contain a given source range

semantics :: Simple Lens (Ann elem dom stage) (SemanticInfo dom elem) #

Access the semantic information of an AST node.

valBindPats :: Simple Traversal (Ann UValueBind dom stage) (Ann UPattern dom stage) #

typeParams :: Simple Traversal (Ann UType dom stage) (Ann UType dom stage) #

A reference to access type arguments to a type constructor call that may be universally qualified or parenthesized.

declHeadNames :: Simple Traversal (Ann UDeclHead dom stage) (Ann UQualifiedName dom stage) #

Accesses that name of a declaration through the declaration head.

bindingName :: Simple Traversal (Ann UValueBind dom stage) (Ann UQualifiedName dom stage) #

Accesses the name of a function or value binding

importIsHiding :: Ann UImportDecl dom stage -> Bool #

Does the import declaration import all elements that are not excluded explicitly?

importIsExact :: Ann UImportDecl dom stage -> Bool #

Does the import declaration import only the explicitly listed elements?

pattern AnnList :: forall (elem :: Type -> Type -> Type) dom stage. [Ann elem dom stage] -> AnnListG elem dom stage #

pattern AnnNothing :: forall (elem :: Type -> Type -> Type) dom stage. AnnMaybeG elem dom stage #

pattern AnnJust :: forall (elem :: Type -> Type -> Type) dom stage. Ann elem dom stage -> AnnMaybeG elem dom stage #

class NamedElement (elem :: Type -> Type -> Type) where #

A class to access the names of named elements. Have to locate where does the AST element store its name. The returned name will be the one that was marked isDefining.

Methods

elementName :: Simple Traversal (Ann elem dom st) (Ann UQualifiedName dom st) #

Instances
NamedElement UDecl 
Instance details

Defined in Language.Haskell.Tools.AST.Helpers

Methods

elementName :: Simple Traversal (Ann UDecl dom st) (Ann UQualifiedName dom st) #

NamedElement ULocalBind 
Instance details

Defined in Language.Haskell.Tools.AST.Helpers

Methods

elementName :: Simple Traversal (Ann ULocalBind dom st) (Ann UQualifiedName dom st) #

stringNodeStr :: Lens (Ann UStringNode dom stage) (Ann UStringNode dom stage) String String #

simpleNameStr :: Lens (Ann UNamePart dom stage) (Ann UNamePart dom stage) String String #

unqualifiedName :: Lens (Ann UQualifiedName dom stage) (Ann UQualifiedName dom stage) (Ann UNamePart dom stage) (Ann UNamePart dom stage) #

qualifiers :: Lens (Ann UQualifiedName dom stage) (Ann UQualifiedName dom stage) (AnnListG UNamePart dom stage) (AnnListG UNamePart dom stage) #

simpleName :: Lens (Ann UName dom stage) (Ann UName dom stage) (Ann UQualifiedName dom stage) (Ann UQualifiedName dom stage) #

operatorName :: Lens (Ann UOperator dom stage) (Ann UOperator dom stage) (Ann UQualifiedName dom stage) (Ann UQualifiedName dom stage) #

promotedStringValue :: Partial (Ann (UPromoted t) dom stage) (Ann (UPromoted t) dom stage) String String #

promotedIntValue :: Partial (Ann (UPromoted t) dom stage) (Ann (UPromoted t) dom stage) Integer Integer #

promotedElements :: Partial (Ann (UPromoted t) dom stage) (Ann (UPromoted t) dom stage) (AnnListG t dom stage) (AnnListG t dom stage) #

promotedConName :: Partial (Ann (UPromoted t) dom stage) (Ann (UPromoted t) dom stage) (Ann UName dom stage) (Ann UName dom stage) #

stringLitValue :: Partial (Ann ULiteral dom stage) (Ann ULiteral dom stage) String String #

intLitValue :: Partial (Ann ULiteral dom stage) (Ann ULiteral dom stage) Integer Integer #

fracLitValue :: Partial (Ann ULiteral dom stage) (Ann ULiteral dom stage) Rational Rational #

floatLitValue :: Partial (Ann ULiteral dom stage) (Ann ULiteral dom stage) Rational Rational #

charLitValue :: Partial (Ann ULiteral dom stage) (Ann ULiteral dom stage) Char Char #

bracketType :: Partial (Ann UBracket dom stage) (Ann UBracket dom stage) (Ann UType dom stage) (Ann UType dom stage) #

bracketPattern :: Partial (Ann UBracket dom stage) (Ann UBracket dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

bracketExpr :: Partial (Ann UBracket dom stage) (Ann UBracket dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

bracketDecl :: Partial (Ann UBracket dom stage) (Ann UBracket dom stage) (AnnListG UDecl dom stage) (AnnListG UDecl dom stage) #

qqString :: Lens (Ann QQString dom stage) (Ann QQString dom stage) String String #

qqExprName :: Lens (Ann UQuasiQuote dom stage) (Ann UQuasiQuote dom stage) (Ann UName dom stage) (Ann UName dom stage) #

qqExprBody :: Lens (Ann UQuasiQuote dom stage) (Ann UQuasiQuote dom stage) (Ann QQString dom stage) (Ann QQString dom stage) #

spliceId :: Partial (Ann USplice dom stage) (Ann USplice dom stage) (Ann UName dom stage) (Ann UName dom stage) #

spliceExpr :: Partial (Ann USplice dom stage) (Ann USplice dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

fieldPatternWildcard :: Partial (Ann UPatternField dom stage) (Ann UPatternField dom stage) (Ann UFieldWildcard dom stage) (Ann UFieldWildcard dom stage) #

fieldPatternName :: Partial (Ann UPatternField dom stage) (Ann UPatternField dom stage) (Ann UName dom stage) (Ann UName dom stage) #

fieldPattern :: Partial (Ann UPatternField dom stage) (Ann UPatternField dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

patternType :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UType dom stage) (Ann UType dom stage) #

patternSplice :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann USplice dom stage) (Ann USplice dom stage) #

patternRhs :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

patternOperator :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

patternName :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UName dom stage) (Ann UName dom stage) #

patternLiteral :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann ULiteral dom stage) (Ann ULiteral dom stage) #

patternLit :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann ULiteral dom stage) (Ann ULiteral dom stage) #

patternLhs :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

patternInner :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

patternFields :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (AnnListG UPatternField dom stage) (AnnListG UPatternField dom stage) #

patternExpr :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

patternElems :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (AnnListG UPattern dom stage) (AnnListG UPattern dom stage) #

patternArgs :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (AnnListG UPattern dom stage) (AnnListG UPattern dom stage) #

patQQ :: Partial (Ann UPattern dom stage) (Ann UPattern dom stage) (Ann UQuasiQuote dom stage) (Ann UQuasiQuote dom stage) #

cmdThen :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) #

cmdStmts :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (AnnListG UCmdStmt dom stage) (AnnListG UCmdStmt dom stage) #

cmdRightCmd :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) #

cmdRhs :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

cmdOperator :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UName dom stage) (Ann UName dom stage) #

cmdLhs :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

cmdLeftCmd :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) #

cmdInnerCmds :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (AnnListG UCmd dom stage) (AnnListG UCmd dom stage) #

cmdInnerCmd :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) #

cmdInner :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) #

cmdExpr :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

cmdElse :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) #

cmdBinds :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (AnnListG ULocalBind dom stage) (AnnListG ULocalBind dom stage) #

cmdBindings :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (AnnListG UPattern dom stage) (AnnListG UPattern dom stage) #

cmdArrowOp :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UArrowAppl dom stage) (Ann UArrowAppl dom stage) #

cmdApplied :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

cmdAlts :: Partial (Ann UCmd dom stage) (Ann UCmd dom stage) (AnnListG UCmdAlt dom stage) (AnnListG UCmdAlt dom stage) #

compStmts :: Lens (Ann UListCompBody dom stage) (Ann UListCompBody dom stage) (AnnListG UCompStmt dom stage) (AnnListG UCompStmt dom stage) #

usingExpr :: Partial (Ann UCompStmt dom stage) (Ann UCompStmt dom stage) (AnnMaybeG UExpr dom stage) (AnnMaybeG UExpr dom stage) #

thenExpr :: Partial (Ann UCompStmt dom stage) (Ann UCompStmt dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

compStmt :: Partial (Ann UCompStmt dom stage) (Ann UCompStmt dom stage) (Ann UStmt dom stage) (Ann UStmt dom stage) #

byExpr :: Partial (Ann UCompStmt dom stage) (Ann UCompStmt dom stage) (AnnMaybeG UExpr dom stage) (AnnMaybeG UExpr dom stage) #

stmtPattern :: Partial (Ann (UStmt' expr) dom stage) (Ann (UStmt' expr) dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

stmtExpr :: Partial (Ann (UStmt' expr) dom stage) (Ann (UStmt' expr) dom stage) (Ann expr dom stage) (Ann expr dom stage) #

stmtBinds :: Partial (Ann (UStmt' expr) dom stage) (Ann (UStmt' expr) dom stage) (AnnListG ULocalBind dom stage) (AnnListG ULocalBind dom stage) #

cmdStmtBinds :: Partial (Ann (UStmt' expr) dom stage) (Ann (UStmt' expr) dom stage) (AnnListG (UStmt' expr) dom stage) (AnnListG (UStmt' expr) dom stage) #

caseGuardStmts :: Lens (Ann (UGuardedCaseRhs' expr) dom stage) (Ann (UGuardedCaseRhs' expr) dom stage) (AnnListG URhsGuard dom stage) (AnnListG URhsGuard dom stage) #

caseGuardExpr :: Lens (Ann (UGuardedCaseRhs' expr) dom stage) (Ann (UGuardedCaseRhs' expr) dom stage) (Ann expr dom stage) (Ann expr dom stage) #

rhsCaseGuards :: Partial (Ann (UCaseRhs' expr) dom stage) (Ann (UCaseRhs' expr) dom stage) (AnnListG (UGuardedCaseRhs' expr) dom stage) (AnnListG (UGuardedCaseRhs' expr) dom stage) #

rhsCaseExpr :: Partial (Ann (UCaseRhs' expr) dom stage) (Ann (UCaseRhs' expr) dom stage) (Ann expr dom stage) (Ann expr dom stage) #

pragmaStr :: Partial (Ann UExprPragma dom stage) (Ann UExprPragma dom stage) (Ann UStringNode dom stage) (Ann UStringNode dom stage) #

pragmaSrcRange :: Partial (Ann UExprPragma dom stage) (Ann UExprPragma dom stage) (Ann USourceRange dom stage) (Ann USourceRange dom stage) #

tupSecExpr :: Partial (Ann UTupSecElem dom stage) (Ann UTupSecElem dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

fieldWildcard :: Partial (Ann UFieldUpdate dom stage) (Ann UFieldUpdate dom stage) (Ann UFieldWildcard dom stage) (Ann UFieldWildcard dom stage) #

fieldValue :: Partial (Ann UFieldUpdate dom stage) (Ann UFieldUpdate dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

fieldUpdateName :: Partial (Ann UFieldUpdate dom stage) (Ann UFieldUpdate dom stage) (Ann UName dom stage) (Ann UName dom stage) #

fieldName :: Partial (Ann UFieldUpdate dom stage) (Ann UFieldUpdate dom stage) (Ann UName dom stage) (Ann UName dom stage) #

altRhs :: Lens (Ann (UAlt' expr) dom stage) (Ann (UAlt' expr) dom stage) (Ann (UCaseRhs' expr) dom stage) (Ann (UCaseRhs' expr) dom stage) #

altPattern :: Lens (Ann (UAlt' expr) dom stage) (Ann (UAlt' expr) dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

altBinds :: Lens (Ann (UAlt' expr) dom stage) (Ann (UAlt' expr) dom stage) (AnnMaybeG ULocalBinds dom stage) (AnnMaybeG ULocalBinds dom stage) #

tupleSectionElems :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UTupSecElem dom stage) (AnnListG UTupSecElem dom stage) #

tupleElems :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UExpr dom stage) (AnnListG UExpr dom stage) #

quotedName :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UName dom stage) (Ann UName dom stage) #

procPattern :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

procExpr :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UCmd dom stage) (Ann UCmd dom stage) #

listElems :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UExpr dom stage) (AnnListG UExpr dom stage) #

innerExpr :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprType :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UType dom stage) (Ann UType dom stage) #

exprThen :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprSumPlaceholdersBefore :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UUnboxedSumPlaceHolder dom stage) (AnnListG UUnboxedSumPlaceHolder dom stage) #

exprSumPlaceholdersAfter :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UUnboxedSumPlaceHolder dom stage) (AnnListG UUnboxedSumPlaceHolder dom stage) #

exprStmts :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UStmt dom stage) (AnnListG UStmt dom stage) #

exprSplice :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann USplice dom stage) (Ann USplice dom stage) #

exprSig :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UType dom stage) (Ann UType dom stage) #

exprRhs :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprRecName :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UName dom stage) (Ann UName dom stage) #

exprRecFields :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UFieldUpdate dom stage) (AnnListG UFieldUpdate dom stage) #

exprQQ :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UQuasiQuote dom stage) (Ann UQuasiQuote dom stage) #

exprPragma :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExprPragma dom stage) (Ann UExprPragma dom stage) #

exprOperator :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

exprName :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UName dom stage) (Ann UName dom stage) #

exprLit :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann ULiteral dom stage) (Ann ULiteral dom stage) #

exprLhs :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprInner :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprIfAlts :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UGuardedCaseRhs dom stage) (AnnListG UGuardedCaseRhs dom stage) #

exprFunBind :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG ULocalBind dom stage) (AnnListG ULocalBind dom stage) #

exprFun :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprElse :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprCond :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprCase :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprBracket :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UBracket dom stage) (Ann UBracket dom stage) #

exprBindings :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UPattern dom stage) (AnnListG UPattern dom stage) #

exprArg :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

exprAlts :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UAlt dom stage) (AnnListG UAlt dom stage) #

enumToFix :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

enumTo :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnMaybeG UExpr dom stage) (AnnMaybeG UExpr dom stage) #

enumThen :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnMaybeG UExpr dom stage) (AnnMaybeG UExpr dom stage) #

enumFrom :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

doKind :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UDoKind dom stage) (Ann UDoKind dom stage) #

compExpr :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

compBody :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (AnnListG UListCompBody dom stage) (AnnListG UListCompBody dom stage) #

arrowAppl :: Partial (Ann UExpr dom stage) (Ann UExpr dom stage) (Ann UArrowAppl dom stage) (Ann UArrowAppl dom stage) #

innerAsserts :: Partial (Ann UAssertion dom stage) (Ann UAssertion dom stage) (AnnListG UAssertion dom stage) (AnnListG UAssertion dom stage) #

assertTypes :: Partial (Ann UAssertion dom stage) (Ann UAssertion dom stage) (AnnListG UType dom stage) (AnnListG UType dom stage) #

assertRhs :: Partial (Ann UAssertion dom stage) (Ann UAssertion dom stage) (Ann UType dom stage) (Ann UType dom stage) #

assertOp :: Partial (Ann UAssertion dom stage) (Ann UAssertion dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

assertLhs :: Partial (Ann UAssertion dom stage) (Ann UAssertion dom stage) (Ann UType dom stage) (Ann UType dom stage) #

assertImplVar :: Partial (Ann UAssertion dom stage) (Ann UAssertion dom stage) (Ann UName dom stage) (Ann UName dom stage) #

assertImplType :: Partial (Ann UAssertion dom stage) (Ann UAssertion dom stage) (Ann UType dom stage) (Ann UType dom stage) #

assertClsName :: Partial (Ann UAssertion dom stage) (Ann UAssertion dom stage) (Ann UName dom stage) (Ann UName dom stage) #

contextAssertion :: Lens (Ann UContext dom stage) (Ann UContext dom stage) (Ann UAssertion dom stage) (Ann UAssertion dom stage) #

kindVar :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UName dom stage) (Ann UName dom stage) #

kindType :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UType dom stage) (Ann UType dom stage) #

kindRight :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

kindRhs :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

kindPromoted :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann (UPromoted UKind) dom stage) (Ann (UPromoted UKind) dom stage) #

kindParen :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

kindLhs :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

kindLeft :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

kindElems :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (AnnListG UKind dom stage) (AnnListG UKind dom stage) #

kindElem :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

kindAppOp :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

kindAppFun :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

kindAppArg :: Partial (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

typeWildcardName :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UName dom stage) (Ann UName dom stage) #

typeType :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

typeRight :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

typeResult :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

typeQQ :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UQuasiQuote dom stage) (Ann UQuasiQuote dom stage) #

typeParam :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

typeOperator :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

typeName :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UName dom stage) (Ann UName dom stage) #

typeLeft :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

typeKind :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

typeInner :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

typeElements :: Partial (Ann UType dom stage) (Ann UType dom stage) (AnnListG UType dom stage) (AnnListG UType dom stage) #

typeElement :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

typeCtx :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UContext dom stage) (Ann UContext dom stage) #

typeCon :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

typeBounded :: Partial (Ann UType dom stage) (Ann UType dom stage) (AnnListG UTyVar dom stage) (AnnListG UTyVar dom stage) #

typeArg :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

tsSplice :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann USplice dom stage) (Ann USplice dom stage) #

tpPromoted :: Partial (Ann UType dom stage) (Ann UType dom stage) (Ann (UPromoted UType) dom stage) (Ann (UPromoted UType) dom stage) #

tyVarName :: Lens (Ann UTyVar dom stage) (Ann UTyVar dom stage) (Ann UName dom stage) (Ann UName dom stage) #

tyVarKind :: Lens (Ann UTyVar dom stage) (Ann UTyVar dom stage) (AnnMaybeG UKindConstraint dom stage) (AnnMaybeG UKindConstraint dom stage) #

valBindRhs :: Partial (Ann UValueBind dom stage) (Ann UValueBind dom stage) (Ann URhs dom stage) (Ann URhs dom stage) #

valBindPat :: Partial (Ann UValueBind dom stage) (Ann UValueBind dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

valBindLocals :: Partial (Ann UValueBind dom stage) (Ann UValueBind dom stage) (AnnMaybeG ULocalBinds dom stage) (AnnMaybeG ULocalBinds dom stage) #

funBindMatches :: Partial (Ann UValueBind dom stage) (Ann UValueBind dom stage) (AnnListG UMatch dom stage) (AnnListG UMatch dom stage) #

kindConstr :: Lens (Ann UKindConstraint dom stage) (Ann UKindConstraint dom stage) (Ann UKind dom stage) (Ann UKind dom stage) #

matchLhsRhs :: Partial (Ann UMatchLhs dom stage) (Ann UMatchLhs dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

matchLhsOperator :: Partial (Ann UMatchLhs dom stage) (Ann UMatchLhs dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

matchLhsName :: Partial (Ann UMatchLhs dom stage) (Ann UMatchLhs dom stage) (Ann UName dom stage) (Ann UName dom stage) #

matchLhsLhs :: Partial (Ann UMatchLhs dom stage) (Ann UMatchLhs dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

matchLhsArgs :: Lens (Ann UMatchLhs dom stage) (Ann UMatchLhs dom stage) (AnnListG UPattern dom stage) (AnnListG UPattern dom stage) #

tsType :: Lens (Ann UTypeSignature dom stage) (Ann UTypeSignature dom stage) (Ann UType dom stage) (Ann UType dom stage) #

tsName :: Lens (Ann UTypeSignature dom stage) (Ann UTypeSignature dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

precedenceValue :: Lens (Ann Precedence dom stage) (Ann Precedence dom stage) Int Int #

fixityPrecedence :: Lens (Ann UFixitySignature dom stage) (Ann UFixitySignature dom stage) (AnnMaybeG Precedence dom stage) (AnnMaybeG Precedence dom stage) #

fixityOperators :: Lens (Ann UFixitySignature dom stage) (Ann UFixitySignature dom stage) (AnnListG UOperator dom stage) (AnnListG UOperator dom stage) #

fixityAssoc :: Lens (Ann UFixitySignature dom stage) (Ann UFixitySignature dom stage) (Ann Assoc dom stage) (Ann Assoc dom stage) #

localBinds :: Lens (Ann ULocalBinds dom stage) (Ann ULocalBinds dom stage) (AnnListG ULocalBind dom stage) (AnnListG ULocalBind dom stage) #

localVal :: Partial (Ann ULocalBind dom stage) (Ann ULocalBind dom stage) (Ann UValueBind dom stage) (Ann UValueBind dom stage) #

localSig :: Partial (Ann ULocalBind dom stage) (Ann ULocalBind dom stage) (Ann UTypeSignature dom stage) (Ann UTypeSignature dom stage) #

localInline :: Partial (Ann ULocalBind dom stage) (Ann ULocalBind dom stage) (Ann UInlinePragma dom stage) (Ann UInlinePragma dom stage) #

localFixity :: Partial (Ann ULocalBind dom stage) (Ann ULocalBind dom stage) (Ann UFixitySignature dom stage) (Ann UFixitySignature dom stage) #

guardRhs :: Partial (Ann URhsGuard dom stage) (Ann URhsGuard dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

guardPat :: Partial (Ann URhsGuard dom stage) (Ann URhsGuard dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

guardCheck :: Partial (Ann URhsGuard dom stage) (Ann URhsGuard dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

guardBinds :: Partial (Ann URhsGuard dom stage) (Ann URhsGuard dom stage) (AnnListG ULocalBind dom stage) (AnnListG ULocalBind dom stage) #

guardStmts :: Lens (Ann UGuardedRhs dom stage) (Ann UGuardedRhs dom stage) (AnnListG URhsGuard dom stage) (AnnListG URhsGuard dom stage) #

guardExpr :: Lens (Ann UGuardedRhs dom stage) (Ann UGuardedRhs dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

rhsGuards :: Partial (Ann URhs dom stage) (Ann URhs dom stage) (AnnListG UGuardedRhs dom stage) (AnnListG UGuardedRhs dom stage) #

rhsExpr :: Partial (Ann URhs dom stage) (Ann URhs dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

matchRhs :: Lens (Ann UMatch dom stage) (Ann UMatch dom stage) (Ann URhs dom stage) (Ann URhs dom stage) #

matchLhs :: Lens (Ann UMatch dom stage) (Ann UMatch dom stage) (Ann UMatchLhs dom stage) (Ann UMatchLhs dom stage) #

matchBinds :: Lens (Ann UMatch dom stage) (Ann UMatch dom stage) (AnnMaybeG ULocalBinds dom stage) (AnnMaybeG ULocalBinds dom stage) #

specializeType :: Lens (Ann USpecializePragma dom stage) (Ann USpecializePragma dom stage) (AnnListG UType dom stage) (AnnListG UType dom stage) #

specializeDef :: Lens (Ann USpecializePragma dom stage) (Ann USpecializePragma dom stage) (Ann UName dom stage) (Ann UName dom stage) #

pragmaPhase :: Lens (Ann USpecializePragma dom stage) (Ann USpecializePragma dom stage) (AnnMaybeG UPhaseControl dom stage) (AnnMaybeG UPhaseControl dom stage) #

numberInteger :: Lens (Ann Number dom stage) (Ann Number dom stage) Integer Integer #

srToLine :: Lens (Ann USourceRange dom stage) (Ann USourceRange dom stage) (Ann Number dom stage) (Ann Number dom stage) #

srToCol :: Lens (Ann USourceRange dom stage) (Ann USourceRange dom stage) (Ann Number dom stage) (Ann Number dom stage) #

srFromLine :: Lens (Ann USourceRange dom stage) (Ann USourceRange dom stage) (Ann Number dom stage) (Ann Number dom stage) #

srFromCol :: Lens (Ann USourceRange dom stage) (Ann USourceRange dom stage) (Ann Number dom stage) (Ann Number dom stage) #

srFileName :: Lens (Ann USourceRange dom stage) (Ann USourceRange dom stage) (Ann UStringNode dom stage) (Ann UStringNode dom stage) #

minimalOrs :: Partial (Ann UMinimalFormula dom stage) (Ann UMinimalFormula dom stage) (AnnListG UMinimalFormula dom stage) (AnnListG UMinimalFormula dom stage) #

minimalName :: Partial (Ann UMinimalFormula dom stage) (Ann UMinimalFormula dom stage) (Ann UName dom stage) (Ann UName dom stage) #

minimalInner :: Partial (Ann UMinimalFormula dom stage) (Ann UMinimalFormula dom stage) (Ann UMinimalFormula dom stage) (Ann UMinimalFormula dom stage) #

minimalAnds :: Partial (Ann UMinimalFormula dom stage) (Ann UMinimalFormula dom stage) (AnnListG UMinimalFormula dom stage) (AnnListG UMinimalFormula dom stage) #

annotateName :: Partial (Ann UAnnotationSubject dom stage) (Ann UAnnotationSubject dom stage) (Ann UName dom stage) (Ann UName dom stage) #

warnMessage :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (AnnListG UStringNode dom stage) (AnnListG UStringNode dom stage) #

specializePragma :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (Ann USpecializePragma dom stage) (Ann USpecializePragma dom stage) #

pragmaSignature :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (AnnMaybeG UName dom stage) (AnnMaybeG UName dom stage) #

pragmaRule :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (AnnListG URule dom stage) (AnnListG URule dom stage) #

pragmaObjects :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

pragmaLineNum :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (Ann LineNumber dom stage) (Ann LineNumber dom stage) #

pragmaInline :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (Ann UInlinePragma dom stage) (Ann UInlinePragma dom stage) #

pragmaFileName :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (AnnMaybeG UStringNode dom stage) (AnnMaybeG UStringNode dom stage) #

deprMessage :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (AnnListG UStringNode dom stage) (AnnListG UStringNode dom stage) #

annotationSubject :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (Ann UAnnotationSubject dom stage) (Ann UAnnotationSubject dom stage) #

annotateExpr :: Partial (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

phaseNum :: Lens (Ann PhaseNumber dom stage) (Ann PhaseNumber dom stage) Integer Integer #

phaseUntil :: Lens (Ann UPhaseControl dom stage) (Ann UPhaseControl dom stage) (AnnMaybeG PhaseInvert dom stage) (AnnMaybeG PhaseInvert dom stage) #

phaseNumber :: Lens (Ann UPhaseControl dom stage) (Ann UPhaseControl dom stage) (AnnMaybeG PhaseNumber dom stage) (AnnMaybeG PhaseNumber dom stage) #

ruleVarType :: Partial (Ann URuleVar dom stage) (Ann URuleVar dom stage) (Ann UType dom stage) (Ann UType dom stage) #

ruleVarName :: Lens (Ann URuleVar dom stage) (Ann URuleVar dom stage) (Ann UName dom stage) (Ann UName dom stage) #

ruleRhs :: Lens (Ann URule dom stage) (Ann URule dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

rulePhase :: Lens (Ann URule dom stage) (Ann URule dom stage) (AnnMaybeG UPhaseControl dom stage) (AnnMaybeG UPhaseControl dom stage) #

ruleName :: Lens (Ann URule dom stage) (Ann URule dom stage) (Ann UStringNode dom stage) (Ann UStringNode dom stage) #

ruleLhs :: Lens (Ann URule dom stage) (Ann URule dom stage) (Ann UExpr dom stage) (Ann UExpr dom stage) #

ruleBounded :: Lens (Ann URule dom stage) (Ann URule dom stage) (AnnListG URuleVar dom stage) (AnnListG URuleVar dom stage) #

teRhs :: Lens (Ann UTypeEqn dom stage) (Ann UTypeEqn dom stage) (Ann UType dom stage) (Ann UType dom stage) #

teLhs :: Lens (Ann UTypeEqn dom stage) (Ann UTypeEqn dom stage) (Ann UType dom stage) (Ann UType dom stage) #

ihType :: Partial (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) (Ann UType dom stage) (Ann UType dom stage) #

ihOperator :: Partial (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

ihLeftOp :: Partial (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) (Ann UType dom stage) (Ann UType dom stage) #

ihHead :: Partial (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) #

ihFun :: Partial (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) #

ihConName :: Partial (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) (Ann UName dom stage) (Ann UName dom stage) #

irVars :: Lens (Ann UInstanceRule dom stage) (Ann UInstanceRule dom stage) (AnnMaybeG (AnnListG UTyVar) dom stage) (AnnMaybeG (AnnListG UTyVar) dom stage) #

irHead :: Lens (Ann UInstanceRule dom stage) (Ann UInstanceRule dom stage) (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) #

irCtx :: Lens (Ann UInstanceRule dom stage) (Ann UInstanceRule dom stage) (AnnMaybeG UContext dom stage) (AnnMaybeG UContext dom stage) #

oneDerived :: Partial (Ann UDeriving dom stage) (Ann UDeriving dom stage) (Ann UInstanceHead dom stage) (Ann UInstanceHead dom stage) #

allDerived :: Partial (Ann UDeriving dom stage) (Ann UDeriving dom stage) (AnnListG UInstanceHead dom stage) (AnnListG UInstanceHead dom stage) #

deriveStrategy :: Lens (Ann UDeriving dom stage) (Ann UDeriving dom stage) (AnnMaybeG UDeriveStrategy dom stage) (AnnMaybeG UDeriveStrategy dom stage) #

fieldType :: Lens (Ann UFieldDecl dom stage) (Ann UFieldDecl dom stage) (Ann UType dom stage) (Ann UType dom stage) #

fieldNames :: Lens (Ann UFieldDecl dom stage) (Ann UFieldDecl dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

conDeclRhs :: Partial (Ann UConDecl dom stage) (Ann UConDecl dom stage) (Ann UType dom stage) (Ann UType dom stage) #

conDeclOp :: Partial (Ann UConDecl dom stage) (Ann UConDecl dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

conDeclName :: Partial (Ann UConDecl dom stage) (Ann UConDecl dom stage) (Ann UName dom stage) (Ann UName dom stage) #

conDeclLhs :: Partial (Ann UConDecl dom stage) (Ann UConDecl dom stage) (Ann UType dom stage) (Ann UType dom stage) #

conDeclFields :: Partial (Ann UConDecl dom stage) (Ann UConDecl dom stage) (AnnListG UFieldDecl dom stage) (AnnListG UFieldDecl dom stage) #

conDeclArgs :: Partial (Ann UConDecl dom stage) (Ann UConDecl dom stage) (AnnListG UType dom stage) (AnnListG UType dom stage) #

conTypeCtx :: Lens (Ann UConDecl dom stage) (Ann UConDecl dom stage) (AnnMaybeG UContext dom stage) (AnnMaybeG UContext dom stage) #

conTypeArgs :: Lens (Ann UConDecl dom stage) (Ann UConDecl dom stage) (AnnListG UTyVar dom stage) (AnnListG UTyVar dom stage) #

funDepRhs :: Lens (Ann UFunDep dom stage) (Ann UFunDep dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

funDepLhs :: Lens (Ann UFunDep dom stage) (Ann UFunDep dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

funDeps :: Lens (Ann UFunDeps dom stage) (Ann UFunDeps dom stage) (AnnListG UFunDep dom stage) (AnnListG UFunDep dom stage) #

patSigType :: Lens (Ann UPatternTypeSignature dom stage) (Ann UPatternTypeSignature dom stage) (Ann UType dom stage) (Ann UType dom stage) #

patSigName :: Lens (Ann UPatternTypeSignature dom stage) (Ann UPatternTypeSignature dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

patOpposite :: Lens (Ann UPatSynWhere dom stage) (Ann UPatSynWhere dom stage) (AnnListG UMatch dom stage) (AnnListG UMatch dom stage) #

patSynRhs :: Partial (Ann UPatSynLhs dom stage) (Ann UPatSynLhs dom stage) (Ann UName dom stage) (Ann UName dom stage) #

patSynOp :: Partial (Ann UPatSynLhs dom stage) (Ann UPatSynLhs dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

patSynLhs :: Partial (Ann UPatSynLhs dom stage) (Ann UPatSynLhs dom stage) (Ann UName dom stage) (Ann UName dom stage) #

patName :: Partial (Ann UPatSynLhs dom stage) (Ann UPatSynLhs dom stage) (Ann UName dom stage) (Ann UName dom stage) #

patArgs :: Partial (Ann UPatSynLhs dom stage) (Ann UPatSynLhs dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

patRhsOpposite :: Partial (Ann UPatSynRhs dom stage) (Ann UPatSynRhs dom stage) (AnnMaybeG UPatSynWhere dom stage) (AnnMaybeG UPatSynWhere dom stage) #

patRhsPat :: Lens (Ann UPatSynRhs dom stage) (Ann UPatSynRhs dom stage) (Ann UPattern dom stage) (Ann UPattern dom stage) #

patRhs :: Lens (Ann UPatternSynonym dom stage) (Ann UPatternSynonym dom stage) (Ann UPatSynRhs dom stage) (Ann UPatSynRhs dom stage) #

patLhs :: Lens (Ann UPatternSynonym dom stage) (Ann UPatternSynonym dom stage) (Ann UPatSynLhs dom stage) (Ann UPatSynLhs dom stage) #

gadtConResultType :: Partial (Ann UGadtConType dom stage) (Ann UGadtConType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

gadtConRecordFields :: Partial (Ann UGadtConType dom stage) (Ann UGadtConType dom stage) (AnnListG UFieldDecl dom stage) (AnnListG UFieldDecl dom stage) #

gadtConNormalType :: Partial (Ann UGadtConType dom stage) (Ann UGadtConType dom stage) (Ann UType dom stage) (Ann UType dom stage) #

gadtConTypeCtx :: Lens (Ann UGadtConDecl dom stage) (Ann UGadtConDecl dom stage) (AnnMaybeG UContext dom stage) (AnnMaybeG UContext dom stage) #

gadtConTypeArgs :: Lens (Ann UGadtConDecl dom stage) (Ann UGadtConDecl dom stage) (AnnListG UTyVar dom stage) (AnnListG UTyVar dom stage) #

gadtConType :: Lens (Ann UGadtConDecl dom stage) (Ann UGadtConDecl dom stage) (Ann UGadtConType dom stage) (Ann UGadtConType dom stage) #

gadtConNames :: Lens (Ann UGadtConDecl dom stage) (Ann UGadtConDecl dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

injAnnRes :: Lens (Ann UInjectivityAnn dom stage) (Ann UInjectivityAnn dom stage) (Ann UTyVar dom stage) (Ann UTyVar dom stage) #

injAnnDeps :: Lens (Ann UInjectivityAnn dom stage) (Ann UInjectivityAnn dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

tfTypeVar :: Partial (Ann UTypeFamilySpec dom stage) (Ann UTypeFamilySpec dom stage) (Ann UTyVar dom stage) (Ann UTyVar dom stage) #

tfSpecKind :: Partial (Ann UTypeFamilySpec dom stage) (Ann UTypeFamilySpec dom stage) (Ann UKindConstraint dom stage) (Ann UKindConstraint dom stage) #

tfInjectivity :: Partial (Ann UTypeFamilySpec dom stage) (Ann UTypeFamilySpec dom stage) (Ann UInjectivityAnn dom stage) (Ann UInjectivityAnn dom stage) #

tfSpec :: Partial (Ann UTypeFamily dom stage) (Ann UTypeFamily dom stage) (AnnMaybeG UTypeFamilySpec dom stage) (AnnMaybeG UTypeFamilySpec dom stage) #

tfKind :: Partial (Ann UTypeFamily dom stage) (Ann UTypeFamily dom stage) (AnnMaybeG UKindConstraint dom stage) (AnnMaybeG UKindConstraint dom stage) #

tfHead :: Lens (Ann UTypeFamily dom stage) (Ann UTypeFamily dom stage) (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) #

specializeInstanceType :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (Ann UType dom stage) (Ann UType dom stage) #

specializeInstance :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (Ann USpecializePragma dom stage) (Ann USpecializePragma dom stage) #

instanceInline :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (Ann UInlinePragma dom stage) (Ann UInlinePragma dom stage) #

instBodyTypeSig :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (Ann UTypeSignature dom stage) (Ann UTypeSignature dom stage) #

instBodyTypeEqn :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (Ann UTypeEqn dom stage) (Ann UTypeEqn dom stage) #

instBodyLhsType :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (Ann UInstanceRule dom stage) (Ann UInstanceRule dom stage) #

instBodyGadtCons :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (AnnListG UGadtConDecl dom stage) (AnnListG UGadtConDecl dom stage) #

instBodyDerivings :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (AnnListG UDeriving dom stage) (AnnListG UDeriving dom stage) #

instBodyDeclFunbind :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (Ann UValueBind dom stage) (Ann UValueBind dom stage) #

instBodyDataNew :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (Ann UDataOrNewtypeKeyword dom stage) (Ann UDataOrNewtypeKeyword dom stage) #

instBodyDataKind :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (AnnMaybeG UKindConstraint dom stage) (AnnMaybeG UKindConstraint dom stage) #

instBodyDataCons :: Partial (Ann UInstBodyDecl dom stage) (Ann UInstBodyDecl dom stage) (AnnListG UConDecl dom stage) (AnnListG UConDecl dom stage) #

instBodyDecls :: Lens (Ann UInstBody dom stage) (Ann UInstBody dom stage) (AnnListG UInstBodyDecl dom stage) (AnnListG UInstBodyDecl dom stage) #

dhRight :: Partial (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UTyVar dom stage) (Ann UTyVar dom stage) #

dhOperator :: Partial (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UOperator dom stage) (Ann UOperator dom stage) #

dhName :: Partial (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UName dom stage) (Ann UName dom stage) #

dhLeft :: Partial (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UTyVar dom stage) (Ann UTyVar dom stage) #

dhBody :: Partial (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) #

dhAppOperand :: Partial (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UTyVar dom stage) (Ann UTyVar dom stage) #

dhAppFun :: Partial (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) #

pragmaFormula :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UMinimalFormula dom stage) (Ann UMinimalFormula dom stage) #

clsInline :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UInlinePragma dom stage) (Ann UInlinePragma dom stage) #

clsFixity :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UFixitySignature dom stage) (Ann UFixitySignature dom stage) #

ceTypeSig :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UTypeSignature dom stage) (Ann UTypeSignature dom stage) #

ceTypeFam :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UTypeFamily dom stage) (Ann UTypeFamily dom stage) #

ceType :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UType dom stage) (Ann UType dom stage) #

ceName :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UName dom stage) (Ann UName dom stage) #

ceKind :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UType dom stage) (Ann UType dom stage) #

ceHead :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) #

ceBind :: Partial (Ann UClassElement dom stage) (Ann UClassElement dom stage) (Ann UValueBind dom stage) (Ann UValueBind dom stage) #

cbElements :: Lens (Ann UClassBody dom stage) (Ann UClassBody dom stage) (AnnListG UClassElement dom stage) (AnnListG UClassElement dom stage) #

declValBind :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UValueBind dom stage) (Ann UValueBind dom stage) #

declTypes :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnListG UType dom stage) (AnnListG UType dom stage) #

declTypeSig :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UTypeSignature dom stage) (Ann UTypeSignature dom stage) #

declTypeFamily :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UTypeFamily dom stage) (Ann UTypeFamily dom stage) #

declType :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UType dom stage) (Ann UType dom stage) #

declSplice :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann USplice dom stage) (Ann USplice dom stage) #

declSpec :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG UTypeFamilySpec dom stage) (AnnMaybeG UTypeFamilySpec dom stage) #

declSafety :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG USafety dom stage) (AnnMaybeG USafety dom stage) #

declRoles :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnListG URole dom stage) (AnnListG URole dom stage) #

declRoleType :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UQualifiedName dom stage) (Ann UQualifiedName dom stage) #

declPragma :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UTopLevelPragma dom stage) (Ann UTopLevelPragma dom stage) #

declPatTypeSig :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UPatternTypeSignature dom stage) (Ann UPatternTypeSignature dom stage) #

declPatSyn :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UPatternSynonym dom stage) (Ann UPatternSynonym dom stage) #

declOverlap :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG UOverlapPragma dom stage) (AnnMaybeG UOverlapPragma dom stage) #

declNewtype :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UDataOrNewtypeKeyword dom stage) (Ann UDataOrNewtypeKeyword dom stage) #

declName :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UName dom stage) (Ann UName dom stage) #

declKind :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG UKindConstraint dom stage) (AnnMaybeG UKindConstraint dom stage) #

declInstance :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UInstanceRule dom stage) (Ann UInstanceRule dom stage) #

declInstRule :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UInstanceRule dom stage) (Ann UInstanceRule dom stage) #

declInstDecl :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG UInstBody dom stage) (AnnMaybeG UInstBody dom stage) #

declHead :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UDeclHead dom stage) (Ann UDeclHead dom stage) #

declGadt :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnListG UGadtConDecl dom stage) (AnnListG UGadtConDecl dom stage) #

declFunDeps :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG UFunDeps dom stage) (AnnMaybeG UFunDeps dom stage) #

declForeignType :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UType dom stage) (Ann UType dom stage) #

declFixity :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UFixitySignature dom stage) (Ann UFixitySignature dom stage) #

declDeriving :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnListG UDeriving dom stage) (AnnListG UDeriving dom stage) #

declDerivStrat :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG UDeriveStrategy dom stage) (AnnMaybeG UDeriveStrategy dom stage) #

declDecl :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnListG UTypeEqn dom stage) (AnnListG UTypeEqn dom stage) #

declCtx :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG UContext dom stage) (AnnMaybeG UContext dom stage) #

declCons :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnListG UConDecl dom stage) (AnnListG UConDecl dom stage) #

declCallConv :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UCallConv dom stage) (Ann UCallConv dom stage) #

declBody :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (AnnMaybeG UClassBody dom stage) (AnnMaybeG UClassBody dom stage) #

declAssignedType :: Partial (Ann UDecl dom stage) (Ann UDecl dom stage) (Ann UType dom stage) (Ann UType dom stage) #

moduleNameString :: Lens (Ann UModuleName dom stage) (Ann UModuleName dom stage) String String #

importRename :: Lens (Ann UImportRenaming dom stage) (Ann UImportRenaming dom stage) (Ann UModuleName dom stage) (Ann UModuleName dom stage) #

importSpecList :: Partial (Ann UImportSpec dom stage) (Ann UImportSpec dom stage) (AnnListG UIESpec dom stage) (AnnListG UIESpec dom stage) #

importSpecHiding :: Partial (Ann UImportSpec dom stage) (Ann UImportSpec dom stage) (AnnListG UIESpec dom stage) (AnnListG UIESpec dom stage) #

importSpec :: Lens (Ann UImportDecl dom stage) (Ann UImportDecl dom stage) (AnnMaybeG UImportSpec dom stage) (AnnMaybeG UImportSpec dom stage) #

importSource :: Lens (Ann UImportDecl dom stage) (Ann UImportDecl dom stage) (AnnMaybeG UImportSource dom stage) (AnnMaybeG UImportSource dom stage) #

importSafe :: Lens (Ann UImportDecl dom stage) (Ann UImportDecl dom stage) (AnnMaybeG UImportSafe dom stage) (AnnMaybeG UImportSafe dom stage) #

importQualified :: Lens (Ann UImportDecl dom stage) (Ann UImportDecl dom stage) (AnnMaybeG UImportQualified dom stage) (AnnMaybeG UImportQualified dom stage) #

importPkg :: Lens (Ann UImportDecl dom stage) (Ann UImportDecl dom stage) (AnnMaybeG UStringNode dom stage) (AnnMaybeG UStringNode dom stage) #

importModule :: Lens (Ann UImportDecl dom stage) (Ann UImportDecl dom stage) (Ann UModuleName dom stage) (Ann UModuleName dom stage) #

importAs :: Lens (Ann UImportDecl dom stage) (Ann UImportDecl dom stage) (AnnMaybeG UImportRenaming dom stage) (AnnMaybeG UImportRenaming dom stage) #

opStr :: Partial (Ann UFilePragma dom stage) (Ann UFilePragma dom stage) (Ann UStringNode dom stage) (Ann UStringNode dom stage) #

lpPragmas :: Partial (Ann UFilePragma dom stage) (Ann UFilePragma dom stage) (AnnListG ULanguageExtension dom stage) (AnnListG ULanguageExtension dom stage) #

modWarningStr :: Partial (Ann UModulePragma dom stage) (Ann UModulePragma dom stage) (AnnListG UStringNode dom stage) (AnnListG UStringNode dom stage) #

modDeprecatedPragma :: Partial (Ann UModulePragma dom stage) (Ann UModulePragma dom stage) (AnnListG UStringNode dom stage) (AnnListG UStringNode dom stage) #

essList :: Partial (Ann USubSpec dom stage) (Ann USubSpec dom stage) (AnnListG UName dom stage) (AnnListG UName dom stage) #

ieSubspec :: Lens (Ann UIESpec dom stage) (Ann UIESpec dom stage) (AnnMaybeG USubSpec dom stage) (AnnMaybeG USubSpec dom stage) #

ieName :: Lens (Ann UIESpec dom stage) (Ann UIESpec dom stage) (Ann UName dom stage) (Ann UName dom stage) #

ieModifier :: Lens (Ann UIESpec dom stage) (Ann UIESpec dom stage) (AnnMaybeG UImportModifier dom stage) (AnnMaybeG UImportModifier dom stage) #

exportModuleName :: Partial (Ann UExportSpec dom stage) (Ann UExportSpec dom stage) (Ann UModuleName dom stage) (Ann UModuleName dom stage) #

exportDecl :: Partial (Ann UExportSpec dom stage) (Ann UExportSpec dom stage) (Ann UIESpec dom stage) (Ann UIESpec dom stage) #

espExports :: Lens (Ann UExportSpecs dom stage) (Ann UExportSpecs dom stage) (AnnListG UExportSpec dom stage) (AnnListG UExportSpec dom stage) #

mhPragma :: Lens (Ann UModuleHead dom stage) (Ann UModuleHead dom stage) (AnnMaybeG UModulePragma dom stage) (AnnMaybeG UModulePragma dom stage) #

mhName :: Lens (Ann UModuleHead dom stage) (Ann UModuleHead dom stage) (Ann UModuleName dom stage) (Ann UModuleName dom stage) #

mhExports :: Lens (Ann UModuleHead dom stage) (Ann UModuleHead dom stage) (AnnMaybeG UExportSpecs dom stage) (AnnMaybeG UExportSpecs dom stage) #

modImports :: Lens (Ann UModule dom stage) (Ann UModule dom stage) (AnnListG UImportDecl dom stage) (AnnListG UImportDecl dom stage) #

modHead :: Lens (Ann UModule dom stage) (Ann UModule dom stage) (AnnMaybeG UModuleHead dom stage) (AnnMaybeG UModuleHead dom stage) #

modDecl :: Lens (Ann UModule dom stage) (Ann UModule dom stage) (AnnListG UDecl dom stage) (AnnListG UDecl dom stage) #

filePragmas :: Lens (Ann UModule dom stage) (Ann UModule dom stage) (AnnListG UFilePragma dom stage) (AnnListG UFilePragma dom stage) #

type HasNameInfo dom = (Domain dom, HasNameInfo' (SemanticInfo dom UQualifiedName)) #

Domains that have semantic information for names

type HasLiteralInfo dom = (Domain dom, HasLiteralInfo' (SemanticInfo dom ULiteral)) #

Domains that have semantic information for literals

class HasLiteralInfo' si where #

Info of types

Methods

semanticsLiteralType :: si -> Type #

class HasNameInfo' si => HasIdInfo' si where #

Infos that may have a typed name that can be extracted

Methods

semanticsId :: si -> Id #

Instances
HasIdInfo' CNameInfo 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

Methods

semanticsId :: CNameInfo -> Id #

HasIdInfo dom => HasIdInfo' (Ann UName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

Methods

semanticsId :: Ann UName dom st -> Id #

HasIdInfo dom => HasIdInfo' (Ann UQualifiedName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

Methods

semanticsId :: Ann UQualifiedName dom st -> Id #

class HasFixityInfo' si where #

Infos that may have a fixity information

Methods

semanticsFixity :: si -> Maybe Fixity #

class HasScopeInfo' si where #

Infos that contain the names that are available in theirs scope

Methods

semanticsScope :: si -> Scope #

class HasDefiningInfo' si where #

Infos that store if they were used to define a name

Methods

semanticsDefining :: si -> Bool #

type HasNoSemanticInfo dom (si :: Type -> Type -> Type) = SemanticInfo dom si ~ NoSemanticInfo #

getInstances :: GhcMonad m => [Module] -> m ([ClsInst], [FamInst]) #

Gets the class and family instances from a module.

data UsageSpec #

Instances
Data UsageSpec 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoTypes

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UsageSpec -> c UsageSpec #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UsageSpec #

toConstr :: UsageSpec -> Constr #

dataTypeOf :: UsageSpec -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> UsageSpec -> UsageSpec #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UsageSpec -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UsageSpec -> r #

gmapQ :: (forall d. Data d => d -> u) -> UsageSpec -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> UsageSpec -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> UsageSpec -> m UsageSpec #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UsageSpec -> m UsageSpec #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UsageSpec -> m UsageSpec #

after :: AfterBefore i => String -> i -> i #

Put the given string before the element if it is not empty

followedBy :: AfterBefore i => String -> i -> i #

The given string should follow the element if it is not empty

relativeIndented :: RelativeIndent i => Int -> i -> i #

The element should be indented relatively to its parent

minimumIndented :: MinimumIndent i => Int -> i -> i #

The elements should be indented at least to the given number of spaces

prepareAST :: StringBuffer -> Ann UModule dom RangeStage -> Ann UModule dom SrcTemplateStage #

Prepares the AST for pretty printing

indented :: ListInfo SrcTemplateStage -> ListInfo SrcTemplateStage #

The elements of the list should be indented on the same column

separatedBy :: String -> ListInfo SrcTemplateStage -> ListInfo SrcTemplateStage #

The elements of the list should be separated by the given string by default (might be overridden)

extractStayingElems :: SourceInfoTraversal node => Ann node dom SrcTemplateStage -> Ann node dom SrcTemplateStage #

Marks template elements in the AST that should always be present in the source code, regardless of their containing elements being deleted. Currently it recognizes CPP pragmas (lines starting with #) This function should only be applied to an AST if CPP is enabled.

mapLocIndices :: Ord k => StringBuffer -> Set (RealSrcLoc, k) -> Map k String #

Partitions the source file in the order where the parts are used in the AST

getLocIndices :: SourceInfoTraversal e => Ann e dom RngTemplateStage -> Set (RealSrcLoc, Int) #

Assigns an index (in the order they are used) for each range

data SourceTemplateElem #

An element of a source template for a singleton AST node.

Constructors

TextElem

Source text belonging to the current node

ChildElem

Placeholder for the next children of the node

Instances
Eq SourceTemplateElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Data SourceTemplateElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceTemplateElem -> c SourceTemplateElem #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceTemplateElem #

toConstr :: SourceTemplateElem -> Constr #

dataTypeOf :: SourceTemplateElem -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> SourceTemplateElem -> SourceTemplateElem #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceTemplateElem -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceTemplateElem -> r #

gmapQ :: (forall d. Data d => d -> u) -> SourceTemplateElem -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceTemplateElem -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceTemplateElem -> m SourceTemplateElem #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceTemplateElem -> m SourceTemplateElem #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceTemplateElem -> m SourceTemplateElem #

Ord SourceTemplateElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Show SourceTemplateElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

data SourceTemplateTextElem #

Instances
Eq SourceTemplateTextElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Data SourceTemplateTextElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceTemplateTextElem -> c SourceTemplateTextElem #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceTemplateTextElem #

toConstr :: SourceTemplateTextElem -> Constr #

dataTypeOf :: SourceTemplateTextElem -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> SourceTemplateTextElem -> SourceTemplateTextElem #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceTemplateTextElem -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceTemplateTextElem -> r #

gmapQ :: (forall d. Data d => d -> u) -> SourceTemplateTextElem -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceTemplateTextElem -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceTemplateTextElem -> m SourceTemplateTextElem #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceTemplateTextElem -> m SourceTemplateTextElem #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceTemplateTextElem -> m SourceTemplateTextElem #

Ord SourceTemplateTextElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Show SourceTemplateTextElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

fixRanges :: SourceInfoTraversal node => Ann node dom RangeStage -> Ann node dom NormRangeStage #

Modifies ranges to contain their children

cutUpRanges :: SourceInfoTraversal node => Ann node dom NormRangeStage -> Ann node dom RngTemplateStage #

Creates a source template from the ranges and the input file. All source ranges must be good ranges.

placeComments :: RangeInfo stage => Map ApiAnnKey [SrcSpan] -> Map SrcSpan [Located AnnotationComment] -> Ann UModule dom stage -> Ann UModule dom stage #

Puts comments in the nodes they should be attached to. Watches for lexical tokens that may divide the comment and the supposed element. Leaves the AST in a state where parent nodes does not contain all of their children.

pattern ForallType :: TyVarList -> Type -> Type #

Forall types ( forall x y . type )

pattern CtxType :: Context -> Type -> Type #

Type with a context ( C a => type )

pattern FunctionType :: Type -> Type -> Type #

Function types ( a -> b )

pattern TupleType :: TypeList -> Type #

Tuple types ( (a,b) )

pattern UnboxedTupleType :: TypeList -> Type #

Unboxed tuple types ( (#a,b#) )

pattern ListType :: Type -> Type #

List type with special syntax ( [a] )

pattern ParArrayType :: Type -> Type #

Parallel array type ( [:a:] )

pattern TypeApp :: Type -> Type -> Type #

Type application ( F a )

pattern InfixTypeApp :: Type -> Operator -> Type -> Type #

Infix type constructor ( (a <: b) )

pattern ParenType :: Type -> Type #

Type surrounded by parentheses ( (T a) )

pattern VarType :: Name -> Type #

Type variable or constructor ( a )

pattern KindedType :: Type -> Kind -> Type #

Type with explicit kind signature ( a :: * )

pattern BangType :: Type -> Type #

Strict type marked with !.

pattern LazyType :: Type -> Type #

Lazy type marked with ~. (Should only be used if Strict or StrictData language extension is used)

pattern UnpackType :: Type -> Type #

Strict type marked with UNPACK pragma. (Usually contains the bang mark.)

pattern NoUnpackType :: Type -> Type #

Strict type marked with NOUNPACK pragma. (Usually contains the bang mark.)

pattern WildcardType :: Type #

A wildcard type ( _ ) with -XPartialTypeSignatures

pattern NamedWildcardType :: Name -> Type #

A named wildcard type ( _t ) with -XPartialTypeSignatures

pattern SpliceType :: Splice -> Type #

A Template Haskell splice type ( $(genType) ).

pattern QuasiQuoteType :: QuasiQuote -> Type #

A Template Haskell splice type ( $(genType) ).

pattern PromotedIntType :: Integer -> Type #

Numeric value promoted to the type level.

pattern PromotedStringType :: String -> Type #

String value promoted to the type level.

pattern PromotedConType :: Name -> Type #

A data constructor value promoted to the type level.

pattern PromotedListType :: TypeList -> Type #

A list of elements as a type.

pattern PromotedTupleType :: TypeList -> Type #

A tuple of elements as a type.

pattern PromotedUnitType :: Type #

Kind of the unit value ().

pattern UnboxedSumType :: TypeList -> Type #

An unboxed sum type.

pattern TyVarDecl :: Name -> TyVar #

Type variable declaration

pattern KindedTyVarDecl :: Name -> Kind -> TyVar #

Kinded type variable declaration ( v :: * )

pattern Context :: Assertion -> Context #

A context of assertions ( C a => ... )

pattern ClassAssert :: Name -> TypeList -> Assertion #

Class assertion (Cls x)

pattern InfixAssert :: Type -> Operator -> Type -> Assertion #

Infix class assertion, also contains type equations ( a ~ X y )

pattern ImplicitAssert :: Name -> Type -> Assertion #

Assertion for implicit parameter binding ( ?cmp :: a -> a -> Bool )

pattern TupleAssert :: [Assertion] -> Assertion #

A list of assertions ( (Eq a, Show a) )

pattern IdSplice :: Name -> Splice #

A simple name splice: $generateX

pattern ParenSplice :: Expr -> Splice #

A splice with parentheses: $(generate input)

pattern QuasiQuote :: Name -> String -> QuasiQuote #

Template haskell quasi-quotation: [quoter|str]

pattern ExprBracket :: Expr -> Bracket #

Expression bracket ( [| x + y |] )

pattern PatternBracket :: Pattern -> Bracket #

Pattern bracket ( [p| Point x y |] )

pattern TypeBracket :: Type -> Bracket #

Type bracket ( [t| (Int,Int) |] )

pattern DeclsBracket :: DeclList -> Bracket #

Declaration bracket ( [d| f :: Int -> Int; f x = x*x |] )

pattern Var :: Name -> Expr #

An expression for a variable or a data constructor ( a )

pattern Lit :: Literal -> Expr #

A literal expression ( 42 )

pattern InfixApp :: Expr -> Operator -> Expr -> Expr #

An infix operator application ( a + b )

pattern PrefixApp :: Operator -> Expr -> Expr #

Prefix operator application ( -x )

pattern App :: Expr -> Expr -> Expr #

Function application ( f 4 )

pattern Lambda :: PatternList -> Expr -> Expr #

Lambda expression ( \a b -> a + b )

pattern Let :: LocalBindList -> Expr -> Expr #

Local binding ( let x = 2; y = 3 in e x y )

pattern If :: Expr -> Expr -> Expr -> Expr #

If expression ( if a then b else c )

pattern MultiIf :: GuardedCaseRhsList -> Expr #

Multi way if expressions with MultiWayIf extension ( if | guard1 -> expr1; guard2 -> expr2 )

pattern Case :: Expr -> AltList -> Expr #

Pattern matching expression ( case expr of pat1 -> expr1; pat2 -> expr2 )

pattern Do :: StmtList -> Expr #

Do-notation expressions ( do x <- act1; act2 )

pattern MDo :: StmtList -> Expr #

MDo-notation expressions ( mdo x <- act1; act2 )

pattern Tuple :: ExprList -> Expr #

Tuple expression ( (e1, e2, e3) )

pattern UnboxedTuple :: ExprList -> Expr #

Unboxed tuple expression ( (# e1, e2, e3 #) )

pattern TupleSection :: TupSecElemList -> Expr #

Tuple section, enabled with TupleSections ( (a,,b) ). One of the elements must be missing.

pattern UnboxedTupleSection :: TupSecElemList -> Expr #

Unboxed tuple section enabled with TupleSections ( () ). One of the elements must be missing.

pattern List :: ExprList -> Expr #

List expression: [1,2,3]

pattern ParArray :: ExprList -> Expr #

Parallel array expression: [: 1,2,3 :]

pattern Paren :: Expr -> Expr #

Parenthesized expression: ( a + b )

pattern LeftSection :: Expr -> Operator -> Expr #

Left operator section: (1+)

pattern RightSection :: Operator -> Expr -> Expr #

Right operator section: (+1)

pattern RecCon :: Name -> FieldUpdateList -> Expr #

Record value construction: Point { x = 3, y = -2 }

pattern RecUpdate :: Expr -> FieldUpdateList -> Expr #

Record value update: p1 { x = 3, y = -2 }

pattern Enum :: Expr -> MaybeExpr -> MaybeExpr -> Expr #

Enumeration expression ( [1,3..10] )

pattern ParArrayEnum :: Expr -> MaybeExpr -> Expr -> Expr #

Parallel array enumeration ( [: 1,3 .. 10 :] )

pattern ListComp :: Expr -> ListCompBodyList -> Expr #

List comprehension ( [ (x, y) | x <- xs | y <- ys ] )

pattern ParArrayListComp :: Expr -> ListCompBodyList -> Expr #

Parallel array comprehensions [: (x, y) | x <- xs , y <- ys :] enabled by ParallelArrays

pattern TypeSig :: Expr -> Type -> Expr #

Explicit type signature ( x :: Int )

pattern ExplicitTypeApp :: Expr -> Type -> Expr #

Explicit type application ( show @Integer (read "5") )

pattern VarQuote :: Name -> Expr #

'x for template haskell reifying of expressions

pattern TypeQuote :: Name -> Expr #

''T for template haskell reifying of types

pattern BracketExpr :: Bracket -> Expr #

Template haskell bracket expression

pattern SpliceExpr :: Splice -> Expr #

Template haskell splice expression, for example: $(gen a) or $x

pattern QuasiQuoteExpr :: QuasiQuote -> Expr #

Template haskell quasi-quotation: [$quoter|str]

pattern ExprPragma :: ExprPragma -> Expr -> Expr #

Template haskell quasi-quotation: [$quoter|str]

pattern Proc :: Pattern -> Cmd -> Expr #

Arrow definition: proc a -> f -< a+1

pattern ArrowApp :: Expr -> ArrowApp -> Expr -> Expr #

Arrow definition: proc a -> f -< a+1

pattern LambdaCase :: AltList -> Expr #

Lambda case ( case 0 -> 1; 1 -> 2 )

pattern StaticPointer :: Expr -> Expr #

Static pointer expression ( static e ). The inner expression must be closed (cannot have variables bound outside)

pattern NormalFieldUpdate :: Name -> Expr -> FieldUpdate #

Update of a field ( x = 1 )

pattern FieldPun :: Name -> FieldUpdate #

Update the field to the value of the same name ( x )

pattern FieldWildcard :: FieldWildcard -> FieldUpdate #

Update the fields of the bounded names to their values ( .. ). Must be the last initializer. Cannot be used in a record update expression.

pattern TupSecPresent :: Expr -> TupSecElem #

An existing element in a tuple section

pattern TupSecMissing :: TupSecElem #

A missing element in a tuple section

pattern Alt :: Pattern -> CaseRhs -> MaybeLocalBinds -> Alt #

Clause of case expression ( Just x -> x + 1 )

pattern CaseRhs :: Expr -> CaseRhs #

Unguarded right-hand side a pattern match ( -> 3 )

pattern GuardedCaseRhss :: GuardedCaseRhsList -> CaseRhs #

Guarded right-hand sides of a pattern match ( | x == 1 -> 3; | otherwise -> 4 )

pattern GuardedCaseRhs :: RhsGuardList -> Expr -> GuardedCaseRhs #

A guarded right-hand side of pattern matches binding ( | x > 3 -> 2 )

pattern CorePragma :: String -> ExprPragma #

A CORE pragma for adding notes to expressions.

pattern SccPragma :: String -> ExprPragma #

An SCC pragma for defining cost centers for profiling

pattern GeneratedPragma :: SourceRange -> ExprPragma #

A pragma that describes if an expression was generated from a code fragment by an external tool ( {--} )

pattern SourceRange :: String -> Integer -> Integer -> Integer -> Integer -> SourceRange #

In-AST source ranges (for generated pragmas)

pattern ArrowAppCmd :: Expr -> ArrowApp -> Expr -> Cmd #

An arrow application command ( f -< x + 1 )

pattern ArrowFormCmd :: Expr -> CmdList -> Cmd #

A form command ( (|untilA (increment -< x+y) (within 0.5 -< x)|) )

pattern AppCmd :: Cmd -> Expr -> Cmd #

A function application command

pattern InfixCmd :: Cmd -> Name -> Cmd -> Cmd #

An infix command application

pattern LambdaCmd :: PatternList -> Cmd -> Cmd #

An infix command application

pattern ParenCmd :: Cmd -> Cmd #

A parenthesized command

pattern CaseCmd :: Expr -> CmdAltList -> Cmd #

A pattern match command

pattern IfCmd :: Expr -> Cmd -> Cmd -> Cmd #

An if command ( if f x y then g -< x+1 else h -< y+2 )

pattern LetCmd :: LocalBindList -> Cmd -> Cmd #

A local binding command ( let z = x+y )

pattern DoCmd :: CmdStmtList -> Cmd #

A local binding command ( let z = x+y )

pattern LeftAppl :: ArrowApp #

Left arrow application: -<

pattern RightAppl :: ArrowApp #

Right arrow application: >-

pattern LeftHighApp :: ArrowApp #

Left arrow high application: -<<

pattern RightHighApp :: ArrowApp #

Right arrow high application: >>-

pattern Hole :: Expr #

A hole expression _

pattern BindStmt :: Pattern -> Expr -> Stmt #

Binding statement ( x <- action )

pattern ExprStmt :: Expr -> Stmt #

Non-binding statement ( action )

pattern LetStmt :: LocalBindList -> Stmt #

Let statement ( let x = 3; y = 4 )

pattern RecStmt :: StmtList -> Stmt #

A recursive binding statement with ( rec b <- f a c; c <- f b a )

pattern DoKeyword :: DoKind #

pattern MDoKeyword :: DoKind #

pattern ListCompBody :: CompStmtList -> ListCompBody #

Body of a list comprehension: ( | x <- [1..10] )

pattern CompStmt :: Stmt -> CompStmt #

Normal monadic statement of a list comprehension

pattern ThenStmt :: Expr -> MaybeExpr -> CompStmt #

Then statements by TransformListComp ( then sortWith by (x + y) )

pattern GroupStmt :: MaybeExpr -> MaybeExpr -> CompStmt #

Grouping statements by TransformListComp ( then group by (x + y) using groupWith )

pattern BindStmtCmd :: Pattern -> Cmd -> CmdStmt #

Binding statement command ( x <- action )

pattern ExprStmtCmd :: Cmd -> CmdStmt #

Non-binding statement command ( action )

pattern LetStmtCmd :: LocalBindList -> CmdStmt #

Let statement command ( let x = 3; y = 4 )

pattern RecStmtCmd :: CmdStmtList -> CmdStmt #

A recursive binding statement command with ( rec b <- f a c; c <- f b a )

pattern VarPat :: Name -> Pattern #

Pattern name binding

pattern LitPat :: Literal -> Pattern #

Literal pattern

pattern InfixAppPat :: Pattern -> Operator -> Pattern -> Pattern #

Infix constructor application pattern ( a :+: b )

pattern AppPat :: Name -> PatternList -> Pattern #

Constructor application pattern ( Point x y )

pattern TuplePat :: PatternList -> Pattern #

Tuple pattern ( (x,y) )

pattern UnboxTuplePat :: PatternList -> Pattern #

Unboxed tuple pattern ( (# x, y #) )

pattern ListPat :: PatternList -> Pattern #

List pattern ( [1,2,a,x] )

pattern ParArrayPat :: PatternList -> Pattern #

Parallel array pattern ( [:1,2,a,x:] )

pattern ParenPat :: Pattern -> Pattern #

Parenthesised patterns

pattern RecPat :: Name -> PatternFieldList -> Pattern #

Record pattern ( Point { x = 3, y } )

pattern AsPat :: Name -> Pattern -> Pattern #

As-pattern (explicit name binding) ( ls@(hd:_) )

pattern WildPat :: Pattern #

Wildcard pattern: ( _ )

pattern IrrefutablePat :: Pattern -> Pattern #

Irrefutable pattern ( ~(x:_) )

pattern BangPat :: Pattern -> Pattern #

Bang pattern ( !x )

pattern TypeSigPat :: Pattern -> Type -> Pattern #

Pattern with explicit type signature ( x :: Int )

pattern ViewPat :: Expr -> Pattern -> Pattern #

View pattern ( f -> Just 1 )

pattern SplicePat :: Splice -> Pattern #

Splice patterns: $(generateX inp)

pattern QuasiQuotePat :: QuasiQuote -> Pattern #

Quasi-quoted patterns: [| 1 + 2 |]

pattern NPlusKPat :: Name -> Literal -> Pattern #

pattern FieldPattern :: Name -> Pattern -> PatternField #

Named field pattern ( p = Point 3 2 )

pattern FieldPunPattern :: Name -> PatternField #

Named field pun ( p )

pattern FieldWildcardPattern :: FieldWildcard -> PatternField #

Wildcard field pattern ( .. )

pattern NormalOp :: QualifiedName -> Operator #

A normal operator used as an operator.

pattern BacktickOp :: QualifiedName -> Operator #

A normal name used as an operator with backticks: a `mod` b

pattern NormalName :: QualifiedName -> Name #

A normal, non-operator name.

pattern ParenName :: QualifiedName -> Name #

Parenthesized name: foldl (+) 0

pattern ImplicitName :: QualifiedName -> Name #

Creates an implicit name: ?var

pattern StringNode :: String -> StringNode #

Program elements formatted as string literals (import packages, pragma texts)

pattern QualifiedName :: NamePartList -> NamePart -> QualifiedName #

Possibly qualified name.

pattern NamePart :: String -> NamePart #

Parts of a qualified name.

pattern Module :: FilePragmaList -> MaybeModuleHead -> ImportDeclList -> DeclList -> Module #

The representation of a haskell module, that is a separate compilation unit. It may or may not have a header.

pattern ModuleHead :: ModuleName -> MaybeModulePragma -> MaybeExportSpecs -> ModuleHead #

Module declaration with name and (optional) exports

pattern ExportSpecs :: ExportSpecList -> ExportSpecs #

A list of export specifications surrounded by parentheses

pattern ExportSpec :: IESpec -> ExportSpec #

Export a name and related names

pattern ModuleExport :: ModuleName -> ExportSpec #

The export of an imported module ( module A )

pattern IESpec :: MaybeImportModifier -> Name -> MaybeSubSpec -> IESpec #

Marks a name to be imported or exported with related names (subspecifier)

pattern SubAll :: SubSpec #

(..): a class exported with all of its methods, or a datatype exported with all of its constructors.

pattern SubList :: NameList -> SubSpec #

(a,b,c): a class exported with some of its methods, or a datatype exported with some of its constructors.

pattern LanguagePragma :: LanguageExtensionList -> FilePragma #

LANGUAGE pragma, listing the enabled language extensions in that file

pattern OptionsPragma :: String -> FilePragma #

OPTIONS pragma, possibly qualified with a tool, e.g. OPTIONS_GHC

pattern LanguageExtension :: String -> LanguageExtension #

The name of the enabled language extension, for example ( LambdaCase )

pattern ModuleWarningPragma :: StringNodeList -> ModulePragma #

A warning pragma attached to the module

pattern ModuleDeprecatedPragma :: StringNodeList -> ModulePragma #

A deprecated pragma attached to the module

pattern CharLit :: Char -> Literal #

Character literal: c

pattern StringLit :: String -> Literal #

String literal: "abc"

pattern IntLit :: Integer -> Literal #

Integer literal: 12

pattern FracLit :: Rational -> Literal #

Fractional literal: 3.14

pattern PrimIntLit :: Integer -> Literal #

Primitive integer literal (of type Int#): 32#

pattern PrimWordLit :: Integer -> Literal #

Primitive word literal (of type Word#): 32##

pattern PrimFloatLit :: Rational -> Literal #

Primitive float literal (of type Float#): 3.14#

pattern PrimDoubleLit :: Rational -> Literal #

Primitive double literal (of type Double#): 3.14##

pattern PrimCharLit :: Char -> Literal #

Primitive character literal (of type Char#): c#

pattern PrimStringLit :: String -> Literal #

Primitive string literal (of type Addr#): "xxx"#

pattern KindConstraint :: Kind -> KindConstraint #

Kind constraint ( :: * -> * )

pattern StarKind :: Kind #

*, the kind of types

pattern UnboxKind :: Kind #

#, the kind of unboxed types

pattern FunKind :: Kind -> Kind -> Kind #

->, the kind of type constructor

pattern ParenKind :: Kind -> Kind #

A parenthesised kind

pattern VarKind :: Name -> Kind #

Kind variable (using PolyKinds extension)

pattern AppKind :: Kind -> Kind -> Kind #

Kind application ( k1 k2 )

pattern ListKind :: Kind -> Kind #

A list kind ( [k] )

pattern IntKind :: Integer -> Kind #

Numeric value promoted to the kind level.

pattern StringKind :: String -> Kind #

String value promoted to the kind level.

pattern ConKind :: Name -> Kind #

A data constructor value promoted to the kind level.

pattern ListKindPromoted :: KindList -> Kind #

A list of elements as a kind.

pattern TupleKind :: KindList -> Kind #

A tuple of elements as a kind.

pattern UnitKind :: Kind #

Kind of the unit value ().

pattern TypeDecl :: DeclHead -> Type -> Decl #

A type synonym ( type String = [Char] )

pattern StandaloneDeriving :: Maybe DeriveStrategy -> Maybe OverlapPragma -> InstanceRule -> Decl #

Standalone deriving declaration ( deriving instance X T )

pattern FixityDecl :: FixitySignature -> Decl #

Fixity declaration ( infixl 5 +, - )

pattern DefaultDecl :: TypeList -> Decl #

Default types ( default (T1, T2) )

pattern TypeSigDecl :: TypeSignature -> Decl #

Type signature declaration ( f :: Int -> Int )

pattern ValueBinding :: ValueBind -> Decl #

Function or value binding ( f x = 12 )

pattern SpliceDecl :: Splice -> Decl #

A Template Haskell splice declaration ( $(generateDecls) )

pattern DataDecl :: DataOrNewtypeKeyword -> MaybeContext -> DeclHead -> ConDeclList -> DerivingList -> Decl #

A data or newtype declaration. Empty data type declarations without where keyword are always belong to DataDecl.

pattern GADTDataDecl :: DataOrNewtypeKeyword -> MaybeContext -> DeclHead -> MaybeKindConstraint -> AnnList UGadtConDecl -> DerivingList -> Decl #

A GADT-style data or newtype declaration.

pattern GadtConDecl :: NameList -> Type -> GadtConDecl #

GADT constructor declaration ( D1 :: Int -> T String )

pattern GadtRecordConDecl :: NameList -> FieldDeclList -> Type -> GadtConDecl #

GADT constructor declaration with record syntax ( D1 :: { val :: Int } -> T String )

pattern ConDecl :: Name -> TypeList -> ConDecl #

Ordinary data constructor ( C t1 t2 )

pattern RecordConDecl :: Name -> FieldDeclList -> ConDecl #

Creates a record data constructor ( Point { x :: Double, y :: Double } )

pattern InfixConDecl :: Type -> Operator -> Type -> ConDecl #

Infix data constructor ( t1 :+: t2 )

pattern FieldDecl :: NameList -> Type -> FieldDecl #

Field declaration ( fld :: Int )

pattern DerivingOne :: InstanceHead -> Deriving #

A deriving clause without parentheses ( deriving Show .

pattern DerivingOne' :: MaybeDeriveStrategy -> InstanceHead -> Deriving #

A deriving clause without parentheses, with/witohut strategy ( deriving stock Show .

pattern DerivingMulti :: InstanceHeadList -> Deriving #

A deriving clause with parentheses deriving (Show, Eq) )

pattern DerivingMulti' :: MaybeDeriveStrategy -> InstanceHeadList -> Deriving #

A deriving clause with parentheses, with/witohut strategy ( deriving stock (Show, Eq) .

pattern FunDeps :: FunDepList -> FunDeps #

A list of functional dependencies: | a -> b, c -> d separated by commas

pattern FunDep :: NameList -> NameList -> FunDep #

A functional dependency, given on the form l1 ... ln -> r1 ... rn

pattern ClassDecl :: MaybeContext -> DeclHead -> MaybeFunDeps -> MaybeClassBody -> Decl #

Type class declaration ( class X a [where f = ...] )

pattern ClassBody :: ClassElementList -> ClassBody #

The list of declarations that can appear in a typeclass

pattern ClassElemSig :: TypeSignature -> ClassElement #

Type signature: f :: A -> B as a class member

pattern ClassElemDef :: ValueBind -> ClassElement #

Default binding: f x = "aaa" as a class member

pattern ClassElemTypeFam :: DeclHead -> MaybeTypeFamilySpec -> ClassElement #

Declaration of an associated type synonym: type T x :: * in a class

pattern ClassElemDataFam :: DeclHead -> MaybeKindConstraint -> ClassElement #

Declaration of an associated data synonym: data T x :: * in a class

pattern ClsDefaultType :: DeclHead -> Type -> ClassElement #

Default choice for type synonym: type T x = TE or type instance T x = TE in a class

pattern ClsDefaultSig :: Name -> Type -> ClassElement #

Default signature (by using DefaultSignatures): default enum :: (Generic a, GEnum (Rep a)) => [a]

pattern ClsMinimal :: MinimalFormula -> ClassElement #

Minimal pragma: {-# MINIMAL (==) | (/=) #-} in a class

pattern MinimalOr :: MinimalFormulaList -> MinimalFormula #

One of the minimal formulas are needed ( min1 | min2 )

pattern MinimalAnd :: MinimalFormulaList -> MinimalFormula #

Both of the minimal formulas are needed ( min1 , min2 )

pattern NameDeclHead :: Name -> DeclHead #

Type or class name as a declaration head

pattern ParenDeclHead :: DeclHead -> DeclHead #

Parenthesized type as a declaration head

pattern DeclHeadApp :: DeclHead -> TyVar -> DeclHead #

Type application as a declaration head

pattern InfixDeclHead :: TyVar -> Operator -> TyVar -> DeclHead #

Infix type application as a declaration head

pattern InstanceDecl :: InstanceRule -> MaybeInstBody -> Decl #

Instance declaration ( instance X T [where f = ...] )

pattern InstanceBody :: InstBodyDeclList -> InstBody #

Instance body is the implementation of the class functions ( where a x = 1; b x = 2 )

pattern InstanceBind :: ValueBind -> InstBodyDecl #

A normal value binding ( f x = 12 ) inside a class instance

pattern InstanceTypeSig :: TypeSignature -> InstBodyDecl #

Type signature in instance definition with InstanceSigs

pattern InstanceTypeFamilyDef :: TypeEqn -> InstBodyDecl #

An associated type definition ( type A X = B ) in a class instance

pattern InstanceDataFamilyDef :: DataOrNewtypeKeyword -> InstanceRule -> ConDeclList -> DerivingList -> InstBodyDecl #

An associated data definition ( data A X = B Int | C ) in a class instance

pattern InstanceDataFamilyGADTDef :: DataOrNewtypeKeyword -> InstanceRule -> MaybeKindConstraint -> AnnList UGadtConDecl -> DerivingList -> InstBodyDecl #

An associated data definition as a GADT ( data A X where B :: Int -> A X ) in a class instance

pattern InstanceSpecializePragma :: Type -> InstBodyDecl #

Specialize instance pragma in a class instance (no phase selection is allowed)

pattern InstanceRule :: AnnMaybe (AnnListG UTyVar) -> MaybeContext -> InstanceHead -> InstanceRule #

Instance head as an instance rule ( X a => Y a )

pattern InstanceHead :: Name -> InstanceHead #

Type or class name as an instance head

pattern InfixInstanceHead :: Type -> Operator -> InstanceHead #

Infix application of the type/class name to the left operand as an instance head

pattern ParenInstanceHead :: InstanceHead -> InstanceHead #

Parenthesized instance head

pattern AppInstanceHead :: InstanceHead -> Type -> InstanceHead #

Type application as an instance head

pattern EnableOverlap :: OverlapPragma #

OVERLAP pragma

pattern DisableOverlap :: OverlapPragma #

NO_OVERLAP pragma

pattern Overlappable :: OverlapPragma #

OVERLAPPABLE pragma

pattern Overlapping :: OverlapPragma #

OVERLAPPING pragma

pattern Overlaps :: OverlapPragma #

OVERLAPS pragma

pattern IncoherentOverlap :: OverlapPragma #

INCOHERENT pragma

pattern RoleDecl :: QualifiedName -> RoleList -> Decl #

Role annotations ( type role Ptr representational )

pattern NominalRole :: Role #

pattern PhantomRole :: Role #

pattern ForeignImport :: CallConv -> MaybeSafety -> Name -> Type -> Decl #

Foreign import ( foreign import foo :: Int -> IO Int )

pattern ForeignExport :: CallConv -> Name -> Type -> Decl #

Foreign export ( foreign export ccall foo :: Int -> IO Int )

pattern StdCall :: CallConv #

Specifies stdcall calling convention for foreign import/export.

pattern CCall :: CallConv #

Specifies ccall calling convention for foreign import/export.

pattern CApi :: CallConv #

Specifies capi calling convention for foreign import/export.

pattern Unsafe :: Safety #

Specifies that the given foreign import is unsafe.

pattern PatternSynonym :: PatSynLhs -> PatSynRhs -> Decl #

Pattern synonyms ( pattern Arrow t1 t2 = App "->" [t1, t2] )

pattern ConPatSyn :: Name -> NameList -> PatSynLhs #

A left hand side with a constructor name and arguments ( Arrow t1 t2 )

pattern InfixPatSyn :: Name -> Operator -> Name -> PatSynLhs #

An infix pattern synonym left-hand side ( t1 :+: t2 )

pattern RecordPatSyn :: Name -> NameList -> PatSynLhs #

A record-style pattern synonym left-hand side ( Arrow { arrowFrom, arrowTo } )

pattern SymmetricPatSyn :: Pattern -> PatSynRhs #

An automatically two-way pattern synonym ( = App "Int" [] )

pattern OneWayPatSyn :: Pattern -> PatSynRhs #

A pattern synonym that can be only used for pattenr matching but not for combining ( <- App "Int" [] )

pattern TwoWayPatSyn :: Pattern -> MatchList -> PatSynRhs #

A pattern synonym with the other direction explicitly specified ( <- App "Int" [] where Int = App "Int" [] )

pattern PatternSignatureDecl :: PatternSignature -> Decl #

Pattern type signature declaration ( pattern Succ :: Int -> Int )

pattern TypeFamily :: DeclHead -> MaybeTypeFamilySpec -> Decl #

Type family declaration ( type family A a :: * -> * )

pattern DataFamily :: DeclHead -> MaybeKindConstraint -> Decl #

Data family declaration ( data family A a :: * -> * )

pattern TypeInstance :: InstanceRule -> Type -> Decl #

Type family instance declaration ( type instance Fam T = AssignedT )

pattern DataInstance :: DataOrNewtypeKeyword -> InstanceRule -> ConDeclList -> DerivingList -> Decl #

Data instance declaration ( data instance Fam T = Con1 | Con2 )

pattern GadtDataInstance :: DataOrNewtypeKeyword -> InstanceRule -> MaybeKindConstraint -> GadtConDeclList -> Decl #

GADT-style data instance declaration ( data instance Fam T where ... )

pattern ClosedTypeFamily :: DeclHead -> MaybeTypeFamilySpec -> TypeEqnList -> Decl #

A closed type family declaration

pattern TypeFamilyKindSpec :: KindConstraint -> TypeFamilySpec #

Specifies the kind of a type family ( :: * -> * )

pattern TypeFamilyInjectivitySpec :: TyVar -> NameList -> TypeFamilySpec #

Specifies the injectivity of a type family ( = r | r -> a )

pattern TypeEqn :: Type -> Type -> TypeEqn #

Type equations as found in closed type families ( T A = S )

pattern PragmaDecl :: TopLevelPragma -> Decl #

Top-level pragmas

pattern RulePragma :: RuleList -> TopLevelPragma #

A pragma that introduces source rewrite rules ( {-# RULES "map/map" [2] forall f g xs. map f (map g xs) = map (f.g) xs #-} )

pattern DeprPragma :: NameList -> String -> TopLevelPragma #

A pragma that marks definitions as deprecated ( {-# DEPRECATED f "f will be replaced by g" #-} )

pattern WarningPragma :: NameList -> String -> TopLevelPragma #

A pragma that marks definitions as deprecated ( {-# WARNING unsafePerformIO "you should know what you are doing" #-} )

pattern AnnPragma :: AnnotationSubject -> Expr -> TopLevelPragma #

A pragma that annotates a definition with an arbitrary value ( {-# ANN f 42 #-} )

pattern InlinePragma :: MaybeConlikeAnnot -> MaybePhaseControl -> Name -> TopLevelPragma #

A pragma that marks a function for inlining to the compiler ( {-# INLINE thenUs #-} )

pattern NoInlinePragma :: Name -> TopLevelPragma #

A pragma that forbids a function from being inlined by the compiler ( {-# NOINLINE f #-} )

pattern InlinablePragma :: MaybePhaseControl -> Name -> TopLevelPragma #

A pragma that marks a function that it may be inlined by the compiler ( {-# INLINABLE thenUs #-} )

pattern LinePragma :: Int -> MaybeStringNode -> TopLevelPragma #

A pragma for maintaining line numbers in generated sources ( {-# LINE 123 "somefile" #-} )

pattern SpecializePragma :: MaybePhaseControl -> Name -> TypeList -> TopLevelPragma #

A pragma that tells the compiler that a polymorph function should be optimized for a given type ( {-# SPECIALISE f :: Int -> b -> b #-} )

pattern PhaseControlFrom :: Integer -> PhaseControl #

Marks that the pragma should be applied from a given compile phase ( [2] )

pattern PhaseControlUntil :: Integer -> PhaseControl #

Marks that the pragma should be applied until a given compile phase ( [~2] )

pattern RewriteRule :: String -> MaybePhaseControl -> RuleVarList -> Expr -> Expr -> Rule #

A rewrite rule ( "map/map" forall f g xs. map f (map g xs) = map (f.g) xs )

pattern NameAnnotation :: Name -> AnnotationSubject #

The definition with the given name is annotated

pattern TypeAnnotation :: Name -> AnnotationSubject #

A type with the given name is annotated

pattern ModuleAnnotation :: AnnotationSubject #

The whole module is annotated

pattern ConlikeAnnotation :: ConlikeAnnot #

A CONLIKE modifier for an INLINE pragma.

pattern SimpleBind :: Pattern -> Rhs -> MaybeLocalBinds -> ValueBind #

Non-function binding ( v = "12" )

pattern FunctionBind :: MatchList -> ValueBind #

Function binding ( f 0 = 1; f x = x ). All matches must have the same name.

pattern Match :: MatchLhs -> Rhs -> MaybeLocalBinds -> Match #

Clause of function binding

pattern MatchLhs :: Name -> PatternList -> MatchLhs #

A match lhs with the function name and parameter names ( f a b )

pattern InfixLhs :: Pattern -> Operator -> Pattern -> PatternList -> MatchLhs #

An infix match lhs for an operator ( a + b )

pattern LocalBinds :: LocalBindList -> LocalBinds #

Local bindings attached to a declaration ( where x = 42 )

pattern LocalValBind :: ValueBind -> LocalBind #

A local binding for a value

pattern LocalTypeSig :: TypeSignature -> LocalBind #

A local type signature

pattern LocalFixity :: FixitySignature -> LocalBind #

A local fixity declaration

pattern TypeSignature :: NameList -> Type -> TypeSignature #

A type signature ( f :: Int -> Int )

pattern InfixL :: OperatorList -> FixitySignature #

A left-associative fixity declaration ( infixl 5 +, - ).

pattern InfixR :: OperatorList -> FixitySignature #

A right-associative fixity declaration ( infixr 5 +, - ).

pattern Infix :: OperatorList -> FixitySignature #

A non-associative fixity declaration ( infix 5 +, - ).

pattern UnguardedRhs :: Expr -> Rhs #

An unguarded right-hand-side ( = 3 )

pattern GuardedRhss :: GuardedRhsList -> Rhs #

An unguarded right-hand-side ( | x == 1 = 3; | otherwise = 4 )

pattern GuardedRhs :: RhsGuardList -> Expr -> GuardedRhs #

A guarded right-hand side of a value binding ( | x > 3 = 2 )

pattern GuardBind :: Pattern -> Expr -> RhsGuard #

A bind statement in a pattern guard ( Just v <- x )

pattern GuardLet :: LocalBindList -> RhsGuard #

A let statement in a pattern guard ( let x = 3 )

pattern GuardCheck :: Expr -> RhsGuard #

An expression to check for a pattern guard

mkGuardCheck :: Expr -> RhsGuard #

Creates an expression to check for a pattern guard

mkGuardLet :: [LocalBind] -> RhsGuard #

Creates a let statement in a pattern guard ( let x = 3 )

mkGuardBind :: Pattern -> Expr -> RhsGuard #

Creates a bind statement in a pattern guard ( Just v <- x )

mkGuardedRhs :: [RhsGuard] -> Expr -> GuardedRhs #

Creates a guarded right-hand side of a value binding ( | x > 3 = 2 )

mkGuardedRhss :: [GuardedRhs] -> Rhs #

Creates an unguarded right-hand-side ( | x == 1 = 3; | otherwise = 4 )

mkUnguardedRhs :: Expr -> Rhs #

Creates an unguarded right-hand-side ( = 3 )

mkInfix :: Int -> Operator -> FixitySignature #

Creates a non-associative fixity declaration ( infix 5 +, - ).

mkInfixR :: Int -> Operator -> FixitySignature #

Creates a right-associative fixity declaration ( infixr 5 +, - ).

mkInfixL :: Int -> Operator -> FixitySignature #

Creates a left-associative fixity declaration ( infixl 5 +, - ).

mkTypeSignature :: Name -> Type -> TypeSignature #

Creates a type signature ( f :: Int -> Int )

mkLocalFixity :: FixitySignature -> LocalBind #

Creates a local fixity declaration

mkLocalTypeSig :: TypeSignature -> LocalBind #

Creates a local type signature

mkLocalValBind :: ValueBind -> LocalBind #

Creates a local binding for a value

mkLocalBinds :: [LocalBind] -> MaybeLocalBinds #

Local bindings attached to a declaration ( where x = 42 )

mkInfixLhs :: Pattern -> Operator -> Pattern -> [Pattern] -> MatchLhs #

Creates an infix match lhs for an operator ( a + b )

mkMatchLhs :: Name -> [Pattern] -> MatchLhs #

Creates a match lhs with the function name and parameter names ( f a b )

mkMatch :: MatchLhs -> Rhs -> Maybe LocalBinds -> Match #

Creates a clause of function binding

mkFunctionBind' :: Name -> [([Pattern], Expr)] -> ValueBind #

A simplified function for creating function bindings without local definitions or guards.

mkFunctionBind :: [Match] -> ValueBind #

Creates a function binding ( f 0 = 1; f x = x ). All matches must have the same name.

mkSimpleBind :: Pattern -> Rhs -> Maybe LocalBinds -> ValueBind #

Creates a value binding ( v = "12" ).

mkSimpleBind' :: Name -> Expr -> ValueBind #

A simplified function to generate simple value bindings without local definitions, guards or complex lhs.

mkConlikeAnnotation :: ConlikeAnnot #

A CONLIKE modifier for an INLINE pragma.

mkModuleAnnotation :: AnnotationSubject #

The whole module is annotated

mkTypeAnnotation :: Name -> AnnotationSubject #

A type with the given name is annotated

mkNameAnnotation :: Name -> AnnotationSubject #

The definition with the given name is annotated

mkRewriteRule :: String -> Maybe PhaseControl -> [RuleVar] -> Expr -> Expr -> Rule #

A rewrite rule ( "map/map" forall f g xs. map f (map g xs) = map (f.g) xs )

mkPhaseControlUntil :: Integer -> PhaseControl #

Marks that the pragma should be applied until a given compile phase ( [~2] )

mkPhaseControlFrom :: Integer -> PhaseControl #

Marks that the pragma should be applied from a given compile phase ( [2] )

mkSpecializePragma :: Maybe PhaseControl -> Name -> [Type] -> TopLevelPragma #

A pragma that tells the compiler that a polymorph function should be optimized for a given type ( {-# SPECIALISE f :: Int -> b -> b #-} )

mkLinePragma :: Int -> Maybe StringNode -> TopLevelPragma #

A pragma for maintaining line numbers in generated sources ( {-# LINE 123 "somefile" #-} )

mkInlinablePragma :: Maybe PhaseControl -> Name -> TopLevelPragma #

A pragma that marks a function that it may be inlined by the compiler ( {-# INLINABLE thenUs #-} )

mkNoInlinePragma :: Name -> TopLevelPragma #

A pragma that forbids a function from being inlined by the compiler ( {-# NOINLINE f #-} )

mkInlinePragma :: Maybe ConlikeAnnot -> Maybe PhaseControl -> Name -> TopLevelPragma #

A pragma that marks a function for inlining to the compiler ( {-# INLINE thenUs #-} )

mkAnnPragma :: AnnotationSubject -> Expr -> TopLevelPragma #

A pragma that annotates a definition with an arbitrary value ( {-# ANN f 42 #-} )

mkWarningPragma :: [Name] -> String -> TopLevelPragma #

A pragma that marks definitions as deprecated ( {-# WARNING unsafePerformIO "you should know what you are doing" #-} )

mkDeprPragma :: [Name] -> String -> TopLevelPragma #

A pragma that marks definitions as deprecated ( {-# DEPRECATED f "f will be replaced by g" #-} )

mkRulePragma :: [Rule] -> TopLevelPragma #

A pragma that introduces source rewrite rules ( {-# RULES "map/map" [2] forall f g xs. map f (map g xs) = map (f.g) xs #-} )

mkPragmaDecl :: TopLevelPragma -> Decl #

Creates a top-level pragmas

mkPatternSignatureDecl :: PatternSignature -> Decl #

Creates a pattern type signature declaration ( pattern Succ :: Int -> Int )

mkTwoWayPatSyn :: Pattern -> [Match] -> PatSynRhs #

Creates a pattern synonym with the other direction explicitly specified ( <- App "Int" [] where Int = App "Int" [] )

mkOneWayPatSyn :: Pattern -> PatSynRhs #

Creates a pattern synonym that can be only used for pattenr matching but not for combining ( <- App "Int" [] )

mkSymmetricPatSyn :: Pattern -> PatSynRhs #

Creates an automatically two-way pattern synonym ( = App "Int" [] )

mkRecordPatSyn :: Name -> [Name] -> PatSynLhs #

Creates a record-style pattern synonym left-hand side ( Arrow { arrowFrom, arrowTo } )

mkInfixPatSyn :: Name -> Operator -> Name -> PatSynLhs #

Creates an infix pattern synonym left-hand side ( t1 :+: t2 )

mkConPatSyn :: Name -> [Name] -> PatSynLhs #

Creates a left hand side of a pattern synonym with a constructor name and arguments ( Arrow t1 t2 )

mkPatternSynonym :: PatSynLhs -> PatSynRhs -> Decl #

Creates a pattern synonym ( pattern Arrow t1 t2 = App "->" [t1, t2] )

mkGadtDataInstance :: DataOrNewtypeKeyword -> InstanceRule -> Maybe KindConstraint -> [GadtConDecl] -> Decl #

Creates a GADT-style data instance declaration ( data instance Fam T where ... )

mkDataInstance :: DataOrNewtypeKeyword -> InstanceRule -> [ConDecl] -> [Deriving] -> Decl #

Creates a data instance declaration ( data instance Fam T = Con1 | Con2 )

mkTypeInstance :: InstanceRule -> Type -> Decl #

Creates a type family instance declaration ( type instance Fam T = AssignedT )

mkTypeEqn :: Type -> Type -> TypeEqn #

Type equations as found in closed type families ( T A = S )

mkTypeFamilyInjectivitySpec :: TyVar -> [Name] -> TypeFamilySpec #

Specifies the injectivity of a type family ( = r | r -> a )

mkTypeFamilyKindSpec :: KindConstraint -> TypeFamilySpec #

Specifies the kind of a type family ( :: * -> * )

mkDataFamily :: DeclHead -> Maybe KindConstraint -> Decl #

Creates a data family declaration ( data family A a :: * -> * )

mkClosedTypeFamily :: DeclHead -> Maybe TypeFamilySpec -> [TypeEqn] -> Decl #

Creates a closed type family declaration ( type family F x where F Int = (); F a = Int )

mkTypeFamily :: DeclHead -> Maybe TypeFamilySpec -> Decl #

Creates a type family declaration ( type family F x )

mkUnsafe :: Safety #

Specifies that the given foreign import is unsafe.

mkCApi :: CallConv #

Specifies capi calling convention for foreign import/export.

mkCCall :: CallConv #

Specifies ccall calling convention for foreign import/export.

mkStdCall :: CallConv #

Specifies stdcall calling convention for foreign import/export.

mkForeignExport :: CallConv -> Name -> Type -> Decl #

Creates a foreign export ( foreign export ccall foo :: Int -> IO Int )

mkForeignImport :: CallConv -> Maybe Safety -> Name -> Type -> Decl #

Creates a foreign import ( foreign import foo :: Int -> IO Int )

mkPhantomRole :: Role #

Marks a given type parameter as phantom.

mkRepresentationalRole :: Role #

Marks a given type parameter as representational.

mkNominalRole :: Role #

Marks a given type parameter as nominal.

mkRoleDecl :: QualifiedName -> [Role] -> Decl #

Creates a role annotations ( type role Ptr representational )

mkIncoherentOverlap :: OverlapPragma #

INCOHERENT pragma for type instance definitions

mkOverlaps :: OverlapPragma #

OVERLAPS pragma for type instance definitions

mkOverlapping :: OverlapPragma #

OVERLAPPING pragma for type instance definitions

mkOverlappable :: OverlapPragma #

OVERLAPPABLE pragma for type instance definitions

mkDisableOverlap :: OverlapPragma #

NO_OVERLAP pragma for type instance definitions

mkEnableOverlap :: OverlapPragma #

OVERLAP pragma for type instance definitions

mkInstanceSpecializePragma :: Type -> InstBodyDecl #

Specialize instance pragma (no phase selection is allowed) in a type class instance

mkInstanceDataFamilyGADTDef :: DataOrNewtypeKeyword -> InstanceRule -> Maybe KindConstraint -> [GadtConDecl] -> [Deriving] -> InstBodyDecl #

An associated data type implemented using GADT style int a type class instance

mkInstanceDataFamilyDef :: DataOrNewtypeKeyword -> InstanceRule -> [ConDecl] -> [Deriving] -> InstBodyDecl #

An associated data type implementation ( data A X = C1 | C2 ) int a type class instance

mkInstanceTypeFamilyDef :: TypeEqn -> InstBodyDecl #

An associated type definition ( type A X = B ) in a type class instance

mkInstanceTypeSig :: TypeSignature -> InstBodyDecl #

Type signature in instance definition with InstanceSigs

mkInstanceBind :: ValueBind -> InstBodyDecl #

A normal declaration ( f x = 12 ) in a type class instance

mkInstanceBody :: [InstBodyDecl] -> InstBody #

Instance body is the implementation of the class functions ( where a x = 1; b x = 2 )

mkAppInstanceHead :: InstanceHead -> Type -> InstanceHead #

Application to one more type as a part of the instance declaration

mkParenInstanceHead :: InstanceHead -> InstanceHead #

Parenthesized instance head as a part of the instance declaration

mkInfixInstanceHead :: Type -> Operator -> InstanceHead #

Infix application of the type/class name to the left operand as a part of the instance declaration

mkInstanceHead :: Name -> InstanceHead #

Type or class name as a part of the instance declaration

mkInstanceRule :: Maybe Context -> InstanceHead -> InstanceRule #

The instance declaration rule, which is, roughly, the part of the instance declaration before the where keyword.

mkInstanceDecl :: Maybe OverlapPragma -> InstanceRule -> Maybe InstBody -> Decl #

Creates a type class instance declaration ( instance X T [where f = ...] )

mkInfixDeclHead :: TyVar -> Operator -> TyVar -> DeclHead #

Infix application of the type/class name to the left operand in a declaration head

mkDeclHeadApp :: DeclHead -> TyVar -> DeclHead #

Application in a declaration head

mkParenDeclHead :: DeclHead -> DeclHead #

Parenthesized type as a declaration head

mkNameDeclHead :: Name -> DeclHead #

Type or class name as a declaration head

mkMinimalAnd :: [MinimalFormula] -> MinimalFormula #

Both of the minimal formulas are needed ( min1 , min2 )

mkMinimalOr :: [MinimalFormula] -> MinimalFormula #

One of the minimal formulas are needed ( min1 | min2 )

mkClsMinimal :: MinimalFormula -> ClassElement #

Minimal pragma: {-# MINIMAL (==) | (/=) #-} in a class

mkFunDep :: [Name] -> [Name] -> FunDep #

Creates a functional dependency, given on the form l1 ... ln -> r1 ... rn

mkClsDefaultSig :: Name -> Type -> ClassElement #

Creates a default signature (by using DefaultSignatures) in class: default enum :: (Generic a, GEnum (Rep a)) => [a]

mkClsDefaultType :: DeclHead -> Type -> ClassElement #

Creates a default choice for type synonym in class: type T x = TE or type instance T x = TE

mkClassElemDataFam :: DeclHead -> Maybe KindConstraint -> ClassElement #

Creates an associated data synonym in class: data T y :: *

mkClassElemTypeFam :: DeclHead -> Maybe TypeFamilySpec -> ClassElement #

Creates an associated type synonym in class: type T y :: *

mkClassElemDef :: ValueBind -> ClassElement #

Creates a default binding as class element: f x = "aaa"

mkClassElemSig :: TypeSignature -> ClassElement #

Creates a type signature as class element: f :: A -> B

mkClassBody :: [ClassElement] -> ClassBody #

Creates the list of declarations that can appear in a typeclass

mkClassDecl :: Maybe Context -> DeclHead -> [FunDep] -> Maybe ClassBody -> Decl #

Creates a type class declaration ( class X a where f = ... )

mkNewtypeKeyword :: DataOrNewtypeKeyword #

The newtype keyword in a type definition

mkDataKeyword :: DataOrNewtypeKeyword #

The data keyword in a type definition

mkDeriving :: [InstanceHead] -> Deriving #

Creates a deriving clause following a data type declaration. ( deriving Show or deriving (Show, Eq) )

mkFieldDecl :: [Name] -> Type -> FieldDecl #

Creates a field declaration ( fld :: Int ) for a constructor

mkInfixConDecl :: Type -> Operator -> Type -> ConDecl #

Creates an infix data constructor ( t1 :+: t2 )

mkRecordConDecl :: Name -> [FieldDecl] -> ConDecl #

Creates a record data constructor ( Point { x :: Double, y :: Double } )

mkConDecl :: Name -> [Type] -> ConDecl #

Creates an ordinary data constructor ( C t1 t2 )

mkGadtRecordConDecl :: [Name] -> [FieldDecl] -> Type -> GadtConDecl #

Creates a GADT constructor declaration with record syntax ( D1 :: { val :: Int } -> T String )

mkGadtConDecl :: [Name] -> Type -> GadtConDecl #

Creates a GADT constructor declaration ( D1 :: Int -> T String )

mkGADTDataDecl :: DataOrNewtypeKeyword -> Maybe Context -> DeclHead -> Maybe KindConstraint -> [GadtConDecl] -> [Deriving] -> Decl #

Creates a GADT-style data or newtype declaration.

mkDataDecl :: DataOrNewtypeKeyword -> Maybe Context -> DeclHead -> [ConDecl] -> [Deriving] -> Decl #

Creates a data or newtype declaration.

mkSpliceDecl :: Splice -> Decl #

Creates a Template Haskell splice declaration ( $(generateDecls) )

mkValueBinding :: ValueBind -> Decl #

Creates a function or value binding ( f x = 12 )

mkTypeSigDecl :: TypeSignature -> Decl #

Creates type signature declaration ( f :: Int -> Int )

mkDefaultDecl :: [Type] -> Decl #

Creates default types ( default (T1, T2) )

mkFixityDecl :: FixitySignature -> Decl #

Creates a fixity declaration ( infixl 5 +, - )

mkStandaloneDeriving :: Maybe DeriveStrategy -> Maybe OverlapPragma -> InstanceRule -> Decl #

Creates a standalone deriving declaration ( deriving instance X T )

mkTypeDecl :: DeclHead -> Type -> Decl #

Creates a type synonym ( type String = [Char] )

mkHole :: Expr #

A hole expression _

mkRightHighAppl :: ArrowApp #

Right arrow high application: >>-

mkLeftHighAppl :: ArrowApp #

Left arrow high application: -<<

mkRightAppl :: ArrowApp #

Right arrow application: >-

mkLeftAppl :: ArrowApp #

Left arrow application: -<

mkDoCmd :: [CmdStmt] -> Cmd #

A do-notation in a command

mkLetCmd :: [LocalBind] -> Cmd -> Cmd #

A local binding command ( let z = x+y )

mkIfCmd :: Expr -> Cmd -> Cmd -> Cmd #

An if command ( if f x y then g -< x+1 else h -< y+2 )

mkCaseCmd :: Expr -> [CmdAlt] -> Cmd #

A pattern match command

mkParenCmd :: Cmd -> Cmd #

A parenthesized command

mkLambdaCmd :: [Pattern] -> Cmd -> Cmd #

A lambda command

mkInfixCmd :: Cmd -> Name -> Cmd -> Cmd #

An infix command application

mkAppCmd :: Cmd -> Expr -> Cmd #

A function application command

mkArrowFromCmd :: Expr -> [Cmd] -> Cmd #

A form command ( (|untilA (increment -< x+y) (within 0.5 -< x)|) )

mkArrowAppCmd :: Expr -> ArrowApp -> Expr -> Cmd #

An arrow application command ( f -< x + 1 )

mkSourceRange :: String -> Integer -> Integer -> Integer -> Integer -> SourceRange #

Create a in-AST source ranges (for generated pragmas)

mkGeneratedPragma :: SourceRange -> ExprPragma #

Creates a pragma that describes if an expression was generated from a code fragment by an external tool ( {-# GENERATED "Happy.y" 1:15-1:25 #-} )

mkSccPragma :: String -> ExprPragma #

Creates an SCC pragma for defining cost centers for profiling

mkCorePragma :: String -> ExprPragma #

Creates a CORE pragma for adding notes to expressions.

mkGuardedCaseRhs :: [RhsGuard] -> Expr -> GuardedCaseRhs #

Creates a guarded right-hand side of pattern matches binding ( | x > 3 -> 2 )

mkGuardedCaseRhss :: [GuardedCaseRhs] -> CaseRhs #

Create a guarded right-hand sides of a pattern match ( | x == 1 -> 3; | otherwise -> 4 )

mkCaseRhs :: Expr -> CaseRhs #

Create a unguarded right-hand side a pattern match ( -> 3 )

mkAlt :: Pattern -> CaseRhs -> Maybe LocalBinds -> Alt #

Create a clause of case expression ( Just x -> x + 1 )

mkFieldWildcard :: FieldUpdate #

Create a update the fields of the bounded names to their values ( .. ). Must be the last initializer. Cannot be used in a record update expression.

mkFieldPun :: Name -> FieldUpdate #

Create a update the field to the value of the same name ( x )

mkFieldUpdate :: Name -> Expr -> FieldUpdate #

Create a update of a field ( x = 1 )

mkStaticPointer :: Expr -> Expr #

Create a static pointer expression ( static e ). The inner expression must be closed (cannot have variables bound outside)

mkLambdaCase :: [Alt] -> Expr #

Create a lambda case ( case 0 -> 1; 1 -> 2 )

mkArrowApp :: Expr -> ArrowApp -> Expr -> Expr #

Create a arrow definition: proc a -> f -< a+1

mkProcExpr :: Pattern -> Cmd -> Expr #

Create a arrow definition: proc a -> f -< a+1

mkExprPragma :: ExprPragma -> Expr -> Expr #

Creates a pragma that marks an expression.

mkQuasiQuoteExpr :: QuasiQuote -> Expr #

Create a template haskell quasi quote expression, for example: [quoter| a + b ]

mkSpliceExpr :: Splice -> Expr #

Create a template haskell splice expression, for example: $(gen a) or $x

mkBracketExpr :: Bracket -> Expr #

Create a template haskell bracket expression

mkTypeQuote :: Name -> Expr #

''T for template haskell reifying of types

mkVarQuote :: Name -> Expr #

'x for template haskell reifying of expressions

mkExplicitTypeApp :: Expr -> Type -> Expr #

Create a explicit type application ( show @Integer (read "5") )

mkExprTypeSig :: Expr -> Type -> Expr #

Create a explicit type signature ( x :: Int )

mkParArrayComp :: Expr -> [ListCompBody] -> Expr #

Create a parallel array comprehensions [: (x, y) | x <- xs , y <- ys :] enabled by ParallelArrays

mkListComp :: Expr -> [ListCompBody] -> Expr #

Create a list comprehension ( [ (x, y) | x <- xs | y <- ys ] )

mkParArrayEnum :: Expr -> Maybe Expr -> Expr -> Expr #

Create a parallel array enumeration ( [: 1,3 .. 10 :] )

mkEnum :: Expr -> Maybe Expr -> Maybe Expr -> Expr #

Create a enumeration expression ( [1,3..10] )

mkRecUpdate :: Expr -> [FieldUpdate] -> Expr #

Create a record value update: p1 { x = 3, y = -2 }

mkRecCon :: Name -> [FieldUpdate] -> Expr #

Create a record value construction: Point { x = 3, y = -2 }

mkRightSection :: Operator -> Expr -> Expr #

Create a right operator section: (+1)

mkLeftSection :: Expr -> Operator -> Expr #

Create a left operator section: (1+)

mkParen :: Expr -> Expr #

Create a parenthesized expression: ( a + b )

mkParArray :: [Expr] -> Expr #

Create a parallel array expression: [: 1,2,3 :]

mkList :: [Expr] -> Expr #

Create a list expression: [1,2,3]

mkTupleUnboxedSection :: [Maybe Expr] -> Expr #

Create a unboxed tuple section, enabled with TupleSections ( (#a,,b#) ). One of the elements must be missing.

mkTupleSection :: [Maybe Expr] -> Expr #

Create a tuple section, enabled with TupleSections ( (a,,b) ). One of the elements must be missing.

mkUnboxedTuple :: [Expr] -> Expr #

Create a unboxed tuple expression ( (# e1, e2, e3 #) )

mkTuple :: [Expr] -> Expr #

Create a tuple expression ( (e1, e2, e3) )

mkMDoBlock :: [Stmt] -> Expr #

Create a mdo-notation expressions ( mdo x <- act1; act2 )

mkDoBlock :: [Stmt] -> Expr #

Create a do-notation expressions ( do x <- act1; act2 )

mkCase :: Expr -> [Alt] -> Expr #

Create a pattern matching expression ( case expr of pat1 -> expr1; pat2 -> expr2 )

mkMultiIf :: [GuardedCaseRhs] -> Expr #

Create a multi way if expressions with MultiWayIf extension ( if | guard1 -> expr1; guard2 -> expr2 )

mkIf :: Expr -> Expr -> Expr -> Expr #

Create a if expression ( if a then b else c )

mkLet :: [LocalBind] -> Expr -> Expr #

Create a local binding ( let x = 2; y = 3 in e x y )

mkLambda :: [Pattern] -> Expr -> Expr #

Create a lambda expression ( \a b -> a + b )

mkApp :: Expr -> Expr -> Expr #

Create a function application expression ( f 4 )

mkPrefixApp :: Operator -> Expr -> Expr #

Create a prefix operator application expression ( -x )

mkInfixApp :: Expr -> Operator -> Expr -> Expr #

Create a infix operator application expression ( a + b )

mkLit :: Literal -> Expr #

Create a literal expression ( 42 )

mkVar :: Name -> Expr #

Create a expression for a variable or a data constructor ( a )

mkTupleAssertion :: [Assertion] -> Assertion #

Creates a list of assertions ( (Eq a, Show a) )

mkImplicitAssert :: Name -> Type -> Assertion #

Creates an assertion for implicit parameter binding ( ?cmp :: a -> a -> Bool )

mkInfixAssert :: Type -> Operator -> Type -> Assertion #

Infix class assertion, also contains type equations ( a ~ X y )

mkClassAssert :: Name -> [Type] -> Assertion #

Class assertion (Cls x)

mkContext :: Assertion -> Context #

Creates a context of assertions ( C a => ... )

mkPromotedUnitType :: Type #

Kind of the unit value ().

mkPromotedTupleType :: [Type] -> Type #

A tuple of elements as a kind.

mkPromotedListType :: [Type] -> Type #

A list of elements as a kind.

mkPromotedConType :: Name -> Type #

A data constructor value promoted to the kind level.

mkPromotedStringType :: String -> Type #

String value promoted to the kind level.

mkPromotedIntType :: Integer -> Type #

Numeric value promoted to the kind level.

mkQuasiQuoteType :: QuasiQuote -> Type #

A Template Haskell quasi-quote type ( [quoter| ... ] ).

mkSpliceType :: Splice -> Type #

A Template Haskell splice type ( $(genType) ).

mkNamedWildcardType :: Name -> Type #

A named wildcard type ( _t ) with -XPartialTypeSignatures

mkWildcardType :: Type #

A wildcard type ( _ ) with -XPartialTypeSignatures

mkNoUnpackType :: Type -> Type #

Strict type marked with UNPACK pragma. (Usually contains the bang mark.)

mkUnpackType :: Type -> Type #

Strict type marked with UNPACK pragma. (Usually contains the bang mark.)

mkLazyType :: Type -> Type #

Lazy type marked with ~. (Should only be used if Strict or StrictData language extension is used)

mkBangType :: Type -> Type #

Strict type marked with !.

mkKindedType :: Type -> Kind -> Type #

Type with explicit kind signature ( a :: * )

mkVarType :: Name -> Type #

Type variable or constructor ( a )

mkKindedTypeVar :: Name -> Kind -> TyVar #

Creates a type variable with kind specification ( t :: * )

mkTypeVar :: Name -> TyVar #

Creates a simple type variable

mkParenType :: Type -> Type #

Type surrounded by parentheses ( (T a) )

mkInfixTypeApp :: Type -> Operator -> Type -> Type #

Infix type constructor ( (a <: b) )

mkTypeApp :: Type -> Type -> Type #

Type application ( F a )

mkParArrayType :: Type -> Type #

Parallel array type ( [:a:] )

mkListType :: Type -> Type #

List type with special syntax ( [a] )

mkUnboxedTupleType :: [Type] -> Type #

Unboxed tuple types ( (#a,b#) )

mkTupleType :: [Type] -> Type #

Tuple types ( (a,b) )

mkFunctionType :: Type -> Type -> Type #

Function types ( a -> b )

mkCtxType :: Context -> Type -> Type #

Type with a context ( forall x y . type )

mkTypeVar' :: Name -> TyVar #

Simplified creation of type variables

mkForallType :: [TyVar] -> Type -> Type #

Forall types ( forall x y . type )

mkUnitKind :: Kind #

Kind of the unit value ().

mkTupleKind :: [Kind] -> Kind #

A tuple of elements as a kind.

mkListKind :: [Kind] -> Kind #

A list of elements as a kind.

mkConKind :: Name -> Kind #

A data constructor value promoted to the kind level.

mkStringKind :: String -> Kind #

String value promoted to the kind level.

mkIntKind :: Integer -> Kind #

Numeric value promoted to the kind level.

mkKindList :: Kind -> Kind #

A list kind ( [k] )

mkKindApp :: Kind -> Kind -> Kind #

Kind application ( k1 k2 )

mkKindVar :: Name -> Kind #

Kind variable (using PolyKinds extension)

mkKindParen :: Kind -> Kind #

A parenthesised kind

mkKindFun :: Kind -> Kind -> Kind #

->, the kind of type constructor

mkKindUnbox :: Kind #

#, the kind of unboxed types

mkKindStar :: Kind #

*, the kind of types

mkKindConstraint :: Kind -> KindConstraint #

Kind constraint ( :: * -> * )

mkPrimStringLit :: String -> Literal #

Primitive string literal (of type Addr#): "xxx"#

mkPrimCharLit :: Char -> Literal #

Primitive character literal (of type Char#): c#

mkPrimDoubleLit :: Rational -> Literal #

Primitive double literal (of type Double#): 3.14##

mkPrimFloatLit :: Rational -> Literal #

Primitive float literal (of type Float#): 3.14#

mkPrimWordLit :: Integer -> Literal #

Primitive word literal (of type Word#): 32##

mkPrimIntLit :: Integer -> Literal #

Primitive integer literal (of type Int#): 32#

mkFracLit :: Rational -> Literal #

Fractional literal: 3.14

mkIntLit :: Integer -> Literal #

Integer literal: 12

mkStringLit :: String -> Literal #

String literal: "abc"

mkCharLit :: Char -> Literal #

Character literal: c

mkModuleDeprecatedPragma :: [String] -> ModulePragma #

A deprecated pragma attached to the module

mkModuleWarningPragma :: [String] -> ModulePragma #

A warning pragma attached to the module

mkOptionsGHC :: String -> FilePragma #

OPTIONS pragma, possibly qualified with a tool, e.g. OPTIONS_GHC

mkLanguagePragma :: [String] -> FilePragma #

LANGUAGE pragma, listing the enabled language extensions in that file

mkModuleName :: String -> ModuleName #

The name of a module

mkImportHidingList :: [IESpec] -> ImportSpec #

Restrict the import definition to DONT import the listed names

mkImportSpecList :: [IESpec] -> ImportSpec #

Restrict the import definition to ONLY import the listed names

mkImportDecl :: Bool -> Bool -> Bool -> Maybe String -> ModuleName -> Maybe ModuleName -> Maybe ImportSpec -> ImportDecl #

An import declaration: import Module.Name

mkSubAll :: SubSpec #

(..): a class exported with all of its methods, or a datatype exported with all of its constructors.

mkSubList :: [Name] -> SubSpec #

(a,b,c): a class exported with some of its methods, or a datatype exported with some of its constructors.

mkPatternIESpec :: Name -> IESpec #

Marks a pattern synonym to be imported or exported

mkIESpec :: Name -> Maybe SubSpec -> IESpec #

Marks a name to be imported or exported with related names (subspecifier)

mkModuleExport :: ModuleName -> ExportSpec #

The export of an imported module ( module A )

mkExportSpec :: IESpec -> ExportSpec #

Export a name and related names

mkExportSpecs :: [ExportSpec] -> ExportSpecs #

A list of export specifications surrounded by parentheses

mkModuleHead :: ModuleName -> Maybe ModulePragma -> Maybe ExportSpecs -> ModuleHead #

Module declaration with name and (optional) exports

mkModule :: [FilePragma] -> Maybe ModuleHead -> [ImportDecl] -> [Decl] -> Module #

The representation of a haskell module, that is a separate compilation unit. It may or may not have a header.

mkStringNode :: String -> StringNode #

Creates a quoted text

mkSimpleName :: String -> QualifiedName #

Creates a simple (unqualified) name

mkSimpleName' :: Name -> QualifiedName #

Creates a simple (unqualified) name

mkNamePart :: String -> NamePart #

Creates a part of a qualified name.

mkQualifiedName' :: [String] -> Name -> QualifiedName #

Creates an annotated qualified simple name

mkImplicitName :: QualifiedName -> Name #

Creates an implicit name: ?var

mkParenName :: QualifiedName -> Name #

Creates a parenthesized name: foldl (+) 0

mkUnqualName' :: Name -> Name #

Creates an annotated unqualified (non-operator) binding name: f or (+)

mkQualName' :: [String] -> Name -> Name #

Creates an annotated qualified (non-operator) binding name: A.B.f or (A.B.+)

mkUnqualOp' :: Name -> Operator #

Creates an annotated unqualified operator: + or `mod`.

mkQualOp' :: [String] -> Name -> Operator #

Creates an annotated qualified operator: A.B.+ or `A.B.mod`.

mkName :: String -> Name #

Creates a simple, unqualified name

mkFieldWildcardPattern :: PatternField #

Wildcard field pattern ( .. )

mkFieldPunPattern :: Name -> PatternField #

Named field pun ( p )

mkPatternField :: Name -> Pattern -> PatternField #

Named field pattern ( p = Point 3 2 )

mkQuasiQuotePat :: QuasiQuote -> Pattern #

Quasi-quoted patterns: [| 1 + 2 |]

mkSplicePat :: Splice -> Pattern #

Splice patterns: $(generateX inp)

mkViewPat :: Expr -> Pattern -> Pattern #

View pattern ( f -> Just 1 )

mkTypeSigPat :: Pattern -> Type -> Pattern #

Pattern with explicit type signature ( x :: Int )

mkBangPat :: Pattern -> Pattern #

Bang pattern ( !x )

mkIrrefutablePat :: Pattern -> Pattern #

Irrefutable pattern ( ~(x:_) )

mkWildPat :: Pattern #

Wildcard pattern: ( _ )

mkAsPat :: Name -> Pattern -> Pattern #

As-pattern (explicit name binding) ( ls@(hd:_) )

mkRecPat :: Name -> [PatternField] -> Pattern #

Record pattern ( Point { x = 3, y } )

mkParenPat :: Pattern -> Pattern #

Parenthesised patterns

mkParArrayPat :: [Pattern] -> Pattern #

Parallel array pattern ( [:1,2,a,x:] )

mkListPat :: [Pattern] -> Pattern #

List pattern ( [1,2,a,x] )

mkUnboxTuplePat :: [Pattern] -> Pattern #

Unboxed tuple pattern ( (# x, y #) )

mkTuplePat :: [Pattern] -> Pattern #

Tuple pattern ( (x,y) )

mkAppPat :: Name -> [Pattern] -> Pattern #

Constructor application pattern ( Point x y )

mkInfixAppPat :: Pattern -> Operator -> Pattern -> Pattern #

Infix constructor application pattern ( a :+: b )

mkLitPat :: Literal -> Pattern #

Literal pattern

mkVarPat :: Name -> Pattern #

Pattern name binding

mkRecCmd :: [CmdStmt] -> CmdStmt #

Creates a recursive binding command with ( rec b <- f a c; c <- f b a )

mkLetStmtCmd :: [LocalBind] -> CmdStmt #

Creates a let command ( let x = 3; y = 4 )

mkExprCmd :: Cmd -> CmdStmt #

Creates a non-binding command ( action )

mkBindCmd :: Pattern -> Cmd -> CmdStmt #

Creates a binding command ( x <- action )

mkGroupStmt :: Maybe Expr -> Maybe Expr -> CompStmt #

Grouping statements by TransformListComp ( then group by (x + y) using groupWith )

mkThenStmt :: Expr -> Maybe Expr -> CompStmt #

Then statements by TransformListComp ( then sortWith by (x + y) )

mkCompStmt :: Stmt -> CompStmt #

Normal monadic statement of a list comprehension

mkListCompBody :: [CompStmt] -> ListCompBody #

Body of a list comprehension: ( | x <- [1..10] )

mkRecStmt :: [Stmt] -> Stmt #

Creates a recursive binding statement with ( rec b <- f a c; c <- f b a )

mkLetStmt :: [LocalBind] -> Stmt #

Creates a let statement ( let x = 3; y = 4 )

mkExprStmt :: Expr -> Stmt #

Creates a non-binding statement ( action )

mkBindStmt :: Pattern -> Expr -> Stmt #

Creates a binding statement ( x <- action )

mkDeclsBracket :: [Decl] -> Bracket #

Declaration bracket ( [d| f :: Int -> Int; f x = x*x |] )

mkTypeBracket :: Type -> Bracket #

Type bracket ( [t| (Int,Int) |] )

mkPatternBracket :: Pattern -> Bracket #

Pattern bracket ( [p| Point x y |] )

mkExprBracket :: Expr -> Bracket #

Expression bracket ( [| x + y |] )

mkQuasiQuote :: Name -> String -> QuasiQuote #

Template haskell quasi-quotation: [quoter|str]

mkParenSplice :: Expr -> Splice #

A splice with parentheses: $(generate input)

mkIdSplice :: Name -> Splice #

A simple name splice: $generateX

type AnnList (node :: Type -> Type -> Type) = AnnListG node IdDom SrcTemplateStage #

type AnnMaybe (node :: Type -> Type -> Type) = AnnMaybeG node IdDom SrcTemplateStage #

type Module = Ann UModule IdDom SrcTemplateStage #

The representation of a haskell module, that is a separate compilation unit. It may or may not have a header.

type ModuleHead = Ann UModuleHead IdDom SrcTemplateStage #

Module declaration with name and (optional) exports

type ExportSpecs = Ann UExportSpecs IdDom SrcTemplateStage #

A list of export specifications surrounded by parentheses

type IESpec = Ann UIESpec IdDom SrcTemplateStage #

Marks a name to be imported or exported with related names (subspecifier)

type ImportModifier = Ann UImportModifier IdDom SrcTemplateStage #

Specifies the imported element

type SubSpec = Ann USubSpec IdDom SrcTemplateStage #

Marks how related names will be imported or exported with a given name

type ModulePragma = Ann UModulePragma IdDom SrcTemplateStage #

Pragmas that must be used after the module head

type FilePragma = Ann UFilePragma IdDom SrcTemplateStage #

Pragmas that must be used before defining the module

type ImportDecl = Ann UImportDecl IdDom SrcTemplateStage #

An import declaration: import Module.Name

type ImportSpec = Ann UImportSpec IdDom SrcTemplateStage #

Restriction on the imported names

type ImportQualified = Ann UImportQualified IdDom SrcTemplateStage #

Marks the import as qualified: qualified

type ImportSource = Ann UImportSource IdDom SrcTemplateStage #

Marks the import as source: {-# SOURCE #-}

type ImportSafe = Ann UImportSafe IdDom SrcTemplateStage #

Marks the import as safe: safe

type TypeNamespace = Ann UTypeNamespace IdDom SrcTemplateStage #

Marks an imported name to belong to the type namespace: type

type ImportRenaming = Ann UImportRenaming IdDom SrcTemplateStage #

Renaming imports ( as A )

type ModuleName = Ann UModuleName IdDom SrcTemplateStage #

The name of a module

type LanguageExtension = Ann ULanguageExtension IdDom SrcTemplateStage #

The name of the enabled language extension, for example ( LambdaCase )

type Decl = Ann UDecl IdDom SrcTemplateStage #

Haskell declaration

type ClassBody = Ann UClassBody IdDom SrcTemplateStage #

The list of declarations that can appear in a typeclass

type ClassElement = Ann UClassElement IdDom SrcTemplateStage #

Members of a class declaration

type InstBody = Ann UInstBody IdDom SrcTemplateStage #

Instance body is the implementation of the class functions ( where a x = 1; b x = 2 )

type InstBodyDecl = Ann UInstBodyDecl IdDom SrcTemplateStage #

Declarations inside an instance declaration.

type GadtConDecl = Ann UGadtConDecl IdDom SrcTemplateStage #

GADT constructor declaration ( D1 :: { val :: Int } -> T String )

type GadtConType = Ann UGadtConType IdDom SrcTemplateStage #

Type of GADT constructors (can be record types: { val :: Int })

type FieldWildcard = Ann UFieldWildcard IdDom SrcTemplateStage #

Marker for a field wildcard. Only needed to attach semantic information in a type-safe way.

type FunDeps = Ann UFunDeps IdDom SrcTemplateStage #

A list of functional dependencies: | a -> b, c -> d separated by commas

type FunDep = Ann UFunDep IdDom SrcTemplateStage #

A functional dependency, given on the form l1 ... ln -> r1 ... rn

type ConDecl = Ann UConDecl IdDom SrcTemplateStage #

A constructor declaration for a datatype

type DataOrNewtypeKeyword = Ann UDataOrNewtypeKeyword IdDom SrcTemplateStage #

The data or the newtype keyword to define ADTs.

type FieldDecl = Ann UFieldDecl IdDom SrcTemplateStage #

Field declaration ( fld :: Int )

type Deriving = Ann UDeriving IdDom SrcTemplateStage #

A deriving clause following a data type declaration. ( deriving Show or deriving (Show, Eq) )

type DeriveStrategy = Ann UDeriveStrategy IdDom SrcTemplateStage #

A deriving strategy (stock, newtype or anyclass)

type InstanceRule = Ann UInstanceRule IdDom SrcTemplateStage #

The instance declaration rule, which is, roughly, the part of the instance declaration before the where keyword.

type InstanceHead = Ann UInstanceHead IdDom SrcTemplateStage #

The specification of the class instance declaration

type OverlapPragma = Ann UOverlapPragma IdDom SrcTemplateStage #

Overlap pragmas. Can be applied to class declarations and class instance declarations.

type TypeEqn = Ann UTypeEqn IdDom SrcTemplateStage #

Type equations as found in closed type families ( T A = S )

type Rule = Ann URule IdDom SrcTemplateStage #

A rewrite rule ( "map/map" forall f g xs. map f (map g xs) = map (f.g) xs )

type RuleVar = Ann URuleVar IdDom SrcTemplateStage #

A variable for a rewrite rule. With or without type signature.

type AnnotationSubject = Ann UAnnotationSubject IdDom SrcTemplateStage #

Annotation allows you to connect an expression to any declaration.

type MinimalFormula = Ann UMinimalFormula IdDom SrcTemplateStage #

Formulas of minimal annotations declaring which functions should be defined.

type SourceRange = Ann USourceRange IdDom SrcTemplateStage #

In-AST source ranges (for generated pragmas)

type TypeFamily = Ann UTypeFamily IdDom SrcTemplateStage #

Open type and data families

type TypeFamilySpec = Ann UTypeFamilySpec IdDom SrcTemplateStage #

Type family specification with kinds specification and injectivity.

type InjectivityAnn = Ann UInjectivityAnn IdDom SrcTemplateStage #

Injectivity annotation for type families ( = r | r -> a )

type PatternSynonym = Ann UPatternSynonym IdDom SrcTemplateStage #

Pattern synonyms: pattern Arrow t1 t2 = App "->" [t1, t2]

type PatSynRhs = Ann UPatSynRhs IdDom SrcTemplateStage #

Right-hand side of pattern synonym

type PatSynLhs = Ann UPatSynLhs IdDom SrcTemplateStage #

Left hand side of a pattern synonym

type PatSynWhere = Ann UPatSynWhere IdDom SrcTemplateStage #

Where clause of pattern synonym (explicit expression direction)

type PatternSignature = Ann UPatternTypeSignature IdDom SrcTemplateStage #

Pattern type signature declaration ( pattern Succ :: Int -> Int )

type Role = Ann URole IdDom SrcTemplateStage #

Role annotations for types

type CallConv = Ann UCallConv IdDom SrcTemplateStage #

Call conventions of foreign functions

type Safety = Ann USafety IdDom SrcTemplateStage #

Safety annotations for foreign calls

type ConlikeAnnot = Ann UConlikeAnnot IdDom SrcTemplateStage #

A CONLIKE modifier for an INLINE pragma.

type PhaseControl = Ann UPhaseControl IdDom SrcTemplateStage #

Controls the activation of a rewrite rule ( [1] )

type ValueBind = Ann UValueBind IdDom SrcTemplateStage #

Value binding for top-level and local bindings

type Match = Ann UMatch IdDom SrcTemplateStage #

Clause of function binding

type MatchLhs = Ann UMatchLhs IdDom SrcTemplateStage #

Something on the left side of the match

type Rhs = Ann URhs IdDom SrcTemplateStage #

Right hand side of a value binding (possible with guards): ( = 3 or | x == 1 = 3; | otherwise = 4 )

type GuardedRhs = Ann UGuardedRhs IdDom SrcTemplateStage #

A guarded right-hand side of a value binding ( | x > 3 = 2 )

type RhsGuard = Ann URhsGuard IdDom SrcTemplateStage #

Guards for value bindings and pattern matches ( Just v x, v 1 )

type LocalBind = Ann ULocalBind IdDom SrcTemplateStage #

Bindings that are enabled in local blocks (where or let).

type LocalBinds = Ann ULocalBinds IdDom SrcTemplateStage #

Local bindings attached to a declaration ( where x = 42 )

type FixitySignature = Ann UFixitySignature IdDom SrcTemplateStage #

A fixity signature ( infixl 5 +, - ).

type TypeSignature = Ann UTypeSignature IdDom SrcTemplateStage #

A type signature ( f :: Int -> Int )

type Type = Ann UType IdDom SrcTemplateStage #

Haskell types

type TyVar = Ann UTyVar IdDom SrcTemplateStage #

Type variable declarations (with possible kind annotation)

type Assertion = Ann UAssertion IdDom SrcTemplateStage #

A single assertion in the context

type KindConstraint = Ann UKindConstraint IdDom SrcTemplateStage #

Kind constraint ( :: * -> * )

type Kind = Ann UKind IdDom SrcTemplateStage #

Haskell kinds

type PromotedKind = Ann (UPromoted UKind) IdDom SrcTemplateStage #

Values promoted to the kind level

type Expr = Ann UExpr IdDom SrcTemplateStage #

Haskell expressions

type Alt = Ann UAlt IdDom SrcTemplateStage #

Clause of case expression ( Just x -> x + 1 )

type CaseRhs = Ann UCaseRhs IdDom SrcTemplateStage #

Right hand side of a match (possible with guards): ( -> 3 or | x == 1 -> 3; | otherwise -> 4 )

type GuardedCaseRhs = Ann UGuardedCaseRhs IdDom SrcTemplateStage #

A guarded right-hand side of pattern matches binding ( | x > 3 -> 2 )

type FieldUpdate = Ann UFieldUpdate IdDom SrcTemplateStage #

Field update expressions

type TupSecElem = Ann UTupSecElem IdDom SrcTemplateStage #

An element of a tuple section that can be an expression or missing (indicating a value from a parameter)

type ExprPragma = Ann UExprPragma IdDom SrcTemplateStage #

Pragmas that can be applied to expressions

type Cmd = Ann UCmd IdDom SrcTemplateStage #

Special expressions for arrows

type CmdAlt = Ann UCmdAlt IdDom SrcTemplateStage #

Clause of case expression for commands

type Stmt = Ann UStmt IdDom SrcTemplateStage #

A statement in a do-notation

type DoKind = Ann UDoKind IdDom SrcTemplateStage #

Keywords do or mdo to start a do-block

type CompStmt = Ann UCompStmt IdDom SrcTemplateStage #

List comprehension statement

type ListCompBody = Ann UListCompBody IdDom SrcTemplateStage #

Body of a list comprehension: ( | x <- [1..10] )

type CmdStmt = Ann UCmdStmt IdDom SrcTemplateStage #

A do-notation for arrows

type Pattern = Ann UPattern IdDom SrcTemplateStage #

Representation of patterns for pattern bindings

type Splice = Ann USplice IdDom SrcTemplateStage #

A template haskell splice

type Bracket = Ann UBracket IdDom SrcTemplateStage #

Template Haskell bracket expressions

type QuasiQuote = Ann UQuasiQuote IdDom SrcTemplateStage #

Template haskell quasi-quotation: [quoter|str]

type Literal = Ann ULiteral IdDom SrcTemplateStage #

Haskell literals

type Operator = Ann UOperator IdDom SrcTemplateStage #

A definition that functions as an operator

type Name = Ann UName IdDom SrcTemplateStage #

A definition that functions as a name

type QualifiedName = Ann UQualifiedName IdDom SrcTemplateStage #

Possible qualified names. Contains also implicit names. Linear implicit parameter: %x. Non-linear implicit parameter: ?x.

type NamePart = Ann UNamePart IdDom SrcTemplateStage #

Parts of a qualified name.

type StringNode = Ann UStringNode IdDom SrcTemplateStage #

Program elements formatted as string literals (import packages, pragma texts)

type ModuleDom = (SourceFileKey, UnnamedModule) Source #

The name of the module and the AST

type UnnamedModule = Ann UModule IdDom SrcTemplateStage Source #

A type for the input and result of refactoring a module

moduleSourceFile :: String -> FilePath Source #

Transforms module name to a .hs file name relative to the source root directory.

sourceFileModule :: FilePath -> String Source #

Transforms a source root relative file name into module name.

data RefactorCtx Source #

The information a refactoring can use

Constructors

RefactorCtx 

Fields

newtype LocalRefactorT m a Source #

Input and output information for the refactoring TODO: use multiple states instead of Either

Instances
MonadTrans LocalRefactorT Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Methods

lift :: Monad m => m a -> LocalRefactorT m a #

RefactorMonad LocalRefactor Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Monad m => MonadReader RefactorCtx (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Monad m => Monad (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Functor m => Functor (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Methods

fmap :: (a -> b) -> LocalRefactorT m a -> LocalRefactorT m b #

(<$) :: a -> LocalRefactorT m b -> LocalRefactorT m a #

Applicative m => Applicative (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Methods

pure :: a -> LocalRefactorT m a #

(<*>) :: LocalRefactorT m (a -> b) -> LocalRefactorT m a -> LocalRefactorT m b #

liftA2 :: (a -> b -> c) -> LocalRefactorT m a -> LocalRefactorT m b -> LocalRefactorT m c #

(*>) :: LocalRefactorT m a -> LocalRefactorT m b -> LocalRefactorT m b #

(<*) :: LocalRefactorT m a -> LocalRefactorT m b -> LocalRefactorT m a #

MonadIO m => MonadIO (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Methods

liftIO :: IO a -> LocalRefactorT m a #

GhcMonad m => GhcMonad (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

(Monad m, HasDynFlags m) => HasDynFlags (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

ExceptionMonad m => ExceptionMonad (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

Monad m => MonadWriter [Either Name (SrcSpan, String, String)] (LocalRefactorT m) Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Monad

type Refactor = ExceptT String Ghc Source #

The refactoring monad for the whole project

type LocalRefactor = LocalRefactorT Refactor Source #

The refactoring monad for a given module

type ProjectRefactoring = [ModuleDom] -> Refactor [RefactorChange] Source #

The type of a refactoring that affects the whole project.

type Refactoring = ModuleDom -> [ModuleDom] -> Refactor [RefactorChange] Source #

The type of a refactoring

type LocalRefactoring = UnnamedModule -> LocalRefactor UnnamedModule Source #

A refactoring that only affects one module

class Monad m => RefactorMonad m where Source #

A monad that can be used to refactor

Methods

refactError :: String -> m a Source #

liftGhc :: Ghc a -> m a Source #

class NamedElement d => BindingElem d where Source #

A type class for handling definitions that can appear as both top-level and local definitions

Methods

sigBind :: Simple Partial (Ann d IdDom SrcTemplateStage) TypeSignature Source #

Accesses a type signature definition in a local or top-level definition

valBind :: Simple Partial (Ann d IdDom SrcTemplateStage) ValueBind Source #

Accesses a value or function definition in a local or top-level definition

fixitySig :: Simple Partial (Ann d IdDom SrcTemplateStage) FixitySignature Source #

Accesses a type signature definition in a local or top-level definition

createTypeSig :: TypeSignature -> Ann d IdDom SrcTemplateStage Source #

Creates a new definition from a type signature

createBinding :: ValueBind -> Ann d IdDom SrcTemplateStage Source #

Creates a new definition from a value or function definition

createFixitySig :: FixitySignature -> Ann d IdDom SrcTemplateStage Source #

Creates a new fixity signature

isTypeSig :: Ann d IdDom SrcTemplateStage -> Bool Source #

Checks if a given definition is a type signature

isBinding :: Ann d IdDom SrcTemplateStage -> Bool Source #

Checks if a given definition is a function or value binding

isFixitySig :: Ann d IdDom SrcTemplateStage -> Bool Source #

Checks if a given definition is a fixity signature

Instances
BindingElem UDecl Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.BindingElem

BindingElem ULocalBind Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.BindingElem

valBindsInList :: BindingElem d => Simple Traversal (AnnList d) ValueBind Source #

debugM :: (Monad m, Show a) => m a -> m a Source #

debug :: Show a => a -> a Source #

debugMaybeT :: Monad m => MaybeT m a -> MaybeT m a Source #

Displays True iff the wrapped value is a Just

setMinimalIndent :: SourceInfoTraversal elem => Int -> elem dom SrcTemplateStage -> elem dom SrcTemplateStage Source #

Set the minimal indentation recursively for a part of the AST

filterList :: SourceInfoTraversal e => (Ann e IdDom SrcTemplateStage -> Bool) -> AnnList e -> AnnList e Source #

Filters the elements of the list. By default it removes the separator before the element. Of course, if the first element is removed, the following separator is removed as well.

filterListSt :: SourceInfoTraversal e => (Ann e IdDom SrcTemplateStage -> Bool) -> AnnList e -> LocalRefactor (AnnList e) Source #

A version of filterList that cares about keeping non-removable code elements (like preprocessor pragmas)

filterListIndexedSt :: SourceInfoTraversal e => (Int -> Ann e IdDom SrcTemplateStage -> Bool) -> AnnList e -> LocalRefactor (AnnList e) Source #

A version of filterListIndexed that cares about keeping non-removable code elements (like preprocessor pragmas)

sublist :: [Int] -> [a] -> [a] Source #

Selects the given indices from a list

notSublist :: [Int] -> [a] -> [a] Source #

Selects all but the given indices from a list

insertWhere :: Bool -> Ann e IdDom SrcTemplateStage -> (Maybe (Ann e IdDom SrcTemplateStage) -> Bool) -> (Maybe (Ann e IdDom SrcTemplateStage) -> Bool) -> AnnList e -> AnnList e Source #

Inserts the element in the places where the two positioning functions (one checks the element before, one the element after) allows the placement.

insertIndex :: (Maybe (Ann e IdDom SrcTemplateStage) -> Bool) -> (Maybe (Ann e IdDom SrcTemplateStage) -> Bool) -> [Ann e IdDom SrcTemplateStage] -> Maybe Int Source #

Checks where the element will be inserted given the two positioning functions.

zipWithSeparators :: AnnList e -> [(([SourceTemplateTextElem], SrcSpan), Ann e IdDom SrcTemplateStage)] Source #

Gets the elements and separators from a list. The first separator is zipped to the second element. To the first element, the "" string is zipped.

removeEmptyBnds :: Simple Traversal Module ValueBind -> Simple Traversal Module Expr -> Module -> Module Source #

Remove the container (where or let) when the last binding is removed.

normalizeElements :: [Ann e dom SrcTemplateStage] -> [Ann e dom SrcTemplateStage] Source #

Puts the elements in the orginal order and remove duplicates (elements with the same source range)

groupElemsBy :: Ord k => (a -> k) -> [a] -> [[a]] Source #

Groups elements together into equivalence groups.

reprElems :: [[a]] -> [(a, [a])] Source #

Chooses a representative element for each equivalence group, and pairs them with their corresponding group.

equivalenceGroupsBy :: Ord k => (a -> k) -> [a] -> [(a, [a])] Source #

Sorts the elements of a list into equivalence groups based on a function, then chooses a representative element for each group, and pairs them with their corresponding group.

isJustT :: Monad m => MaybeT m a -> m Bool Source #

isNothingT :: Monad m => MaybeT m a -> m Bool Source #

liftMaybe :: Monad m => Maybe a -> MaybeT m a Source #

fromMaybeT :: Monad m => a -> MaybeT m a -> m a Source #

fromMaybeTM :: Monad m => m a -> MaybeT m a -> m a Source #

maybeT :: Monad m => b -> (a -> b) -> MaybeT m a -> m b Source #

maybeTM :: Monad m => m b -> (a -> m b) -> MaybeT m a -> m b Source #

runRefactor :: ModuleDom -> [ModuleDom] -> Refactoring -> Ghc (Either String [RefactorChange]) Source #

Performs the given refactoring, transforming it into a Ghc action

localRefactoring :: LocalRefactoring -> Refactoring Source #

Wraps a refactoring that only affects one module. Performs the per-module finishing touches.

localRefactoringRes :: ((UnnamedModule -> UnnamedModule) -> a -> a) -> UnnamedModule -> LocalRefactor a -> Refactor a Source #

Transform the result of the local refactoring

insertText :: SourceInfoTraversal p => [(SrcSpan, String, String)] -> p dom SrcTemplateStage -> p dom SrcTemplateStage Source #

Re-inserts the elements removed from the AST that should be kept (for example preprocessor directives)

addGeneratedImports :: [Name] -> Module -> Module Source #

Adds the imports that bring names into scope that are needed by the refactoring

referenceName' :: ([String] -> Name -> Ann nt IdDom SrcTemplateStage) -> Name -> LocalRefactor (Ann nt IdDom SrcTemplateStage) Source #

Create a name that references the definition. Generates an import if the definition is not yet imported.

referenceBy :: ([String] -> Name -> Ann nt IdDom SrcTemplateStage) -> Name -> [Ann UImportDecl IdDom SrcTemplateStage] -> Ann nt IdDom SrcTemplateStage Source #

Reference the name by the shortest suitable import

type TypedModule = Ann UModule IdDom SrcTemplateStage Source #

The final version of our AST, with type infromation added

tryRefactor :: (RealSrcSpan -> Refactoring) -> String -> ModuleName -> IO () Source #

A quick function to try the refactorings

correctRefactorSpan :: UnnamedModule -> RealSrcSpan -> RealSrcSpan Source #

Adjust the source range to be applied to the refactored module

useFlags :: [String] -> Ghc ([String], DynFlags -> DynFlags) Source #

Set the given flags for the GHC session. Also gives back a change function that you can use to apply the settings to any flags. Prints out errors and warnings

reloadPkgDb :: Ghc () Source #

Reloads the package database based on the session flags

initGhcFlags :: Ghc () Source #

Initialize GHC flags to default values that support refactoring

initGhcFlags' :: Bool -> Bool -> Ghc () Source #

Sets up basic flags and settings for GHC

useDirs :: [FilePath] -> Ghc () Source #

Use the given source directories when searching for imported modules

deregisterDirs :: [FilePath] -> Ghc () Source #

Don't use the given source directories when searching for imported modules

toFileName :: FilePath -> ModuleName -> FilePath Source #

Translates module name and working directory into the name of the file where the given module should be defined

toBootFileName :: FilePath -> ModuleName -> FilePath Source #

Translates module name and working directory into the name of the file where the boot module should be defined

getSourceDir :: ModSummary -> IO FilePath Source #

Get the source directory where the module is located.

getModSumOrig :: ModSummary -> FilePath Source #

Gets the path to the source file of the module.

getModSumName :: ModSummary -> String Source #

Gets the module name

loadModuleAST :: FilePath -> ModuleName -> Ghc TypedModule Source #

Load the AST of a module given by the working directory and module name.

loadModule :: FilePath -> ModuleName -> Ghc ModSummary Source #

Load the summary of a module given by the working directory and module name.

parseTyped :: ModSummary -> Ghc TypedModule Source #

Get the typed representation of a Haskell module.

withAlteredDynFlags :: GhcMonad m => (DynFlags -> m DynFlags) -> m a -> m a Source #

Modifies the dynamic flags for performing a ghc task

forceCodeGen :: ModSummary -> ModSummary Source #

Forces the code generation for a given module

forceAsmGen :: ModSummary -> ModSummary Source #

Forces ASM code generation for a given module

modSumNormalizeFlags :: ModSummary -> ModSummary Source #

Normalizes the flags for a module summary

normalizeFlags :: DynFlags -> DynFlags Source #

Removes all flags that are unintelligable for refactoring

readSrcSpan :: String -> RealSrcSpan Source #

Read a source range from our textual format: line:col-line:col or line:col

readSrcLoc :: String -> RealSrcLoc Source #

Read a source location from our format: line:col

performCommand Source #

Arguments

:: [RefactoringChoice]

The set of available refactorings

-> [String]

The refactoring command

-> Either FilePath ModuleDom

The module in which the refactoring is performed

-> [ModuleDom]

Other modules

-> Ghc (Either String [RefactorChange]) 

Executes a given command (choosen from the set of available refactorings) on the selected module and given other modules.

refactorCommands :: [RefactoringChoice] -> [String] Source #

Gets the name of possible refactorings.

data Severity Source #

Constructors

Error 
Warning 
Info 
Instances
Eq Severity Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Show Severity Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Generic Severity Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Associated Types

type Rep Severity :: Type -> Type #

Methods

from :: Severity -> Rep Severity x #

to :: Rep Severity x -> Severity #

ToJSON Severity Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Methods

toJSON :: Severity -> Value

toEncoding :: Severity -> Encoding

toJSONList :: [Severity] -> Value

toEncodingList :: [Severity] -> Encoding

type Rep Severity Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

type Rep Severity = D1 (MetaData "Severity" "Language.Haskell.Tools.Refactor.Querying" "haskell-tools-refactor-1.1.1.0-6rN5kFHgkT84ROl6XoQzhz" False) (C1 (MetaCons "Error" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Warning" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Info" PrefixI False) (U1 :: Type -> Type)))

data Marker Source #

Constructors

Marker 
Instances
Eq Marker Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Methods

(==) :: Marker -> Marker -> Bool #

(/=) :: Marker -> Marker -> Bool #

Show Marker Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Generic Marker Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Associated Types

type Rep Marker :: Type -> Type #

Methods

from :: Marker -> Rep Marker x #

to :: Rep Marker x -> Marker #

ToJSON Marker Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Methods

toJSON :: Marker -> Value

toEncoding :: Marker -> Encoding

toJSONList :: [Marker] -> Value

toEncodingList :: [Marker] -> Encoding

type Rep Marker Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

type Rep Marker = D1 (MetaData "Marker" "Language.Haskell.Tools.Refactor.Querying" "haskell-tools-refactor-1.1.1.0-6rN5kFHgkT84ROl6XoQzhz" False) (C1 (MetaCons "Marker" PrefixI True) (S1 (MetaSel (Just "location") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SrcSpan) :*: (S1 (MetaSel (Just "severity") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Severity) :*: S1 (MetaSel (Just "message") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 String))))

data QueryValue Source #

Constructors

GeneralQuery Value 
MarkerQuery [Marker] 
Instances
Eq QueryValue Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Show QueryValue Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Generic QueryValue Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Associated Types

type Rep QueryValue :: Type -> Type #

ToJSON QueryValue Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

Methods

toJSON :: QueryValue -> Value

toEncoding :: QueryValue -> Encoding

toJSONList :: [QueryValue] -> Value

toEncodingList :: [QueryValue] -> Encoding

type Rep QueryValue Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Querying

type Rep QueryValue = D1 (MetaData "QueryValue" "Language.Haskell.Tools.Refactor.Querying" "haskell-tools-refactor-1.1.1.0-6rN5kFHgkT84ROl6XoQzhz" False) (C1 (MetaCons "GeneralQuery" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Value)) :+: C1 (MetaCons "MarkerQuery" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [Marker])))

performQuery Source #

Arguments

:: [QueryChoice]

The set of available queries

-> [String]

The query command

-> Either FilePath ModuleDom

The module in which the refactoring is performed

-> [ModuleDom]

Other modules

-> Ghc (Either String (QueryType, Value)) 

data NameClass Source #

Different classes of definitions that have different kind of names.

Constructors

Variable

Normal value definitions: functions, variables

Ctor

Data constructors

ValueOperator

Functions with operator-like names

DataCtorOperator

Constructors with operator-like names

SynonymOperator

UType definitions with operator-like names

classifyName :: RefactorMonad m => Name -> m NameClass Source #

Get which category does a given name belong to

validModuleName :: String -> Maybe String Source #

Checks if a given name is a valid module name

nameValid :: NameClass -> String -> Maybe String Source #

Check if a given name is valid for a given kind of definition

assertionQNames :: Assertion -> [QualifiedName] Source #

Collects the qualified names of the class heads in an assertion.

assertionSemNames :: Assertion -> [Name] Source #

Collects the semantic names of the class heads in an assertion.

nameFromType :: Type -> Maybe Name Source #

Extracts the name of a type. In case of a type application, it finds the type being applied. It works only for unambiguous types, so it won't work for tuples.

lookupTypeFromId :: (HasIdInfo' id, GhcMonad m) => id -> MaybeT m Type Source #

Looks up the Type of an entity with an Id of any locality. If the entity being scrutinised is a type variable, it fails.

typeOrKindFromId :: HasIdInfo' id => id -> Type Source #

Looks up the Type or the Kind of an entity that has an Id. Note: In some cases we only get the Kind of the Id (e.g. for type constructors)

typeFromTyThing :: TyThing -> Maybe Type Source #

Extracts a Type from a TyThing when possible.

lookupTypeFromGlobalName :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Type Source #

Looks up a GHC Type from a Haskell Tools Name (given the name is global) For an identifier, it returns its type. For a data constructor, it returns its type. For a pattern synonym, it returns its builder's type. For a type synonym constructor, it returns its right-hand side. For a coaxiom, it fails.

lookupTypeSynRhs :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Type Source #

Looks up the right-hand side (GHC representation) of a Haskell Tools Name corresponding to a type synonym

lookupClassWith :: GhcMonad m => (a -> MaybeT m Name) -> a -> MaybeT m Class Source #

Looks up a GHC.Class from something that has a type class constructor in it Fails if the argument does not contain a class type constructor

semanticsTypeSynRhs :: GhcMonad m => Type -> MaybeT m Type Source #

Looks up the right-hand side (GHC representation) of a Haskell Tools Type corresponding to a type synonym

semanticsType :: GhcMonad m => Type -> MaybeT m Type Source #

Converts a global Haskell Tools type to a GHC type

satisfies :: (HasNameInfo' n, GhcMonad m) => (TyThing -> Maybe a) -> (a -> Bool) -> n -> MaybeT m Bool Source #

Looks up the given name, extracts something out of it. If the extraction is not succesful, it returns False, if it is successful, then checks the result against the predicate. The reasoning behind this, is that the predicate can only be satisfied by a proper name.

isClassTyConNameM :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Bool Source #

Decides whether a given name is a type family constructor. Fails if the lookup is not successful.

isVanillaDataConNameM :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m Bool Source #

Decides whether a given name is a standard Haskell98 data constructor. Fails if the lookup is not successful.

lookupClosedTyFam :: (HasNameInfo' n, GhcMonad m) => n -> MaybeT m ClosedTyFam Source #

Looks up a closed type family from a name.

coAxiomFromTyThing :: TyThing -> Maybe (CoAxiom Branched) Source #

Extract the CoAxioms from a TyThing representing a closed type family.

hasTyVarHead :: Type -> Bool Source #

Determines whether a Type itself has a type variable head.

data Ann (elem :: Type -> Type -> Type) dom stage #

An element of the AST keeping extra information.

Instances
HasNameInfo' DeclHead Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

HasNameInfo' InstanceHead Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

HasNameInfo' Operator Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

(ApplySemaChange (SemaInfoClassify e), SemanticTraversal e) => SemanticTraversal (Ann e) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

semaTraverse :: Monad f => SemaTrf f dom1 dom2 -> Ann e dom1 st -> f (Ann e dom2 st) #

SourceInfoTraversal e => SourceInfoTraversal (Ann e) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> Ann e dom st1 -> f (Ann e dom st2) #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> Ann e dom st1 -> f (Ann e dom st2) #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> Ann e dom st1 -> f (Ann e dom st2) #

SourceInfo src => Eq (Ann elem dom src) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

(==) :: Ann elem dom src -> Ann elem dom src -> Bool #

(/=) :: Ann elem dom src -> Ann elem dom src -> Bool #

HasNameInfo dom => HasNameInfo' (Ann UName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

Methods

semanticsName :: Ann UName dom st -> Maybe Name #

HasNameInfo dom => HasNameInfo' (Ann UQualifiedName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

HasLiteralInfo dom => HasLiteralInfo' (Ann ULiteral dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

Methods

semanticsLiteralType :: Ann ULiteral dom st -> Type #

HasIdInfo dom => HasIdInfo' (Ann UName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

Methods

semanticsId :: Ann UName dom st -> Id #

HasIdInfo dom => HasIdInfo' (Ann UQualifiedName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

Methods

semanticsId :: Ann UQualifiedName dom st -> Id #

HasFixityInfo dom => HasFixityInfo' (Ann UQualifiedName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

HasScopeInfo dom => HasScopeInfo' (Ann UQualifiedName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

HasScopeInfo dom => HasScopeInfo' (Ann UExpr dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

Methods

semanticsScope :: Ann UExpr dom st -> Scope #

HasDefiningInfo dom => HasDefiningInfo' (Ann UQualifiedName dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

HasModuleInfo dom => HasModuleInfo' (Ann UModule dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

HasImportInfo dom => HasImportInfo' (Ann UImportDecl dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

HasImplicitFieldsInfo dom => HasImplicitFieldsInfo' (Ann UFieldWildcard dom st) 
Instance details

Defined in Language.Haskell.Tools.AST.SemaInfoClasses

HasSourceInfo (Ann elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Associated Types

type SourceInfoType (Ann elem dom stage) :: Type #

Methods

srcInfo :: Simple Lens (Ann elem dom stage) (SourceInfoType (Ann elem dom stage)) #

SourceInfo stage => HasRange (Ann elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

getRange :: Ann elem dom stage -> SrcSpan #

setRange :: SrcSpan -> Ann elem dom stage -> Ann elem dom stage #

type Rep (Ann e dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Instances.Generic

type Rep (Ann e dom stage) = D1 (MetaData "Ann" "Language.Haskell.Tools.AST.Ann" "haskell-tools-ast-1.1.1.0-KX9To7HoJR9HzfMqL62gL1" False) (C1 (MetaCons "Ann" PrefixI True) (S1 (MetaSel (Just "_annotation") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (NodeInfo (SemanticInfo dom e) (SpanInfo stage))) :*: S1 (MetaSel (Just "_element") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (e dom stage))))
type SourceInfoType (Ann elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SourceInfoType (Ann elem dom stage) = SpanInfo stage
type IgnoredFields (Ann elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Instances.ClassyPlate

type IgnoredFields (Ann elem dom stage) = (Right "_annotation" :: Either (Symbol, Nat) Symbol) ': ([] :: [Either (Symbol, Nat) Symbol])

class HasSourceInfo e where #

Associated Types

type SourceInfoType e :: Type #

Methods

srcInfo :: Simple Lens e (SourceInfoType e) #

Instances
HasSourceInfo (AnnMaybeG elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Associated Types

type SourceInfoType (AnnMaybeG elem dom stage) :: Type #

Methods

srcInfo :: Simple Lens (AnnMaybeG elem dom stage) (SourceInfoType (AnnMaybeG elem dom stage)) #

HasSourceInfo (AnnListG elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Associated Types

type SourceInfoType (AnnListG elem dom stage) :: Type #

Methods

srcInfo :: Simple Lens (AnnListG elem dom stage) (SourceInfoType (AnnListG elem dom stage)) #

HasSourceInfo (Ann elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Associated Types

type SourceInfoType (Ann elem dom stage) :: Type #

Methods

srcInfo :: Simple Lens (Ann elem dom stage) (SourceInfoType (Ann elem dom stage)) #

class HasRange a where #

Extracts or modifies the concrete range corresponding to a given source info. In case of lists and optional elements, it may not contain the elements inside.

Methods

getRange :: a -> SrcSpan #

setRange :: SrcSpan -> a -> a #

Instances
HasRange (OptionalInfo RangeStage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

HasRange (OptionalInfo NormRangeStage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

HasRange (ListInfo RangeStage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

HasRange (ListInfo NormRangeStage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

HasRange (SpanInfo RangeStage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

HasRange (SpanInfo NormRangeStage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

SourceInfo stage => HasRange (AnnMaybeG elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

getRange :: AnnMaybeG elem dom stage -> SrcSpan #

setRange :: SrcSpan -> AnnMaybeG elem dom stage -> AnnMaybeG elem dom stage #

SourceInfo stage => HasRange (AnnListG elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

getRange :: AnnListG elem dom stage -> SrcSpan #

setRange :: SrcSpan -> AnnListG elem dom stage -> AnnListG elem dom stage #

SourceInfo stage => HasRange (Ann elem dom stage) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

getRange :: Ann elem dom stage -> SrcSpan #

setRange :: SrcSpan -> Ann elem dom stage -> Ann elem dom stage #

annListElems :: Lens (AnnListG elem dom stage) (AnnListG elem dom stage) [Ann elem dom stage] [Ann elem dom stage] #

annListAnnot :: Lens (AnnListG elem dom stage) (AnnListG elem dom stage) (NodeInfo (SemanticInfo dom (AnnListG elem)) (ListInfo stage)) (NodeInfo (SemanticInfo dom (AnnListG elem)) (ListInfo stage)) #

annList :: Traversal (AnnListG e d s) (AnnListG e d s) (Ann e d s) (Ann e d s) #

annJust :: Partial (AnnMaybeG e d s) (AnnMaybeG e d s) (Ann e d s) (Ann e d s) #

annMaybe :: Lens (AnnMaybeG elem dom stage) (AnnMaybeG elem dom stage) (Maybe (Ann elem dom stage)) (Maybe (Ann elem dom stage)) #

type Domain d = (Typeable d, Data d, SemanticInfo' d SemaInfoDefaultCls ~ NoSemanticInfo, Data (SemanticInfo' d SemaInfoNameCls), Data (SemanticInfo' d SemaInfoLitCls), Data (SemanticInfo' d SemaInfoExprCls), Data (SemanticInfo' d SemaInfoImportCls), Data (SemanticInfo' d SemaInfoModuleCls), Data (SemanticInfo' d SemaInfoWildcardCls)) #

A semantic domain for the AST. The semantic domain maps semantic information for the different types of nodes in the AST. The kind of semantic domain for an AST depends on which stages of the compilation it passed. However after transforming the GHC representation to our AST, the domain stays the same. The domain is not applied to the AST elements that are generated while refactoring.

data Dom name #

With this domain, semantic information can be parameterized. In practice it is only used if the compilation cannot proceed past the type checking phase.

Instances
(Data name, Typeable name) => Data (Dom name) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dom name -> c (Dom name) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Dom name) #

toConstr :: Dom name -> Constr #

dataTypeOf :: Dom name -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Dom name)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Dom name)) #

gmapT :: (forall b. Data b => b -> b) -> Dom name -> Dom name #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dom name -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dom name -> r #

gmapQ :: (forall d. Data d => d -> u) -> Dom name -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Dom name -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dom name -> m (Dom name) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dom name -> m (Dom name) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dom name -> m (Dom name) #

type SemanticInfo' (Dom n) SemaInfoDefaultCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' (Dom n) SemaInfoWildcardCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' (Dom n) SemaInfoModuleCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' (Dom n) SemaInfoImportCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' (Dom n) SemaInfoExprCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' (Dom n) SemaInfoLitCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' (Dom n) SemaInfoNameCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

data IdDom #

Instances
Data IdDom 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> IdDom -> c IdDom #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c IdDom #

toConstr :: IdDom -> Constr #

dataTypeOf :: IdDom -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> IdDom -> IdDom #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> IdDom -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> IdDom -> r #

gmapQ :: (forall d. Data d => d -> u) -> IdDom -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> IdDom -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> IdDom -> m IdDom #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> IdDom -> m IdDom #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> IdDom -> m IdDom #

HasNameInfo' DeclHead Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

HasNameInfo' InstanceHead Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

HasNameInfo' Operator Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

type SemanticInfo' IdDom SemaInfoNameCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' IdDom SemaInfoLitCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' IdDom SemaInfoExprCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' IdDom SemaInfoImportCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' IdDom SemaInfoModuleCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' IdDom SemaInfoDefaultCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

type SemanticInfo' IdDom SemaInfoWildcardCls 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

shortShowSpan :: SrcSpan -> String #

A short form of showing a range, without file name, for debugging purposes.

data SrcTemplateStage #

A stage where the annotation controls how the original source code can be retrieved from the AST. A source template is assigned to each node. It has holes where the content of an other node should be printed and ranges for the source code of the node.

Instances
Data SrcTemplateStage 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SrcTemplateStage -> c SrcTemplateStage #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SrcTemplateStage #

toConstr :: SrcTemplateStage -> Constr #

dataTypeOf :: SrcTemplateStage -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> SrcTemplateStage -> SrcTemplateStage #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SrcTemplateStage -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SrcTemplateStage -> r #

gmapQ :: (forall d. Data d => d -> u) -> SrcTemplateStage -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SrcTemplateStage -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SrcTemplateStage -> m SrcTemplateStage #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcTemplateStage -> m SrcTemplateStage #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcTemplateStage -> m SrcTemplateStage #

HasNameInfo' DeclHead Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

HasNameInfo' InstanceHead Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

HasNameInfo' Operator Source # 
Instance details

Defined in Language.Haskell.Tools.Refactor.Utils.NameLookup

AfterBefore (OptionalInfo SrcTemplateStage) 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplateHelpers

AfterBefore (ListInfo SrcTemplateStage) 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplateHelpers

RelativeIndent (OptionalInfo SrcTemplateStage) 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplateHelpers

RelativeIndent (ListInfo SrcTemplateStage) 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplateHelpers

RelativeIndent (SpanInfo SrcTemplateStage) 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplateHelpers

MinimumIndent (OptionalInfo SrcTemplateStage) 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplateHelpers

MinimumIndent (ListInfo SrcTemplateStage) 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplateHelpers

MinimumIndent (SpanInfo SrcTemplateStage) 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplateHelpers

data OptionalInfo SrcTemplateStage 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

data ListInfo SrcTemplateStage 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

data SpanInfo SrcTemplateStage 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

class SourceInfoTraversal (a :: Type -> Type -> Type) where #

A class for traversing source information in an AST

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> a dom st1 -> f (a dom st2) #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> a dom st1 -> f (a dom st2) #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> a dom st1 -> f (a dom st2) #

Instances
SourceInfoTraversal e => SourceInfoTraversal (AnnMaybeG e) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> AnnMaybeG e dom st1 -> f (AnnMaybeG e dom st2) #

SourceInfoTraversal e => SourceInfoTraversal (AnnListG e) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnListG e dom st1 -> f (AnnListG e dom st2) #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> AnnListG e dom st1 -> f (AnnListG e dom st2) #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> AnnListG e dom st1 -> f (AnnListG e dom st2) #

SourceInfoTraversal e => SourceInfoTraversal (Ann e) 
Instance details

Defined in Language.Haskell.Tools.AST.Ann

Methods

sourceInfoTraverseUp :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> Ann e dom st1 -> f (Ann e dom st2) #

sourceInfoTraverseDown :: Monad f => SourceInfoTrf f st1 st2 -> f () -> f () -> Ann e dom st1 -> f (Ann e dom st2) #

sourceInfoTraverse :: Monad f => SourceInfoTrf f st1 st2 -> Ann e dom st1 -> f (Ann e dom st2) #

data SourceTemplateTextElem #

Instances
Eq SourceTemplateTextElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Data SourceTemplateTextElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SourceTemplateTextElem -> c SourceTemplateTextElem #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SourceTemplateTextElem #

toConstr :: SourceTemplateTextElem -> Constr #

dataTypeOf :: SourceTemplateTextElem -> DataType #

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

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

gmapT :: (forall b. Data b => b -> b) -> SourceTemplateTextElem -> SourceTemplateTextElem #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SourceTemplateTextElem -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SourceTemplateTextElem -> r #

gmapQ :: (forall d. Data d => d -> u) -> SourceTemplateTextElem -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SourceTemplateTextElem -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SourceTemplateTextElem -> m SourceTemplateTextElem #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceTemplateTextElem -> m SourceTemplateTextElem #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SourceTemplateTextElem -> m SourceTemplateTextElem #

Ord SourceTemplateTextElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate

Show SourceTemplateTextElem 
Instance details

Defined in Language.Haskell.Tools.PrettyPrint.Prepare.SourceTemplate