Try PureScript is an online PureScript code editor for quickly experimenting with PureScript code snippets and ideas.
- Create a
bower.json
/psc-package.json
file with all the dependencies you want to be available for the library backend and optionally an extraTry
module if you want. Example PR - Write an example in a github gist and name it
Main.purs
. Example Gist - add a backend button and a backend option in
index.html
andindex.js
respectively. Example PR- Note to link the gist from the previous bullet in the
mainGist
field inindex.js
- Note to link the gist from the previous bullet in the
- Ask phil to update the
core
main gist to link to the new backend
- Writing code using the Ace Editor
- Automatic compilation
- PureScript syntax highlighting
- Run and print output or show resulting JavaScript
- Multiple view modes: code, output or both
- Persistent session
- Load PureScript code from Github Gists
- Save PureScript code as anonymous Github Gists
- (Note: These Gists are not associated with your GitHub account and are visible to anyone with a link to them)
Most of these features can be controlled not only from the toolbar, but also using the query parameters:
-
Load From Gist: Load PureScript code from Gist id using the
gist
parameter- Example:
gist=37c3c97f47a43f20c548
will load the code from this Gist if the file was namedMain.purs
- Example:
-
View Mode: Control the view mode using the
view
parameter- Options are:
code
,output
,both
- Example:
view=output
will only display the output
- Options are:
-
Backend: Control which backend will compile your code using the
backend
parameter- Options are:
core
,thermite
,slides
,flare
,mathbox
,behavior
- Example:
backend=thermite
will use the thermite backend
- Options are:
-
Auto Compile: Automatic compilation can be turned off using the
compile
parameter- Options are:
true
,false
- Example:
compile=false
will turn auto compilation off
- Options are:
-
JavaScript Code Generation: Print the resulting JavaScript code in the output window instead of the output of the program using the
js
parameter- Options are:
true
,false
- Example:
js=true
will print JavaScript code instead of the program's output
- Options are:
-
Session: Load code from a session which is stored with localStorage using the
session
parameter- Usually managed by Try PureScript
- Example:
session=9162f098-070f-4053-60ea-eba47021450d
(Note: will probably not work for you) - When used with the
gist
query parameter the code will be loaded from the Gist and not the session