let to_object tr =
object
  method next = next tr
  method feed s = feed tr s
  method stop = stop tr
end