setIO a@(IOA sz p) i v
  = do arr     <- readIORef p
       let arr' = set arr i v
       writeIORef p arr'


{-@ ofListIO :: xs:[a] -> IO ({v:IOArr a | size v = len xs}) @-}
setIO a@(IOA sz p) i v
  = do arr     <- readIORef p
       let arr' = set arr i v
       writeIORef p arr'


{-@ ofListIO :: xs:[a] -> IO ({v:IOArr a | size v = len xs}) @-}
setIO a@(IOA sz p) i v
  = do arr     <- readIORef p
       let arr' = set arr i v
       writeIORef p arr'


{-@ ofListIO :: xs:[a] -> IO ({v:IOArr a | size v = len xs}) @-}