Skip to content

Instantly share code, notes, and snippets.

@okram
Created November 5, 2020 18:29
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 okram/39483e1451f8308fa8d9ca7e3c327107 to your computer and use it in GitHub Desktop.
Save okram/39483e1451f8308fa8d9ca7e3c327107 to your computer and use it in GitHub Desktop.
mmlang> int => vertex
==>vertex<=int[is,bool<=int[gt,0]]
[coerce,vertex{?}<=nat{?}[split,('id'->nat)]]
mmlang> int => vertex => -<(_;_)
==>(vertex:('id'->nat);vertex:('id'->nat))<=int[is,bool<=int[gt,0]]
[coerce,vertex{?}<=nat{?}[split,('id'->nat)]]
[split,(vertex:('id'->nat);vertex:('id'->nat))]
mmlang> int => vertex => -<(_;_) => edge
==>edge<=int[is,bool<=int[gt,0]]
[coerce,vertex{?}<=nat{?}[split,('id'->nat)]]
[split,(vertex:('id'->nat);vertex:('id'->nat))]
[coerce,edge{?}<=(vertex:('id'->nat);vertex:('id'->nat)){?}
[split,('outV'->vertex<=(vertex:('id'->nat);vertex:('id'->nat))[get,0,_],
'inV'->vertex<=(vertex:('id'->nat);vertex:('id'->nat))[get,1,_])]]
mmlang> 5 => vertex => -<(_;_) => edge
==>edge:('outV'->vertex:('id'->nat:5),'inV'->vertex:('id'->nat:5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment