Skip to content

Instantly share code, notes, and snippets.

Created March 30, 2015 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5d5f9f383c0c03c883fa to your computer and use it in GitHub Desktop.
Save anonymous/5d5f9f383c0c03c883fa to your computer and use it in GitHub Desktop.
{- loldate -}
import Time
import IO
import Locale
import qualified Data.Map as M
import Data.Maybe
loldays = M.fromList [ (Monday, "Moeday")
, (Tuesday, "Pantsuday")
, (Wednesday, "Wednesdesu")
, (Thursday, "Boring Thursday")
, (Friday, "Furry Friday")
, (Saturday, "Caturday")
, (Sunday, "Stupiday")
]
getLolDay :: CalendarTime -> String
getLolDay t = fromJust $ M.lookup (ctWDay t) loldays
main = do
t <- getClockTime >>= toCalendarTime
putStrLn $ getLolDay t ++ " " ++ formatCalendarTime defaultTimeLocale s t
where s = "%b %e %H:%M:%S %Z %Y"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment