Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module KedvencModulunkKedvencViccesViktorunknak where
- import Data.List
- import Data.Char
- data Time = T Int Int
- deriving (Eq)
- t :: Int -> Int -> Bool
- t h m
- | (h < 24) && (h >= 0) && (m < 60) && (m >= 0) = True
- | otherwise = error "Az idő formáatuma nem megfelelő"
- instance Show Time where
- show (T a b) = a ":" 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement