| {- 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