just to clarify:
the issue lies with the pure operations.
Strictly speaking, the one on mutable byte arrays doesn't even need the effects annotation, because the ST s / IO ordering will be enough to make sure it will always be run when it should. the pure ones, would almost always need to be in some sort of monadic wrapper to make sure they're sequences ahead of time at the right time, i think
the concern lies with prefetches being for performance: they only make sense as part of a thoughtful approach to leveraging the memory bandwidth of a system, and GHC does make use of system memory buses pretty aggressively as is!
to be clear: I'd very much like to be able to write code like
prefetchPtrM :: Monad m => Ptr a -> m ()
prefetchPtrM (Ptr adr) = do (return $ prefetchAddrOp addr) ; return ()
this is reasonably motivated use case: the Vector library has monadic operations on its Pure vectors to enforce evaluation order.
naively, it seems like the right approach requires at least the "can fail" annotation, and perhaps maybe the "has side effects annotation", so that the above prefetchM operation is definable.
or maybe im not understanding something, and this is simpler than I fear?
thanks!