scc src adj gr takes a directed graph gr represented as a list
of adjacency descriptors of type 'a. Each descriptor d in gr
contains a single source vertex src d. The function adj takes
a vertex visitor fn and a descriptor d, and iterates over d,
applying fn to each vertex adjacent to src d. It is allowed
to apply fn to vertices outside gr. The result of scc is
a list of strongly connected components in a topological order.
Each component is represented as a non-empty list of descriptors
whose sources constitute the component, together with a Boolean
flag indicating the presence of cycles inside the component.
This flag is always true for non-singleton components.