Advertisement
CamolaZ

FirstClassof3 PPL

Mar 5th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. plus :: Double -> Double -> Double
  2. plus x y = x +y
  3.  
  4. b1 :: [Double]
  5. b1=[31,2,756,3]
  6. b2 = [2,6..100]
  7.  
  8. -- init is everything except last one!
  9.  
  10. --EX. 1
  11. hello :: String -> String
  12. hello n = "Hello "++n ++" Great!!!"
  13.  
  14.  
  15. --Ex. 2
  16. vol :: Num a => a ->a -> a -> a
  17. vol x y z = x*y*z
  18.  
  19. --Ex. 3a
  20. doubleMe :: Num a => a -> a
  21. doubleMe a = 2*a
  22.  
  23. --Ex. 3b
  24.  
  25. myNumbers :: [Integer]
  26. myNumbers = [11,12..99]
  27.  
  28. --Ex. 3c
  29. map doubleMe myNumbers --on Terminal
  30.  
  31. --Ex. 3d
  32. mod13 :: [Integer]
  33. mod13 list =
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement