HASKELL.DAY

A pastoral hymn to pure functional programming

λ λ λ λ λ λ λ λ λ
map :: (a -> b) -> [a] -> [b] foldr :: (a -> b -> b) -> b -> [a] -> b

THE FOREST OF TYPES

data Tree a = Leaf | Node (Tree a) a (Tree a)
data Maybe a = Nothing | Just a
data Either a b = Left a | Right b

In 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.

THE RIVER OF FUNCTIONS

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.

THE MOUNTAIN OF MONADS

IO MAYBE STATE
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.

THE HORIZON

Where every program is a proof,
every type a theorem,
and every compilation
a small act of grace.

λ