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(...))
map
filter
reduce
find
partition
🔒

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

1

Map

Learn about map in fp-ts array

beginnerStart
2

Filter

Learn about filter in fp-ts array

beginnerStart
3

Reduce

Learn about reduce in fp-ts array

beginnerStart
4

Find

Learn about find in fp-ts array

intermediateStart
5

Partition

Learn about partition in fp-ts array

intermediateStart
6

Sort

Learn about sort in fp-ts array

intermediateStart
7

Chaining

Learn about chaining in fp-ts array

advancedStart
8

Flatmap

Learn about flatmap in fp-ts array

advancedStart
9

Compact

Learn about compact in fp-ts array

advancedStart
10

Pipeline

Learn about pipeline in fp-ts array

advancedStart

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