mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-09-21 02:07:25 +03:00
[doc] Interface constructors
This commit is contained in:
parent
5993233057
commit
51184c156d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user