Golf golf golf
This commit is contained in:
parent
0044d607f6
commit
e46b3b37be
|
@ -17,12 +17,9 @@ instance Random Fastfood where
|
||||||
(x, g') -> (toEnum x, g')
|
(x, g') -> (toEnum x, g')
|
||||||
random = randomR (minBound, maxBound)
|
random = randomR (minBound, maxBound)
|
||||||
|
|
||||||
getCurrentWeekDay :: IO DayOfWeek
|
|
||||||
getCurrentWeekDay = dayOfWeek . utctDay <$> getCurrentTime
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
day <- getCurrentWeekDay
|
day <- dayOfWeek . utctDay <$> getCurrentTime -- slight golf optimisation
|
||||||
case day of
|
case day of
|
||||||
Tuesday -> print Friet
|
Tuesday -> print Friet
|
||||||
_ -> print =<< (randomIO :: IO Fastfood)
|
_ -> print =<< (randomIO :: IO Fastfood)
|
||||||
|
|
Loading…
Reference in a new issue