Want to learn and master Lean?

Join Exercism’s Lean Track for access to 100 exercises with automatic analysis of your code and personal mentoring, all 100% free.

About Lean

namespace HelloWorld

inductive World where
    | earth | mars

def hello (world : World) : String :=
    match world with
    | .earth => "Hello, Earth!"
    | .mars  => "Hi, Mars!"

end HelloWorld

100 coding exercises for Lean on Exercism. From Nucleotide Count to House.


Get better at programming through fun, rewarding coding exercises that test your understanding of concepts with Exercism.

See all Lean exercises on Exercism

Key Features of Lean


Lean

Purely functional

Deterministic functions make code predictable, composable and easier to understand.

Dependently typed

Encoding rules directly in types makes them self-documenting and invalid states unrepresentable.

Programs and proofs

Write programs and prove them correct in the same language. Specification is code.

Proved correctness

Go beyond testing by mathematically proving critical properties of your code.

Type classes

Categorizing types into classes provides lightweight, extensible abstraction.

Strong metaprogramming

A powerful macro and elaborator framework lets you extend the language to fit your domain.

Get mentored the Lean way

Every language has its own way of doing things. Lean is no different. Our mentors will help you learn to think like a Lean developer and how to write idiomatic code in Lean. Once you've solved an exercise, submit it to our volunteer team, and they'll give you hints, ideas, and feedback on how to make it feel more like what you'd normally see in Lean - they'll help you discover the things you don't know that you don't know.

Learn more about mentoring

Community-sourced Lean exercises

The Lean track on Exercism has 100 exercises to help you write better code.

See all Lean exercises
Lean

Get started with the Lean track

The best part, it’s 100% free for everyone.

Join the Lean track