counts :: [[TSInterval]] -> [(TSInterval, Int)]
counts ss = if null times then [] else counts' 0 (fst $ head times) times
  where toTimes = concat . map (\ (a, b) -> [(a, Start), (b, End)])
        times   = sort (concat $ map toTimes ss)
counts :: [[TSInterval]] -> [(TSInterval, Int)]
counts ss = if null times then [] else counts' 0 (fst $ head times) times
  where toTimes = concat . map (\ (a, b) -> [(a, Start), (b, End)])
        times   = sort (concat $ map toTimes ss)
counts ss = if null times then [] else counts' 0 (fst $ head times) times
  where toTimes = concat . map (\ (a, b) -> [(a, Start), (b, End)])
        times   = sort (concat $ map toTimes ss)