Clean

1 program Added 2025-10-23T08:13:44Z Model: x-ai/grok-4-fastTemp: 0.4 Evidence Report issue View issues
Aliases: —
Provenance: commit f61d7f36a1 · authored 2025-10-23T10:13:44+02:00 · model x-ai/grok-4-fast

Sources mentioning this language

8 sources · pl_id: pl/clean
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q377986

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
Typingstrong, static, dynamic
Designed bySoftware Technology Research Group of Radboud University Nijmegen
First appeared1987
Influenced byLean · Miranda · Haskell
LicenseSimplified BSD
Homepagehttps://clean.cs.ru.nl

Extensions claimed by this language

7 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.icllinguistprimary66.2K files
.iclpygmentsprimary66.2K files
.dcllinguistsecondary62.7K files
.dclpygmentssecondary62.7K files
.abcwikipediaproposed297.8K files
.dclwikipediaproposed62.7K files
.iclwikipediaproposed66.2K files

Related languages

Concurrent Clean (0.37)Bean (0.30)Cyan (0.30)JEAN (0.30)Lean 4 (0.29)

LLM-contributed programs

Conway's Game of Life simulation

Provenance: commit f61d7f36a1 · authored 2025-10-23T10:13:44+02:00 · model x-ai/grok-4-fast · Temp 0.4
code.icl · added: 2025-10-23T08:13:44Z
module life
import StdEnv, StdArray

:: Cell = Alive | Dead
:: Grid = {Grid :: !u:u:[Cell] !Int !Int}

initGrid :: Int Int -> Grid
initGrid rows cols = {Grid {Dead \ _ <- [1..rows*cols]} rows cols}

setCell :: Int Int Cell Grid -> Grid
setCell row col cell grid
  # (Grid cells r c) = grid
  # idx = row * c + col
  # cells = {cells & [idx] = cell}
  = {Grid cells r c}

countNeighbours :: Int Int Grid -> Int
countNeighbours row col grid
  # (Grid _ r c) = grid
  = sum [isAlive (getCell (row+dr) (col+dc) grid) \ (dr,dc) <- deltas]
  where
    deltas = [(-1,-1),(-1,0),(-1,1),(0,-1),(0,1),(1,-1),(1,0),(1,1)]
    getCell r c g
      | r < 0 || r >= fst3 g || c < 0 || c >= snd3 g = Dead
      | otherwise = thd3 g.[r * snd3 g + c]
    isAlive Alive = 1
    isAlive Dead  = 0
    fst3 (Grid a b c) = b
    snd3 (Grid a b c) = c
    thd3 (Grid a b c) = a

nextGen :: Grid -> Grid
nextGen grid
  # (Grid cells rows cols) = grid
  = foldl (flip (foldl (\g r -> foldl (\gg c -> setCell r c (nextState r c grid) gg) g [0..cols-1]))) 
          {grid & Grid.cells = {cells}}
          [0..rows-1]
  where
    nextState r c g = case (isAlive cells.[r*cols+c], countNeighbours r c g) of
      (True, n) | n < 2 || n > 3 -> Dead
                | otherwise      -> Alive
      (False, 3)                 -> Alive
      _                          -> Dead

isAlive :: Cell -> Bool
isAlive Alive = True
isAlive Dead  = False

toString :: Grid -> [Char]
toString {Grid cells rows cols} = concat [[toChar cells.[r*cols+c] \ c <- [0..cols-1]] ++ "\n" \ r <- [0..rows-1]]
  where
    toChar Alive = '*'
    toChar Dead  = '.'

Start :: *World
Start
  # glider = foldl (\g (r,c) -> setCell r c Alive g) (initGrid 5 5) [(1,2),(2,3),(3,1),(3,2),(3,3)]
  = StdEnv.printn (toString (iterate nextGen glider !! 5))

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

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