Skip to content

Instantly share code, notes, and snippets.

@okram
Last active October 14, 2020 21:32
Show Gist options
  • Save okram/d4c06a947f66198039b4e858c59d9fbf to your computer and use it in GitHub Desktop.
Save okram/d4c06a947f66198039b4e858c59d9fbf to your computer and use it in GitHub Desktop.
(int;int) => (nat;nat)
..yields:
(nat;nat)<=(int;int)[combine,(nat<=int[is,bool<=int[gt,0]];nat<=int[is,bool<=int[gt,0]])]
(nat;nat)<=(int;int)[combine,(nat<=int[is,bool<=int[gt,0]];nat<=int[is,bool<=int[gt,0]])]
^ ^ | |
| | [is] [is]
| | | |
\---\-----/----/
@okram
Copy link
Author

okram commented Oct 14, 2020

(int;nat) => edge

edge<=(int;nat)[combine,
                 (vertex<=int[is,bool<=int[gt,0]][split,('id'->nat)];vertex<=nat[split,('id'->nat)])]      // (make int a vertex;make nat a vertex)
               [split,('outV'->vertex<=(vertex;vertex)[get,0,_],'inV'->vertex<=(vertex;vertex)[get,1,_])]  // (make vertex pair and edge)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment