Array
Master functional array operations and data transformations
What is Array?
The Array module provides functional operations for working with arrays. These operations are immutable (never modify the original array), composable (easily chain operations together), and type-safe (full TypeScript inference).
// Instead of this:
const result = []
for (let i = 0; i < arr.length; i++) { ... }
// Use this:
const result = pipe(arr, A.map(...), A.filter(...))Immutable Operations
Transform data without mutations
Composable
Chain operations with ease
Type-Safe
Compile-time guarantees
Functional
Pure, predictable transformations
Array in Action
❌ Imperative Loops
const result = []
for (let i = 0; i < numbers.length; i++) {
if (numbers[i] % 2 === 0) {
result.push(numbers[i] * 2)
}
}
// Mutations, loops, hard to read✅ Array Operations
const result = pipe( numbers, A.filter(n => n % 2 === 0), A.map(n => n * 2) ) // Declarative, composable, clear
Practice Exercises
Map
Learn about map in fp-ts array
Filter
Learn about filter in fp-ts array
Reduce
Learn about reduce in fp-ts array
Find
Learn about find in fp-ts array
Partition
Learn about partition in fp-ts array
Sort
Learn about sort in fp-ts array
Chaining
Learn about chaining in fp-ts array
Flatmap
Learn about flatmap in fp-ts array
Compact
Learn about compact in fp-ts array
Pipeline
Learn about pipeline in fp-ts array
Why Learn Array?
Master Array
Learn the fundamental concepts and patterns that make Array powerful
10 Exercises
Practice with hands-on exercises from beginner friendly level
Production Ready
Apply Array patterns to build robust, type-safe applications