Skip to content

Commit cbeb8b9

Browse files
authored
Add Reflection.TypeChecking.Format.errorPartFmt (#1307)
1 parent 9b6c36b commit cbeb8b9

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ Other major changes
3535
Other minor additions
3636
---------------------
3737

38+
* Added `Reflection.TypeChecking.Format.errorPartFmt`.
39+
3840
* Added new records to `Algebra.Bundles`:
3941
```agda
4042
RawNearSemiring c ℓ : Set (suc (c ⊔ ℓ))

src/Reflection/TypeChecking/Format.agda

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,7 @@ typeErrorFmt fmt = mapPrintf (lexer fmt) (typeError ∘ concat) (printf fmt)
7979

8080
debugPrintFmt : String (fmt : String) Printf (lexer fmt) (TC ⊤)
8181
debugPrintFmt tag lvl fmt = mapPrintf (lexer fmt) (debugPrint tag lvl ∘ concat) (printf fmt)
82+
83+
-- Combine with "%e" format for nested format calls.
84+
errorPartFmt : (fmt : String) Printf (lexer fmt) (List ErrorPart)
85+
errorPartFmt fmt = mapPrintf (lexer fmt) concat (printf fmt)

src/Reflection/TypeChecking/Monad.agda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ open Builtin public
3333
renaming (returnTC to return)
3434

3535
open Format public
36-
using (typeErrorFmt; debugPrintFmt)
36+
using (typeErrorFmt; debugPrintFmt; errorPartFmt)
3737

3838
------------------------------------------------------------------------
3939
-- Utility functions

0 commit comments

Comments
 (0)