Converting anki-furigana to HTML-furigana without parser libraries
Building a list like ((... ++ [_]) ++ [_]) ++ [_] takes quadratic time, break doesn't.

parse :: String -&gt; [Tag]
parse lss = case break (`elem` "[ \n") lss of
  ([],         []) -&gt; []
  ([],     '[':ls) -&gt; parseUpText ls
  ([],     ' ':ls) -&gt; Blank     : parse ls
  ([],    '\n':ls) -&gt; Newline   : parse ls
  (kana,       ls) -&gt; Kana kana : parse ls

parseUpText :: String -&gt; [Tag]
parseUpText lss = case break (== ']') lss of
  ([],         []) -&gt; []
  (kana,       []) -&gt; [Kana (' ':kana)]
  ([],     ']':ls) -&gt; parse ls
  (uptext, ']':ls) -&gt; Uptext uptext : parse ls