This commit is contained in:
2025-01-04 21:08:46 +00:00
parent 698bb081dd
commit 86173f9f6a
2 changed files with 1 additions and 14 deletions
-10
View File
@@ -1,10 +0,0 @@
module Dodge.Base.Arithmetic where
import MaybeHelp
decreaseToZero :: Int -> Int
decreaseToZero = max 0 . subtract 1
decreaseToNothing' :: (Num a, Ord a) => Maybe' a -> Maybe' a
decreaseToNothing' ma = case ma of
Just' x | x > 0 -> Just' (x - 1)
_ -> Nothing'