summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-api
diff options
context:
space:
mode:
authorAndrei Barbu <andrei@0xab.com>2021-08-25 03:20:51 -0400
committerAndrei Barbu <andrei@0xab.com>2021-10-08 19:45:29 -0400
commita76409c758d8c7bd837dcc6c0b58f8cce656b4f1 (patch)
tree95dde306e370fe296ef84efa959828e8ecdd1267 /testsuite/tests/ghc-api
parent55a6377a5d55d6e6e93cf3d087f1e2d17fe7d3f3 (diff)
downloadhaskell-a76409c758d8c7bd837dcc6c0b58f8cce656b4f1.tar.gz
Add defaulting plugins.
Like the built-in type defaulting rules these plugins can propose candidates to resolve ambiguous type variables. Machine learning and other large APIs like those for game engines introduce new numeric types and other complex typed APIs. The built-in defaulting mechanism isn't powerful enough to resolve ambiguous types in these cases forcing users to specify minutia that they might not even know how to do. There is an example defaulting plugin linked in the documentation. Applications include defaulting the device a computation executes on, if a gradient should be computed for a tensor, or the size of a tensor. See https://github.com/ghc-proposals/ghc-proposals/pull/396 for details.
Diffstat (limited to 'testsuite/tests/ghc-api')
-rw-r--r--testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr4
1 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr b/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr
index 2487a3da5b..b8fcd66a02 100644
--- a/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr
+++ b/testsuite/tests/ghc-api/apirecomp001/apirecomp001.stderr
@@ -4,7 +4,7 @@ B.hs:4:1: warning: [-Wmissing-signatures (in -Wall)]
answer_to_live_the_universe_and_everything :: Int
B.hs:5:13: warning: [-Wtype-defaults (in -Wall)]
- • Defaulting the following constraints to type ‘Integer’
+ • Defaulting the type variable ‘a0’ to type ‘Integer’ in the following constraints
(Num a0) arising from the literal ‘1’ at B.hs:5:13
(Enum a0)
arising from the arithmetic sequence ‘1 .. 23 * 2’ at B.hs:5:12-20
@@ -20,7 +20,7 @@ B.hs:4:1: warning: [-Wmissing-signatures (in -Wall)]
answer_to_live_the_universe_and_everything :: Int
B.hs:5:13: warning: [-Wtype-defaults (in -Wall)]
- • Defaulting the following constraints to type ‘Integer’
+ • Defaulting the type variable ‘a0’ to type ‘Integer’ in the following constraints
(Num a0) arising from the literal ‘1’ at B.hs:5:13
(Enum a0)
arising from the arithmetic sequence ‘1 .. 23 * 2’ at B.hs:5:12-20