@@ -14,36 +14,20 @@ cadr : (xs : List a)
14cadr (x :: (y :: _)) {cons1=refl} {cons2=refl} = y
14cadr (x :: (y :: _)) {cons1=refl} {cons2=refl} = y
15cadr (x :: []) {cons1=refl} {cons2=refl} impossible
15cadr (x :: []) {cons1=refl} {cons2=refl} impossible
17−total
17+extractList : TT -> Maybe TT
18−eltsErr : TT -> TT -> Maybe (List ErrorReportPart)
18+extractList (App (App reflCon (App isCons lst)) _) = Just lst
19−eltsErr (P (DCon _ _) (NS (UN "False") _) _) (P (DCon _ _) (NS (UN "True") _) _) =
20− Just [ NamePart (NS (UN "cadr") ["FunErrTest"])
21− , TextPart "requires that its argument contain at least two elements."
23−eltsErr (P (DCon _ _) (NS (UN "True") _) _) (App (App isCons ty) xs) =
24− Just [ NamePart (NS (UN "cadr") ["FunErrTest"])
25− , TextPart "requires that its argument contain at least two elements."
26− , TextPart "This fails because: "
27− , SubReport [ TextPart "There is no proof that"
29− , TextPart "is non-empty."
32−eltsErr _ _ = Nothing
19+extractList _ = Nothing
35has2elts : Err -> Maybe (List ErrorReportPart)
23has2elts : Err -> Maybe (List ErrorReportPart)
36−has2elts (CantUnify _ tm1 tm2 e _ _) = eltsErr tm1 tm2 <|> has2elts e
24+has2elts (CantSolveGoal tm _) = do lst <- extractList tm
25+ return [ TextPart "Could not prove that"
27+ , TextPart "has at least two elements."
37has2elts e = Just [TextPart (show e)]
29has2elts e = Just [TextPart (show e)]
39%error_handlers cadr cons1 has2elts
31%error_handlers cadr cons1 has2elts
40%error_handlers cadr cons2 has2elts
32%error_handlers cadr cons2 has2elts
42−problem1 : List a -> a