1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-14 08:27:03 +03:00

rename some functions

This commit is contained in:
Jan Mas Rovira 2022-03-29 15:18:17 +02:00
parent 53f66b09f2
commit 1c59cd1502

View File

@ -142,12 +142,12 @@ throwErr = throw
inferExpression' :: forall r. Members '[Reader InfoTable, Error Err, Reader LocalVars] r =>
Expression -> Sem r TypedExpression
inferExpression' e = case e of
ExpressionIden i -> checkIden i
ExpressionApplication a -> checkApplication a
ExpressionIden i -> inferIden i
ExpressionApplication a -> inferApplication a
ExpressionTyped {} -> impossible
where
checkIden :: Iden -> Sem r TypedExpression
checkIden i = case i of
inferIden :: Iden -> Sem r TypedExpression
inferIden i = case i of
IdenFunction fun -> do
info <- lookupFunction fun
return (TypedExpression (info ^. functionInfoType) (ExpressionIden i))
@ -157,8 +157,8 @@ inferExpression' e = case e of
IdenVar v -> do
ty <- lookupVar v
return (TypedExpression ty (ExpressionIden i))
checkApplication :: Application -> Sem r TypedExpression
checkApplication a = do
inferApplication :: Application -> Sem r TypedExpression
inferApplication a = do
l <- inferExpression' (a ^. appLeft)
fun <- getFunctionType (l ^. typedType)
r <- checkExpression (fun ^. funLeft) (a ^. appRight)