The lsp library abstracts over an Io monad with a write implementation, but it invokes write twice across a bind with an assumption that those writes will not be interleaved (code). This assumption may hold for the fiber implementation, but it does not necessarily hold for any monad. The writes need to be sequenced.