Changes

Jump to navigation Jump to search
2 bytes added ,  14:48, July 15, 2016
→‎An Example of Why and How: Spelling/Grammar Check, typos fixed: For example → For example,, defintion → definition
Line 14: Line 14:  
Rather than giving multiply a tuple with two numbers, what if we only gave multiply one number. This function would then return another function, which took another number. This second function would then return the answer.
 
Rather than giving multiply a tuple with two numbers, what if we only gave multiply one number. This function would then return another function, which took another number. This second function would then return the answer.
   −
For example if we were multiplying 3 and 2, multiply would take 3, return a new function called ''multiply 3'' which takes 2 as its argument and returns 6.
+
For example, if we were multiplying 3 and 2, multiply would take 3, return a new function called ''multiply 3'' which takes 2 as its argument and returns 6.
    
In Haskell syntax we would define this as
 
In Haskell syntax we would define this as
Line 21: Line 21:  
  multiply x y = x * y
 
  multiply x y = x * y
   −
With this new defintion we can just set out function double to be multiply 2. In Haskell this is
+
With this new definition we can just set out function double to be multiply 2. In Haskell this is
    
  double :: Integer -> Integer
 
  double :: Integer -> Integer
Block, SkipCaptcha, Automoderated users, Bots, edit
57,719

edits

Navigation menu