3import Language.Reflection
4import Language.Reflection.Errors
5import Language.Reflection.Utils
7%language ErrorReflection
11 -> {auto cons1 : NonEmpty xs}
12 -> {auto cons2 : NonEmpty (tail xs)}
14cadr (x :: (y :: _)) {cons1=IsNonEmpty} {cons2=IsNonEmpty} = y
15cadr (x :: []) {cons1=IsNonEmpty} {cons2=IsNonEmpty} impossible
16cadr [] {cons1=IsNonEmpty} {cons2=IsNonEmpty} impossible
18extractList : TT -> Maybe TT
19extractList (App (App neType _) lst) = Just lst
20extractList t = Just t -- Nothing
23has2elts : Err -> Maybe (List ErrorReportPart)
24has2elts (CantSolveGoal tm _) = do lst <- extractList tm
25 return [ TextPart "Could not prove that"
27 , TextPart "has at least two elements."
29has2elts e = Just [TextPart (show e)]
31%error_handlers cadr cons1 has2elts
32%error_handlers cadr cons2 has2elts
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list