Skip to content

Various fixes to 0.2.0 release.#37

Merged
sigilante merged 11 commits into
masterfrom
claude/goth-language-overview-fOWhO
Jan 31, 2026
Merged

Various fixes to 0.2.0 release.#37
sigilante merged 11 commits into
masterfrom
claude/goth-language-overview-fOWhO

Conversation

@sigilante
Copy link
Copy Markdown
Owner

No description provided.

sigilante and others added 11 commits January 30, 2026 18:21
Curried 2-arg primitives for binary file I/O, enabling entropy
from /dev/urandom. ⧏ 8 "/dev/urandom" returns [8]I64 of byte
values 0–255. ⧐ writes a byte array to a file path.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Implement fold as 3-arg primitive (f acc arr) with evaluator access
  for calling closures, intercepted in apply_once before prim dispatch.
  Unicode alias ⌿.
- Add bitwise primitives: bitand, bitor, bitxor/⊻, shl, shr.
  All operate on I64 with currying support.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
… polymorphic option/result, apply_type

- #8: Remove duplicate functions between prelude/math/list stdlib modules
  - isEven/isOdd removed from math.goth (authoritative in prelude)
  - clamp removed from math.goth (authoritative in prelude)
  - pair/fst/snd/mapPair removed from list.goth (authoritative in prelude)

- #10: Fix LANGUAGE.md false claims
  - Replace -- comments with # in all code examples
  - Add ℤ, ℕ, F, String to primitive types table
  - Fix integer description from "64-bit signed" to "arbitrary precision (i128)"
  - Change all example signatures from I64 to ℤ (idiomatic type)
  - Fix let binding syntax from ← to = (both accepted, = is primary)
  - Update primitives reference signatures to use ℤ

- #11: Rewrite option.goth and result.goth with generic polymorphic API
  - option.goth: 74 monomorphic functions → 28 generic functions
  - result.goth: 81 monomorphic functions → 32 generic functions
  - Eliminates type suffix explosion (someI/someF/someB → some, etc.)
  - Uses 0 as universal dead placeholder for None/unused slots
  - Works because evaluator is type-erased at runtime
  - none takes ⟨⟩ arg (type variable in bare constant becomes closure)

- #12: Fix apply_type in subst.rs to handle all Type variants
  - Add Variant, Exists, App, Effectful, Interval cases
  - Remove catch-all _ => ty.clone() fallback (now exhaustive)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
Type checker: cast validation (as? returns Option), record update,
LetRec annotations, do-block type threading, fresh Forall variables.

Safety: replace unsafe static mut terminal state with Mutex + atexit +
catch_unwind. eval_filter propagates predicate errors instead of
silently dropping elements. Closure equality includes captured env.

New: fromChars primitive for string round-tripping. OpDecl pretty
printing (was todo!() panic). Operator precedence delegates to single
source of truth.

Docs: CHANGELOG.md, 8 undocumented operators in LANGUAGE.md, integer
type clarification. Deps: thiserror 1.0 → 2.0. Cargo.toml metadata.
Remove empty example directories.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@sigilante sigilante merged commit 8a52e26 into master Jan 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant