encyclopegia.org

Idris (programming language)

Idris is a purely-functional programming language with dependent types, quantity annotations, optional lazy evaluation, and features such as a totality checker. Idris is designed to be a general-purpose programming language similar to Haskell, but may also be used as a proof assistant. The Idris type system is similar to Agda's. Compared to Agda, Idris prioritizes management of side effects and support for embedded domain-specific languages. Idris is compiled by modular backends, which provide code generation and a runtime system. The Idris compiler includes backends for Chez Scheme, Racket, JavaScript (both browser- and Node.js-based), and C. Additional third-party backends are available for other platforms. Idris is named after a singing dragon from the 1970s UK children's television programme Ivor the Engine.

Idris is a purely-functional programming language with dependent types, quantity annotations, optional lazy evaluation, and features such as a totality checker. Idris is designed to be a general-purpose programming language similar to Haskell, but may also be used as a proof assistant. The Idris type system is similar to Agda's. Compared to Agda, Idris prioritizes management of side effects and support for embedded domain-specific languages. Idris is compiled by modular backends, which provide code generation and a runtime system. The Idris compiler includes backends for Chez Scheme, Racket, JavaScript (both browser- and Node.js-based), and C. Additional third-party backends are available for other platforms. Idris is named after a singing dragon from the 1970s UK children's television programme Ivor the Engine. ==Features== Idris combines a number of features from relatively mainstream functional programming languages with features borrowed from proof assistants. ===Functional programming=== The syntax of Idris shows many similarities with that of Haskell. A hello world program in Idris might look like this: module Main main : IO () main = putStrLn "Hello, World!" The only differences between this program and its Haskell equivalent are the single (instead of double) colon in the type signature of the main function, and the omission of the word " where " in the module declaration. ===Inductive and parametric data types=== Idris supports inductively-defined data types and parametric polymorphism. Such types can be defined both in traditional Haskell 98-like syntax: data Tree a = Node (Tree a) (Tree a) | Leaf a or in the more general generalized algebraic data type (GADT)-like syntax: data Tree : Type -> Type where Node : Tree a -> Tree a -> Tree a Leaf : a -> Tree a ===Dependent types=== With dependent types, it is possible for values to appear in the types; in effect, any value-level computation can be performed during type checking. The following defines a type of lists whose lengths are known before the program runs, traditionally called vectors: data Vect : Nat -> Type -> Type where Nil : Vect 0 a (::) : (x : a) -> (xs : Vect n a) -> Vect (n + 1) a This type can be used as follows: total append : Vect n a -> Vect m a -> Vect (n + m) a append Nil ys = ys append (x :: xs) ys = x :: append xs ys The function append appends a vector of m elements of type a to a vector of n elements of type a . Since the precise types of the input vectors depend on a value, it is possible to be certain at compile time that the resulting vector will have exactly ( n + m ) elements of type a . The word " total " invokes the totality checker which will report an error if the function doesn't cover all possible cases or cannot be (automatically) proven not to enter an infinite loop. Another common example is pairwise addition of two vectors that are parameterized over their length: total pairAdd : Num a => Vect n a -> Vect n a -> Vect n a pairAdd Nil Nil = Nil pairAdd (x :: xs) (y :: ys) = x + y :: pairAdd xs ys Num a signifies that the type a belongs to the type class Num . Note that this function still typechecks successfully as total, even though there is no case matching Nil in one vector and a number in the other. Because the type system can prove that the vectors have the same length, we can be sure at compile time that case will not occur and there is no need to include that case in the function’s definition. ===Proof assistant features=== Dependent types are powerful enough to encode most properties of programs, and an Idris program can prove invariants at compile time. This makes Idris into a proof assistant. There are two standard ways of interacting with proof assistants: by writing a series of tactic invocations (Rocq style), or by interactively elaborating a proof term (Epigram–Agda style). Idris supports both modes of interaction, although the set of available tactics is not yet as useful as that of Rocq. ===Code generation=== Because Idris contains a proof assistant, Idris programs can be written to pass proofs around. If treated naïvely, such proofs remain around at runtime. Idris aims to avoid this pitfall by aggressively erasing unused terms. By default, Idris generates native code through C. The other officially supported backend generates JavaScript. ==Idris 2== Idris 2 is a new self-hosted version of the language which deeply integrates a linear type system, based on quantitative type theory. It currently compiles to Scheme and C. ==See also== List of proof assistants Total functional programming ==References== ==External links== , documentation, frequently asked questions, examples Idris at the Hackage repository Documentation for the Idris Language (tutorial, language reference, etc.)

References

  1. Index of /~eb/darcs/Idris · retrieved 2026-11-18 · rev 1378427112
    Cite this reference

    MLA "Index of /~eb/darcs/Idris." Brady, Edwin (12 December 2007). 2026-11-18. https://web.archive.org/web/20080320233322/http://www-fp.cs.st-and.ac.uk/~eb/darcs/Idris/. Accessed 25 November 2026.

    Chicago "Index of /~eb/darcs/Idris." Brady, Edwin (12 December 2007). 2026-11-18. https://web.archive.org/web/20080320233322/http://www-fp.cs.st-and.ac.uk/~eb/darcs/Idris/.

    APA Brady, Edwin (12 December 2007). (2026). Index of /~eb/darcs/Idris. Retrieved November 25, 2026, from https://web.archive.org/web/20080320233322/http://www-fp.cs.st-and.ac.uk/~eb/darcs/Idris/

  2. Benchmark results · retrieved 2026-11-18 · rev 1378427112
    Cite this reference

    MLA "Benchmark results." 2026-11-18. http://ziman.functor.sk/erasure-bm/. Accessed 25 November 2026.

    Chicago "Benchmark results." 2026-11-18. http://ziman.functor.sk/erasure-bm/.

    APA encyclopegia.org. (2026). Benchmark results. Retrieved November 25, 2026, from http://ziman.functor.sk/erasure-bm/

  3. idris-lang/Idris2 · retrieved 2021-04-10 · rev 1378427112
    Cite this reference

    MLA "idris-lang/Idris2." 2021-04-10. https://github.com/idris-lang/Idris2. Accessed 25 November 2026.

    Chicago "idris-lang/Idris2." 2021-04-10. https://github.com/idris-lang/Idris2.

    APA encyclopegia.org. (2021). idris-lang/Idris2. Retrieved November 25, 2026, from https://github.com/idris-lang/Idris2

  4. Release [v0.8.0] 2025 Hallowe'en Release · retrieved 2025-08-30 · rev 1378427112
    Cite this reference

    MLA "Release [v0.8.0] 2025 Hallowe'en Release." "Release [v0. 2025-08-30. https://github.com/idris-lang/Idris2/releases/tag/v0.8.0. Accessed 25 November 2026.

    Chicago "Release [v0.8.0] 2025 Hallowe'en Release." "Release [v0. 2025-08-30. https://github.com/idris-lang/Idris2/releases/tag/v0.8.0.

    APA "Release [v0. (2025). Release [v0.8.0] 2025 Hallowe'en Release. Retrieved November 25, 2026, from https://github.com/idris-lang/Idris2/releases/tag/v0.8.0

  5. Compiling to Executables · retrieved 2026-11-18 · rev 1378427112
    Cite this reference

    MLA "Compiling to Executables." 2026-11-18. https://idris2.readthedocs.io/en/latest/backends/index.html. Accessed 25 November 2026.

    Chicago "Compiling to Executables." 2026-11-18. https://idris2.readthedocs.io/en/latest/backends/index.html.

    APA encyclopegia.org. (2026). Compiling to Executables. Retrieved November 25, 2026, from https://idris2.readthedocs.io/en/latest/backends/index.html

  6. External Backends · retrieved 2026-11-18 · rev 1378427112
    Cite this reference

    MLA "External Backends." 2026-11-18. https://github.com/idris-lang/Idris2/wiki/External-backends. Accessed 25 November 2026.

    Chicago "External Backends." 2026-11-18. https://github.com/idris-lang/Idris2/wiki/External-backends.

    APA encyclopegia.org. (2026). External Backends. Retrieved November 25, 2026, from https://github.com/idris-lang/Idris2/wiki/External-backends

  7. Frequently Asked Questions · retrieved 2015-07-18 · rev 1378427112
    Cite this reference

    MLA "Frequently Asked Questions." 2015-07-18. http://docs.idris-lang.org/en/latest/faq/faq.html#what-does-the-name-idris-mean. Accessed 25 November 2026.

    Chicago "Frequently Asked Questions." 2015-07-18. http://docs.idris-lang.org/en/latest/faq/faq.html#what-does-the-name-idris-mean.

    APA encyclopegia.org. (2015). Frequently Asked Questions. Retrieved November 25, 2026, from http://docs.idris-lang.org/en/latest/faq/faq.html#what-does-the-name-idris-mean

  8. Syntax Guide – Idris 1.3.2 documentation · retrieved 2026-11-18 · rev 1378427112
    Cite this reference

    MLA "Syntax Guide – Idris 1.3.2 documentation." "Syntax Guide – Idris 1. 2026-11-18. https://docs.idris-lang.org/en/v1.3.2/reference/syntax-guide.html. Accessed 25 November 2026.

    Chicago "Syntax Guide – Idris 1.3.2 documentation." "Syntax Guide – Idris 1. 2026-11-18. https://docs.idris-lang.org/en/v1.3.2/reference/syntax-guide.html.

    APA "Syntax Guide – Idris 1. (2026). Syntax Guide – Idris 1.3.2 documentation. Retrieved November 25, 2026, from https://docs.idris-lang.org/en/v1.3.2/reference/syntax-guide.html

  9. Erasure By Usage Analysis – Idris latest documentation · retrieved 2026-11-18 · rev 1378427112
    Cite this reference

    MLA "Erasure By Usage Analysis – Idris latest documentation." 2026-11-18. http://idris.readthedocs.org/en/latest/reference/erasure.html. Accessed 25 November 2026.

    Chicago "Erasure By Usage Analysis – Idris latest documentation." 2026-11-18. http://idris.readthedocs.org/en/latest/reference/erasure.html.

    APA encyclopegia.org. (2026). Erasure By Usage Analysis – Idris latest documentation. Retrieved November 25, 2026, from http://idris.readthedocs.org/en/latest/reference/erasure.html

  10. Idris, a language with dependent types · retrieved 2014-10-25 · rev 1378427112
    Cite this reference

    MLA "Idris, a language with dependent types." a b c "Idris, a language with dependent types". 2014-10-25. http://www.idris-lang.org/. Accessed 25 November 2026.

    Chicago "Idris, a language with dependent types." a b c "Idris, a language with dependent types". 2014-10-25. http://www.idris-lang.org/.

    APA a b c "Idris, a language with dependent types". (2014). Idris, a language with dependent types. Retrieved November 25, 2026, from http://www.idris-lang.org/

  11. Uniqueness Types · retrieved 2019-09-25 · rev 1378427112
    Cite this reference

    MLA "Uniqueness Types." a b "Uniqueness Types". 2019-09-25. http://docs.idris-lang.org/en/latest/reference/uniqueness-types.html. Accessed 25 November 2026.

    Chicago "Uniqueness Types." a b "Uniqueness Types". 2019-09-25. http://docs.idris-lang.org/en/latest/reference/uniqueness-types.html.

    APA a b "Uniqueness Types". (2019). Uniqueness Types. Retrieved November 25, 2026, from http://docs.idris-lang.org/en/latest/reference/uniqueness-types.html

Cite this article

MLA

"Idris (programming language)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/idris-programming-language. Accessed 25 November 2026.

Chicago

"Idris (programming language)." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/idris-programming-language.

APA

encyclopegia.org. (2026). Idris (programming language). Retrieved November 25, 2026, from https://encyclopegia.org/wiki/idris-programming-language

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

official language

stub · references available

pan-Slavic language

stub · references available

Hawaiʻi Sign Language

stub · references available

Taiwanese Sign Language

stub · references available

Category:Programming languages

stub · references available

International Mother Language Day

stub · references available

polysynthetic language

stub · references available

Category:Films by country or language

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1378427112 · 0.5 · snapshot enwiki-001378427112

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.