Dever v0.0.2
This commit is contained in:
commit
e6e175ebcf
816 files changed
+120349
No files matched your search
@@ -0,0 +1,73 @@
|
||||
type Item { text: Text }
|
||||
|
||||
loop first(values: AsyncStream<Int>) (out: Int?)
|
||||
| each value in values | result |
|
||||
| out | first value |
|
||||
|
||||
loop summary(values: AsyncStream<Int>) (first: Int?, count: Int, sum: Int)
|
||||
| each value in values | result |
|
||||
| first | first value |
|
||||
| count | count |
|
||||
| sum | sum value |
|
||||
|
||||
loop records(values: AsyncStream<Item>) (out: List<Item>)
|
||||
| each value in values | result |
|
||||
| out | list value |
|
||||
|
||||
loop nulls(values: AsyncStream<Int?>) (out: List<Int?>)
|
||||
| each value in values | result |
|
||||
| out | list value |
|
||||
|
||||
guard(value: Int) (out: Int) { check value > 0 else Invalid
|
||||
out = value }
|
||||
loop checked(values: AsyncStream<Int>) (out: Int)
|
||||
| each value in values | result |
|
||||
| out | sum guard(value) |
|
||||
|
||||
flow main() (out: Int)
|
||||
| step | kind | do |
|
||||
| values | calc | stream([1, 2, 3]) |
|
||||
| result | loop | summary(values) |
|
||||
| out | calc | result.sum |
|
||||
|
||||
flow bytes() (out: Int)
|
||||
| step | kind | do |
|
||||
| values | calc | stream(dever.bytes.fromText("ABC")) |
|
||||
| result | loop | summary(values) |
|
||||
| out | calc | result.sum |
|
||||
|
||||
flow channel() (first: Int?, next: Int?)
|
||||
| step | kind | do |
|
||||
| queue | calc | channel<Int>(2) |
|
||||
| - | calc | send(queue, 1) |
|
||||
| - | calc | send(queue, 2) |
|
||||
| values | calc | stream(queue) |
|
||||
| first | loop | first(values) |
|
||||
| next | calc | receive(queue) |
|
||||
| - | calc | close(queue) |
|
||||
|
||||
flow ticking(period: Int) (out: Int?)
|
||||
| step | kind | do |
|
||||
| values | flow | dever.task.ticks(period) |
|
||||
| out | loop | first(values) |
|
||||
|
||||
flow empty() (out: List<Int?>)
|
||||
| step | kind | do |
|
||||
| values: AsyncStream<Int?> | calc | stream([]) |
|
||||
| out | loop | nulls(values) |
|
||||
|
||||
flow closeAlias() (out: Int?)
|
||||
| step | kind | do |
|
||||
| values | calc | stream([1, 2]) |
|
||||
| alias | calc | values |
|
||||
| - | calc | close(alias) |
|
||||
| out | loop | first(values) |
|
||||
|
||||
ignore(value: Int) () {}
|
||||
loop drain(values: AsyncStream<Int>) ()
|
||||
| each value in values | result |
|
||||
| - | do ignore(value) |
|
||||
|
||||
loop noPull(values: AsyncStream<Int>) (out: List<Int>)
|
||||
| each value in values | take | result |
|
||||
| out | 0 | list value |
|
||||
Reference in new issue
Block a user