fastfood-hs/app/Main.hs
2024-03-12 20:55:47 +01:00

21 lines
462 B
Haskell

module Main where
import System.Random
data Fastfood = Kapsalon
| Pizza
| Lasagne
| Nachos
| 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 = print =<< (randomIO :: IO Fastfood)