DrBoolean / freeky

Free monad Collection
MIT License
176 stars 15 forks source link

Applicatives with Free Monads #2

Open paparga opened 8 years ago

paparga commented 8 years ago

Hi!

I live in Chile and an average request to the United States has about 200 ms latency, so for us making request in parallel really improves the user experience. I'm using your version of data.task with non blocking ap, but I loose that improvement if I use this or other free monad library.

So is there some way for combining the power of applicatives with this library? I don't care if it isn't very performant, I have 200 ms of latency.

Thanks

rjmk commented 8 years ago

I believe dispatch to ap could be down similarly to fold here and this.chain(f => a.map(f)) here would become this.x.ap ? this.x.ap(a) : this.chain(f => a.map(f))

DrBoolean commented 8 years ago

@rjmk yep! Anyone want to submit a PR or shall i go for it?

rjmk commented 8 years ago

PR here. Now here