The following code gives the error: "No instance for ‘MArray (STArray s) Char Identity’ arising from a use of ‘readArray’. Can someone help me understand what’s wrong? Thanks!
foo = runST do
ary <- newListArray (0,4) "hello" :: ST s (STArray s Int Char)
pure $ flip execState "" do
for_ [0..4] \i -> do
c <- lift $ readArray ary i
modify' (c:)