https://github.com/noughtmare/jak
Simple frp text editor for testing and learning purposes.
https://github.com/noughtmare/jak
frp haskell text-editor yampa
Last synced: 6 months ago
JSON representation
Simple frp text editor for testing and learning purposes.
- Host: GitHub
- URL: https://github.com/noughtmare/jak
- Owner: noughtmare
- License: agpl-3.0
- Created: 2018-01-07T14:29:36.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-10-10T14:18:38.000Z (about 5 years ago)
- Last Synced: 2025-03-26T11:05:42.163Z (7 months ago)
- Topics: frp, haskell, text-editor, yampa
- Language: Haskell
- Homepage:
- Size: 59.6 KB
- Stars: 7
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README

Simple frp text editor for testing and learning purposes.
## Status
The text editor can currently edit and show text.
Planned features are (in order of importance):
- [x] Can edit text.
- [x] Has a viewport.
- [ ] Supports line wrapping.
- [ ] Can read and write files.Long term goals:
- [ ] Supports the Language Server Protocol (using [haskell-lsp-client](https://github.com/noughtmare/haskell-lsp-client)).
- [ ] Has vim keybindings.
- [ ] Has a browser frontend (this is the reason for the AGPL license).## Design decisions
Feel free to contact me (for example by opening an issue here) if you would
like to have any other design decisions explained.### Yampa
I chose to use frpnow mainly because it promises an efficient implementation
and it doesn't have many extraneous features which I probably won't need and
will only get in the way of learning how to use it.The main alternatives for me would be Yampa, but I didn't want to learn how
to use the arrow interface. Or maybe reflex when I'm more comfortable with
FRP.#### UPDATE 2019-08-08:
I have now learned how to use the arrow interface, it is not too hard. I think
that the new Yampa implementation is much nicer than the previous frpnow
implementation.### Type safety
I am using explicit data types for each different type of integer. I hope
this will prevent most mistakes that can happen.The main disadvantage of this is that conversions between the types need
to be explicitely specified by the programmer, but I personally really
like it when all the types logically fit together.### Modularity
I have decided to split the viewport, cursor and content. This should
improve the readability and modularity of the code. A disadvantage is
that some internal information is lost so some functions may have
worse performance, but it shouldn't influence the worst case time
complexity.When implementing this I really noticed that the code became much more
readable.