Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Oct 25, 2022
1 parent bad81e3 commit af658b2
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/Juvix/Compiler/Core/Extra/Base.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ mkConstr i tag args = NCtr (Constr i tag args)
mkConstr' :: Tag -> [Node] -> Node
mkConstr' = mkConstr Info.empty

-- TODO remove
mkLambdaOld :: Info -> Node -> Node
mkLambdaOld i b = NLam (Lambda i emptyBinder b)

mkLambda :: Info -> Binder -> Node -> Node
mkLambda i bi b = NLam (Lambda i bi b)

Expand Down Expand Up @@ -215,27 +211,22 @@ unfoldApps = go []
unfoldApps' :: Node -> (Node, [Node])
unfoldApps' = second (map snd) . unfoldApps

mkLambdas :: [Info] -> Node -> Node
mkLambdas is n = foldl' (flip mkLambdaOld) n (reverse is)

reLambda :: LambdaLhs -> Node -> Node
reLambda lhs = mkLambda (lhs ^. lambdaLhsInfo) (lhs ^. lambdaLhsBinder)

reLambdas :: [LambdaLhs] -> Node -> Node
reLambdas is n = foldl' (flip reLambda) n (reverse is)

-- | the given info corresponds to the binder info
mkLambdaB :: Binder -> Node -> Node
mkLambdaB = mkLambda mempty

-- | the given infos correspond to the binder infos
mkLambdasB :: [Binder] -> Node -> Node
mkLambdasB is n = foldl' (flip mkLambdaB) n (reverse is)

mkLambdas' :: Int -> Node -> Node
mkLambdas' k
| k < 0 = impossible
| otherwise = mkLambdas (replicate k Info.empty)
| otherwise = mkLambdasB (replicate k emptyBinder)

unfoldLambdasRev :: Node -> ([LambdaLhs], Node)
unfoldLambdasRev = go []
Expand Down

0 comments on commit af658b2

Please sign in to comment.