Skip to content

Commit ab4c9ed

Browse files
authored
Merge pull request #44 from coot/purescript-aff-4.0.0
Updates for purescript-aff-4.0.0
2 parents 1c1aa3c + bc5f5a7 commit ab4c9ed

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"purescript-semirings": "^4.0.0",
3636
"purescript-tuples": "^4.0.0",
3737
"purescript-validation": "^3.0.0",
38-
"purescript-aff": "^3.0.0",
38+
"purescript-aff": "^4.0.0",
3939
"purescript-control": "^3.0.0",
4040
"purescript-console": "^3.0.0",
4141
"purescript-integers": "^3.0.0"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"private": true,
33
"scripts": {
44
"clean": "rimraf output && rimraf .pulp-cache",
5-
"build": "pulp build --censor-lib --strict",
5+
"build": "pulp build -- --censor-lib --strict",
66
"test": "pulp test"
77
},
88
"devDependencies": {

src/Routing.purs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,16 @@ module Routing (
99
matchesAff'
1010
) where
1111

12-
import Prelude (Unit, unit, pure, const, ($))
13-
import Control.Monad.Eff (Eff())
14-
import Control.Monad.Aff (Aff(), makeAff)
15-
import Data.Maybe (Maybe(..))
12+
import Control.Monad.Aff (Aff, makeAff, nonCanceler)
13+
import Control.Monad.Eff (Eff)
1614
import Data.Either (Either(..), either)
17-
import Data.Tuple (Tuple(..))
15+
import Data.Maybe (Maybe(..))
1816
import Data.String.Regex as R
1917
import Data.String.Regex.Flags as RF
20-
21-
import Routing.Parser (parse)
18+
import Data.Tuple (Tuple(..))
19+
import Prelude (Unit, const, pure, unit, ($), (<$))
2220
import Routing.Match (Match, runMatch)
21+
import Routing.Parser (parse)
2322

2423

2524
foreign import decodeURIComponent :: String -> String
@@ -53,9 +52,9 @@ matches' decoder routing cb = hashes $ \old new ->
5352
matchesAff' :: forall e a. (String -> String) ->
5453
Match a -> Aff e (Tuple (Maybe a) a)
5554
matchesAff' decoder routing =
56-
makeAff \_ k -> do
55+
makeAff \k -> nonCanceler <$
5756
matches' decoder routing \old new ->
58-
k $ Tuple old new
57+
k $ Right $ Tuple old new
5958

6059
matchesAff :: forall e a. Match a -> Aff e (Tuple (Maybe a) a)
6160
matchesAff = matchesAff' decodeURIComponent

0 commit comments

Comments
 (0)