packages feed

Spock 0.13.0.0 → 0.14.0.0

raw patch · 5 files changed

+15/−10 lines, 5 filesdep ~Spock-coredep ~resourcetdep ~stm-containersPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: Spock-core, resourcet, stm-containers

API changes (from Hackage documentation)

+ Web.Spock.Config: [sc_cookieEOL] :: SessionCfg conn a st -> CookieEOL
- Web.Spock: (<//>) :: () => Path as Open -> Path bs ps -> Path Append as bs ps
+ Web.Spock: (<//>) :: forall (as :: [Type]) (bs :: [Type]) (ps :: PathState). Path as 'Open -> Path bs ps -> Path (Append as bs) ps
- Web.Spock: data Path (as :: [*]) (pathState :: PathState) :: [*] -> PathState -> *
+ Web.Spock: data Path (as :: [Type]) (pathState :: PathState)
- Web.Spock: data StdMethod :: *
+ Web.Spock: data StdMethod
- Web.Spock: middleware :: (RouteM t, Monad m) => Middleware -> t ctx m ()
+ Web.Spock: middleware :: forall t (m :: Type -> Type) ctx. (RouteM t, Monad m) => Middleware -> t ctx m ()
- Web.Spock: prehook :: (RouteM t, MonadIO m) => ActionCtxT ctx m ctx' -> t ctx' m () -> t ctx m ()
+ Web.Spock: prehook :: forall t (m :: Type -> Type) ctx ctx'. (RouteM t, MonadIO m) => ActionCtxT ctx m ctx' -> t ctx' m () -> t ctx m ()
- Web.Spock: renderRoute :: AllHave ToHttpApiData as => Path as Open -> HVectElim as Text
+ Web.Spock: renderRoute :: forall (as :: [Type]). AllHave ToHttpApiData as => Path as 'Open -> HVectElim as Text
- Web.Spock: root :: Path [] * Open
+ Web.Spock: root :: Path ('[] :: [Type]) 'Open
- Web.Spock: static :: String -> Path [] * Open
+ Web.Spock: static :: String -> Path ('[] :: [Type]) 'Open
- Web.Spock: type Var a = Path (:) * a [] * Open
+ Web.Spock: type Var a = Path '[a] 'Open
- Web.Spock: var :: (Typeable * a, FromHttpApiData a) => Path (:) * a [] * Open
+ Web.Spock: var :: (Typeable a, FromHttpApiData a) => Path '[a] 'Open
- Web.Spock: wildcard :: Path (:) * Text [] * Closed
+ Web.Spock: wildcard :: Path '[Text] 'Closed
- Web.Spock.Config: SessionCfg :: Text -> NominalDiffTime -> Int -> Bool -> a -> SessionStoreInstance (Session conn a st) -> NominalDiffTime -> SessionHooks a -> SessionCfg conn a st
+ Web.Spock.Config: SessionCfg :: Text -> CookieEOL -> NominalDiffTime -> Int -> Bool -> a -> SessionStoreInstance (Session conn a st) -> NominalDiffTime -> SessionHooks a -> SessionCfg conn a st
- Web.Spock.Internal.SessionManager: SessionManager :: m SessionId -> m Text -> m () -> m sess -> (sess -> m ()) -> (forall a. (sess -> (sess, a)) -> m a) -> ((forall n. Monad n => sess -> n sess) -> m ()) -> MonadIO m => m () -> Middleware -> IO () -> SessionManager m conn sess st
+ Web.Spock.Internal.SessionManager: SessionManager :: m SessionId -> m Text -> m () -> m sess -> (sess -> m ()) -> (forall a. (sess -> (sess, a)) -> m a) -> ((forall n. Monad n => sess -> n sess) -> m ()) -> (MonadIO m => m ()) -> Middleware -> IO () -> SessionManager m conn sess st

Files

Spock.cabal view
@@ -1,5 +1,5 @@ name:                Spock-version:             0.13.0.0+version:             0.14.0.0 synopsis:            Another Haskell web framework for rapid development description:         This toolbox provides everything you need to get a quick start into web hacking with haskell:                      .@@ -24,11 +24,11 @@ license-file:        LICENSE author:              Alexander Thiemann <mail@athiemann.net> maintainer:          Alexander Thiemann <mail@athiemann.net>-copyright:           (c) 2013 - 2017 Alexander Thiemann+copyright:           (c) 2013 - 2020 Alexander Thiemann category:            Web build-type:          Simple-cabal-version:       >=1.8-tested-with:         GHC==7.10.2, GHC==8.0.1+cabal-version:       >=2.0+tested-with:         GHC==8.8.4  extra-source-files:     README.md@@ -45,7 +45,7 @@                 Web.Spock.Internal.Monad,                 Web.Spock.Internal.Types   build-depends:-                       Spock-core >= 0.13,+                       Spock-core >= 0.14,                        base >= 4 && < 5,                        base64-bytestring >=1.0,                        bytestring >=0.10,@@ -60,9 +60,9 @@                        mtl >=2.1,                        reroute >=0.5,                        resource-pool >=0.2,-                       resourcet >= 0.4,+                       resourcet >= 1.2.2,                        stm >=2.4,-                       stm-containers >=0.2,+                       stm-containers >= 1.1.0.2,                        text >= 0.11.3.1,                        time >=1.4,                        transformers >=0.3,@@ -71,6 +71,7 @@                        vault >=0.3,                        wai >=3.0   ghc-options: -Wall -fno-warn-orphans+  default-language:    Haskell2010  test-suite spocktests   type:                exitcode-stdio-1.0@@ -98,6 +99,7 @@                        wai-extra    ghc-options: -Wall -fno-warn-orphans+  default-language:    Haskell2010  source-repository head   type:     git
src/Web/Spock/Config.hs view
@@ -43,6 +43,7 @@      return        SessionCfg        { sc_cookieName = "spockcookie"+       , sc_cookieEOL = CookieValidForever        , sc_sessionTTL = 3600        , sc_sessionIdEntropy = 64        , sc_sessionExpandTTL = True
src/Web/Spock/Internal/SessionManager.hs view
@@ -177,7 +177,7 @@       value = sess_id sess       settings =           defaultCookieSettings-          { cs_EOL = CookieValidForever+          { cs_EOL = sc_cookieEOL cfg           , cs_HTTPOnly = True           } 
src/Web/Spock/Internal/SessionVault.hs view
@@ -14,7 +14,7 @@ import Data.Hashable import Focus as F import qualified ListT as L-import qualified STMContainers.Map as STMMap+import qualified StmContainers.Map as STMMap import qualified Data.Text as T  class (Eq (SessionKey s), Hashable (SessionKey s)) => IsSession s where@@ -46,7 +46,7 @@  -- | Get all sessions as list toList :: SessionVault s -> STM [s]-toList =  liftM (map snd) . L.toList . STMMap.stream . unSessionVault+toList =  liftM (map snd) . L.toList . STMMap.listT . unSessionVault  -- | Remove all sessions that do not match the predicate filterSessions :: IsSession s => (s -> Bool) -> SessionVault s -> STM ()
src/Web/Spock/Internal/Types.hs view
@@ -94,6 +94,8 @@    = SessionCfg    { sc_cookieName :: T.Text      -- ^ name of the client side cookie+   , sc_cookieEOL :: CookieEOL+     -- ^ how long the client side cookie should live    , sc_sessionTTL :: NominalDiffTime      -- ^ how long shoud a client session live    , sc_sessionIdEntropy :: Int