Skip to content

Commit

Permalink
version 0.0.1.7: add more HasCallStack (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
maksbotan authored Apr 28, 2021
1 parent 279193e commit bc5988a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion hasbolt-extras.cabal
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Database/Bolt/Extras/DSL/Typed/Parameters.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 []

0 comments on commit bc5988a

Please sign in to comment.