HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleselda-0.5.2.1Haskell2010

Database.Selda.MakeSelectors

Utilities for creating selectors for non-record types. In general, you should really use record types for your tables and their record labels (i.e. #label) as selectors using the OverloadedLabels extension instead.

  • 1 type
  • 1 class
  • 2 values
  • Packageselda-0.5.2.1
  • Exports4
  • LanguageHaskell2010
  • LicenceMIT
  • SourceMakeSelectors.hs
typetype Selectors r = Sels r (Rep r)
#

An inductive tuple of selectors for the given relation.

classclass GSelectors t (f :: Type -> Type) where
#

Any table type that can have selectors generated.

Instances4GSelectors
valueselectors :: (Relational a, GSelectors a (Rep a)) => Table a -> Selectors a
#

Generate selector functions for the given table. Selectors can be used to access the fields of a query result tuple, avoiding the need to pattern match on the entire tuple.

tbl :: Table (Int, Text)
tbl = table "foo" []
(tblBar :*: tblBaz) = selectors tbl

q :: Query s Text
q = do
  row <- select tbl
  return (row ! tblBaz)