GithubHelp home page GithubHelp logo

emonad's Introduction

Emonad

1 Description

Emonad is a text editor that is similar to emacs, but written in Haskell. The frontend will be text only. The editor logic will be completely pure reducing bugs and complications. This will be an interesting design approach to text editors since most text editors, including emacs, are written with lots of mutable state. While emacs has elisp at its core, emonad will have Haskell at its core. Config files will be written in Haskell.

2 Architecture

2.1 Rope

This is the data structure that holds the text of the buffer. We extended the rope library with a few extra functions that make it easier to use.

  • log time insertion and deletion
  • constant time length

2.2 Buffer

This is the data structure that deals with the buffer

  • Move the mark and point
  • Manipulate text
  • Save to a file
  • Load from a file
  • Paging

2.3 BufferList

This is the module that deals with the collection of buffers.

  • Add new buffers
  • Kill buffer
  • Switch between buffers
  • Transform the current buffer

2.4 Editor

This is the current state of the editor. It knows about the buffer list, the context of key presses, the minibuffer, and the terminal

  • Deals with user input
  • Switches between buffer and minibuffer
  • Reads user input (IO)
  • Sets the text in the minibuffer

2.5 UI

This is the code that draws the editor in the terminal

  • Primarily uses the vty library
  • Uses combinators to layout the page

3 Additional Libraries

3.1 Rope

This is the efficient data structure that we use to store text

3.2 Vty

Terminal interaction library

3.3 mtl

Monads!!!

3.4 directory

Library that deals with the filesystem

3.5 HUnit

Unit testing

3.6 QuickCheck

Property based testing

4 Controls

  • C-x C-f: Find file
  • C-x C-s: Save buffer to file
  • C-x b: Switch to buffer by name
  • C-x k: Kill buffer by name
  • C-a: Beginning of line
  • C-e: End of line
  • C-f: Move forward
  • C-b: Move Backward
  • C-n: Move to next line
  • C-p: Move to previous line
  • C-space: Set the mark
  • C-x C-x: Swap the point and mark
  • C-d: Delete
  • C-g: Exit command or minibuffer

5 Installation instructions

cabal configure
cabal install

emonad's People

Contributors

awbraunstein avatar rafekettler avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.