-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Graph of the subtype relation -- -- Build a graph whose nodes are Types and whose edges represent the -- subtype relation: Char is a subtype of Maybe Char, Int is a subtype of -- (Int, Double), and so on. @package th-typegraph @version 0.35.1 module Language.Haskell.TH.TypeGraph.Prelude -- | 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, Data a) => a -> [Char] -- | Pretty print with friendly names and wide lines pprintW :: (Ppr a, Data a) => Int -> a -> [Char] -- | Pretty print with friendly names in left mode pprintL :: (Ppr a, Data a) => a -> [Char] -- | Perform a fold over the Type and Info values embedded in t class OverTypes t overTypes :: (OverTypes t, Quasi m) => (a -> Either Info Type -> m a) -> a -> t -> m a -- | 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. unlifted :: (OverTypes t, Quasi m) => t -> m Bool constructorName :: Con -> Name declarationName :: Dec -> Maybe Name declarationType :: Dec -> Maybe Type unReify :: Data a => a -> a unReifyName :: Name -> Name -- | Return a key's list of adjacent keys adjacent' :: forall node key. (Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex) -> (Vertex, key) -> [(Vertex, key)] -- | Return a key's list of reachable keys reachable' :: forall node key. (Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex) -> (Vertex, key) -> [(Vertex, key)] -- | 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. friendlyNames :: Data a => a -> a instance Language.Haskell.TH.Ppr.Ppr () instance Language.Haskell.TH.TypeGraph.Prelude.OverTypes Language.Haskell.TH.Syntax.Dec instance Language.Haskell.TH.TypeGraph.Prelude.OverTypes Language.Haskell.TH.Syntax.StrictType instance Language.Haskell.TH.TypeGraph.Prelude.OverTypes Language.Haskell.TH.Syntax.VarStrictType instance Language.Haskell.TH.TypeGraph.Prelude.OverTypes Language.Haskell.TH.Syntax.Con instance Language.Haskell.TH.TypeGraph.Prelude.OverTypes Language.Haskell.TH.Syntax.Type instance Language.Haskell.TH.TypeGraph.Prelude.OverTypes Language.Haskell.TH.Syntax.Info -- | A fold on the shape of the constructors of a DataD or NewtypeD record. module Language.Haskell.TH.TypeGraph.Shape type Field = (Name, Con, Either Int Name) data FieldType Positional :: Int -> StrictType -> FieldType Named :: VarStrictType -> FieldType fieldType :: FieldType -> Type constructorName :: Con -> Name constructorFields :: Name -> Con -> [Field] constructorFieldTypes :: Con -> [FieldType] -- | Build a pattern that will match only values with the given -- constructor. constructorPat :: Con -> PatQ fPos :: FieldType -> Either Int Name fName :: FieldType -> Either Int Name fType :: FieldType -> Type -- | Given the list of constructors from a Dec, dispatch on the different -- levels of complexity of the type they represent - a wrapper is a -- single arity one constructor, an enum is several arity zero -- constructors, and so on. foldShape :: Monad m => ([(Con, [FieldType])] -> m r) -> (Con -> [FieldType] -> m r) -> ([Con] -> m r) -> (Con -> FieldType -> m r) -> [Con] -> m r instance Data.Data.Data Language.Haskell.TH.TypeGraph.Shape.FieldType instance GHC.Show.Show Language.Haskell.TH.TypeGraph.Shape.FieldType instance GHC.Classes.Ord Language.Haskell.TH.TypeGraph.Shape.FieldType instance GHC.Classes.Eq Language.Haskell.TH.TypeGraph.Shape.FieldType instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.TypeGraph.Shape.Field instance Language.Haskell.TH.Ppr.Ppr (GHC.Base.Maybe Language.Haskell.TH.TypeGraph.Shape.Field, Language.Haskell.TH.Expand.E Language.Haskell.TH.Syntax.Type) instance Language.Haskell.TH.Ppr.Ppr (GHC.Base.Maybe Language.Haskell.TH.TypeGraph.Shape.Field, Language.Haskell.TH.Syntax.Type) instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.TypeGraph.Shape.FieldType module Language.Haskell.TH.TypeGraph.Vertex class TypeGraphVertex v -- | Return the set of Name of a type's synonyms, plus the name (if -- any) used in its data declaration. Note that this might return the -- empty set. typeNames :: TypeGraphVertex v => v -> Set Name bestType :: TypeGraphVertex v => v -> Type -- | A vertex of the type graph. Includes a type and (optionally) what -- field of a parent type holds that type. This allows special treatment -- of a type depending on the type that contains it. data TGV' TGV' :: Maybe Field -> TGVSimple' -> TGV' -- | The record field which contains this type [_field] :: TGV' -> Maybe Field [_vsimple] :: TGV' -> TGVSimple' field :: Lens' TGV' (Maybe Field) vsimple :: Lens' TGV' TGVSimple' type TGV = (Vertex, TGV') -- | For simple type graphs where no parent field information is required. data TGVSimple' TGVSimple' :: Set Name -> E Type -> TGVSimple' -- | All the type synonyms that expand to this type [_syns] :: TGVSimple' -> Set Name -- | The fully expanded type [_etype] :: TGVSimple' -> E Type syns :: Lens' TGVSimple' (Set Name) etype :: Lens' TGVSimple' (E Type) type TGVSimple = (Vertex, TGVSimple') bestTypeQ :: TypeGraphVertex v => v -> TypeQ instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.TypeGraph.Vertex.TGV' instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.TypeGraph.Vertex.TGVSimple instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.TypeGraph.Vertex.TGV instance Language.Haskell.TH.Ppr.Ppr ((), Language.Haskell.TH.TypeGraph.Vertex.TGV', [Language.Haskell.TH.TypeGraph.Vertex.TGV']) instance Language.Haskell.TH.Ppr.Ppr ((), Language.Haskell.TH.TypeGraph.Vertex.TGVSimple', [Language.Haskell.TH.TypeGraph.Vertex.TGVSimple']) instance Language.Haskell.TH.Ppr.Ppr (Data.Map.Base.Map Language.Haskell.TH.TypeGraph.Vertex.TGV' (Data.Set.Base.Set Language.Haskell.TH.TypeGraph.Vertex.TGV')) instance Language.Haskell.TH.Ppr.Ppr (Data.Map.Base.Map Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' (Data.Set.Base.Set Language.Haskell.TH.TypeGraph.Vertex.TGVSimple')) instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.TypeGraph.Vertex.TGV' instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' instance Language.Haskell.TH.TypeGraph.Vertex.TypeGraphVertex Language.Haskell.TH.TypeGraph.Vertex.TGV' instance Language.Haskell.TH.TypeGraph.Vertex.TypeGraphVertex Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' instance Language.Haskell.TH.TypeGraph.Vertex.TypeGraphVertex Language.Haskell.TH.TypeGraph.Vertex.TGV instance Language.Haskell.TH.TypeGraph.Vertex.TypeGraphVertex Language.Haskell.TH.TypeGraph.Vertex.TGVSimple instance Data.Data.Data Language.Haskell.TH.TypeGraph.Vertex.TGV' instance GHC.Show.Show Language.Haskell.TH.TypeGraph.Vertex.TGV' instance GHC.Classes.Ord Language.Haskell.TH.TypeGraph.Vertex.TGV' instance GHC.Classes.Eq Language.Haskell.TH.TypeGraph.Vertex.TGV' instance Data.Data.Data Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' instance GHC.Show.Show Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' instance GHC.Classes.Ord Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' instance GHC.Classes.Eq Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' module Language.Haskell.TH.TypeGraph.TypeInfo -- | Information collected about the graph implied by the structure of one -- or more Type values. data TypeInfo startTypes :: Lens' TypeInfo [Type] fields :: Lens' TypeInfo (Map (E Type) (Set Field)) infoMap :: Lens' TypeInfo (Map Name Info) synonyms :: Lens' TypeInfo (Map (E Type) (Set Name)) typeSet :: Lens' TypeInfo (Set Type) -- | Build a TypeInfo value by scanning the supplied types makeTypeInfo :: forall m. DsMonad m => (Type -> m (Set Type)) -> [Type] -> m TypeInfo -- | Build a vertex from the given Type and optional Field. -- vertex :: forall m. (DsMonad m, MonadReaders TypeInfo m) => Maybe -- Field -> E Type -> m TypeGraphVertex vertex fld etyp = maybe -- (typeVertex etyp) (fieldVertex etyp) fld -- -- Build a non-field vertex typeVertex :: MonadReaders TypeInfo m => E Type -> m TGVSimple' typeVertex' :: MonadReaders TypeInfo m => E Type -> m TGV' -- | Build a vertex associated with a field fieldVertex :: MonadReaders TypeInfo m => Field -> E Type -> m TGV' -- | Find the vertices that involve a particular type - if the field is -- specified it return s singleton, otherwise it returns a set containing -- a vertex one for the type on its own, and one for each field -- containing that type. fieldVertices :: MonadReaders TypeInfo m => TGVSimple' -> m (Set TGV') allVertices :: (Functor m, DsMonad m, MonadReaders TypeInfo m) => Maybe Field -> E Type -> m (Set TGV') instance GHC.Base.Monad m => Control.Monad.States.MonadStates Language.Haskell.TH.Expand.ExpandMap (Control.Monad.Trans.State.Lazy.StateT Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo m) instance Language.Haskell.TH.Syntax.Lift Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo instance GHC.Classes.Ord Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo instance GHC.Classes.Eq Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo instance GHC.Show.Show Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo -- | The HasStack monad used in MIMO to construct lenses that look deep -- into a record type. However, it does not involve the Path type -- mechanism, and is unaware of View instances and other things that -- modify the type graph. Lets see how it adapts. module Language.Haskell.TH.TypeGraph.Stack -- | A stack describes a path from a top type down through fields of its -- component types. data TypeStack TypeStack :: Type -> [StackElement] -> TypeStack [_topType] :: TypeStack -> Type [_typeStack] :: TypeStack -> [StackElement] topType :: Lens' TypeStack Type typeStack :: Lens' TypeStack [StackElement] -- | The information required to extact a field value from a value. We keep -- a stack of these as we traverse a declaration. Generally, we only need -- the field names. data StackElement StackElement :: FieldType -> Con -> Dec -> StackElement prettyStack :: TypeStack -> String -- | Push the stack and process the field. foldField :: MonadReaders TypeStack m => (FieldType -> m r) -> Dec -> Con -> FieldType -> m r type HasStack = MonadReaders TypeStack type StackT m = ReaderT TypeStack m execStackT :: Monad m => StackT m a -> Type -> m a withStack :: (Monad m, MonadReaders TypeStack m) => (TypeStack -> m a) -> m a -- | push an element onto the TypeStack in m push :: MonadReaders TypeStack m => FieldType -> Con -> Dec -> m a -> m a -- | Return a lambda function that turns a value of Type typ0 into the type -- implied by the stack elements. stackAccessor :: (Quasi m, MonadReaders TypeStack m) => m Exp traceIndented :: MonadReaders TypeStack m => String -> m () -- | Given a field name, return the name to use for the corresponding lens. lensNamer :: String -> String instance Control.Monad.Readers.MonadReaders Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo m => Control.Monad.Readers.MonadReaders Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo (Control.Monad.Trans.Reader.ReaderT Language.Haskell.TH.TypeGraph.Stack.TypeStack m) instance Data.Data.Data Language.Haskell.TH.TypeGraph.Stack.TypeStack instance GHC.Show.Show Language.Haskell.TH.TypeGraph.Stack.TypeStack instance GHC.Classes.Eq Language.Haskell.TH.TypeGraph.Stack.TypeStack instance Data.Data.Data Language.Haskell.TH.TypeGraph.Stack.StackElement instance GHC.Show.Show Language.Haskell.TH.TypeGraph.Stack.StackElement instance GHC.Classes.Eq Language.Haskell.TH.TypeGraph.Stack.StackElement -- | Function to compute free type variable set for a Type. (I took this -- from somewhere, I really need to credit it. Now when I search all I -- can find is myself.) module Language.Haskell.TH.TypeGraph.Free -- | Return the names of the type variables that are free in x. I.e., type -- variables that appear in the type expression but are not bound by an -- enclosing forall or by the type parameters of a Dec. freeTypeVars :: (FreeTypeVars t, Quasi m) => t -> m (Set Name) instance Language.Haskell.TH.TypeGraph.Free.FreeTypeVars a => Language.Haskell.TH.TypeGraph.Free.FreeTypeVars [a] instance Language.Haskell.TH.TypeGraph.Free.FreeTypeVars Language.Haskell.TH.Syntax.Type instance Language.Haskell.TH.TypeGraph.Free.FreeTypeVars Language.Haskell.TH.Syntax.Con instance Language.Haskell.TH.TypeGraph.Free.FreeTypeVars (Language.Haskell.TH.Syntax.Strict, Language.Haskell.TH.Syntax.Type) instance Language.Haskell.TH.TypeGraph.Free.FreeTypeVars (Language.Haskell.TH.Syntax.Name, Language.Haskell.TH.Syntax.Strict, Language.Haskell.TH.Syntax.Type) instance GHC.Show.Show Language.Haskell.TH.TypeGraph.Free.St -- | Operations involving the edges of the graph (before it is a graph.) module Language.Haskell.TH.TypeGraph.Edges type GraphEdges key = Map key (Set key) -- | Given the discovered set of types and maps of type synonyms and -- fields, build and return the GraphEdges relation on TypeGraphVertex. -- This is not a recursive function, it stops when it reaches the field -- types. typeGraphEdges :: forall m. (DsMonad m, Functor m, MonadReaders TypeInfo m, MonadStates ExpandMap m) => m (GraphEdges TGV') -- | Isolate and remove matching nodes cut :: (Eq a, Ord a) => (a -> Bool) -> GraphEdges a -> GraphEdges a -- | Monadic predicate version of cut. cutM :: (Functor m, Monad m, Eq a, Ord a) => (a -> m Bool) -> GraphEdges a -> m (GraphEdges a) cutEdges :: (Eq a, Ord a) => (a -> a -> Bool) -> GraphEdges a -> (GraphEdges a) cutEdgesM :: (Monad m, Eq a, Ord a) => (a -> a -> m Bool) -> GraphEdges a -> m (GraphEdges a) -- | Remove all the in- and out-edges of matching nodes isolate :: (Eq a, Ord a) => (a -> Bool) -> GraphEdges a -> GraphEdges a -- | Monadic predicate version of isolate. isolateM :: (Functor m, Monad m, Eq a, Ord a) => (a -> m Bool) -> GraphEdges a -> m (GraphEdges a) -- | Replace the out set of selected nodes link :: (Eq a, Ord a) => (a -> Maybe (Set a)) -> GraphEdges a -> GraphEdges a linkM :: (Eq a, Ord a, Monad m) => (a -> m (Maybe (Set a))) -> GraphEdges a -> m (GraphEdges a) -- | Remove matching nodes and extend each of their in-edges to each of -- their out-edges. dissolve :: (Eq a, Ord a) => (a -> Bool) -> GraphEdges a -> GraphEdges a -- | Monadic predicate version of dissolve. dissolveM :: (Functor m, Monad m, Eq a, Ord a) => (a -> m Bool) -> GraphEdges a -> m (GraphEdges a) -- | Simplify a graph by throwing away the field information in each node. -- This means the nodes only contain the fully expanded Type value (and -- any type synonyms.) simpleEdges :: GraphEdges TGV' -> GraphEdges TGVSimple' -- | Abstract operations on Maps containing graph edges. module Language.Haskell.TH.TypeGraph.TypeGraph data TypeGraph graph :: Lens' TypeGraph (Graph, Vertex -> ((), TGV', [TGV']), TGV' -> Maybe Vertex) gsimple :: Lens' TypeGraph (Graph, Vertex -> ((), TGVSimple', [TGVSimple']), TGVSimple' -> Maybe Vertex) stack :: Lens' TypeGraph [StackElement] -- | Build a TypeGraph given a set of edges and the TypeInfo environment makeTypeGraph :: MonadReaders TypeInfo m => (GraphEdges TGV') -> m TypeGraph -- | Build a graph from the result of typeGraphEdges, each edge goes from a -- type to one of the types it contains. Thus, each edge represents a -- primitive lens, and each path in the graph is a composition of lenses. graphFromMap :: forall key. (Ord key) => GraphEdges key -> (Graph, Vertex -> ((), key, [key]), key -> Maybe Vertex) class HasTGV a asTGV :: HasTGV a => a -> TGV' class HasTGVSimple a asTGVSimple :: HasTGVSimple a => a -> TGVSimple' simplify :: (MonadReaders TypeGraph m, HasTGV t) => t -> m TGVSimple -- | All the nodes in the TGV (unsimplified) graph, where each field of a -- record is a distinct node. allPathNodes :: forall m. (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => m (Set TGV) -- | All the nodes in the TGVSimple graph, where each field representa a -- different type. allPathStarts :: forall m. (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => m (Set TGVSimple) -- | Return the nodes adjacent to x in the lens graph. lensKeys :: (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => TGVSimple -> m (Set TGV) -- | Each lens represents a single step in a path. The start point is a -- simplified vertex and the endpoint is an unsimplified vertex. allLensKeys :: forall m. (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => m (Map TGVSimple (Set TGV)) -- | Find the node corresponding to the given simple graph node in the full -- graph. tgv :: MonadReaders TypeGraph m => Maybe Field -> TGVSimple -> m TGV -- | Find the simple graph node corresponding to the given type tgvSimple :: (MonadStates ExpandMap m, DsMonad m, MonadReaders TypeInfo m, MonadReaders TypeGraph m) => Type -> m (Maybe TGVSimple) tgvSimple' :: (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => Type -> m TGVSimple -- | Return the nodes reachable from x in the path graph. pathKeys :: (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => TGVSimple -> m (Set TGVSimple) -- | Return the nodes reachable from x in the path graph. pathKeys' :: (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => TGV -> m (Set TGVSimple) -- | Paths go between simple types. allPathKeys :: (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => m (Map TGVSimple (Set TGVSimple)) reachableFrom :: forall m. (DsMonad m, MonadReaders TypeGraph m) => TGV -> m (Set TGV) reachableFromSimple :: forall m. (DsMonad m, MonadReaders TypeGraph m) => TGVSimple -> m (Set TGVSimple) -- | Can we reach the goal type from the start type in this key? goalReachableFull :: (Functor m, DsMonad m, MonadReaders TypeGraph m, HasTGV t) => t -> t -> m Bool -- | Can we reach the goal type in the simplified graph? goalReachableSimple :: (Functor m, DsMonad m, MonadReaders TypeGraph m, HasTGVSimple s) => s -> s -> m Bool -- | Version of goalReachableSimple that first simplifies its argument -- nodes goalReachableSimple' :: (Functor m, DsMonad m, MonadReaders TypeGraph m, HasTGV t) => t -> t -> m Bool -- | When a VertexStatus value is associated with a Type it describes -- alterations in the type graph from the usual default. data VertexStatus typ -- | normal case Vertex :: VertexStatus typ -- | out degree zero - don't create any outgoing edges Sink :: VertexStatus typ -- | replace all outgoing edges with an edge to an alternate type Divert :: typ -> VertexStatus typ -- | add an extra outgoing edge to the given type Extra :: typ -> VertexStatus typ -- | Return the TGV associated with a particular type, with no field -- specified. typeGraphVertex :: (MonadReaders TypeInfo m, MonadStates ExpandMap m, DsMonad m) => Type -> m TGV' -- | Return the TGV associated with a particular type and field. typeGraphVertexOfField :: (MonadReaders TypeInfo m, MonadStates ExpandMap m, DsMonad m) => Field -> Type -> m TGV' instance GHC.Show.Show typ => GHC.Show.Show (Language.Haskell.TH.TypeGraph.TypeGraph.VertexStatus typ) instance (GHC.Base.Monad m, Control.Monad.Readers.MonadReaders [Language.Haskell.TH.TypeGraph.Stack.StackElement] m) => Control.Monad.Readers.MonadReaders [Language.Haskell.TH.TypeGraph.Stack.StackElement] (Control.Monad.Trans.Reader.ReaderT Language.Haskell.TH.TypeGraph.TypeGraph.TypeGraph m) instance Control.Monad.Readers.MonadReaders Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo m => Control.Monad.Readers.MonadReaders Language.Haskell.TH.TypeGraph.TypeInfo.TypeInfo (Control.Monad.Trans.Reader.ReaderT Language.Haskell.TH.TypeGraph.TypeGraph.TypeGraph m) instance Language.Haskell.TH.Ppr.Ppr Language.Haskell.TH.TypeGraph.TypeGraph.TypeGraph instance Language.Haskell.TH.Ppr.Ppr Data.Graph.Vertex instance Language.Haskell.TH.Ppr.Ppr (Data.Graph.Graph, Data.Graph.Vertex -> ((), Language.Haskell.TH.TypeGraph.Vertex.TGV', [Language.Haskell.TH.TypeGraph.Vertex.TGV']), Language.Haskell.TH.TypeGraph.Vertex.TGV' -> GHC.Base.Maybe Data.Graph.Vertex) instance Language.Haskell.TH.Ppr.Ppr (Data.Graph.Graph, Data.Graph.Vertex -> ((), Language.Haskell.TH.TypeGraph.Vertex.TGVSimple', [Language.Haskell.TH.TypeGraph.Vertex.TGVSimple']), Language.Haskell.TH.TypeGraph.Vertex.TGVSimple' -> GHC.Base.Maybe Data.Graph.Vertex) instance Language.Haskell.TH.TypeGraph.TypeGraph.HasTGV Language.Haskell.TH.TypeGraph.Vertex.TGV instance Language.Haskell.TH.TypeGraph.TypeGraph.HasTGVSimple Language.Haskell.TH.TypeGraph.Vertex.TGVSimple instance Data.Default.Class.Default (Language.Haskell.TH.TypeGraph.TypeGraph.VertexStatus typ) -- | The HasStack monad used in MIMO to construct lenses that look deep -- into a record type. However, it does not involve the Path type -- mechanism, and is unaware of View instances and other things that -- modify the type graph. Lets see how it adapts. module Language.Haskell.TH.TypeGraph.Lens -- | Generate lenses to access the fields of the row types. Like -- Control.Lens.TH.makeLenses, but makes lenses for every field, and -- instead of removing the prefix '_' to form the lens name it adds the -- prefix "lens" and capitalizes the first letter of the field. The only -- reason for this function is backwards compatibility, makeLensesFor -- should be used instead. makeTypeGraphLenses :: forall m. (DsMonad m, MonadReaders TypeInfo m, MonadReaders TypeGraph m, MonadStates ExpandMap m) => m [Dec] -- | Build the list of pairs used by makeLensesFor. lensNamePairs :: Quasi m => (Name -> Name -> Name -> (String, String)) -> Name -> m [(String, String)] -- | Function to compute the arity or kind of a Type, the number of type -- parameters that need to be applied to get a concrete type. module Language.Haskell.TH.TypeGraph.Arity -- | Compute the arity of a type - the number of type parameters that must -- be applied to it in order to obtain a concrete type. I'm not quite -- sure I understand the relationship between this and -- freeTypeVars. typeArity :: Quasi m => Type -> m Int