git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Update docs
e0e5169Phil Freeman
docs/source/ffi.rst+16−7
@@ -4,7 +4,7 @@ Foreign Function Interface
4Importing Values
4Importing Values
5----------------
5----------------
6
6
7−The `foreign import` keyword declares a value which is defined in Javascript, and its type::
7+The ``foreign import`` keywords declare a value which is defined in Javascript, and its type::
8
8
9 foreign import pow :: Number -> Number -> Number
9 foreign import pow :: Number -> Number -> Number
10
10
@@ -13,19 +13,28 @@ Inline Javascript
13
13
14A 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::
14A 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::
15
15
16− foreign import pow "function pow(n) {\
16+ foreign import pow
17+ "function pow(n) {\
17− \ return function(p) {\
18+ \ return function(p) {\
18− \ return Math.pow(n, p);\
19+ \ return Math.pow(n, p);\
19− \ };\
20+ \ };\
20− \}" :: Number -> Number -> Number
21+ \}" :: Number -> Number -> Number
21
22
22Importing Types
23Importing Types
23---------------
24---------------
24
25
25−To declare a new type with no constructors, use `foreign import data` and provide the kind::
26+To declare a new type with no constructors, use ``foreign import data`` and provide the kind::
26
27
27 foreign import data DOM :: *
28 foreign import data DOM :: *
28
29
29 foreign import document :: {
30 foreign import document :: {
30 createElement :: String -> DOM
31 createElement :: String -> DOM
31 }
32 }
33+
34+Importing Type Class Instances
35+------------------------------
36+
37+Type class instances can be imported with ``foreign import instance``::
38+
39+ foreign import instance showString :: Prelude.Show String
40+
docs/source/intro.rst+13−15
@@ -14,7 +14,7 @@ PureScript is a small strongly, statically typed compile-to-JS language with a n
14- Modules
14- Modules
15- Rank N Types
15- Rank N Types
16- Do Notation
16- Do Notation
17−- Optional tail-call elimination
17+- Tail-call elimination
18- Type Classes
18- Type Classes
19
19
20Installation
20Installation
@@ -44,12 +44,15 @@ The following options are supported:
44--output Write the generated Javascript to the specified file
44--output Write the generated Javascript to the specified file
45--externs Write a list of foreign imports declarations to the specified file in addition to generating Javascript output
45--externs Write a list of foreign imports declarations to the specified file in addition to generating Javascript output
46--runtime-type-checks Generate simple runtime type checks for function arguments with simple types.
46--runtime-type-checks Generate simple runtime type checks for function arguments with simple types.
47−--tco Perform tail-call elimination on the generated Javascript.
47+--no-tco Turn off tail-call elimination.
48--no-prelude Do not include the Prelude in the generated Javascript.
48--no-prelude Do not include the Prelude in the generated Javascript.
49−--magic-do Overload the `do` keyword to inline calls to `bind` for the `Eff` monad, to generate more efficient code.
49+--no-magic-do Turn off optimizations which inline calls to `>>=` for the `Eff` monad.
50+--no-opts Disable all optimizations.
50--main Generate a call to `main` in the specified module after all other generated Javascript. Defaults to `Main` if the option is used but no value is provided.
51--main Generate a call to `main` in the specified module after all other generated Javascript. Defaults to `Main` if the option is used but no value is provided.
51--module If specified, any code which is not referenced transitively from this module will be removed. This argument can be used multiple times.
52--module If specified, any code which is not referenced transitively from this module will be removed. This argument can be used multiple times.
53+--codegen A list of modules for which Javascript and externs should be generated. This argument can be used multiple times.
52--browser-namespace Specify the namespace that PureScript modules will be exported to when running in the browser.
54--browser-namespace Specify the namespace that PureScript modules will be exported to when running in the browser.
55+--verbose-errors Generate verbose error messages
53
56
54Motivation
57Motivation
55----------
58----------
@@ -98,23 +101,19 @@ The following code defines a `Person` data type and a function to generate a str
98
101
99 data Person = Person { name :: String, age :: Number }
102 data Person = Person { name :: String, age :: Number }
100
103
101− foreign import numberToString :: Number -> String
102−
103 showPerson :: Person -> String
104 showPerson :: Person -> String
104− showPerson (Person o) = o.name ++ ", aged " ++ numberToString(o.age)
105+ showPerson (Person o) = o.name ++ ", aged " ++ show o.age
105
106
106 examplePerson :: Person
107 examplePerson :: Person
107− examplePerson = Person {name: "Bonnie", age: 26}
108+ examplePerson = Person { name: "Bonnie", age: 26 }
108−
109
109
110Line by line, this reads as follows:
110Line by line, this reads as follows:
111
111
112−- `Person` is a data type with one constructor, also called `Person`
112+- ``Person`` is a data type with one constructor, also called ``Person``
113−- The `Person` constructor takes an object with two properties, `name` which is a `String`, and `age` which is a `Number`
113+- The ``Person`` constructor takes an object with two properties, ``name`` which is a ``String``, and ``age`` which is a ``Number``
114−- The `numberToString` function is written in Javascript, and converts a `Number` to its `String` representation
115−- The `showPerson` function takes a `Person` and returns a `String`
114+- The ``showPerson`` function takes a ``Person`` and returns a ``String``
116−- `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.
115+- ``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.
117−- `examplePerson` is a Person object, made with the Person constructor and given the String "Bonnie" for the name value and the Number 26 for the age value.
116+- ``examplePerson`` is a Person object, made with the ``Person`` constructor and given the String "Bonnie" for the name value and the Number 26 for the age value.
118
117
119The generated Javascript looks like this::
118The generated Javascript looks like this::
120
119
@@ -131,7 +130,6 @@ The generated Javascript looks like this::
131 age: 26
130 age: 26
132 });
131 });
133
132
134−
135Related Projects
133Related Projects
136----------------
134----------------
137
135
docs/source/modules.rst+16−1
@@ -26,4 +26,19 @@ Alternatively, a list of names to import can be provided in parentheses::
26
26
27 module B where
27 module B where
28
28
29− import A (id)
29+ import A (runFoo)
30+
31+Values, type constructors and data constructors can all be explicitly imported. A type constructor should be followed by a list of associated data constructors to import in parentheses. A double dot (``..``) can be used to import all data constructors for a given type constructor::
32+
33+ module B where
34+
35+ import A (runFoo, Foo(..), Bar(Bar))
36+
37+Module Exports
38+--------------
39+
40+Module exports can be restricted to a set of names by providing that set in parentheses in the module declaration::
41+
42+ module A (runFoo, Foo(..)) where
43+
44+The types of names which can be exported is the same as for module imports.
docs/source/prelude.rst−260
@@ -7,207 +7,21 @@ Module Prelude
7Types
7Types
8~~~~~
8~~~~~
9
9
10−::
11−
12− data Ordering where
13− LT :: Ordering
14− GT :: Ordering
15− EQ :: Ordering
16−
17Type Classes
10Type Classes
18~~~~~~~~~~~~
11~~~~~~~~~~~~
19
12
20−::
21−
22− class Alternative f where
23− empty :: forall a. f a
24− (<|>) :: forall a. f a -> f a -> f a
25−
26− class Applicative f where
27− pure :: forall a. a -> f a
28− (<*>) :: forall a b. f (a -> b) -> f a -> f b
29−
30− class Bits b where
31− (&) :: b -> b -> b
32− (|) :: b -> b -> b
33− (^) :: b -> b -> b
34− shl :: b -> Prim.Number -> b
35− shr :: b -> Prim.Number -> b
36− zshr :: b -> Prim.Number -> b
37− complement :: b -> b
38−
39− class BoolLike b where
40− (&&) :: b -> b -> b
41− (||) :: b -> b -> b
42− not :: b -> b
43−
44− class Category a where
45− id :: forall t. a t t
46− (<<<) :: forall b c d. a c d -> a b c -> a b d
47−
48− class Eq a where
49− (==) :: a -> a -> Prim.Boolean
50− (/=) :: a -> a -> Prim.Boolean
51−
52− class Functor f where
53− (<$>) :: forall a b. (a -> b) -> f a -> f b
54−
55− class Monad m where
56− return :: forall a. a -> m a
57− (>>=) :: forall a b. m a -> (a -> m b) -> m b
58−
59− class Num a where
60− (+) :: a -> a -> a
61− (-) :: a -> a -> a
62− (*) :: a -> a -> a
63− (/) :: a -> a -> a
64− (%) :: a -> a -> a
65− negate :: a -> a
66−
67− class Ord a where
68− compare :: a -> a -> Ordering
69−
70− class Show a where
71− show :: a -> Prim.String
72−
73Type Class Instances
13Type Class Instances
74~~~~~~~~~~~~~~~~~~~~
14~~~~~~~~~~~~~~~~~~~~
75
15
76−::
77−
78− instance applicativeFromMonad :: (Monad m) => Applicative m
79−
80− instance bitsNumber :: Bits Prim.Number
81−
82− instance boolLikeBoolean :: BoolLike Prim.Boolean
83−
84− instance categoryArr :: Category Prim.Function
85−
86− instance eqArray :: (Eq a) => Eq [a]
87−
88− instance eqBoolean :: Eq Prim.Boolean
89−
90− instance eqNumber :: Eq Prim.Number
91−
92− instance eqString :: Eq Prim.String
93−
94− instance functorFromApplicative :: (Applicative f) => Functor f
95−
96− instance numNumber :: Num Prim.Number
97−
98− instance ordNumber :: Ord Prim.Number
99−
100− instance showBoolean :: Show Prim.Boolean
101−
102− instance showNumber :: Show Prim.Number
103−
104− instance showOrdering :: Show Ordering
105−
106− instance showString :: Show Prim.String
107−
108Values
16Values
109~~~~~~
17~~~~~~
110
18
111−::
112−
113− (!!) :: forall a. [a] -> Prim.Number -> a
114−
115− (#) :: forall a b. a -> (a -> b) -> b
116−
117− ($) :: forall a b. (a -> b) -> a -> b
118−
119− (++) :: Prim.String -> Prim.String -> Prim.String
120−
121− (<) :: forall a. (Ord a) => a -> a -> Prim.Boolean
122−
123− (<=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
124−
125− (>) :: forall a. (Ord a) => a -> a -> Prim.Boolean
126−
127− (>=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
128−
129− (>>>) :: forall a b c d. (Category a) => a b c -> a c d -> a b d
130−
131− boolAnd :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
132−
133− boolNot :: Prim.Boolean -> Prim.Boolean
134−
135− boolOr :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
136−
137− const :: forall a b. a -> b -> a
138−
139− flip :: forall a b c. (a -> b -> c) -> b -> a -> c
140−
141− numAdd :: Prim.Number -> Prim.Number -> Prim.Number
142−
143− numAnd :: Prim.Number -> Prim.Number -> Prim.Number
144−
145− numCompare :: Prim.Number -> Prim.Number -> Ordering
146−
147− numComplement :: Prim.Number -> Prim.Number
148−
149− numDiv :: Prim.Number -> Prim.Number -> Prim.Number
150−
151− numMod :: Prim.Number -> Prim.Number -> Prim.Number
152−
153− numMul :: Prim.Number -> Prim.Number -> Prim.Number
154−
155− numNegate :: Prim.Number -> Prim.Number
156−
157− numOr :: Prim.Number -> Prim.Number -> Prim.Number
158−
159− numShl :: Prim.Number -> Prim.Number -> Prim.Number
160−
161− numShr :: Prim.Number -> Prim.Number -> Prim.Number
162−
163− numSub :: Prim.Number -> Prim.Number -> Prim.Number
164−
165− numXor :: Prim.Number -> Prim.Number -> Prim.Number
166−
167− numZshr :: Prim.Number -> Prim.Number -> Prim.Number
168−
169− on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
170−
171− showNumberImpl :: Prim.Number -> Prim.String
172−
173Module Data.Eq
19Module Data.Eq
174--------------
20--------------
175
21
176Types
22Types
177~~~~~
23~~~~~
178
24
179−::
180−
181− data Ref a where
182− Ref :: a -> Ref a
183−
184−Type Classes
185−~~~~~~~~~~~~
186−
187−Type Class Instances
188−~~~~~~~~~~~~~~~~~~~~
189−
190−::
191−
192− instance eqRef :: Eq (Ref a)
193−
194−Values
195−~~~~~~
196−
197−::
198−
199− liftRef :: forall a b. (a -> a -> b) -> Ref a -> Ref a -> b
200−
201− refEq :: forall a. Ref a -> Ref a -> Prim.Boolean
202−
203− refIneq :: forall a. Ref a -> Ref a -> Prim.Boolean
204−
205−Module Data.Eq.Unsafe
206−---------------------
207−
208−Types
209−~~~~~
210−
211Type Classes
25Type Classes
212~~~~~~~~~~~~
26~~~~~~~~~~~~
213
27
@@ -217,53 +31,21 @@ Type Class Instances
217Values
31Values
218~~~~~~
32~~~~~~
219
33
220−::
221−
222− refEq :: forall a. a -> a -> Prim.Boolean
223−
224− refIneq :: forall a. a -> a -> Prim.Boolean
225−
226Module Control.Monad.Eff
34Module Control.Monad.Eff
227------------------------
35------------------------
228
36
229Types
37Types
230~~~~~
38~~~~~
231
39
232−::
233−
234− data Eff :: # ! -> * -> *
235−
236− type Pure a = forall e. Eff e a
237−
238Type Classes
40Type Classes
239~~~~~~~~~~~~
41~~~~~~~~~~~~
240
42
241Type Class Instances
43Type Class Instances
242~~~~~~~~~~~~~~~~~~~~
44~~~~~~~~~~~~~~~~~~~~
243
45
244−::
245−
246− instance monadEff :: Monad (Eff e)
247−
248Values
46Values
249~~~~~~
47~~~~~~
250
48
251−::
252−
253− bindEff :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
254−
255− forE :: forall e. Prim.Number -> Prim.Number -> (Prim.Number -> Eff e { }) -> Eff e { }
256−
257− foreachE :: forall e a. [a] -> (a -> Eff e { }) -> Eff e { }
258−
259− retEff :: forall e a. a -> Eff e a
260−
261− runPure :: forall a. Pure a -> a
262−
263− untilE :: forall e. Eff e Prim.Boolean -> Eff e { }
264−
265− whileE :: forall e a. Eff e Prim.Boolean -> Eff e a -> Eff e { }
266−
267Module Control.Monad.Eff.Unsafe
49Module Control.Monad.Eff.Unsafe
268-------------------------------
50-------------------------------
269
51
@@ -279,20 +61,12 @@ Type Class Instances
279Values
61Values
280~~~~~~
62~~~~~~
281
63
282−::
283−
284− unsafeInterleaveEff :: forall eff1 eff2 a. Eff eff1 a -> Eff eff2 a
285−
286Module Debug.Trace
64Module Debug.Trace
287------------------
65------------------
288
66
289Types
67Types
290~~~~~
68~~~~~
291
69
292−::
293−
294− data Trace :: !
295−
296Type Classes
70Type Classes
297~~~~~~~~~~~~
71~~~~~~~~~~~~
298
72
@@ -302,26 +76,12 @@ Type Class Instances
302Values
76Values
303~~~~~~
77~~~~~~
304
78
305−::
306−
307− print :: forall a r. (Show a) => a -> Eff (trace :: Trace | r) { }
308−
309− trace :: forall r. Prim.String -> Eff (trace :: Trace | r) { }
310−
311Module Control.Monad.ST
79Module Control.Monad.ST
312-----------------------
80-----------------------
313
81
314Types
82Types
315~~~~~
83~~~~~
316
84
317−::
318−
319− data ST :: * -> !
320−
321− data STArray :: * -> * -> *
322−
323− data STRef :: * -> * -> *
324−
325Type Classes
85Type Classes
326~~~~~~~~~~~~
86~~~~~~~~~~~~
327
87
@@ -331,23 +91,3 @@ Type Class Instances
331Values
91Values
332~~~~~~
92~~~~~~
333
93
334−::
335−
336− modifySTRef :: forall a h r. STRef h a -> (a -> a) -> Eff (st :: ST h | r) a
337−
338− newSTArray :: forall a h r. Prim.Number -> a -> Eff (st :: ST h | r) (STArray h a)
339−
340− newSTRef :: forall a h r. a -> Eff (st :: ST h | r) (STRef h a)
341−
342− peekSTArray :: forall a h r. STArray h a -> Eff (st :: ST h | r) a
343−
344− pokeSTArray :: forall a h r. STArray h a -> Prim.Number -> a -> Eff (st :: ST h | r) a
345−
346− readSTRef :: forall a h r. STRef h a -> Eff (st :: ST h | r) a
347−
348− runST :: forall a r. (forall h. Eff (st :: ST h | r) a) -> Eff r a
349−
350− runSTArray :: forall a r. (forall h. Eff (st :: ST h | r) (STArray h a)) -> Eff r [a]
351−
352− writeSTRef :: forall a h r. STRef h a -> a -> Eff (st :: ST h | r) a
353−
docs/source/syntax.rst+25−2
@@ -143,7 +143,7 @@ For example::
143Do Notation
143Do Notation
144-----------
144-----------
145
145
146−The `do` keyword introduces simple syntactic sugar for monadic expressions.
146+The ``do`` keyword introduces simple syntactic sugar for monadic expressions.
147
147
148Here is an example, using the maybe monad::
148Here is an example, using the maybe monad::
149
149
@@ -166,7 +166,7 @@ Here is an example, using the maybe monad::
166
166
167``isEven`` adds two values of type ``Maybe Number`` and returns their sum, if the sum is even. If the sum is odd, ``evenSum`` returns ``Nothing``.
167``isEven`` adds two values of type ``Maybe Number`` and returns their sum, if the sum is even. If the sum is odd, ``evenSum`` returns ``Nothing``.
168
168
169−When using `do` notation, the corresponding type constructor must be an instance of the `Prelude.Monad` type class, which defines the ``ret`` and ``>>=`` functions.
169+When using ``do`` notation, the corresponding type constructor must be an instance of the ``Prelude.Monad`` type class, which defines the ``ret`` and ``>>=`` functions.
170
170
171Statements can have the following form:
171Statements can have the following form:
172
172
@@ -215,3 +215,26 @@ For example, the following function increments the ``foo`` property on its argum
215
215
216 incr o = o { foo = o.foo + 1 }
216 incr o = o { foo = o.foo + 1 }
217
217
218+Let Bindings
219+------------
220+
221+The ``let`` keywords a collection of local declarations, which may be mutually recursive, and which may include type declarations::
222+
223+ factorial :: Number -> Number
224+ factorial =
225+ let
226+ go :: Number -> Number -> Number
227+ go acc 1 = acc
228+ go acc n = go (acc * n) (n - 1)
229+ in
230+ go 1
231+
232+The ``where`` keyword can also be used to introduce local declarations `at the end of a value declaration`::
233+
234+ factorial :: Number -> Number
235+ factorial = go 1
236+ where
237+ go :: Number -> Number -> Number
238+ go acc 1 = acc
239+ go acc n = go (acc * n) (n - 1)
240+
docs/source/typeclasses.rst+3−3
@@ -1,13 +1,13 @@
1Type Classes
1Type Classes
2============
2============
3
3
4−PureScript has basic support for type classes via the `class` and `instance` keywords.
4+PureScript has basic support for type classes via the ``class`` and ``instance`` keywords.
5
5
6−Type class instances must be of the form `String`, `Number`, `Boolean`, `[t]` or `C t1 ... tn`, and only a single type class parameter is supported.
6+Types appearing in class instances are must be of the form ``String``, ``Number``, ``Boolean``, or ``C t1 ... tn`` where ``C`` is a type constructor (including ``[]`` and ``->`` and ``t_i`` are types of the same form).
7
7
8Type class instances are resolved based on the order in which they appeared in the source files. In particular, overlapping instances are permitted.
8Type class instances are resolved based on the order in which they appeared in the source files. In particular, overlapping instances are permitted.
9
9
10−Here is an example of the `Show` typeclass, with instances for Strings, Booleans and arrays::
10+Here is an example of the ``Show`` typeclass, with instances for ``String``, ``Booleans`` and ``[]``::
11
11
12 class Show a where
12 class Show a where
13 show :: a -> String
13 show :: a -> String
docs/source/types.rst+6−7
@@ -44,9 +44,9 @@ For example::
44
44
45 test = runFoo Foo ++ runFoo (Bar "Test")
45 test = runFoo Foo ++ runFoo (Bar "Test")
46
46
47−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.
47+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
48
49−``runFoo`` is an example of pattern matching on a tagged union type to discover its constructor, and the last line shows how ``Foo``s are constructed.
49+``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``.
50
50
51Functions
51Functions
52---------
52---------
@@ -62,7 +62,7 @@ Here is an example::
62
62
63 identity x = x
63 identity x = x
64
64
65−`identity` is inferred to have (polymorphic) type ``forall t0. t0 -> t0``. This means that for any type ``t0``, ``identity`` can be given a value of type ``t0`` and will give back a value of the same type.
65+``identity`` is inferred to have (polymorphic) type ``forall t0. t0 -> t0``. This means that for any type ``t0``, ``identity`` can be given a value of type ``t0`` and will give back a value of the same type.
66
66
67A type annotation can also be provided::
67A type annotation can also be provided::
68
68
@@ -78,9 +78,8 @@ For example, the following function accesses two properties on a record::
78
78
79 addProps o = o.foo + o.bar
79 addProps o = o.foo + o.bar
80
80
81−The inferred type of `addProps` is
81+The inferred type of ``addProps`` is::
82
82
83−::
84 forall r. { foo :: Number, bar :: Number | r } -> Number
83 forall r. { foo :: Number, bar :: Number | r } -> Number
85
84
86Here, the type variable ``r`` has kind ``# *`` - it represents a `row` of `types`. It can be instantiated with any row of named types.
85Here, the type variable ``r`` has kind ``# *`` - it represents a `row` of `types`. It can be instantiated with any row of named types.
@@ -95,7 +94,7 @@ even though the type of ``addProps`` does not mention the property ``baz``. Howe
95
94
96 addProps { foo: 1 }
95 addProps { foo: 1 }
97
96
98−since the `bar` property is missing.
97+since the ``bar`` property is missing.
99
98
100Rank N Types
99Rank N Types
101------------
100------------
@@ -109,7 +108,7 @@ As an example, we can pass a polymorphic function as an argument to another func
109 poly :: (forall a. a -> a) -> Boolean
108 poly :: (forall a. a -> a) -> Boolean
110 poly f = (f 0 < 1) == f true
109 poly f = (f 0 < 1) == f true
111
110
112−Notice that the polymorphic function's type argument is instantiated to both `Number` and `Boolean`.
111+Notice that the polymorphic function's type argument is instantiated to both ``Number`` and ``Boolean``.
113
112
114An argument to ``poly`` must indeed be polymorphic. For example, the following fails::
113An argument to ``poly`` must indeed be polymorphic. For example, the following fails::
115
114
prelude/README.md−227
@@ -3,189 +3,18 @@
3
3
4### Types
4### Types
5
5
6− data Ordering where
7− LT :: Ordering
8− GT :: Ordering
9− EQ :: Ordering
10−
11
6
12### Type Classes
7### Type Classes
13
8
14− class Alternative f where
15− empty :: forall a. f a
16− (<|>) :: forall a. f a -> f a -> f a
17−
18− class Applicative f where
19− pure :: forall a. a -> f a
20− (<*>) :: forall a b. f (a -> b) -> f a -> f b
21−
22− class Bits b where
23− (&) :: b -> b -> b
24− (|) :: b -> b -> b
25− (^) :: b -> b -> b
26− shl :: b -> Prim.Number -> b
27− shr :: b -> Prim.Number -> b
28− zshr :: b -> Prim.Number -> b
29− complement :: b -> b
30−
31− class BoolLike b where
32− (&&) :: b -> b -> b
33− (||) :: b -> b -> b
34− not :: b -> b
35−
36− class Category a where
37− id :: forall t. a t t
38− (<<<) :: forall b c d. a c d -> a b c -> a b d
39−
40− class Eq a where
41− (==) :: a -> a -> Prim.Boolean
42− (/=) :: a -> a -> Prim.Boolean
43−
44− class Functor f where
45− (<$>) :: forall a b. (a -> b) -> f a -> f b
46−
47− class Monad m where
48− return :: forall a. a -> m a
49− (>>=) :: forall a b. m a -> (a -> m b) -> m b
50−
51− class Num a where
52− (+) :: a -> a -> a
53− (-) :: a -> a -> a
54− (*) :: a -> a -> a
55− (/) :: a -> a -> a
56− (%) :: a -> a -> a
57− negate :: a -> a
58−
59− class Ord a where
60− compare :: a -> a -> Ordering
61−
62− class Show a where
63− show :: a -> Prim.String
64−
65
9
66### Type Class Instances
10### Type Class Instances
67
11
68− instance applicativeFromMonad :: (Monad m) => Applicative m
69−
70− instance bitsNumber :: Bits Prim.Number
71−
72− instance boolLikeBoolean :: BoolLike Prim.Boolean
73−
74− instance categoryArr :: Category Prim.Function
75−
76− instance eqArray :: (Eq a) => Eq [a]
77−
78− instance eqBoolean :: Eq Prim.Boolean
79−
80− instance eqNumber :: Eq Prim.Number
81−
82− instance eqString :: Eq Prim.String
83−
84− instance functorFromApplicative :: (Applicative f) => Functor f
85−
86− instance numNumber :: Num Prim.Number
87−
88− instance ordNumber :: Ord Prim.Number
89−
90− instance showBoolean :: Show Prim.Boolean
91−
92− instance showNumber :: Show Prim.Number
93−
94− instance showOrdering :: Show Ordering
95−
96− instance showString :: Show Prim.String
97−
98
12
99### Values
13### Values
100
14
101− (!!) :: forall a. [a] -> Prim.Number -> a
102−
103− (#) :: forall a b. a -> (a -> b) -> b
104−
105− ($) :: forall a b. (a -> b) -> a -> b
106−
107− (++) :: Prim.String -> Prim.String -> Prim.String
108−
109− (<) :: forall a. (Ord a) => a -> a -> Prim.Boolean
110−
111− (<=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
112−
113− (>) :: forall a. (Ord a) => a -> a -> Prim.Boolean
114−
115− (>=) :: forall a. (Ord a) => a -> a -> Prim.Boolean
116−
117− (>>>) :: forall a b c d. (Category a) => a b c -> a c d -> a b d
118−
119− boolAnd :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
120−
121− boolNot :: Prim.Boolean -> Prim.Boolean
122−
123− boolOr :: Prim.Boolean -> Prim.Boolean -> Prim.Boolean
124−
125− const :: forall a b. a -> b -> a
126−
127− flip :: forall a b c. (a -> b -> c) -> b -> a -> c
128−
129− numAdd :: Prim.Number -> Prim.Number -> Prim.Number
130−
131− numAnd :: Prim.Number -> Prim.Number -> Prim.Number
132−
133− numCompare :: Prim.Number -> Prim.Number -> Ordering
134−
135− numComplement :: Prim.Number -> Prim.Number
136−
137− numDiv :: Prim.Number -> Prim.Number -> Prim.Number
138−
139− numMod :: Prim.Number -> Prim.Number -> Prim.Number
140−
141− numMul :: Prim.Number -> Prim.Number -> Prim.Number
142−
143− numNegate :: Prim.Number -> Prim.Number
144−
145− numOr :: Prim.Number -> Prim.Number -> Prim.Number
146−
147− numShl :: Prim.Number -> Prim.Number -> Prim.Number
148−
149− numShr :: Prim.Number -> Prim.Number -> Prim.Number
150−
151− numSub :: Prim.Number -> Prim.Number -> Prim.Number
152−
153− numXor :: Prim.Number -> Prim.Number -> Prim.Number
154−
155− numZshr :: Prim.Number -> Prim.Number -> Prim.Number
156−
157− on :: forall a b c. (b -> b -> c) -> (a -> b) -> a -> a -> c
158−
159− showNumberImpl :: Prim.Number -> Prim.String
160−
161
15
162## Module Data.Eq
16## Module Data.Eq
163
17
164−### Types
165−
166− data Ref a where
167− Ref :: a -> Ref a
168−
169−
170−### Type Classes
171−
172−
173−### Type Class Instances
174−
175− instance eqRef :: Eq (Ref a)
176−
177−
178−### Values
179−
180− liftRef :: forall a b. (a -> a -> b) -> Ref a -> Ref a -> b
181−
182− refEq :: forall a. Ref a -> Ref a -> Prim.Boolean
183−
184− refIneq :: forall a. Ref a -> Ref a -> Prim.Boolean
185−
186−
187−## Module Data.Eq.Unsafe
188−
189### Types
18### Types
190
19
191
20
@@ -197,44 +26,20 @@
197
26
198### Values
27### Values
199
28
200− refEq :: forall a. a -> a -> Prim.Boolean
201−
202− refIneq :: forall a. a -> a -> Prim.Boolean
203−
204
29
205## Module Control.Monad.Eff
30## Module Control.Monad.Eff
206
31
207### Types
32### Types
208
33
209− data Eff :: # ! -> * -> *
210−
211− type Pure a = forall e. Eff e a
212−
213
34
214### Type Classes
35### Type Classes
215
36
216
37
217### Type Class Instances
38### Type Class Instances
218
39
219− instance monadEff :: Monad (Eff e)
220−
221
40
222### Values
41### Values
223
42
224− bindEff :: forall e a b. Eff e a -> (a -> Eff e b) -> Eff e b
225−
226− forE :: forall e. Prim.Number -> Prim.Number -> (Prim.Number -> Eff e { }) -> Eff e { }
227−
228− foreachE :: forall e a. [a] -> (a -> Eff e { }) -> Eff e { }
229−
230− retEff :: forall e a. a -> Eff e a
231−
232− runPure :: forall a. Pure a -> a
233−
234− untilE :: forall e. Eff e Prim.Boolean -> Eff e { }
235−
236− whileE :: forall e a. Eff e Prim.Boolean -> Eff e a -> Eff e { }
237−
238
43
239## Module Control.Monad.Eff.Unsafe
44## Module Control.Monad.Eff.Unsafe
240
45
@@ -249,15 +54,11 @@
249
54
250### Values
55### Values
251
56
252− unsafeInterleaveEff :: forall eff1 eff2 a. Eff eff1 a -> Eff eff2 a
253−
254
57
255## Module Debug.Trace
58## Module Debug.Trace
256
59
257### Types
60### Types
258
61
259− data Trace :: !
260−
261
62
262### Type Classes
63### Type Classes
263
64
@@ -267,21 +68,11 @@
267
68
268### Values
69### Values
269
70
270− print :: forall a r. (Show a) => a -> Eff (trace :: Trace | r) { }
271−
272− trace :: forall r. Prim.String -> Eff (trace :: Trace | r) { }
273−
274
71
275## Module Control.Monad.ST
72## Module Control.Monad.ST
276
73
277### Types
74### Types
278
75
279− data ST :: * -> !
280−
281− data STArray :: * -> * -> *
282−
283− data STRef :: * -> * -> *
284−
285
76
286### Type Classes
77### Type Classes
287
78
@@ -291,23 +82,5 @@
291
82
292### Values
83### Values
293
84
294− modifySTRef :: forall a h r. STRef h a -> (a -> a) -> Eff (st :: ST h | r) a
295−
296− newSTArray :: forall a h r. Prim.Number -> a -> Eff (st :: ST h | r) (STArray h a)
297−
298− newSTRef :: forall a h r. a -> Eff (st :: ST h | r) (STRef h a)
299−
300− peekSTArray :: forall a h r. STArray h a -> Eff (st :: ST h | r) a
301−
302− pokeSTArray :: forall a h r. STArray h a -> Prim.Number -> a -> Eff (st :: ST h | r) a
303−
304− readSTRef :: forall a h r. STRef h a -> Eff (st :: ST h | r) a
305−
306− runST :: forall a r. (forall h. Eff (st :: ST h | r) a) -> Eff r a
307−
308− runSTArray :: forall a r. (forall h. Eff (st :: ST h | r) (STArray h a)) -> Eff r [a]
309−
310− writeSTRef :: forall a h r. STRef h a -> a -> Eff (st :: ST h | r) a
311−
312
85
313
86