-- 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.32 -- | The Expanded class helps keep track of which Type -- values have been fully expanded to a canonical form. This lets us use -- the Eq and Ord relationships on Type and -- Pred values when reasoning about instance context. What the -- expandType function does is use the function from -- th-desugar to replace occurrences of ConT name with -- the associated Type if name is a declared type synonym -- TySynD name _ typ. For convenience, a wrapper type E -- is provided, along with the Expanded instances E -- Type and E Pred. Now the expandType and -- expandPred functions can be used to return values of type E -- Type and E Pred respectively. -- -- Instances Expanded Type Type and Expanded Pred Pred -- are provided in Language.Haskell.TH.Context.Unsafe, for when -- less type safety is required. module Language.Haskell.TH.TypeGraph.Expand -- | A concrete type used to mark type which have been expanded newtype E a E :: a -> E a [_unE] :: E a -> a unE :: Iso (E a_akEX) (E a_anii) a_akEX a_anii -- | The state type used to memoize expansions. type ExpandMap = Map Type (E Type) -- | Apply the th-desugar expand function to a Type and mark it as -- expanded. expandType :: (DsMonad m, MonadStates ExpandMap m) => Type -> m (E Type) -- | Apply the th-desugar expand function to a Pred and mark it as -- expanded. Note that the definition of Pred changed in -- template-haskell-2.10.0.0. expandPred :: (DsMonad m, MonadStates ExpandMap m) => Type -> m (E Type) -- | Expand a list of Type and build an expanded ClassP -- Pred. expandClassP :: (DsMonad m, MonadStates ExpandMap m) => Name -> [Type] -> m (E Type) instance Data.Data.Data a => Data.Data.Data (Language.Haskell.TH.TypeGraph.Expand.E a) instance GHC.Show.Show a => GHC.Show.Show (Language.Haskell.TH.TypeGraph.Expand.E a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Language.Haskell.TH.TypeGraph.Expand.E a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Language.Haskell.TH.TypeGraph.Expand.E a) instance Language.Haskell.TH.Ppr.Ppr a => Language.Haskell.TH.Ppr.Ppr (Language.Haskell.TH.TypeGraph.Expand.E a) instance Language.Haskell.TH.Syntax.Lift (Language.Haskell.TH.TypeGraph.Expand.E Language.Haskell.TH.Syntax.Type) 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. pprint' :: (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' :: (Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex) -> key -> [key] -- | Return a key's list of reachable keys reachable' :: (Graph, Vertex -> (node, key, [key]), key -> Maybe Vertex) -> key -> [key] newtype L a L :: a -> L a -- | 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.Ppr.Ppr a => Language.Haskell.TH.Ppr.Ppr (Language.Haskell.TH.TypeGraph.Prelude.L [a]) 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 instance Language.Haskell.TH.Syntax.Lift a => Language.Haskell.TH.Syntax.Lift (Data.Set.Base.Set a) instance (Language.Haskell.TH.Syntax.Lift a, Language.Haskell.TH.Syntax.Lift b) => Language.Haskell.TH.Syntax.Lift (Data.Map.Base.Map a b) -- | 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 -- | A fold on the shape of the constructors of a DataD or NewtypeD record. module Language.Haskell.TH.TypeGraph.Shape type Field = (Name, Name, Either Int Name) constructorFields :: Name -> Con -> [Field] data FieldType Positional :: Int -> StrictType -> FieldType Named :: VarStrictType -> FieldType fieldType :: FieldType -> Type constructorFieldTypes :: Con -> [FieldType] 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.TypeGraph.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 -- | 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) tgv :: TGVSimple -> 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 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 (Name, Name, Either Int Name))) 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 :: 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.TypeGraph.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 -- | 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 :: (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 -- | 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 -- | 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 :: (Ord key) => GraphEdges key -> (Graph, Vertex -> ((), key, [key]), key -> Maybe Vertex) -- | All the nodes in the TGV (unsimplified) graph, where each field of a -- record is a distinct node. allPathNodes :: (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 :: (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 :: (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => m (Map TGVSimple (Set TGV)) -- | 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) -- | Paths go between simple types. allPathKeys :: (DsMonad m, MonadStates ExpandMap m, MonadReaders TypeGraph m, MonadReaders TypeInfo m) => m (Map TGVSimple (Set TGVSimple)) reachableFrom :: (DsMonad m, MonadReaders TypeGraph m) => TGV -> m (Set TGV) reachableFromSimple :: (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) => TGV -> TGV -> m Bool -- | Can we reach the goal type in the simplified graph? goalReachableSimple :: (Functor m, DsMonad m, MonadReaders TypeGraph m) => TGVSimple -> TGVSimple -> m Bool -- | Version of goalReachableSimple that first simplifies its argument -- nodes goalReachableSimple' :: (Functor m, DsMonad m, MonadReaders TypeGraph m) => TGV -> TGV -> 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 set of adjacent vertices according to the default type -- graph - i.e. the one determined only by the type definitions, not by -- any additional hinting function. adjacent :: (MonadReaders TypeInfo m, DsMonad m, MonadStates ExpandMap m) => TGV -> m (Set TGV) -- | 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) => (Name, Name, Either Int Name) -> 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 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 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 :: (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