git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update intro.rst
56cf09aPhil Freeman
docs/source/intro.rst+16−10
@@ -18,15 +18,21 @@ PureScript is a small strongly, statically typed compile-to-JS language with a n
18- Optional tail-call elimination
18- Optional tail-call elimination
19- Type Classes
19- Type Classes
20
20
21−Try It!
22−-------
23−
24−Try PureScript in the browser [here](http://tryps.functorial.com/).
25−
26Installation
21Installation
27------------
22------------
28
23
29−Install the Haskell Plaform, then `cabal install`
24+If you have the Haskell Plaform installed, then you can install the latest released version from Hackage::
25+
26+ cabal update
27+ cabal install purescript
28+
29+If you would like to build the latest version of the code, clone this repository and build:
30+
31+ git clone git://github.com:paf31/purescript.git
32+ cabal configure --enable-tests
33+ cabal build
34+ cabal test
35+ cabal install
30
36
31Usage
37Usage
32-----
38-----
@@ -35,9 +41,9 @@ The `psc` executable takes a list of PureScript source files as arguments and by
35
41
36The following options are supported:
42The following options are supported:
37
43
38−-s --stdin Read input from standard input instead of from files
44+--stdin Read input from standard input instead of from files
39−-o --output Write the generated Javascript to the specified file
45+--output Write the generated Javascript to the specified file
40−-e --foreign imports Write a list of foreign imports declarations to the specified file in addition to generating Javascript output
46+--externs Write a list of foreign imports declarations to the specified file in addition to generating Javascript output
41--runtime-type-checks Generate simple runtime type checks for function arguments with simple types.
47--runtime-type-checks Generate simple runtime type checks for function arguments with simple types.
42--tco Perform tail-call elimination on the generated Javascript.
48--tco Perform tail-call elimination on the generated Javascript.
43--no-prelude Do not include the Prelude in the generated Javascript.
49--no-prelude Do not include the Prelude in the generated Javascript.
@@ -99,7 +105,7 @@ The following code defines a `Person` data type and a function to generate a str
99Line by line, this reads as follows:
105Line by line, this reads as follows:
100
106
101- `Person` is a data type with one constructor, also called `Person`
107- `Person` is a data type with one constructor, also called `Person`
102− - The `Person` constructor takes an object with two properties, `name` which is a `String`, and `age` which is a `Number`
108+- The `Person` constructor takes an object with two properties, `name` which is a `String`, and `age` which is a `Number`
103- The `numberToString` function is written in Javascript, and converts a `Number` to its `String` representation
109- The `numberToString` function is written in Javascript, and converts a `Number` to its `String` representation
104- The `showPerson` function takes a `Person` and returns a `String`
110- The `showPerson` function takes a `Person` and returns a `String`
105- `showPerson` works by case analysis on its argument, first matching the constructor `Person` and then using string concatenation and object accessors to return its result.
111- `showPerson` works by case analysis on its argument, first matching the constructor `Person` and then using string concatenation and object accessors to return its result.