From 04c402f30e6bda5b304a7bb3b39c78787238c884 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Tue, 2 May 2017 17:40:05 +0200 Subject: [PATCH] updates for purescript-0.11 --- bower.json | 4 ++-- src/React/Redux.purs | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/bower.json b/bower.json index 8528986..fe54bdd 100644 --- a/bower.json +++ b/bower.json @@ -16,7 +16,7 @@ "!src/**/*" ], "dependencies": { - "purescript-profunctor-lenses": "^2.1.0", - "purescript-react": "^2.0.0" + "purescript-profunctor-lenses": "^3.2.0", + "purescript-react": "^3.0.0" } } diff --git a/src/React/Redux.purs b/src/React/Redux.purs index 50b7b8e..d59cc4f 100644 --- a/src/React/Redux.purs +++ b/src/React/Redux.purs @@ -34,20 +34,16 @@ module React.Redux , fromEnhancerForeign ) where -import Prelude (Unit, (>>=), (<<<), const, pure, id, unit) - -import Control.Monad.Eff (Eff) +import React as React +import Control.Monad.Eff (Eff, kind Effect) import Control.Monad.Eff.Class (class MonadEff, liftEff) - import Data.Either (Either, either) import Data.Function.Uncurried (Fn2, Fn3, runFn2, runFn3) import Data.Lens (Getter', Lens', Prism', matching, set, to, view) import Data.Tuple (Tuple(..), fst) - +import Prelude (Unit, (>>=), (<<<), const, pure, id, unit) import Unsafe.Coerce (unsafeCoerce) -import React as React - type ReduxReactClass' state props = ReduxReactClass state Unit props type Reducer action state = action -> state -> state @@ -165,11 +161,11 @@ reducerOptic lens prism k action state = either (const state) (\a -> set lens (k action' :: Either action action' action' = matching prism action -foreign import data REDUX :: ! +foreign import data REDUX :: Effect -foreign import data Store :: * -> * -> * +foreign import data Store :: Type -> Type -> Type -foreign import data ReduxReactClass :: * -> * -> * -> * +foreign import data ReduxReactClass :: Type -> Type -> Type -> Type foreign import connect_ :: forall state props props'. Fn3 (state -> props -> Tuple state props) (Tuple state props -> props') (React.ReactClass props') (ReduxReactClass state props props')