How can I edit the following code to make Haskell show all the possibilities of rotating an input list from the user :
rotate :: Int -> [a] -> [a]
rotate n text = take (length text) (drop n (cycle text))
I assume that to print all the possibilities we need to drop the first element X times. where X is the length of the list entered.
circle :: [a] -> [[a]]
circle text = take (length text) (drop (1) (cycle text))
I can't perform the operation where the list is printed X times. Also I have errors while running the above code which states the following: Couldn't match type ‘a’ with ‘[a]’
I wanted the Output to be something like that:
circle "ab"
["ab","ba"]