Skip to content

Commit

Permalink
Merge pull request #403 from JordanMartinez/development
Browse files Browse the repository at this point in the history
Make next minor release: ps-0.13.x-v0.20.1
  • Loading branch information
JordanMartinez authored Nov 8, 2019
2 parents 4ec9c35 + 1fff801 commit cf7ff63
Show file tree
Hide file tree
Showing 9 changed files with 1,165 additions and 1,115 deletions.
3 changes: 2 additions & 1 deletion .procedures/Making-A-New-Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ Steps to follow for making a new release:
2. Use the GitHub's diff in the PR to look over everything and ensure all work is done
- If not, push any other changes
3. Re-generate the ToC and push the change (no further work can be done at this point)
4. Conver the "Draft PR" into a real PR
4. Re-generate the CHANGELOG.md file via `./.generateChangelog.sh TOKEN`
4. Convert the "Draft PR" into a real PR
5. Wait for CI to pass
6. Merge the PR
7. Fetch the latest changes to include the 'PR merge' commit
Expand Down
38 changes: 34 additions & 4 deletions 00-Getting-Started/03-The-REPL.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Exits the REPL, returning control to your shell.

### Reload

#### The Problem

You can only define a binding once. Defining it again with a different expression will output an error
```purescript
x = 5 -- first time
Expand All @@ -100,9 +102,12 @@ add1 = (\x -> x + 1)
times2 = (\x -> x * 3) -- "3" should be "2"
```

#### The Solutions

Ideally, you could just clear the second function's binding and rewrite it. Unfortunately, you cannot do that. You can either:
1. use the `:reload` command to clear out both functions' bindings, redefine the first one, and then define the second one with the correct implementation
2. define a new binding for the correct implementation:

```purescript
-- 1st option
add1 = (\x -> x + 1)
Expand All @@ -117,9 +122,36 @@ times2 = (\x -> x * 3) -- Whoops! "3" should be "2"
times2_fix = (\x -> x * 2) -- define new function with correct implementation
```

3. define your code in a file (as a module) and import that module into your REPL session. Any edits made to this file are picked-up upon a REPL reload.

Create a file containing your REPL script:
```purescript
-- MyModule.file
module MyModule where
import Prelude
add1 = (\x -> x + 1)
times2 = (\x -> x * 3) -- This typo will be fixed later
```

Load script into the REPL:
```
> import MyModule
> times2 4
12
```

Make any edits to this file. For example, change to `times2 = (\x -> x * 2)`. Save file, then reload in existing REPL session. The `MyModule` import will be remembered.
```
> :reload
> times2 4
8
```

### Clear

The same as `:reload` except that all imported modules are also removed. If you do this, you will need to reimport any modules you wish to use. For example, you will likely need to reimport Prelude (`import Prelude`), so that you can use number operations (i.e. `+`, `-`, `/`, `*`) and the `==` function again.
Use `:cl` rather than `:c` to distinguish between this command and `:complete`. This works the same as `:reload` except that all imported modules are also removed. If you do this, you will need to reimport any modules you wish to use. For example, you will likely need to reimport Prelude (`import Prelude`), so that you can use number operations (i.e. `+`, `-`, `/`, `*`) and the `==` function again.

### Browse

Expand Down Expand Up @@ -176,6 +208,4 @@ The REPL will then parse and all of the code, enabling you to use it from that p

### Complete

The REPL does not currently support tab-completion. This command shows the options one might use.

For example, one could type `:complete a`/`:c a` to show what are all of the usuable functions that start with `a`.
The REPL already supports tab-completion. So, this command isn't meant to be used by humans. Rather, it's for tools that need a way to get tab-completion. For context, see [Harry's comment](https://github.com/purescript/purescript/issues/3746#issuecomment-550512591).
3 changes: 2 additions & 1 deletion 00-Getting-Started/04-Other-Important-Info.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ While reading through this repo, the [Functional Programming Jargon](https://git
## Differences From Haskell

If you're coming to PureScript with a Haskell background, be sure to consult the following resources:
- [Introduction to Purescript for Haskell Developers](http://code.adriansieber.com/adrian/adriansieber-com/src/branch/master/posts/_2018-11-01_introduction_to_purescript_for_haskell_developers/main.pdf) (pdf)
- [Introduction to Purescript for Haskell Developers](http://code.adriansieber.com/adrian/adriansieber-com/src/branch/master/posts/_2018-11-01_introduction_to_purescript_for_haskell_developers/main_light.pdf) (pdf)
- [The Purescript Documentation Repo's "Differences from Haskell" page](https://github.com/purescript/documentation/blob/master/language/Differences-from-Haskell.md)

## Use GitHub Search to Find Things Search Engines (i.e. Google) Don't
Expand All @@ -34,6 +34,7 @@ Then, you use a search query like the following:
## Documenation

- Anytime you need to look up the documentation for a package, use [Pursuit](http://pursuit.purescript.org/). Be aware that some of the deprecated packages mentioned above are still posted there.
- Use the [same instructions used by Hoogle](https://github.com/ndmitchell/hoogle/blob/master/README.md#chrome-integration) to add Pursuit as a search engine to your web browser.
- Read [Pursuit's Search Help page](https://pursuit.purescript.org/help/users#searching)
- Some libraries have not been updated to `0.13.4` and are still on the `0.11.7` release. Some still work; others won't. In this work, we will insure that you do not use any such libraries, but be aware of that if you browse the docs on your own.
- Lastly, some libraries have not uploaded their latest versions' documentation. In these cases, we will forewarn you. Fortunately, `spago docs` will produce a local version of the source code's documentation that looks similar to Pursuit. It does not support all the features of Pursuit, but it's better than nothing. To do that, follow these commands:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ But what kinds of things do we compose? In Functional Programming, we compose ty
Algebraic Data Types (ADTs) use Algebra to define the total number of values a given type (i.e. named Set) can have.

There are two videos worth watching in this regard. The table and visualizations that follow merely summarize their points, except for the ideas behind the `List` and `Tree` types in the second video.
- ['Algebraic Data Types' as "Composable Data Types" (stop at 12:40)](https://youtu.be/Up7LcbGZFuo?t=1155)
- ['Algebraic Data Types' as "Composable Data Types" (stop at 29:26)](https://youtu.be/Up7LcbGZFuo?t=1155)
- Same ideas already explained in the above "Power of Composition" video:
- It uses a different syntax than `PureScript` but the ideas still apply.
- [The Algebra of Algebraic Data Types](https://www.youtube.com/watch?v=YScIPA8RbVE)
Expand Down
13 changes: 1 addition & 12 deletions 11-Syntax/02-Foreign-Function-Interface/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,7 @@ Besides compiling to Javascript, Purescript can also compile to other languages.

## Syntax

This folder documents the pattern to follow to write correct FFI code. However, once [FFI-Easy](https://pursuit.purescript.org/packages/purescript-easy-ffi/2.1.2) gets updated to `0.12.0`, we could write the following code:
```purescript
import Data.Foreign.EasyFFI (unsafeForeignFunction, unsafeForeignProcedure)
basicFunction :: Number -> Number -> Number
basicFunction = unsafeForeignFunction [ "x", "y" ] "x + y"
basicEffect :: String -> Effect Unit
basicEffect = unsafeForeignProcedure [ "msg", "" ] "console.log(msg);"
```

Until then, see [Justin Woo's RTD explanation](https://purescript-resources.readthedocs.io/en/latest/ffi.html) for a good explanation on FFI and links.
This folder provides examples of FFI for simple cases regarding the JavaScript backend. However, see [Wrapping JavaScript for PureScript](https://blog.ndk.io/purescript-ffi.html) for more detailed examples as to how to do FFI properly.

You should also look at the Purescript and Javascript source code for Effect.Uncurried:
- [Purescript](https://github.com/purescript/purescript-effect/blob/v2.0.0/src/Effect/Uncurried.purs#L139)
Expand Down
7 changes: 7 additions & 0 deletions 31-Design-Patterns/22-Existential-Types.purs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{-
Note: Certain uses of Existential Types seem to be an Anti-Pattern.
See this post for more details:
https://lukepalmer.wordpress.com/2010/01/24/haskell-antipattern-existential-typeclass/
-}
module Patterns.ExistentialTypes where

import Prelude
Expand Down
34 changes: 27 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@

## [Unreleased](https://github.com/JordanMartinez/purescript-jordans-reference/tree/HEAD)

[Full Changelog](https://github.com/JordanMartinez/purescript-jordans-reference/compare/ps-0.13.x-v0.19.0...HEAD)
[Full Changelog](https://github.com/JordanMartinez/purescript-jordans-reference/compare/ps-0.13.x-v0.20.0...HEAD)

**Implemented enhancements:**

- Link to 'Why isn't FP the norm' video [\#396](https://github.com/JordanMartinez/purescript-jordans-reference/issues/396) [[Getting-Started](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Getting-Started)] [[Helpful-Links](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Helpful-Links)] [[enhancement](https://github.com/JordanMartinez/purescript-jordans-reference/labels/enhancement)]
- Update project to 0.13.4 PS release [\#393](https://github.com/JordanMartinez/purescript-jordans-reference/issues/393) [[Meta](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Meta)] [[enhancement](https://github.com/JordanMartinez/purescript-jordans-reference/labels/enhancement)] [[major-breaking-change](https://github.com/JordanMartinez/purescript-jordans-reference/labels/major-breaking-change)]
- Wrap a 'Show' type class in a newtype [\#300](https://github.com/JordanMartinez/purescript-jordans-reference/issues/300) [[Design-Patterns](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Design-Patterns)] [[enhancement](https://github.com/JordanMartinez/purescript-jordans-reference/labels/enhancement)]
- Define "Best Practices" for writing a binding to other JS libraries [\#96](https://github.com/JordanMartinez/purescript-jordans-reference/issues/96) [[Design-Patterns](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Design-Patterns)] [[enhancement](https://github.com/JordanMartinez/purescript-jordans-reference/labels/enhancement)]

**Closed issues:**

- File existential types [\#49](https://github.com/JordanMartinez/purescript-jordans-reference/issues/49) [[Design-Patterns](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Design-Patterns)] [[ToResearch](https://github.com/JordanMartinez/purescript-jordans-reference/labels/ToResearch)]

**Merged pull requests:**

- REPL command shorthand clarification [\#399](https://github.com/JordanMartinez/purescript-jordans-reference/pull/399) ([milesfrain](https://github.com/milesfrain))
- Fix some spelling mistakes. [\#397](https://github.com/JordanMartinez/purescript-jordans-reference/pull/397) ([meowjesty](https://github.com/meowjesty))
- Make next major release: ps-0.13.x-v0.20.0 [\#394](https://github.com/JordanMartinez/purescript-jordans-reference/pull/394) ([JordanMartinez](https://github.com/JordanMartinez))

## [ps-0.13.x-v0.20.0](https://github.com/JordanMartinez/purescript-jordans-reference/tree/ps-0.13.x-v0.20.0) (2019-10-22)
[Full Changelog](https://github.com/JordanMartinez/purescript-jordans-reference/compare/ps-0.13.x-v0.19.0...ps-0.13.x-v0.20.0)

**Implemented enhancements:**

Expand Down Expand Up @@ -101,6 +121,10 @@

- Wrong syntax in code example [\#357](https://github.com/JordanMartinez/purescript-jordans-reference/issues/357) [[bug](https://github.com/JordanMartinez/purescript-jordans-reference/labels/bug)]

**Merged pull requests:**

- Make next minor release: ps-0.13.x-v0.17.1 [\#365](https://github.com/JordanMartinez/purescript-jordans-reference/pull/365) [[Release-PR](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Release-PR)] ([JordanMartinez](https://github.com/JordanMartinez))

## [ps-0.13.x-v0.17.0](https://github.com/JordanMartinez/purescript-jordans-reference/tree/ps-0.13.x-v0.17.0) (2019-07-25)
[Full Changelog](https://github.com/JordanMartinez/purescript-jordans-reference/compare/ps-0.13.x-v0.16.1...ps-0.13.x-v0.17.0)

Expand Down Expand Up @@ -152,7 +176,6 @@

**Merged pull requests:**

- Make next minor release: ps-0.13.x-v0.17.1 [\#365](https://github.com/JordanMartinez/purescript-jordans-reference/pull/365) [[Release-PR](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Release-PR)] ([JordanMartinez](https://github.com/JordanMartinez))
- Make next major release: ps-0.13.x-v0.16.0 [\#344](https://github.com/JordanMartinez/purescript-jordans-reference/pull/344) [[Release-PR](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Release-PR)] ([JordanMartinez](https://github.com/JordanMartinez))
- Alternative laws chapter [\#342](https://github.com/JordanMartinez/purescript-jordans-reference/pull/342) ([crisoagf](https://github.com/crisoagf))

Expand Down Expand Up @@ -629,6 +652,7 @@
**Merged pull requests:**

- Make next release: ps-0.12.x-v0.9.4 [\#130](https://github.com/JordanMartinez/purescript-jordans-reference/pull/130) [[Release-PR](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Release-PR)] ([JordanMartinez](https://github.com/JordanMartinez))
- minor typo [\#116](https://github.com/JordanMartinez/purescript-jordans-reference/pull/116) ([RAbraham](https://github.com/RAbraham))

## [ps-0.12.x-v0.9.3](https://github.com/JordanMartinez/purescript-jordans-reference/tree/ps-0.12.x-v0.9.3) (2018-10-25)
[Full Changelog](https://github.com/JordanMartinez/purescript-jordans-reference/compare/ps-0.12.x-v0.9.2...ps-0.12.x-v0.9.3)
Expand Down Expand Up @@ -751,7 +775,6 @@

**Merged pull requests:**

- minor typo [\#116](https://github.com/JordanMartinez/purescript-jordans-reference/pull/116) ([RAbraham](https://github.com/RAbraham))
- Make minor release: ps-0.12.x-v0.8.1 [\#88](https://github.com/JordanMartinez/purescript-jordans-reference/pull/88) [[Release-PR](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Release-PR)] ([JordanMartinez](https://github.com/JordanMartinez))

## [ps-0.12.x-v0.8.0](https://github.com/JordanMartinez/purescript-jordans-reference/tree/ps-0.12.x-v0.8.0) (2018-10-02)
Expand Down Expand Up @@ -818,6 +841,7 @@
**Merged pull requests:**

- Make next release: `PS-0.12.x-v0.6.0` [\#63](https://github.com/JordanMartinez/purescript-jordans-reference/pull/63) [[Release-PR](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Release-PR)] ([JordanMartinez](https://github.com/JordanMartinez))
- Make next release: `ps-0.12.x-v0.5.0` [\#57](https://github.com/JordanMartinez/purescript-jordans-reference/pull/57) [[Release-PR](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Release-PR)] ([JordanMartinez](https://github.com/JordanMartinez))

## [ps-0.12.x-v0.6.0](https://github.com/JordanMartinez/purescript-jordans-reference/tree/ps-0.12.x-v0.6.0) (2018-09-09)
[Full Changelog](https://github.com/JordanMartinez/purescript-jordans-reference/compare/ps-0.12.x-v0.5.0...ps-0.12.x-v0.6.0)
Expand All @@ -826,10 +850,6 @@

- Document `main` requirement for running a program [\#50](https://github.com/JordanMartinez/purescript-jordans-reference/issues/50) [[Syntax](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Syntax)] [[enhancement](https://github.com/JordanMartinez/purescript-jordans-reference/labels/enhancement)]

**Merged pull requests:**

- Make next release: `ps-0.12.x-v0.5.0` [\#57](https://github.com/JordanMartinez/purescript-jordans-reference/pull/57) [[Release-PR](https://github.com/JordanMartinez/purescript-jordans-reference/labels/Release-PR)] ([JordanMartinez](https://github.com/JordanMartinez))

## [ps-0.12.x-v0.5.0](https://github.com/JordanMartinez/purescript-jordans-reference/tree/ps-0.12.x-v0.5.0) (2018-09-04)
[Full Changelog](https://github.com/JordanMartinez/purescript-jordans-reference/compare/ps-0.12.x-v0.4.0...ps-0.12.x-v0.5.0)

Expand Down
2 changes: 1 addition & 1 deletion packages.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ let additions =


let upstream =
https://github.com/purescript/package-sets/releases/download/psc-0.13.4-20191021/packages.dhall sha256:205829948db98d5bab8cd74e811de9b0d2a6bf3802031904db4007ee6d773a28
https://github.com/purescript/package-sets/releases/download/psc-0.13.4-20191025/packages.dhall sha256:f9eb600e5c2a439c3ac9543b1f36590696342baedab2d54ae0aa03c9447ce7d4

let overrides = {=}

Expand Down
Loading

0 comments on commit cf7ff63

Please sign in to comment.