-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2027 from david-christiansen/issue/2019
Better documentation display for instances
- Loading branch information
Showing
7 changed files
with
112 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module docs003 | ||
|
||
instance [mine] Functor List where | ||
map m [] = [] | ||
map m (x :: xs) = m x :: map m xs | ||
|
||
||| More functors! | ||
instance [another] Functor List where | ||
map f xs = map @{mine} f xs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Type checking ./docs003.idr | ||
Type class Functor | ||
Functors | ||
|
||
Parameters: | ||
f -- the action of the functor on objects | ||
|
||
Methods: | ||
map : Functor f => (m : a -> b) -> f a -> f b | ||
The action of the functor on morphisms | ||
|
||
Instances: | ||
Functor List | ||
Functor Stream | ||
Functor Provider | ||
Functor Binder | ||
Functor PrimIO | ||
Functor (IO' ffi) | ||
Functor Maybe | ||
Functor (Either e) | ||
|
||
Named instances: | ||
docs003.mine : Functor List | ||
docs003.another : Functor List | ||
More functors! | ||
|
||
Subclasses: | ||
Traversable f | ||
Applicative f | ||
Named instance: | ||
mine : Functor List | ||
|
||
|
||
Named instance: | ||
another : Functor List | ||
More functors! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
:doc Functor | ||
:doc mine | ||
:doc another |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
idris --consolewidth 80 --quiet --nocolor docs003.idr < input | ||
rm *.ibc |