functype 2.2.0 → 2.2.1

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/README.md CHANGED
@@ -5,16 +5,16 @@
5
5
  </picture>
6
6
  </p>
7
7
 
8
- # Functype
8
+ # functype
9
9
 
10
10
  [![NPM Version](https://img.shields.io/npm/v/functype)](https://www.npmjs.com/package/functype)
11
11
  [![CI](https://github.com/jordanburke/functype/actions/workflows/ci.yml/badge.svg)](https://github.com/jordanburke/functype/actions/workflows/ci.yml)
12
12
 
13
13
  ## A Functional Programming Library for TypeScript
14
14
 
15
- Functype is a lightweight functional programming library for TypeScript, drawing inspiration from functional programming paradigms, the Scala Standard Library, and ZIO. It provides a comprehensive set of utilities and abstractions designed to facilitate functional programming within TypeScript applications.
15
+ functype is a lightweight functional programming library for TypeScript, drawing inspiration from functional programming paradigms, the Scala Standard Library, and ZIO. It provides a comprehensive set of utilities and abstractions designed to facilitate functional programming within TypeScript applications.
16
16
 
17
- [API Documentation](https://jordanburke.github.io/functype/) · [Cheatsheet for Scala / cats / fp-ts users](./CHEATSHEET.md)
17
+ [Website](https://functype.org/) · [API Documentation](https://functype.org/api-docs/) · [Cheatsheet for Scala / cats / Effect users](./CHEATSHEET.md)
18
18
 
19
19
  ### CLI Documentation
20
20
 
@@ -181,7 +181,7 @@ const result = Lazy(() => 10)
181
181
 
182
182
  ### Do-notation (High-Performance For-Comprehensions)
183
183
 
184
- Functype provides generator-based Do-notation for monadic composition, similar to Scala's for-comprehensions, with **significant performance advantages for List operations**:
184
+ functype provides generator-based Do-notation for monadic composition, similar to Scala's for-comprehensions, with **significant performance advantages for List operations**:
185
185
 
186
186
  ```typescript
187
187
  import { Do, DoAsync, $ } from "functype"
@@ -394,7 +394,7 @@ TracedOption(user, tracer, "span-1")
394
394
 
395
395
  ## Conditional Programming
396
396
 
397
- Functype provides `Cond` and `Match` for functional conditional logic without early returns:
397
+ functype provides `Cond` and `Match` for functional conditional logic without early returns:
398
398
 
399
399
  ### Cond
400
400
 
@@ -501,7 +501,7 @@ const classifier = Match.builder<Animal, string>()
501
501
 
502
502
  ## Fold
503
503
 
504
- Functype includes a powerful `fold` operation for pattern matching and extracting values:
504
+ functype includes a powerful `fold` operation for pattern matching and extracting values:
505
505
 
506
506
  ```typescript
507
507
  import { Option, Either, Try, List } from "functype"
@@ -534,7 +534,7 @@ const listResult = list.foldLeft(0)((acc, num) => acc + num) // 6
534
534
 
535
535
  ## Foldable
536
536
 
537
- Functype includes a `Foldable` type class that all data structures implement:
537
+ functype includes a `Foldable` type class that all data structures implement:
538
538
 
539
539
  ```typescript
540
540
  import { FoldableUtils, Option, List, Try } from "functype"
@@ -565,7 +565,7 @@ const convertedToEither = FoldableUtils.toEither(tryVal, "Error") // Right(10)
565
565
 
566
566
  ## Matchable
567
567
 
568
- Functype includes a `Matchable` type class for enhanced pattern matching:
568
+ functype includes a `Matchable` type class for enhanced pattern matching:
569
569
 
570
570
  ```typescript
571
571
  import { Option, Either, Try, List, MatchableUtils } from "functype"
@@ -613,11 +613,11 @@ const result = isPositive(num) ?? defaultCase(num) // "Positive: 42"
613
613
 
614
614
  ## Interface Hierarchy
615
615
 
616
- All data structures in Functype implement a unified hierarchy of interfaces, providing consistent behavior across the library:
616
+ All data structures in functype implement a unified hierarchy of interfaces, providing consistent behavior across the library:
617
617
 
618
618
  ### Type Classes
619
619
 
620
- Functype leverages type classes to provide common operations:
620
+ functype leverages type classes to provide common operations:
621
621
 
622
622
  - **Functor**: Supports `map` operation for transforming wrapped values
623
623
  - **Applicative**: Extends Functor with `ap` for applying wrapped functions
@@ -684,11 +684,11 @@ list.forEach(console.log) // Logs: 1, 2, 3, 4, 5
684
684
 
685
685
  ## Feature Matrix
686
686
 
687
- For a comprehensive overview of which interfaces are supported by each data structure, see the [Functype Feature Matrix](docs/FUNCTYPE_FEATURE_MATRIX.md).
687
+ For a comprehensive overview of which interfaces are supported by each data structure, see the [functype Feature Matrix](docs/FUNCTYPE_FEATURE_MATRIX.md).
688
688
 
689
689
  ## Type Safety
690
690
 
691
- Functype leverages TypeScript's advanced type system to provide compile-time safety for functional patterns, ensuring that your code is both robust and maintainable.
691
+ functype leverages TypeScript's advanced type system to provide compile-time safety for functional patterns, ensuring that your code is both robust and maintainable.
692
692
 
693
693
  ```typescript
694
694
  // Type inference works seamlessly
@@ -700,7 +700,7 @@ const mappedValue = option.map((x) => x.toString())
700
700
 
701
701
  ## Error Formatting
702
702
 
703
- Functype provides utilities for improved error visualization and logging:
703
+ functype provides utilities for improved error visualization and logging:
704
704
 
705
705
  ```typescript
706
706
  import { Throwable, createErrorSerializer, formatError, formatErrorChain } from "functype"
@@ -757,7 +757,7 @@ For more details, see the [Error Formatting Guide](docs/error-formatting.md).
757
757
  - ✓ Add Pipe interface for composition
758
758
  - ✓ Add Serializable for persistence
759
759
  - ✓ Add Typeable support
760
- - [ ] Implement NonEmptyList<A>
760
+ - [ ] Implement `NonEmptyList<A>`
761
761
  - List guaranteed to have at least one element
762
762
  - Prevents empty list errors at compile time
763
763
  - Full standard interface implementation
@@ -765,7 +765,7 @@ For more details, see the [Error Formatting Guide](docs/error-formatting.md).
765
765
 
766
766
  ### Medium Priority
767
767
 
768
- - [ ] Implement ValidatedNel<E, A> for validation with error accumulation
768
+ - [ ] Implement `ValidatedNel<E, A>` for validation with error accumulation
769
769
  - Unlike Either, collects multiple errors
770
770
  - Uses NonEmptyList for error collection
771
771
  - Applicative instance combines errors
@@ -775,7 +775,7 @@ For more details, see the [Error Formatting Guide](docs/error-formatting.md).
775
775
  - ✓ Add guard clauses (when conditions)
776
776
  - ✓ Support destructuring patterns
777
777
  - ✓ Consolidated into unified Match implementation
778
- - [x] Implement IO<R,E,A> effect type
778
+ - [x] Implement `IO<R,E,A>` effect type
779
779
  - ✓ Lazy execution with typed errors
780
780
  - ✓ Dependency injection (Tag, Context, Layer)
781
781
  - ✓ Composable operations (map, flatMap, zip, race)
@@ -790,7 +790,7 @@ For more details, see the [Error Formatting Guide](docs/error-formatting.md).
790
790
  - ✓ Add Serializable for persistence
791
791
  - ✓ Add Companion pattern with utility methods
792
792
  - ✓ Added specialized pair() and triple() constructors
793
- - [ ] Implement Lens<S, A> for immutable updates
793
+ - [ ] Implement `Lens<S, A>` for immutable updates
794
794
  - Composable property access
795
795
  - Type-safe nested updates
796
796
  - Works with all functype data structures
@@ -836,7 +836,7 @@ For more details, see the [Error Formatting Guide](docs/error-formatting.md).
836
836
  - [x] Add noUncheckedIndexedAccess for safer array indexing
837
837
  - [ ] Improve support for higher-kinded types:
838
838
  - Current type parameters work well for first-order types
839
- - Expand to support type constructors as parameters (F<A> => F<B>)
839
+ - Expand to support type constructors as parameters (`F<A> => F<B>`)
840
840
  - [x] Add branded/nominal types for stronger type safety
841
841
  - [x] Implement more type-level utilities — partial (`Widen<A, B>` conditional-type helper in `src/typeclass/variance.ts`; more in `src/types/`, `src/typeable/`)
842
842
  - [ ] Leverage newer TypeScript features (const type parameters, tuple manipulation)
@@ -868,9 +868,9 @@ Work that shipped but wasn't captured in the planned roadmap above:
868
868
 
869
869
  ## Claude Code Skills
870
870
 
871
- Functype provides two specialized Claude Code skills to enhance your development experience:
871
+ functype provides two specialized Claude Code skills to enhance your development experience:
872
872
 
873
- ### Functype User Guide
873
+ ### functype User Guide
874
874
 
875
875
  Help for developers using functype in their projects:
876
876
 
@@ -880,7 +880,7 @@ Help for developers using functype in their projects:
880
880
 
881
881
  **Install**: Download from [dist/skills/functype-user.zip](./dist/skills/functype-user.zip)
882
882
 
883
- ### Functype Library Developer
883
+ ### functype Library Developer
884
884
 
885
885
  Guide for contributors developing functype itself:
886
886
 
@@ -4,10 +4,10 @@
4
4
  *
5
5
  * ## Scala Equivalents
6
6
  *
7
- * Functype: `const x = yield* $(Option(5))`
7
+ * functype: `const x = yield* $(Option(5))`
8
8
  * Scala: `x <- Some(5)`
9
9
  *
10
- * Functype: `return x + y`
10
+ * functype: `return x + y`
11
11
  * Scala: `yield x + y`
12
12
  *
13
13
  * ## Core Concepts
@@ -8,7 +8,7 @@ import { Type } from "../types/index.js";
8
8
  */
9
9
  export type Kind<F, A> = F extends ((arg: infer T) => infer R) ? R : never;
10
10
  /**
11
- * Type constructors for common Functype data types
11
+ * Type constructors for common functype data types
12
12
  */
13
13
  export type OptionKind = <A>(a: A) => Option<A>;
14
14
  export type ListKind = <A>(a: A) => List<A>;
@@ -1 +1 @@
1
- var e=`2.2.0`;export{e as version};
1
+ var e=`2.2.1`;export{e as version};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "functype",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "description": "A functional programming library for TypeScript, using immutable data structures and type classes",
6
6
  "keywords": [
@@ -34,7 +34,7 @@
34
34
  "@eslint/compat": "^2.1.1",
35
35
  "@eslint/eslintrc": "^3.3.7",
36
36
  "@types/node": "~24.19.2",
37
- "eslint-config-functype": "2.202.0",
37
+ "eslint-config-functype": "2.202.1",
38
38
  "esbuild": "^0.28.2",
39
39
  "eslint-plugin-functional": "^10.0.1",
40
40
  "fast-check": "^4.10.3",