Skip to main content
added 110 characters in body
Source Link
Palle
  • 12.3k
  • 3
  • 43
  • 64

You're passing the average2 function to the append function instead of calling it in the last line. Also, newList is empty and does not get mutated nor read from. You can just add a new head to the list when returning it.

Change it to

append newList [((x + x')/2)] :: (average2 x' :: [xs]) 

You're passing the average2 function to the append function instead of calling it in the last line.

Change it to

append newList [((x + x')/2)] (average2 x' :: [xs]) 

You're passing the average2 function to the append function instead of calling it in the last line. Also, newList is empty and does not get mutated nor read from. You can just add a new head to the list when returning it.

Change it to

((x + x')/2) :: (average2 x' :: [xs]) 
Source Link
Palle
  • 12.3k
  • 3
  • 43
  • 64

You're passing the average2 function to the append function instead of calling it in the last line.

Change it to

append newList [((x + x')/2)] (average2 x' :: [xs])