This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor Main | |
new create(env: Env) => | |
None | |
primitive TokenCount | |
primitive TokenItem | |
type Token[A: Any #share] is ((TokenCount, None, USize) | (TokenItem, A)) | |
interface Tokens[A: Any #share] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Counter | |
var value: U32 = 0 | |
fun ref increment(delta: Delta ref) => | |
value = value + 1 | |
delta.diff = delta.diff + 1 | |
class Delta | |
var diff: U32 = 0 | |
var foo: Any box = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use "debug" | |
class Foo | |
new create() => | |
Debug("create called") | |
fun apply() => | |
Debug("apply called") | |
actor Main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor Main | |
var max: I32 = 100 | |
let sink: Prime | |
new create(env: Env) => | |
try | |
max = env.args(1)?.i32()? | |
end | |
let n: I32 = 2 | |
sink = Prime(env, n) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JsonParser | |
let _input: String | |
var _index: ISize = 0 | |
new create(input: String) => | |
_input = input | |
fun _char(): U32 ? => _input.utf32(_index)?._1 | |
fun _atom(c: U32): Bool => (c >= 'a') and (c <= 'z') | |
fun _digit(c: U32): Bool => (c >= '0') and (c <= '9') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class JsonParser | |
let _input: String | |
var _index: ISize = 0 | |
new create(input: String) => | |
_input = input | |
fun _current_char(): U32 ? => _input.utf32(_index)?._1 | |
fun _is_atom(c: U32): Bool => (c >= 'a') and (c <= 'z') | |
fun _is_digit(c: U32): Bool => (c >= '0') and (c <= '9') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor Main | |
new create(env: Env) => | |
env.out.print("Hello, world!") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use "net" | |
use "time" | |
use "json" | |
use "net/http" | |
use "promises" | |
use "buffered" | |
use "collections" | |
use @time[USize](ptr: USize) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface tag Source[A: Any val] | |
be poll(out: Out[A]) | |
type Out[A: Any val] is {(A)} val | |
actor Func2[A: Any val, B: Any val, C: Any val] is Source[C] | |
let a: Source[A] | |
let b: Source[B] | |
let fn: {(A, B): C} val | |
new create(a': Source[A], b': Source[B], fn': {(A, B): C} val) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor Main | |
new create(env: Env) => | |
env.out.print("Hello, world!") |