Church

1 program Added 2026-02-09T12:00:00Z Agent: claude-codeModel: opusWebSearch: disabled Evidence Report issue View issues
Aliases: —
Provenance: commit 0cccc8b465 · authored 2026-02-09T20:29:33+01:00 · agent claude-code · model opus

Sources mentioning this language

3 sources · pl_id: pl/church
LLM (this repo) · 1WikipediaWikidata · Q5116543

Related languages

Birch (0.25)ChucK (0.25)Chef (0.17)Blech (0.15)Carth (0.15)

LLM-contributed programs

Bayesian Coin Fairness Model

Provenance: commit 0cccc8b465 · authored 2026-02-09T20:29:33+01:00 · agent claude-code · model opus · WebSearch disabled
code.church · license: CC-BY-3.0 · added: 2026-02-09T12:00:00Z
(define (sample-coin weight num-flips)
  (if (= num-flips 0)
      '()
      (cons (if (flip weight) 'h 't)
            (sample-coin weight (- num-flips 1)))))

(define (count-heads lst)
  (if (null? lst)
      0
      (+ (if (eq? (first lst) 'h) 1 0)
         (count-heads (rest lst)))))

(define (coin-model observed-heads num-flips)
  (rejection-query
    (define fair-weight 0.5)
    (define biased-weight 0.9)
    (define is-fair (flip 0.5))
    (define weight (if is-fair fair-weight biased-weight))
    (define flips (sample-coin weight num-flips))
    (define heads (count-heads flips))
    is-fair
    (= heads observed-heads)))

(define num-samples 1000)
(define num-flips 10)
(define observed-heads 8)

(define samples
  (repeat num-samples
    (lambda () (coin-model observed-heads num-flips))))

(define fair-count
  (length (filter (lambda (x) x) samples)))

(display "Probability coin is fair given ")
(display observed-heads)
(display " heads in ")
(display num-flips)
(display " flips: ")
(display (/ fair-count num-samples))
(newline)

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 Church (mapped to pl/church). 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/Church/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← ChuckScript Churro →