Skip to content

Commit

Permalink
[ instance ] some useful verbose output for debugging instance argume…
Browse files Browse the repository at this point in the history
…nt search
  • Loading branch information
UlfNorell committed Oct 28, 2015
1 parent edaf9a2 commit 19867e8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/full/Agda/TypeChecking/InstanceArguments.hs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,16 @@ dropSameCandidates m cands = do
-- @checkCandidates m t cands@ returns a refined list of valid candidates.
checkCandidates :: MetaId -> Type -> [Candidate] -> TCM [Candidate]
checkCandidates m t cands = disableDestructiveUpdate $ do
filterResetingState m cands (checkCandidateForMeta m t)
verboseBracket "tc.instance.candidates" 20 ("checkCandidates " ++ prettyShow m) $ do
reportSDoc "tc.instance.candidates" 20 $ nest 2 $ text "target:" <+> prettyTCM t
reportSDoc "tc.instance.candidates" 20 $ nest 2 $ vcat
[ text "candidates"
, vcat [ text "-" <+> prettyTCM v <+> text ":" <+> prettyTCM t | Candidate v t _ <- cands ] ]
cands' <- filterResetingState m cands (checkCandidateForMeta m t)
reportSDoc "tc.instance.candidates" 20 $ nest 2 $ vcat
[ text "valid candidates"
, vcat [ text "-" <+> prettyTCM v <+> text ":" <+> prettyTCM t | Candidate v t _ <- cands' ] ]
return cands'
where
checkCandidateForMeta :: MetaId -> Type -> Candidate -> TCM Bool
checkCandidateForMeta m t (Candidate term t' eti) = do
Expand Down

0 comments on commit 19867e8

Please sign in to comment.