Changes to primops break libraries (was Re: 7.8 Feature window)
simonpj at microsoft.com
Thu Aug 22 14:40:09 CEST 2013
| •Six primops are an exception to the rules above: sameMutableArray#,
| sameMutableByteArray#, sameMutableArrayArray#, sameMutVar#, sameMVar#
| and sameTVar#. Their names have remained the same as before and new
| wrappers created for them lack # at the end of their name. We made that
| decission because this naming feels more consistent and these primops
| are rarely used so we expect that they won't break a lot of existing
1. Why do you say "this naming feels more consistent"? Consistent with what? I'd expect sameTVar# to return a Bool, just like ==#.
I'd prefer to say "just import PrimWrappers" than to say "just import PrimWrapper and change the names of these six functions". I don’t really see a clear distinction at all.
2. The module name PrimWrappers is terrible, because it's so close to PrimopWrappers, which is machine generated. Lots of scope for confusion. How about CmpOpWrappers or BoolOpWrappers? Any opinions from other ghc-devs?
3. Could you add a section "Breaking changes" to http://ghc.haskell.org/trac/ghc/wiki/PrimBool to explain what to change. Currently it's buried (in bold I know) in "Implementation details" which is not where I'd look as a library author.
4. Can the release notes http://ghc.haskell.org/trac/ghc/browser/docs/users_guide/7.8.1-notes.xml perhaps refer to the wiki page? That gives much more background. Library authors will find that helpful.
So long as we get these choices fixed for 7.8 we are fine.
More information about the ghc-devs