I\'m new in haskell and I\'m looking for some standard functions to work with lists by indexes.
My exact problem is that i want to remove 3 elements after every 5. If i
You can count your elements easily:
strip' (x:xs) n | n == 7 = strip' xs 0 | n >= 5 = strip' xs (n+1) | n < 5 = x : strip' xs (n+1) strip l = strip' l 0
Though open-coding looks shorter:
strip (a:b:c:d:e:_:_:_:xs) = a:b:c:d:e:strip xs strip (a:b:c:d:e:xs) = a:b:c:d:e:[] strip xs = xs