1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

Add a helper to test whether an integer is odd.

This commit is contained in:
Rob Rix 2017-03-09 12:32:37 -05:00
parent 99069c3646
commit abb71497da

View File

@ -78,6 +78,9 @@ at v (Diagonal k) = do
overlaps :: Endpoint -> Endpoint -> Bool overlaps :: Endpoint -> Endpoint -> Bool
overlaps (Endpoint x y) (Endpoint u v) = x - y == u - v && x <= u overlaps (Endpoint x y) (Endpoint u v) = x - y == u - v && x <= u
isOdd :: Integral a => a -> Bool
isOdd = (== 1) . (`mod` 2)
-- Instances -- Instances