Skip to content

Instantly share code, notes, and snippets.

@okram
Created November 5, 2020 18:29
Embed
What would you like to do?
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