Merge pull request #280 from ZornitsaAsanska/Haskell

Added my name and some Haskell code
This commit is contained in:
Luke Oliff
2018-10-08 09:44:29 -07:00
committed by GitHub
2 changed files with 19 additions and 0 deletions

14
code/ZornitsaAsanska.hs Normal file
View File

@@ -0,0 +1,14 @@
--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