GHC.Arr defines
{-# INLINE unsafeArray' #-}
unsafeArray' :: Ix i => (i,i) -> Int -> [(Int, e)] -> Array i e
unsafeArray' (l,u) n@(I# n#) ies = runST (ST $ \s1# ->
case newArray# n# arrEleBottom s1# of
(# s2#, marr# #) ->
foldr (fill marr#) (done l u n marr#) ies s2#)
This is a critical array-building function, but it only works for lists. I'd like to change that. The two things that would have to change would be the type signature, which would become
unsafeArray' :: (Foldable f, Ix i) => (i,i) -> Int -> f (Int, e) -> Array i e
and its choice of foldr, from GHC.List.foldr to Data.Foldable.foldr.