Skip to content

Commit 4f6c0e3

Browse files
authored
Update the documentation with some upcoming v0.14.0 changes (#362)
* Update documentation for the deprecation of MonadZero * Update documentation for type synonym instances * Update documentation for roles and Coercible * Update documentation for the deprecation of the # kind * Remove mentions of Eff and effect rows * Add PolyKinds to the Haskell extensions list * Add StandaloneKindSignatures to the Haskell extensions list
1 parent 130fd60 commit 4f6c0e3

File tree

6 files changed

+14
-17
lines changed

6 files changed

+14
-17
lines changed

guides/FFI-Tips.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,20 @@ exports.doSomethingImpl = function(isJust, show, value) {
115115

116116
By moving the `show` reference out to `showSomething` the compiler will pick the right `Show` instance for us at that point, so we don't have to deal with typeclass dictionaries in `showSomethingImpl`.
117117

118-
## Why Doesn't my `Eff` Work When Passed to a Normal JS Function?
118+
## Why Doesn't my `Effect` Work When Passed to a Normal JS Function?
119119

120120
["Representing Side Effects"](https://book.purescript.org/chapter10.html#representing-side-effects) in *PureScript by Example*.
121121

122122
In order to avoid prematurely evaluating effects (or evaluating effects that should not be evaluated at all), PureScript wraps them in constant functions:
123123

124124
```javascript
125-
exports.myEff = function() {
125+
exports.myEffect = function() {
126126
return doSomethingEffectful(1, 2, 3);
127127
}
128128
```
129129

130130
which is imported to PureScript as:
131131

132132
```purescript
133-
foreign import myEff :: forall eff. Eff (myEff :: MYEFF | eff) SomeType
133+
foreign import myEffect :: Effect SomeType
134134
```

language/Differences-from-Haskell.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,13 @@ In the past, PureScript used `return`. However, it is now removed and replaced w
209209

210210
## Array Comprehensions
211211

212-
PureScript does not provide special syntax for array comprehensions. Instead, use `do`-notation. The `guard` function from the `Control.MonadPlus` module in `purescript-control` can be used to filter results:
212+
PureScript does not provide special syntax for array comprehensions. Instead, use `do`-notation. The `guard` function from the `Control.Alternative` module in `purescript-control` can be used to filter results:
213213

214214
```purescript
215215
import Prelude (($), (*), (==), bind, pure)
216216
import Data.Array ((..))
217217
import Data.Tuple (Tuple(..))
218-
import Control.MonadZero (guard)
218+
import Control.Alternative (guard)
219219
220220
factors :: Int -> Array (Tuple Int Int)
221221
factors n = do
@@ -286,6 +286,10 @@ The PureScript compiler does not support GHC-like language extensions. However,
286286
* RankNTypes
287287
* RebindableSyntax
288288
* ScopedTypeVariables
289+
* TypeSynonymInstances
290+
* RoleAnnotations
291+
* PolyKinds
292+
* StandaloneKindSignatures
289293

290294
Note on `DataKinds`: Unlike in Haskell, user-defined kinds are open, and they are not promoted, which means that their constructors can only be used in types, and not in values. For more information about the kind system, see https://github.com/purescript/documentation/blob/master/language/Types.md#kind-system
291295

language/FFI.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ foreign import document :: {
3838
}
3939
```
4040

41-
When declaring types in this way, you may declare your type to have any kind, not just `Type`. For example, to declare a row of effects:
41+
When declaring types in this way, you may declare your type to have any kind, not just `Type`. For example, to declare a row of symbols:
4242

4343
```purescript
44-
foreign import data MyRow :: # Effect
44+
foreign import data MyRow :: Row Symbol
4545
```

language/Records.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ Fields of records can be accessed using a dot, followed by the label of the fiel
2424

2525
`{ ... }` is just syntactic sugar for the `Record` type constructor, so `{ language :: String }` is the same as `Record ( language :: String )`.
2626

27-
The Record type constructor is parameterized by a row of types. In kind notation, `Record` has kind `# Type -> Type`. That is, it takes a row of types to a type.
27+
The Record type constructor is parameterized by a row of types. In kind notation, `Record` has kind `Row Type -> Type`. That is, it takes a row of types to a type.
2828

29-
`( language :: String )` denotes a row of types (something of kind `# Type`), so it can be passed to `Record` to construct a type, namely `Record ( language :: String )`.
29+
`( language :: String )` denotes a row of types (something of kind `Row Type`), so it can be passed to `Record` to construct a type, namely `Record ( language :: String )`.
3030

3131
## Extending Records
3232

language/Type-Classes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,4 @@ Other classes
237237
- [`Partial`](https://pursuit.purescript.org/builtins/docs/Prim#t:Partial)
238238
- [`Fail`](https://pursuit.purescript.org/builtins/docs/Prim.TypeError#t:Fail)
239239
- [`Warn`](https://pursuit.purescript.org/builtins/docs/Prim.TypeError#t:Warn)
240+
- [`Coercible`](https://pursuit.purescript.org/builtins/docs/Prim.Coerce#t:Coercible)

language/Types.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,8 @@ mkDoubledFoo foo bar = { foo: 2.0*foo, bar: 2.0*bar }
201201
-- (Remember that Bar Number is the same as Foo)
202202
doubleFoo :: Foo -> Foo
203203
doubleFoo = combineBar mkDoubledFoo
204-
205-
-- Define type synonyms to help write complex Effect rows
206-
-- This will accept further Effects to be added to the row
207-
type RandomConsoleEffects eff = ( random :: RANDOM, console :: CONSOLE | eff )
208-
-- This limits the Effects to just RANDOM and CONSOLE
209-
type RandomConsoleEffect = RandomConsoleEffects ()
210204
```
211205

212-
Unlike newtypes, type synonyms are merely aliases and cannot be distinguished from usages of their expansion. Because of this they cannot be used to declare a type class instance. For more see [``TypeSynonymInstance`` Error](../errors/TypeSynonymInstance.md#typesynonyminstance-error).
213-
214206
## Constrained Types
215207

216208
Polymorphic types may be predicated on one or more ``constraints``. See the chapter on type classes for more information.

0 commit comments

Comments
 (0)