purescript-native-cpp-ffi icon indicating copy to clipboard operation
purescript-native-cpp-ffi copied to clipboard

aff monad

Open srghma2 opened this issue 5 years ago • 4 comments

any ideas how to implement it?

srghma2 avatar Nov 19 '19 20:11 srghma2

I haven't looked into it, although I've wanted to do so for a while. I imagine there are a few implementation possibilities. Do you have a specific use case or app that you want to port?

andyarvanitis avatar Nov 21 '19 05:11 andyarvanitis

Hi, cool. No, I don't have use case yet, this is just something I noticed

srghma2 avatar Nov 22 '19 06:11 srghma2

I'm interested in this as well. So far, mostly to use dependencies that rely on it. For instance, I just hit this trying to use purescript-spec. https://github.com/purescript-spec/purescript-spec/blob/master/example/Main.purs. I ended up switching to quickcheck, as I just wanted any test library.

For concurrency in general, I wrote some hacky bindings around go routines using a wait group, with two functions async and await, where async kicks off a go routine and await waits on the wait group. It's missing all the sophistication of Aff, but maybe an alternative purescript-native concurrency toolkit aimed at things that are straightforward to implement in go would be useful: wrapping some of the basic features of go routines and channels.

joprice avatar Oct 14 '20 22:10 joprice

There have been a couple people offering to implement Aff, but I haven't gotten a PR or report that they were successful. I'd like to do it myself (maybe initially just for golang, but eventually also for C++) if I manage to find the time.

andyarvanitis avatar Oct 15 '20 03:10 andyarvanitis