-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
69 lines (62 loc) · 2.92 KB
/
index.ts
File metadata and controls
69 lines (62 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
export * from './option/basics';
export * from './option/transforms';
export * from './option/combining-and-conversions';
export * from './option/pipelines';
export * from './result/basics';
export * from './result/transforms';
export * from './result/combining-and-conversions';
export * from './result/pipelines';
export * from './interop/interop-examples';
export * from './composition/curry-basics';
export * from './composition/tupled-basics';
export * from './composition/advanced-composition';
export * from './composition/async-composition';
export * from './schema/basic';
export * from './schema/union';
export * from './schema/tuple';
export * from './schema/async-validation';
export * from './schema/abort-early';
export * from './schema/is';
export * from './schema/standard-schema';
export * from './complete-pipelines/hill-clohessy-wiltshire';
export * from './complete-pipelines/hohmann-transfer';
export * from './complete-pipelines/async';
export * from './complete-pipelines/async-launch';
export * from './complete-pipelines/async-flow';
/*
Example Categories:
OPTION EXAMPLES:
- Basics (some, none, fromNullable, isSome, isNone, match, unwrapOr, unwrapOrElse)
- Transforms (map, flatMap, bimap, filter, tap)
- Combining & Conversions (combine, mapToResult)
- Pipelines (curried helpers in pipe: mapWith, flatMapWith, filterWith, tapWith)
RESULT EXAMPLES:
- Basics (ok, err, isOk, isErr, match, unwrap, unwrapOr, unwrapOrElse)
- Transforms (map, flatMap, mapErr, bimap, filter, tap, tapErr, orElse)
- Combining & Conversions (combine, combineAll, fromTry, fromPromise, toPromise, mapToOption)
- Pipelines (curried helpers in pipe/pipeAsync: mapWith, flatMapWith, filterWith, etc.)
INTEROP EXAMPLES:
- Option -> Result (adding error context to missing values)
- Result -> Option (dropping error details when only success/failure matters)
- Mixed workflow (combining both types in real scenarios)
COMPOSITION EXAMPLES:
- Curry basics (making multi-arg functions pipeable)
- Tupled basics (working with tuple data)
- Advanced composition (real-world function transformation patterns)
- Async composition (pipeAsync and flowAsync for async pipelines)
SCHEMA / VALIDATION EXAMPLES:
- Basic schema (required fields, type checks)
- Nested objects (validating structured data)
- Unions and enums (discriminated unions, string enums)
- Tuples (heterogeneous and homogeneous tuples)
- Async validation (refineAsync, chainAsync, refineAtAsync)
- Abort early (stop on first error with abortEarly option)
- Type guard (is() — boolean shorthand for validate)
- Standard Schema interop (toStandardSchema for tRPC, TanStack, etc.)
COMPLETE PIPELINES:
- Hill-Clohessy-Wiltshire (spacecraft relative motion)
- Hohmann Transfer (orbital maneuvers)
- Async API call (input validation + network request + error handling)
- Async Launch Decision (input validation + multiple async steps + final decision)
- Async Flow (schema validation + Result operators + flowAsync pipeline)
*/