/Foo.dump-stg-final.hs Secret
Created
September 2, 2023 12:06
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
==================== Final STG: ==================== | |
2023-09-02 11:45:02.694574244 UTC | |
Foo.foo2 :: GHC.Prim.Addr# | |
[GblId, Unf=OtherCon []] = | |
"f: non-positive value"#; | |
Foo.foo1 :: [GHC.Types.Char] | |
[GblId] = | |
{} \u [] GHC.CString.unpackCString# Foo.foo2; | |
Foo.foo | |
:: forall (m :: * -> *). | |
Control.Monad.Error.Class.MonadError GHC.Base.String m => | |
GHC.Types.Int -> m GHC.Types.Int | |
[GblId, | |
Arity=2, | |
Str=<SP(1P(LP(A,L,A,A,A,A),1C(1,C(1,L)),A,A),MC(1,L),A)><ML>, | |
Unf=OtherCon []] = | |
{} \r [$dMonadError_s11X eta_s11Y] | |
case Control.Monad.Error.Class.$p1MonadError $dMonadError_s11X of { | |
GHC.Base.C:Monad ww_s120 | |
ww1_s121 [Occ=Once1!] | |
_ [Occ=Dead] | |
_ [Occ=Dead] -> | |
let { | |
sat_s12d [Occ=Once1] :: GHC.Types.Int -> m_aQ2 GHC.Types.Int | |
[LclId] = | |
{ww_s120} \r [y_s12a] | |
case y_s12a of vx_s12b [Occ=Once1] { | |
GHC.Types.I# _ [Occ=Dead] -> GHC.Base.pure ww_s120 vx_s12b; | |
}; } in | |
let { | |
sat_s129 [Occ=Once1] :: m_aQ2 GHC.Types.Int | |
[LclId] = | |
{ww_s120, $dMonadError_s11X, eta_s11Y} \u [] | |
case eta_s11Y of { | |
GHC.Types.I# x_s125 -> | |
case ># [x_s125 0#] of { | |
__DEFAULT -> | |
Control.Monad.Error.Class.throwError $dMonadError_s11X Foo.foo1; | |
1# -> | |
case -# [x_s125 1#] of sat_s127 [Occ=Once1] { | |
__DEFAULT -> | |
let { | |
sat_s128 [Occ=Once1] :: GHC.Types.Int | |
[LclId] = | |
GHC.Types.I#! [sat_s127]; | |
} in GHC.Base.pure ww_s120 sat_s128; | |
}; | |
}; | |
}; | |
} in ww1_s121 sat_s129 sat_s12d; | |
}; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Foo where | |
import Control.Monad.Except | |
foo :: (MonadError String m) => Int -> m Int | |
foo !x = do | |
y <- | |
if x > 0 | |
then pure (x - 1) | |
else throwError "f: non-positive value" | |
pure $! y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment