Repository navigation
Tweak unsafePartial usages - #57
Conversation
|
Ah... In that case, let me rework how I'm doing that here. |
|
How's that? |
|
That works—and you don't need to eta-expand But now that I'm bothering to test it, this approach does cause the compiler to introduce a thunk where there wasn't before. Not as big a deal as losing TCO, to be sure, but that does explain why the |
Darn... I'm assuming you're looking at the FFI to conclude that? And if so, is it the FFI of Ideas for how to update this without TCO being removed or the thunk being added? |
|
My PR, but I'd expect the same on master. Two ideas: We could always add Or, we could move the This all makes me a little sad. Efficient code shouldn't be this fragile. |
I went with this approach instead. |
There was a problem hiding this comment.
Would work with my PR and remove the need for the hack (unless we want to keep it in case private user code uses this same idiom), with no negative consequences from an end-user's perspective. I haven't been nearly as involved in developing core libraries as I have with the compiler so this isn't a full ‘I approve of this change as a maintainer’ approval. (Ah, good, GitHub apparently agrees.)
|
@natefaubion Any thoughts on this? Merging this will enable Ryan to remove the "hacky" way of dealing with this particular case in purescript/purescript#4283 I'm not sure how often the pattern of |

Description of the change
See purescript/purescript#4179 (comment)
CC @rhendric. Would this PR work? Or do I really need to use
let x = ... in unsafePartial x? I'm trying to keep the diff smallChecklist: