 ->
   ([ `line of line_callback
    | `close of close_callback]
     [@bs.string]) ->  unit = "" [@@bs.send]

let register readline =
  on readline (`line begin fun s -> prerr_endline s end);
  on readline (`close begin fun () -> prerr_endline "finished" end);
  print_endline "done"
```

---

## FFI examples

- In BuckleScript, `##` is used as method dispatch

```ocaml
let f obj = obj##height + obj##width
val f : [%obj: < height : int ; width : int ; .. > ] -> int
let a = f [%obj { height = 3; width = 32}]