Skip to content

Instantly share code, notes, and snippets.

@ionoy
Created March 12, 2014 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ionoy/9506260 to your computer and use it in GitHub Desktop.
Save ionoy/9506260 to your computer and use it in GitHub Desktop.
private GetTypeDependencies(typePath : list[string]) : IEnumerable[string]
{
//This is to avoid recursive dependencies
match(typePath)
{
| typeName :: _ =>
mutable lst;
if(_dependencyMap.TryGetValue(typeName, out lst))
lst.Concat(lst.Where(d => typePath.All(p => d != p))
.SelectMany(d => GetTypeDependencies(d :: typePath)))
.Distinct()
else [];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment