Safe Haskell | None |
---|---|
Language | Haskell2010 |
Build a directed graph whose nodes are arity zero types and whose edges represent the hops in the path graph.
- class DsMonad m => HasVisitedMap m where
- doType :: HasTypeTraversal m => Type -> m ()
- class Monad m => HasTypeParameters m where
- withBindings :: (HasTypeParameters m, Data a) => ((a -> a) -> m ()) -> [TyVarBndr] -> m ()
- class (DsMonad m, HasVisitedMap m) => HasTypeTraversal m where
- doApply :: (HasTypeTraversal m, HasTypeParameters m, DsMonad m) => Type -> Type -> m ()
- data FieldInfo = FieldInfo {
- _typeName :: Name
- _constrCount :: Int
- _constrIndex :: Int
- _constrName :: Name
- _fieldCount :: Int
- _fieldIndex :: Int
- _fieldName :: Maybe Name
- _fieldType :: Type
- expandType :: DsMonad m => Type -> m Type
- pprint1 :: (Ppr a, Data a) => a -> [Char]
- pprint1' :: Ppr a => a -> [Char]
- pprintW :: (Ppr a, Data a) => Int -> a -> [Char]
- pprintW' :: Ppr a => Int -> a -> [Char]
- class ToName a where
- class HasMessageInfo a where
- message :: (Quasi m, MonadReader s m, HasMessageInfo s) => Int -> String -> m ()
- indent :: String -> String -> String
Documentation
class DsMonad m => HasVisitedMap m where Source #
doType :: HasTypeTraversal m => Type -> m () Source #
class Monad m => HasTypeParameters m where 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 #
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.
doApply :: (HasTypeTraversal m, HasTypeParameters m, DsMonad m) => Type -> Type -> m () Source #
FieldInfo | |
|
pprintW :: (Ppr a, Data a) => Int -> a -> [Char] Source #
Pretty print with friendly names and wide lines
Copied from haskell-src-meta
class HasMessageInfo a where Source #
message :: (Quasi m, MonadReader s m, HasMessageInfo s) => Int -> String -> m () Source #
Output a verbosity controlled error message with the current indentation.