
Hello, My question/wish is maybe naive, but anyway: Is there a library (not a language extension, like Concurrent Haskell, Glasgow Parallel Haskell, ...) enabling to run two functions in parallel, possibly in cascade? Something like:
testAll (threadStart f1 (threadStart f2 f3))
where threadStart :: a -> b -> (WillBe a, WillBe b) where type WillBe is something like Maybe, but changing within a time (mutable values) ~ Processing, Just a, Nothing
testAll (Nothing,p) = putStr "No result for f1" >> testPair p testAll (l,(Nothing,r)) = putStr "Noresult for f2" >> testPair (l,r) testAll (l,(ll,Nothing)) = putStr "No result for f3" >> testPair (l,ll) testAll (Just a,p) = putStr ("res of f1: " ++ show a) >> testPair p ...
testPair ~ about the same like testAll
Probably the explanation is not too clear and what I wish is out of the language scope (not really functional), but I would appreciate something like that. Is there something like that for Haskell/Hugs? Thx for any ref. Dusan

Why doesn't Concurrent Haskell suit your needs? Dean Dusan Kolar wrote:
Hello,
My question/wish is maybe naive, but anyway: Is there a library (not a language extension, like Concurrent Haskell, Glasgow Parallel Haskell, ...) enabling to run two functions in parallel, possibly in cascade?
Something like:
testAll (threadStart f1 (threadStart f2 f3))
where threadStart :: a -> b -> (WillBe a, WillBe b) where type WillBe is something like Maybe, but changing within a time (mutable values) ~ Processing, Just a, Nothing
testAll (Nothing,p) = putStr "No result for f1" >> testPair p testAll (l,(Nothing,r)) = putStr "Noresult for f2" >> testPair (l,r) testAll (l,(ll,Nothing)) = putStr "No result for f3" >> testPair (l,ll) testAll (Just a,p) = putStr ("res of f1: " ++ show a) >> testPair p ...
testPair ~ about the same like testAll
Probably the explanation is not too clear and what I wish is out of the language scope (not really functional), but I would appreciate something like that. Is there something like that for Haskell/Hugs?
Thx for any ref.
Dusan

Dusan Kolar asked:
My question/wish is maybe naive, but anyway: Is there a library (not a language extension, like Concurrent Haskell, Glasgow Parallel Haskell, ...) enabling to run two functions in parallel, possibly in cascade?
I think the best you can get without language extensions is what is described in Koen Claessen's Functional Pearl "A Poor Man's Concurrency Monad". It's really nice, but not exactly what you seem to want. You can get that article from http://www.cs.chalmers.se/~koen/publications.html All the best Christian Sievers
participants (3)
-
Christian Sievers
-
Dean Herington
-
Dusan Kolar