From bb3decc9008831e1fc3ab29ba54c689140806ba3 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Wed, 20 Sep 2017 21:11:31 +0200 Subject: [PATCH 1/2] Updates for purescript-aff-4.0.0 --- bower.json | 2 +- src/Routing.purs | 17 ++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index 28a27e5..8bad8b0 100644 --- a/bower.json +++ b/bower.json @@ -35,7 +35,7 @@ "purescript-semirings": "^4.0.0", "purescript-tuples": "^4.0.0", "purescript-validation": "^3.0.0", - "purescript-aff": "^3.0.0", + "purescript-aff": "^4.0.0", "purescript-control": "^3.0.0", "purescript-console": "^3.0.0", "purescript-integers": "^3.0.0" diff --git a/src/Routing.purs b/src/Routing.purs index 128890d..4e0f7bd 100644 --- a/src/Routing.purs +++ b/src/Routing.purs @@ -9,17 +9,16 @@ module Routing ( matchesAff' ) where -import Prelude (Unit, unit, pure, const, ($)) -import Control.Monad.Eff (Eff()) -import Control.Monad.Aff (Aff(), makeAff) -import Data.Maybe (Maybe(..)) +import Control.Monad.Aff (Aff, makeAff, nonCanceler) +import Control.Monad.Eff (Eff) import Data.Either (Either(..), either) -import Data.Tuple (Tuple(..)) +import Data.Maybe (Maybe(..)) import Data.String.Regex as R import Data.String.Regex.Flags as RF - -import Routing.Parser (parse) +import Data.Tuple (Tuple(..)) +import Prelude (Unit, const, pure, unit, ($), (<$)) import Routing.Match (Match, runMatch) +import Routing.Parser (parse) foreign import decodeURIComponent :: String -> String @@ -53,9 +52,9 @@ matches' decoder routing cb = hashes $ \old new -> matchesAff' :: forall e a. (String -> String) -> Match a -> Aff e (Tuple (Maybe a) a) matchesAff' decoder routing = - makeAff \_ k -> do + makeAff \k -> nonCanceler <$ matches' decoder routing \old new -> - k $ Tuple old new + k $ Right $ Tuple old new matchesAff :: forall e a. Match a -> Aff e (Tuple (Maybe a) a) matchesAff = matchesAff' decodeURIComponent From bc5f5a70723b3356ab25d70e1c433836134450c4 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Fri, 22 Sep 2017 14:43:57 +0200 Subject: [PATCH 2/2] Fixed npm buid script. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a6271ca..da76be2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "private": true, "scripts": { "clean": "rimraf output && rimraf .pulp-cache", - "build": "pulp build --censor-lib --strict", + "build": "pulp build -- --censor-lib --strict", "test": "pulp test" }, "devDependencies": {