Liquid Haskell

1 program Added 2026-03-10T12:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: LiquidHaskell
Provenance: commit 671847f653 · authored 2026-03-10T11:08:41+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

LiquidHaskell (0.82)Liskell (0.40)Concurrent Haskell (0.26)Liquidity (0.25)pH (0.25)

LLM-contributed programs

Safe Operations with Refinement Types

Provenance: commit 671847f653 · authored 2026-03-10T11:08:41+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.hs · added: 2026-03-10T12:00:00Z
{-@ LIQUID "--no-termination" @-}
module SafeOps where

{-@ type Pos = {v:Int | v > 0} @-}
{-@ type NonEmpty a = {v:[a] | len v > 0} @-}

{-@ head' :: NonEmpty a -> a @-}
head' :: [a] -> a
head' (x:_) = x
head' []    = error "unreachable"

{-@ safeDiv :: Int -> {v:Int | v /= 0} -> Int @-}
safeDiv :: Int -> Int -> Int
safeDiv x y = x `div` y

{-@ factorial :: Nat -> Pos @-}
factorial :: Int -> Int
factorial 0 = 1
factorial n = n * factorial (n - 1)

main :: IO ()
main = do
    let xs = [1, 2, 3] :: [Int]
    putStrLn $ "Head: "    ++ show (head' xs)
    putStrLn $ "10 / 2 = " ++ show (safeDiv 10 2)
    putStrLn $ "5! = "     ++ show (factorial 5)

Contribute — propose a file extension

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