How to write a recursion function in haskell
问题 How can I write a function in Haskell which takes a list and a number and it removes all the elements greater than that number and returns the list. remove [5, 4, 3, 9, 1 ] 5 should return [5,4,3,1] I wrote the following method which is becoming infinite loop some where when it hits the greater than the given number. I am getting out [5,4,3 and then program is not ending. remove l1 x = if (null l1 == True) then l1 else if (head l1 > x) then remove (drop 0 l1) x else ((head l1) : remove (tail