Skip to content

Commit 682ed92

Browse files
sjsyrekhdgarrood
authored andcommitted
Fix typos and various other errors (#131)
I only fixed typos and one grammatical problem. I added clarifying punctuation in a few places. I added missing backticks for consistency (e.g. the Prelude library in line 323). I noted this line: >* `Monoid` has a superclass `Semigroup`, which provides `(<>)`, and does not require an identity. Haskell has `Semigroup` now, so you may want to indicate as much, but I didn't go ahead and make this change, myself.
1 parent 5898676 commit 682ed92

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

language/Differences-from-Haskell.md

+7-8
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ ap :: forall m a b. (Monad m) => m (a -> b) -> m a -> m b
5050

5151
### Numbers
5252

53-
There is a native `Number` type which represents JavaScript's standard IEEE754 float and an `Int` which is restricted to the range of32bit integers.InJavaScript the `Int` values and operations are generated with a `|0` postfix to achieve this, e.g.if you have variables `x`, `y`, and`z`oftype `Int`, then the PureScript expression `(x + y) * z` would compile to `((x + y)|0* z)|0`.
53+
There is a native `Number` type which represents JavaScript's standard IEEE754 float and an `Int` which is restricted to the range of32-bit integers.InJavaScript, the `Int` values and operations are generated with a `|0` postfix to achieve this, e.g.if you have variables `x`, `y`, and`z`oftype `Int`, then the PureScript expression `(x + y) * z` would compile to `((x + y)|0* z)|0`.
5454

5555
### Unit
5656

@@ -64,7 +64,7 @@ There is also an `Array` type for native JavaScript arrays, but this does not ha
6464

6565
## `IO` vs `Eff`
6666

67-
Haskell uses the `IO` monad to deal with side effects, inPureScript there is a monad called `Eff` that serves the same purpose but can track side effects with more granularity.For example, in a Haskell program the type signature of`main` will be:
67+
Haskell uses the `IO` monad to deal with side effects.InPureScript, there is a monad called `Eff` that serves the same purpose but can track side effects with more granularity.For example, in a Haskell program the type signature of`main` will be:
6868

6969
``` haskell
7070
main::IO()
@@ -123,14 +123,14 @@ setX :: Number -> PointRec -> PointRec
123123
setX val point = point { x = val }
124124
```
125125

126-
A common mistake to look out for is when writing a function that accepts a data type like the original `Point` above, is that the object is still wrapped inside `Point` so something like this will fail:
126+
A common mistake to look out for is when writing a function that accepts a data type like the original `Point` abovethe object is still wrapped inside `Point`, so something like this will fail:
127127

128128
```purescript
129129
showPoint :: Point -> String
130130
showPoint p = show p.x <> ", " <> show p.y
131131
```
132132

133-
Instead we need to destructure `Point` to get at the object:
133+
Instead, we need to destructure `Point` to get at the object:
134134

135135
```purescript
136136
showPoint :: Point -> String
@@ -199,7 +199,7 @@ When instances cannot be declared in the same module, one way to work around it
199199

200200
### Default members
201201

202-
At the moment it is not possible to declare default member implementations for type classes. This may change in the future.
202+
At the moment, it is not possible to declare default member implementations for type classes. This may change in the future.
203203

204204
### Type class hierarchies
205205

@@ -223,7 +223,7 @@ The `<<<` operator is actually a more general morphism composition operator that
223223

224224
## `return`
225225

226-
In the past, PureScript used `return`. However, it is now removed and replaced with [`pure`](https://pursuit.purescript.org/packages/purescript-prelude/1.1.0/docs/Control.Applicative#v:pure). It was always an alias for pure, which means this change was implemented by simply removing the alias.
226+
In the past, PureScript used `return`. However, it is now removed and replaced with [`pure`](https://pursuit.purescript.org/packages/purescript-prelude/1.1.0/docs/Control.Applicative#v:pure). It was always an alias for `pure`, which means this change was implemented by simply removing the alias.
227227

228228
## Array Comprehensions
229229

@@ -320,10 +320,9 @@ When writing documentation, the pipe character `|` must appear at the start of e
320320
As PureScript has not inherited Haskell's legacy code, some operators and functions that are common in Haskell have different names in PureScript:
321321

322322
-`(>>)` is `(*>)`, as `Apply` is a superclass of `Monad` so there is no need to have an `Monad`-specialised version.
323-
- Since 0.9.1, the Prelude library does not contain `(++)` as a second alias for `append` / `(<>)` (`mappend` in Haskell) anymore.
323+
- Since 0.9.1, the `Prelude` library does not contain `(++)` as a second alias for `append` / `(<>)` (`mappend` in Haskell) anymore.
324324
-`mapM` is `traverse`, as this is a more general form that applies to any traversable structure, not just lists. Also it only requires `Applicative` rather than `Monad`. Similarly, `liftM` is `map`.
325325
- Many functions that are part of `Data.List` in Haskell are provided in a more generic form in `Data.Foldable` or `Data.Traversable`.
326326
-`some` and `many` are defined with the type of list they operate on (`Data.Array` or `Data.List`).
327327
- Instead of `_foo` for typed holes, use `?foo`. You have to name the hole; `?` is not allowed.
328328
- Ranges are written as `1..2` rather than `[1..2]`
329-

0 commit comments

Comments
 (0)
close