@shd101wyy/yo 0.1.25 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/skills/yo-async-effects/async-effects-recipes.md +6 -6
- package/.github/skills/yo-core-patterns/core-patterns-cheatsheet.md +4 -0
- package/.github/skills/yo-syntax/syntax-cheatsheet.md +5 -0
- package/out/cjs/index.cjs +545 -547
- package/out/cjs/yo-cli.cjs +605 -606
- package/out/cjs/yo-lsp.cjs +552 -554
- package/out/esm/index.mjs +503 -505
- package/out/types/src/codegen/codegen-c.d.ts +2 -2
- package/out/types/src/codegen/functions/collection.d.ts +2 -2
- package/out/types/src/codegen/functions/context.d.ts +3 -2
- package/out/types/src/codegen/types/collection.d.ts +2 -2
- package/out/types/src/codegen/utils/index.d.ts +3 -1
- package/out/types/src/doc/builder.d.ts +2 -2
- package/out/types/src/evaluator/calls/closure-type.d.ts +2 -2
- package/out/types/src/evaluator/calls/record-type.d.ts +11 -0
- package/out/types/src/evaluator/context.d.ts +8 -9
- package/out/types/src/evaluator/index.d.ts +3 -3
- package/out/types/src/evaluator/types/record.d.ts +14 -0
- package/out/types/src/evaluator/types/validation.d.ts +2 -2
- package/out/types/src/evaluator/values/anonymous-module.d.ts +5 -5
- package/out/types/src/evaluator/values/impl.d.ts +1 -1
- package/out/types/src/expr.d.ts +1 -4
- package/out/types/src/function-value.d.ts +1 -1
- package/out/types/src/lsp/document-manager.d.ts +1 -1
- package/out/types/src/module-manager.d.ts +3 -3
- package/out/types/src/types/creators.d.ts +3 -4
- package/out/types/src/types/definitions.d.ts +8 -19
- package/out/types/src/types/guards.d.ts +3 -3
- package/out/types/src/types/tags.d.ts +0 -1
- package/out/types/src/types/utils.d.ts +1 -1
- package/out/types/src/value-tag.d.ts +0 -1
- package/out/types/src/value.d.ts +6 -13
- package/out/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/std/error.yo +6 -6
- package/std/prelude.yo +1 -7
- package/out/types/src/evaluator/calls/module-type.d.ts +0 -11
- package/out/types/src/evaluator/types/module.d.ts +0 -19
package/package.json
CHANGED
package/std/error.yo
CHANGED
|
@@ -19,19 +19,19 @@ export AnyError;
|
|
|
19
19
|
/// Allows using `String` directly as an error type.
|
|
20
20
|
impl(String, Error());
|
|
21
21
|
|
|
22
|
-
/// Non-resumable exception handling effect
|
|
22
|
+
/// Non-resumable exception handling effect record.
|
|
23
23
|
/// Use `throw` to raise an `AnyError` and abort the current computation.
|
|
24
|
-
Exception ::
|
|
24
|
+
Exception :: struct(
|
|
25
25
|
throw : (fn(forall(ResumeType : Type), error : AnyError) -> ResumeType)
|
|
26
26
|
);
|
|
27
27
|
export Exception;
|
|
28
28
|
|
|
29
29
|
|
|
30
|
-
/// Creates a resumable exception
|
|
30
|
+
/// Creates a resumable exception effect record parameterized by the resume type.
|
|
31
31
|
/// Unlike `Exception`, the handler can return a value to resume the computation.
|
|
32
|
-
ResumableException :: (fn(comptime(ResumeType) : Type) -> comptime(
|
|
33
|
-
|
|
32
|
+
ResumableException :: (fn(comptime(ResumeType) : Type) -> comptime(Type))(
|
|
33
|
+
struct(
|
|
34
34
|
throw : (fn(error : AnyError) -> ResumeType)
|
|
35
35
|
)
|
|
36
36
|
);
|
|
37
|
-
export ResumableException;
|
|
37
|
+
export ResumableException;
|
package/std/prelude.yo
CHANGED
|
@@ -4228,9 +4228,6 @@ TypeInfo :: enum(
|
|
|
4228
4228
|
),
|
|
4229
4229
|
|
|
4230
4230
|
// Meta types
|
|
4231
|
-
Module(
|
|
4232
|
-
fields : ComptimeList(TypeFieldInfo)
|
|
4233
|
-
),
|
|
4234
4231
|
Trait(
|
|
4235
4232
|
fields : ComptimeList(TraitFieldInfo),
|
|
4236
4233
|
kind : TraitKind
|
|
@@ -4281,9 +4278,6 @@ impl(TypeInfo,
|
|
|
4281
4278
|
is_trait : (fn(comptime(self) : TypeInfo) -> comptime(bool))(
|
|
4282
4279
|
match(self, .Trait(_, _) => true, _ => false)
|
|
4283
4280
|
),
|
|
4284
|
-
is_module : (fn(comptime(self) : TypeInfo) -> comptime(bool))(
|
|
4285
|
-
match(self, .Module(_) => true, _ => false)
|
|
4286
|
-
),
|
|
4287
4281
|
is_void : (fn(comptime(self) : TypeInfo) -> comptime(bool))(
|
|
4288
4282
|
match(self, .Void => true, _ => false)
|
|
4289
4283
|
),
|
|
@@ -6190,7 +6184,7 @@ export JoinHandle;
|
|
|
6190
6184
|
///
|
|
6191
6185
|
/// Provides `io.async`, `io.await`, `io.spawn`, and `io.state` operations.
|
|
6192
6186
|
/// Automatically injected into `main` when declared with `using(io : IO)`.
|
|
6193
|
-
IO ::
|
|
6187
|
+
IO :: struct(
|
|
6194
6188
|
/// Create a new `Future` from an async closure.
|
|
6195
6189
|
async : (fn(forall(T : Type, ...(E)), action : Impl(Fn(using(...(E))) -> T)) -> Impl(Future(T, ...(E)))),
|
|
6196
6190
|
/// Await a `Future`, suspending until its result is ready.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type Environment } from "../../env";
|
|
2
|
-
import { type Expr } from "../../expr";
|
|
3
|
-
import type { ModuleType } from "../../types/definitions";
|
|
4
|
-
import type { EvaluatorContext, ModuleTypeCallResult } from "../context";
|
|
5
|
-
export declare function tryToImplementModuleWithArgumentsByModuleType({ moduleExpr, moduleType, argExprs, callerEnv, context, }: {
|
|
6
|
-
moduleExpr: Expr;
|
|
7
|
-
moduleType: ModuleType;
|
|
8
|
-
argExprs: Expr[];
|
|
9
|
-
callerEnv: Environment;
|
|
10
|
-
context: EvaluatorContext;
|
|
11
|
-
}): ModuleTypeCallResult;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { Environment } from "../../env";
|
|
2
|
-
import { type Expr, type FnCallExpr } from "../../expr";
|
|
3
|
-
import type { ModuleField } from "../../types/definitions";
|
|
4
|
-
import type { EvaluatorContext } from "../context";
|
|
5
|
-
export declare function evaluateModuleField({ expr, moduleFieldIndex, env, context, isForEvaluatingModuleType, }: {
|
|
6
|
-
expr: Expr;
|
|
7
|
-
moduleFieldIndex: number;
|
|
8
|
-
env: Environment;
|
|
9
|
-
context: EvaluatorContext;
|
|
10
|
-
isForEvaluatingModuleType: boolean;
|
|
11
|
-
}): {
|
|
12
|
-
field: ModuleField;
|
|
13
|
-
env: Environment;
|
|
14
|
-
};
|
|
15
|
-
export declare function evaluateModuleType({ expr, env, context, }: {
|
|
16
|
-
expr: FnCallExpr;
|
|
17
|
-
env: Environment;
|
|
18
|
-
context: EvaluatorContext;
|
|
19
|
-
}): FnCallExpr;
|