unsafeShift operations for Data.Bits

Samuel Bronson naesten at gmail.com
Mon Nov 6 14:09:18 EST 2006

On 11/6/06, roconnor at theorem.ca <roconnor at theorem.ca> wrote:
> On Mon, 6 Nov 2006, Samuel Bronson wrote:
> > And use them for the default implementation of rotate, while we are at it.
> I thought you had a patch to GHC that worked really well?  I think it is
> much beter idea to fix the inliner rather than exposing unsafe
> functionality.

It isn't really *unsafe*, exactly. But it might not be purely
functional. However, it isn't imperative or anything like that. Also,
for rotate, I needed to change the implementations in the *libraries*
(it was only the GHC-specific implementations, though). (Also, nobody
seems to have applied that patch yet for some reason.) And I needed to
change them to use the raw, unchecked primops.

Oh, that reminds me. Why call them "unsafe"? Why not "unchecked" as
GHC's primops are called?

More information about the Libraries mailing list