Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. applyTimesExerciseA = applyTimes 5 (+ 1) 5
  2.  
  3. applyTimesExerciseB = (+ 1) (applyTimes 4 (+ 1) 5)
  4.  
  5. applyTimesExerciseC = (+ 1) ((+ 1) (applyTimes 3 (+ 1) 5))
  6.  
  7. applyTimesExerciseD = (+ 1) ((+ 1) ((+ 1) (applyTimes 2 (+ 1) 5)))
  8.  
  9. applyTimesExerciseE = (+ 1) ((+ 1) ((+ 1) ((+ 1) (applyTimes 1 (+ 1) 5))))
  10.  
  11. applyTimesExerciseF =
  12. (+ 1) ((+ 1) ((+ 1) ((+ 1) ((+ 1) (applyTimes 0 (+ 1) 5)))))
  13.  
  14. applyTimesExerciseG = (+ 1) ((+ 1) ((+ 1) ((+ 1) ((+ 1) (5)))))
  15.  
  16. applyTimesExerciseH = (+ 1) ((+ 1) ((+ 1) ((+ 1) ((+ 1) 5))))
  17.  
  18. applyTimesExerciseI = (+ 1) ((+ 1) ((+ 1) ((+ 1) 6)))
  19.  
  20. applyTimesExerciseJ = (+ 1) ((+ 1) ((+ 1) 7))
  21.  
  22. applyTimesExerciseK = (+ 1) ((+ 1) 8)
  23.  
  24. applyTimesExerciseL = (+ 1) 9
  25.  
  26. applyTimesExerciseM = 10
  27.  
  28. checkApplyTimesExercise = foldl (\acc curr -> acc && curr == 10) True
  29.  
  30. applyTimesExerciseCorrect =
  31. checkApplyTimesExercise
  32. [ applyTimesExerciseA
  33. , applyTimesExerciseB
  34. , applyTimesExerciseC
  35. , applyTimesExerciseD
  36. , applyTimesExerciseE
  37. , applyTimesExerciseF
  38. , applyTimesExerciseG
  39. , applyTimesExerciseH
  40. , applyTimesExerciseI
  41. , applyTimesExerciseJ
  42. , applyTimesExerciseK
  43. , applyTimesExerciseL
  44. , applyTimesExerciseM
  45. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement