Egison

1 program Added 2026-02-05T21:04:17Z Agent: claude-codeModel: opusWebSearch: enabled Evidence Report issue View issues
Aliases: —
Provenance: commit 8b754f5b74 · authored 2026-02-05T22:05:04+01:00 · agent claude-code · model opus

Sources mentioning this language

3 sources · pl_id: pl/egison
LLM (this repo) · 1PldbRosettacode

Related languages

Edison (0.45)Bison (0.25)Meson (0.25)Michelson (0.19)ReasonML (0.18)

LLM-contributed programs

Poker Hand Classification

Provenance: commit 8b754f5b74 · authored 2026-02-05T22:05:04+01:00 · agent claude-code · model opus · WebSearch enabled
code.egi · license: MIT · added: 2026-02-05T21:04:17Z
def suit := algebraicDataMatcher
  | spade
  | heart
  | club
  | diamond

def card := algebraicDataMatcher
  | card suit (mod 13)

def poker cs :=
  match cs as multiset card with
  | [card $s $n, card #s #(n-1), card #s #(n-2), card #s #(n-3), card #s #(n-4)]
    -> "Straight flush"
  | [card _ $n, card _ #n, card _ #n, card _ #n, _]
    -> "Four of a kind"
  | [card _ $m, card _ #m, card _ #m, card _ $n, card _ #n]
    -> "Full house"
  | [card $s _, card #s _, card #s _, card #s _, card #s _]
    -> "Flush"
  | [card _ $n, card _ #(n-1), card _ #(n-2), card _ #(n-3), card _ #(n-4)]
    -> "Straight"
  | [card _ $n, card _ #n, card _ #n, _, _]
    -> "Three of a kind"
  | [card _ $m, card _ #m, card _ $n, card _ #n, _]
    -> "Two pair"
  | [card _ $n, card _ #n, _, _, _]
    -> "One pair"
  | [_, _, _, _, _] -> "Nothing"

assertEqual "poker hand 1"
  (poker [Card Spade 5, Card Spade 6, Card Spade 7, Card Spade 8, Card Spade 9])
  "Straight flush"

assertEqual "poker hand 2"
  (poker [Card Spade 5, Card Diamond 5, Card Spade 7, Card Club 5, Card Heart 5])
  "Four of a kind"

assertEqual "poker hand 3"
  (poker [Card Spade 5, Card Diamond 5, Card Spade 7, Card Club 5, Card Heart 7])
  "Full house"

assertEqual "poker hand 4"
  (poker [Card Spade 5, Card Spade 6, Card Spade 7, Card Spade 13, Card Spade 9])
  "Flush"

assertEqual "poker hand 5"
  (poker [Card Spade 5, Card Club 6, Card Spade 7, Card Spade 8, Card Spade 9])
  "Straight"

assertEqual "poker hand 6"
  (poker [Card Spade 5, Card Diamond 5, Card Spade 7, Card Club 5, Card Heart 8])
  "Three of a kind"

assertEqual "poker hand 7"
  (poker [Card Spade 5, Card Diamond 10, Card Spade 7, Card Club 5, Card Heart 10])
  "Two pair"

assertEqual "poker hand 8"
  (poker [Card Spade 5, Card Diamond 10, Card Spade 7, Card Club 5, Card Heart 8])
  "One pair"

assertEqual "poker hand 9"
  (poker [Card Spade 5, Card Spade 6, Card Spade 7, Card Spade 8, Card Diamond 11])
  "Nothing"

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 Egison (mapped to pl/egison). 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/Egison/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Egglog EGL →