Skip to main content
Version: v2.2.82 (latest)
Recipes · Introduction

Recipes Overview.

Practical recipes and patterns for common tasks using fp-go. Each recipe demonstrates real-world usage with complete, runnable examples.

// Each recipe includes
Problem, solution, explanation, variations.
// Prerequisites
Go 1.24+, fp-go v2 installed.
// Categories
5
Error handling, data, I/O, composition, testing.
01

Error Handling.

Learn how to handle errors functionally:

02

Data Processing.

Transform and process data functionally:

03

I/O Operations.

Handle asynchronous operations:

04

Composition Patterns.

Compose functions and effects:

05

Testing Patterns.

Test functional code effectively:

06

Getting Started.

Recipe Structure

Each recipe includes:

  • Problem Statement - What problem does this solve?
  • Solution - Complete, runnable code example
  • Explanation - Step-by-step breakdown
  • Variations - Alternative approaches
  • Best Practices - Tips and recommendations

Prerequisites

All recipes assume you have:

install.sh
go get github.com/IBM/fp-go/v2

And basic familiarity with fp-go core types like Option, Result, Either, and IO.

Contributing

Have a recipe to share? Contributions are welcome! See our contribution guidelines.