Skip to content

Instantly share code, notes, and snippets.

@okram
Created October 13, 2020 19:57
Show Gist options
  • Save okram/9b4702894aa319d99bdc9977a82cb8a9 to your computer and use it in GitHub Desktop.
Save okram/9b4702894aa319d99bdc9977a82cb8a9 to your computer and use it in GitHub Desktop.
(nat;attr);(nat;attr) => edge
((nat;attr);(nat;attr)),
(vertex;vertex),
[combine,(vertex<=(nat;attr)[split,('id'->nat<=(nat;attr)[get,0,_],
'attrs'->attr<=(nat;attr)[get,1,_])];
vertex<=(nat;attr)[split,('id'->nat<=(nat;attr)[get,0,_],
'attrs'->attr<=(nat;attr)[get,1,_])])],
[split,('outV'->vertex<=(vertex;vertex)[get,0,_],
'inV'->vertex<=(vertex;vertex)[get,1,_])],
edge<=(vertex;vertex)
[split,('outV'->vertex<=(vertex;vertex)[get,0,_],
'inV'->vertex<=(vertex;vertex)[get,1,_])]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment