-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add some (short, incomplete) notes on design
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Design | ||
|
||
The API that Doodle presents to the user should be compositional and easy to reason about. | ||
There are fundamental ideas in functional programming. | ||
Internally, the implementation may be a stateful program, as the majority of graphics library are implemented in a stateful way. | ||
|
||
|
||
## Conveniences | ||
|
||
We provide convenience operations for common operations. | ||
For example, we can just `draw` a `Picture` without providing a `Canvas` or `Frame`, or having to deal with `IO`. | ||
|
||
Conveniences that run `IO` should be implemented as syntax. | ||
Other conveniences should generally be implemented as methods on algebras, | ||
implemented in terms of more basic methods on the algebra. | ||
(Note that the current system is very mixed on whether this is followed or not.) | ||
|
||
The default operations, provided as syntax, generally do not expose `IO`. | ||
Altneratives that do expose `IO` are suffixed `toIO`. | ||
So, for example, `draw` is the default operation to render a `Picture` and does not expose an `IO`. | ||
The syntax that does is called `drawToIO`. |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
laika.navigationOrder = [ | ||
README.md | ||
design.md | ||
process.md | ||
syntax.md | ||
backend.md | ||
|