Skip to content

Instantly share code, notes, and snippets.

@Philonous
Created May 14, 2021 17:49
Show Gist options
  • Save Philonous/135480d9016a9b51568a1495dacdf63f to your computer and use it in GitHub Desktop.
Save Philonous/135480d9016a9b51568a1495dacdf63f to your computer and use it in GitHub Desktop.
toARec core
-- RHS size: {terms: 73, types: 246, coercions: 177, joins: 2/2}
go
:: forall (ts' :: [(Symbol, *)]).
([Any] -> [Any])
-> Rec ElField ts'
-> ARec
ElField
'[ '("a0", Int), '("a1", Int), '("a2", Int), '("a3", Int),
'("a4", Int), '("a5", Int), '("a6", Int), '("a7", Int),
'("a8", Int), '("a9", Int), '("a10", Int), '("a11", Int),
'("a12", Int), '("a13", Int), '("a14", Int), '("a15", Int)]
go
= \ (@ (ts' :: [(Symbol, *)]))
(acc :: [Any] -> [Any])
(ds :: Rec ElField ts') ->
case ds of {
RNil co ->
case runRW#
(\ (s1# :: State# RealWorld) ->
case newArray# 16# arrEleBottom s1# of { (# ipv, ipv1 #) ->
join {
$j :: State# RealWorld -> (# State# RealWorld, Array Int Any #)
$j (wild4
:: State# RealWorld
Unf=OtherCon [])
= case unsafeFreezeArray# ipv1 wild4 of { (# ipv2, ipv3 #) ->
(# ipv2, Array mkARec5 mkARec4 16# ipv3 #)
} } in
joinrec {
go1
:: [Any]
-> Int#
-> State# RealWorld
-> (# State# RealWorld, Array Int Any #)
go1 (ds2 :: [Any]) (eta :: Int#) (eta1 :: State# RealWorld)
= case ds2 of {
[] -> jump $j eta1;
: y ys ->
case writeArray# ipv1 eta y eta1 of s4# { __DEFAULT ->
case eta of wild2 {
__DEFAULT -> jump go1 ys (+# wild2 1#) s4#;
15# -> jump $j s4#
}
}
}; } in
jump go1 (acc []) 0# ipv
})
of
{ (# ipv, ipv1 #) ->
ipv1 `cast` <Co:170>
};
:& @ r @ rs co x xs ->
go (\ (x1 :: [Any]) -> acc (: (x `cast` <Co:7>) x1)) xs
}
end Rec }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment