module Wedding where import Prelude type MarriedOn = String type WhoWhere = (String, String, String) type Who = (String, String) at :: WhoWhere -> String -> IO () at (wife, husband, date) place = do sep putStrLn $ ctr $ wife ++ " and " ++ husband putStrLn $ ctr "were married on" putStrLn $ ctr date putStrLn $ ctr "at" putStrLn $ ctr place sep where ctr x = "|" ++ pad left ++ x ++ pad right ++ "|" where left = (69 - length x) `div` 2 right = 68 - (left + length x) pad n = replicate n ' ' sep = putStrLn $ "+" ++ replicate 68 '-' ++ "+" married :: () -> String -> MarriedOn on :: () and :: String -> String -> Who were :: Who -> MarriedOn -> WhoWhere wife `and` husband = (wife, husband) (wife, husband) `were` date = (wife, husband, date) married _ place = place on = ()