allDependencies :: (Eq a, Ord a) => (a -> [a]) -> a -> [a]
allDependencies callees a = f [a]
  where
  f sofar
    | sofar == next = sofar
    | otherwise     = f next
    where
    next = sort $ nub $ sofar ++ concatMap callees sofar
allDependencies :: (Eq a, Ord a) => (a -> [a]) -> a -> [a]
allDependencies callees a = f [a]
  where
  f sofar
    | sofar == next = sofar
    | otherwise     = f next
    where
    next = sort $ nub $ sofar ++ concatMap callees sofar
allDependencies callees a = f [a]
  where
  f sofar
    | sofar == next = sofar
    | otherwise     = f next
    where
    next = sort $ nub $ sofar ++ concatMap callees sofar