Skip to content

Instantly share code, notes, and snippets.

@mpickering
Created March 3, 2022 15:13
Show Gist options
  • Save mpickering/74590e7ababb7a82abc4b04749456ccd to your computer and use it in GitHub Desktop.
Save mpickering/74590e7ababb7a82abc4b04749456ccd to your computer and use it in GitHub Desktop.
-- NEW CORE
lookup :: forall a. Key -> IntMap a -> Maybe a
[GblId,
Arity=2,
Str=<1!L><1L>,
Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True,
Guidance=ALWAYS_IF(arity=2,unsat_ok=True,boring_ok=False)
Tmpl= \ (@a_a6HU)
(k_a3xA [Occ=Once1!] :: Key)
(eta_B0 [Occ=Once1] :: IntMap a_a6HU) ->
case k_a3xA of { GHCExts.I# ipv_sdoJ [Occ=OnceL2] ->
joinrec {
go_sdSm [Occ=LoopBreakerT[1]] :: IntMap a_a6HU -> Maybe a_a6HU
[LclId[JoinId(1)(Nothing)], Arity=1, Str=<SL>, Unf=OtherCon []]
go_sdSm (ds_dbaQ [Occ=Once1!] :: IntMap a_a6HU)
= case ds_dbaQ of {
Bin _ [Occ=Dead] bx1_dcXg [Occ=Once1] l_a3xE [Occ=Once1]
r_a3xF [Occ=Once1] ->
case GHCExts.and#
(GHCExts.int2Word# ipv_sdoJ) (GHCExts.int2Word# bx1_dcXg)
of {
__DEFAULT -> jump go_sdSm r_a3xF;
0## -> jump go_sdSm l_a3xE
};
Tip bx_dcXh [Occ=Once1] x_a3xH [Occ=Once1] ->
case GHCExts.==# ipv_sdoJ bx_dcXh of {
__DEFAULT -> GHC.Maybe.Nothing @a_a6HU;
1# -> GHC.Maybe.Just @a_a6HU x_a3xH
};
Nil -> GHC.Maybe.Nothing @a_a6HU
}; } in
jump go_sdSm eta_B0
}}]
-- OLD CORE
lookup :: Data.IntSet.Internal.Key -> IntMap a -> GHC.Maybe.Maybe a
[HasNoCafRefs, TagSig: <TagProper>, LambdaFormInfo: LFReEntrant 2,
Arity: 2, Strictness: <1!L><1L>, Inline: [2],
Unfolding: InlineRule (2, True, False)
(\ @a
(k['Many] :: Data.IntSet.Internal.Key)
(eta['Many] :: IntMap a) ->
case k of wild { GHC.Types.I# ww -> $wlookup @a ww eta })]
Data.IntMap.Internal.$wlookup [InlPrag=[2]]
:: forall {a}. GHCExts.Int# -> IntMap a -> Maybe a
[GblId[StrictWorker([~, !])],
Arity=2,
Str=<L><1L>,
Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True,
WorkFree=True, Expandable=True, Guidance=IF_ARGS [0 0] 124 0}]
Data.IntMap.Internal.$wlookup
= \ (@a_seU3)
(ww_seU6 :: GHCExts.Int#)
(eta_seU8
:: IntMap a_seU3
Unf=OtherCon []) ->
join {
exit_X2 [Dmd=LCL(C1(L))] :: GHCExts.Int# -> a_seU3 -> Maybe a_seU3
[LclId[JoinId(2)(Nothing)], Arity=2, Str=<L><L>]
exit_X2 (bx_dcYE [OS=OneShot] :: GHCExts.Int#)
(x_a3yA [OS=OneShot] :: a_seU3)
= case GHCExts.==# ww_seU6 bx_dcYE of {
__DEFAULT -> GHC.Maybe.Nothing @a_seU3;
1# -> GHC.Maybe.Just @a_seU3 x_a3yA
} } in
joinrec {
go_sdT9 [Occ=LoopBreaker, Dmd=SCS(L)]
:: IntMap a_seU3 -> Maybe a_seU3
[LclId[JoinId(1)(Nothing)], Arity=1, Str=<1L>, Unf=OtherCon []]
go_sdT9 (ds_dbdh :: IntMap a_seU3)
= case ds_dbdh of {
Bin bx_dcYC bx1_dcYD l_a3yx r_a3yy ->
let {
m_sdTb :: GHCExts.Word#
[LclId]
m_sdTb = GHCExts.int2Word# bx1_dcYD } in
case GHCExts./=#
(GHCExts.word2Int#
(GHCExts.and#
(GHCExts.int2Word# ww_seU6)
(GHCExts.xor#
(GHCExts.int2Word# (GHCExts.negateInt# (GHCExts.word2Int# m_sdTb)))
m_sdTb)))
bx_dcYC
of {
__DEFAULT ->
case GHCExts.and# (GHCExts.int2Word# ww_seU6) m_sdTb of {
__DEFAULT -> jump go_sdT9 r_a3yy;
0## -> jump go_sdT9 l_a3yx
};
1# -> GHC.Maybe.Nothing @a_seU3
};
Tip bx_dcYE x_a3yA -> jump exit_X2 bx_dcYE x_a3yA;
Nil -> GHC.Maybe.Nothing @a_seU3
}; } in
jump go_sdT9 eta_seU8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment