mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-25 20:51:43 +03:00
[ docs ] Update Control.App docs
This commit is contained in:
parent
17cdc7fa88
commit
ca071a96c3
@ -50,7 +50,7 @@ use ``PrimIO`` in the initial list of errors ``Init``.
|
||||
|
||||
.. code-block:: idris
|
||||
|
||||
HasErr Void e => PrimIO e where ...
|
||||
HasErr AppHasIO e => PrimIO e where ...
|
||||
|
||||
Given this, we can implement ``Console`` and run our ``hello``
|
||||
program in ``IO``. It is implemented as follows in ``Control.App.Console``:
|
||||
|
@ -95,7 +95,7 @@ synonym for ``Type``):
|
||||
.. code-block:: idris
|
||||
|
||||
Init : List Error
|
||||
Init = [Void]
|
||||
Init = [AppHasIO]
|
||||
|
||||
run : App {l} Init a -> IO a
|
||||
|
||||
@ -103,5 +103,5 @@ Generalising the ``Path`` parameter with ``l``
|
||||
means that we can invoke ``run`` for any application, whether the ``Path``
|
||||
is ``NoThrow`` or ``MayThrow``. But, in practice, all applications
|
||||
given to ``run`` will not throw at the top level, because the only
|
||||
exception type available is the empty type ``Void``. Any exceptions
|
||||
exception type available is the type ``AppHasIO``. Any exceptions
|
||||
will have been introduced and handled inside the ``App``.
|
||||
|
Loading…
Reference in New Issue
Block a user