@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.
Files changed (38) hide show
  1. package/.github/skills/yo-async-effects/async-effects-recipes.md +6 -6
  2. package/.github/skills/yo-core-patterns/core-patterns-cheatsheet.md +4 -0
  3. package/.github/skills/yo-syntax/syntax-cheatsheet.md +5 -0
  4. package/out/cjs/index.cjs +545 -547
  5. package/out/cjs/yo-cli.cjs +605 -606
  6. package/out/cjs/yo-lsp.cjs +552 -554
  7. package/out/esm/index.mjs +503 -505
  8. package/out/types/src/codegen/codegen-c.d.ts +2 -2
  9. package/out/types/src/codegen/functions/collection.d.ts +2 -2
  10. package/out/types/src/codegen/functions/context.d.ts +3 -2
  11. package/out/types/src/codegen/types/collection.d.ts +2 -2
  12. package/out/types/src/codegen/utils/index.d.ts +3 -1
  13. package/out/types/src/doc/builder.d.ts +2 -2
  14. package/out/types/src/evaluator/calls/closure-type.d.ts +2 -2
  15. package/out/types/src/evaluator/calls/record-type.d.ts +11 -0
  16. package/out/types/src/evaluator/context.d.ts +8 -9
  17. package/out/types/src/evaluator/index.d.ts +3 -3
  18. package/out/types/src/evaluator/types/record.d.ts +14 -0
  19. package/out/types/src/evaluator/types/validation.d.ts +2 -2
  20. package/out/types/src/evaluator/values/anonymous-module.d.ts +5 -5
  21. package/out/types/src/evaluator/values/impl.d.ts +1 -1
  22. package/out/types/src/expr.d.ts +1 -4
  23. package/out/types/src/function-value.d.ts +1 -1
  24. package/out/types/src/lsp/document-manager.d.ts +1 -1
  25. package/out/types/src/module-manager.d.ts +3 -3
  26. package/out/types/src/types/creators.d.ts +3 -4
  27. package/out/types/src/types/definitions.d.ts +8 -19
  28. package/out/types/src/types/guards.d.ts +3 -3
  29. package/out/types/src/types/tags.d.ts +0 -1
  30. package/out/types/src/types/utils.d.ts +1 -1
  31. package/out/types/src/value-tag.d.ts +0 -1
  32. package/out/types/src/value.d.ts +6 -13
  33. package/out/types/tsconfig.tsbuildinfo +1 -1
  34. package/package.json +1 -1
  35. package/std/error.yo +6 -6
  36. package/std/prelude.yo +1 -7
  37. package/out/types/src/evaluator/calls/module-type.d.ts +0 -11
  38. package/out/types/src/evaluator/types/module.d.ts +0 -19
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shd101wyy/yo",
3
3
  "displayName": "Yo",
4
- "version": "0.1.25",
4
+ "version": "0.1.26",
5
5
  "main": "./out/cjs/index.cjs",
6
6
  "module": "./out/esm/index.mjs",
7
7
  "types": "./out/types/src/index.d.ts",
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 module.
22
+ /// Non-resumable exception handling effect record.
23
23
  /// Use `throw` to raise an `AnyError` and abort the current computation.
24
- Exception :: module(
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 module parameterized by the resume type.
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(Module))(
33
- module(
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 :: module(
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;