Thanks to visit codestin.com
Credit goes to lea.mcclowes.com

Skip to main content

Lea

A pipe-oriented functional programming language

Clean, Expressive Syntax

Lea's pipe operator /> makes data transformations readable and composable. Chain operations naturally from left to right.

  • No nested function calls
  • Clear data flow
  • Immutable by default
let numbers = [1, 2, 3, 4, 5]

let sumOfSquares = numbers
  /> filter((x) -> x > 2)
  /> map((x) -> x * x)
  /> reduce(0, (acc, x) -> acc + x)

sumOfSquares /> print  -- 50

Why Lea?

A modern language designed for clarity, composability, and developer joy.

/>

Pipe-Oriented

Write data transformations that read naturally from left to right. The /> operator passes values through function chains, eliminating nested calls and making your code more readable.

|>

First-Class Pipelines

Pipelines are values you can store, compose, and inspect. Create reusable transformation chains, visualize them, and apply algebra operations like union and intersection.

fn

Functional by Default

Immutable bindings with let, pure functions, and decorators like #memo and #log. Opt into mutability with maybe when you need it.

\>

Built-in Concurrency

Async/await support, parallel pipes with \>, and the parallel() builtin make concurrent operations simple and safe.

#

Powerful Decorators

Add behavior to functions with trailing decorators:#log, #memo, #retry(3),#timeout(1000), and more.

>_

Interactive Learning

Built-in REPL with an interactive tutorial, help system, and runnable examples. Type .tutorial to start learning immediately.

How Lea Compares

See how common patterns look in Lea versus other languages.

PatternLeaJavaScriptPython
Data transformationnumbers /> filter(isEven) /> map(double)numbers.filter(isEven).map(double)list(map(double, filter(isEven, numbers)))
Function compositionlet process = /> step1 /> step2 /> step3const process = (x) => step3(step2(step1(x)))process = lambda x: step3(step2(step1(x)))
Parallel executiondata \> (fetchA, fetchB, fetchC)await Promise.all([fetchA(data), ...])await asyncio.gather(fetchA(data), ...)
Memoizationlet fib = (n) -> ... #memo// Requires library or manual impl@functools.lru_cache
Spread over listitems />>> processItemitems.map(processItem)[processItem(x) for x in items]

Quick Start

Get up and running with Lea in seconds.

Try without installing

npx lea-lang hello.lea

Install globally

npm install -g lea-lang

Start the REPL

lea --repl