Tradition

This commit is contained in:
Nox Sluijtman 2024-03-21 02:49:38 +01:00
parent d6fd426d31
commit 112bdf4847

View file

@ -1,11 +1,13 @@
module Main where
import System.Random
import Data.Time
data Fastfood = Kapsalon
| Pizza
| Lasagne
| Nachos
| Friet
| Durum
deriving (Show, Eq, Ord, Enum, Read, Bounded)
@ -15,6 +17,12 @@ instance Random Fastfood where
(x, g') -> (toEnum x, g')
random = randomR (minBound, maxBound)
getCurrentWeekDay :: IO DayOfWeek
getCurrentWeekDay = dayOfWeek . utctDay <$> getCurrentTime
main :: IO ()
main = print =<< (randomIO :: IO Fastfood)
main = do
day <- getCurrentWeekDay
if day == Tuesday
then print Friet
else print =<< (randomIO :: IO Fastfood)