haxl 0.4.0.2 → 0.5.0.0
raw patch · 9 files changed
+42/−38 lines, 9 filesdep −directorydep ~aesondep ~basedep ~timePVP ok
version bump matches the API change (PVP)
Dependencies removed: directory
Dependency ranges changed: aeson, base, time, vector
API changes (from Hackage documentation)
- Haxl.Core: MemoFingerprintKey :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> Addr# -> Addr# -> MemoFingerprintKey a
- Haxl.Core: class Show1 f
- Haxl.Core: show1 :: Show1 f => f a -> String
- Haxl.Core.Exception: instance Data.Aeson.Types.Class.ToJSON Haxl.Core.Exception.HaxlException
- Haxl.Core.Memo: MemoFingerprintKey :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> Addr# -> Addr# -> MemoFingerprintKey a
- Haxl.Core.Show1: class Show1 f
- Haxl.Core.Show1: show1 :: Show1 f => f a -> String
- Haxl.Core.Types: instance Data.Aeson.Types.Class.ToJSON Haxl.Core.Types.DataSourceRoundStats
- Haxl.Core.Types: instance Data.Aeson.Types.Class.ToJSON Haxl.Core.Types.RoundStats
- Haxl.Core.Types: instance Data.Aeson.Types.Class.ToJSON Haxl.Core.Types.Stats
- Haxl.Prelude: instance (u1 ~ u2) => Haxl.Prelude.IfThenElse (Haxl.Core.Monad.GenHaxl u1 GHC.Types.Bool) (Haxl.Core.Monad.GenHaxl u2 a)
+ Haxl.Core: [MemoFingerprintKey] :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> Addr# -> Addr# -> MemoFingerprintKey a
+ Haxl.Core: class ShowP f
+ Haxl.Core: data family State f;
+ Haxl.Core: showp :: ShowP f => f a -> String
+ Haxl.Core: }
+ Haxl.Core.Exception: instance Data.Aeson.Types.ToJSON.ToJSON Haxl.Core.Exception.HaxlException
+ Haxl.Core.Memo: [MemoFingerprintKey] :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> Addr# -> Addr# -> MemoFingerprintKey a
+ Haxl.Core.ShowP: class ShowP f
+ Haxl.Core.ShowP: showp :: ShowP f => f a -> String
+ Haxl.Core.StateStore: data family State f;
+ Haxl.Core.StateStore: }
+ Haxl.Core.Types: instance Data.Aeson.Types.ToJSON.ToJSON Haxl.Core.Types.DataSourceRoundStats
+ Haxl.Core.Types: instance Data.Aeson.Types.ToJSON.ToJSON Haxl.Core.Types.RoundStats
+ Haxl.Core.Types: instance Data.Aeson.Types.ToJSON.ToJSON Haxl.Core.Types.Stats
+ Haxl.Prelude: infix 4 ./=
+ Haxl.Prelude: infixr 2 .||
+ Haxl.Prelude: infixr 3 .&&
+ Haxl.Prelude: instance u1 ~ u2 => Haxl.Prelude.IfThenElse (Haxl.Core.Monad.GenHaxl u1 GHC.Types.Bool) (Haxl.Core.Monad.GenHaxl u2 a)
- Haxl.Core: cachedComputation :: (Eq (req a), Hashable (req a), Typeable (req a)) => req a -> GenHaxl u a -> GenHaxl u a
+ Haxl.Core: cachedComputation :: forall req u a. (Eq (req a), Hashable (req a), Typeable (req a)) => req a -> GenHaxl u a -> GenHaxl u a
- Haxl.Core: class (DataSourceName req, StateKey req, Show1 req) => DataSource u req
+ Haxl.Core: class (DataSourceName req, StateKey req, ShowP req) => DataSource u req
- Haxl.Core: class Typeable f => StateKey (f :: * -> *) where data family State f
+ Haxl.Core: class Typeable f => StateKey (f :: * -> *) where data State f where {
- Haxl.Core: stateGet :: StateKey r => StateStore -> Maybe (State r)
+ Haxl.Core: stateGet :: forall r. StateKey r => StateStore -> Maybe (State r)
- Haxl.Core: stateSet :: StateKey f => State f -> StateStore -> StateStore
+ Haxl.Core: stateSet :: forall f. StateKey f => State f -> StateStore -> StateStore
- Haxl.Core.Monad: cachedComputation :: (Eq (req a), Hashable (req a), Typeable (req a)) => req a -> GenHaxl u a -> GenHaxl u a
+ Haxl.Core.Monad: cachedComputation :: forall req u a. (Eq (req a), Hashable (req a), Typeable (req a)) => req a -> GenHaxl u a -> GenHaxl u a
- Haxl.Core.RequestStore: addRequest :: (DataSource u r) => BlockedFetch r -> RequestStore u -> RequestStore u
+ Haxl.Core.RequestStore: addRequest :: forall u r. (DataSource u r) => BlockedFetch r -> RequestStore u -> RequestStore u
- Haxl.Core.StateStore: class Typeable f => StateKey (f :: * -> *) where data family State f
+ Haxl.Core.StateStore: class Typeable f => StateKey (f :: * -> *) where data State f where {
- Haxl.Core.StateStore: stateGet :: StateKey r => StateStore -> Maybe (State r)
+ Haxl.Core.StateStore: stateGet :: forall r. StateKey r => StateStore -> Maybe (State r)
- Haxl.Core.StateStore: stateSet :: StateKey f => State f -> StateStore -> StateStore
+ Haxl.Core.StateStore: stateSet :: forall f. StateKey f => State f -> StateStore -> StateStore
- Haxl.Core.Types: class (DataSourceName req, StateKey req, Show1 req) => DataSource u req
+ Haxl.Core.Types: class (DataSourceName req, StateKey req, ShowP req) => DataSource u req
- Haxl.Prelude: class (DataSourceName req, StateKey req, Show1 req) => DataSource u req
+ Haxl.Prelude: class (DataSourceName req, StateKey req, ShowP req) => DataSource u req
Files
- Haxl/Core.hs +2/−2
- Haxl/Core/Monad.hs +8/−6
- Haxl/Core/Show1.hs +0/−17
- Haxl/Core/ShowP.hs +17/−0
- Haxl/Core/Types.hs +4/−4
- changelog.md +3/−0
- haxl.cabal +6/−7
- tests/ExampleDataSource.hs +1/−1
- tests/MockTAO.hs +1/−1
Haxl/Core.hs view
@@ -62,7 +62,7 @@ -- * Building data sources DataSource(..),- Show1(..),+ ShowP(..), DataSourceName(..), Request, BlockedFetch(..),@@ -97,5 +97,5 @@ import Haxl.Core.Monad hiding (unsafeLiftIO {- Ask nicely to get this! -}) import Haxl.Core.Types import Haxl.Core.Exception-import Haxl.Core.Show1 (Show1(..))+import Haxl.Core.ShowP (ShowP(..)) import Haxl.Core.StateStore
Haxl/Core/Monad.hs view
@@ -54,7 +54,7 @@ ) where import Haxl.Core.Types-import Haxl.Core.Show1+import Haxl.Core.ShowP import Haxl.Core.StateStore import Haxl.Core.Exception import Haxl.Core.RequestStore@@ -780,16 +780,18 @@ ifTrace f 3 $ forM_ jobs $ \(BlockedFetches reqs) ->- forM_ reqs $ \(BlockedFetch r _) -> putStrLn (show1 r)+ forM_ reqs $ \(BlockedFetch r _) -> putStrLn (showp r) let applyFetch (i, BlockedFetches (reqs :: [BlockedFetch r])) = case stateGet (states env) of Nothing ->- return (SyncFetch (mapM_ (setError (const e)) reqs))- where req :: r a; req = undefined- e = DataSourceError $- "data source not initialized: " <> dataSourceName req+ return (SyncFetch (mapM_ (setError e) reqs))+ where e req = DataSourceError $+ "data source not initialized: " <>+ dataSourceName req <>+ ": " <>+ Text.pack (showp req) Just state -> return $ wrapFetchInTrace i (length reqs) (dataSourceName (undefined :: r a))
− Haxl/Core/Show1.hs
@@ -1,17 +0,0 @@--- Copyright (c) 2014-present, Facebook, Inc.--- All rights reserved.------ This source code is distributed under the terms of a BSD license,--- found in the LICENSE file. An additional grant of patent rights can--- be found in the PATENTS file.---- Most users should import "Haxl.Core" instead of importing this--- module directly.-module Haxl.Core.Show1- ( Show1(..)- ) where---- | A class of type constructors for which we can show all--- parameterizations.-class Show1 f where- show1 :: f a -> String
+ Haxl/Core/ShowP.hs view
@@ -0,0 +1,17 @@+-- Copyright (c) 2014-present, Facebook, Inc.+-- All rights reserved.+--+-- This source code is distributed under the terms of a BSD license,+-- found in the LICENSE file. An additional grant of patent rights can+-- be found in the PATENTS file.++-- Most users should import "Haxl.Core" instead of importing this+-- module directly.+module Haxl.Core.ShowP+ ( ShowP(..)+ ) where++-- | A class of type constructors for which we can show all+-- parameterizations.+class ShowP f where+ showp :: f a -> String
Haxl/Core/Types.hs view
@@ -114,7 +114,7 @@ #if __GLASGOW_HASKELL__ < 708 import Haxl.Core.Util (tryReadMVar) #endif-import Haxl.Core.Show1+import Haxl.Core.ShowP import Haxl.Core.StateStore -- ---------------------------------------------------------------------------@@ -330,7 +330,7 @@ -- For a complete example data source, see -- <https://github.com/facebook/Haxl/tree/master/example Examples>. ---class (DataSourceName req, StateKey req, Show1 req) => DataSource u req where+class (DataSourceName req, StateKey req, ShowP req) => DataSource u req where -- | Issues a list of fetches to this 'DataSource'. The 'BlockedFetch' -- objects contain both the request and the 'ResultVar's into which to put@@ -352,10 +352,10 @@ -- take a dummy request. dataSourceName :: req a -> Text --- The 'Show1' class is a workaround for the fact that we can't write+-- The 'ShowP' class is a workaround for the fact that we can't write -- @'Show' (req a)@ as a superclass of 'DataSource', without also -- parameterizing 'DataSource' over @a@, which is a pain (I tried--- it). 'Show1' seems fairly benign, though.+-- it). 'ShowP' seems fairly benign, though. -- | A convenience only: package up 'Eq', 'Hashable', 'Typeable', and 'Show' -- for requests into a single constraint.
changelog.md view
@@ -1,3 +1,6 @@+# Changes in version 0.5.0.0+ * Rename 'Show1' to 'ShowP' ([#62](https://github.com/facebook/Haxl/issues/62))+ # Changes in version 0.3.0.0 * Some performance improvements, including avoiding quadratic
haxl.cabal view
@@ -1,5 +1,5 @@ name: haxl-version: 0.4.0.2+version: 0.5.0.0 synopsis: A Haskell library for efficient, concurrent, and concise data access. homepage: https://github.com/facebook/Haxl@@ -16,7 +16,7 @@ tested-with: GHC==7.8.4, GHC==7.10.3,- GHC==8.0.1+ GHC==8.0.2 description: Haxl is a library and EDSL for efficient scheduling of concurrent data@@ -43,23 +43,22 @@ build-depends: HUnit >= 1.2 && < 1.6,- aeson >= 0.6 && < 1.1,+ aeson >= 0.6 && < 1.2, base == 4.*, binary >= 0.7 && < 0.9, bytestring >= 0.9 && < 0.11, containers == 0.5.*, deepseq,- directory >= 1.1 && < 1.3, exceptions >=0.8 && <0.9, filepath >= 1.3 && < 1.5, ghc-prim, hashable == 1.2.*, pretty == 1.1.*, text >= 1.1.0.1 && < 1.3,- time >= 1.4 && < 1.7,+ time >= 1.4 && < 1.8, transformers, unordered-containers == 0.2.*,- vector >= 0.10 && <0.12+ vector >= 0.10 && <0.13 exposed-modules: Haxl.Core,@@ -69,7 +68,7 @@ Haxl.Core.Monad, Haxl.Core.RequestStore, Haxl.Core.StateStore,- Haxl.Core.Show1,+ Haxl.Core.ShowP, Haxl.Core.Types, Haxl.Prelude
tests/ExampleDataSource.hs view
@@ -65,7 +65,7 @@ deriving instance Show (ExampleReq a) -instance Show1 ExampleReq where show1 = show+instance ShowP ExampleReq where showp = show instance Hashable (ExampleReq a) where hashWithSalt s (CountAardvarks a) = hashWithSalt s (0::Int,a)
tests/MockTAO.hs view
@@ -37,7 +37,7 @@ deriving instance Show (TAOReq a) deriving instance Eq (TAOReq a) -instance Show1 TAOReq where show1 = show+instance ShowP TAOReq where showp = show instance Hashable (TAOReq a) where hashWithSalt s (AssocRangeId2s a b) = hashWithSalt s (a,b)