-
Notifications
You must be signed in to change notification settings - Fork 60
Make array creation friendlier to worker-wrapper #104
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
Conversation
e45a301 to
47d2765
Compare
|
The Core looks rather better, IMO (see, e.g., what this does to |
|
Another option is to write |
|
Forgive me for being dense, but I'm still a bit unclear (from the comments, at least) how this is improving the interaction w.r.t. worker-wrapper. Can you expand on the comments a bit to clarify? Also, if I understand correctly, this will make creating empty arrays slightly slower, yes? If so, is there an alternative way to create an empty array that is faster? We should point in out in the Haddocks if so. |
|
i guess another way of stating Ryan's question is: what is a small example of what worker wrapper will facilitate here? An important detail to keep in mind with Primitive is that its foremost a toolkit for mutable data structures, and fusion-y optimizations tend to be very low ROI in those cases. We should provide all the right primitives for supporting easy optimization in client libraries (like vector), but that doesn't mean we should push fusion into this layer? I'm open to being educated / convinced about this, but could you help Ryan and Myself understand the goal / code improvements this will facilitate and some toy example where the change is high impact/measurable? |
|
The fact that immutable arrays aren't the prime directive doesn't mean they should get short shrift! I'm not really doing anything fancy here. Suppose I write |
|
To be clear,
|
|
@RyanGlScott, yes, this will make creating empty arrays with |
Oops, I missed that part, so that makes that concern pretty much moot :) |
4415300 to
c41af1c
Compare
* Let GHC can erase `Array` constructors in many cases. * Add a `runArray` function like the ones in `array` and `vector`. Closes haskell#102
c47d53f to
b233062
Compare
Closes #102