-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add methods or
and and
for concurrency
#27
Comments
@jdegoes I would love to hear your thoughts on this. |
@safareli if you haven't seen it already, there's some discussion of concurrent free applicatives in section 5.4 of "There is no fork" http://dl.acm.org/citation.cfm?id=2628144 |
url is not working |
(amended the link - from there, follow the link to the pdf) |
Free is concurrent if target monad is not lawful. so if in perfect world all Task/Futures are lawful then there will be no concurrency benefits from dispatching to if we add some minimal concurrency constructs to Free and then it would be possible to still fold it concurrently when target monad is lawful. related issue: fantasy-land#179 |
will take a look at that paper but haxl is not lawful as well |
I like it. FWIW, |
|
If we had that algebras in FL then foldMap would become: foldMap :: (ChainRace m, ChainRec m, Monad m) => Free i a ~> (i -> m a) -> TypeRep m -> m a And with something like Parallel we can transform |
Also related: SeqPar - Free applicative in free monad |
Currently i'm porting the recent version of haskell-free-concurrent. Before I did not understood the implementation because of Lenses and it's strange operators, but now I did another try and i got it 🎉 |
I was thinking what if instead of ignoring law
<*> = ap
make Free lawfull but add two methodsor
andand
which could be used when actions should be resolved concurrently.possibly change
foldmap
to somethink like this:we would need to change type of Free to:
it would also change description of the repo
With this constructs we could also have this static methods on Free:
The text was updated successfully, but these errors were encountered: