chp-plus doesn't install

I'm getting these errors (ghc 6.10.4 on Linux x86_64): Building chp-plus-1.1.0... [1 of 9] Compiling Control.Concurrent.CHP.Test ( Control/Concurrent/CHP/Test.hs, dist/build/Control/Concurrent/CHP/Test.o ) [2 of 9] Compiling Control.Concurrent.CHP.Console ( Control/Concurrent/CHP/Console.hs, dist/build/Control/Concurrent/CHP/Console.o ) [3 of 9] Compiling Control.Concurrent.CHP.Connect ( Control/Concurrent/CHP/Connect.hs, dist/build/Control/Concurrent/CHP/Connect.o ) Control/Concurrent/CHP/Connect.hs:146:67: Couldn't match expected type `ChanOpts a' against inferred type `ConnectableParam (Chanout a)' In the first argument of `oneToOneChannel'', namely `o' In the second argument of `(<$>)', namely `oneToOneChannel' o' In the first argument of `(>>=)', namely `((writer &&& reader) <$> oneToOneChannel' o)' Control/Concurrent/CHP/Connect.hs:152:67: Couldn't match expected type `ChanOpts a' against inferred type `ConnectableParam (Chanin a)' In the first argument of `oneToOneChannel'', namely `o' In the second argument of `(<$>)', namely `oneToOneChannel' o' In the first argument of `(>>=)', namely `((reader &&& writer) <$> oneToOneChannel' o)' etc. -- Colin Adams Preston Lancashire

Colin Paul Adams wrote:
I'm getting these errors (ghc 6.10.4 on Linux x86_64):
Building chp-plus-1.1.0... [1 of 9] Compiling Control.Concurrent.CHP.Test ( Control/Concurrent/CHP/Test.hs, dist/build/Control/Concurrent/CHP/Test.o ) [2 of 9] Compiling Control.Concurrent.CHP.Console ( Control/Concurrent/CHP/Console.hs, dist/build/Control/Concurrent/CHP/Console.o ) [3 of 9] Compiling Control.Concurrent.CHP.Connect ( Control/Concurrent/CHP/Connect.hs, dist/build/Control/Concurrent/CHP/Connect.o )
Control/Concurrent/CHP/Connect.hs:146:67: Couldn't match expected type `ChanOpts a' against inferred type `ConnectableParam (Chanout a)' In the first argument of `oneToOneChannel'', namely `o' In the second argument of `(<$>)', namely `oneToOneChannel' o' In the first argument of `(>>=)', namely `((writer &&& reader) <$> oneToOneChannel' o)'
I don't immediately have a GHC 6.10.4 machine to hand, but that is an odd error. Here is the code in question: instance ConnectableExtra (Chanout a) (Chanin a) where type ConnectableParam (Chanout a) = ChanOpts a connectExtra o = (>>=) ((writer &&& reader) <$> oneToOneChannel' o) (based on the class: class ConnectableExtra l r where type ConnectableParam l connectExtra :: ConnectableParam l -> ((l, r) -> CHP ()) -> CHP () ) So I don't see why there is a type mismatch; ConnectableParam (Chanout a) is ChanOpts a. I don't know if it's somehow confused by the recently added similar instance: instance ConnectableExtra (Chanout a) (Shared Chanin a) where type ConnectableParam (Chanout a) = ChanOpts a connectExtra o = (>>=) ((writer &&& reader) <$> oneToAnyChannel' o) There's no conflict between the two instances, though. I wonder if making ConnectableParam depend on "l" and "r" would fix it. I'll look further into this when I get onto a 6.10.4 machine. Thanks, Neil.

Colin Paul Adams wrote:
I'm getting these errors (ghc 6.10.4 on Linux x86_64):
Building chp-plus-1.1.0... [1 of 9] Compiling Control.Concurrent.CHP.Test ( Control/Concurrent/CHP/Test.hs, dist/build/Control/Concurrent/CHP/Test.o ) [2 of 9] Compiling Control.Concurrent.CHP.Console ( Control/Concurrent/CHP/Console.hs, dist/build/Control/Concurrent/CHP/Console.o ) [3 of 9] Compiling Control.Concurrent.CHP.Connect ( Control/Concurrent/CHP/Connect.hs, dist/build/Control/Concurrent/CHP/Connect.o )
Control/Concurrent/CHP/Connect.hs:146:67: Couldn't match expected type `ChanOpts a' against inferred type `ConnectableParam (Chanout a)' In the first argument of `oneToOneChannel'', namely `o' In the second argument of `(<$>)', namely `oneToOneChannel' o' In the first argument of `(>>=)', namely `((writer &&& reader) <$> oneToOneChannel' o)'
There's no conflict between the two instances, though. I wonder if making ConnectableParam depend on "l" and "r" would fix it. I'll look further into this when I get onto a 6.10.4 machine. That did indeed turn out to be the fix. That will teach me to release a
Neil Brown wrote: package without remembering to test it on GHC 6.10 first. I've uploaded chp-plus 1.2.0 to Hackage, which should fix this issue (among other changes). So: cabal update && cabal install chp-plus Should work now. Let me know if you have any other troubles. Thanks, Neil.

"Neil" == Neil Brown
writes:
Neil> That did indeed turn out to be the fix. That will teach me to Neil> release a package without remembering to test it on GHC 6.10 Neil> first. I've uploaded chp-plus 1.2.0 to Hackage, which should Neil> fix this issue (among other changes). So: Neil> cabal update && cabal install chp-plus Neil> Should work now. Let me know if you have any other troubles. Yes, I was able to compile and run the first program in the tutorial. Thanks. -- Colin Adams Preston Lancashire
participants (2)
-
Colin Paul Adams
-
Neil Brown