From a7640310689726a7aaed8ae8a0ed1e5ccb3ace6e Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Sat, 8 Nov 2008 16:00:29 +0000 Subject: [PATCH] Added the support for glossing over pattern-match failures --- checks/CheckFramework.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/checks/CheckFramework.hs b/checks/CheckFramework.hs index c265287..9aee6e9 100644 --- a/checks/CheckFramework.hs +++ b/checks/CheckFramework.hs @@ -148,11 +148,14 @@ forAnyAST origF = CheckOptM $ do apply :: TypeSet -> (a -> RestartT A.AST a CheckOptM ()) -> (a, Route a A.AST) -> RestartT A.AST a CheckOptM a apply typeSet f (x, route) - = (RestartT $ ((local (const route) $ getRestartT (f x)))) + = (RestartT $ (local (const route) $ getRestartT (wrap f x))) >> (liftRestartT (CheckOptM get) >>* ast >>* routeGet route) >>= gmapMForRoute typeSet (extTransformRoute baseTransformRoute $ \(y, route') -> apply typeSet f (y, route @-> route')) + wrap :: (a -> RestartT A.AST a CheckOptM ()) -> (a -> RestartT A.AST a CheckOptM + ()) + wrap f x = join (liftIO $ onlyIfPatternMatch (return ()) f x) -- | For both of these functions I'm going to need to mark all analyses as no longer -- valid, but more difficult will be to maintain the current position (if possible