is there a simple way to control time complexity of functions in haskell?
I have constructed a function that reverses a list of any type, the goal is to have it in linear time complexity which i have attempted to solve like this:
rev :: [a] -> [a]
rev(x:[]) = [x]
rev(x:xs) = (rev xs) ++ [x]
my intetion is to have it linear, O(n), but i am unsure if it actually is and would therefore like use some type of tool that might analyze the code/function to show that it is infact linear.
i would thus like to know:
Is this function linear? can i show it with any analyzing tools?