Description #
Idris is a general-purpose functional programming language with dependent types, allowing types to be predicated on values. It supports interactive theorem proving, precise type-driven development, and has Haskell-like syntax with additional compile-time safety.
History #
Idris was created by Edwin Brady and first released in 2007. Its design draws inspiration from Haskell and Coq, with the goal of bringing dependent types to general-purpose programming. Idris 2, written in Idris itself, was released in 2021.
Hello World Code #
module Main
main : IO ()
main = putStrLn "Hello, World!"
How to Run #
Option 1: Online
- Try Idris (Replit) (for Idris 1 only)
Option 2: Local
- Install Idris (v1 or v2):
brew install idris # macOS
sudo apt install idris # Linux
Save code as Main.idr
and run:
idris Main.idr -o main
./main
Key Concepts
- Dependent types
- Pure functional programming
- Interactive theorem proving
- Type-driven development
- Totality checking
- Lazy evaluation
- Pattern matching
- First-class types
- IO monad
- Meta-programming and reflection
Try It Online #
- Replit – Idris (Note: Idris 2 may not be available online yet)
Fun Facts #
- Idris allows you to encode program correctness directly in types.
- Idris 2 is self-hosted—written in Idris itself.
- It’s commonly compared with Agda and Coq in type theory circles.