valiant-fused-effects: Fused-effects adapter for valiant

[ bsd3, database, library ] [ Propose Tags ] [ Report a vulnerability ]

Provides an Valiant effect and ValiantPoolC carrier for the fused-effects effect system, enabling compile-time checked SQL queries as an algebraic effect.

import Valiant.FusedEffects

myApp :: Has Valiant sig m => m [User]
myApp = do
  users <- fetchAllF listUsers ()
  pure users

main :: IO ()
main = do
  pool <- newPool defaultPoolConfig { poolConnString = "..." }
  result <- runValiantPool pool myApp
  print result

[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
werror

Enable -Werror for development builds.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log CHANGELOG.md
Dependencies base (>=4.17 && <5), fused-effects (>=1.1 && <1.3), pg-wire (>=0.2 && <0.3), valiant (>=0.1 && <0.2) [details]
Tested with ghc ==9.10.3
License BSD-3-Clause
Author Josh Burgess
Maintainer joshburgess.webdev@gmail.com
Uploaded by joshburgess at 2026-04-30T12:29:07Z
Category Database
Home page https://github.com/joshburgess/valiant
Bug tracker https://github.com/joshburgess/valiant/issues
Source repo head: git clone https://github.com/joshburgess/valiant(adapters/valiant-fused-effects)
Distributions
Downloads 8 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-04-30 [all 1 reports]

Readme for valiant-fused-effects-0.1.0.1

[back to package description]

valiant-fused-effects

fused-effects adapter for valiant.

Provides a Valiant effect, a ValiantPoolC carrier (built on ReaderC Pool), and Has (Reader Pool) sig m-constrained smart constructors.

Quick start

import Control.Carrier.Lift (runM)
import Valiant (newPool, defaultPoolConfig, poolConnString)
import Valiant.FusedEffects

myApp :: (Has (Reader Pool) sig m, MonadIO m) => m [User]
myApp = do
  users <- fetchAllF listUsers ()
  pure users

main :: IO ()
main = do
  pool <- newPool defaultPoolConfig { poolConnString = "postgres://..." }
  users <- runM . runValiantPool pool $ myApp
  print users

What you get

  • Effect: data Valiant
  • Carrier: type ValiantPoolC m = ReaderC Pool m with runValiantPool :: Pool -> ValiantPoolC m a -> m a
  • Query operations: fetchOneF, fetchAllF, fetchScalarF, fetchOneOrThrowF, fetchExistsF
  • Command operations: executeF, executeReturningF, executeBatchF
  • Transactions: withTransactionF
  • Raw access: withConnectionF

See the valiant tutorial for Statement definitions and the valiant prepare workflow.