@@ -227,9 +227,15 @@ elabClauses info fc opts n_in cs = let n = liftname info n_in in
227227 pcover <-
228228 if cov
229229 then do missing <- genClauses fc n (map fst pdef) cs
230− poss <- mapM (checkPossible info fc True n) missing
231− let missing' = mapMaybe id poss
232− logLvl 3 $ "Must be unreachable: " ++ show missing' ++ " from " ++ show missing
230+ missing' <- filterM (checkPossible info fc True n) missing
231+-- let missing' = mapMaybe (\x -> case x of
232+-- Nothing -> Nothing
233+-- Just t -> Just $ delab ist t)
234+-- poss
235+ logLvl 3 $ "Must be unreachable:\n" ++
236+ showSep "\n" (map (showImp True) missing') ++
237+ "\nAgainst: " ++
238+ showSep "\n" (map (\t -> showImp True (delab ist t)) (map fst pdef))
233239 if null missing'
234240 then return True
235241 else return False
@@ -319,7 +325,7 @@ elabVal info aspat tm_in
319325-- checks if the clause is a possible left hand side. Returns the term if
320326-- possible, otherwise Nothing.
321327
322−checkPossible :: ElabInfo -> FC -> Bool -> Name -> PTerm -> Idris (Maybe Term)
328+checkPossible :: ElabInfo -> FC -> Bool -> Name -> PTerm -> Idris Bool
323329checkPossible info fc tcgen fname lhs_in
324330 = do ctxt <- getContext
325331 i <- get
@@ -330,16 +336,16 @@ checkPossible info fc tcgen fname lhs_in
330336 OK ((lhs', _, _), _) ->
331337 do let lhs_tm = orderPats (getInferTerm lhs')
332338 b <- inferredDiff fc (delab' i lhs_tm True) lhs
333− if not b then return (Just lhs_tm) else return Nothing
339+ return (not b) -- then return (Just lhs_tm) else return Nothing
334340-- trace (show (delab' i lhs_tm True) ++ "\n" ++ show lhs) $ return (not b)
335− Error _ -> return Nothing
341+ Error _ -> return False
336342
337343elabClause :: ElabInfo -> FC -> Bool -> PClause -> Idris (Maybe (Term, Term))
338344elabClause info fc tcgen (PClause fname lhs_in [] PImpossible [])
339345 = do b <- checkPossible info fc tcgen fname lhs_in
340346 case b of
341− Just _ -> fail $ show fc ++ ":" ++ show lhs_in ++ " is a possible case"
342− Nothing -> return Nothing
347+ True -> fail $ show fc ++ ":" ++ show lhs_in ++ " is a possible case"
348+ False -> return Nothing
343349elabClause info fc tcgen (PClause fname lhs_in withs rhs_in whereblock)
344350 = do ctxt <- getContext
345351 -- Build the LHS as an "Infer", and pull out its type and