@@ -524,12 +524,13 @@ infer' (Accessor prop val) = do
524524 _ <- subsumes Nothing objTy (Object (RCons prop field rest))
525525 return $ TypedValue True (Accessor prop typed) field
526526 Just ty -> return $ TypedValue True (Accessor prop typed) ty
527−infer' (Abs arg ret) = do
527+infer' (Abs (Left arg) ret) = do
528528 ty <- fresh
529529 Just moduleName <- checkCurrentModule <$> get
530530 bindLocalVariables moduleName [(arg, ty)] $ do
531531 body@(TypedValue _ _ bodyTy) <- infer' ret
532− return $ TypedValue True (Abs arg body) $ function ty bodyTy
532+ return $ TypedValue True (Abs (Left arg) body) $ function ty bodyTy
533+infer' (Abs (Right _) _) = error "Binder was not desugared"
533534infer' (App f arg) = do
534535 f'@(TypedValue _ _ ft) <- infer f
535536 (ret, app) <- checkFunctionApplication f' ft arg
@@ -728,7 +729,7 @@ check' val t@(ConstrainedType constraints ty) = do
728729 TypeClassDictionaryInScope name className instanceTy Nothing TCDRegular) (map (Qualified Nothing) dictNames)
729730 (qualifyAllUnqualifiedNames moduleName env constraints)) $
730731 check val ty
731− return $ TypedValue True (foldr Abs val' dictNames) t
732+ return $ TypedValue True (foldr Abs val' (map Left dictNames)) t
732733check' val t@(SaturatedTypeSynonym name args) = do
733734 ty <- introduceSkolemScope <=< expandTypeSynonym name $ args
734735 val' <- check val ty
@@ -748,10 +749,11 @@ check' v@(BooleanLiteral _) t | t == tyBoolean =
748749check' (ArrayLiteral vals) t@(TypeApp a ty) | a == tyArray = do
749750 arr <- ArrayLiteral <$> forM vals (\val -> check val ty)
750751 return $ TypedValue True arr t
751−check' (Abs arg ret) ty@(TypeApp (TypeApp t argTy) retTy) | t == tyFunction = do
752+check' (Abs (Left arg) ret) ty@(TypeApp (TypeApp t argTy) retTy) | t == tyFunction = do
752753 Just moduleName <- checkCurrentModule <$> get
753754 ret' <- bindLocalVariables moduleName [(arg, argTy)] $ check ret retTy
754− return $ TypedValue True (Abs arg ret') ty
755+ return $ TypedValue True (Abs (Left arg) ret') ty
756+check' (Abs (Right _) _) _ = error "Binder was not desugared"
755757check' (App f arg) ret = do
756758 f'@(TypedValue _ _ ft) <- infer f
757759 (ret', app) <- checkFunctionApplication f' ft arg