Skip to content

Commit 088ef5f

Browse files
committed
Merge pull request #55 from kRITZCREEK/0.9
updates for 0.9
2 parents 7428d85 + 9011e1b commit 088ef5f

File tree

11 files changed

+64
-70
lines changed

11 files changed

+64
-70
lines changed

bower.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-console": "^0.1.0",
21-
"purescript-exceptions": "^0.3.0",
22-
"purescript-functions": "^0.1.0",
23-
"purescript-transformers": "^0.8.1"
20+
"purescript-console": "^1.0.0",
21+
"purescript-exceptions": "^1.0.0",
22+
"purescript-functions": "^1.0.0",
23+
"purescript-transformers": "^1.0.0"
2424
}
2525
}

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "pulp build",
6-
"test": "pulp test"
5+
"build": "psc \"src/**/*.purs\" \"bower_components/purescript-*/src/**/*.purs\"",
6+
"test": "psc \"src/**/*.purs\" \"bower_components/purescript-*/src/**/*.purs\" \"test/**/*.purs\" && psc-bundle \"output/**/*.js\" --module Test.Main --main Test.Main | node"
77
},
88
"devDependencies": {
9-
"pulp": "^8.1.0",
10-
"purescript": "^0.7.6",
9+
"purescript": "^0.9.1-rc.1",
1110
"rimraf": "^2.5.2"
1211
}
1312
}

src/Control/Monad/Aff.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* global exports */
22
"use strict";
33

4-
// module Control.Monad.Aff
5-
64
exports._cancelWith = function (nonCanceler, aff, canceler1) {
75
return function(success, error) {
86
var canceler2 = aff(success, error);

src/Control/Monad/Aff.purs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,20 @@ module Control.Monad.Aff
2121
where
2222

2323
import Prelude
24-
25-
import Control.Alt (Alt)
26-
import Control.Alternative (Alternative)
27-
import Control.Monad.Cont.Class (MonadCont)
28-
import Control.Monad.Eff (Eff())
29-
import Control.Monad.Eff.Class (MonadEff)
30-
import Control.Monad.Eff.Exception (Error(), EXCEPTION(), throwException, error)
31-
import Control.Monad.Error.Class (MonadError, throwError)
32-
import Control.Monad.Rec.Class (MonadRec, tailRecM)
33-
import Control.MonadPlus (MonadPlus)
34-
import Control.Plus (Plus)
35-
24+
import Control.Alt (class Alt)
25+
import Control.Alternative (class Alternative)
26+
import Control.Monad.Cont.Class (class MonadCont)
27+
import Control.Monad.Eff (Eff)
28+
import Control.Monad.Eff.Class (class MonadEff)
29+
import Control.Monad.Eff.Exception (Error, EXCEPTION, throwException, error)
30+
import Control.Monad.Error.Class (class MonadError, throwError)
31+
import Control.Monad.Rec.Class (class MonadRec)
32+
import Control.MonadPlus (class MonadZero, class MonadPlus)
33+
import Control.Plus (class Plus)
3634
import Data.Either (Either(..), either, isLeft)
37-
import Data.Foldable (Foldable, foldl)
38-
import Data.Function (Fn2(), Fn3(), runFn2, runFn3)
39-
import Data.Monoid (Monoid, mempty)
35+
import Data.Foldable (class Foldable, foldl)
36+
import Data.Function.Uncurried (Fn2, Fn3, runFn2, runFn3)
37+
import Data.Monoid (class Monoid, mempty)
4038

4139
-- | An asynchronous computation with effects `e`. The computation either
4240
-- | errors or produces a value of type `a`.
@@ -188,6 +186,8 @@ instance plusAff :: Plus (Aff e) where
188186

189187
instance alternativeAff :: Alternative (Aff e)
190188

189+
instance monadZero :: MonadZero (Aff e)
190+
191191
instance monadPlusAff :: MonadPlus (Aff e)
192192

193193
instance monadRecAff :: MonadRec (Aff e) where

src/Control/Monad/Aff/AVar.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* global exports */
22
"use strict";
33

4-
// module Control.Monad.Aff.AVar
5-
64
exports._makeVar = function (nonCanceler) {
75
return function(success, error) {
86
try {
@@ -16,8 +14,8 @@ exports._makeVar = function (nonCanceler) {
1614
}
1715

1816
return nonCanceler;
19-
}
20-
}
17+
};
18+
};
2119

2220
exports._takeVar = function (nonCanceler, avar) {
2321
return function(success, error) {
@@ -32,8 +30,8 @@ exports._takeVar = function (nonCanceler, avar) {
3230
}
3331

3432
return nonCanceler;
35-
}
36-
}
33+
};
34+
};
3735

3836
exports._putVar = function (nonCanceler, avar, a) {
3937
return function(success, error) {
@@ -64,8 +62,8 @@ exports._putVar = function (nonCanceler, avar, a) {
6462
}
6563

6664
return nonCanceler;
67-
}
68-
}
65+
};
66+
};
6967

7068
exports._killVar = function (nonCanceler, avar, e) {
7169
return function(success, error) {
@@ -91,5 +89,5 @@ exports._killVar = function (nonCanceler, avar, e) {
9189
}
9290

9391
return nonCanceler;
94-
}
95-
}
92+
};
93+
};

src/Control/Monad/Aff/AVar.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Prelude
1616
import Control.Monad.Aff (Aff(), Canceler(), nonCanceler)
1717
import Control.Monad.Eff.Exception (Error())
1818

19-
import Data.Function (Fn2(), Fn3(), runFn2, runFn3)
19+
import Data.Function.Uncurried (Fn2(), Fn3(), runFn2, runFn3)
2020

2121
foreign import data AVAR :: !
2222

@@ -33,7 +33,7 @@ makeVar' :: forall e a. a -> AffAVar e (AVar a)
3333
makeVar' a = do
3434
v <- makeVar
3535
putVar v a
36-
return v
36+
pure v
3737

3838
-- | Takes the next value from the asynchronous avar.
3939
takeVar :: forall e a. AVar a -> AffAVar e a

src/Control/Monad/Aff/Class.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Prelude
44

55
import Control.Monad.Aff (Aff())
66
import Control.Monad.Cont.Trans (ContT())
7-
import Control.Monad.Eff.Class (MonadEff)
7+
import Control.Monad.Eff.Class (class MonadEff)
88
import Control.Monad.Except.Trans (ExceptT())
99
import Control.Monad.List.Trans (ListT())
1010
import Control.Monad.Maybe.Trans (MaybeT())
@@ -14,7 +14,7 @@ import Control.Monad.State.Trans (StateT())
1414
import Control.Monad.Trans (lift)
1515
import Control.Monad.Writer.Trans (WriterT())
1616

17-
import Data.Monoid (Monoid)
17+
import Data.Monoid (class Monoid)
1818

1919
class (MonadEff eff m) <= MonadAff eff m where
2020
liftAff :: forall a. Aff eff a -> m a

src/Control/Monad/Aff/Console.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Control.Monad.Aff.Console where
22

33
import Prelude
4-
import qualified Control.Monad.Eff.Console as C
4+
import Control.Monad.Eff.Console as C
55

66
import Control.Monad.Aff (Aff())
77
import Control.Monad.Eff.Class (liftEff)
@@ -11,7 +11,7 @@ import Control.Monad.Eff.Class (liftEff)
1111
log :: forall e. String -> Aff (console :: C.CONSOLE | e) Unit
1212
log = liftEff <<< C.log
1313

14-
-- | Prints any `Show`-able value to the console. This basically saves you
15-
-- | from writing `liftEff $ print x` everywhere.
16-
print :: forall e a. (Show a) => a -> Aff (console :: C.CONSOLE | e) Unit
17-
print = liftEff <<< C.print
14+
-- | Logs any `Show`-able value to the console. This basically saves you
15+
-- | from writing `liftEff $ logShow x` everywhere.
16+
logShow :: forall e a. (Show a) => a -> Aff (console :: C.CONSOLE | e) Unit
17+
logShow = liftEff <<< C.logShow

src/Control/Monad/Aff/Par.purs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ module Control.Monad.Aff.Par
77
) where
88

99
import Prelude
10-
11-
import Control.Alt (Alt)
12-
import Control.Alternative (Alternative)
10+
import Control.Alt (class Alt)
11+
import Control.Alternative (class Alternative)
1312
import Control.Monad.Aff (attempt, cancelWith, forkAff)
14-
import Control.Monad.Aff.AVar (AffAVar(), AVar(), makeVar, makeVar', takeVar, putVar, killVar)
15-
import Control.Monad.Eff.Exception (Error())
16-
import Control.Plus (Plus, empty)
17-
18-
import Data.Either (Either(), either)
19-
import Data.Monoid (Monoid, mempty)
13+
import Control.Monad.Aff.AVar (AffAVar, AVar, makeVar, makeVar', takeVar, putVar, killVar)
14+
import Control.Monad.Eff.Exception (Error)
15+
import Control.Plus (class Plus, empty)
16+
import Data.Either (Either, either)
17+
import Data.Monoid (class Monoid, mempty)
2018

2119
newtype Par e a = Par (AffAVar e a)
2220

@@ -51,7 +49,7 @@ instance altPar :: Alt (Par e) where
5149
alt (Par a1) (Par a2) =
5250
let maybeKill va ve err = do
5351
e <- takeVar ve
54-
if e == 1 then killVar va err else return unit
52+
if e == 1 then killVar va err else pure unit
5553
putVar ve (e + 1)
5654
in Par do
5755
va <- makeVar -- the `a` value

src/Control/Monad/Aff/Unsafe.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/* global exports */
22
"use strict";
33

4-
// module Control.Monad.Aff.Unsafe
5-
64
exports.unsafeTrace = function (v) {
75
return function(success, error) {
86
console.log(v);
@@ -20,13 +18,13 @@ exports.unsafeTrace = function (v) {
2018
success(false);
2119

2220
return nonCanceler;
23-
}
21+
};
2422
};
2523

2624
return nonCanceler;
2725
};
28-
}
26+
};
2927

3028
exports.unsafeInterleaveAff = function (aff) {
3129
return aff;
32-
}
30+
};

0 commit comments

Comments
 (0)