Strongly connected components

A function for strongly connected components of directed graphs in general was borrowed from HBC and tidied up by Iavor (HBC is implemented in Lazy ML, not Haskell):
scc :: (Eq a) => Graph a -> [Graph a]
sccEq :: EqOp a -> Graph a -> [Graph a]
type Graph a = Assoc a [a]
See module NewSCC.

A reusable wrapper function, that applies scc to declarations is used in the type checker:

sccD :: (Eq i, FreeNames i d, DefinedNames i d) => [d] -> [[d]]
See module TiSCC.