|
1 |
| -# Haskell.do |
| 1 | +# haskell.do |
2 | 2 |
|
3 | 3 | [](https://gitter.im/theam/haskell-do?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
4 | 4 |
|
5 |
| -Haskell.do is a Haskell code editor, centered around interactive development. |
| 5 | +[haskell.do](haskell.do) is a Haskell code editor, centered around interactive development. You can get it on [the website](haskell.do). |
6 | 6 |
|
7 |
| -This is a **pre-release** version, **not expected to be used in production**. As a |
8 |
| -prototype, major changes may be applied in the future that could break backwards |
9 |
| -compatibility. Pull Requests will be greatly appreciated, check out [our contributing guidelines](CONTRIBUTING.md). |
| 7 | +Pull Requests are greatly appreciated, check out [our contributing guidelines](CONTRIBUTING.md). |
10 | 8 |
|
11 |
| -The current version is written in [Haskell](https://www.haskell.org/) and |
12 |
| -[PureScript](http://www.purescript.org/), but on next releases we're aiming for |
13 |
| -a pure Haskell implementation. |
| 9 | +## Building from source |
14 | 10 |
|
15 |
| -## Usage |
16 |
| - |
17 |
| -The only *3rd-party* requirement to run Haskell.do is [Stack](http://haskellstack.org/) and [NodeJS](https://nodejs.org/). |
18 |
| - |
19 |
| -Before proceeding, run a `npm install -g purescript pulp bower` to install the required NodeJS binaries. |
| 11 | +The only *3rd-party* requirement to build [haskell.do](haskell.do) is [Stack](http://haskellstack.org/) and [NodeJS](https://nodejs.org/) (due to GHCJS). |
20 | 12 |
|
21 | 13 | `git clone https://github.com/theam/haskell-do && cd haskell-do`
|
22 | 14 |
|
23 | 15 | `stack Build.hs -h` for detailed usage of the build file.
|
24 | 16 |
|
25 |
| -`stack Build.hs -d` for installing the required dependencies, and |
26 |
| - |
27 |
| -`stack Build.hs -a` for building the whole Haskell.do project. |
28 |
| - |
29 |
| -### Initializing a project |
30 |
| -Begin by creating a **new** Stack project in another terminal: |
31 |
| - |
32 |
| -`stack new your-project-name simple-library`. Be sure to use _hyphens_ not underscores. |
33 |
| - |
34 |
| -After doing that, `cd your-project-name && stack setup && stack build`. |
35 |
| - |
36 |
| -Back in the terminal where you cloned Haskell.do, run `stack Build.hs -- --run`, |
37 |
| -Haskell.do will open and it will ask you to open a Stack project. |
38 |
| -Navigate to the root of the project you just created and open `src/Lib.hs` |
39 |
| - |
40 |
| -### Main interface |
41 |
| -Let's begin by adding a text cell for documenting our analysis: |
42 |
| - |
43 |
| - |
44 |
| - |
45 |
| -Haskell.do's text editor is based on [SimpleMDE](https://simplemde.com/) for |
46 |
| -handling the editing and rendering of the "documentation" part of our code. |
47 |
| - |
48 |
| -It supports all the features that you would expect from a normal markdown |
49 |
| -editor, including image embedding. |
50 |
| - |
51 |
| -- Do a single click out of the editor to render the current text |
52 |
| -- Do a double click inside of the editor to come back to the text editing |
53 |
| - view. |
54 |
| - |
55 |
| - |
56 |
| - |
57 |
| -Now, **it's time to work with some code, let's insert a code cell**. |
58 |
| -In it, we write regular Haskell code, like we would do in a normal Haskell |
59 |
| -module. |
60 |
| - |
61 |
| -In fact, our whole page is just a Haskell file that can be used in any |
62 |
| -Haskell, project. No need to export/import! |
63 |
| - |
64 |
| - |
65 |
| - |
66 |
| -Now we have to try our new algorithm we spent hours researching on. |
67 |
| -No, we do not have to spawn a `stack ghci` or a `stack repl`. Haskell.do |
68 |
| -manages that for us and reloads the code each time we ask it to evaluate |
69 |
| -some expression. |
70 |
| - |
71 |
| -Just click on the **toggle console** button and press the save button to |
72 |
| -enable it. |
73 |
| - |
74 |
| -After writing your expression, press return [twice](https://github.com/theam/haskell-do/issues/1) |
75 |
| -to get the result written on screen. |
76 |
| - |
77 |
| - |
78 |
| - |
79 |
| -But, what does our *real* module file look like? Let's see the contents |
80 |
| -of our `Main.hs` file: |
81 |
| - |
82 |
| -```haskell |
83 |
| --- # Analyzing dog cuteness with genetic algorithms |
84 |
| --- |
85 |
| --- After going **through thorough and tough thoughts**, we decided to use a simple example. |
86 |
| - |
87 |
| -a = [1..20] |
88 |
| -b = f <$> a |
89 |
| - |
90 |
| -f :: Int -> Int |
91 |
| -f x = x * 3 + 4 |
92 |
| -``` |
| 17 | +`stack Build.hs -a` for building project. |
93 | 18 |
|
94 |
| -Just regular Haskell! Ready for deployment! |
| 19 | +`stack Build.hs -r` for running [haskell.do](haskell.do) on port `8080`. |
95 | 20 |
|
96 | 21 | ## Contributing
|
97 | 22 |
|
|
0 commit comments