From e116bc7adc8f9c0e219e1b7c399e265f8f1e23ad Mon Sep 17 00:00:00 2001 From: Kosyrev Serge Date: Mon, 1 Jul 2019 04:15:49 +0300 Subject: [PATCH] MFP compat: s/fail/error/ in compileStmt --- src/LambdaCube/Compiler/Statements.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/LambdaCube/Compiler/Statements.hs b/src/LambdaCube/Compiler/Statements.hs index 1755b57e..1679ad77 100644 --- a/src/LambdaCube/Compiler/Statements.hs +++ b/src/LambdaCube/Compiler/Statements.hs @@ -112,12 +112,12 @@ compileStmt lhs compilegt ds = \case alts -> compileStmt lhs compileGuardTrees' [TypeAnn n t] alts fs@(FunAlt n vs _: _) -> case groupBy ((==) `on` fst) [(length vs, n) | FunAlt n vs _ <- fs] of [gs@((num, _): _)] - | num == 0 && length gs > 1 -> fail $ "redefined " ++ sName n ++ ":\n" ++ show (vcat $ pShow . sourceInfo . snd <$> gs) + | num == 0 && length gs > 1 -> error $ "redefined " ++ sName n ++ ":\n" ++ show (vcat $ pShow . sourceInfo . snd <$> gs) | n `elem` [n' | TypeFamily n' _ <- ds] -> return [] | otherwise -> do cf <- compilegt (SIName_ (mconcat [sourceInfo n | FunAlt n _ _ <- fs]) (nameFixity n) $ sName n) vs [gt | FunAlt _ _ gt <- fs] return [StLet n (listToMaybe [t | TypeAnn n' t <- ds, n' == n]{-TODO: fail if more-}) $ lhs n cf] - fs -> fail $ "different number of arguments of " ++ sName n ++ ":\n" ++ show (vcat $ pShow . sourceInfo . snd . head <$> fs) + fs -> error $ "different number of arguments of " ++ sName n ++ ":\n" ++ show (vcat $ pShow . sourceInfo . snd . head <$> fs) [Stmt x] -> return [x] where noTA x = ((Visible, Wildcard SType), x)