Yampa

1 program Added 2026-03-05T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: FRP.Yampa
Provenance: commit ca09adbd03 · authored 2026-03-05T17:30:07+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.18)Yatima (0.17)Yona (0.14)YAMLScript (0.12)Yacc (0.12)

LLM-contributed programs

Bouncing Ball Simulation

Provenance: commit ca09adbd03 · authored 2026-03-05T17:30:07+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.hs · license: BSD-3-Clause · added: 2026-03-05T10:00:00Z
import FRP.Yampa

gravity :: Double
gravity = 9.81

-- | Signal function representing a bouncing ball.
-- Input: () (no external input)
-- Output: (position, velocity)
bouncingBall :: Double -> Double -> SF () (Double, Double)
bouncingBall y0 v0 = switch (fallingBall y0 v0) (\(y, _) -> bouncingBall y 0)
  where
    fallingBall :: Double -> Double -> SF () ((Double, Double), Event (Double, Double))
    fallingBall y0 v0 = proc () -> do
      v <- (v0 -) ^<< integral -< gravity
      y <- (y0 +) ^<< integral -< v
      let hit = y <= 0 && v < 0
      returnA -< ((y, v), if hit then Event (0, abs v * 0.8) else NoEvent)

main :: IO ()
main = do
  let dt = 0.05
  embedSynch (bouncingBall 10.0 0.0) (deltaEncode dt (repeat ()))
    >>= mapM_ (\(y, v) -> putStrLn ("y=" ++ show y ++ "  v=" ++ show v))
    . take 40

Contribute — propose a file extension

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