HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleselda-0.5.2.1Haskell2010

Database.Selda

Selda is not LINQ, but they're definitely related.

Selda is a high-level EDSL for interacting with relational databases. All database computations are performed within some monad implementing the MonadSelda type class. The SeldaT monad over any MonadIO is the only pre-defined instance of MonadSelda. SeldaM is provided as a convenient short-hand for SeldaT IO.

To actually execute a database computation, you need one of the database backends: selda-sqlite or selda-postgresql.

All Selda functions may throw SeldaError when something goes wrong. This includes database connection errors, uniqueness constraint errors, etc.

See https://selda.link/tutorial for a tutorial covering the language basics.

  • 31 types
  • 26 classes
  • 116 values
  • Packageselda-0.5.2.1
  • Exports181
  • LanguageHaskell2010
  • LicenceMIT
  • SourceSelda.hs

Running queries

21 declarations
familytype family Backend (m :: Type -> Type)
#

Type of database backend used by m.

Instances1Backend
  • type Backend (SeldaT b m) = bDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
datadata SeldaError
#

Thrown by any function in SeldaT if an error occurs.

Constructors

Instances3Eq, Show, Exception
  • Eq SeldaErrorDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Show SeldaErrorDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
  • Exception SeldaErrorDefined in selda-0.5.2.1 · Database.Selda.Backend.Internal
datadata ValidationError
#

An error occurred when validating a database table. If this error is thrown, there is a bug in your database schema, and the particular table that triggered the error is unusable. Since validation is deterministic, this error will be thrown on every consecutive operation over the offending table.

Therefore, it is not meaningful to handle this exception in any way, just fix your bug instead.

Instances3Eq, Show, Exception
newtypenewtype SeldaT b (m :: Type -> Type) a
#

Monad transformer adding Selda SQL capabilities.

Instances11MonadTrans, Monad, Functor, MonadFail, Applicative, MonadIO, …
typetype Relational a = (Generic a, SqlRow a, GRelation (Rep a))
#

Any type which has a corresponding relation. To make a Relational instance for some type, simply derive Generic.

Note that only types which have a single data constructor, and where all fields are instances of SqlValue can be used with this module. Attempting to use functions in this module with any type which doesn't obey those constraints will result in a very confusing type error.

newtypenewtype Only a
#

Wrapper for single column tables. Use this when you need a table with only a single column, with table or selectValues.

Constructors

Instances18Enum, Eq, Fractional, Integral, Num, Ord, …
classclass The a where
#

Associated types

Methods

  • the :: a -> TheOnly a

    Extract the value of a row from a singleton table.

Instances2The
  • The (Only a)Defined in selda-0.5.2.1 · Database.Selda
  • The (Row s (Only a))Defined in selda-0.5.2.1 · Database.Selda
datadata Table a
#

A database table, based on some Haskell data type. Any single constructor type can form the basis of a table, as long as it derives Generic and all of its fields are instances of SqlType.

newtypenewtype Query s a
#

An SQL query.

Instances5Monad, Functor, Applicative, Set, Preparable
  • Monad (Query s)Defined in selda-0.5.2.1 · Database.Selda.Query.Type
  • Functor (Query s)Defined in selda-0.5.2.1 · Database.Selda.Query.Type
  • Applicative (Query s)Defined in selda-0.5.2.1 · Database.Selda.Query.Type
  • Set (Query s)Defined in selda-0.5.2.1 · Database.Selda
  • Result a => Preparable (Query s a)Defined in selda-0.5.2.1 · Database.Selda.Prepared
newtypenewtype Row (s :: k) (a :: k1)
#

A database row. A row is a collection of one or more columns.

Instances6The, Columns, Result, TheOnly
newtypenewtype Col (s :: k) a
#

A database column. A column is often a literal column table, but can also be an expression over such a column or a constant expression.

Instances14Mappable, Preparable, Fractional, Num, IsString, Semigroup, …
classclass Typeable (Res r) => Result r where
#

An acceptable query result type; one or more columns stitched together with :*:.

Instances4Result
valuequery :: (MonadSelda m, Result a) => Query (Backend m) a -> m [Res a]
#

Run a query within a Selda monad. In practice, this is often a SeldaT transformer on top of some other monad. Selda transformers are entered using backend-specific withX functions, such as withSQLite from the SQLite backend.

valuetransaction :: (MonadSelda m, MonadMask m) => m a -> m a
#

Perform the given computation atomically. If an exception is raised during its execution, the entire transaction will be rolled back and the exception re-thrown, even if the exception is caught and handled within the transaction.

valuewithoutForeignKeyEnforcement :: (MonadSelda m, MonadMask m) => m a -> m a
#

Run the given computation as a transaction without enforcing foreign key constraints.

If the computation finishes with the database in an inconsistent state with regards to foreign keys, the resulting behavior is undefined. Use with extreme caution, preferably only for migrations.

On the PostgreSQL backend, at least PostgreSQL 9.6 is required.

Using this should be avoided in favor of deferred foreign key constraints. See SQL backend documentation for deferred constraints.

valuenewUuid :: (MonadIO m, IsUUID uuid) => m uuid
#

Generate a new random UUID using the system's random number generator. UUIDs generated this way are (astronomically likely to be) unique, but not necessarily unpredictable.

For applications where unpredictability is crucial, take care to use a proper cryptographic PRNG to generate your UUIDs.

Constructing queries

22 declarations
classclass Typeable a => SqlType a where
#

Any datatype representable in (Selda's subset of) SQL.

Methods

Instances19SqlType, …
classclass Typeable a => SqlRow a where
#

Methods

  • nextResult :: ResultReader a

    Read the next, potentially composite, result from a stream of columns.

  • nestedCols :: Proxy a -> Int

    The number of nested columns contained in this type.

Instances8SqlRow, …
  • SqlRow a => SqlRow (Maybe a)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • SqlType a => SqlRow (Only a)Defined in selda-0.5.2.1 · Database.Selda
  • (Typeable (a, b), GSqlRow (Rep (a, b))) => SqlRow (a, b)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • (Typeable (a, b, c), GSqlRow (Rep (a, b, c))) => SqlRow (a, b, c)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • (Typeable (a, b, c, d), GSqlRow (Rep (a, b, c, d))) => SqlRow (a, b, c, d)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • (Typeable (a, b, c, d, e), GSqlRow (Rep (a, b, c, d, e))) => SqlRow (a, b, c, d, e)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • (Typeable (a, b, c, d, e, f), GSqlRow (Rep (a, b, c, d, e, f))) => SqlRow (a, b, c, d, e, f)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • (Typeable (a, b, c, d, e, f, g), GSqlRow (Rep (a, b, c, d, e, f, g))) => SqlRow (a, b, c, d, e, f, g)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
classclass GSqlRow (f :: Type -> Type) where
#
Instances4GSqlRow
  • TypeError ('Text "Selda currently does not support creating tables from sum types." ':$$: 'Text "Restrict your table type to a single data constructor.") => GSqlRow (a :+: b)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • SqlType a => GSqlRow (K1 i a)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • (GSqlRow a, GSqlRow b) => GSqlRow (a :*: b)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
  • GSqlRow f => GSqlRow (M1 c i f)Defined in selda-0.5.2.1 · Database.Selda.SqlRow
classclass (Typeable a, Bounded a, Enum a) => SqlEnum a where
#

Any type that's bounded, enumerable and has a text representation, and thus representable as a Selda enumerable.

While it would be more efficient to store enumerables as integers, this makes hand-rolled SQL touching the values inscrutable, and will break if the user a) derives Enum and b) changes the order of their constructors. Long-term, this should be implemented in PostgreSQL as a proper enum anyway, which mostly renders the performance argument moot.

Methods

Instances1SqlEnum
classclass s ~ t => Same (s :: k) (t :: k) where
#

Denotes that scopes s and t are identical.

Instances2Same
  • Same s sDefined in selda-0.5.2.1 · Database.Selda.Column
  • (s ~ t, TypeError ('Text "An identifier from an outer scope may not be used in an inner query.")) => Same s tDefined in selda-0.5.2.1 · Database.Selda.Column
datadata Order
#

The order in which to sort result rows.

Instances3Eq, Ord, Show
  • Eq OrderDefined in selda-0.5.2.1 · Database.Selda.SQL
  • Ord OrderDefined in selda-0.5.2.1 · Database.Selda.SQL
  • Show OrderDefined in selda-0.5.2.1 · Database.Selda.SQL
datadata (:*:) a b where
#

An inductively defined "tuple", or heterogeneous, non-empty list.

Constructors

  • (:*:) :: a -> b -> (:*:) a binfixr 1
Instances11Eq, Ord, Show, Generic, Columns, Result, …
valueselectValues :: Relational a => [a] -> Query s (Row s a)
#

Query an ad hoc table of type a. Each element in the given list represents one row in the ad hoc table.

valuefrom
  1. :: (Typeable t, SqlType a)
  2. => Selector t a
  3. -> Query s (Row s t)
  4. -> Query s (Col s a)
#

Convenient shorthand for fmap (! sel) q. The following two queries are quivalent:

q1 = name `from` select people
q2 = do
  person <- select people
  return (person ! name)
valueorder :: (Same s t, SqlType a) => Col s a -> Order -> Query t ()
#

Sort the result rows in ascending or descending order on the given row.

If multiple order directives are given, later directives are given precedence but do not cancel out earlier ordering directives. To get a list of persons sorted primarily on age and secondarily on name:

peopleInAgeAndNameOrder = do
  person <- select people
  order (person ! name) ascending
  order (person ! age) ascending
  return (person ! name)

For a table [(Alice, 20), (Bob, 20), (Eve, 18)], this query will always return [Eve, Alice, Bob].

The reason for later orderings taking precedence and not the other way around is composability: order should always sort the current result set to avoid weird surprises when a previous order directive is buried somewhere deep in an earlier query. However, the ordering must always be stable, to ensure that previous calls to order are not simply erased.

valueinner
  1. :: (Columns a, Columns (OuterCols a))
  2. => Query (Inner s) a
  3. -> Query s (OuterCols a)
#

Explicitly create an inner query. Equivalent to innerJoin (const true).

Sometimes it's handy, for performance reasons and otherwise, to perform a subquery and restrict only that query before adding the result of the query to the result set, instead of first adding the query to the result set and restricting the whole result set afterwards.

Working with selectors

15 declarations
newtypenewtype Selector t a
#

A column selector. Column selectors can be used together with the ! and with functions to get and set values on rows, or to specify foreign keys.

Instances2SelectorLike, IsLabel
typetype FieldType (name :: Symbol) t = GFieldType (Rep t) (NoSuchSelector t name) name
#

The type of the name field, in the record type t.

value(?)
  1. :: SqlType a
  2. => Row s (Maybe t)
  3. -> Selector t a
  4. -> Col s (Coalesce (Maybe a))
#

Extract the given column from the given nullable row. Nullable rows usually result from left joins. If a nullable column is extracted from a nullable row, the resulting nested Maybes will be squashed into a single level of nesting.

datadata Assignment s a where
#

A selector-value assignment pair.

Constructors

valuewith :: Row s a -> [Assignment s a] -> Row s a
#

For each selector-value pair in the given list, on the given tuple, update the field pointed out by the selector with the corresponding value.

Expressions over columns

48 declarations
classclass Set (set :: Type -> Type) where
#

Any container type for which we can check object membership.

Methods

Instances2Set
  • Set []Defined in selda-0.5.2.1 · Database.Selda
  • Set (Query s)Defined in selda-0.5.2.1 · Database.Selda
classclass Semigroup a => Monoid a where
#

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following:

Right identity

x <> mempty = x

Left identity

mempty <> x = x

Associativity

x <> (y <> z) = (x <> y) <> z

(

Semigroup

law)

Concatenation

mconcat = foldr (<>) mempty

You can alternatively define mconcat instead of mempty, in which case the laws are:

Unit

mconcat (pure x) = x

Multiplication

mconcat (join xss) = mconcat (fmap mconcat xss)

Subclass

mconcat (toList xs) = sconcat xs

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Data.Semigroup.Sum and Data.Semigroup.Product.

NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.

Methods

  • mempty :: a

    Identity of mappend

    Examples
    Example1 expression
    "Hello world" <> mempty"Hello world"
    Example1 expression
    mempty <> [1, 2, 3][1,2,3]
  • mappend :: a -> a -> a

    An associative operation

    NOTE: This method is redundant and has the default implementation mappend = (<>) since base-4.11.0.0. Should it be implemented manually, since mappend is a synonym for (<>), it is expected that the two functions are defined the same way. In a future GHC release mappend will be removed from Monoid.

  • mconcat :: [a] -> a

    Fold a list using the monoid.

    For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

    Example1 expression
    mconcat ["Hello", " ", "Haskell", "!"]"Hello Haskell!"
Instances80Monoid, …
  • Monoid ByteArrayDefined in base-4.20.2.0 · Data.Array.Byte
  • Monoid BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internal
  • Monoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Monoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Monoid ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Monoid IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Monoid AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Monoid EventLifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Monoid LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types

    mappend takes the longer of two lifetimes.

  • Monoid ExceptionContextDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Context
  • Monoid OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid OsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types

    "String-Concatenation" for OsString. This is not the same as (</>).

  • Monoid PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Monoid WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Monoid DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • Monoid TextDefined in text-2.1.3 · Data.Text · orphan
  • Monoid BuilderDefined in text-2.1.3 · Data.Text.Internal.Builder
  • Monoid TextDefined in text-2.1.3 · Data.Text.Lazy · orphan
  • Monoid StrictTextBuilderDefined in text-2.1.3 · Data.Text.Internal.StrictBuilder
  • Monoid CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDays

    Additive

  • Monoid CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTime

    Additive

  • Monoid ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid (Comparison a)Defined in base-4.20.2.0 · Data.Functor.Contravariant

    mempty on comparisons always returns EQ. Without newtypes this equals pure (pure EQ).

    mempty :: Comparison a
    mempty = Comparison _ _ -> EQ
    
  • Monoid (Equivalence a)Defined in base-4.20.2.0 · Data.Functor.Contravariant

    mempty on equivalences always returns True. Without newtypes this equals pure (pure True).

    mempty :: Equivalence a
    mempty = Equivalence _ _ -> True
    
  • Monoid (Predicate a)Defined in base-4.20.2.0 · Data.Functor.Contravariant

    mempty on predicates always returns True. Without newtypes this equals pure True.

    mempty :: Predicate a
    mempty = _ -> True
    
  • Monoid (PutM ())Defined in binary-0.8.9.3 · Data.Binary.Put
  • Monoid (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Monoid (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Monoid (MergeSet a)Defined in containers-0.7 · Data.Set.Internal
  • Monoid (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Monoid (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Monoid (Endo a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Monoid [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid a => Monoid (STM a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Monoid a => Monoid (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Monoid a => Monoid (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Monoid a => Monoid (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid a => Monoid (IO a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid a => Monoid (Q a)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Monoid a => Monoid (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid m => Monoid (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Monoid p => Monoid (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Semigroup a => Monoid (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base

    Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."

    Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.

  • Bits a => Monoid (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Bits a => Monoid (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • FiniteBits a => Monoid (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits

    This constraint is arguably too strong. However, as some types (such as Natural) have undefined complement, this is the only safe choice.

  • FiniteBits a => Monoid (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits

    This constraint is arguably too strong. However, as some types (such as Natural) have undefined complement, this is the only safe choice.

  • Num a => Monoid (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Num a => Monoid (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Ord a => Monoid (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Ord a => Monoid (Max a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils
  • Ord a => Monoid (Min a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils
  • (Generic a, Monoid (Rep a ())) => Monoid (Generically a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • (Ord a, Bounded a) => Monoid (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • (Ord a, Bounded a) => Monoid (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Monoid (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Monoid (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monoid a => Monoid (Op a b)Defined in base-4.20.2.0 · Data.Functor.Contravariant

    mempty @(Op a b) without newtypes is mempty @(b->a) = _ -> mempty.

    mempty :: Op a b
    mempty = Op _ -> mempty
    
  • Monoid a => Monoid (ST s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ST
  • Monoid b => Monoid (a -> b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Ord k => Monoid (Map k v)Defined in containers-0.7 · Data.Map.Internal
  • (Monoid a, Monoid b) => Monoid (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Alternative f => Monoid (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid (Col s Text)Defined in selda-0.5.2.1 · Database.Selda · orphan
  • Monoid (f p) => Monoid (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monoid a => Monoid (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Monoid a => Monoid (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • (Applicative f, Monoid a) => Monoid (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid c => Monoid (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • (Monoid (f a), Monoid (g a)) => Monoid (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product
  • (Monoid (f p), Monoid (g p)) => Monoid ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • (Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid (f (g a)) => Monoid (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Monoid (f (g p)) => Monoid ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monoid (f p) => Monoid (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • (Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
classclass Semigroup a where
#

The class of semigroups (types with an associative binary operation).

Instances should satisfy the following:

Associativity

x <> (y <> z) = (x <> y) <> z

You can alternatively define sconcat instead of (<>), in which case the laws are:

Unit

sconcat (pure x) = x

Multiplication

sconcat (join xss) = sconcat (fmap sconcat xss)

Methods

  • (<>) :: a -> a -> ainfixr 6

    An associative operation.

    Examples
    Example1 expression
    [1,2,3] <> [4,5,6][1,2,3,4,5,6]
    Example1 expression
    Just [1, 2, 3] <> Just [4, 5, 6]Just [1,2,3,4,5,6]
    Example1 expression
    putStr "Hello, " <> putStrLn "World!"Hello, World!
Instances91Semigroup, …
newtypenewtype ID a
#

A typed row identifier. Generic tables should use this instead of RowID. Use untyped to erase the type of a row identifier, and cast from the Database.Selda.Unsafe module if you for some reason need to add a type to a row identifier.

Instances7Eq, Ord, Show, Generic, SqlOrd, SqlType, …
valueinvalidId :: ID a
#

A typed row identifier which is guaranteed to not match any row in any table.

valueisInvalidId :: ID a -> Bool
#

Is the given typed row identifier invalid? I.e. is it guaranteed to not match any row in any table?

valuefromId :: ID a -> Int64
#

Create a typed row identifier from an integer. Use with caution, preferably only when reading user input.

valuetoId :: Int64 -> ID a
#

Create a typed row identifier from an integer. Use with caution, preferably only when reading user input.

classclass IsUUID a where
#

Any type which is backed by an UUID.

Methods

Instances2IsUUID
  • IsUUID UUIDDefined in selda-0.5.2.1 · Database.Selda
  • IsUUID (UUID' a)Defined in selda-0.5.2.1 · Database.Selda
newtypenewtype UUID' a
#

An UUID identifying a database row.

Instances7Eq, Ord, Show, Generic, IsUUID, SqlType, …
valuetypedUuid :: UUID -> UUID' a
#

Convert an untyped UUID to a typed one. Use sparingly, preferably only during deserialization.

newtypenewtype RowID
#

A row identifier for some table. This is the type of auto-incrementing primary keys.

Instances7Eq, Ord, Show, Generic, SqlOrd, SqlType, …
valueinvalidRowId :: RowID
#

A row identifier which is guaranteed to not match any row in any table.

valueisInvalidRowId :: RowID -> Bool
#

Is the given row identifier invalid? I.e. is it guaranteed to not match any row in any table?

valuetoRowId :: Int64 -> RowID
#

Create a row identifier from an integer. Use with caution, preferably only when reading user input.

value(.==) :: (Same s t, SqlType a) => Col s a -> Col t a -> Col s Bool
#

Comparisons over columns. Note that when comparing nullable (i.e. Maybe) columns, SQL NULL semantics are used. This means that comparing to a NULL field will remove the row in question from the current set. To test for NULL, use isNull instead of .== literal Nothing.

value(./=) :: (Same s t, SqlType a) => Col s a -> Col t a -> Col s Bool
#

Comparisons over columns. Note that when comparing nullable (i.e. Maybe) columns, SQL NULL semantics are used. This means that comparing to a NULL field will remove the row in question from the current set. To test for NULL, use isNull instead of .== literal Nothing.

valuelike :: Same s t => Col s Text -> Col t Text -> Col s Bool
#

The SQL LIKE operator; matches strings with % wildcards. For instance:

"%gon" `like` "dragon" .== true
valuetrue :: Col s Bool
#

True and false boolean literals.

valueifNull :: (Same s t, SqlType a) => Col s a -> Col t (Maybe a) -> Col s a
#

If the second value is Nothing, return the first value. Otherwise return the second value.

valuematchNull
  1. :: (SqlType a, SqlType b, Same s t)
  2. => Col s b
  3. -> Col s a -> Col s b
  4. -> Col t (Maybe a)
  5. -> Col s b
#

Applies the given function to the given nullable column where it isn't null, and returns the given default value where it is.

This is the Selda equivalent of maybe.

valuenew :: Relational a => [Assignment s a] -> Row s a
#

Create a new row with the given fields. Any unassigned fields will contain their default values.

valuerow :: Relational a => a -> Row s a
#

Create a new row from the given value. This can be useful when you want to update all or most of a row:

update users (#uid `is` user_id)
             (\old -> row user_info `with` [...])
valueonly :: SqlType a => Col s a -> Row s (Only a)
#

Create a singleton table column from an appropriate value.

Converting between column types

5 declarations
valuejust :: SqlType a => Col s a -> Col s (Maybe a)
#

Lift a non-nullable column to a nullable one. Useful for creating expressions over optional columns:

data Person = Person {name :: Text, age :: Int, pet :: Maybe Text}
  deriving Generic
instance SqlRow Person

people :: Table Person
people = table "people" []

peopleWithCats = do
  person <- select people
  restrict (person ! #pet .== just "cat")
  return (person ! #name)

Inner queries

16 declarations
newtypenewtype Aggr s a
#

A single aggregate column. Aggregate columns may not be used to restrict queries. When returned from an aggregate subquery, an aggregate column is converted into a non-aggregate column.

Instances4Mappable, Aggregates, Container
familytype family OuterCols a where
#

Convert one or more inner column to equivalent columns in the outer query. OuterCols (Aggr (Inner s) a :*: Aggr (Inner s) b) = Col s a :*: Col s b, for instance.

Equations

familytype family LeftCols a where
#

The results of a left join are always nullable, as there is no guarantee that all joined columns will be non-null. JoinCols a where a is an extensible tuple is that same tuple, but in the outer query and with all elements nullable. For instance:

 LeftCols (Col (Inner s) Int :*: Col (Inner s) Text)
   = Col s (Maybe Int) :*: Col s (Maybe Text)

Equations

datadata Inner s
#

Denotes an inner query. For aggregation, treating sequencing as the cartesian product of queries does not work well. Instead, we treat the sequencing of aggregate with other queries as the cartesian product of the aggregated result of the query, a small but important difference.

However, for this to work, the aggregate query must not depend on any columns in the outer product. Therefore, we let the aggregate query be parameterized over Inner s if the parent query is parameterized over s, to enforce this separation.

Instances2Aggregates
classclass SqlType a => SqlOrd a
#

Any column type that can be used with the min_ and max_ functions.

Instances8SqlOrd, …
valueleftJoin
  1. :: (Columns a, Columns (OuterCols a), Columns (LeftCols a))
  2. => (OuterCols a -> Col s Bool)

    Predicate determining which lines to join. | Right-hand query to join.

  3. -> Query (Inner s) a
  4. -> Query s (LeftCols a)
#

Perform a LEFT JOIN with the current result set (i.e. the outer query) as the left hand side, and the given query as the right hand side. Like with aggregate, the inner (or right) query must not depend on the outer (or right) one.

The given predicate over the values returned by the inner query determines for each row whether to join or not. This predicate may depend on any values from the outer query.

For instance, the following will list everyone in the people table together with their address if they have one; if they don't, the address field will be NULL.

getAddresses :: Query s (Col s Text :*: Col s (Maybe Text))
getAddresses = do
  (name :*: _) <- select people
  (_ :*: address) <- leftJoin (\(n :*: _) -> n .== name)
                              (select addresses)
  return (name :*: address)
valueaggregate
  1. :: (Columns (AggrCols a), Aggregates a)
  2. => Query (Inner s) a
  3. -> Query s (AggrCols a)
#

Execute a query, returning an aggregation of its results. The query must return an inductive tuple of Aggregate columns. When aggregate returns, those columns are converted into non-aggregate columns, which may then be used to further restrict the query.

Note that aggregate queries must not depend on outer queries, nor must they return any non-aggregate columns. Attempting to do either results in a type error.

The SQL HAVING keyword can be implemented by combining aggregate and restrict:

-- Find the number of people living on every address, for all addresses
-- with more than one tenant:
-- SELECT COUNT(name) AS c, address FROM housing GROUP BY name HAVING c > 1

numPpl = do
  (num_tenants :*: theAddress) <- aggregate $ do
    h <- select housing
    theAddress <- groupBy (h ! address)
    return (count (h ! address) :*: theAddress)
 restrict (num_tenants .> 1)
 return (num_tenants :*: theAddress)
valuegroupBy
  1. :: (Same s t, SqlType a)
  2. => Col (Inner s) a
  3. -> Query (Inner t) (Aggr (Inner t) a)
#

Group an aggregate query by a column. Attempting to group a non-aggregate query is a type error. An aggregate representing the grouped-by column is returned, which can be returned from the aggregate query. For instance, if you want to find out how many people have a pet at home:

aggregate $ do
  person <- select people
  name' <- groupBy (person ! name)
  return (name' :*: count(person ! pet_name) .> 0)
valuemax_ :: SqlOrd a => Col s a -> Aggr s (Maybe a)
#

The greatest value in the given column. Texts are compared lexically.

valuemin_ :: SqlOrd a => Col s a -> Aggr s (Maybe a)
#

The smallest value in the given column. Texts are compared lexically.

Modifying tables

12 declarations
valueinsert :: (MonadSelda m, Relational a) => Table a -> [a] -> m Int
#

Insert the given values into the given table. All columns of the table must be present. If your table has an auto-incrementing primary key, use the special value def for that column to get the auto-incrementing behavior. Returns the number of rows that were inserted.

To insert a list of tuples into a table with auto-incrementing primary key:

data Person = Person
  { id :: ID Person
  , name :: Text
  , age :: Int
  , pet :: Maybe Text
  } deriving Generic
instance SqlResult Person

people :: Table Person
people = table "people" [autoPrimary :- id]

main = withSQLite "my_database.sqlite" $ do
  insert_ people
    [ Person def "Link" 125 (Just "horse")
    , Person def "Zelda" 119 Nothing
    , ...
    ]

Note that if one or more of the inserted rows would cause a constraint violation, NO rows will be inserted; the whole insertion fails atomically.

valueinsertWithPK :: (MonadSelda m, Relational a) => Table a -> [a] -> m (ID a)
#

Like insert, but returns the primary key of the last inserted row. Attempting to run this operation on a table without an auto-incrementing primary key will always return a row identifier that is guaranteed to not match any row in any table.

valuetryInsert
  1. :: (MonadSelda m, MonadCatch m, Relational a)
  2. => Table a
  3. -> [a]
  4. -> m Bool
#

Attempt to insert a list of rows into a table, but don't raise an error if the insertion fails. Returns True if the insertion succeeded, otherwise False.

Like insert, if even one of the inserted rows would cause a constraint violation, the whole insert operation fails.

valueinsertUnless
  1. :: (MonadSelda m, MonadMask m, Relational a)
  2. => Table a
  3. -> Row (Backend m) a -> Col (Backend m) Bool
  4. -> [a]
  5. -> m (Maybe (ID a))
#

Perform the given insert, if no rows already present in the table match the given predicate. Returns the primary key of the last inserted row, if the insert was performed. If called on a table which doesn't have an auto-incrementing primary key, Just id is always returned on successful insert, where id is a row identifier guaranteed to not match any row in any table.

valuedef :: SqlType a => a
#

The default value for a column during insertion. For an auto-incrementing primary key, the default value is the next key.

Using def in any other context than insertion results in a runtime error.

valueupsert
  1. :: (MonadSelda m, MonadMask m, Relational a)
  2. => Table a
  3. -> Row (Backend m) a -> Col (Backend m) Bool
  4. -> Row (Backend m) a -> Row (Backend m) a
  5. -> [a]
  6. -> m (Maybe (ID a))
#

Attempt to perform the given update. If no rows were updated, insert the given row. Returns the primary key of the inserted row, if the insert was performed. Calling this function on a table which does not have a primary key will return Just id on a successful insert, where id is a row identifier guaranteed to not match any row in any table.

Note that this may perform two separate queries: one update, potentially followed by one insert.

Prepared statements

3 declarations
classclass Prepare q f where
#

Some parameterized query q that can be prepared into a function f in some MonadSelda.

Instances2Prepare
valueprepared :: (Preparable q, Prepare q f, Equiv q f) => q -> f
#

Create a prepared Selda function. A prepared function has zero or more arguments, and will get compiled into a prepared statement by the first backend to execute it. Any subsequent calls to the function for the duration of the connection to the database will reuse the prepared statement.

Preparable functions are of the form (SqlType a, SqlType b, ...) => Col s a -> Col s b -> ... -> Query s r. The resulting prepared function will be of the form MonadSelda m => a -> b -> ... -> m [Res r]. Note, however, that when using prepared, you must give a concrete type for m due to how Haskell's type class resolution works.

Prepared functions rely on memoization for just-in-time preparation and caching. This means that if GHC accidentally inlines your prepared function, it may get prepared twice. While this does not affect the correctness of your program, and is fairly unlikely to happen, if you want to be absolutely sure that your queries aren't re-prepared more than absolutely necessary, consider adding a NOINLINE annotation to each prepared function.

Note that when using a constrained backend type variable (i.e. foo :: Bar b => SeldaM b [Int]), optimizations must be enabled for prepared statements to be effective.

A usage example:

persons :: Table (Text, Int)
(persons, name :*: age) = tableWithSelectors "ages" [name :- primary]

{-# NOINLINE ageOf #-}
ageOf :: Text -> SeldaM [Int]
ageOf = prepared $ \n -> do
  person <- select ages
  restrict $ (person!name .== n)
  return age

Defining schemas

20 declarations
classclass Generic a where
#

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

A Generic instance must satisfy the following laws:

from . to ≡ id
to . from ≡ id
Instances197Generic, …
  • Generic ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Generic ForeignSrcLangDefined in ghc-boot-th-9.10.3 · GHC.ForeignSrcLang.Type
  • Generic ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.Type
  • Generic VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrder
  • Generic ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypes
  • Generic AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Version
  • Generic FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Generic CCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ConcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DebugFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoCostCentresDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoHeapProfileDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoTraceDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic GCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic GiveGCStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic HpcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic MiscFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ParFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ProfFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic RTSFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic TickyFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic TraceFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic SrcLocDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic GCDetailsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Generic RTSStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Generic GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic OsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic OsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • Generic RowIDDefined in selda-0.5.2.1 · Database.Selda.SqlType
  • Generic AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Generic (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (SCC vertex)Defined in containers-0.7 · Data.Graph
  • Generic (Digit a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (Elem a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (FingerTree a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (Node a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (ViewL a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (ViewR a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (Tree a)Defined in containers-0.7 · Data.Tree
  • Generic (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Generic (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Endo a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Generic (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic (Only a)Defined in selda-0.5.2.1 · Database.Selda
  • Generic (ID a)Defined in selda-0.5.2.1 · Database.Selda.SqlType
  • Generic (UUID' a)Defined in selda-0.5.2.1 · Database.Selda.SqlType
  • Generic (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (WrappedMonad m a)Defined in base-4.20.2.0 · Control.Applicative
  • Generic (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Lift f a)Defined in transformers-0.6.1.1 · Control.Applicative.Lift
  • Generic (MaybeT m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe
  • Generic (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a :*: b)Defined in selda-0.5.2.1 · Database.Selda.Types
  • Generic (WrappedArrow a b c)Defined in base-4.20.2.0 · Control.Applicative
  • Generic (Kleisli m a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Generic (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Generic (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec (Ptr ()) p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards
  • Generic (AccumT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum
  • Generic (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • Generic (IdentityT f a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity
  • Generic (ReaderT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Reader
  • Generic (SelectT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Select
  • Generic (StateT s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Lazy
  • Generic (StateT s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Strict
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPS
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Strict
  • Generic (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Generic (Reverse f a)Defined in transformers-0.6.1.1 · Data.Functor.Reverse
  • Generic (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product
  • Generic (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum
  • Generic (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (ContT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Cont
  • Generic ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Generic (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Strict
  • Generic ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
newtypenewtype TableName
#

Name of a database table.

Instances4Eq, Ord, Show, IsString
newtypenewtype ColName
#

Name of a database column.

Instances4Eq, Ord, Show, IsString
  • Eq ColNameDefined in selda-0.5.2.1 · Database.Selda.Types
  • Ord ColNameDefined in selda-0.5.2.1 · Database.Selda.Types
  • Show ColNameDefined in selda-0.5.2.1 · Database.Selda.Types
  • IsString ColNameDefined in selda-0.5.2.1 · Database.Selda.Types
datadata Attr a where
#

A generic column attribute. Essentially a pair or a record selector over the type a and a column attribute. An attribute may be either a Group attribute, meaning that it can span multiple columns, or a Selector -- single column -- attribute.

Constructors

datadata Attribute (g :: Type -> Type -> Type) t c
#

Some attribute that may be set on a column of type c, in a table of type t.

datadata Group t a where
#

A non-empty list of selectors, where the element selectors need not have the same type. Used to specify constraints, such as uniqueness or primary key, potentially spanning multiple columns.

Constructors

Instances2SelectorLike, IsLabel
valuesel :: Selector t a -> Selector t a
#

Annotation to force the type of a polymorphic label (i.e. #foo) to be a selector. This is useful, for instance, when defining unique constraints: sel #foo :- unique.

valuetable :: Relational a => TableName -> [Attr a] -> Table a
#

Generate a table from the given table name and list of column attributes. All Maybe fields in the table's type will be represented by nullable columns, and all non-Maybe fields fill be represented by required columns. For example:

data Person = Person
  { id   :: ID Person
  , name :: Text
  , age  :: Int
  , pet  :: Maybe Text
  }
  deriving Generic

people :: Table Person
people = table "people" [#id :- autoPrimary]

This will result in a table of Persons, with an auto-incrementing primary key.

If the given type does not have record selectors, the column names will be col_1, col_2, etc.

valuetableFieldMod
  1. :: Relational a
  2. => TableName
  3. -> [Attr a]
  4. -> Text -> Text
  5. -> Table a
#

Generate a table from the given table name, a list of column attributes and a function that maps from field names to column names. Ex.:

data Person = Person
  { personId   :: Int
  , personName :: Text
  , personAge  :: Int
  , personPet  :: Maybe Text
  }
  deriving Generic

people :: Table Person
people = tableFieldMod "people"
  [#personName :- autoPrimary]
  (fromJust . stripPrefix "person")

This will create a table with the columns named Id, Name, Age and Pet.

A "weakly auto-incrementing" primary key. Behaves like autoPrimary, but the sequence of generated keys is not guaranteed to be monotonically increasing.

This gives better performance on some backends, but means that the relation a > b = a was inserted at a later point in time than b does not hold.

datadata IndexMethod
#

Method to use for indexing with indexedUsing. Index methods are ignored by the SQLite backend, as SQLite doesn't support different index methods.

Instances3Eq, Ord, Show

Creating and dropping tables

4 declarations

Tuple convenience functions

7 declarations
classclass Tup a where
#
Instances2Tup
  • Head a ~ a => Tup aDefined in selda-0.5.2.1 · Database.Selda.Types
  • Tup (a :*: b)Defined in selda-0.5.2.1 · Database.Selda.Types
valuefirst :: Tup a => a -> Head a
#

Get the first element of an inductive tuple.

valuesecond :: Tup b => a :*: b -> Head b
#

Get the second element of an inductive tuple.

valuethird :: Tup c => a :*: (b :*: c) -> Head c
#

Get the third element of an inductive tuple.

Useful re-exports

8 declarations
classclass Monad m => MonadIO (m :: Type -> Type) where
#

Monads in which IO computations may be embedded. Any monad built by applying a sequence of monad transformers to the IO monad will be an instance of this class.

Instances should satisfy the following laws, which state that liftIO is a transformer of monads:

Instances19MonadIO, …
classclass MonadCatch m => MonadMask (m :: Type -> Type) where
#

A class for monads which provide for the ability to account for all possible exit points from a computation, and to mask asynchronous exceptions. Continuation-based monads are invalid instances of this class.

Instances should ensure that, in the following code:

fg = f `finally` g

The action g is called regardless of what occurs within f, including async exceptions. Some monads allow f to abort the computation via other effects than throwing an exception. For simplicity, we will consider aborting and throwing an exception to be two forms of "throwing an error".

If f and g both throw an error, the error thrown by fg depends on which errors we're talking about. In a monad transformer stack, the deeper layers override the effects of the inner layers; for example, ExceptT e1 (Except e2) a represents a value of type Either e2 (Either e1 a), so throwing both an e1 and an e2 will result in Left e2. If f and g both throw an error from the same layer, instances should ensure that the error from g wins.

Effects other than throwing an error are also overridden by the deeper layers. For example, StateT s Maybe a represents a value of type s -> Maybe (a, s), so if an error thrown from f causes this function to return Nothing, any changes to the state which f also performed will be erased. As a result, g will see the state as it was before f. Once g completes, f's error will be rethrown, so g' state changes will be erased as well. This is the normal interaction between effects in a monad transformer stack.

By contrast, lifted-base's version of finally always discards all of g's non-IO effects, and g never sees any of f's non-IO effects, regardless of the layer ordering and regardless of whether f throws an error. This is not the result of interacting effects, but a consequence of MonadBaseControl's approach.

Instances14MonadMask, …
methodliftIO :: IO a -> m a
#

Lift a computation from the IO monad. This allows us to run IO computations in any monadic stack, so long as it supports these kinds of operations (i.e. IO is the base monad for the stack).

Example
import Control.Monad.Trans.State -- from the "transformers" library

printState :: Show s => StateT s IO ()
printState = do
  state <- get
  liftIO $ print state

Had we omitted liftIO, we would have ended up with this error:

• Couldn't match type ‘IO’ with ‘StateT s IO’
 Expected type: StateT s IO ()
   Actual type: IO ()

The important part here is the mismatch between StateT s IO () and IO ().

Luckily, we know of a function that takes an IO a and returns an (m a): liftIO, enabling us to run the program and see the expected results:

> evalStateT printState "hello"
"hello"

> evalStateT printState 3
3
datadata Text
#

A space efficient, packed, unboxed Unicode text type.

Instances20IsList, Eq, Data, Ord, Read, Show, …
  • IsList TextDefined in text-2.1.3 · Data.Text · orphan

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedLists['\55555'] :: Text"\65533"
  • Eq TextDefined in text-2.1.3 · Data.Text · orphan
  • Data TextDefined in text-2.1.3 · Data.Text · orphan

    This instance preserves data abstraction at the cost of inefficiency. We omit reflection services for the sake of data abstraction.

    This instance was created by copying the updated behavior of Data.Set.Set and Data.Map.Data.Map.Map. If you feel a mistake has been made, please feel free to submit improvements.

    The original discussion is archived here: could we get a Data instance for Data.Text.Text?

    The followup discussion that changed the behavior of Set and Data.Map.Map is archived here: Proposal: Allow gunfold for Data.Map, ...

  • Ord TextDefined in text-2.1.3 · Data.Text · orphan
  • Read TextDefined in text-2.1.3 · Data.Text · orphan
  • Show TextDefined in text-2.1.3 · Data.Text.Show · orphan
  • IsString TextDefined in text-2.1.3 · Data.Text · orphan

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedStrings"\55555" :: Text"\65533"
  • Semigroup TextDefined in text-2.1.3 · Data.Text · orphan

    Beware: stimes will crash if the given number does not fit into an Int.

  • Monoid TextDefined in text-2.1.3 · Data.Text · orphan
  • PrintfArg TextDefined in text-2.1.3 · Data.Text · orphan
  • NFData TextDefined in text-2.1.3 · Data.Text · orphan
  • Binary TextDefined in text-2.1.3 · Data.Text · orphan
  • Hashable TextDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • SqlOrd TextDefined in selda-0.5.2.1 · Database.Selda
  • SqlType TextDefined in selda-0.5.2.1 · Database.Selda.SqlType
  • Lift TextDefined in text-2.1.3 · Data.Text · orphan
  • IsString (Col s Text)Defined in selda-0.5.2.1 · Database.Selda.Column
  • Semigroup (Col s Text)Defined in selda-0.5.2.1 · Database.Selda · orphan
  • Monoid (Col s Text)Defined in selda-0.5.2.1 · Database.Selda · orphan
  • type Item Text = CharDefined in text-2.1.3 · Data.Text · orphan
newtypenewtype Day
#

The Modified Julian Day is a standard count of days, with zero being the day 1858-11-17.

Instances14Enum, Eq, Data, Ord, Read, Show, …
  • Enum DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Eq DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Data DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Ord DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Read DayDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Show DayDefined in time-1.12.2 · Data.Time.Calendar.Gregorian · orphan
  • Ix DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • NFData DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • DayPeriod DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • FormatTime DayDefined in time-1.12.2 · Data.Time.Format.Format.Instances · orphan
  • ParseTime DayDefined in time-1.12.2 · Data.Time.Format.Parse.Instances · orphan
  • ISO8601 DayDefined in time-1.12.2 · Data.Time.Format.ISO8601

    yyyy-mm-dd (ISO 8601:2004(E) sec. 4.1.2.2 extended format)

  • SqlOrd DayDefined in selda-0.5.2.1 · Database.Selda
  • SqlType DayDefined in selda-0.5.2.1 · Database.Selda.SqlType
datadata TimeOfDay
#

Time of day as represented in hour, minute and second (with picoseconds), typically used to express local time of day.

TimeOfDay 24 0 0 is considered invalid for the purposes of makeTimeOfDayValid, as well as reading and parsing, but valid for ISO 8601 parsing in Data.Time.Format.ISO8601.

Instances11Eq, Data, Ord, Read, Show, NFData, …
  • Eq TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • Data TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • Ord TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • Read TimeOfDayDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Show TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • NFData TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • FormatTime TimeOfDayDefined in time-1.12.2 · Data.Time.Format.Format.Instances · orphan
  • ParseTime TimeOfDayDefined in time-1.12.2 · Data.Time.Format.Parse.Instances · orphan
  • ISO8601 TimeOfDayDefined in time-1.12.2 · Data.Time.Format.ISO8601

    hh:mm:ss[.sss] (ISO 8601:2004(E) sec. 4.2.2.2, 4.2.2.4(a) extended format)

  • SqlOrd TimeOfDayDefined in selda-0.5.2.1 · Database.Selda
  • SqlType TimeOfDayDefined in selda-0.5.2.1 · Database.Selda.SqlType
datadata UTCTime
#

This is the simplest representation of UTC. It consists of the day number, and a time offset from midnight. Note that if a day has a leap second added to it, it will have 86401 seconds.

Instances11Eq, Data, Ord, Read, Show, NFData, …
  • Eq UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Data UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Ord UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Read UTCTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Show UTCTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTime · orphan
  • NFData UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • FormatTime UTCTimeDefined in time-1.12.2 · Data.Time.Format.Format.Instances · orphan
  • ParseTime UTCTimeDefined in time-1.12.2 · Data.Time.Format.Parse.Instances · orphan
  • ISO8601 UTCTimeDefined in time-1.12.2 · Data.Time.Format.ISO8601

    yyyy-mm-ddThh:mm:ss[.sss]Z (ISO 8601:2004(E) sec. 4.3.2 extended format)

  • SqlOrd UTCTimeDefined in selda-0.5.2.1 · Database.Selda
  • SqlType UTCTimeDefined in selda-0.5.2.1 · Database.Selda.SqlType
datadata UUID
#

Type representing Universally Unique Identifiers (UUID) as specified in RFC 4122.

Instances14Eq, Data, Ord, Read, Show, Storable, …
  • Eq UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Data UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Ord UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Read UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Show UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

    Pretty prints a UUID (without quotation marks). See also toString.

    Example1 expression
    show nil"00000000-0000-0000-0000-000000000000"
  • Storable UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

    This Storable instance uses the memory layout as described in RFC 4122, but in contrast to the Binary instance, the fields are stored in host byte order.

  • NFData UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Random UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

    This Random instance produces insecure version 4 UUIDs as specified in RFC 4122.

  • Uniform UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • Binary UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

    This Binary instance is compatible with RFC 4122, storing the fields in network order as 16 bytes.

  • Hashable UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal
  • IsUUID UUIDDefined in selda-0.5.2.1 · Database.Selda
  • SqlType UUIDDefined in selda-0.5.2.1 · Database.Selda.SqlType

    defaultValue for UUIDs is the all-zero RFC4122 nil UUID.

  • Lift UUIDDefined in uuid-types-1.0.6 · Data.UUID.Types.Internal

Orphan instances

2 instances