allocBuffer : Int -> IO Buffer
allocBuffer n = primtIO $ prim__newBuffer n
emptyBuffer : IO Buffer
emptyBuffer = allocBuffer 0
resize : Buffer -> Int -> IO ()
grow : Buffer -> Int -> IO ()
grow b n = resize b (!(rawSize b) + n)
-- same as newBuffer but without Maybe
nonEmptyBuffer : (n : Int) -> {0 auto notZero : n /= 0} -> IO Buffer
Summary
The buffer API has the following problems:
newBufferdue to MaybeThe proposal
Add the following