-
Notifications
You must be signed in to change notification settings - Fork 141
Export Primitive Vector's constructor #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export Primitive Vector's constructor #31
Conversation
- Document briefly Vector's and MVector's fields
I know we export it elsewhere, but personally I'm not a fan of exporting datatype constructors (it makes it difficult to change the representation later), and would prefer a function unsafeToByteArray :: Vector a -> ByteArray# On the other hand, we've already exported the constructor for MVector so maybe the cat is already out of the bag. |
Sound reasonable. But, then it would make sense to hide the MVector constructor too (otherwise you can't really change the internal representation, and just for consistency), and this would be a backward incompatible change in itself. Anyway, whichever solution is preferred! I am OK with either. |
I would say "put it to a vote" but breaking backwards compatibility would make a mess here, and (correct me if I'm wrong) I don't think we can attach a deprecation warning to the exported constructor without marking the whole type as deprecated. I think really this means that the "exposed constructors" camp has already won here and that we should merge your change just for consistency. |
Export Primitive Vector's constructor
Thanks! |
I think we should expose these constructors from an Otherwise I think this is a good change. |
Consistency is the bugbear of small minds/etc., but are you really saying you don't want them to match? |
Only foolish consistency. The upside of having an I want both |
I'd like to at least know what the actual cost would be of not keeping the |
Impossible to know, not all the world is Hackage. That code has had a public release, we can't walk the decision back without warning end users. |
would the deprecation pragma work here, btw? |
@hvr: no, because it would also deprecate the MVector type. And also, we don't want to deprecate the value, just want to state that it should be imported from another module. @tibbe: How about this; we add two brand new modules: |
Yes. On Thu, Jun 26, 2014 at 9:08 PM, Mihaly Barasz notifications@github.com
|
This is useful to access the underlying ByteArray, eg. to pass it to FFI functions.