@satoshibits/functional 1.0.3 → 1.1.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"io.mjs","sourceRoot":"","sources":["../src/io.mts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;;;;;;;;;;;AA0BH;;;;;;;GAOG;AACH,MAAM,CAAC,IAAM,EAAE,GAAG;IAChB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,EAAE,EACA,UAAK,KAAQ;QACb,OAAA;YACE,OAAA,KAAK;QAAL,CAAK;IADP,CACO;IAET;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,GAAG,EACD,UAAO,CAAkB;QACzB,OAAA,UAAC,EAAS;YACV,OAAA;gBACE,OAAA,CAAC,CAAC,EAAE,EAAE,CAAC;YAAP,CAAO;QADT,CACS;IAFT,CAES;IAEX;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,KAAK,EACH,UAAO,CAAsB;QAC7B,OAAA,UAAC,EAAS;YACV,OAAA;gBACE,OAAA,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;YAAT,CAAS;QADX,CACW;IAFX,CAEW;IAEb;;;;;;OAMG;IACH,OAAO,EACL,UAAO,CAAsB;QAC7B,OAAA,UAAC,EAAS;YACV,OAAA;gBACE,OAAA,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;YAAT,CAAS;QADX,CACW;IAFX,CAEW;IAEb;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,EAAE,EACA,UAAO,OAAc;QACrB,OAAA,UAAC,IAAqB;YACtB,OAAA;gBACE,OAAA,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YAAjB,CAAiB;QADnB,CACmB;IAFnB,CAEmB;IAErB;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,GAAG,EAAE,UAAK,EAAS,IAAQ,O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,CAAC,CAAC,CAAC,EAAE,CAAC;gBACP,OAAO,CAAC,CAAC;YACX,CAAC;QAJD,CAIC;IALD,CAKC;CACJ,CAAC"}
package/dist/option.d.mts CHANGED
@@ -55,7 +55,7 @@ export type Option<T> = Some<T> | None;
55
55
  * @since 2025-07-03
56
56
  */
57
57
  export interface Some<T> {
58
- readonly _tag: 'Some';
58
+ readonly _tag: "Some";
59
59
  readonly value: T;
60
60
  }
61
61
  /**
@@ -68,7 +68,7 @@ export interface Some<T> {
68
68
  * @since 2025-07-03
69
69
  */
70
70
  export interface None {
71
- readonly _tag: 'None';
71
+ readonly _tag: "None";
72
72
  }
73
73
  /**
74
74
  * Creates a Some variant containing the provided value.
@@ -473,16 +473,16 @@ export declare const tryCatch: <T>(fn: () => T) => Option<T>;
473
473
  * @example
474
474
  * const logValue = pipe(
475
475
  * Option.some(42),
476
- * Option.tap(value => console.log('Found value:', value))
476
+ * Option.tapOption(value => console.log('Found value:', value))
477
477
  * ); // logs "Found value: 42" and returns Some(42)
478
478
  *
479
479
  * @example
480
480
  * // Debug logging in a chain
481
481
  * const result = pipe(
482
482
  * getUserInput(),
483
- * Option.tap(input => console.log('Raw input:', input)),
483
+ * Option.tapOption(input => console.log('Raw input:', input)),
484
484
  * Option.map(normalize),
485
- * Option.tap(normalized => console.log('Normalized:', normalized)),
485
+ * Option.tapOption(normalized => console.log('Normalized:', normalized)),
486
486
  * Option.filter(isValid)
487
487
  * );
488
488
  *
@@ -490,37 +490,10 @@ export declare const tryCatch: <T>(fn: () => T) => Option<T>;
490
490
  * // Side effects like analytics
491
491
  * const trackEvent = pipe(
492
492
  * findUser(id),
493
- * Option.tap(user => analytics.track('user.found', { id: user.id }))
493
+ * Option.tapOption(user => analytics.track('user.found', { id: user.id }))
494
494
  * );
495
495
  */
496
- export declare const tap: <T>(fn: (value: T) => void) => (option: Option<T>) => Option<T>;
497
- /**
498
- * Namespace containing all Option utilities.
499
- *
500
- * @category Namespace
501
- */
502
- export declare const Option: {
503
- readonly some: <T>(value: T) => Option<T>;
504
- readonly none: () => Option<never>;
505
- readonly fromNullable: <T>(value: T | null | undefined) => Option<T>;
506
- readonly fromPredicate: <T>(predicate: (value: T) => boolean) => (value: T) => Option<T>;
507
- readonly tryCatch: <T>(fn: () => T) => Option<T>;
508
- readonly isSome: <T>(option: Option<T>) => option is Some<T>;
509
- readonly isNone: <T>(option: Option<T>) => option is None;
510
- readonly map: <A, B>(fn: (value: A) => B) => (option: Option<A>) => Option<B>;
511
- readonly flatMap: <A, B>(fn: (value: A) => Option<B>) => (option: Option<A>) => Option<B>;
512
- readonly chain: <A, B>(fn: (value: A) => Option<B>) => (option: Option<A>) => Option<B>;
513
- readonly getOrElse: <T>(defaultValue: () => T) => (option: Option<T>) => T;
514
- readonly orElse: <T>(alternative: () => Option<T>) => (option: Option<T>) => Option<T>;
515
- readonly filter: typeof filter;
516
- readonly tap: <T>(fn: (value: T) => void) => (option: Option<T>) => Option<T>;
517
- readonly match: <T, A, B>(patterns: {
518
- some: (value: T) => A;
519
- none: () => B;
520
- }) => (option: Option<T>) => A | B;
521
- readonly toNullable: <T>(option: Option<T>) => T | null;
522
- readonly toUndefined: <T>(option: Option<T>) => T | undefined;
523
- };
496
+ export declare const tapOption: <T>(fn: (value: T) => void) => (option: Option<T>) => Option<T>;
524
497
  /**
525
498
  * Combines two Options using a binary function.
526
499
  * Returns None if either Option is None.
@@ -551,7 +524,7 @@ export declare const lift2: <A, B, C>(fn: (a: A, b: B) => C) => (optionA: Option
551
524
  *
552
525
  * @category Combinations
553
526
  * @example
554
- * const results = sequence([
527
+ * const results = sequenceOption([
555
528
  * Option.some(1),
556
529
  * Option.some(2),
557
530
  * Option.some(3)
@@ -560,36 +533,19 @@ export declare const lift2: <A, B, C>(fn: (a: A, b: B) => C) => (optionA: Option
560
533
  *
561
534
  * @example
562
535
  * // Parse multiple values
563
- * const numbers = sequence(
536
+ * const numbers = sequenceOption(
564
537
  * inputs.map(input => parseNumber(input))
565
538
  * );
566
539
  *
567
540
  * @example
568
541
  * // Validate all fields
569
- * const validatedFields = sequence([
542
+ * const validatedFields = sequenceOption([
570
543
  * validateField('name', data.name),
571
544
  * validateField('email', data.email),
572
545
  * validateField('age', data.age)
573
546
  * ]);
574
547
  */
575
- export declare const sequence: <T>(options: Option<T>[]) => Option<T[]>;
576
- /**
577
- * Applies a function wrapped in an Option to a value wrapped in an Option.
578
- *
579
- * @category Apply
580
- * @example
581
- * const addOne = (n: number) => n + 1;
582
- * const result = ap(Option.some(addOne))(Option.some(5));
583
- * // => Some(6)
584
- *
585
- * @example
586
- * // Partial application with options
587
- * const add = (a: number) => (b: number) => a + b;
588
- * const maybeAdd5 = Option.map(add)(Option.some(5));
589
- * const result = ap(maybeAdd5)(Option.some(3));
590
- * // => Some(8)
591
- */
592
- export declare const ap: <A, B>(optionFn: Option<(a: A) => B>) => (optionA: Option<A>) => Option<B>;
548
+ export declare const sequenceOption: <T>(options: Option<T>[]) => Option<T[]>;
593
549
  /**
594
550
  * Sequences a struct of Options into an Option of a struct.
595
551
  * Returns Some with the struct of all values if all are Some, None if any is None.
@@ -619,4 +575,175 @@ export declare const ap: <A, B>(optionFn: Option<(a: A) => B>) => (optionA: Opti
619
575
  * });
620
576
  */
621
577
  export declare const sequenceS: <T extends Record<string, Option<unknown>>>(struct: T) => Option<{ [K in keyof T]: T[K] extends Option<infer U> ? U : never; }>;
578
+ /**
579
+ * Executes an Option for its side effects, discarding the result.
580
+ * @description Runs an Option-returning function but preserves the original value.
581
+ * Useful for logging or other side effects where the result isn't needed.
582
+ *
583
+ * @template A - The type of the value
584
+ * @param {function(A): Option<unknown>} f - Function that returns an Option (result discarded)
585
+ * @returns {function(Option<A>): Option<A>} A function that executes side effects
586
+ *
587
+ * @category Combinators
588
+ * @example
589
+ * const log = (msg: string): Option<void> => {
590
+ * console.log(msg);
591
+ * return Option.some(undefined);
592
+ * };
593
+ *
594
+ * const result = Option.chainFirst((n: number) => log(`Got: ${n}`))(
595
+ * Option.some(42)
596
+ * ); // logs "Got: 42", returns Some(42)
597
+ *
598
+ * @since 2025-09-18
599
+ */
600
+ export declare const chainFirst: <A>(f: (a: A) => Option<unknown>) => (option: Option<A>) => Option<A>;
601
+ /**
602
+ * Combines Options in a tuple into an Option of a tuple.
603
+ * @description Takes multiple Options and returns an Option containing a tuple
604
+ * of their values. Returns None if any Option is None.
605
+ *
606
+ * @template T - Tuple type of Options
607
+ * @param {...T} options - Options to combine
608
+ * @returns {Option<{ [K in keyof T]: T[K] extends Option<infer U> ? U : never }>} Option of tuple
609
+ *
610
+ * @category Combinators
611
+ * @example
612
+ * const option1 = Option.some(1);
613
+ * const option2 = Option.some('hello');
614
+ * const option3 = Option.some(true);
615
+ *
616
+ * const combined = Option.sequenceT(option1, option2, option3);
617
+ * // => Some([1, 'hello', true])
618
+ *
619
+ * @since 2025-09-18
620
+ */
621
+ export declare const sequenceT: <T extends readonly Option<unknown>[]>(...options: T) => Option<{ [K in keyof T]: T[K] extends Option<infer U> ? U : never; }>;
622
+ /**
623
+ * Maps a function returning an Option over an array and sequences the results.
624
+ * @description Applies an Option-returning function to each element of an array
625
+ * and collects all results. If any operation returns None, returns None.
626
+ *
627
+ * @template T - The input type
628
+ * @template U - The output type
629
+ * @param {function(T): Option<U>} f - Function that returns an Option
630
+ * @returns {function(T[]): Option<U[]>} A function that traverses arrays with Options
631
+ *
632
+ * @category Combinators
633
+ * @example
634
+ * const parseNumber = (s: string): Option<number> => {
635
+ * const n = Number(s);
636
+ * return isNaN(n) ? Option.none() : Option.some(n);
637
+ * };
638
+ *
639
+ * const parseAll = Option.traverse(parseNumber);
640
+ * parseAll(['1', '2', '3']); // => Some([1, 2, 3])
641
+ * parseAll(['1', 'x', '3']); // => None
642
+ *
643
+ * @since 2025-09-18
644
+ */
645
+ export declare const traverse: <T, U>(f: (t: T) => Option<U>) => (ts: T[]) => Option<U[]>;
646
+ /**
647
+ * Applies an Option of a function to an Option of a value.
648
+ * @description Enables applying functions wrapped in Options to values wrapped
649
+ * in Options. If either Option is None, returns None. This is the
650
+ * applicative apply operation for Option types.
651
+ *
652
+ * @template A - The input type
653
+ * @template B - The output type
654
+ * @param {Option<A>} optionValue - Option containing a value
655
+ * @returns {function(Option<function(A): B>): Option<B>} A function that applies Option functions
656
+ *
657
+ * @category Combinators
658
+ * @example
659
+ * const add = (a: number) => (b: number) => a + b;
660
+ * const optionAdd = Option.some(add);
661
+ * const option5 = Option.some(5);
662
+ * const option3 = Option.some(3);
663
+ *
664
+ * const sum = Option.ap(option3)(
665
+ * Option.ap(option5)(
666
+ * Option.map(add)(Option.some(10))
667
+ * )
668
+ * ); // => Some(18)
669
+ *
670
+ * @since 2025-09-18
671
+ */
672
+ export declare const ap: <A, B>(optionValue: Option<A>) => (optionFn: Option<(a: A) => B>) => Option<B>;
673
+ type Context = Record<string, unknown>;
674
+ interface Builder {
675
+ bind: <K extends string, T>(key: K, option: Option<T> | ((ctx: Context) => Option<T>)) => Builder;
676
+ map: <T>(f: (ctx: Context) => T) => Option<T>;
677
+ flatMap: <T>(f: (ctx: Context) => Option<T>) => Option<T>;
678
+ value: () => Option<Context>;
679
+ }
680
+ /**
681
+ * Do notation helper for Option types.
682
+ * @description Provides a way to write sequential Option operations in an
683
+ * imperative style, similar to async/await but for Option types.
684
+ *
685
+ * @returns {object} Do notation builder
686
+ *
687
+ * @category Do Notation
688
+ * @example
689
+ * const result = Option.Do()
690
+ * .bind('x', Option.some(5))
691
+ * .bind('y', Option.some(3))
692
+ * .map(({ x, y }) => x + y);
693
+ * // => Some(8)
694
+ *
695
+ * @example
696
+ * const withNone = Option.Do()
697
+ * .bind('x', Option.some(5))
698
+ * .bind('y', Option.none())
699
+ * .map(({ x, y }) => x + y);
700
+ * // => None
701
+ *
702
+ * @example
703
+ * // With dependent bindings
704
+ * const calculation = Option.Do()
705
+ * .bind('a', Option.some(10))
706
+ * .bind('b', ({ a }) => a > 5 ? Option.some(a * 2) : Option.none())
707
+ * .bind('c', ({ b }) => Option.some(b + 1))
708
+ * .map(({ a, b, c }) => ({ original: a, doubled: b, final: c }));
709
+ * // => Some({ original: 10, doubled: 20, final: 21 })
710
+ *
711
+ * @since 2025-09-18
712
+ */
713
+ export declare const Do: () => Builder;
714
+ /**
715
+ * Namespace containing all Option utilities.
716
+ *
717
+ * @category Namespace
718
+ */
719
+ export declare const Option: {
720
+ readonly some: <T>(value: T) => Option<T>;
721
+ readonly none: () => Option<never>;
722
+ readonly fromNullable: <T>(value: T | null | undefined) => Option<T>;
723
+ readonly fromPredicate: <T>(predicate: (value: T) => boolean) => (value: T) => Option<T>;
724
+ readonly tryCatch: <T>(fn: () => T) => Option<T>;
725
+ readonly isSome: <T>(option: Option<T>) => option is Some<T>;
726
+ readonly isNone: <T>(option: Option<T>) => option is None;
727
+ readonly map: <A, B>(fn: (value: A) => B) => (option: Option<A>) => Option<B>;
728
+ readonly flatMap: <A, B>(fn: (value: A) => Option<B>) => (option: Option<A>) => Option<B>;
729
+ readonly chain: <A, B>(fn: (value: A) => Option<B>) => (option: Option<A>) => Option<B>;
730
+ readonly getOrElse: <T>(defaultValue: () => T) => (option: Option<T>) => T;
731
+ readonly orElse: <T>(alternative: () => Option<T>) => (option: Option<T>) => Option<T>;
732
+ readonly filter: typeof filter;
733
+ readonly tapOption: <T>(fn: (value: T) => void) => (option: Option<T>) => Option<T>;
734
+ readonly match: <T, A, B>(patterns: {
735
+ some: (value: T) => A;
736
+ none: () => B;
737
+ }) => (option: Option<T>) => A | B;
738
+ readonly toNullable: <T>(option: Option<T>) => T | null;
739
+ readonly toUndefined: <T>(option: Option<T>) => T | undefined;
740
+ readonly ap: <A, B>(optionValue: Option<A>) => (optionFn: Option<(a: A) => B>) => Option<B>;
741
+ readonly chainFirst: <A>(f: (a: A) => Option<unknown>) => (option: Option<A>) => Option<A>;
742
+ readonly sequenceT: <T extends readonly Option<unknown>[]>(...options: T) => Option<{ [K in keyof T]: T[K] extends Option<infer U> ? U : never; }>;
743
+ readonly traverse: <T, U>(f: (t: T) => Option<U>) => (ts: T[]) => Option<U[]>;
744
+ readonly sequenceOption: <T>(options: Option<T>[]) => Option<T[]>;
745
+ readonly sequenceS: <T extends Record<string, Option<unknown>>>(struct: T) => Option<{ [K in keyof T]: T[K] extends Option<infer U> ? U : never; }>;
746
+ readonly Do: () => Builder;
747
+ };
748
+ export {};
622
749
  //# sourceMappingURL=option.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"option.d.mts","sourceRoot":"","sources":["../src/option.mts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;;;;;GASG;AACH,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;AAEvC;;;;;;;;;;GAUG;AACH,MAAM,WAAW,IAAI,CAAC,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;CACnB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,SAAU,CAAC,KAAG,MAAM,CAAC,CAAC,CAG1C,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,IAAI,QAAO,MAAM,CAAC,KAAK,CAElC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAU,CAAC,GAAG,IAAI,GAAG,SAAS,KAAG,MAAM,CAAC,CAAC,CACT,CAAC;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,GACvB,CAAC,aAAc,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,aAC7B,CAAC,KAAG,MAAM,CAAC,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