Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module KedvencModulunkKedvencViccesViktorunknak where
- data Time = T Int Int
- deriving (Eq)
- t :: Int -> Int -> Time
- t h m
- | (h < 24) && (h >= 0) && (m < 60) && (m >= 0) = T h m
- | otherwise = error "Az idő formáatuma nem megfelelő"
- instance Show Time where
- show (T a b) = show a ++ ":" ++ show b
- {-
- isEarlier :: (T Int, Int) (T Int, Int) -> Bool
- isEarlier (T h1 m1) (T h2 m2)
- | (h1 < h2) = True
- | (h1 == h2) && (m1 < m2) = True
- | otherwise = False
- isBetween :: (T Int, Int) (T Int, Int) (T Int, Int) -> Bool
- isBetween (T h1 m1) (T h2 m2) (T h3 m3)
- | (h1 < h2 && h2 < h3) = True
- -- |
- -}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement