th-sccs-0.0.0.20110723: Binding group analysis in Template Haskell

Language.Haskell.TH.SCCs

Synopsis

Documentation

binding_group :: Name -> Q (Set Name)Source

Wrapper for scc that forgets the distinction between a single acyclic SCC and a singly recursive SCC

binding_groups :: [Name] -> Q [Set Name]Source

Wrapper for sccs that forgets the distinction between a single acyclic SCC and a singly recursive SCC

scc :: Name -> Q (Either Name (Set Name))Source

Computes the SCC that includes the declaration of the given name; Left is a singly acyclic declaration, Right is a mutually recursive group (possibly of size one: singly recursion).

sccs :: [Name] -> Q [Either Name (Set Name)]Source

Computes all SCCs for the given names (including those it dominates)

class Dependencies t whereSource

Calculate the type declarations upon which this construct syntactically depends. The first argument tracks the bindings traversed; use td_descend to maintain it.

td_recur :: Dependencies t => [Name] -> t -> Set NameSource

Just a bit shorter than type_dependencies'

td_descend :: (Named a, Dependencies t) => [Name] -> a -> t -> Set NameSource

Shorter than type_dependencies' and also adds the name of the seconda argument to the tracked bindings

class Named t whereSource

This is semantically murky: it's just the name of anything that "naturally" defines a name; error if it doesn't.

Methods

name_of :: t -> NameSource

Instances

Named Pat 
Named Dec 
Named Info 
Named Con 
Named RecordField 

printQ :: Show a => Maybe String -> Q a -> Q [Dec]Source

Helpful for debugging generated code