-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Hybrid free monad / free applicative #983
Comments
So the interesting thing is that it allows you to control the I am unsure about this because of the dangers of |
@adelbertc It only introduces danger of having inconsistent There is the question of whether certain execution semantics (such as |
Oh and by the way, thanks for bringing this up @bqm :). This is something that I've thought about and discussed with several people, but I don't think it ever made itself into a GitHub issue. |
Can this use case be solved by newtype-ing (wrapping in a value class/tagged types) and overriding the |
@adelbertc I think only if you reify an |
Probably waiting on this as well #990 |
just a heads up on this video which, towards the end, combines both Free and FreeApplicative using Coproduct. i couldn't find the source code for the example though. |
Found the code and slides for @markus1189 presentation that @weihsiu mentioned above in case anyone was looking for those: https://github.com/markus1189/flatmap-oslo-2016 |
I think you might need to take a look at haskell-free-concurrent written by @srijs and my improgress port of it to JS safareli/free#31, this allows to mix |
Also the P.S. to not i'm not familiar with scala and type signatures might not be correct |
Contrast with Also relevant is my |
Yeah indeed @jdegoes the post-free talk sounds more like a workshop, is there any chance to get a recording or maybe a write-up afterwards? :D |
Can't wait to read/watch that :p |
Hopefully it will be recorded. 😄 If not, I will write up in a blog. |
For those interested, I tried to translate @jdegoes ' |
@peterneyens Cool! 😄 |
For those interested, this has been implemented in typelevel |
Markus's talk is also on youtube: https://www.youtube.com/watch?v=C2hCOGYRxP0 |
Hello,
I am new to the cats project & open source in general - cats is a great project & I learnt a lot from it :)
I've been exploring free monads recently & my understanding is that we can't express parallel operations with them. Free applicatives on the other hand, allow us to express parallelism but we can't express sequential operations.
It seems that it could be interesting to have a data structure that could support both use cases - sequential & parallel operations. For instance, we may want to implement a key value store DSL and be able to write a program like "do these 2 put operations in parallel and if they succeeded, do these 2 get operations in parallel".
I've made a naive implementation of such a structure to show what I mean (naive implementation because I lose a few interesting properties like the tail recursive interpreters for instance) & wrote a simple client code example.
Naive implementation: https://gist.github.com/bqm/bee72c18fa4baa708f7cf2b146bbc872
Simple client code: https://gist.github.com/bqm/e8e28c06311be8d76071729dcaf5b836
What do you think of having an hybrid structure like that in cats?
The text was updated successfully, but these errors were encountered: