From bc5988ad6451d1c62ac0412ed5bd1233d808a4b2 Mon Sep 17 00:00:00 2001 From: Maxim Koltsov Date: Wed, 28 Apr 2021 19:06:43 +0300 Subject: [PATCH] version 0.0.1.7: add more HasCallStack (#44) --- CHANGELOG.md | 4 ++++ hasbolt-extras.cabal | 2 +- src/Database/Bolt/Extras/DSL/Typed/Parameters.hs | 10 +++++----- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b25428b..2531179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +## [0.0.1.7] - 2021-04-28 +### Changed +- Add more `HasCallStack`. + ## [0.0.1.6] - 2020-12-26 ### Fixed - Fix `makeNodeLike` for `Maybe` fields, bug introduced in previous version. diff --git a/hasbolt-extras.cabal b/hasbolt-extras.cabal index 05280f8..8cbbf41 100644 --- a/hasbolt-extras.cabal +++ b/hasbolt-extras.cabal @@ -1,5 +1,5 @@ name: hasbolt-extras -version: 0.0.1.6 +version: 0.0.1.7 synopsis: Extras for hasbolt library description: Extras for hasbolt library homepage: https://github.com/biocad/hasbolt-extras#readme diff --git a/src/Database/Bolt/Extras/DSL/Typed/Parameters.hs b/src/Database/Bolt/Extras/DSL/Typed/Parameters.hs index 83cae23..cfe4302 100644 --- a/src/Database/Bolt/Extras/DSL/Typed/Parameters.hs +++ b/src/Database/Bolt/Extras/DSL/Typed/Parameters.hs @@ -15,10 +15,9 @@ import Control.Monad.IO.Class (MonadIO) import Data.Kind (Type) import qualified Data.Map.Strict as Map import Data.Text (Text, pack) -import Database.Bolt (BoltActionT, - IsValue (..), - Record, Value, - queryP) +import Database.Bolt (BoltActionT, IsValue (..), Record, + Value, queryP) +import GHC.Stack (HasCallStack, withFrozenCallStack) import GHC.TypeLits (Symbol) import Database.Bolt.Extras.DSL.Internal.Executer (formQuery) @@ -53,7 +52,7 @@ newtype CypherDSLParams (params :: [(Symbol, Type)]) (a :: Type) -- This should be considered an implementation detail. class QueryWithParams (params :: [(Symbol, Type)]) (m :: Type -> Type) fun | params m -> fun where -- | Internal function that accumulates parameters from type-level list. - collectParams :: CypherDSL () -> [(Text, Value)] -> fun + collectParams :: HasCallStack => CypherDSL () -> [(Text, Value)] -> fun -- | Base case: if there are no parameters, perform query with 'queryP'. instance MonadIO m => QueryWithParams '[] m (BoltActionT m [Record]) where @@ -95,6 +94,7 @@ queryWithParams :: forall params m fun . MonadIO m => QueryWithParams params m fun + => HasCallStack => CypherDSLParams params () -> fun queryWithParams (CypherDSLParams dsl) = collectParams @params @m dsl []