@@ -361,61 +361,40 @@ instance MetaSubst Int (Synthesized (LHsExpr GhcPs)) where
361
361
------------------------------------------------------------------------------
362
362
-- | Reasons a tactic might fail.
363
363
data TacticError
364
- = UndefinedHypothesis OccName
364
+ = OutOfGas
365
365
| GoalMismatch String CType
366
- | UnsolvedSubgoals [Judgement ]
367
- | UnificationError CType CType
368
366
| NoProgress
369
367
| NoApplicableTactic
370
- | IncorrectDataCon DataCon
371
- | RecursionOnWrongParam OccName Int OccName
372
368
| UnhelpfulRecursion
373
369
| UnhelpfulDestruct OccName
374
- | UnhelpfulSplit OccName
375
370
| TooPolymorphic
376
371
| NotInScope OccName
377
372
| TacticPanic String
373
+ deriving (Eq )
378
374
379
375
instance Show TacticError where
380
- show (UndefinedHypothesis name) =
381
- occNameString name <> " is not available in the hypothesis."
376
+ show OutOfGas = " Auto ran out of gas"
382
377
show (GoalMismatch tac (CType typ)) =
383
378
mconcat
384
379
[ " The tactic "
385
380
, tac
386
381
, " doesn't apply to goal type "
387
382
, unsafeRender typ
388
383
]
389
- show (UnsolvedSubgoals _) =
390
- " There were unsolved subgoals"
391
- show (UnificationError (CType t1) (CType t2)) =
392
- mconcat
393
- [ " Could not unify "
394
- , unsafeRender t1
395
- , " and "
396
- , unsafeRender t2
397
- ]
398
384
show NoProgress =
399
385
" Unable to make progress"
400
386
show NoApplicableTactic =
401
387
" No tactic could be applied"
402
- show (IncorrectDataCon dcon) =
403
- " Data con doesn't align with goal type (" <> unsafeRender dcon <> " )"
404
- show (RecursionOnWrongParam call p arg) =
405
- " Recursion on wrong param (" <> show call <> " ) on arg"
406
- <> show p <> " : " <> show arg
407
388
show UnhelpfulRecursion =
408
389
" Recursion wasn't productive"
409
390
show (UnhelpfulDestruct n) =
410
391
" Destructing patval " <> show n <> " leads to no new types"
411
- show (UnhelpfulSplit n) =
412
- " Splitting constructor " <> show n <> " leads to no new goals"
413
392
show TooPolymorphic =
414
393
" The tactic isn't applicable because the goal is too polymorphic"
415
394
show (NotInScope name) =
416
395
" Tried to do something with the out of scope name " <> show name
417
396
show (TacticPanic err) =
418
- " PANIC : " <> err
397
+ " Tactic panic : " <> err
419
398
420
399
421
400
------------------------------------------------------------------------------
@@ -560,16 +539,18 @@ data AgdaMatch = AgdaMatch
560
539
561
540
562
541
data UserFacingMessage
563
- = TacticErrors
542
+ = NotEnoughGas
543
+ | TacticErrors
564
544
| TimedOut
565
545
| NothingToDo
566
546
| InfrastructureError Text
567
547
deriving Eq
568
548
569
549
instance Show UserFacingMessage where
570
- show TacticErrors = " Wingman couldn't find a solution"
571
- show TimedOut = " Wingman timed out while trying to find a solution"
572
- show NothingToDo = " Nothing to do"
550
+ show NotEnoughGas = " Wingman ran out of gas when trying to find a solution. \n Try increasing the `auto_gas` setting."
551
+ show TacticErrors = " Wingman couldn't find a solution"
552
+ show TimedOut = " Wingman timed out while trying to find a solution"
553
+ show NothingToDo = " Nothing to do"
573
554
show (InfrastructureError t) = " Internal error: " <> T. unpack t
574
555
575
556
0 commit comments