Containers depending on ghc-prim

Hi all, is it OK for containers to depend on ghc-prim package? The GHC documentation says not to use it, but it seems to me people are using it whenever they need :) I do not know whether there is any policy about that. Any comments, GHC HQ? The reason for that is unchecked bit shift. Data.Bits.shift[L|R] and GHC.Exts.shift[L|RL]# perform checks to ensure the shift is not by more than WORD_SIZE_IN_BITS. That does not sound like a big deal, but it causes unnecessary heap allocation that I could not reliably avoid. Using GHC.Prim.uncheckedShift[L|RL]# produces best code. Cheers, Milan PS: Dependency would be GHC-specific, non-GHC compilers use Data.Bits.shift[L|R].

On Wed, Oct 12, 2011 at 10:11 AM, Milan Straka
is it OK for containers to depend on ghc-prim package? The GHC documentation says not to use it, but it seems to me people are using it whenever they need :) I do not know whether there is any policy about that. Any comments, GHC HQ?
Yes, as long as you make sure the package is still portable. In the next version of base we'll have Data.Bits.unsafeShirt{R,L}. -- Johan

On 12 October 2011 23:43, Johan Tibell
Yes, as long as you make sure the package is still portable. In the next version of base we'll have Data.Bits.unsafeShirt{R,L}.
Is the unsafe shirt the same one as the hair shirt? :p -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
participants (3)
-
Ivan Lazar Miljenovic
-
Johan Tibell
-
Milan Straka