I have a list of string lengths, and I want to make span indices from them. So given lengths [23, 27, 47] I want to produce [(0, 23), (24, 27), (28, 47)]. How can I do that?
Here's what I have so far. I'm not sure I'm on the right track:
makeSpans :: [Int] -> [(Int, Int)]
makeSpans [x:y:xs] = [(x+1, y), makeSpans xs]
makeSpans [x:y] = (x+1, y)
makeSpans y = y