Skip to content

Commit eb46b90

Browse files
committed
Updates for RC
1 parent 250924c commit eb46b90

4 files changed

Lines changed: 17 additions & 21 deletions

File tree

bower.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
"package.json"
2525
],
2626
"dependencies": {
27-
"purescript-identity": "~0.4.0",
28-
"purescript-eff": "~0.1.0",
29-
"purescript-either": "~0.2.0",
30-
"purescript-st": "~0.1.0"
27+
"purescript-identity": "^0.4.0",
28+
"purescript-eff": "^0.1.0",
29+
"purescript-either": "^0.2.0",
30+
"purescript-st": "^0.1.0"
3131
},
3232
"devDependencies": {
33-
"purescript-console": "~0.1.0"
33+
"purescript-console": "^0.1.0"
3434
}
3535
}

docs/Control.Monad.Rec.Class.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ class (Monad m) <= MonadRec m where
77
tailRecM :: forall a b. (a -> m (Either a b)) -> a -> m b
88
```
99

10-
##### Instances
11-
``` purescript
12-
instance monadRecIdentity :: MonadRec Identity
13-
instance monadRecEff :: MonadRec (Eff eff)
14-
```
15-
1610
This type class captures those monads which support tail recursion in constant stack space.
1711

1812
The `tailRecM` function takes a step function, and applies that step function recursively
@@ -34,6 +28,12 @@ loopWriter n = tailRecM go n
3428
return (Left (n - 1))
3529
```
3630

31+
##### Instances
32+
``` purescript
33+
instance monadRecIdentity :: MonadRec Identity
34+
instance monadRecEff :: MonadRec (Eff eff)
35+
```
36+
3737
#### `tailRecM2`
3838

3939
``` purescript

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"devDependencies": {
44
"gulp": "^3.8.11",
55
"gulp-plumber": "^1.0.0",
6-
"gulp-purescript": "^0.5.0",
7-
"gulp-run": "~1.6.7",
6+
"gulp-purescript": "^0.5.0-rc.1",
7+
"gulp-run": "^1.6.7",
88
"rimraf": "^2.3.3"
99
}
1010
}

test/Test/Main.purs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
module Test.Main where
22

33
import Prelude
4-
5-
import Console
64
import Control.Monad (when)
7-
import Control.Monad.Eff
5+
import Control.Monad.Eff (Eff())
6+
import Control.Monad.Eff.Console (CONSOLE(), log, print)
87
import Control.Monad.Rec.Class
9-
import Data.Either
10-
import Data.Identity
11-
import Data.Maybe
12-
-- import Data.Monoid
13-
-- import Data.Monoid.Additive
8+
import Data.Either (Either(..))
149

1510
-- | Compute the nth triangle number
1611
triangle :: Int -> Eff (console :: CONSOLE) Int
@@ -41,6 +36,7 @@ mutual = tailRec go <<< Left
4136
odd 0 = Right false
4237
odd n = Left (Left (n - 1))
4338

39+
main :: Eff (console :: CONSOLE) Unit
4440
main = do
4541
triangle 10
4642
print $ mutual 1000001

0 commit comments

Comments
 (0)