[doc] Interface constructors

This commit is contained in:
Ruslan Feizerakhmanov 2021-05-08 11:36:12 +03:00
parent 5993233057
commit 51184c156d

View File

@ -721,6 +721,25 @@ do this with a ``using`` clause in the implementation as follows:
The ``using PlusNatSemi`` clause indicates that ``PlusNatMonoid`` should
extend ``PlusNatSemi`` specifically.
.. _InterfaceConstructors:
Interface Constructors
======================
Interfaces, just like records, can be declared with a user-defined constructor.
.. code-block:: idris
interface A a where
getA : a
interface A t => B t where
constructor MkB
getB : t
Then ``MkB : A t => t -> B t``.
.. _DeterminingParameters:
Determining Parameters