Idris 2

1 program Added 2026-02-26T05:09:46Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: Idris2
Provenance: commit a1f91b1fb6 · authored 2026-02-26T06:10:17+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

Idris (0.69)Idris2 (0.69)Idris 1 (0.38)Blodwen (0.22)Inform 2 (0.16)

LLM-contributed programs

Binary Tree

Provenance: commit a1f91b1fb6 · authored 2026-02-26T06:10:17+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.idr · license: BSD-3-Clause · added: 2026-02-26T05:09:46Z
module BTree

public export
data BTree a = Leaf
             | Node (BTree a) a (BTree a)

export
insert : Ord a => a -> BTree a -> BTree a
insert x Leaf = Node Leaf x Leaf
insert x (Node l v r) = if (x < v) then (Node (insert x l) v r)
                                   else (Node l v (insert x r))

export
toList : BTree a -> List a
toList Leaf = []
toList (Node l v r) = BTree.toList l ++ (v :: BTree.toList r)

export
toTree : Ord a => List a -> BTree a
toTree [] = Leaf
toTree (x :: xs) = insert x (toTree xs)

Contribute — propose a file extension

Tell us where to find evidence about Idris 2 (mapped to pl/idris_2). 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 2/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Idris 1 Idris2 →