Skip to content

Commit

Permalink
Change upload String param to Filename
Browse files Browse the repository at this point in the history
  • Loading branch information
etmoore committed Feb 7, 2021
1 parent aff5bfd commit 9bf6c78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ch09.md
Expand Up @@ -298,7 +298,7 @@ Let's read a file, then upload it directly afterward:
```js
// readFile :: Filename -> Either String (Task Error String)
// httpPost :: String -> String -> Task Error JSON
// upload :: String -> Either String (Task Error JSON)
// upload :: Filename -> Either String (Task Error JSON)
const upload = compose(map(chain(httpPost('/uploads'))), readFile);
```

Expand All @@ -309,7 +309,7 @@ All of this is achieved in one linear left to right flow. This is all pure and d
For contrast, let's look at the standard imperative way to pull this off:

```js
// upload :: String -> (String -> a) -> Void
// upload :: Filename -> (String -> a) -> Void
const upload = (filename, callback) => {
if (!filename) {
throw new Error('You need a filename!');
Expand Down

0 comments on commit 9bf6c78

Please sign in to comment.