Yona

1 program Added 2026-02-27T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: Yatta
Provenance: commit 240e12d066 · authored 2026-02-27T07:24:38+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

YARA (0.27)Yatima (0.25)Kona (0.20)Verona (0.18)JSONata (0.17)

LLM-contributed programs

Common Functions (Factorial, Fibonacci, Pattern Matching)

Provenance: commit 240e12d066 · authored 2026-02-27T07:24:38+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.yona · license: GPL-3.0 · added: 2026-02-27T10:00:00Z
module tests\CommonFunctions exports
    factorial,
    fibonacci,
    bmiTell,
    nonLinearTupleTest,
    nonLinearListTest,
    nonLinearHeadTailsTest,
    nonLinearAsSequenceOneTest,
    nonLinearAsSequenceTwoTest,
    countdown,
    read_all_lines,
    print_sequence,
    raise_error
    as

    #factorial 1 = 1
    #factorial n = n * factorial (n - 1)

    # A tail recursive function to calculate factorial
    factTR 0 a = a
    factTR n a = factTR (n - 1) (n * a)

    # A wrapper over factTR
    factorial n = factTR n 1

    fibonacci 0 = 0
    fibonacci 1 = 1
    fibonacci n = fibonacci (n - 1) + fibonacci (n - 2)

    bmiTell bmi
        | bmi <= 18.5 = "You're underweight, you emo, you!"
        | bmi <= 25.0 = "You're supposedly normal. Pffft, I bet you're ugly!"
        | bmi <= 30.0 = "You're fat! Lose some weight, fatty!"
        | true        = "You're a whale, congratulations!"

    nonLinearTupleTest (arg, _) (_, arg)       = arg
    nonLinearTupleTest (argOne, _) (_, argTwo) = argOne + argTwo

    nonLinearListTest [arg, _] [_, arg]       = arg
    nonLinearListTest [argOne, _] [_, argTwo] = argOne + argTwo

    nonLinearHeadTailsTest head -| _ head -| _       = head
    nonLinearHeadTailsTest headOne -| _ headTwo -| _ = headOne + headTwo

    nonLinearAsSequenceOneTest seqOne@(head -| _) seqTwo@(head -| _)       = head
    nonLinearAsSequenceOneTest seqOne@(headOne -| _) seqTwo@(headTwo -| _) = headOne + headTwo

    nonLinearAsSequenceTwoTest seq@(headOne -| _) seq@(headTwo -| _)       = headOne
    nonLinearAsSequenceTwoTest seqOne@(headOne -| _) seqTwo@(headTwo -| _) = headOne + headTwo

    countdown n
        | n < 1 = 0
    countdown n = countdown (n - 1)


    read_all_lines file = read_lines file 0

    read_lines file acc =
        case File::read_line file of
            (:ok, _, new_file)  -> read_lines new_file (acc + 1)
            :eof                -> acc
        end

    print_sequence []     = ""
    print_sequence h -| t =
        do
            IO::println h
            print_sequence t
        end


    raise_error = raise :test_error "testing error"
end

Contribute — propose a file extension

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