
#7887: panic when playing with pipes -------------------------------+-------------------------------------------- Reporter: bfr | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.6.3 Resolution: fixed | Keywords: Os: Unknown/Multiple | Architecture: Unknown/Multiple Failure: None/Unknown | Difficulty: Unknown Testcase: | Blockedby: Blocking: | Related: -------------------------------+-------------------------------------------- Changes (by igloo): * difficulty: => Unknown Old description:
I am playing around with pipes-3.2.0 using ghc-6.7.3. I load this code in ghci:
""" import Control.Proxy
fork :: (Monad m, Proxy p1, Proxy p2, Proxy p3) => () -> Consumer p1 a (Producer p2 a (Producer p3 a m)) r fork () = runIdentityP . hoist (runIdentityP . hoist runIdentityP) $ forever $ do a <- request () -- Request from the 'Consumer' lift $ respond a -- Send to the outer 'Producer' lift $ lift $ respond a -- Send to the inner 'Producer'
test :: (Proxy p) => () -> Producer p Int IO r test () = runIdentityP $ forever $ do respond 1 """
then I type
*Main> :t hoist (hoist lift) $ test
<interactive>:1:1: Warning: Could not deduce (Monad ()) arising from a use of `hoist' from the context (Monad m, MonadTrans t1, Proxy p, MFunctor t) bound by the inferred type of it :: (Monad m, MonadTrans t1, Proxy p, MFunctor t) => t (t1 m) -> Producer p Int IO r at Top level Possible fix: add an instance declaration for (Monad ()) In the expression: hoist (hoist lift) In the expression: hoist (hoist lift) $ test
<interactive>:1:1: Warning: Could not deduce (MFunctor (->)) arising from a use of `hoist' from the context (Monad m, MonadTrans t1, Proxy p, MFunctor t) bound by the inferred type of it :: (Monad m, MonadTrans t1, Proxy p, MFunctor t) => t (t1 m) -> Producer p Int IO r at Top level Possible fix: add an instance declaration for (MFunctor (->)) In the expression: hoist (hoist lift) In the expression: hoist (hoist lift) $ test
<interactive>:1:8: Warning:ghc: panic! (the 'impossible' happened) (GHC version 7.6.3 for x86_64-unknown-linux): kindFunResult <<details unavailable>>
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
New description: I am playing around with pipes-3.2.0 using ghc-6.7.3. I load this code in ghci: {{{ import Control.Proxy fork :: (Monad m, Proxy p1, Proxy p2, Proxy p3) => () -> Consumer p1 a (Producer p2 a (Producer p3 a m)) r fork () = runIdentityP . hoist (runIdentityP . hoist runIdentityP) $ forever $ do a <- request () -- Request from the 'Consumer' lift $ respond a -- Send to the outer 'Producer' lift $ lift $ respond a -- Send to the inner 'Producer' test :: (Proxy p) => () -> Producer p Int IO r test () = runIdentityP $ forever $ do respond 1 }}} then I type {{{ *Main> :t hoist (hoist lift) $ test <interactive>:1:1: Warning: Could not deduce (Monad ()) arising from a use of `hoist' from the context (Monad m, MonadTrans t1, Proxy p, MFunctor t) bound by the inferred type of it :: (Monad m, MonadTrans t1, Proxy p, MFunctor t) => t (t1 m) -> Producer p Int IO r at Top level Possible fix: add an instance declaration for (Monad ()) In the expression: hoist (hoist lift) In the expression: hoist (hoist lift) $ test <interactive>:1:1: Warning: Could not deduce (MFunctor (->)) arising from a use of `hoist' from the context (Monad m, MonadTrans t1, Proxy p, MFunctor t) bound by the inferred type of it :: (Monad m, MonadTrans t1, Proxy p, MFunctor t) => t (t1 m) -> Producer p Int IO r at Top level Possible fix: add an instance declaration for (MFunctor (->)) In the expression: hoist (hoist lift) In the expression: hoist (hoist lift) $ test <interactive>:1:8: Warning:ghc: panic! (the 'impossible' happened) (GHC version 7.6.3 for x86_64-unknown-linux): kindFunResult <<details unavailable>> Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug }}} -- -- Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7887#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler