Created
March 30, 2015 19:15
-
-
Save anonymous/5d5f9f383c0c03c883fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{- 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