
#8382: ghc unhappy with program who want to program in C in haskell...
-------------------------------------+------------------------------------
Reporter: wagle | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture: Unknown/Multiple
Type of failure: None/Unknown | Difficulty: Unknown
Test Case: | Blocked By:
Blocking: | Related Tickets:
-------------------------------------+------------------------------------
Comment (by wagle):
-dcore-lint gives:
tuple:p3 wagle$ ghc -dcore-lint test1.hs
[1 of 1] Compiling Main ( test1.hs, test1.o )
*** Core Lint errors : in result of Desugar (after optimization) ***
<no location info>: Warning:
In the expression: GHC.Show.$fShow[]
@ (Data.Vector.Mutable.MVector GHC.Prim.RealWorld
(GHC.Prim.Any *))
$dShow_aLp
$dShow_aLp
:: GHC.Show.Show
(Data.Vector.Mutable.MVector GHC.Prim.RealWorld a_t1z)
[LclId] is out of scope
<no location info>: Warning:
In the expression: GHC.Show.$fShow[]
@ (Data.Vector.Mutable.MVector GHC.Prim.RealWorld
(GHC.Prim.Any *))
$dShow_aLp
Argument value doesn't match argument type:
Fun type:
GHC.Show.Show
(Data.Vector.Mutable.MVector
GHC.Prim.RealWorld (GHC.Prim.Any *)) =>
GHC.Show.Show
[Data.Vector.Mutable.MVector GHC.Prim.RealWorld (GHC.Prim.Any
*)]
Arg type:
GHC.Show.Show
(Data.Vector.Mutable.MVector GHC.Prim.RealWorld a_t1z)
Arg: $dShow_aLp
*** Offending Program ***
Rec {
Main.updateMatrix
:: forall (m_azy :: * -> *) a_azz.
Control.Monad.Primitive.PrimMonad m_azy =>
Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_azy)
(Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_azy) a_azz)
-> (GHC.Types.Int, GHC.Types.Int) -> a_azz -> m_azy ()
[LclId]
Main.updateMatrix =
\ (@ (m_azC :: * -> *))
(@ a_azD)
($dPrimMonad_azE :: Control.Monad.Primitive.PrimMonad m_azC) ->
let {
$dMonad_ayF :: GHC.Base.Monad m_azC
[LclId]
$dMonad_ayF =
Control.Monad.Primitive.$p1PrimMonad @ m_azC $dPrimMonad_azE } in
\ (m_ays
:: Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_azC)
(Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_azC) a_azD))
(ds_dM4 :: (GHC.Types.Int, GHC.Types.Int))
(x_ayv :: a_azD) ->
case ds_dM4 of _ { (i_ayt, j_ayu) ->
GHC.Base.>>=
@ m_azC
$dMonad_ayF
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_azC) a_azD)
@ ()
(Data.Vector.Mutable.read
@ m_azC
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_azC) a_azD)
$dPrimMonad_azE
m_ays
i_ayt)
(\ (v_ayw
:: Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_azC) a_azD) ->
Data.Vector.Mutable.write
@ m_azC @ a_azD $dPrimMonad_azE v_ayw j_ayu x_ayv)
}
Main.createMatrix
:: forall (m_aEn :: * -> *) a_aEo.
(GHC.Num.Num a_aEo, Control.Monad.Primitive.PrimMonad m_aEn) =>
(GHC.Types.Int, GHC.Types.Int)
-> m_aEn (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEn)
(Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEn) a_aEo))
[LclId]
Main.createMatrix =
\ (@ (m_aEs :: * -> *))
(@ a_aEt)
($dNum_aEu :: GHC.Num.Num a_aEt)
($dPrimMonad_aEv :: Control.Monad.Primitive.PrimMonad m_aEs) ->
let {
$dMonad_azP :: GHC.Base.Monad m_aEs
[LclId]
$dMonad_azP =
Control.Monad.Primitive.$p1PrimMonad @ m_aEs $dPrimMonad_aEv } in
\ (ds_dMj :: (GHC.Types.Int, GHC.Types.Int)) ->
case ds_dMj of _ { (vsize_ay5, ksize_ay6) ->
GHC.Base.>>=
@ m_aEs
$dMonad_azP
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs)
(Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs) a_aEt))
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs)
(Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs) a_aEt))
(Data.Vector.Mutable.new
@ m_aEs
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs) a_aEt)
$dPrimMonad_aEv
vsize_ay5)
(\ (m_ay7
:: Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs)
(Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs) a_aEt)) ->
GHC.Base.>>
@ m_aEs
$dMonad_azP
@ ()
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs)
(Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs) a_aEt))
(GHC.Base.$
@ (GHC.Types.Int -> m_aEs ())
@ (m_aEs ())
(Control.Monad.forM_
@ GHC.Types.Int
@ m_aEs
@ ()
$dMonad_azP
(GHC.Enum.enumFromTo
@ GHC.Types.Int
GHC.Enum.$fEnumInt
(GHC.Types.I# 0)
(GHC.Num.-
@ GHC.Types.Int GHC.Num.$fNumInt vsize_ay5
(GHC.Types.I# 1))))
(\ (i_ayq :: GHC.Types.Int) ->
GHC.Base.>>=
@ m_aEs
$dMonad_azP
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs) a_aEt)
@ ()
(Data.Vector.Mutable.new @ m_aEs @ a_aEt
$dPrimMonad_aEv ksize_ay6)
(\ (v_ayr
:: Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs)
a_aEt) ->
GHC.Base.>>
@ m_aEs
$dMonad_azP
@ ()
@ ()
(Data.Vector.Mutable.set
@ m_aEs
@ a_aEt
$dPrimMonad_aEv
v_ayr
(GHC.Num.fromInteger @ a_aEt $dNum_aEu
(__integer 0)))
(Data.Vector.Mutable.write
@ m_aEs
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState
m_aEs) a_aEt)
$dPrimMonad_aEv
m_ay7
i_ayq
v_ayr))))
(GHC.Base.return
@ m_aEs
$dMonad_azP
@ (Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs)
(Data.Vector.Mutable.MVector
(Control.Monad.Primitive.PrimState m_aEs) a_aEt))
m_ay7))
}
$dShow_aJR
:: GHC.Show.Show
[Data.Vector.Mutable.MVector GHC.Prim.RealWorld (GHC.Prim.Any *)]
[LclId]
$dShow_aJR =
GHC.Show.$fShow[]
@ (Data.Vector.Mutable.MVector GHC.Prim.RealWorld (GHC.Prim.Any *))
$dShow_aLp
cobox_aFM
:: Data.Vector.Vector
(Data.Vector.Mutable.MVector GHC.Prim.RealWorld (GHC.Prim.Any *))
~ Data.Vector.Generic.Base.Mutable
(GHC.Prim.Any (* -> *))
(Control.Monad.Primitive.PrimState GHC.Types.IO)
(Data.Vector.Mutable.MVector GHC.Prim.RealWorld (GHC.Prim.Any *))
[LclId]
cobox_aFM =
case cobox_aKH of _ { GHC.Types.Eq# cobox_dMX ->
GHC.Types.Eq#
@ *
@ (Data.Vector.Vector
(Data.Vector.Mutable.MVector GHC.Prim.RealWorld (GHC.Prim.Any
*)))
@ (Data.Vector.Generic.Base.Mutable
v_t1O
(Control.Monad.Primitive.PrimState GHC.Types.IO)
(Data.Vector.Mutable.MVector GHC.Prim.RealWorld (GHC.Prim.Any
*)))
@~ (cobox_dMX