• Stars
    star
    612
  • Rank 73,287 (Top 2 %)
  • Language
    Haskell
  • License
    GNU General Publi...
  • Created about 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Extremely modular text editor built in Haskell

Rasa (Rah-zah)

Join the chat at https://gitter.im/rasa-editor/Lobby Hackage

Embarrassingly modular customizable text editor built in Haskell.

Rasa Editor

A Rasa editing session with multiple cursors & viewports.

Documentation

You can find hackage documentation for rasa and some extensions here:

What people are saying

Excessively Modular! - some bald guy

I'm glad I'm unemployed so I have time to configure it! - my mate Steve

You should go outside one of these days. - Mother

Getting started

Configuring Rasa

Rasa is designed to be easy to configure and script, both when adding extensions provided by the community, and when writing your own user-scripts.

Rasa is written in Haskell, and the configuration is done in the Haskell language, don't let that scare you though, you can script Rasa and add extensions without knowing much haskell!

Building Your First Extension

^ That guide will walk you through installation and getting running! Once you're running rasa you can experiment with creating your own adaptations. You should customize your keymap to add a few mappings you like. It's a short step from here to developing your own extensions. Actions like you'd use in an extension can be registered to listeners in your Main.hs. You can build and experiment with entire extensions in your config file and extract them as a package when you're ready, kind of like a vimrc file. Again, just read the extension guide, it covers what you need to know!

If you have any issues (and I'm sure there'll be a few; it's a new project!) please report them here.

Core Principles

Rasa is meant to be about as modular as an editor can be. The goal is for as much code as possible to be extracted into composable extensions. If the core editing facilities can't be implemented as extensions, then the extension interface isn't powerful enough. I've taken this to its extreme, for instance the following features are implemented as rasa extensions that anyone in the community could have written.

  • Loading and saving files
  • Key bindings
  • Listening for keyboard events
  • Multiple cursors
  • Rendering the editor to the terminal

This approach has some unique pros and cons:

Pros

  • Implementing most core functionality as extensions ensures a powerful and elegant extension interface.
  • Flexibility; don't like the default cursor implementation? Write your own!
  • Adaptability; the core of Rasa is miniscule, you can mix and match extensions to build any editor you want.

Cons

  • Module cross-dependencies makes the community infrastructure more fragile; We'll likely develop a solution to this as a community as time goes on.
  • Fragmentation; Not having a single implementation for a given feature means extensions that depend on a feature have to pick a specific implementation to augment. Over time data-structures and types will be standardized into Rasa's core to help alleviate this.

Core Features

As stated above, the editor itself focuses primarily on easy extensibility, so it doesn't have a lot of editing features built in, instead it focuses on standardizing a good extension API. We focus on creating a simple system so people can pick it up quickly.

Here are some features of that API:

Event Listener System

All actions in the editor are triggered via an event/listener system. Extensions may subscribe to events from the editor, or from another extension and perform an action in response. The Event which triggered the listener is available as an argument). Extensions may also dispatch any kind of event at any time which other extensions may listen for.

Actions/BufActions

Extensions define things that they'd like to do using a powerful set of functions which they can embed in an Action. Within an action an extension may perform IO, access the available buffers, store and access extension state, and edit text.

Running Tests

Run all tests:

  • stack test

Run only tests for core editor:

  • stack test rasa

Installation

At the moment you must build Rasa from source;

To provide reproducible builds, Rasa uses Stack & Nix.

  1. Install stack
  2. Install nix
  3. Clone this repo and cd into the directory
  4. Run stack build && stack exec rasa (you may want to alias this to rasa)

Installation without nix (not-recommended)

  1. Install stack
  2. Clone this repo and cd into the directory
  3. Run stack build --no-nix && stack exec rasa --no-nix (you may want to alias this to rasa)

Troubleshooting

If you have issues with nix; you may try running rasa without it with stack build --no-nix && stack exec rasa; You'll likely have to consider the following:

  • You may need to install icu4c (brew install icu4c), it's a dependency of the rope library rasa uses.
  • On linux, when the error message Missing C libraries: icuuc, icui18n, icudata appears, install libicu-dev (e.g. with sudo apt install libicu-dev).
  • You'll need to point to the icu4c lib in your stack.yaml wherever it's stored on your system. If you install using brew on your Mac, then you can add the following to your stack.yaml:
extra-lib-dirs:
- /usr/local/opt/icu4c/lib 
extra-include-dirs:
- /usr/local/opt/icu4c/include
  • Depending on which LTS you're on, you'll likely also have to add each rasa package you use to your stack.yaml as extra-deps, here's an example:
# in stack.yaml
extra-deps:
- rasa-0.1.0.0
- rasa-ext-cursors-0.1.0.0
- rasa-ext-logger-0.1.0.0
- rasa-ext-vim-0.1.0.0
- text-lens-0.1.0.0
- rasa-ext-files-0.1.0.0
- rasa-ext-cmd-0.1.0.0
- rasa-ext-slate-0.1.0.0
- vty-5.14

Contributing

Things are moving quickly, but I'd love a hand! You can get a rough idea of where you can help out at the Roadmap, feel free to leave a comment there asking any questions.

Chatting about features is a key part of Rasa's development; come join us in the Chat Room!

More Repositories

1

slick

Static site generator built on Shake configured in Haskell
Haskell
204
star
2

void-space

Well-Typed Typing Tutor where you Type Types... in space... yup, you heard me
Haskell
140
star
3

wc

Beating unix `wc` in Haskell
Haskell
136
star
4

lens-regex-pcre

Text lenses using PCRE regexes
Haskell
126
star
5

SitePipe

Yet another static site generator - non-opinionated, value-level. Less magic == easier to understand
Haskell
119
star
6

eve

An extensible event-driven application framework in haskell
Haskell
109
star
7

comonads-by-example

Comonads By Example Conference talk
Haskell
89
star
8

Firefly

Simple Haskell http framework
Haskell
87
star
9

json-to-haskell

In goes JSON, out comes a complete Haskell model complete with instances! CLI and web interface available.
Haskell
83
star
10

astar-monad

A smart A* search monad transformer which supports backtracking user-state!
Haskell
81
star
11

jet

A structural editor for JSON values
Haskell
78
star
12

Advent-Of-Code-Polyglot

Examples of "Advent Of Code" solutions in many programming languages.
Python
72
star
13

mad-props

Forward-propagating Constraint Solver monad. Good for solving Sudoku, N-Queens, etc.
Haskell
66
star
14

lens-csv

Lensy interface for parsing CSV's
Haskell
42
star
15

LumberJack

A terminal-ui log watcher written in Go using the Flux architecture
Go
38
star
16

conway

Conway's game of life in 100 lines or less!
Haskell
34
star
17

tempered

Templating engine based on shell interpolation
Haskell
31
star
18

unipatterns

Helpers which allow safe partial pattern matching in lambdas
Haskell
31
star
19

session-sauce

Shell plugin for managing tmux sessions
Shell
29
star
20

slick-template

A template for quickly building sites with slick
CSS
27
star
21

grids

Arbitrary dimension type-safe grids
Haskell
26
star
22

copy-pasta

Shell
26
star
23

dumbwaiter

Extensible HTTP Web server configured entirely by a yaml file
Haskell
25
star
24

haskell-stack-travis-ci

Dead simple setup tools for running a Haskell build matrix using stack for several versions.
Shell
23
star
25

lens-filesystem

Lens interface for your filesystem
Haskell
22
star
26

selections

Haskell Package for operating with selections over an underlying functor
Haskell
22
star
27

btt-quicknav

HTML overlay for quickly navigating your computer
JavaScript
19
star
28

lens-errors

Handling errors which occur deep inside lens-chains
Haskell
17
star
29

proton

Haskell Profunctor Optics experiments
Haskell
15
star
30

Type-Tac-Toe

Type-safe tic-tac-toe using Typesafe programming in Haskell
Haskell
15
star
31

wave-function-collapse

Wave function collapse procedural generation for arbitrary graphs
Haskell
15
star
32

catalyst

There are many category theory implementations, but this one is mine
Haskell
14
star
33

update-monad

An implementation of the Update Monad and a 'Free' version from https://danelahman.github.io/papers/types13postproc.pdf
Haskell
13
star
34

Candor

A toy Parser+Compiler+Typechecker
Haskell
12
star
35

recursive-zipper

Zippers for cofree types
Haskell
12
star
36

climbing-fp-ladder

A record of examples and anecdotes as I ascend the ladder of Functional Programming
12
star
37

charter

Haskell charting library
Haskell
10
star
38

trek

Haskell
10
star
39

vimprove

A series of daily tasks/info to learn vim from beginner to expert one day at a time.
Shell
9
star
40

react-tui

Haskell
9
star
41

dont-argue

Dead-simple command line arguments for python scripts.
Python
8
star
42

advent-of-code-haskell

Advent of Code Solutions in Haskell
Haskell
7
star
43

BoxKite

A very simple blog framework that emphasizes managing posts in a plain-text directory structure. Runs on Google App Engine, but can also be exported as a static site.
Python
7
star
44

flux-monoid

A monoid which counts changing values in a sequence
Haskell
6
star
45

ffs

A Fuse-compatible Functional File System with @isovector
Haskell
6
star
46

lens-friends

Just some lens combinator experiments :)
Haskell
5
star
47

jaunt

a jq clone in purescript
PureScript
5
star
48

json-to-haskell-web

Haskell
5
star
49

brick-filetree

A brick widget for exploring your filetree
Haskell
5
star
50

vim-committed

Sends Desktop notifications to remind you to commit.
Vim Script
4
star
51

CMPT481

Human Computer Interaction Project
JavaScript
4
star
52

rxjs-tutorial

Walkthrough of building a simple webapp using different rxjs patterns
TypeScript
4
star
53

jsonf

An educational JSON functor library for teaching recursion-schemes
Haskell
4
star
54

haskell-library-template

Template for Haskell libraries
Haskell
4
star
55

rust-advent-of-code

Rust
4
star
56

recursion-schemes-by-example

JavaScript
4
star
57

monad-suspend

Experimental Cost-Annotated Self-Yielding Coroutines
Haskell
4
star
58

game-genre-per-day

Weird and whimsical video game genres everyday!
TypeScript
4
star
59

reactive-streams

Reactive stream combinators in Haskell! Implementations of Rx primitives based on the 'machines' library
Haskell
4
star
60

professor

An experimental http server written entirely with profunctors
Haskell
4
star
61

Wirehack

A small circuit-building game built in Haskell
Haskell
3
star
62

ChrisPenner.github.io

Basic Website
HTML
3
star
63

json-to-haskell-purescript

Generate Haskell datatypes from json objects
Dhall
3
star
64

free-cached

Cache previous runs of free monads
Haskell
3
star
65

substrate

File substitution tools I need for my book
Haskell
3
star
66

cards-against-corona

Elm
3
star
67

chip8

Rust
3
star
68

type-arithmetic

Proofs of types as a semiring via Curry-Howard Isomorphism
Haskell
3
star
69

purescript-node-readline-aff

A wrapper around Node.ReadLine for use with the Aff Monad.
PureScript
3
star
70

Flow

An experimental Haskell FRP (streams) library
Haskell
3
star
71

j-lang-haskell

JLang combinators in Haskell
Haskell
3
star
72

purescript-flow

A redux-style application framework
PureScript
3
star
73

catalyst-build

Experimental build system based on composition of categories & arrows
Haskell
3
star
74

focus

cli utility for hacking and slashing data
Haskell
3
star
75

rx-prop

Propagator based reactive extensions library
Haskell
2
star
76

rsi

Structural regex based command pipelines
Haskell
2
star
77

propellant

Foray into propagator networks in Haskell
Haskell
2
star
78

concurrency-comparison

Comparison of basic concurrency primitives and tasks in Haskell and Golang
Haskell
2
star
79

mustache-shake

Build rules for compiling mustache templates using shake
Haskell
2
star
80

scavenger

A basic texting scavenger hunt using Twilio
Python
2
star
81

mailing-list-reader

Haskell
2
star
82

Kaleidoscope

Working through the Kaleidoscope llvm compiler project
Haskell
2
star
83

delve

Terminal UI File Browser
Haskell
2
star
84

free-contravariant

An exploration into free contravariant functors
Haskell
2
star
85

schemer

Uber basic scheme interpreter
Haskell
2
star
86

continuity

Composable Component Framework
Haskell
2
star
87

eve-cli

Terminal event handlers and rendering for `eve` programs
Haskell
2
star
88

sheets

Overly complex attempt at typesafe spreadsheets
Haskell
2
star
89

Simpleton-Algebraics

Learn about Functional Algebraic Types without making your head explode.
2
star
90

flags

Compiles a declarative bash script configuration into a 100% bash flags and argument parser.
Shell
2
star
91

dual-free

Library for combined free & cofree trees into a single type.
Haskell
2
star
92

cofree-zippers

Just an experiment, move along :)
Haskell
1
star
93

grids-images

Tools for interacting with images using grids
Haskell
1
star
94

overlord

Logs dashboard for all your local servers.
JavaScript
1
star
95

SPA-GAE-template

Single page application template for google app engine using react-redux
JavaScript
1
star
96

SpareSpeare

Shakespeare Filler Text Generator
Python
1
star
97

cmpt317

Python
1
star
98

test-specialization

Companion to a blog post on testing patterns in Haskell
Haskell
1
star
99

reified-dicts

Experiment to reify symbols/nats into constraints by matching them within a known set.
Haskell
1
star
100

unison-testing

Just a scrap unison codebase for testing
1
star