th-typegraph-0.35.1: Graph of the subtype relation

Safe HaskellNone
LanguageHaskell2010

Language.Haskell.TH.TypeGraph.Prelude

Contents

Synopsis

Documentation

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

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

Pretty print with friendly names and wide lines

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

Pretty print with friendly names in left mode

class OverTypes t where Source #

Perform a fold over the Type and Info values embedded in t

Minimal complete definition

overTypes

Methods

overTypes :: Quasi m => (a -> Either Info Type -> m a) -> a -> t -> m a Source #

Instances

OverTypes Type Source # 

Methods

overTypes :: Quasi m => (a -> Either Info Type -> m a) -> a -> Type -> m a Source #

OverTypes Dec Source # 

Methods

overTypes :: Quasi m => (a -> Either Info Type -> m a) -> a -> Dec -> m a Source #

OverTypes Con Source # 

Methods

overTypes :: Quasi m => (a -> Either Info Type -> m a) -> a -> Con -> m a Source #

OverTypes Info Source # 

Methods

overTypes :: Quasi m => (a -> Either Info Type -> m a) -> a -> Info -> m a Source #

OverTypes StrictType Source # 

Methods

overTypes :: Quasi m => (a -> Either Info Type -> m a) -> a -> StrictType -> m a Source #

OverTypes VarStrictType Source # 

Methods

overTypes :: Quasi m => (a -> Either Info Type -> m a) -> a -> VarStrictType -> m a Source #

unlifted :: (OverTypes t, Quasi m) => t -> m Bool Source #

Does the type or the declaration to which it refers contain a primitive (aka unlifted) type? This will traverse down any Dec to the named types, and then check whether any of their Info records are PrimTyConI values.

unReify :: Data a => a -> a Source #

adjacent' :: forall node key. (Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex) -> (Vertex, key) -> [(Vertex, key)] Source #

Return a key's list of adjacent keys

reachable' :: forall node key. (Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex) -> (Vertex, key) -> [(Vertex, key)] Source #

Return a key's list of reachable keys

friendlyNames :: Data a => a -> a Source #

Make a template haskell value more human reader friendly. The result almost certainly won't be compilable. That's ok, though, because the input is usually uncompilable - it imports hidden modules, uses infix operators in invalid positions, puts module qualifiers in places where they are not allowed, and maybe other things.

Orphan instances

Ppr () Source # 

Methods

ppr :: () -> Doc #

ppr_list :: [()] -> Doc #