Permalink
Browse files

Remove mention of IO (#192)

* Remove mention of IO

as discussed here #189 (comment)

* added myself to the contributors

thanks for having me - even if all I did was delete

* update unsafeThrow mention
  • Loading branch information...
CarstenKoenig authored and kRITZCREEK committed Jul 17, 2018
1 parent 36dae7b commit 8c3b9644390d7bbbe3797fbcfb7b3c03fd1bc992
Showing with 2 additions and 15 deletions.
  1. +1 −0 CONTRIBUTORS.md
  2. +1 −15 language/Differences-from-Haskell.md
View
@@ -37,6 +37,7 @@ If you would prefer to use different terms, please use the section below instead
| [@mattaudesse](https://github.com/mattaudesse) | Matt Audesse | [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/deed) |
| [@juhp](https://github.com/juhp) | Jens Petersen | [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/deed) |
| [@gabejohnson](https://github.com/gabejohnson) | Gabe Johnson | [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/deed) |
| [@carstenkoenig](https://github.com/carstenkoenig) | Carsten König | [CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/deed) |
### Contributors using Modified Terms
@@ -62,20 +62,6 @@ PureScript does not provide syntactic sugar for list types. Construct list types
There is also an `Array` type for native JavaScript arrays, but this does not have the same performance characteristics as `List`. `Array` _values_ can be constructed with `[x, y, z]` literals, but the type still needs to be annotated as `Array a`.
## `IO` vs `Effect`
Haskell uses the `IO` monad to deal with side effects. In PureScript, there is a similar monad called `Effect` that serves the same purpose. For example, in a Haskell program the type signature of `main` will be:
``` haskell
main :: IO ()
```
In PureScript you would write it like this:
``` purescript
main :: Effect Unit
```
## Records
PureScript can encode JavaScript-style objects directly by using row types, so Haskell-style record definitions actually have quite a different meaning in PureScript:
@@ -305,7 +291,7 @@ Note on `DataKinds`: Unlike in Haskell, user-defined kinds are open, and they ar
## `error` and `undefined`
For `error`, you can use `Control.Monad.Eff.Exception.Unsafe.unsafeThrow`, in the `purescript-exceptions` package.
For `error`, you can use `Effect.Exception.Unsafe.unsafeThrow`, in the `purescript-exceptions` package.
`undefined` can be emulated with `Unsafe.Coerce.unsafeCoerce unit :: forall a. a`, which is in the `purescript-unsafe-coerce` package. See also https://github.com/purescript/purescript-prelude/issues/44.

0 comments on commit 8c3b964

Please sign in to comment.