agda / agda

Agda is a dependently typed programming language / interactive theorem prover.
https://wiki.portal.chalmers.se/agda/pmwiki.php
Other
2.4k stars 339 forks source link

Named errors instead of Generic[Doc]Error #7225

Open andreasabel opened 2 months ago

andreasabel commented 2 months ago

We have currently short of 250 places where we throw a GenericError or GenericDocError.

/src/full/Agda$ 
grep -R '[^_][gG]eneric\(Doc\)\?[eE]rror' --include="*.hs" \
  --exclude=./TypeChecking/Monad/Base.hs --exclude=./TypeChecking/Errors.hs \
  | wc
     247    2584   25145

The mid-term plan is to replace these by properly named errors. The name of the error can then be printed as part of the error message. Expected benefits:

Steps to implement:

The current list of occurrences is (2024-04-15):

/src/full/Agda[issue-7181]$ 
grep -Rc '[^_][gG]eneric\(Doc\)\?[eE]rror' --include="*.hs" \
  --exclude=./TypeChecking/Monad/Base.hs --exclude=./TypeChecking/Errors.hs \
  | grep -v ':0' | sort

Suggested prioritization:

  1. type checker
  2. scope checker
  3. interaction
  4. compiler