I have a basic problem, after if .. then I can not have more than one function, why?
check [] _ _ = []
check (x:xs) limit counter = if (x> head xs && counter < limit)
then incr counter -- I want here add another action
else if ( x < head xs )
then check xs limit counter
else incr x
main = do
print $ check [4,3,5,6] 1 0
--- The answer I aim is : [3,4,5,6]
The goal of the check is to find whether each element is bigger than the next one or not, if yes then increase counter and do another action like swap their places, and there is a limit for this action, like here is just 1 time, means just 1 times it can do that action not more.