Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
a_s2EZ :: State# RealWorld -> (# State# RealWorld, () #)
a_s2EZ =
\ (s_X2nI :: State# RealWorld) ->
let {
a_s2FI
:: forall r_a13N.
([Int], Int)
-> Int
-> forall r_aog.
Int
-> State# RealWorld
-> (# State# RealWorld,
((([Int] -> Int -> r_a13N) -> r_a13N) -> Int -> r_aog) -> r_aog #)
a_s2FI =
\ (@ r_a13N)
(x_aKM :: ([Int], Int))
(s'_aKN :: Int)
(@ r_aog)
(eta_B2 :: Int)
(eta_B1 :: State# RealWorld) ->
let {
x_XPa :: [Int]
x_XPa = case x_aKM of _ { (x_a293, ds1_a294) -> x_a293 } } in
let {
x_aKF :: ([Int] -> Int -> r_a13N) -> r_a13N
x_aKF =
\ (f_aKH :: [Int] -> Int -> r_a13N) -> f_aKH x_XPa s'_aKN } in
(# eta_B1,
\ (f_aKH
:: (([Int] -> Int -> r_a13N) -> r_a13N) -> Int -> r_aog) ->
f_aKH x_aKF eta_B2 #) } in
let {
lvl_X2lE
:: forall r_a13N.
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int -> StateT Int IO ((([Int], Int) -> Int -> r_a13N) -> r_a13N)
lvl_X2lE =
\ (@ r_X16o)
(x_XNo :: ([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
(s'_XNq :: Int) ->
let {
x_XQt :: ([Int], Int)
x_XQt = x_XNo ((,) @ [Int] @ Int) } in
let {
x_aKF :: (([Int], Int) -> Int -> r_X16o) -> r_X16o
x_aKF =
\ (f_aKH :: ([Int], Int) -> Int -> r_X16o) ->
f_aKH x_XQt s'_XNq } in
(\ (@ r_X16t) (s_XMD :: Int) (s_a2jT :: State# RealWorld) ->
(# s_a2jT,
\ (f_aKH
:: ((([Int], Int) -> Int -> r_X16o) -> r_X16o) -> Int -> r_X16t) ->
f_aKH x_aKF s_XMD #))
`cast` ((forall r_X16t.
<Int>_R
-> Sym
(NTCo:IO[0]
<(((([Int], Int) -> Int -> r_X16o) -> r_X16o) -> Int -> r_X16t)
-> r_X16t>_R))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N <IO>_R <(([Int], Int) -> Int -> r_X16o) -> r_X16o>_N)
:: (forall r_X16t.
Int
-> State# RealWorld
-> (# State# RealWorld,
(((([Int], Int) -> Int -> r_X16o) -> r_X16o) -> Int -> r_X16t)
-> r_X16t #))
~R# StateT Int IO ((([Int], Int) -> Int -> r_X16o) -> r_X16o)) } in
letrec {
a_s2Fy
:: [StateT Int (StateT Int (StateT Int IO)) Int]
-> forall r_XqS.
Int
-> StateT Int (StateT Int IO) (([Int] -> Int -> r_XqS) -> r_XqS)
a_s2Fy =
\ (ds_X2kt :: [StateT Int (StateT Int (StateT Int IO)) Int])
(@ r_XqS)
(eta_X2E :: Int) ->
case ds_X2kt of _ {
[] ->
(\ (@ r_Xoh)
(eta_B3 :: Int)
(@ r_Xoi)
(eta_B2 :: Int)
(eta_X6 :: State# RealWorld) ->
let {
x_XPd :: ([Int] -> Int -> r_XqS) -> r_XqS
x_XPd =
\ (f_aKH :: [Int] -> Int -> r_XqS) -> f_aKH ([] @ Int) eta_X2E } in
let {
x_aKF
:: ((([Int] -> Int -> r_XqS) -> r_XqS) -> Int -> r_Xoh) -> r_Xoh
x_aKF =
\ (f_aKH :: (([Int] -> Int -> r_XqS) -> r_XqS) -> Int -> r_Xoh) ->
f_aKH x_XPd eta_B3 } in
(# eta_X6,
\ (f_aKH
:: (((([Int] -> Int -> r_XqS) -> r_XqS) -> Int -> r_Xoh) -> r_Xoh)
-> Int -> r_Xoi) ->
f_aKH x_aKF eta_B2 #))
`cast` ((forall r_Xoh.
<Int>_R
-> (forall r_Xoi.
<Int>_R
-> Sym
(NTCo:IO[0]
<((((([Int] -> Int -> r_XqS) -> r_XqS) -> Int -> r_Xoh) -> r_Xoh)
-> Int -> r_Xoi)
-> r_Xoi>_R))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<((([Int] -> Int -> r_XqS) -> r_XqS) -> Int -> r_Xoh) -> r_Xoh>_N))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N <StateT Int IO>_R <([Int] -> Int -> r_XqS) -> r_XqS>_N)
:: (forall r_Xoh.
Int
-> forall r_Xoi.
Int
-> State# RealWorld
-> (# State# RealWorld,
((((([Int] -> Int -> r_XqS) -> r_XqS) -> Int -> r_Xoh) -> r_Xoh)
-> Int -> r_Xoi)
-> r_Xoi #))
~R# StateT Int (StateT Int IO) (([Int] -> Int -> r_XqS) -> r_XqS));
: y_a2iJ ys_a2iK ->
a_s2kq
@ Int
@ (StateT Int (StateT Int IO))
$dMonad_a16m
@ [Int]
@ [Int]
((\ (@ r_XqZ) (eta_X2L :: Int) ->
let {
a_s2Fw
:: forall r_a13N.
Int
-> Int
-> forall r_Xr5.
Int
-> forall r_Xoh.
Int
-> State# RealWorld
-> (# State# RealWorld,
(((((([Int] -> [Int]) -> Int -> r_a13N) -> r_a13N)
-> Int -> r_Xr5)
-> r_Xr5)
-> Int -> r_Xoh)
-> r_Xoh #)
a_s2Fw =
\ (@ r_X16B)
(x_XNB :: Int)
(s'_XND :: Int)
(@ r_Xr5)
(eta_B3 :: Int)
(@ r_Xoh)
(eta_B2 :: Int)
(eta_X2U :: State# RealWorld) ->
let {
x_XPr :: [Int] -> [Int]
x_XPr = : @ Int x_XNB } in
let {
x_XPu :: (([Int] -> [Int]) -> Int -> r_X16B) -> r_X16B
x_XPu =
\ (f_aKH :: ([Int] -> [Int]) -> Int -> r_X16B) ->
f_aKH x_XPr s'_XND } in
let {
x_aKF
:: (((([Int] -> [Int]) -> Int -> r_X16B) -> r_X16B)
-> Int -> r_Xr5)
-> r_Xr5
x_aKF =
\ (f_aKH
:: ((([Int] -> [Int]) -> Int -> r_X16B) -> r_X16B)
-> Int -> r_Xr5) ->
f_aKH x_XPu eta_B3 } in
(# eta_X2U,
\ (f_aKH
:: ((((([Int] -> [Int]) -> Int -> r_X16B) -> r_X16B)
-> Int -> r_Xr5)
-> r_Xr5)
-> Int -> r_Xoh) ->
f_aKH x_aKF eta_B2 #) } in
let {
ds_X2cy
:: StateT
Int
(StateT Int IO)
((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
ds_X2cy =
(y_a2iJ
`cast` (Cont8.NTCo:StateT[0]
<Int>_N <StateT Int (StateT Int IO)>_R <Int>_N
:: StateT Int (StateT Int (StateT Int IO)) Int
~R# (forall r_aog.
Int
-> StateT
Int
(StateT Int IO)
((Int -> Int -> r_aog) -> r_aog))))
@ (StateT
Int (StateT Int IO) ((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
eta_X2L } in
(\ (@ r_Xr6) (eta_X2S :: Int) ->
let {
lvl_X2m0
:: forall r_X16J.
((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ) -> Int -> r_X16J)
-> r_X16J)
lvl_X2m0 =
\ (@ r_X16K)
(x_XNK
:: (Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
(s'_XNM :: Int) ->
((x_XNK
((a_s2Fw @ r_XqZ)
`cast` (<Int>_R
-> <Int>_R
-> (forall r_Xr5.
<Int>_R
-> (forall r_Xoh.
<Int>_R
-> Sym
(NTCo:IO[0]
<(((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr5)
-> r_Xr5)
-> Int -> r_Xoh)
-> r_Xoh>_R))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr5)
-> r_Xr5>_N))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<StateT Int IO>_R
<(([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ>_N)
:: (Int
-> Int
-> forall r_Xr5.
Int
-> forall r_Xoh.
Int
-> State# RealWorld
-> (# State# RealWorld,
(((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr5)
-> r_Xr5)
-> Int -> r_Xoh)
-> r_Xoh #))
~R# (Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)))))
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<StateT Int IO>_R
<(([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ>_N
:: StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
~R# (forall r_aog.
Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_aog)
-> r_aog))))
@ r_X16K s'_XNM } in
let {
ds_X2aA
:: StateT
Int
IO
((((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
ds_X2aA =
(ds_X2cy
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<StateT Int IO>_R
<(Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)>_N
:: StateT
Int
(StateT Int IO)
((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
~R# (forall r_aog.
Int
-> StateT
Int
IO
((((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> Int -> r_aog)
-> r_aog))))
@ (StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ) -> Int -> r_Xr6)
-> r_Xr6))
eta_X2S } in
(\ (@ r_Xre) (eta_B2 :: Int) (eta_X31 :: State# RealWorld) ->
case (((ds_X2aA
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)>_N
:: StateT
Int
IO
((((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
~R# (forall r_aog.
Int
-> IO
((((((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int])
-> Int -> r_XqZ)
-> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int])
-> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> Int -> r_aog)
-> r_aog))))
@ (IO
((((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre))
eta_B2)
`cast` (NTCo:IO[0]
<(((((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> Int
-> IO
((((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre))
-> IO
((((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre)>_R
:: IO
((((((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> Int
-> IO
((((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre))
-> IO
((((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre))
~R# (State# RealWorld
-> (# State# RealWorld,
(((((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> Int
-> IO
((((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre))
-> IO
((((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre) #))))
eta_X31
of _ { (# ipv_a2k1, ipv1_a2k2 #) ->
((ipv1_a2k2
(\ (x_XNV
:: (((Int
-> Int
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ))
-> Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6))
(s'_XNX :: Int) ->
((x_XNV (lvl_X2m0 @ r_Xr6))
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6>_N
:: StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
~R# (forall r_aog.
Int
-> IO
((((((([Int] -> [Int]) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_aog)
-> r_aog))))
@ r_Xre s'_XNX))
`cast` (NTCo:IO[0]
<(((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre>_R
:: IO
((((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre)
~R# (State# RealWorld
-> (# State# RealWorld,
(((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xre)
-> r_Xre #))))
ipv_a2k1
})
`cast` ((forall r_Xrd.
<Int>_R
-> Sym
(NTCo:IO[0]
<(((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xrd)
-> r_Xrd>_R))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6>_N)
:: (forall r_Xrd.
Int
-> State# RealWorld
-> (# State# RealWorld,
(((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)
-> Int -> r_Xrd)
-> r_Xrd #))
~R# StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_Xr6)
-> r_Xr6)))
`cast` (Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<StateT Int IO>_R
<(([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ>_N)
:: (forall r_aog.
Int
-> StateT
Int
IO
((((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)
-> Int -> r_aog)
-> r_aog))
~R# StateT
Int
(StateT Int IO)
((([Int] -> [Int]) -> Int -> r_XqZ) -> r_XqZ)))
`cast` (Sym
(Cont8.NTCo:StateT[0]
<Int>_N <StateT Int (StateT Int IO)>_R <[Int] -> [Int]>_N)
:: (forall r_aog.
Int
-> StateT
Int (StateT Int IO) ((([Int] -> [Int]) -> Int -> r_aog) -> r_aog))
~R# StateT Int (StateT Int (StateT Int IO)) ([Int] -> [Int])))
((a_s2Fy ys_a2iK)
`cast` (Sym
(Cont8.NTCo:StateT[0]
<Int>_N <StateT Int (StateT Int IO)>_R <[Int]>_N)
:: (forall r_aog.
Int
-> StateT Int (StateT Int IO) (([Int] -> Int -> r_aog) -> r_aog))
~R# StateT Int (StateT Int (StateT Int IO)) [Int]))
@ r_XqS
eta_X2E
}; } in
case ((((((a_s2Fy
(build
@ (StateT Int (StateT Int (StateT Int IO)) Int)
(\ (@ b_a284)
(c_a285
:: StateT Int (StateT Int (StateT Int IO)) Int -> b_a284 -> b_a284)
(nil_a286 :: b_a284) ->
repeatFB
@ (StateT Int (StateT Int (StateT Int IO)) Int)
@ (Int -> b_a284)
(takeFB
@ (StateT Int (StateT Int (StateT Int IO)) Int)
@ b_a284
c_a285
nil_a286)
((\ (@ r_Xsv)
(eta_X4h :: Int)
(@ r_XqZ)
(eta_B3 :: Int)
(@ r_Xoh)
(eta_B2 :: Int)
(eta_X2O :: State# RealWorld) ->
case eta_X4h of _ { I# x_a29G ->
let {
ipv_s2hD :: Int#
ipv_s2hD = +# x_a29G 1# } in
let {
s_Xxv :: Int
s_Xxv = I# ipv_s2hD } in
((((\ (@ r_Xrb) (eta_X2X :: Int) (eta_X5T :: State# RealWorld) ->
let {
x_XPn :: (Int -> Int -> r_Xsv) -> r_Xsv
x_XPn =
\ (f_axp :: Int -> Int -> r_Xsv) -> f_axp s_Xxv s_Xxv } in
let {
x_aKF
:: (((Int -> Int -> r_Xsv) -> r_Xsv) -> Int -> r_XqZ)
-> r_XqZ
x_aKF =
\ (f_aKH
:: ((Int -> Int -> r_Xsv) -> r_Xsv) -> Int -> r_XqZ) ->
f_aKH x_XPn eta_B3 } in
(# eta_X5T,
\ (f_aKH
:: ((((Int -> Int -> r_Xsv) -> r_Xsv) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xrb) ->
f_aKH x_aKF eta_X2X #))
`cast` (Nth:1
((forall r_Xr8.
<Int>_R
-> (forall r_Xrb.
<Int>_R
-> Sym
(NTCo:IO[0]
<(((((Int -> Int -> r_Xsv) -> r_Xsv)
-> Int -> r_Xr8)
-> r_Xr8)
-> Int -> r_Xrb)
-> r_Xrb>_R))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((Int -> Int -> r_Xsv) -> r_Xsv)
-> Int -> r_Xr8)
-> r_Xr8>_N))@r_XqZ)
; Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((Int -> Int -> r_Xsv) -> r_Xsv) -> Int -> r_XqZ)
-> r_XqZ>_N
:: (forall r_Xrb.
Int
-> State# RealWorld
-> (# State# RealWorld,
(((((Int -> Int -> r_Xsv) -> r_Xsv)
-> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xrb)
-> r_Xrb #))
~R# (forall r_aog.
Int
-> IO
((((((Int -> Int -> r_Xsv) -> r_Xsv)
-> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_aog)
-> r_aog))))
@ r_Xoh eta_B2)
`cast` (NTCo:IO[0]
<(((((Int -> Int -> r_Xsv) -> r_Xsv) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xoh)
-> r_Xoh>_R
:: IO
((((((Int -> Int -> r_Xsv) -> r_Xsv) -> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xoh)
-> r_Xoh)
~R# (State# RealWorld
-> (# State# RealWorld,
(((((Int -> Int -> r_Xsv) -> r_Xsv)
-> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xoh)
-> r_Xoh #))))
eta_X2O
})
`cast` ((forall r_Xsv.
<Int>_R
-> (forall r_XqZ.
<Int>_R
-> (forall r_Xoh.
<Int>_R
-> Sym
(NTCo:IO[0]
<(((((Int -> Int -> r_Xsv) -> r_Xsv)
-> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xoh)
-> r_Xoh>_R))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((Int -> Int -> r_Xsv) -> r_Xsv) -> Int -> r_XqZ)
-> r_XqZ>_N))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<StateT Int IO>_R
<(Int -> Int -> r_Xsv) -> r_Xsv>_N))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N <StateT Int (StateT Int IO)>_R <Int>_N)
:: (forall r_Xsv.
Int
-> forall r_XqZ.
Int
-> forall r_Xoh.
Int
-> State# RealWorld
-> (# State# RealWorld,
(((((Int -> Int -> r_Xsv) -> r_Xsv)
-> Int -> r_XqZ)
-> r_XqZ)
-> Int -> r_Xoh)
-> r_Xoh #))
~R# StateT Int (StateT Int (StateT Int IO)) Int))
(I# 1000#)))
@ ([Int], Int)
(I# 0#))
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<StateT Int IO>_R
<([Int] -> Int -> ([Int], Int)) -> ([Int], Int)>_N
:: StateT
Int
(StateT Int IO)
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
~R# (forall r_aog.
Int
-> StateT
Int
IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int -> r_aog)
-> r_aog))))
@ (StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
(I# 0#))
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))>_N
:: StateT
Int
IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
~R# (forall r_aog.
Int
-> IO
(((((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> Int -> r_aog)
-> r_aog))))
@ (IO
((((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))))
(I# 0#))
`cast` (NTCo:IO[0]
<((((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> Int
-> IO
((((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))))
-> IO
((((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))>_R
:: IO
(((((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> Int
-> IO
((((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))))
-> IO
((((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))))
~R# (State# RealWorld
-> (# State# RealWorld,
((((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> Int
-> IO
((((([Int], Int)
-> Int
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int))))))
-> IO
((((([Int], Int)
-> Int
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int))))) #))))
s_X2nI
of _ { (# ipv_a2k1, ipv1_a2k2 #) ->
case ((ipv1_a2k2
(\ (x_XNF
:: ((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
(s'_XNH :: Int) ->
((x_XNF
(lvl_X2lE
@ (StateT
Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))>_N
:: StateT
Int
IO
((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
~R# (forall r_aog.
Int
-> IO
((((([Int], Int)
-> Int
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int -> r_aog)
-> r_aog))))
@ (IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
s'_XNH))
`cast` (NTCo:IO[0]
<(((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))>_R
:: IO
((((([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))
~R# (State# RealWorld
-> (# State# RealWorld,
(((([Int], Int)
-> Int
-> StateT
Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))))
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO
(([Int] -> Int -> ([Int], Int))
-> ([Int], Int)))) #))))
ipv_a2k1
of _ { (# ipv_X2mV, ipv1_X2mX #) ->
case ((ipv1_X2mX
(\ (x_XNJ
:: (([Int], Int)
-> Int
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
(s'_XNL :: Int) ->
((x_XNJ
((a_s2FI @ ([Int], Int))
`cast` (<([Int], Int)>_R
-> <Int>_R
-> (forall r_aog.
<Int>_R
-> Sym
(NTCo:IO[0]
<((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int -> r_aog)
-> r_aog>_R))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<([Int] -> Int -> ([Int], Int)) -> ([Int], Int)>_N)
:: (([Int], Int)
-> Int
-> forall r_aog.
Int
-> State# RealWorld
-> (# State# RealWorld,
((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int -> r_aog)
-> r_aog #))
~R# (([Int], Int)
-> Int
-> StateT
Int
IO
(([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))))
`cast` (Cont8.NTCo:StateT[0]
<Int>_N <IO>_R <([Int] -> Int -> ([Int], Int)) -> ([Int], Int)>_N
:: StateT Int IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
~R# (forall r_aog.
Int
-> IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int -> r_aog)
-> r_aog))))
@ (IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
s'_XNL))
`cast` (NTCo:IO[0]
<((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))>_R
:: IO
(((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
~R# (State# RealWorld
-> (# State# RealWorld,
((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))
-> IO
((([Int], Int)
-> Int
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))) #))))
ipv_X2mV
of _ { (# ipv_X2m2, ipv1_X2m4 #) ->
case ((ipv1_X2m4
((\ (x_XNJ :: ([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
(s'_XNL :: Int)
(eta_X2U :: State# RealWorld) ->
let {
x_aKF :: ([Int], Int)
x_aKF = x_XNJ ((,) @ [Int] @ Int) } in
(# eta_X2U,
\ (f_aKH
:: ([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))) ->
f_aKH x_aKF s'_XNL #))
`cast` (<([Int] -> Int -> ([Int], Int)) -> ([Int], Int)>_R
-> <Int>_R
-> Sym
(NTCo:IO[0]
<(([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))>_R)
:: ((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> State# RealWorld
-> (# State# RealWorld,
(([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)) #))
~R# ((([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
-> Int
-> IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))))))
`cast` (NTCo:IO[0]
<(([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))>_R
:: IO
((([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
~R# (State# RealWorld
-> (# State# RealWorld,
(([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)))
-> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int)) #))))
ipv_X2m2
of _ { (# ipv_X2m6, ipv1_X2m8 #) ->
case ((ipv1_X2m8
((\ (x_aKM :: ([Int], Int))
(s'_aKN :: Int)
(eta_B1 :: State# RealWorld) ->
let {
x_aKF :: [Int]
x_aKF = case x_aKM of _ { (x_a293, ds1_a294) -> x_a293 } } in
(# eta_B1,
\ (f_aKH :: [Int] -> Int -> ([Int], Int)) -> f_aKH x_aKF s'_aKN #))
`cast` (<([Int], Int)>_R
-> <Int>_R
-> Sym
(NTCo:IO[0] <([Int] -> Int -> ([Int], Int)) -> ([Int], Int)>_R)
:: (([Int], Int)
-> Int
-> State# RealWorld
-> (# State# RealWorld,
([Int] -> Int -> ([Int], Int)) -> ([Int], Int) #))
~R# (([Int], Int)
-> Int -> IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))))))
`cast` (NTCo:IO[0]
<([Int] -> Int -> ([Int], Int)) -> ([Int], Int)>_R
:: IO (([Int] -> Int -> ([Int], Int)) -> ([Int], Int))
~R# (State# RealWorld
-> (# State# RealWorld,
([Int] -> Int -> ([Int], Int)) -> ([Int], Int) #))))
ipv_X2m6
of _ { (# ipv_X2ma, ipv1_X2mc #) ->
hPutStr2
stdout
(case ipv1_X2mc ((,) @ [Int] @ Int) of _ { (x_a293, ds1_a294) ->
showList__ @ Int shows7 x_a293 ([] @ Char)
})
True
ipv_X2ma
}
}
}
}
}
main :: IO ()
main =
a_s2EZ
`cast` (Sym (NTCo:IO[0] <()>_R)
:: (State# RealWorld -> (# State# RealWorld, () #)) ~R# IO ())
==================== Simplifier ====================
Max iterations = 4
SimplMode {Phase = 2 [main],
inline,
rules,
eta-expand,
case-of-case}
Result size of Simplifier
= {terms: 812, types: 5,388, coercions: 2,766}
...
a_s2Fb
:: forall s_X15T a_X188 b_X15V.
StateT s_X15T (StateT Int (StateT Int IO)) a_X188
-> (a_X188 -> StateT s_X15T (StateT Int (StateT Int IO)) b_X15V)
-> forall r_aog.
s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog)
a_s2Fb =
\ (@ s_X15T)
(@ a_X188)
(@ b_X15V)
(ds_X29X :: StateT s_X15T (StateT Int (StateT Int IO)) a_X188)
(g_XN1
:: a_X188 -> StateT s_X15T (StateT Int (StateT Int IO)) b_X15V)
(@ r_aog)
(eta_B1 :: s_X15T) ->
let {
lvl_s2j5
:: forall r_a13N.
a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_a13N) -> r_a13N)
lvl_s2j5 =
\ (@ r_a13N) (x_aKM :: a_X188) (s'_aKN :: s_X15T) ->
((g_XN1 x_aKM)
`cast` (Cont8.NTCo:StateT[0]
<s_X15T>_N <StateT Int (StateT Int IO)>_R <b_X15V>_N
:: StateT s_X15T (StateT Int (StateT Int IO)) b_X15V
~R# (forall r_aog.
s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))))
@ r_a13N s'_aKN } in
let {
ds_X2ca
:: StateT
Int
(StateT Int IO)
((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
ds_X2ca =
(ds_X29X
`cast` (Cont8.NTCo:StateT[0]
<s_X15T>_N <StateT Int (StateT Int IO)>_R <a_X188>_N
:: StateT s_X15T (StateT Int (StateT Int IO)) a_X188
~R# (forall r_aog.
s_X15T
-> StateT
Int (StateT Int IO) ((a_X188 -> s_X15T -> r_aog) -> r_aog))))
@ (StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
eta_B1 } in
(\ (@ r_XqI) (eta_X2u :: Int) ->
let {
lvl_s2j8
:: forall r_a13N.
((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_a13N)
-> r_a13N)
lvl_s2j8 =
\ (@ r_a13N)
(x_aKM
:: (a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
(s'_aKN :: Int) ->
((x_aKM (lvl_s2j5 @ r_aog))
`cast` (Cont8.NTCo:StateT[0]
<Int>_N <StateT Int IO>_R <(b_X15V -> s_X15T -> r_aog) -> r_aog>_N
:: StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog)
~R# (forall r_Xoh.
Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_Xoh)
-> r_Xoh))))
@ r_a13N s'_aKN } in
let {
ds_X2ac
:: StateT
Int
IO
((((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
ds_X2ac =
(ds_X2ca
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<StateT Int IO>_R
<(a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog)>_N
:: StateT
Int
(StateT Int IO)
((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
~R# (forall r_Xoh.
Int
-> StateT
Int
IO
((((a_X188
-> s_X15T
-> StateT
Int
(StateT Int IO)
((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int -> r_Xoh)
-> r_Xoh))))
@ (StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
eta_X2u } in
(\ (@ r_XqQ) (eta_B2 :: Int) (eta_X2D :: State# RealWorld) ->
case (((ds_X2ac
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)>_N
:: StateT
Int
IO
((((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
~R# (forall r_Xoh.
Int
-> IO
((((((a_X188
-> s_X15T
-> StateT
Int
(StateT Int IO)
((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int
(StateT Int IO)
((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog)
-> Int -> r_XqI)
-> r_XqI))
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog)
-> Int -> r_XqI)
-> r_XqI))
-> Int -> r_Xoh)
-> r_Xoh))))
@ (IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ))
eta_B2)
`cast` (NTCo:IO[0]
<(((((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
-> Int
-> IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ))
-> IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ)>_R
:: IO
((((((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
-> Int
-> IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ))
-> IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ))
~R# (State# RealWorld
-> (# State# RealWorld,
(((((a_X188
-> s_X15T
-> StateT
Int
(StateT Int IO)
((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int
(StateT Int IO)
((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog)
-> Int -> r_XqI)
-> r_XqI))
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog)
-> Int -> r_XqI)
-> r_XqI))
-> Int
-> IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog)
-> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ))
-> IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog)
-> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ) #))))
eta_X2D
of _ { (# ipv_a2k1, ipv1_a2k2 #) ->
((ipv1_a2k2
(\ (x_aKM
:: (((a_X188
-> s_X15T
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
-> Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI))
(s'_aKN :: Int) ->
((x_aKM (lvl_s2j8 @ r_XqI))
`cast` (Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI>_N
:: StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI) -> r_XqI)
~R# (forall r_Xoh.
Int
-> IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_Xoh)
-> r_Xoh))))
@ r_XqQ s'_aKN))
`cast` (NTCo:IO[0]
<(((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ>_R
:: IO
((((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ)
~R# (State# RealWorld
-> (# State# RealWorld,
(((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqQ)
-> r_XqQ #))))
ipv_a2k1
})
`cast` ((forall r_XqP.
<Int>_R
-> Sym
(NTCo:IO[0]
<(((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqP)
-> r_XqP>_R))
; Sym
(Cont8.NTCo:StateT[0]
<Int>_N
<IO>_R
<(((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI>_N)
:: (forall r_XqP.
Int
-> State# RealWorld
-> (# State# RealWorld,
(((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)
-> Int -> r_XqP)
-> r_XqP #))
~R# StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_XqI)
-> r_XqI)))
`cast` (Sym
(Cont8.NTCo:StateT[0]
<Int>_N <StateT Int IO>_R <(b_X15V -> s_X15T -> r_aog) -> r_aog>_N)
:: (forall r_Xoh.
Int
-> StateT
Int
IO
((((b_X15V -> s_X15T -> r_aog) -> r_aog) -> Int -> r_Xoh)
-> r_Xoh))
~R# StateT
Int (StateT Int IO) ((b_X15V -> s_X15T -> r_aog) -> r_aog))
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
module Cont8 (main) where
import Prelude
liftM :: (Monad m) => (a1 -> r) -> m a1 -> m r
liftM f m1 = do { x1 <- m1; return (f x1) }
ap :: (Monad m) => m (a -> b) -> m a -> m b
ap m1 m2 = do { x1 <- m1; x2 <- m2; return (x1 x2) }
replicateM :: (Monad m) => Int -> m a -> m [a]
replicateM n x = sequence (replicate n x)
modify :: Monad m => (s -> s) -> StateT s m ()
modify f = get >>= put . f
newtype StateT s m a = StateT { getStateTFunc
:: forall r . s -> m ((a -> s -> r) -> r)}
instance Monad m => Functor (StateT s m) where
fmap = liftM
instance Monad m => Applicative (StateT s m) where
pure = return
(<*>) = ap
instance Monad m => Monad (StateT s m) where
return x = StateT $ \s -> return $ \f -> f x s
StateT f >>= g = StateT $ \s -> do
useX <- f s
useX $ \x s' -> getStateTFunc (g x) s'
runStateT :: Monad m => StateT s m a -> s -> m (a, s)
runStateT f s = do
useXS <- getStateTFunc f s
return $ useXS $ \x s' -> (x,s')
get :: Monad m => StateT s m s
get = StateT $ \s -> return $ \f -> f s s
put :: Monad m => s -> StateT s m ()
put s = s `seq` StateT $ \_ -> return $ \f -> f () s
-- benchmark
incrementLevel0 :: LargeState Int
incrementLevel0 = do
modify inc
get
inc :: Int -> Int
inc n = n + 1
{-# INLINE inc #-}
type LargeState = StateT Int
(StateT Int
(StateT Int IO))
runLargeState :: LargeState a -> IO a
runLargeState s = do
let s0 = liftM fst $ runStateT s 0
let s1 = liftM fst $ runStateT s0 0
let s2 = liftM fst $ runStateT s1 0
--let s3 = liftM fst $ runStateT s2 0
--let s4 = liftM fst $ runStateT s3 0
--let s5 = liftM fst $ runStateT s4 0
s2
main :: IO ()
main = do
s <- runLargeState $ replicateM 1000 incrementLevel0
putStrLn $ show s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment