Closed Bodigrim closed 8 months ago
@Bodigrim I extended same treatment to unsafeSlice
and converted comment to GHC note. This seems to be a good format for long form comment which are referenced from multiple places in source code
If you're fine with this I'd like to merge this PR
@Shimuuar sure, go ahead.
basicUnsafe{Read/Write/IndexM}
are class members and, unless a call site was already specialised to a specific vector instance, GHC has no clue that the index is most certainly to be used eagerly. Bang before the index provides this vital for optimizer information.I've been recently looking at Core for programs, where vectors did not specialise to a specific instance for one reason or another. It's really horrible: even if a specific instance remains unknown, we should tell GHC that passing boxed indices around is not OK.