I think you really don't need this. The problems is the line just after, which should not be evaluated at top level. The solution is to have:
```
let kv_ro_of_fs fs = ....
```