Run Haskell online — GHC 9, purely functional, browser-hosted.
Haskell is the reference pure-functional language: lazy evaluation, algebraic data types, a type system so strong that `undefined` and `partial pattern match` are the only escape hatches. If you have never worked in a language where the compiler catches everything, this is where you go.
ls-judge compiles Haskell with GHC 9 inside a Firecracker microVM. Prelude is available; extra Hackage packages are not (no network).
Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.
main :: IO ()
main = do
line <- getLine
let n = read line :: Int
print (n * 2)
21
42