d2 n = case even n of
               True -> (n+2)
               False -> n

-- The next exercise doesn’t have all the cases covered. See if you can fix it.

-- 1. The following compares a value, x, to zero and returns an indicator for
-- whether x is a postive number or negative number. But what if x is 0? You may
-- need to play with the compare function a bit to find what to do.
nums x =

ifEvenAdd2 n = case even n of
               True -> (n+2)
               False -> n

-- The next exercise doesn’t have all the cases covered. See if you can fix it.

-- 1. The following compares a value, x, to zero and returns an indicator for
-- whether x is a postive number or negative number. But what if x is 0? You may
-- need to play with the compare function a bit to find what to do.
ifEvenAdd2 n = case even n of
               True -> (n+2)
               False -> n

-- The next exercise doesn’t have all the cases covered. See if you can fix it.

-- 1. The following compares a value, x, to zero and returns an indicator for
-- whether x is a postive number or negative number. But what if x is 0? You may
-- need to play with the compare function a bit to find what to do.