From 23fcb09d934bf77fe58f232d2c246a81fc76591f Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Fri, 16 Nov 2018 13:24:54 +0000 Subject: [Typeclasses] Warn when RHS of `:>` is not a class This introduces the warning “not-a-class” in the “typeclasses” category. --- doc/sphinx/addendum/type-classes.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc/sphinx') diff --git a/doc/sphinx/addendum/type-classes.rst b/doc/sphinx/addendum/type-classes.rst index 15a55d9e72..882798205b 100644 --- a/doc/sphinx/addendum/type-classes.rst +++ b/doc/sphinx/addendum/type-classes.rst @@ -260,6 +260,12 @@ preorder can be used instead. This is very similar to the coercion mechanism of ``Structure`` declarations. The implementation simply declares each projection as an instance. +.. warn:: Ignored instance declaration for “@ident”: “@term” is not a class + + Using this ``:>`` syntax with a right-hand-side that is not itself a Class + has no effect (apart from emitting this warning). In particular, is does not + declare a coercion. + One can also declare existing objects or structure projections using the Existing Instance command to achieve the same effect. -- cgit v1.2.3