What problem does it solve?
Writing functional Go code with the fp-go v2 library is error-prone because its combinators are low-frequency in training data, leading to misremembered signatures, wrong import paths, and imperative habits leaking into pipelines. This Skill provides verified patterns for Pipe, Flow, the reader monad, do-notation, and lenses so generated code compiles and follows fp-go idioms.
Core Features & Use Cases
- Pipe and Flow composition: Apply data-first (Pipe) and function-first (Flow) composition correctly, with point-free style, Predicate/Endomorphism return types, and numeric combinators like N.MoreThan and N.Mul.
- Reader monad and do-notation: Build environment-dependent computations with R.Do, R.Bind, R.ApS, and R.Let, choosing the right combinator for sequential versus independent steps.
- Lenses and testing: Create lenses with L.MakeLens for struct field access and generate _test.go files that exercise pipelines with concrete environments and assert.Equal.
- Use Case: A developer asks to refactor an imperative order-processing function into fp-go v2 style; the Skill produces a kleisli arrow using do-notation with Bind for database calls, Let for pure calculations, plus a unit test, all importing from github.com/IBM/fp-go/v2.
Quick Start
Refactor my imperative Go function into fp-go v2 style using Pipe, the reader monad with context.Context, and do-notation, and generate a unit test for it.