Core Lint error when compiling servant-machines
Summary
servant-machines-0.15.1
fails to compile with -dcore-lint
Steps to reproduce
$ cabal get servant-machines-0.15.1
$ cat > cabal.project << EOF
packages: .
package servant-machines
ghc-options: -dcore-lint
EOF
$ cabal build
Click to expand
[1 of 1] Compiling Servant.Machines ( src/Servant/Machines.hs, /data/builds/clc-stackage/servant-machines-0.15.1/dist-newstyle/build/x86_64-linux/ghc-9.2.5/servant-machines-0.15.1/build/Servant/Machines.o, /data/builds/clc-stackage/servant-machines-0.15.1/dist-newstyle/build/x86_64-linux/ghc-9.2.5/servant-machines-0.15.1/build/Servant/Machines.dyn_o )
*** Core Lint errors : in result of Desugar (before optimization) ***
src/Servant/Machines.hs:38:5: warning:
The type variable @o_a3mS is out of scope
In the type of a binder: $s$cfromSourceIO_d3r8
In the type ‘SourceIO o_a3mS -> MachineT IO k_a3mT o_a3mS’
Substitution: [TCvSubst
In scope: InScope {}
Type env: []
Co env: []]
*** Offending Program ***
Rec {
$dMonadIO_a3oa :: MonadIO IO
[LclId]
$dMonadIO_a3oa = $fMonadIOIO
$tcMachineToSourceIO :: TyCon
[LclIdX]
$tcMachineToSourceIO
= TyCon
4066493096765222578##
6418676922636249070##
$trModule
(TrNameS "MachineToSourceIO"#)
0#
$krep_a3qa
$krep_a3qa [InlPrag=[~]] :: KindRep
[LclId]
$krep_a3qa = KindRepFun krep$*Arr* $krep_a3qb
$krep_a3qb [InlPrag=[~]] :: KindRep
[LclId]
$krep_a3qb = KindRepTyConApp $tcConstraint ([] @KindRep)
$trModule :: Module
[LclIdX]
$trModule
= Module
(TrNameS "servant-machines-0.15.1-inplace"#)
(TrNameS "Servant.Machines"#)
$fToSourceIOoMachineT [InlPrag=INLINE (sat-args=0)]
:: forall (m :: * -> *) o (k :: * -> *).
MachineToSourceIO m =>
ToSourceIO o (MachineT m k o)
[LclIdX[DFunId(nt)],
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=False,boring_ok=True)
Tmpl= \ (@(m_a313 :: * -> *))
(@o_a314)
(@(k_a315 :: * -> *))
($dMachineToSourceIO_a316 [Occ=Once1]
:: MachineToSourceIO m_a313) ->
($ctoSourceIO_a318
@m_a313 @o_a314 @k_a315 $dMachineToSourceIO_a316)
`cast` (Sym (N:ToSourceIO[0]
<o_a314>_N <MachineT m_a313 k_a315 o_a314>_N)
:: (MachineT m_a313 k_a315 o_a314 -> SourceIO o_a314)
~R# ToSourceIO o_a314 (MachineT m_a313 k_a315 o_a314))}]
$fToSourceIOoMachineT
= \ (@(m_a313 :: * -> *))
(@o_a314)
(@(k_a315 :: * -> *))
($dMachineToSourceIO_a316 :: MachineToSourceIO m_a313) ->
C:ToSourceIO
@o_a314
@(MachineT m_a313 k_a315 o_a314)
($ctoSourceIO_a318
@m_a313 @o_a314 @k_a315 $dMachineToSourceIO_a316)
$ctoSourceIO_a318
:: forall (m :: * -> *) o (k :: * -> *).
MachineToSourceIO m =>
MachineT m k o -> SourceIO o
[LclId]
$ctoSourceIO_a318
= \ (@(m_a313 :: * -> *))
(@o_a314)
(@(k_a315 :: * -> *))
($dMachineToSourceIO_a316 :: MachineToSourceIO m_a313) ->
let {
$dMachineToSourceIO_a31c :: MachineToSourceIO m_a313
[LclId]
$dMachineToSourceIO_a31c = $dMachineToSourceIO_a316 } in
machineToSourceIO @m_a313 $dMachineToSourceIO_a31c @k_a315 @o_a314
$fMachineToSourceIOIO [InlPrag=INLINE (sat-args=0)]
:: MachineToSourceIO IO
[LclIdX[DFunId(nt)],
Unf=Unf{Src=InlineStable, TopLvl=True, Value=False, ConLike=False,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=0,unsat_ok=False,boring_ok=True)
Tmpl= $cmachineToSourceIO_a31i
`cast` (Sym (N:MachineToSourceIO[0] <IO>_N)
:: (forall (k :: * -> *) o. MachineT IO k o -> SourceT IO o)
~R# MachineToSourceIO IO)}]
$fMachineToSourceIOIO
= C:MachineToSourceIO @IO $cmachineToSourceIO_a31i
$cmachineToSourceIO_a31i
:: forall (k :: * -> *) o. MachineT IO k o -> SourceT IO o
[LclId]
$cmachineToSourceIO_a31i
= \ (@(k_a31l :: * -> *))
(@o_a31m)
(ma_a2YN :: MachineT IO k_a31l o_a31m) ->
letrec {
go_a2YO
:: forall {m :: * -> *} {k :: * -> *} {a}.
Monad m =>
MachineT m k a -> StepT m a
[LclId]
go_a2YO
= \ (@(m_a31M :: * -> *))
(@(k_a31w :: * -> *))
(@a_a31N)
($dMonad_a3mf :: Monad m_a31M) ->
let {
$dMonad_a31R :: Monad m_a31M
[LclId]
$dMonad_a31R = $dMonad_a3mf } in
let {
$dMonad_a32a :: Monad m_a31M
[LclId]
$dMonad_a32a = $dMonad_a31R } in
let {
$dMonad_a325 :: Monad m_a31M
[LclId]
$dMonad_a325 = $dMonad_a31R } in
letrec {
go_a31p :: MachineT m_a31M k_a31w a_a31N -> StepT m_a31M a_a31N
[LclId]
go_a31p
= \ (ds_d3qu :: MachineT m_a31M k_a31w a_a31N) ->
let {
m_a2YP
:: m_a31M (Step k_a31w a_a31N (MachineT m_a31M k_a31w a_a31N))
[LclId]
m_a2YP
= ds_d3qu
`cast` (N:MachineT[0] <m_a31M>_N <k_a31w>_N <a_a31N>_N
:: MachineT m_a31M k_a31w a_a31N
~R# m_a31M
(Step
k_a31w a_a31N (MachineT m_a31M k_a31w a_a31N))) } in
$ @LiftedRep
@(m_a31M (StepT m_a31M a_a31N))
@(StepT m_a31M a_a31N)
((\ (@(m_a31E :: * -> *))
(@a_a31F)
(ds_d3qv :: m_a31E (StepT m_a31E a_a31F)) ->
Effect @m_a31E @a_a31F ds_d3qv)
@m_a31M @a_a31N)
(>>=
@m_a31M
$dMonad_a31R
@(Step k_a31w a_a31N (MachineT m_a31M k_a31w a_a31N))
@(StepT m_a31M a_a31N)
m_a2YP
(\ (step_a2YQ
:: Step k_a31w a_a31N (MachineT m_a31M k_a31w a_a31N)) ->
let {
ds_d3qw :: Step k_a31w a_a31N (MachineT m_a31M k_a31w a_a31N)
[LclId]
ds_d3qw = step_a2YQ } in
case ds_d3qw of wild_00 {
Stop ->
return
@m_a31M
$dMonad_a325
@(StepT m_a31M a_a31N)
((\ (@(m_a31E :: * -> *)) (@a_a31F) -> Stop @m_a31E @a_a31F)
@m_a31M @a_a31N);
Yield x_a2YR m'_a2YS ->
return
@m_a31M
$dMonad_a32a
@(StepT m_a31M a_a31N)
((\ (@(m_a31E :: * -> *))
(@a_a31F)
(ds_d3qE :: a_a31F)
(ds_d3qF :: StepT m_a31E a_a31F) ->
Yield @m_a31E @a_a31F ds_d3qE ds_d3qF)
@m_a31M @a_a31N x_a2YR (go_a31p m'_a2YS));
Await @t_a32l ds_d3qH ds_d3qI m'_a2YT ->
let {
$dMonad_a32n :: Monad m_a31M
[LclId]
$dMonad_a32n = $dMonad_a3mf } in
return
@m_a31M
$dMonad_a32n
@(StepT m_a31M a_a31N)
((\ (@(m_a31E :: * -> *))
(@a_a31F)
(ds_d3qG :: StepT m_a31E a_a31F) ->
Skip @m_a31E @a_a31F ds_d3qG)
@m_a31M @a_a31N (go_a31p m'_a2YT))
})); } in
go_a31p; } in
(\ (@(m_a306 :: * -> *))
(@a_a307)
(ds_d3qk
:: forall b. (StepT m_a306 a_a307 -> m_a306 b) -> m_a306 b) ->
SourceT @m_a306 @a_a307 ds_d3qk)
@IO
@o_a31m
(\ (@b_a3mx) ->
let {
$dMonad_a3mM :: Monad IO
[LclId]
$dMonad_a3mM = $fMonadIO } in
rightSection
@LiftedRep
@LiftedRep
@LiftedRep
@'Many
@'Many
@(StepT IO o_a31m -> IO b_a3mx)
@(StepT IO o_a31m)
@(IO b_a3mx)
($ @LiftedRep @(StepT IO o_a31m) @(IO b_a3mx))
(go_a2YO @IO @k_a31l @o_a31m $dMonad_a3mM ma_a2YN))
$fFromSourceIOoMachineT [InlPrag=INLINE (sat-args=0)]
:: forall (m :: * -> *) o (k :: * -> *).
MonadIO m =>
FromSourceIO o (MachineT m k o)
[LclIdX[DFunId(nt)],
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=1,unsat_ok=False,boring_ok=True)
Tmpl= \ (@(m_a3mR :: * -> *))
(@o_a3mS)
(@(k_a3mT :: * -> *))
($dMonadIO_a3mU [Occ=Once1] :: MonadIO m_a3mR) ->
($cfromSourceIO_a3mW @m_a3mR @o_a3mS @k_a3mT $dMonadIO_a3mU)
`cast` (Sym (N:FromSourceIO[0] <o_a3mS>_N) <MachineT
m_a3mR k_a3mT o_a3mS>_N
:: (SourceIO o_a3mS -> MachineT m_a3mR k_a3mT o_a3mS)
~R# FromSourceIO o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))}]
$fFromSourceIOoMachineT
= \ (@(m_a3mR :: * -> *))
(@o_a3mS)
(@(k_a3mT :: * -> *))
($dMonadIO_a3mU :: MonadIO m_a3mR) ->
C:FromSourceIO
@o_a3mS
@(MachineT m_a3mR k_a3mT o_a3mS)
($cfromSourceIO_a3mW @m_a3mR @o_a3mS @k_a3mT $dMonadIO_a3mU)
$cfromSourceIO_a3mW
:: forall (m :: * -> *) o (k :: * -> *).
MonadIO m =>
SourceIO o -> MachineT m k o
[LclId,
RULES: "SPEC $cfromSourceIO"
forall (@(k_a3mT :: * -> *))
(@o_a3mS)
($dMonadIO_a3oa :: MonadIO IO).
$cfromSourceIO_a3mW @IO @o_a3mS @k_a3mT $dMonadIO_a3oa
= $s$cfromSourceIO_d3r8]
$cfromSourceIO_a3mW
= \ (@(m_a3mR :: * -> *))
(@o_a3mS)
(@(k_a3mT :: * -> *))
($dMonadIO_a3mU :: MonadIO m_a3mR) ->
let {
$dMonadIO_a3nQ :: MonadIO m_a3mR
[LclId]
$dMonadIO_a3nQ = $dMonadIO_a3mU } in
let {
$dMonadIO_a3nD :: MonadIO m_a3mR
[LclId]
$dMonadIO_a3nD = $dMonadIO_a3mU } in
let {
$dMonadFail_a3nj :: MonadFail IO
[LclId]
$dMonadFail_a3nj = $fMonadFailIO } in
let {
$dMonad_a3n9 :: Monad IO
[LclId]
$dMonad_a3n9 = $fMonadIO } in
let {
$dMonad_a3nm :: Monad IO
[LclId]
$dMonad_a3nm = $dMonad_a3n9 } in
let {
$dMonad_a3nq :: Monad IO
[LclId]
$dMonad_a3nq = $dMonad_a3n9 } in
\ (src_a2Yo :: SourceIO o_a3mS) ->
letrec {
go_a2Yp
:: StepT IO o_a3mS
-> IO (Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
[LclId]
go_a2Yp
= \ (ds_d3qY :: StepT IO o_a3mS) ->
case ds_d3qY of wild_00 {
Stop ->
return
@IO
$dMonad_a3n9
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
((\ (@(k_a31U :: * -> *)) (@o_a31V) (@r_a31W) ->
Stop @k_a31U @o_a31V @r_a31W)
@k_a3mT @o_a3mS @(MachineT m_a3mR k_a3mT o_a3mS));
Error err_a2Yq ->
fail
@IO
$dMonadFail_a3nj
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
err_a2Yq;
Skip s_a2YG -> go_a2Yp s_a2YG;
Yield x_a2YI s_a2YJ ->
return
@IO
$dMonad_a3nq
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
((\ (@(k_a31U :: * -> *))
(@o_a31V)
(@r_a31W)
(ds_d3r5 :: o_a31V)
(ds_d3r6 :: r_a31W) ->
Yield @k_a31U @o_a31V @r_a31W ds_d3r5 ds_d3r6)
@k_a3mT
@o_a3mS
@(MachineT m_a3mR k_a3mT o_a3mS)
x_a2YI
((\ (@(m_a2Z4 :: * -> *))
(@(k_a2Z5 :: * -> *))
(@o_a2Z6)
(ds_d3r7
:: m_a2Z4 (Step k_a2Z5 o_a2Z6 (MachineT m_a2Z4 k_a2Z5 o_a2Z6))) ->
MachineT @m_a2Z4 @k_a2Z5 @o_a2Z6 ds_d3r7)
@m_a3mR
@k_a3mT
@o_a3mS
(liftIO
@m_a3mR
$dMonadIO_a3nD
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
(go_a2Yp s_a2YJ))));
Effect ms_a2YH ->
>>=
@IO
$dMonad_a3nm
@(StepT IO o_a3mS)
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
ms_a2YH
go_a2Yp
}; } in
$ @LiftedRep
@(m_a3mR (Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS)))
@(MachineT m_a3mR k_a3mT o_a3mS)
((\ (@(m_a2Z4 :: * -> *))
(@(k_a2Z5 :: * -> *))
(@o_a2Z6)
(ds_d3qT
:: m_a2Z4 (Step k_a2Z5 o_a2Z6 (MachineT m_a2Z4 k_a2Z5 o_a2Z6))) ->
MachineT @m_a2Z4 @k_a2Z5 @o_a2Z6 ds_d3qT)
@m_a3mR @k_a3mT @o_a3mS)
($ @LiftedRep
@(IO (Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS)))
@(m_a3mR (Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS)))
(liftIO
@m_a3mR
$dMonadIO_a3nQ
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS)))
(unSourceT
@IO
@o_a3mS
src_a2Yo
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
go_a2Yp))
$s$cfromSourceIO_d3r8 [InlPrag=INLINE (sat-args=1)]
:: SourceIO o_a3mS -> MachineT IO k_a3mT o_a3mS
[LclId]
$s$cfromSourceIO_d3r8
= (\ (@(m_a3mR :: * -> *))
(@o_a3mS)
(@(k_a3mT :: * -> *))
($dMonadIO_a3mU :: MonadIO m_a3mR) ->
let {
$dMonadIO_a3nQ :: MonadIO m_a3mR
[LclId]
$dMonadIO_a3nQ = $dMonadIO_a3mU } in
let {
$dMonadIO_a3nD :: MonadIO m_a3mR
[LclId]
$dMonadIO_a3nD = $dMonadIO_a3mU } in
let {
$dMonadFail_a3nj :: MonadFail IO
[LclId]
$dMonadFail_a3nj = $fMonadFailIO } in
let {
$dMonad_a3n9 :: Monad IO
[LclId]
$dMonad_a3n9 = $fMonadIO } in
let {
$dMonad_a3nm :: Monad IO
[LclId]
$dMonad_a3nm = $dMonad_a3n9 } in
let {
$dMonad_a3nq :: Monad IO
[LclId]
$dMonad_a3nq = $dMonad_a3n9 } in
\ (src_a2Yo :: SourceIO o_a3mS) ->
letrec {
go_a2Yp
:: StepT IO o_a3mS
-> IO (Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
[LclId]
go_a2Yp
= \ (ds_d3qY :: StepT IO o_a3mS) ->
case ds_d3qY of wild_00 {
Stop ->
return
@IO
$dMonad_a3n9
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
((\ (@(k_a31U :: * -> *)) (@o_a31V) (@r_a31W) ->
Stop @k_a31U @o_a31V @r_a31W)
@k_a3mT @o_a3mS @(MachineT m_a3mR k_a3mT o_a3mS));
Error err_a2Yq ->
fail
@IO
$dMonadFail_a3nj
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
err_a2Yq;
Skip s_a2YG -> go_a2Yp s_a2YG;
Yield x_a2YI s_a2YJ ->
return
@IO
$dMonad_a3nq
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
((\ (@(k_a31U :: * -> *))
(@o_a31V)
(@r_a31W)
(ds_d3r5 :: o_a31V)
(ds_d3r6 :: r_a31W) ->
Yield @k_a31U @o_a31V @r_a31W ds_d3r5 ds_d3r6)
@k_a3mT
@o_a3mS
@(MachineT m_a3mR k_a3mT o_a3mS)
x_a2YI
((\ (@(m_a2Z4 :: * -> *))
(@(k_a2Z5 :: * -> *))
(@o_a2Z6)
(ds_d3r7
:: m_a2Z4 (Step k_a2Z5 o_a2Z6 (MachineT m_a2Z4 k_a2Z5 o_a2Z6))) ->
MachineT @m_a2Z4 @k_a2Z5 @o_a2Z6 ds_d3r7)
@m_a3mR
@k_a3mT
@o_a3mS
(liftIO
@m_a3mR
$dMonadIO_a3nD
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
(go_a2Yp s_a2YJ))));
Effect ms_a2YH ->
>>=
@IO
$dMonad_a3nm
@(StepT IO o_a3mS)
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
ms_a2YH
go_a2Yp
}; } in
$ @LiftedRep
@(m_a3mR (Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS)))
@(MachineT m_a3mR k_a3mT o_a3mS)
((\ (@(m_a2Z4 :: * -> *))
(@(k_a2Z5 :: * -> *))
(@o_a2Z6)
(ds_d3qT
:: m_a2Z4 (Step k_a2Z5 o_a2Z6 (MachineT m_a2Z4 k_a2Z5 o_a2Z6))) ->
MachineT @m_a2Z4 @k_a2Z5 @o_a2Z6 ds_d3qT)
@m_a3mR @k_a3mT @o_a3mS)
($ @LiftedRep
@(IO (Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS)))
@(m_a3mR (Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS)))
(liftIO
@m_a3mR
$dMonadIO_a3nQ
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS)))
(unSourceT
@IO
@o_a3mS
src_a2Yo
@(Step k_a3mT o_a3mS (MachineT m_a3mR k_a3mT o_a3mS))
go_a2Yp)))
@IO @o_a3mS @k_a3mT $dMonadIO_a3oa
end Rec }
*** End of Offense ***
Environment
- GHC version used: 9.2.5
Edited by Zubin