This commit is contained in:
2026-05-07 07:31:33 -06:00
parent 720a3da8c4
commit 980fbbb033
2 changed files with 12 additions and 10 deletions
+3 -7
View File
@@ -74,13 +74,9 @@ instance SexpIso Exp where
Position (Sexp :- t) (Exp :- List Val :- Val :- Text :- t)
letapp = Lam.letIso symbol (sexpIso @(NonEmpty Val)) (sexpIso @Exp)
>>> IG.Iso bluh hulb
bluh (e :- ((r,f:|xs):bs) :- t) =
bluh (e :- ((r,f:|xs):|bs) :- t) =
foldr (\(v,g:|ys) -> ExpLetApply v g ys) e bs :- xs :- f :- r :- t
bluh _ = error "empty let lol"
hulb :: (Exp :- ([Val] :- (Val :- (Text :- t))))
-> Exp :- ([(Name, NonEmpty Val)] :- t)
hulb (e :- xs :- f :- r :- t) = e' :- ((r,f:|xs):bs) :- t
-- hulb (e :- xs :- f :- r :- t) = ExpLetApply r f xs e' :- bs :- t
hulb (e :- xs :- f :- r :- t) = e' :- ((r,f:|xs):|bs) :- t
where
-- (bs,e') = ([],e)
(bs,e') = collapseBindings #ExpLetApply _4 e
@@ -219,7 +215,7 @@ lower'
lower' (ExpVal v) k = lowerVal v k
lower' (ExpLetApply r f xs e) k =
blah (lowerVal @es <$> (f:|xs)) \(f':xs') -> do
telescope (lowerVal @es <$> (f:|xs)) \(f':|xs') -> do
Emit [ QBE.Call
(Just (lowerName r, QBE.AbiBaseTy QBE.Long))
f'