let xhtml_of_textile stream = let rec loop (acc : blocks) = try let block = Stream.next stream in loop {{ acc @ [(xhtml_of_block block)] }} with Stream.Failure -> acc in loop {{ [] }}