This commit is contained in:
+3
-7
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user