map :: (Contiguous arr1, Element arr1 b, Contiguous arr2, Element arr2 c) => (b -> c) -> arr1 b -> arr2 c
convert :: (Contiguous arr1, Element arr1 b, Contiguous arr2, Element arr2 c) => arr1 b -> arr2 b
convert actually has the exact same implementation as map, except that b unifies with c in the case of the former.
So, we should change the implementation of convert a = runST $ do ... to convert a = map id a.
the relevant types:
convert
actually has the exact same implementation asmap
, except thatb
unifies withc
in the case of the former.So, we should change the implementation of
convert a = runST $ do ...
toconvert a = map id a
.