cabal-version: 3.0
name: valiant-effectful
version: 0.1.0.2
synopsis: Effectful adapter for valiant
description:
Provides an @Valiant@ effect for the @effectful@ effect system, enabling
compile-time checked SQL queries as an effect with pool-based handlers.
@
import Valiant.Effectful
myApp :: (Valiant :> es, IOE :> es) => Eff es [User]
myApp = do
users <- fetchAllEff listUsers ()
forM_ users $ \\u -> executeEff updateLastSeen (userId u)
pure users
main :: IO ()
main = do
pool <- newPool defaultPoolConfig { poolConnString = "..." }
runEff . runValiant pool $ myApp
@
license: BSD-3-Clause
license-file: LICENSE
author: Josh Burgess
maintainer: joshburgess.webdev@gmail.com
category: Database
homepage: https://github.com/joshburgess/valiant
bug-reports: https://github.com/joshburgess/valiant/issues
build-type: Simple
extra-doc-files:
README.md
CHANGELOG.md
tested-with: GHC ==9.10.3
source-repository head
type: git
location: https://github.com/joshburgess/valiant
subdir: adapters/valiant-effectful
flag werror
description: Enable -Werror for development builds.
default: False
manual: True
common warnings
ghc-options: -Wall -Wcompat -Wno-unticked-promoted-constructors -funbox-strict-fields -fspecialise-aggressively
if flag(werror)
ghc-options: -Werror
library
import: warnings
hs-source-dirs: src
default-language: GHC2021
default-extensions:
DataKinds
DerivingStrategies
GADTs
LambdaCase
OverloadedStrings
StrictData
TypeFamilies
TypeOperators
exposed-modules:
Valiant.Effectful
build-depends:
, base >=4.17 && <5
, effectful-core >=2.3 && <2.7
, valiant >=0.1 && <0.2
, pg-wire >=0.2 && <0.3
, vector >=0.12 && <0.14
test-suite valiant-effectful-test
import: warnings
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Main.hs
default-language: GHC2021
default-extensions:
DataKinds
GADTs
OverloadedStrings
TypeOperators
ghc-options: -rtsopts "-with-rtsopts=-K8K"
build-depends:
, base >=4.17 && <5
, bytestring >=0.11 && <0.13
, effectful-core >=2.3 && <2.7
, hspec >=2.11 && <2.13
, valiant
, valiant-effectful
, pg-wire
, text >=2.0 && <2.2
other-modules:
TestSupport