-
Notifications
You must be signed in to change notification settings - Fork 8
/
DSL_IDEAS
91 lines (58 loc) · 1.49 KB
/
DSL_IDEAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
step a + b, Left => c # split
# OR
step a, Right => b, Left => c # split
step b + b2 + b3 + d # path
step c + c2 + d
step d
# Introspect adds Start and end?
step a + b + c + d # long path
step b, Left => b # loop
# railway
step a + b + c
start set_model + decide, A => stripe, B => int1, C => int2
path stripe + send_invoice, Left =>
railway model, build, validate, persist
railway model, build, validate, Fail(log), persist, Fail(log_again),
end(End.failure)
end(End.success)
path(a, decider,
{
A => railway(charge, invoice, {Left=>"End.failure", Right=>"End.success"}),
B => railway(int1, int_invoice, {Left=>"End.failure", Right=>"End.success"})
C => railway(int2, Right=>"int_invoice", {Left=>"End.failure", Right=>"End.success"})
}
)
path(charge =>{Left=>fail), invoice=>{Left=>fail})
magnetic_to: [*]
on: Track(*)
Path(
{a, :a, R+L-}
{b, :b, R+L-}
{c, :c, R+L-}, -=>a
)
Path(
+{a, :a, R+L-}, +=>b, -=>b
+{b, :b, R+L-} +=>c, -=>c
+{c, :c, R+L-}, -=>a +=>ES, -=>a
+{ES, :ES, }
)
# intermediate, e.g. from editor:
# allows {:replace} and {:implement}, wires correct signals
# to outgoing connections by semantic
A{ +-} => {+=>B, -=>B}
B{ +-} => {+=>C, -=>C}
C{ +-} => {+=>ES, -=>A}
ES{}
=> circuit
Path(
{a, :a, R+L-}, +=>b, -=>b
{b, :b, R+L-} +=>c, -=>c
{c, :c, R+L-}, -=>a +=>ES, -=>a
{ES, :ES, }
)
task [A, id: :a], [B, id: b], [C, id: c, outputs: {..}]
circuit(
A,
B,
C=>{..}
)