Skip to content

Instantly share code, notes, and snippets.

@nox
Created October 30, 2012 16:43
Show Gist options
  • Save nox/3981420 to your computer and use it in GitHub Desktop.
Save nox/3981420 to your computer and use it in GitHub Desktop.
wtf is sofs useful for
1> ParentChildRel = sofs:relation([{michel,gertrude},{robert,mickael},{brigitte,gertrude},{brigitte,sophia}], [{parent, child}]).
{'Set',[{brigitte,gertrude},
{brigitte,sophia},
{michel,gertrude},
{robert,mickael}],
{parent,child}}
2> ParentChildrenRel = sofs:relation_to_family(ParentChildRel).
{'Set',[{brigitte,[gertrude,sophia]},
{michel,[gertrude]},
{robert,[mickael]}],
{parent,[child]}}
3> sofs:to_external(ParentChildrenRel).
[{brigitte,[gertrude,sophia]},
{michel,[gertrude]},
{robert,[mickael]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment