valiant-bluefin: Bluefin effect adapter for valiant

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

Provides an Valiant effect handle for the bluefin effect system, enabling compile-time checked SQL queries with explicit effect passing.

import Valiant.Bluefin

myApp :: Valiant e -> Eff es [User]
myApp db = do
  users <- fetchAllB db listUsers ()
  pure users

[Skip to Readme]

Modules

[Index] [Quick Jump]

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), bluefin (>=0.0 && <0.2), 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:06Z
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-bluefin)
Distributions
Downloads 7 total (7 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-bluefin-0.1.0.1

[back to package description]

valiant-bluefin

Bluefin effect adapter for valiant.

Bluefin uses explicit effect handles rather than type-level effect lists. This adapter wraps a Pool as a ValiantHandle e that you pass to functions that need database access.

Quick start

import Valiant (newPool, defaultPoolConfig, poolConnString)
import Valiant.Bluefin

myApp :: ValiantHandle e -> IO [User]
myApp db = fetchAllB db listUsers ()

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

What you get

  • runValiantB :: Pool -> (forall e. ValiantHandle e -> IO a) -> IO a
  • Query operations: fetchOneB, fetchAllB, fetchScalarB, fetchOneOrThrowB, fetchExistsB
  • Command operations: executeB, executeReturningB, executeBatchB
  • Transactions: withTransactionB
  • Raw access: withConnectionB

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