mkSection_ :: Text -> [SectionBodyLine] -> Either String ConfigSection
mkSection_ renderedName l = mkSection options comments blankLines renderedName
  where
    (options, comments, blankLines) = foldr go ([], [], []) $ zip l [0..]
    go (OptionLine key desc, i)  (as, bs, cs) = ((key, (i, desc)) : as ,         bs,          cs)
    go (CommentLine x,       i)  (as, bs, cs) = (                   as, (i, x) : bs,          cs)
    go (BlankLine x,         i)  (as, bs, cs) = (                   as,          bs, (i, x) : cs)
mkSection_ :: Text -> [SectionBodyLine] -> Either String ConfigSection
mkSection_ renderedName l = mkSection options comments blankLines renderedName
  where
    (options, comments, blankLines) = foldr go ([], [], []) $ zip l [0..]
    go (OptionLine key desc, i)  (as, bs, cs) = ((key, (i, desc)) : as ,         bs,          cs)
    go (CommentLine x,       i)  (as, bs, cs) = (                   as, (i, x) : bs,          cs)
    go (BlankLine x,         i)  (as, bs, cs) = (                   as,          bs, (i, x) : cs)
mkSection_ renderedName l = mkSection options comments blankLines renderedName
  where
    (options, comments, blankLines) = foldr go ([], [], []) $ zip l [0..]
    go (OptionLine key desc, i)  (as, bs, cs) = ((key, (i, desc)) : as ,         bs,          cs)
    go (CommentLine x,       i)  (as, bs, cs) = (                   as, (i, x) : bs,          cs)
    go (BlankLine x,         i)  (as, bs, cs) = (                   as,          bs, (i, x) : cs)