Skip to content
This repository was archived by the owner on Oct 23, 2018. It is now read-only.

Commit 2bcdbb9

Browse files
committed
update to 0.12 and psc-package
1 parent cf0b510 commit 2bcdbb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+300
-397
lines changed

exercises/chapter10/src/Control/Monad/Eff/Alert.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
module Control.Monad.Eff.Alert where
1+
module Effect.Alert where
22

33
import Prelude
44

5-
import Control.Monad.Eff (kind Effect, Eff)
5+
import Effect (kind Effect, Effect)
66

77
foreign import data ALERT :: Effect
88

exercises/chapter10/src/Control/Monad/Eff/Storage.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
module Control.Monad.Eff.Storage where
1+
module Effect.Storage where
22

33
import Prelude
44

5-
import Control.Monad.Eff (kind Effect, Eff)
5+
import Effect (kind Effect, Effect)
66
import Data.Foreign (Foreign)
77

88
foreign import data STORAGE :: Effect

exercises/chapter10/src/Main.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ module Main where
22

33
import Prelude
44

5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Alert (ALERT, alert)
7-
import Control.Monad.Eff.Console (CONSOLE, log)
8-
import Control.Monad.Eff.Storage (STORAGE, setItem, getItem)
5+
import Effect (Effect)
6+
import Effect.Alert (ALERT, alert)
7+
import Effect.Console (log)
8+
import Effect.Storage (STORAGE, setItem, getItem)
99
import Control.Monad.Except (runExcept)
1010
import DOM (DOM)
1111
import DOM.HTML (window)

exercises/chapter11/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/output/
66
/node_modules/
77
/bower_components/
8+
.psc-package
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "chapter2",
3+
"set": "psc-0.12.0-20180625",
4+
"source": "https://github.com/purescript/package-sets.git",
5+
"depends": [
6+
"console",
7+
"math",
8+
"node-readline",
9+
"prelude",
10+
"strings",
11+
"transformers"
12+
]
13+
}

exercises/chapter11/src/Main.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ module Main where
22

33
import Prelude
44
import Node.ReadLine as RL
5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Console (CONSOLE, log)
7-
import Control.Monad.Eff.Exception (EXCEPTION)
5+
import Effect (Effect)
6+
import Effect.Console (log)
87
import Control.Monad.RWS (RWSResult(..), runRWS)
98
import Data.Either (Either(..))
109
import Data.Foldable (for_)

exercises/chapter12/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
/output/
66
/node_modules/
77
/bower_components/
8+
.psc-package

exercises/chapter12/bower.json

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "chapter2",
3+
"set": "psc-0.12.0-20180625",
4+
"source": "https://github.com/purescript/package-sets.git",
5+
"depends": [
6+
"console",
7+
"functions",
8+
"lists",
9+
"math",
10+
"parallel",
11+
"prelude",
12+
"refs",
13+
"strings",
14+
"transformers"
15+
]
16+
}

exercises/chapter12/src/Files.purs

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,50 +3,48 @@ module Files where
33
import Prelude
44

55
import Control.Monad.Cont.Trans (ContT(..))
6-
import Control.Monad.Eff (kind Effect, Eff)
6+
import Effect (Effect)
77
import Control.Monad.Except.Trans (ExceptT(..))
88
import Data.Either (Either(..))
99
import Data.Function.Uncurried (Fn4, Fn3, runFn4, runFn3)
1010
import Types (Async)
1111

12-
foreign import data FS :: Effect
13-
1412
type ErrorCode = String
1513

1614
type FilePath = String
1715

1816
foreign import readFileImpl ::
19-
forall eff. Fn3 FilePath
20-
(String -> Eff (fs :: FS | eff) Unit)
21-
(ErrorCode -> Eff (fs :: FS | eff) Unit)
22-
(Eff (fs :: FS | eff) Unit)
17+
Fn3 FilePath
18+
(String -> Effect Unit)
19+
(ErrorCode -> Effect Unit)
20+
(Effect Unit)
2321

2422
foreign import writeFileImpl ::
25-
forall eff. Fn4 FilePath
23+
Fn4 FilePath
2624
String
27-
(Eff (fs :: FS | eff) Unit)
28-
(ErrorCode -> Eff (fs :: FS | eff) Unit)
29-
(Eff (fs :: FS | eff) Unit)
25+
(Effect Unit)
26+
(ErrorCode -> Effect Unit)
27+
(Effect Unit)
3028

31-
readFile :: forall eff. FilePath -> (Either ErrorCode String -> Eff (fs :: FS | eff) Unit) -> Eff (fs :: FS | eff) Unit
29+
readFile :: FilePath -> (Either ErrorCode String -> Effect Unit) -> Effect Unit
3230
readFile path k = runFn3 readFileImpl path (k <<< Right) (k <<< Left)
3331

34-
writeFile :: forall eff. FilePath -> String -> (Either ErrorCode Unit -> Eff (fs :: FS | eff) Unit) -> Eff (fs :: FS | eff) Unit
32+
writeFile :: FilePath -> String -> (Either ErrorCode Unit -> Effect Unit) -> Effect Unit
3533
writeFile path text k = runFn4 writeFileImpl path text (k $ Right unit) (k <<< Left)
3634

37-
readFileCont :: forall eff. FilePath -> Async (fs :: FS | eff) (Either ErrorCode String)
35+
readFileCont :: FilePath -> Async (Either ErrorCode String)
3836
readFileCont path = ContT $ readFile path
3937

40-
writeFileCont :: forall eff. FilePath -> String -> Async (fs :: FS | eff) (Either ErrorCode Unit)
38+
writeFileCont :: FilePath -> String -> Async (Either ErrorCode Unit)
4139
writeFileCont path text = ContT $ writeFile path text
4240

43-
readFileContEx :: forall eff. FilePath -> ExceptT ErrorCode (Async (fs :: FS | eff)) String
41+
readFileContEx :: FilePath -> ExceptT ErrorCode Async String
4442
readFileContEx path = ExceptT $ readFileCont path
4543

46-
writeFileContEx :: forall eff. FilePath -> String -> ExceptT ErrorCode (Async (fs :: FS | eff)) Unit
44+
writeFileContEx :: FilePath -> String -> ExceptT ErrorCode Async Unit
4745
writeFileContEx path text = ExceptT $ writeFileCont path text
4846

49-
copyFileContEx :: forall eff. FilePath -> FilePath -> ExceptT ErrorCode (Async (fs :: FS | eff)) Unit
47+
copyFileContEx :: FilePath -> FilePath -> ExceptT ErrorCode Async Unit
5048
copyFileContEx src dest = do
5149
content <- readFileContEx src
5250
writeFileContEx dest content

0 commit comments

Comments
 (0)