I'm working with this type of list:
data Elem = Dot | Star
and I've to print a list of tuples, with 2 units, in which the first indicates the length of a sequence of "Star" in the list and the second lists the locations where this sequence appears (the first position is 1). Possibly without using built in function.
The function is:
occ :: [Elem] -> [(Int, [Int])]
EDIT: My idea is: split the problem in two functions, one for find the position of every "Star", one for lists the locations.
EDIT2: Example:
occ [Dot,Star,Dot,Star,Dot,Star,Star,Star]
[(1,[2,4]), (3,[6])]
EDIT3: http://pastebin.com/uvvXBARL