Skip to content
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

ApplicativeRec #75

Open
jnape opened this issue Oct 5, 2019 · 0 comments
Open

ApplicativeRec #75

jnape opened this issue Oct 5, 2019 · 0 comments

Comments

@jnape
Copy link
Member

jnape commented Oct 5, 2019

It seems like there could exist an equivalent stack-safe applicative, similar to MonadRec, working title ApplicativeRec, with a trampolineA :: ApplicativeRec f => f (a -> RR a b) -> f a -> f b. Furthermore, it would get an instance for free for every MonadRec in the form of trampolineA f = trampolineM (\a -> fmap ($ a) f).

However, applicatives that support custom zip semantics (like IO that can zip in parallel), or applicatives that are implicitly stack-safe but do not support parallel execution (like Lazy) could offer better implementations than the default built on trampolineM.

This may also make it possible for SafeT to preserve nested stack-safe parallel composition for zips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant