Reformat code

This commit is contained in:
Anton Vakhrushev 2020-06-20 12:40:10 +03:00
parent 2d86d90956
commit 2e6e06310d
3 changed files with 16 additions and 14 deletions

View File

@ -4,10 +4,12 @@ module Constraint
, inside , inside
) where ) where
data Constraint = Constraint data Constraint =
Constraint
{ lower :: Int { lower :: Int
, upper :: Int , upper :: Int
} deriving (Show, Eq) }
deriving (Show, Eq)
inside :: (Int, Int) -> Constraint -> Bool inside :: (Int, Int) -> Constraint -> Bool
inside (x, y) (Constraint lw up) = x >= lw && y <= up inside (x, y) (Constraint lw up) = x >= lw && y <= up

View File

@ -8,9 +8,7 @@ import Data.Maybe
import Helper import Helper
data Field data Field
= Range Int = Range Int Int Int
Int
Int
| Sequence [Int] | Sequence [Int]
deriving (Eq, Show) deriving (Eq, Show)

View File

@ -10,13 +10,15 @@ import Data.Dates
import Data.Maybe import Data.Maybe
import Field import Field
data Pattern = Pattern data Pattern =
Pattern
{ cminute :: Field { cminute :: Field
, chour :: Field , chour :: Field
, cday :: Field , cday :: Field
, cmonth :: Field , cmonth :: Field
, cweek :: Field , cweek :: Field
} deriving (Show) }
deriving (Show)
match :: String -> DateTime -> Maybe Bool match :: String -> DateTime -> Maybe Bool
match s d = match s d =