Skip to content

Instantly share code, notes, and snippets.

@Theodus
Theodus / interaction_combinators.py
Created August 19, 2023 14:29 — forked from cheery/interaction_combinators.py
Interaction combinators
# -*- encoding: utf-8 -*-
# Implements symmetric interaction combinators
# I took some ideas from Victor Maia's projects.
# Bunch of cells form an interaction net.
# It's a half-edge graph.
class Cell:
def __init__(self, kind):
self.ports = (Port(self), Port(self), Port(self))
self.kind = kind # 'era', 'con', 'fan'
(lldb) p ast_print(child)
(seq
(tuple
(seq
(let
((id name) [nominal (id $0) (id String) x val x x])
(nominal (id $0) (id String) x val x x)
[nominal (id $0) (id String) x val x x]
)
[nominal (id $0) (id String) x val x x]
Error:
/home/theodus/stuff/ponyc/packages/builtin/seq.pony:83:5: type argument is outside its constraint
_fold[B](0, f, consume acc)
^
Info:
/home/theodus/stuff/ponyc/packages/builtin/seq.pony:83:11: argument: B #any
_fold[B](0, f, consume acc)
^
/home/theodus/stuff/ponyc/packages/builtin/seq.pony:85:13: constraint: B #any (bind)
fun _fold[B](i: USize, f: {(B!, this->A!): B^} box, acc: B): B =>