getSums :: [String] -> [[String]]
getSums strs = go strs [] []
    where go []       [] acc = reverse acc
          go []       s1 acc = reverse ((reverse s1):acc)
          go ("|":ss) s1 acc = go ss [] ((reverse s1):acc)
          go (s:ss)   s1 acc = go ss (s:s1) acc

-- Parses the text.
getSums :: [String] -> [[String]]
getSums strs = go strs [] []
    where go []       [] acc = reverse acc
          go []       s1 acc = reverse ((reverse s1):acc)
          go ("|":ss) s1 acc = go ss [] ((reverse s1):acc)
          go (s:ss)   s1 acc = go ss (s:s1) acc

-- Parses the text.
getSums strs = go strs [] []
    where go []       [] acc = reverse acc
          go []       s1 acc = reverse ((reverse s1):acc)
          go ("|":ss) s1 acc = go ss [] ((reverse s1):acc)
          go (s:ss)   s1 acc = go ss (s:s1) acc

-- Parses the text.