module Main where import System.Random import Data.Time data Fastfood = Kapsalon | Pizza | Lasagne | Nachos | Friet | Durum deriving (Show, Eq, Ord, Enum, Read, Bounded) instance Random Fastfood where randomR (a, b) g = case randomR (fromEnum a, fromEnum b) g of (x, g') -> (toEnum x, g') random = randomR (minBound, maxBound) main :: IO () main = do day <- dayOfWeek . utctDay <$> getCurrentTime -- slight golf optimisation case day of Tuesday -> print Friet _ -> print =<< (randomIO :: IO Fastfood)