Last active
April 5, 2016 10:24
-
-
Save bradparker/1af207d01808300186501f6dc361353d to your computer and use it in GitHub Desktop.
decrementBy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
decrementBy :: (Ord a, Num a) => a -> a -> a | |
decrementBy n d | |
| n < d = 0 | |
| otherwise = n - d | |
--- 1 `decrementBy` 2 | |
--- 0 | |
--- 2 `decrementBy` 1 | |
--- 1 | |
--- pi `decrementBy` 1 | |
--- 2.141592653589793 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment