th-typegraph-1.0.2: Graph of the subtype relation

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.TypeTraversal

Description

Build a directed graph whose nodes are arity zero types and whose edges represent the hops in the path graph.

Synopsis

Documentation

class DsMonad m => HasVisitedMap m where Source #

Minimal complete definition

unvisited

Methods

unvisited :: Type -> m () -> m () Source #

class Monad m => HasTypeParameters m where Source #

Minimal complete definition

pushParam, withParams

Methods

pushParam :: Type -> m a -> m a Source #

withParams :: ([Type] -> m ()) -> m () Source #

withBindings :: (HasTypeParameters m, Data a) => ((a -> a) -> m ()) -> [TyVarBndr] -> m () Source #

Input is a list of type variable bindings (such as those appearing in a Dec) and the current stack of type parameters applied by AppT. Builds a function that expands a type using those bindings and pass it to an action.

class (DsMonad m, HasVisitedMap m) => HasTypeTraversal m where Source #

Minimal complete definition

prepType, doTypeInternal, doListT, doTupleT, doField, doVarT

Methods

prepType :: Type -> m Type Source #

Normally just return, this can modify the types during the traversal.

doTypeInternal :: Type -> m () Source #

This is passed every type that is encountered. The methods below are called from doApply.

doListT :: Type -> Type -> m () Source #

When a ListT type is encountered this is passed the type and the element type

doTupleT :: Type -> Type -> Int -> m () Source #

When a TupleT type is encountered this is called once for each element, with the type, element type, and element position.

doField :: Type -> (Type -> Type) -> FieldInfo -> m () Source #

When a field is encountered this is called with all the field info - type name, constructor countpositionname, field countpositiontype/maybe name.

doVarT :: Type -> Name -> m () Source #

Called when a type variable is encountered.

pprint1 :: (Ppr a, Data a) => a -> [Char] Source #

Pretty print a Ppr value on a single line with each block of white space (newlines, tabs, etc.) converted to a single space, and all the module qualifiers removed from the names. (If the data type has no Name values the friendlyNames function has no effect.)

pprint1' :: Ppr a => a -> [Char] Source #

pprintW :: (Ppr a, Data a) => Int -> a -> [Char] Source #

Pretty print with friendly names and wide lines

pprintW' :: Ppr a => Int -> a -> [Char] Source #

class ToName a where Source #

Copied from haskell-src-meta

Minimal complete definition

toName

Methods

toName :: a -> Name Source #

class HasMessageInfo a where Source #

Minimal complete definition

verbosity', prefix'

message :: (Quasi m, MonadReader s m, HasMessageInfo s) => Int -> String -> m () Source #

Output a verbosity controlled error message with the current indentation.

indent :: String -> String -> String Source #

Indent the lines of a message.