hacktoberfest-2018/code/HigherOrderFuctions.hs

15 lines
412 B
Haskell
Raw Normal View History

2018-10-07 22:57:23 +00:00
--First steps in Higher Order Functions
divideByTen :: (Floating a) => a -> a
divideByTen = (/10)
divideTenBy :: (Floating a) => a -> a
divideTenBy = (10/)
subtractFour :: (Num a) => a -> a
subtractFour = (subtract 4)
--subtract a b returns b-a
-- subtract :: Num a => a -> a -> a
--subtract a returns (a -> a) - a function that takes one parameter and subtracts the already given one from it