Skip to content

Instantly share code, notes, and snippets.

@mpickering
Created February 3, 2023 12:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mpickering/dd54a6bc02058f5a407078bf1e6d31b1 to your computer and use it in GitHub Desktop.
Save mpickering/dd54a6bc02058f5a407078bf1e6d31b1 to your computer and use it in GitHub Desktop.
-- RHS size: {terms: 403, types: 480, coercions: 132, joins: 3/5}
primUnfoldrBounded [InlPrag=INLINE (sat-args=3)]
:: forall b a. BoundedPrim b -> (a -> Maybe (b, a)) -> a -> Builder
[GblId,
Arity=6,
Str=<M!P(L,LCL(C1(C1(!P(L,1L)))))><SCS(L)><L><LCL(C1(L))><1L><L>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=3,unsat_ok=False,boring_ok=False)
Tmpl= (\ (@b_a6mX)
(@a_a6mY)
(w_a5Sw [Occ=OnceL1!] :: BoundedPrim b_a6mX)
(f_a5Sx :: a_a6mY -> Maybe (b_a6mX, a_a6mY))
(x0_a5Sy [Occ=Once1] :: a_a6mY)
(@r_i6xq)
(eta_B0 [Occ=Once1] :: BuildStep r_i6xq)
(eta1_B1 [Occ=Once1] :: BufferRange)
(eta2_X2 [Occ=Once1, OS=OneShot] :: State# RealWorld) ->
letrec {
fillWith_a6n9 [Occ=LoopBreaker]
:: a_a6mY
-> (BufferRange -> IO (BuildSignal r_i6xq))
-> BufferRange
-> IO (BuildSignal r_i6xq)
[LclId, Arity=3, Unf=OtherCon []]
fillWith_a6n9
= \ (x_a5SB [Occ=Once1] :: a_a6mY)
(k_a5SC [Occ=OnceL2!] :: BufferRange -> IO (BuildSignal r_i6xq))
(ds_d6wa [Occ=Once1!] :: BufferRange) ->
case ds_d6wa of { BufferRange bx_d6x1 [Occ=Once1] bx1_d6x2 ->
let {
ope0_a5SE [Occ=OnceL1] :: Ptr Word8
[LclId, Unf=OtherCon []]
ope0_a5SE = GHC.Ptr.Ptr @Word8 bx1_d6x2 } in
letrec {
go_a6nq [Occ=LoopBreaker]
:: Maybe (b_a6mX, a_a6mY) -> Ptr Word8 -> IO (BuildSignal r_i6xq)
[LclId, Arity=3, Unf=OtherCon []]
go_a6nq
= \ (ds1_d6wd [Occ=Once1!] :: Maybe (b_a6mX, a_a6mY))
(op_a5SG [Occ=Once2!] :: Ptr Word8) ->
case ds1_d6wd of {
Nothing ->
case op_a5SG of op1_X4 [Occ=Once1] { Ptr _ [Occ=Dead] ->
k_a5SC
(Data.ByteString.Builder.Internal.$WBufferRange
op1_X4 ope0_a5SE)
};
Just ds2_d6wr [Occ=Once1!] ->
case ds2_d6wr of
{ (y_a5SH [Occ=OnceL2], x'_a5SI [Occ=OnceL2]) ->
case op_a5SG of op1_X5 [Occ=Once2]
{ Ptr ipv_s6yY [Occ=Once1] ->
case w_a5Sw of
{ Data.ByteString.Builder.Prim.Internal.BP bx2_i6xf
ds3_i6xg [Occ=OnceL2!] ->
case ltAddr# bx1_d6x2 (plusAddr# ipv_s6yY bx2_i6xf) of {
__DEFAULT ->
(\ (s_i6yt [Occ=Once1] :: State# RealWorld) ->
case ((ds3_i6xg y_a5SH op1_X5)
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld,
Ptr Word8 #))))
s_i6yt
of
{ (# ipv1_i6yv [Occ=Once1], ipv2_i6yw [Occ=Once1] #) ->
((go_a6nq (f_a5Sx x'_a5SI) ipv2_i6yw)
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #))))
ipv1_i6yv
})
`cast` (Sym (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R)
:: (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #))
~R# IO (BuildSignal r_i6xq));
1# ->
(\ (s_i6y8 [Occ=Once1] :: State# RealWorld) ->
(# s_i6y8,
Data.ByteString.Builder.Internal.$WBufferFull
@r_i6xq
(GHC.Types.I# bx2_i6xf)
op1_X5
(\ (ds4_d6wm [Occ=Once1!] :: BufferRange) ->
case ds4_d6wm of
{ BufferRange bx3_d6x3 [Occ=Once1]
bx4_d6x4 [Occ=Once1] ->
(\ (s1_i6yt [Occ=Once1] :: State# RealWorld) ->
case ((ds3_i6xg
y_a5SH
(GHC.Ptr.Ptr @Word8 bx3_d6x3))
`cast` (GHC.Types.N:IO[0]
<Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State#
RealWorld,
Ptr Word8 #))))
s1_i6yt
of
{ (# ipv1_i6yv [Occ=Once1],
ipv2_i6yw [Occ=Once1!] #) ->
case ipv2_i6yw of opNew'_X8 [Occ=Once1]
{ Ptr _ [Occ=Dead] ->
((fillWith_a6n9
x'_a5SI
k_a5SC
(Data.ByteString.Builder.Internal.$WBufferRange
opNew'_X8
(GHC.Ptr.Ptr @Word8 bx4_d6x4)))
`cast` (GHC.Types.N:IO[0]
<BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State# RealWorld,
BuildSignal
r_i6xq #))))
ipv1_i6yv
}
})
`cast` (Sym (GHC.Types.N:IO[0]
<BuildSignal r_i6xq>_R)
:: (State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #))
~R# IO (BuildSignal r_i6xq))
}) #))
`cast` (Sym (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R)
:: (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #))
~R# IO (BuildSignal r_i6xq))
}
}
}
}
}; } in
go_a6nq (f_a5Sx x_a5SB) (GHC.Ptr.Ptr @Word8 bx_d6x1)
}; } in
((fillWith_a6n9 x0_a5Sy eta_B0 eta1_B1)
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #))))
eta2_X2)
`cast` (forall (b :: <*>_N) (a :: <*>_N).
<BoundedPrim b>_R
%<'Many>_N ->_R <a -> Maybe (b, a)>_R
%<'Many>_N ->_R <a>_R
%<'Many>_N ->_R forall (r :: <*>_N).
<BuildStep (r |> <*>_N)>_R
%<'Many>_N ->_R <BufferRange>_R
%<'Many>_N ->_R Sym (GHC.Types.N:IO[0]
<BuildSignal (r |> <*>_N)>_R)
; Sym (Data.ByteString.Builder.Internal.N:Builder[0])
:: (forall {b} {a}.
BoundedPrim b
-> (a -> Maybe (b, a))
-> a
-> forall {r}.
BuildStep (r |> <*>_N)
-> BufferRange
-> State# RealWorld
-> (# State# RealWorld, BuildSignal (r |> <*>_N) #))
~R# (forall {b} {a}.
BoundedPrim b -> (a -> Maybe (b, a)) -> a -> Builder))}]
primUnfoldrBounded
= (\ (@b_a6mX)
(@a_a6mY)
(w_a5Sw :: BoundedPrim b_a6mX)
(f_a5Sx :: a_a6mY -> Maybe (b_a6mX, a_a6mY))
(x0_a5Sy :: a_a6mY)
(@r_i6xq)
(eta_B0 :: BuildStep r_i6xq)
(eta1_B1 :: BufferRange)
(eta2_X2 [OS=OneShot] :: State# RealWorld) ->
case eta1_B1 of wild_X3 { BufferRange ww_s6Kv ww1_s6Kw ->
case f_a5Sx x0_a5Sy of {
Nothing ->
((eta_B0 wild_X3)
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #))))
eta2_X2;
Just ds_d6wr ->
case ds_d6wr of { (y_a5SH, x'_a5SI) ->
case w_a5Sw of
{ Data.ByteString.Builder.Prim.Internal.BP bx_i6xf ds1_i6xg ->
case ltAddr# ww1_s6Kw (plusAddr# ww_s6Kv bx_i6xf) of {
__DEFAULT ->
case ((ds1_i6xg y_a5SH (GHC.Ptr.Ptr @Word8 ww_s6Kv))
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld -> (# State# RealWorld, Ptr Word8 #))))
eta2_X2
of
{ (# ipv_i6yv, ipv1_i6yw #) ->
joinrec {
go_s6H8 [Occ=LoopBreaker, Dmd=SCS(C1(C1(L)))]
:: Maybe (b_a6mX, a_a6mY)
-> Ptr Word8
-> State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #)
[LclId[JoinId(3)(Just [!, !])],
Arity=3,
Str=<1L><1L><L>,
Unf=OtherCon []]
go_s6H8 (ds3_d6wd :: Maybe (b_a6mX, a_a6mY))
(op_a5SG :: Ptr Word8)
(eta3_X8 [OS=OneShot] :: State# RealWorld)
= case ds3_d6wd of {
Nothing ->
case op_a5SG of { Ptr ipv2_s6yP ->
((eta_B0
(Data.ByteString.Builder.Internal.BufferRange ipv2_s6yP ww1_s6Kw))
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #))))
eta3_X8
};
Just ds4_Xa ->
case ds4_Xa of { (y1_Xc, x'1_Xd) ->
case op_a5SG of op1_Xe { Ptr ipv2_s6yR ->
case ltAddr# ww1_s6Kw (plusAddr# ipv2_s6yR bx_i6xf) of {
__DEFAULT ->
case ((ds1_i6xg y1_Xc op1_Xe)
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld, Ptr Word8 #))))
eta3_X8
of
{ (# ipv3_Xh, ipv4_Xi #) ->
jump go_s6H8 (f_a5Sx x'1_Xd) ipv4_Xi ipv3_Xh
};
1# ->
(# eta3_X8,
Data.ByteString.Builder.Internal.BufferFull
@r_i6xq
bx_i6xf
ipv2_s6yR
((\ (ds5_d6wm :: BufferRange)
(eta4_Xg [OS=OneShot] :: State# RealWorld) ->
case ds5_d6wm of { BufferRange bx1_d6x3 bx2_d6x4 ->
case ((ds1_i6xg y1_Xc (GHC.Ptr.Ptr @Word8 bx1_d6x3))
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld, Ptr Word8 #))))
eta4_Xg
of
{ (# ipv3_Xj, ipv4_Xk #) ->
case ipv4_Xk of { Ptr ipv5_s6yT ->
letrec {
$wfillWith_s6Oc [InlPrag=[2],
Occ=LoopBreaker,
Dmd=SCS(C1(C1(C1(C1(L)))))]
:: a_a6mY
-> (BufferRange -> IO (BuildSignal r_i6xq))
-> Addr#
-> Addr#
-> State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #)
[LclId,
Arity=5,
Str=<L><LCL(C1(L))><L><L><L>,
Unf=OtherCon []]
$wfillWith_s6Oc
= \ (x_s6Kr :: a_a6mY)
(k_Xm :: BufferRange -> IO (BuildSignal r_i6xq))
(ww2_Xn :: Addr#)
(ww3_X4 :: Addr#)
(eta5_Xo [OS=OneShot] :: State# RealWorld) ->
case f_a5Sx x_s6Kr of {
Nothing ->
((k_Xm
(Data.ByteString.Builder.Internal.BufferRange
ww2_Xn ww3_X4))
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #))))
eta5_Xo;
Just ds7_Xq ->
case ds7_Xq of { (y2_Xs, x'2_Xt) ->
case ltAddr# ww3_X4 (plusAddr# ww2_Xn bx_i6xf)
of {
__DEFAULT ->
case ((ds1_i6xg
y2_Xs (GHC.Ptr.Ptr @Word8 ww2_Xn))
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld,
Ptr Word8 #))))
eta5_Xo
of
{ (# ipv6_Xw, ipv7_Xx #) ->
joinrec {
go1_Xy [Occ=LoopBreaker,
Dmd=SCS(C1(C1(!P(L,L))))]
:: Maybe (b_a6mX, a_a6mY)
-> Ptr Word8
-> State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #)
[LclId[JoinId(3)(Just [!, !])],
Arity=3,
Str=<1L><1L><L>,
Unf=OtherCon []]
go1_Xy (ds9_Xz :: Maybe (b_a6mX, a_a6mY))
(op2_XA :: Ptr Word8)
(eta6_XB [OS=OneShot]
:: State# RealWorld)
= case ds9_Xz of {
Nothing ->
case op2_XA of { Ptr ipv8_s6yP ->
((k_Xm
(Data.ByteString.Builder.Internal.BufferRange
ipv8_s6yP ww3_X4))
`cast` (GHC.Types.N:IO[0]
<BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State#
RealWorld,
BuildSignal
r_i6xq #))))
eta6_XB
};
Just ds10_XD ->
case ds10_XD of { (y3_XF, x'3_XG) ->
case op2_XA of op3_XH
{ Ptr ipv8_XI ->
case ltAddr#
ww3_X4
(plusAddr# ipv8_XI bx_i6xf)
of {
__DEFAULT ->
case ((ds1_i6xg y3_XF op3_XH)
`cast` (GHC.Types.N:IO[0]
<Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State#
RealWorld
-> (# State#
RealWorld,
Ptr
Word8 #))))
eta6_XB
of
{ (# ipv9_XL, ipv10_XM #) ->
jump go1_Xy
(f_a5Sx x'3_XG)
ipv10_XM
ipv9_XL
};
1# ->
(# eta6_XB,
Data.ByteString.Builder.Internal.BufferFull
@r_i6xq
bx_i6xf
ipv8_XI
((\ (ds11_XK
:: BufferRange)
(eta7_XL [OS=OneShot]
:: State#
RealWorld) ->
case ds11_XK of
{ BufferRange bx3_XN
bx4_XO ->
case ((ds1_i6xg
y3_XF
(GHC.Ptr.Ptr
@Word8
bx3_XN))
`cast` (GHC.Types.N:IO[0]
<Ptr
Word8>_R
:: IO
(Ptr
Word8)
~R# (State#
RealWorld
-> (# State#
RealWorld,
Ptr
Word8 #))))
eta7_XL
of
{ (# ipv9_XQ,
ipv10_XR #) ->
case ipv10_XR of
{ Ptr ipv11_XT ->
$wfillWith_s6Oc
x'3_XG
k_Xm
ipv11_XT
bx4_XO
ipv9_XQ
}
}
})
`cast` (<BufferRange>_R
%<'Many>_N ->_R Sym (GHC.Types.N:IO[0]
<BuildSignal
r_i6xq>_R)
:: (BufferRange
-> State#
RealWorld
-> (# State#
RealWorld,
BuildSignal
r_i6xq #))
~R# (BufferRange
-> IO
(BuildSignal
r_i6xq)))) #)
}
}
}
}; } in
jump go1_Xy (f_a5Sx x'2_Xt) ipv7_Xx ipv6_Xw
};
1# ->
(# eta5_Xo,
Data.ByteString.Builder.Internal.BufferFull
@r_i6xq
bx_i6xf
ww2_Xn
((\ (ds8_Xv :: BufferRange)
(eta6_Xw [OS=OneShot]
:: State# RealWorld) ->
case ds8_Xv of
{ BufferRange bx3_Xy bx4_Xz ->
case ((ds1_i6xg
y2_Xs
(GHC.Ptr.Ptr @Word8 bx3_Xy))
`cast` (GHC.Types.N:IO[0]
<Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State#
RealWorld
-> (# State#
RealWorld,
Ptr
Word8 #))))
eta6_Xw
of
{ (# ipv6_XB, ipv7_XC #) ->
case ipv7_XC of { Ptr ipv8_XE ->
$wfillWith_s6Oc
x'2_Xt k_Xm ipv8_XE bx4_Xz ipv6_XB
}
}
})
`cast` (<BufferRange>_R
%<'Many>_N ->_R Sym (GHC.Types.N:IO[0]
<BuildSignal
r_i6xq>_R)
:: (BufferRange
-> State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #))
~R# (BufferRange
-> IO
(BuildSignal
r_i6xq)))) #)
}
}
}; } in
$wfillWith_s6Oc x'1_Xd eta_B0 ipv5_s6yT bx2_d6x4 ipv3_Xj
}
}
})
`cast` (<BufferRange>_R
%<'Many>_N ->_R Sym (GHC.Types.N:IO[0]
<BuildSignal r_i6xq>_R)
:: (BufferRange
-> State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #))
~R# (BufferRange -> IO (BuildSignal r_i6xq)))) #)
}
}
}
}; } in
jump go_s6H8 (f_a5Sx x'_a5SI) ipv1_i6yw ipv_i6yv
};
1# ->
(# eta2_X2,
Data.ByteString.Builder.Internal.BufferFull
@r_i6xq
bx_i6xf
ww_s6Kv
((\ (ds2_d6wm :: BufferRange)
(eta3_X9 [OS=OneShot] :: State# RealWorld) ->
case ds2_d6wm of { BufferRange bx1_d6x3 bx2_d6x4 ->
case ((ds1_i6xg y_a5SH (GHC.Ptr.Ptr @Word8 bx1_d6x3))
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld, Ptr Word8 #))))
eta3_X9
of
{ (# ipv_i6yv, ipv1_i6yw #) ->
case ipv1_i6yw of { Ptr ipv2_s6yT ->
letrec {
$wfillWith_s6Od [InlPrag=[2],
Occ=LoopBreaker,
Dmd=SCS(C1(C1(C1(C1(L)))))]
:: a_a6mY
-> (BufferRange -> IO (BuildSignal r_i6xq))
-> Addr#
-> Addr#
-> State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #)
[LclId, Arity=5, Str=<L><LCL(C1(L))><L><L><L>, Unf=OtherCon []]
$wfillWith_s6Od
= \ (x_s6Kr :: a_a6mY)
(k_Xc :: BufferRange -> IO (BuildSignal r_i6xq))
(ww2_Xd :: Addr#)
(ww3_X4 :: Addr#)
(eta4_Xe [OS=OneShot] :: State# RealWorld) ->
case f_a5Sx x_s6Kr of {
Nothing ->
((k_Xc
(Data.ByteString.Builder.Internal.BufferRange
ww2_Xd ww3_X4))
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #))))
eta4_Xe;
Just ds4_Xg ->
case ds4_Xg of { (y1_Xi, x'1_Xj) ->
case ltAddr# ww3_X4 (plusAddr# ww2_Xd bx_i6xf) of {
__DEFAULT ->
case ((ds1_i6xg y1_Xi (GHC.Ptr.Ptr @Word8 ww2_Xd))
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld,
Ptr Word8 #))))
eta4_Xe
of
{ (# ipv3_Xm, ipv4_Xn #) ->
joinrec {
go_s6H8 [Occ=LoopBreaker, Dmd=SCS(C1(C1(!P(L,L))))]
:: Maybe (b_a6mX, a_a6mY)
-> Ptr Word8
-> State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6xq #)
[LclId[JoinId(3)(Just [!, !])],
Arity=3,
Str=<1L><1L><L>,
Unf=OtherCon []]
go_s6H8 (ds6_d6wd :: Maybe (b_a6mX, a_a6mY))
(op_a5SG :: Ptr Word8)
(eta5_Xo [OS=OneShot] :: State# RealWorld)
= case ds6_d6wd of {
Nothing ->
case op_a5SG of { Ptr ipv5_s6yP ->
((k_Xc
(Data.ByteString.Builder.Internal.BufferRange
ipv5_s6yP ww3_X4))
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R
:: IO (BuildSignal r_i6xq)
~R# (State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #))))
eta5_Xo
};
Just ds7_Xq ->
case ds7_Xq of { (y2_Xs, x'2_Xt) ->
case op_a5SG of op1_X8 { Ptr ipv5_s6yR ->
case ltAddr# ww3_X4 (plusAddr# ipv5_s6yR bx_i6xf)
of {
__DEFAULT ->
case ((ds1_i6xg y2_Xs op1_X8)
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld,
Ptr Word8 #))))
eta5_Xo
of
{ (# ipv6_Xw, ipv7_Xx #) ->
jump go_s6H8 (f_a5Sx x'2_Xt) ipv7_Xx ipv6_Xw
};
1# ->
(# eta5_Xo,
Data.ByteString.Builder.Internal.BufferFull
@r_i6xq
bx_i6xf
ipv5_s6yR
((\ (ds8_Xv :: BufferRange)
(eta6_Xw [OS=OneShot]
:: State# RealWorld) ->
case ds8_Xv of
{ BufferRange bx3_Xy bx4_Xz ->
case ((ds1_i6xg
y2_Xs
(GHC.Ptr.Ptr @Word8 bx3_Xy))
`cast` (GHC.Types.N:IO[0]
<Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State#
RealWorld
-> (# State#
RealWorld,
Ptr
Word8 #))))
eta6_Xw
of
{ (# ipv6_XB, ipv7_XC #) ->
case ipv7_XC of { Ptr ipv8_XE ->
$wfillWith_s6Od
x'2_Xt k_Xc ipv8_XE bx4_Xz ipv6_XB
}
}
})
`cast` (<BufferRange>_R
%<'Many>_N ->_R Sym (GHC.Types.N:IO[0]
<BuildSignal
r_i6xq>_R)
:: (BufferRange
-> State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #))
~R# (BufferRange
-> IO
(BuildSignal
r_i6xq)))) #)
}
}
}
}; } in
jump go_s6H8 (f_a5Sx x'1_Xj) ipv4_Xn ipv3_Xm
};
1# ->
(# eta4_Xe,
Data.ByteString.Builder.Internal.BufferFull
@r_i6xq
bx_i6xf
ww2_Xd
((\ (ds5_Xl :: BufferRange)
(eta5_Xm [OS=OneShot] :: State# RealWorld) ->
case ds5_Xl of { BufferRange bx3_Xo bx4_Xp ->
case ((ds1_i6xg y1_Xi (GHC.Ptr.Ptr @Word8 bx3_Xo))
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld,
Ptr Word8 #))))
eta5_Xm
of
{ (# ipv3_Xr, ipv4_Xs #) ->
case ipv4_Xs of { Ptr ipv5_Xu ->
$wfillWith_s6Od x'1_Xj k_Xc ipv5_Xu bx4_Xp ipv3_Xr
}
}
})
`cast` (<BufferRange>_R
%<'Many>_N ->_R Sym (GHC.Types.N:IO[0]
<BuildSignal
r_i6xq>_R)
:: (BufferRange
-> State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6xq #))
~R# (BufferRange
-> IO (BuildSignal r_i6xq)))) #)
}
}
}; } in
$wfillWith_s6Od x'_a5SI eta_B0 ipv2_s6yT bx2_d6x4 ipv_i6yv
}
}
})
`cast` (<BufferRange>_R
%<'Many>_N ->_R Sym (GHC.Types.N:IO[0] <BuildSignal r_i6xq>_R)
:: (BufferRange
-> State# RealWorld -> (# State# RealWorld, BuildSignal r_i6xq #))
~R# (BufferRange -> IO (BuildSignal r_i6xq)))) #)
}
}
}
}
})
`cast` (forall (b :: <*>_N) (a :: <*>_N).
<BoundedPrim b>_R
%<'Many>_N ->_R <a -> Maybe (b, a)>_R
%<'Many>_N ->_R <a>_R
%<'Many>_N ->_R forall (r :: <*>_N).
<BuildStep (r |> <*>_N)>_R
%<'Many>_N ->_R <BufferRange>_R
%<'Many>_N ->_R Sym (GHC.Types.N:IO[0]
<BuildSignal (r |> <*>_N)>_R)
; Sym (Data.ByteString.Builder.Internal.N:Builder[0])
:: (forall {b} {a}.
BoundedPrim b
-> (a -> Maybe (b, a))
-> a
-> forall {r}.
BuildStep (r |> <*>_N)
-> BufferRange
-> State# RealWorld
-> (# State# RealWorld, BuildSignal (r |> <*>_N) #))
~R# (forall {b} {a}.
BoundedPrim b -> (a -> Maybe (b, a)) -> a -> Builder))
-- RHS size: {terms: 148, types: 190, coercions: 63, joins: 2/3}
primUnfoldrBounded [InlPrag=INLINE (sat-args=3)]
:: forall b a. BoundedPrim b -> (a -> Maybe (b, a)) -> a -> Builder
[GblId,
Arity=6,
Str=<L!P(L,LC(S,C(1,C(1,P(L,1L)))))><SC(S,L)><L><LC(L,C(1,L))><1!P(L,L)><L>,
Unf=Unf{Src=StableUser, TopLvl=True,
Value=True, ConLike=True, WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=3,unsat_ok=False,boring_ok=False)
Tmpl= (\ (@b_a6mk)
(@a_a6ml)
(w_a5RZ [Occ=OnceL1!] :: BoundedPrim b_a6mk)
(f_a5S0 :: a_a6ml -> Maybe (b_a6mk, a_a6ml))
(x0_a5S1 [Occ=Once1] :: a_a6ml)
(@r_i6wL)
(eta_B0 [Occ=Once1] :: BuildStep r_i6wL)
(eta1_B1 [Occ=Once1] :: BufferRange)
(eta2_B2 [Occ=Once1, OS=OneShot] :: State# RealWorld) ->
letrec {
fillWith_a6mw [Occ=LoopBreaker]
:: a_a6ml
-> (BufferRange -> IO (BuildSignal r_i6wL))
-> BufferRange
-> IO (BuildSignal r_i6wL)
[LclId, Arity=4, Unf=OtherCon []]
fillWith_a6mw
= \ (x_a5S4 [Occ=Once1] :: a_a6ml)
(k_a5S5 [Occ=OnceL2!] :: BufferRange -> IO (BuildSignal r_i6wL))
(ds_d6vv [Occ=Once1!] :: BufferRange) ->
case ds_d6vv of { BufferRange bx_d6wm [Occ=Once1] bx1_d6wn ->
let {
ope0_a5S7 [Occ=OnceL1] :: Ptr Word8
[LclId, Unf=OtherCon []]
ope0_a5S7 = GHC.Ptr.Ptr @Word8 bx1_d6wn } in
letrec {
go_a6mN [Occ=LoopBreaker]
:: Maybe (b_a6mk, a_a6ml) -> Ptr Word8 -> IO (BuildSignal r_i6wL)
[LclId, Arity=3, Unf=OtherCon []]
go_a6mN
= \ (ds1_d6vy [Occ=Once1!] :: Maybe (b_a6mk, a_a6ml))
(op_a5S9 [Occ=Once2!] :: Ptr Word8) ->
case ds1_d6vy of {
Nothing ->
case op_a5S9 of op1_X4 [Occ=Once1] { Ptr _ [Occ=Dead] ->
k_a5S5
(Data.ByteString.Builder.Internal.$WBufferRange
op1_X4 ope0_a5S7)
};
Just ds2_d6vM [Occ=Once1!] ->
case ds2_d6vM of
{ (y_a5Sa [Occ=OnceL2], x'_a5Sb [Occ=OnceL2]) ->
case op_a5S9 of op1_X5 [Occ=Once2]
{ Ptr ipv_s6yo [Occ=Once1] ->
case w_a5RZ of
{ Data.ByteString.Builder.Prim.Internal.BP bx2_i6wA
ds3_i6wB [Occ=OnceL2!] ->
case ltAddr# bx1_d6wn (plusAddr# ipv_s6yo bx2_i6wA) of {
__DEFAULT ->
(\ (s_i6xR [Occ=Once1] :: State# RealWorld) ->
case ((ds3_i6wB y_a5Sa op1_X5)
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld,
Ptr Word8 #))))
s_i6xR
of
{ (# ipv1_i6xT [Occ=Once1], ipv2_i6xU [Occ=Once1] #) ->
((go_a6mN (f_a5S0 x'_a5Sb) ipv2_i6xU)
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6wL>_R
:: IO (BuildSignal r_i6wL)
~R# (State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6wL #))))
ipv1_i6xT
})
`cast` (Sym (GHC.Types.N:IO[0] <BuildSignal r_i6wL>_R)
:: (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6wL #))
~R# IO (BuildSignal r_i6wL));
1# ->
(\ (s_i6xw [Occ=Once1] :: State# RealWorld) ->
(# s_i6xw,
Data.ByteString.Builder.Internal.$WBufferFull
@r_i6wL
(GHC.Types.I# bx2_i6wA)
op1_X5
(\ (ds4_d6vH [Occ=Once1!] :: BufferRange) ->
case ds4_d6vH of
{ BufferRange bx3_d6wo [Occ=Once1]
bx4_d6wp [Occ=Once1] ->
(\ (s1_i6xR [Occ=Once1] :: State# RealWorld) ->
case ((ds3_i6wB
y_a5Sa
(GHC.Ptr.Ptr @Word8 bx3_d6wo))
`cast` (GHC.Types.N:IO[0]
<Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State#
RealWorld,
Ptr Word8 #))))
s1_i6xR
of
{ (# ipv1_i6xT [Occ=Once1],
ipv2_i6xU [Occ=Once1!] #) ->
case ipv2_i6xU of opNew'_X8 [Occ=Once1]
{ Ptr _ [Occ=Dead] ->
((fillWith_a6mw
x'_a5Sb
k_a5S5
(Data.ByteString.Builder.Internal.$WBufferRange
opNew'_X8
(GHC.Ptr.Ptr @Word8 bx4_d6wp)))
`cast` (GHC.Types.N:IO[0]
<BuildSignal r_i6wL>_R
:: IO (BuildSignal r_i6wL)
~R# (State# RealWorld
-> (# State# RealWorld,
BuildSignal
r_i6wL #))))
ipv1_i6xT
}
})
`cast` (Sym (GHC.Types.N:IO[0]
<BuildSignal r_i6wL>_R)
:: (State# RealWorld
-> (# State# RealWorld,
BuildSignal r_i6wL #))
~R# IO (BuildSignal r_i6wL))
}) #))
`cast` (Sym (GHC.Types.N:IO[0] <BuildSignal r_i6wL>_R)
:: (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6wL #))
~R# IO (BuildSignal r_i6wL))
}
}
}
}
}; } in
go_a6mN (f_a5S0 x_a5S4) (GHC.Ptr.Ptr @Word8 bx_d6wm)
}; } in
((fillWith_a6mw x0_a5S1 eta_B0 eta1_B1)
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6wL>_R
:: IO (BuildSignal r_i6wL)
~R# (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6wL #))))
eta2_B2)
`cast` (forall (b :: <*>_N) (a :: <*>_N).
<BoundedPrim (b |> <*>_N)>_R
%<Many>_N ->_R <(a |> <*>_N)
-> Maybe ((b |> <*>_N), (a |> <*>_N))>_R
%<Many>_N ->_R <(a |> <*>_N)>_R
%<Many>_N ->_R forall (r :: <*>_N).
<BuildStep (r |> <*>_N)>_R
%<Many>_N ->_R <BufferRange>_R
%<Many>_N ->_R Sym (GHC.Types.N:IO[0]
<BuildSignal (r |> <*>_N)>_R)
; Sym (Data.ByteString.Builder.Internal.N:Builder[0])
:: (forall {b} {a}.
BoundedPrim (b |> <*>_N)
-> ((a |> <*>_N) -> Maybe ((b |> <*>_N), (a |> <*>_N)))
-> (a |> <*>_N)
-> forall {r}.
BuildStep (r |> <*>_N)
-> BufferRange
-> State# RealWorld
-> (# State# RealWorld, BuildSignal (r |> <*>_N) #))
~R# (forall {b} {a}.
BoundedPrim (b |> <*>_N)
-> ((a |> <*>_N) -> Maybe ((b |> <*>_N), (a |> <*>_N)))
-> (a |> <*>_N)
-> Builder))}]
primUnfoldrBounded
= (\ (@b_a6mk)
(@a_a6ml)
(w_a5RZ :: BoundedPrim b_a6mk)
(f_a5S0 :: a_a6ml -> Maybe (b_a6mk, a_a6ml))
(x0_a5S1 :: a_a6ml)
(@r_i6wL)
(eta_B0 :: BuildStep r_i6wL)
(eta1_B1 :: BufferRange)
(eta2_B2 [OS=OneShot] :: State# RealWorld) ->
case eta1_B1 of { BufferRange ww_s6JU ww1_s6JV ->
letrec {
$wfillWith_s6JZ [InlPrag=[2],
Occ=LoopBreaker,
Dmd=SC(S,C(1,C(1,C(1,C(1,L)))))]
:: a_a6ml
-> (BufferRange -> IO (BuildSignal r_i6wL))
-> Addr#
-> Addr#
-> State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6wL #)
[LclId, Arity=5, Str=<L><LC(L,C(1,L))><L><L><L>, Unf=OtherCon []]
$wfillWith_s6JZ
= \ (x_s6JQ :: a_a6ml)
(k_s6JR :: BufferRange -> IO (BuildSignal r_i6wL))
(ww2_X4 :: Addr#)
(ww3_X5 :: Addr#)
(eta3_s6JX [OS=OneShot] :: State# RealWorld) ->
join {
exit_X8 [Dmd=LC(S,C(1,C(1,C(1,C(1,C(1,!P(L,L)))))))]
:: State# RealWorld
-> b_a6mk
-> a_a6ml
-> Addr#
-> Int#
-> (b_a6mk -> Ptr Word8 -> IO (Ptr Word8))
-> (# State# RealWorld, BuildSignal r_i6wL #)
[LclId[JoinId(6)(Nothing)],
Arity=6,
Str=<L><L><L><L><L><LC(S,C(1,C(1,P(L,1L))))>]
exit_X8 (eta4_X9 [OS=OneShot] :: State# RealWorld)
(y_a5Sa [OS=OneShot] :: b_a6mk)
(x'_a5Sb [OS=OneShot] :: a_a6ml)
(ipv_s6yg [OS=OneShot] :: Addr#)
(bx_i6wA [OS=OneShot] :: Int#)
(ds1_i6wB [OS=OneShot] :: b_a6mk -> Ptr Word8 -> IO (Ptr Word8))
= (# eta4_X9,
Data.ByteString.Builder.Internal.BufferFull
@r_i6wL
bx_i6wA
ipv_s6yg
((\ (ds_d6vH :: BufferRange)
(eta5_Xa [OS=OneShot] :: State# RealWorld) ->
case ds_d6vH of { BufferRange bx1_d6wo bx2_d6wp ->
case ((ds1_i6wB y_a5Sa (GHC.Ptr.Ptr @Word8 bx1_d6wo))
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld, Ptr Word8 #))))
eta5_Xa
of
{ (# ipv1_i6xT, ipv2_i6xU #) ->
case ipv2_i6xU of { Ptr ipv3_s6yi ->
$wfillWith_s6JZ x'_a5Sb k_s6JR ipv3_s6yi bx2_d6wp ipv1_i6xT
}
}
})
`cast` (<BufferRange>_R
%<Many>_N ->_R Sym (GHC.Types.N:IO[0] <BuildSignal r_i6wL>_R)
:: (BufferRange
-> State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6wL #))
~R# (BufferRange -> IO (BuildSignal r_i6wL)))) #) } in
case f_a5S0 x_s6JQ of {
Nothing ->
((k_s6JR
(Data.ByteString.Builder.Internal.BufferRange ww2_X4 ww3_X5))
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6wL>_R
:: IO (BuildSignal r_i6wL)
~R# (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6wL #))))
eta3_s6JX;
Just ds_d6vM ->
case ds_d6vM of { (y_a5Sa, x'_a5Sb) ->
case w_a5RZ of
{ Data.ByteString.Builder.Prim.Internal.BP bx_i6wA ds1_i6wB ->
case ltAddr# ww3_X5 (plusAddr# ww2_X4 bx_i6wA) of {
__DEFAULT ->
case ((ds1_i6wB y_a5Sa (GHC.Ptr.Ptr @Word8 ww2_X4))
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld, Ptr Word8 #))))
eta3_s6JX
of
{ (# ipv_i6xT, ipv1_i6xU #) ->
joinrec {
go_s6Fg [Occ=LoopBreaker, Dmd=SC(S,C(1,C(1,!P(L,L))))]
:: Maybe (b_a6mk, a_a6ml)
-> Ptr Word8
-> State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6wL #)
[LclId[JoinId(3)(Just [!, !])],
Arity=3,
Str=<1L><1L><L>,
Unf=OtherCon []]
go_s6Fg (ds3_d6vy :: Maybe (b_a6mk, a_a6ml))
(op_a5S9 :: Ptr Word8)
(eta4_X9 [OS=OneShot] :: State# RealWorld)
= case ds3_d6vy of {
Nothing ->
case op_a5S9 of { Ptr ipv2_s6ye ->
((k_s6JR
(Data.ByteString.Builder.Internal.BufferRange
ipv2_s6ye ww3_X5))
`cast` (GHC.Types.N:IO[0] <BuildSignal r_i6wL>_R
:: IO (BuildSignal r_i6wL)
~R# (State# RealWorld
-> (# State# RealWorld, BuildSignal r_i6wL #))))
eta4_X9
};
Just ds4_Xd ->
case ds4_Xd of { (y1_Xf, x'1_Xg) ->
case op_a5S9 of op1_X7 { Ptr ipv2_s6yg ->
case ltAddr# ww3_X5 (plusAddr# ipv2_s6yg bx_i6wA) of {
__DEFAULT ->
case ((ds1_i6wB y1_Xf op1_X7)
`cast` (GHC.Types.N:IO[0] <Ptr Word8>_R
:: IO (Ptr Word8)
~R# (State# RealWorld
-> (# State# RealWorld, Ptr Word8 #))))
eta4_X9
of
{ (# ipv3_Xj, ipv4_Xk #) ->
jump go_s6Fg (f_a5S0 x'1_Xg) ipv4_Xk ipv3_Xj
};
1# ->
jump exit_X8 eta4_X9 y1_Xf x'1_Xg ipv2_s6yg bx_i6wA ds1_i6wB
}
}
}
}; } in
jump go_s6Fg (f_a5S0 x'_a5Sb) ipv1_i6xU ipv_i6xT
};
1# -> jump exit_X8 eta3_s6JX y_a5Sa x'_a5Sb ww2_X4 bx_i6wA ds1_i6wB
}
}
}
}; } in
$wfillWith_s6JZ x0_a5S1 eta_B0 ww_s6JU ww1_s6JV eta2_B2
})
`cast` (forall (b :: <*>_N) (a :: <*>_N).
<BoundedPrim (b |> <*>_N)>_R
%<Many>_N ->_R <(a |> <*>_N)
-> Maybe ((b |> <*>_N), (a |> <*>_N))>_R
%<Many>_N ->_R <(a |> <*>_N)>_R
%<Many>_N ->_R forall (r :: <*>_N).
<BuildStep (r |> <*>_N)>_R
%<Many>_N ->_R <BufferRange>_R
%<Many>_N ->_R Sym (GHC.Types.N:IO[0] <BuildSignal (r |> <*>_N)>_R)
; Sym (Data.ByteString.Builder.Internal.N:Builder[0])
:: (forall {b} {a}.
BoundedPrim (b |> <*>_N)
-> ((a |> <*>_N) -> Maybe ((b |> <*>_N), (a |> <*>_N)))
-> (a |> <*>_N)
-> forall {r}.
BuildStep (r |> <*>_N)
-> BufferRange
-> State# RealWorld
-> (# State# RealWorld, BuildSignal (r |> <*>_N) #))
~R# (forall {b} {a}.
BoundedPrim (b |> <*>_N)
-> ((a |> <*>_N) -> Maybe ((b |> <*>_N), (a |> <*>_N)))
-> (a |> <*>_N)
-> Builder))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment