@@ -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 )
1614import Data.Either (Either (..), either )
17- import Data.Tuple ( Tuple (..))
15+ import Data.Maybe ( Maybe (..))
1816import Data.String.Regex as R
1917import Data.String.Regex.Flags as RF
20-
21- import Routing.Parser ( parse )
18+ import Data.Tuple ( Tuple (..))
19+ import Prelude ( Unit , const , pure , unit , ($), (<$) )
2220import Routing.Match (Match , runMatch )
21+ import Routing.Parser (parse )
2322
2423
2524foreign import decodeURIComponent :: String -> String
@@ -53,9 +52,9 @@ matches' decoder routing cb = hashes $ \old new ->
5352matchesAff' :: forall e a . (String -> String ) ->
5453 Match a -> Aff e (Tuple (Maybe a ) a )
5554matchesAff' 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
6059matchesAff :: forall e a . Match a -> Aff e (Tuple (Maybe a ) a )
6160matchesAff = matchesAff' decodeURIComponent
0 commit comments