-
Notifications
You must be signed in to change notification settings - Fork 90
Make function composition stack safe #150
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
I got this idea just today and couldn't hold to build and open PR 🗡 It's sort of composition of work done in Eff http://github.com/purescript/purescript-eff/pull/31 and the post I wrote a while ago about Stack safe Function composition. /cc @natefaubion @paf31 It's worth noting that whenever it's known that composition is happening for function type, compiler is doing optimization so this FFI function will not be called at all, that's why I use |
Sorry, but in my opinion this is totally unsuitable for Prelude. As I said on the |
I'm with @paf31 on this, I think, especially since this only seems to have an effect in rare cases (I don't remember the last time I wrote a function with a |
Fair points 🙌 |
@safareli did you end up doing anything with this in terms of making a separate lib? I think there could be some really handy uses. |
I don't think this will work for |
Nope, how you think this could be used as separate lib? |
Function newtype, perhaps?
…On Tue, 13 Feb 2018 at 10:11, Irakli Safareli ***@***.***> wrote:
Nope, how you think this could be used as separate lib?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#150 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AARBS_GjXsUeTdyadhRUudCNeLZpgleUks5tUdBJgaJpZM4RCehI>
.
|
|
Did you get the stack overflow by using Builder? |
Yes, if you compose enough |
(or rather, the |
Sure, it's less likely to happen, so was curious if you had practical case where it happened. |
Don't worry too much about it, as I have another solution for my situation. I just think this particular solution is quite interesting, and probably could be applied in other situations, too. |
I have published the lib here https://github.com/safareli/purescript-stacksafe-function |
TODO