Idris

1 program Added 2025-10-22T09:52:34Z Model: meta-llama/llama-3.1-70b-instructTemp: 0.4 Evidence Report issue View issues
Aliases: Idris2
Provenance: commit 199b796915 · authored 2025-10-22T11:52:34+02:00 · model meta-llama/llama-3.1-70b-instruct

Sources mentioning this language

8 sources · pl_id: pl/idris
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q15408477

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsfunctional
Typingdependent
Designed byEdwin Brady
First appeared2007
Influenced byAgda · Clean · Rocq (previously known as Coq) · Epigram · F# · Haskell · ML · Rust
LicenseBSD
Homepagehttp://www.idris-lang.org

Extensions claimed by this language

5 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.idrlinguistprimary136.6K files
.idrpygmentsprimary136.6K files
.idrwikidataprimary136.6K files
.lidrwikidataprimary4.3K files
.lidrlinguistsecondary4.3K files

Related languages

Idris 2 (0.69)Idris2 (0.67)Idris 1 (0.43)Blodwen (0.16)Idio (0.14)

LLM-contributed programs

Idris REPL

Provenance: commit 199b796915 · authored 2025-10-22T11:52:34+02:00 · model meta-llama/llama-3.1-70b-instruct · Temp 0.4
code.idr · license: BSD-3-Clause · added: 2025-10-22T09:52:34Z
module Main

main : IO ()
main = do print "Hello, World!"

Real programs from Software Heritage

1 sample mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
list_nat.idr · 1555 B · ext .idr · seen 24× in SWH
via unique-primary
swh:1:cnt:7ef3cc2560e795ecfe90a76e9b7fa6427a9dde95;origin=https://github.com/kevinsullivan/cs1113f16;anchor=swh:1:rev:523b9e9e58088ab0aebc18e89dea2b35eacb0c1f;path=/mylib/src/list_nat.idr
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
||| An abstract data type, nat, simulating
||| the natural numbers and common arithmetic
||| operations involving natural numbers
module list_nat

import nat

||| The primary data type we export is Nat.
||| The constructors are hidden from other modules.
export
data ListNat =
  ||| Nil_Nat represents the empty list of natural numbers
  NilNat |
  ||| Con_Nat head tail represents the
  ConsNat Nat ListNat


{-
We provide a slightly more abstract way to obtain
values of type Nat.
-}

||| Return the Nat representing zero
export
list_nat_empty: ListNat
list_nat_empty = NilNat


||| Identity function for list_nat_cons
export
list_nat_id: ListNat -> ListNat
list_nat_id l = l



||| Return the (Nat representing the) successor of the given Nat
export
list_nat_cons: Nat -> ListNat -> ListNat
list_nat_cons n l = ConsNat n l



||| Compute the tail of a given list (with tail nil = nil)
list_nat_tail: ListNat -> ListNat
list_nat_tail NilNat = NilNat
list_nat_tail (ConsNat head tail) = tail


{-
Key idea: a Nat can be only a Z or an S and a one-smaller Nat
The smaller Nat inside gives us the predecessor except for Z
For Z we'll define the predecessor to be just Z itself.
-}

-- And here it comes -- a real mind-blower -- arithmetic!

||| Return true if a given number is even otherwise false

||| (This function simulates) natural number addition
||| in Peano arithmetic
export
list_nat_plus: ListNat -> ListNat -> ListNat
list_nat_plus NilNat m = m
list_nat_plus (ConsNat h t) m = ConsNat h (list_nat_plus t m)

-- And some code to test it all out

Contribute — propose a file extension

Tell us where to find evidence about Idris (mapped to pl/idris). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Idris/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Idol Idris 1 →