In both the following cases the highlighting is wrong:
1.
2.
The code
module DateRanges where
data Date = Date Int deriving (Eq, Ord, Show)
data Ranges = Ranges [(Date, Date)] deriving Show
restrictRanges :: Date -> Date -> Ranges -> Ranges
restrictRanges loRestr hiRestr (Ranges ranges) =
Ranges $ concatMap f ranges where
f (lo, hi)
| lo >= loRestr && hi <= hiRestr = [(lo, hi)]
| hi < loRestr || lo > hiRestr = []
| otherwise = [(max lo loRestr, min hi hiRestr)]
test :: IO ()
test = do
let ranges = Ranges [(Date 1, Date 10)]
print $ show $ restrictRanges (Date 3) (Date 5) ranges
In both the following cases the highlighting is wrong:
1.
2.
The code