Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion fjs/asn.1/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
type Unpacked,
type Vec
} from "../types/bit_vec/module.f.ts"
import { identity } from "../types/function/module.f.ts"
import { identity } from "../types/function/module.f.mjs"
import { max } from "../types/function/compare/module.f.ts"
import { encode as b128encode, decode as b128decode } from "../basen/base128/module.f.ts"

Expand Down
4 changes: 2 additions & 2 deletions fjs/base_n/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
*/
import { msb, lsb, type Vec, vec, chunkList, unpack } from '../types/bit_vec/module.f.ts'
import { fold, type List } from '../types/list/module.f.ts'
import { compose } from '../types/function/module.f.ts'
import type { Nullable } from '../types/nullable/module.f.ts'
import { compose } from '../types/function/module.f.mjs'
import type { Nullable } from '../types/nullable/module.f.mjs'

const { unpackSplit } = msb

Expand Down
2 changes: 1 addition & 1 deletion fjs/basen/base64/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @module
*/
import { msb, type Vec, length, vec, maxLength } from "../../types/bit_vec/module.f.ts"
import type { Nullable } from "../../types/nullable/module.f.ts"
import type { Nullable } from "../../types/nullable/module.f.mjs"
import { baseN } from "../../base_n/module.f.ts"

const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
Expand Down
2 changes: 1 addition & 1 deletion fjs/basen/cbase32/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @module
*/
import { msb, lsb, type Vec, length, vec, empty } from "../../types/bit_vec/module.f.ts"
import type { Nullable } from "../../types/nullable/module.f.ts"
import type { Nullable } from "../../types/nullable/module.f.mjs"
import { baseN } from "../../base_n/module.f.ts"

// 0123456789abcdef
Expand Down
2 changes: 1 addition & 1 deletion fjs/bnf/data/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { stringify } from '../../media/json/module.f.ts'
import { identity } from '../../types/function/module.f.ts'
import { identity } from '../../types/function/module.f.mjs'
import { sort } from '../../types/object/module.f.ts'
import { oneEncode, option, range, rangeDecode, repeat0Plus, set } from '../module.f.ts'
import { classic, deterministic } from '../testlib.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/bnf/token_symbol/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @module
*/
import { assert } from '../../asserts/module.f.mjs'
import { fromUndefined, type Nullable } from '../../types/nullable/module.f.ts'
import { fromUndefined, type Nullable } from '../../types/nullable/module.f.mjs'
import { eof, rangeDecode, unicodeRange } from '../module.f.ts'

const [, unicodeLast] = rangeDecode(unicodeRange)
Expand Down
2 changes: 1 addition & 1 deletion fjs/cas/evo/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { decodeText, encodeText, dialect, checkReferences, isHash, type LockMap,
import { ok, error, type Ok, type Result } from '../../types/result/module.f.ts'
import { nonEmpty, empty as elEmpty } from '../../effects/list/module.f.ts'
import { at, definedEntries, type StringMap } from '../../types/object/module.f.ts'
import { unwrap } from '../../types/nullable/module.f.ts'
import { unwrap } from '../../types/nullable/module.f.mjs'
import type { Vec } from '../../types/bit_vec/module.f.ts'
import { isNotFound, type IoResult } from '../../effects/node/module.f.ts'

Expand Down
2 changes: 1 addition & 1 deletion fjs/cas/evo/proof.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { sha256 } from '../../crypto/sha2/module.f.ts'
import { emptyState, virtual } from '../../effects/node/virtual/module.f.ts'
import { vec, vec8, type Vec } from '../../types/bit_vec/module.f.ts'
import { cBase32ToVec, vecToCBase32 } from '../../basen/cbase32/module.f.ts'
import { unwrap } from '../../types/nullable/module.f.ts'
import { unwrap } from '../../types/nullable/module.f.mjs'
import { ok, error, type Ok } from '../../types/result/module.f.ts'
import { nonEmpty, empty as elEmpty } from '../../effects/list/module.f.ts'
import type { IoResult } from '../../effects/node/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/cas/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import {
type Stat,
type WriteBytes,
} from '../effects/node/module.f.ts'
import { toOption } from '../types/nullable/module.f.ts'
import { toOption } from '../types/nullable/module.f.mjs'
import { error, ok, unwrap } from '../types/result/module.f.ts'
import { splitAt } from '../types/string/module.f.ts'
import { nonEmpty, empty as elEmpty, type List } from '../effects/list/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/ci/nix/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import { forEachStep, mapStep, pure, step, type Effect } from '../../effects/module.f.ts'
import { mkdir, writeUtf8File, type Mkdir, type WriteFile } from '../../effects/node/module.f.ts'
import { nixToString, type Expression } from '../../media/nix/module.f.ts'
import { fromUndefined, unwrap as unwrapNullable } from '../../types/nullable/module.f.ts'
import { fromUndefined, unwrap as unwrapNullable } from '../../types/nullable/module.f.mjs'
import { unwrap } from '../../types/result/module.f.ts'
import { install, test, uses, type MetaStep } from '../common/module.f.ts'
import { nixpkgs } from '../config/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/common/monoid/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
import type { Fold, Reduce } from '../../types/function/operator/module.f.ts'
import { reduce, type List } from '../../types/list/module.f.ts'
import { flip } from '../../types/function/module.f.ts'
import { flip } from '../../types/function/module.f.mjs'

/**
* Represents a monoid, an algebraic structure with a binary operation
Expand Down
2 changes: 1 addition & 1 deletion fjs/crypto/pow/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/
import { mask } from '../../types/bigint/module.f.ts'
import { type Vec, uint } from '../../types/bit_vec/module.f.ts'
import type { Nullable } from '../../types/nullable/module.f.ts'
import type { Nullable } from '../../types/nullable/module.f.mjs'
import { computeSync, sha256, type Sha2 } from '../sha2/module.f.ts'

const nBitsMantissa = mask(24n)
Expand Down
2 changes: 1 addition & 1 deletion fjs/crypto/sha2/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { utf8 } from '../../text/module.f.ts'
import { repeat, uint, vec } from '../../types/bit_vec/module.f.ts'
import { flip } from '../../types/function/module.f.ts'
import { flip } from '../../types/function/module.f.mjs'
import { assertEq } from '../../asserts/module.f.mjs'
import { map } from '../../types/list/module.f.ts'
import {
Expand Down
2 changes: 1 addition & 1 deletion fjs/crypto/vdf/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* ```
*/
import { modSqrt, prime_field, type PrimeField } from '../../types/prime_field/module.f.ts'
import type { Nullable } from '../../types/nullable/module.f.ts'
import type { Nullable } from '../../types/nullable/module.f.mjs'
import type { Unary } from '../../types/bigint/module.f.ts'

/** Sloth VDF modulus (3072-bit safe prime, same as reference implementations). */
Expand Down
2 changes: 1 addition & 1 deletion fjs/djs/serializer/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { fold } from '../../types/list/module.f.ts'
import { concat } from '../../types/string/module.f.ts'
import { type List, flat, flatMap, map, concat as listConcat } from '../../types/list/module.f.ts'
const { entries } = Object
import { compose, fn } from '../../types/function/module.f.ts'
import { compose, fn } from '../../types/function/module.f.mjs'
import { serialize as bigintSerialize } from '../../types/bigint/module.f.ts'
import { objectWrap, arrayWrap, stringSerialize, numberSerialize, nullSerialize, boolSerialize } from '../../media/json/serializer/module.f.ts'

Expand Down
2 changes: 1 addition & 1 deletion fjs/djs/serializer/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { countRefs, stringify, stringifyAsTree } from './module.f.ts'
import { sort } from '../../types/object/module.f.ts'
import { identity } from '../../types/function/module.f.ts'
import { identity } from '../../types/function/module.f.mjs'
import { setProperty } from '../../media/json/module.f.ts'
import { assertEq } from '../../asserts/module.f.mjs'

Expand Down
2 changes: 1 addition & 1 deletion fjs/effects/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
import { assert } from '../asserts/module.f.mjs'
import { fold, type List } from '../types/list/module.f.ts'
import { at } from '../types/object/module.f.ts'
import type { Option } from '../types/option/module.f.ts'
import type { Option } from '../types/option/module.f.mjs'
import type { Result } from '../types/result/module.f.ts'

export type Operation =
Expand Down
2 changes: 1 addition & 1 deletion fjs/fsc/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '../types/range_map/module.f.ts'
import { reduce as listReduce, toArray, map, type List } from '../types/list/module.f.ts'
import { range as asciiRange } from '../text/ascii/module.f.ts'
import { flip, fn } from '../types/function/module.f.ts'
import { flip, fn } from '../types/function/module.f.mjs'
import { one, type Range } from '../types/range/module.f.ts'
import { assertEq } from '../asserts/module.f.mjs'

Expand Down
2 changes: 1 addition & 1 deletion fjs/fsm/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '../types/range_map/module.f.ts'
import { type Fold, type Scan, strictEqual } from '../types/function/operator/module.f.ts'
import { stringify } from '../media/json/module.f.ts'
import { identity } from '../types/function/module.f.ts'
import { identity } from '../types/function/module.f.mjs'
import { stringToList } from '../text/utf16/module.f.ts'
import { cmp } from '../types/string/module.f.ts'

Expand Down
2 changes: 1 addition & 1 deletion fjs/fsm/proof.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { dfa, run, toRange, toUnion, type Grammar } from './module.f.ts'
import { union } from '../types/byte_set/module.f.ts'
import { sort, fromEntries } from '../types/object/module.f.ts'
import { stringify } from '../media/json/module.f.ts'
import { identity } from '../types/function/module.f.ts'
import { identity } from '../types/function/module.f.mjs'
import { toArray } from '../types/list/module.f.ts'
import { stringToList } from '../text/utf16/module.f.ts'
import { assertEq } from '../asserts/module.f.mjs'
Expand Down
2 changes: 1 addition & 1 deletion fjs/mcp/cas/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ import {
} from '../../protocol/mcp/module.f.ts'
import { collectRead, fileCas, type FileCasOperation } from '../../cas/module.f.ts'
import { fromVec } from '../../text/utf8/module.f.ts'
import { identity } from '../../types/function/module.f.ts'
import { identity } from '../../types/function/module.f.mjs'
import { sha256 } from '../../crypto/sha2/module.f.ts'
import { nonEmpty, empty as elEmpty } from '../../effects/list/module.f.ts'
import { syncRevision, type Cache } from '../../cas/evo/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/mcp/evo/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import {
type ToolEntry, type ToolsCallResult,
} from '../../protocol/mcp/module.f.ts'
import { stringify } from '../../media/json/module.f.ts'
import { identity } from '../../types/function/module.f.ts'
import { identity } from '../../types/function/module.f.mjs'
import { type Evo } from '../../cas/evo/module.f.ts'

// ── Argument schemas (declared once, used for both inputSchema and validate) ─────
Expand Down
2 changes: 1 addition & 1 deletion fjs/media/html/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import { map, flatMap, flat, concat as listConcat, type List } from '../../types/list/module.f.ts'
import { concat, concat as stringConcat } from '../../types/string/module.f.ts'
import { definedEntries, type Entry, type StringMap } from '../../types/object/module.f.ts'
import { compose } from '../../types/function/module.f.ts'
import { compose } from '../../types/function/module.f.mjs'
import { stringToList } from '../../text/utf16/module.f.ts'
import { includes } from '../../types/array/module.f.ts'
import { type Vec } from '../../types/bit_vec/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/media/json/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import type { Result } from '../../types/result/module.f.ts'
import { parse as parseTokens } from './parser/module.f.ts'
import { tokenize } from './tokenizer/module.f.ts'
import { at, definedEntries, type Entry as ObjectEntry } from '../../types/object/module.f.ts'
import { compose, fn } from '../../types/function/module.f.ts'
import { compose, fn } from '../../types/function/module.f.mjs'
import { objectWrap, arrayWrap, stringSerialize, numberSerialize, nullSerialize, boolSerialize } from './serializer/module.f.ts'
import { boolean as rttiBoolean, number as rttiNumber, string as rttiString, or, record, array as rttiArray } from '../../types/rtti/module.f.ts'
import type { Ts } from '../../types/rtti/ts/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/media/json/proof.f.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parse, setProperty, stringify } from './module.f.ts'
import { sort } from '../../types/object/module.f.ts'
import { identity } from '../../types/function/module.f.ts'
import { identity } from '../../types/function/module.f.mjs'
import { assertEq } from '../../asserts/module.f.mjs'

export const proof = {
Expand Down
2 changes: 1 addition & 1 deletion fjs/media/type/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
import { msb, fromSentinel, length, u8List, type Vec } from '../../types/bit_vec/module.f.ts'
import { iterable } from '../../types/list/module.f.ts'
import type { Nullable } from '../../types/nullable/module.f.ts'
import type { Nullable } from '../../types/nullable/module.f.mjs'
import { pure, step, type Effect, type Operation } from '../../effects/module.f.ts'
import type { List } from '../../effects/list/module.f.ts'
import type { IoResult } from '../../effects/node/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/sul/level/literal/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { log2 } from '../../../types/bigint/module.f.ts'
import { msb, vec, type Vec } from '../../../types/bit_vec/module.f.ts'
import type { Func } from '../../../types/function/module.f.ts'
import type { Func } from '../../../types/function/module.f.mjs'
import { strictEqual, type Equal, type StateScan } from '../../../types/function/operator/module.f.ts'
import { equal, map, type List } from '../../../types/list/module.f.ts'
import { join } from '../../../types/string/module.f.ts'
Expand Down
2 changes: 1 addition & 1 deletion fjs/text/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { msb, tryU8ListToVec, u8List, type Vec } from '../types/bit_vec/module.f
import { flatMap, type List } from '../types/list/module.f.ts'
import { fromCodePointList, toCodePointList } from './utf8/module.f.ts'
import { stringToCodePointList, codePointListToString } from './utf16/module.f.ts'
import { mapUnwrap, type Nullable } from '../types/nullable/module.f.ts'
import { mapUnwrap, type Nullable } from '../types/nullable/module.f.mjs'

export type Block = ItemThunk | ItemArray

Expand Down
2 changes: 1 addition & 1 deletion fjs/text/utf16/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '../../types/list/module.f.ts'
import { concat, type StateScan } from '../../types/function/operator/module.f.ts'
import { contains } from '../../types/range/module.f.ts'
import { fn } from '../../types/function/module.f.ts'
import { fn } from '../../types/function/module.f.mjs'
import {
decoder,
errorMask,
Expand Down
2 changes: 1 addition & 1 deletion fjs/types/array/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @module
*/

import { fromUndefined, map } from '../nullable/module.f.ts'
import { fromUndefined, map } from '../nullable/module.f.mjs'

export const isArray = (value: unknown): value is readonly unknown[] =>
value instanceof Array
Expand Down
4 changes: 2 additions & 2 deletions fjs/types/bit_vec/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
* @module
*/
import { bitLength, divUp, mask, maxLength, xor, type Reduce as BigintReduce } from '../bigint/module.f.ts'
import { flip, identity } from '../function/module.f.ts'
import { flip, identity } from '../function/module.f.mjs'
import type { Binary, Fold, Reduce as OpReduce } from '../function/operator/module.f.ts'
import { map, tryFold, type Accumulator, type List, type Thunk } from '../list/module.f.ts'
import { asBase, asNominal, type Nominal } from '../nominal/module.f.ts'
import { repeat as mRepeat } from '../../common/monoid/module.f.ts'
import { cmp, max, min, type Sign } from '../function/compare/module.f.ts'
import { mapUnwrap, type Nullable } from '../nullable/module.f.ts'
import { mapUnwrap, type Nullable } from '../nullable/module.f.mjs'

/**
* A vector of bits represented as a signed `bigint`.
Expand Down
2 changes: 1 addition & 1 deletion fjs/types/btree/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @module
*/
import { flat, type List, type Thunk } from '../list/module.f.ts'
import { map } from '../nullable/module.f.ts'
import { map } from '../nullable/module.f.mjs'
import type { TNode, Tree } from './types/module.f.ts'

const nodeValues: <T>(node: TNode<T>) => Thunk<T>
Expand Down
2 changes: 1 addition & 1 deletion fjs/types/btree/remove/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { Compare } from '../../function/compare/module.f.ts'
import { type Path, type PathItem, find } from '../find/module.f.ts'
import { fold, concat, next } from '../../list/module.f.ts'
import type { Array2 } from '../../array/module.f.ts'
import { map } from '../../nullable/module.f.ts'
import { map } from '../../nullable/module.f.mjs'

type Leaf01<T> = null | Leaf1<T>

Expand Down
2 changes: 1 addition & 1 deletion fjs/types/byte_set/module.f.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* @module
*/
import { compose } from '../function/module.f.ts'
import { compose } from '../function/module.f.mjs'
import type { RangeMap } from '../range_map/module.f.ts'
import type { SortedSet } from '../sorted_set/module.f.ts'
import { reverse, countdown, flat, map } from '../list/module.f.ts'
Expand Down
47 changes: 47 additions & 0 deletions fjs/types/function/module.f.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* A generic function type.
*
* @template I, O
* @typedef {(_: I) => O} Func
*/

/**
* A postfix compose function.
*
* @type {<I, X>(g: Func<I, X>) => <O>(f: Func<X, O>) => Func<I, O>}
*/
export const compose = g => f => x => f(g(x))

/**
* A generic identity function.
*
* @type {<T>(value: T) => T}
*/
export const identity = value => value

/**
* Flips the arguments of a curried function.
*
* @type {<A, B, C>(f: (a: A) => (b: B) => C) => (b: B) => (a: A) => C}
*/
export const flip = f => b => a => f(a)(b)

/**
* A functional utility type that enables seamless chaining of transformations.
*
* @template I, O
* @typedef {{
* readonly result: Func<I, O>
* readonly map: <T>(g: Func<O, T>) => Fn<I, T>
* }} Fn
*/

/**
* Creates an `Fn` instance from a function, enabling chaining of transformations.
*
* @type {<I, O>(result: Func<I, O>) => Fn<I, O>}
*/
export const fn = result => ({
result,
map: g => fn(compose(result)(g))
})
40 changes: 0 additions & 40 deletions fjs/types/function/module.f.ts

This file was deleted.

Loading
Loading