Skip to content

Commit 6ff9df4

Browse files
committed
tut27: ready for gist
1 parent 0b9fdfb commit 6ff9df4

File tree

11 files changed

+227
-6
lines changed

11 files changed

+227
-6
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@
1111
*/src/Secret.purs
1212
*/*.sketch
1313
test-build-log.txt
14-
spago-update-log.txt
14+
spago-update-log.txt
15+
*/index.js
20.5 KB
Loading
19.3 KB
Loading

resources/tut27_process_node.png

10.3 KB
Loading
104 KB
Loading
51 KB
Loading

tut27/README.md

Lines changed: 217 additions & 0 deletions
Large diffs are not rendered by default.

tut27/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"clean": "rimraf output && rimraf .spago && rimraf .purs-repl && rimraf .psci_modules",
88
"install": "spago install",
99
"build": "spago build",
10+
"bundle": "spago bundle-app --main Main --to index.js",
1011
"exec": "spago run",
1112
"all": "npm run clean && npm run install && npm run build && npm run exec"
1213
}

tut27/src/Main.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@ names =
2727
pure $
2828
if (length args > 0)
2929
then Right args
30-
else Left "you must enter at least one name"
30+
else Left "you must enter at least one artist"
3131
in
3232
newTask $ \callback -> do
3333
checkArgs >>= \args ->
3434
callback $ either (\e -> rej e) (\xs -> res xs) args
3535
pure $ nonCanceler
3636

37-
findArtist :: String -> TaskE Error Artist
38-
findArtist name = taskOf name
37+
findArtist :: Artist -> TaskE Error Artist
38+
findArtist = taskOf
3939

4040
relatedArtists :: Id -> TaskE Error RelatedArtists
41-
relatedArtists id = taskOf ["Oasis", "Blur"]
41+
relatedArtists _ = taskOf ["John Lennon", "Paul McCartney"]
4242

43-
artistId :: Artist -> TaskE Error Int
43+
artistId :: Artist -> TaskE Error Id
4444
artistId _ = taskOf 10
4545

4646
related :: String -> TaskE Error RelatedArtists

tut28/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"clean": "rimraf output && rimraf .spago && rimraf .purs-repl && rimraf .psci_modules",
88
"install": "spago install",
99
"build": "spago build",
10+
"bundle": "spago bundle-app --main Main --to index.js",
1011
"exec": "spago run",
1112
"all": "npm run clean && npm run install && npm run build && npm run exec"
1213
}

0 commit comments

Comments
 (0)