A pastoral hymn to pure functional programming
data Tree a = Leaf | Node (Tree a) a (Tree a)data Maybe a = Nothing | Just adata Either a b = Left a | Right bIn Haskell, types are not constraints — they are the landscape itself. Every value has a type, every function a signature, every composition a proof that the world fits together perfectly.
compose = (.) . (.)
filter :: (a -> Bool) -> [a] -> [a]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
Functions flow like water — pure, composable, eternal. In Haskell, a function is a promise: give me this, and I will always return that. No surprises, no side effects, just the clear current of computation.
main :: IO ()
main = do
name <- getLine
putStrLn ("Hello, " ++ name ++ "!")
putStrLn "Welcome to haskell.day"
safeDivide :: Int -> Int -> Maybe Int
safeDivide _ 0 = Nothing
safeDivide x y = Just (x `div` y)
Monads are not burritos. They are mountains — vast, inevitable, and once you have climbed them, the entire landscape of computation unfolds below you. The bind operator (>>=) is your rope.