git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge branch 'master' of github.com:paf31/purescript
commit396b86e8ea99016bb2dfad0883418a04ef43bf62 authorPhil Freeman <paf31@cantab.net> dateMon 6 Oct 2014, 08:57 (12 years ago) parent7f0a40ec1fc649
2 files changed+8−8
docs/source/ffi.rst+5−5 docs/source/types.rst+3−3
docs/source/ffi.rst+5−5
@@ -14,11 +14,11 @@ Inline Javascript
1414A foreign import declaration may optionally contain its definition in Javascript as a string literal. If this is provided, the string will be inserted directly into the generated Javascript before the current module definition::
1515
1616 foreign import pow
17− "function pow(n) {\
18− \ return function(p) {\
19− \ return Math.pow(n, p);\
20− \ };\
21− \}" :: Number -> Number -> Number
17+ """function pow(n) {
18+ return function(p) {
19+ return Math.pow(n, p);
20+ };
21+ }""" :: Number -> Number -> Number
2222
2323Importing Types
2424---------------
docs/source/types.rst+3−3
@@ -38,21 +38,21 @@ Tagged unions can only be created using their constructors, and deconstructed th
3838
3939For example::
4040
41− data Foo a = Foo | Bar String
41+ data Foo = Foo | Bar String
4242
4343 runFoo Foo = "It's a Foo"
4444 runFoo (Bar s) = "It's a Bar. The string is " ++ s
4545
4646 test = runFoo Foo ++ runFoo (Bar "Test")
4747
48−In the example, Foo is a tagged union type which has two constructors. It's first constructor ``Foo`` takes no argument, and it's second ``Bar`` takes one, which must be a String.
48+In the example, Foo is a tagged union type which has two constructors. Its first constructor ``Foo`` takes no arguments, and its second ``Bar`` takes one, which must be a String.
4949
5050``runFoo`` is an example of pattern matching on a tagged union type to discover its constructor, and the last line shows how to construct values of type ``Foo``.
5151
5252Newtypes
5353--------
5454
55−Newtypes are like data types introduced with the ``data`` keyword, but are restricted to a single contructor which contains a single arguments. Newtypes are introduced with the ``newtype`` keyword::
55+Newtypes are like data types introduced with the ``data`` keyword, but are restricted to a single contructor which contains a single argument. Newtypes are introduced with the ``newtype`` keyword::
5656
5757 newtype Percentage = Percentage Number
5858