nfx is made for you with Love by @vic. If you like my work, consider sponsoring
See our Documentation website
Built from four kernel primitives in ~30 lines:
- immediate - Effect with resolved value
- pending - Effect awaiting context
- adapt - Transform context and continuation
- runFx - Evaluate effect when requirements satisfied
Everything else derives from these: map, flatMap, state, errors, streams, logic programming.
kernel - Foundation providing immediate/pending constructors, eval, and adapt
basic - Value lifting with pure and value
functor - Transform effects with map and contraMap
monad - Sequence effects with mapM, flatMap, and then'
provide - Satisfy context requirements and inject dependencies
sequence - Do-notation for readable effect chains
state - Implicit state threading (get, set, modify)
context - Attribute-based context manipulation
request - Named capability requests
handlers - Effect interception and transformation
lens - Bidirectional focus on nested context
pair - Product types for heterogeneous contexts
and - Context conjunction operations
zip - Parallel effect combination
conditions - Common Lisp style resumable error handling with signals, handlers, and restarts
result - Simple throw/catch error propagation
bracket - Resource management with guaranteed cleanup
rw - Reader (environment access) and Writer (output accumulation)
acc - Accumulator patterns (list, attrset, sum, product)
choice - Non-deterministic logic programming with backtracking
arrow - Pure function composition in context
stream-core - Lazy stream constructors (done, more, fromList, repeat)
stream-transform - Element transformation (map, filter)
stream-limit - Length control (take, takeWhile)
stream-reduce - Consumption (fold, toList, forEach)
stream-combine - Combination (concat, interleave, flatten, flatMap, zip)