Îõ³h*Œ£qÑà      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂ1.5.0.0ž Safe-Inferred)*1äù trel8Ë is a kind that parameterises aggregations. Aggregations parameterised by  are analogous to  5 (i.e, they can only produce results on a non-empty  )) whereas aggregations parameterised by  are analagous to ÃÛ (given a non-empty) query, they return the identity values of the aggregation functions.ÄÅÆ  Safe-Inferred01ÍÛù ®ÇÈÉ  Safe-Inferred1ÍÚÛù [Êrel8Map a  Type -> Type function over the Type1-kinded type variables in of a type constructor.ËÊNone01ÂÃÄÅÆÍÚÛÝðù šÌÍÎÏÐÑÒ Safe-Inferred)*1Ãù ×ÓÔÕÖרÙÚ Safe-InferredÀÒù>rel8An ordering expression for a(. Primitive orderings are defined with  and , and you can combine Order via its various instances.A common pattern is to use Û1 to combine multiple orderings in sequence, and  to select individual columns.Ü Safe-InferredÕjÝÞßàá Safe-Inferred)*/0Íù¤âã Safe-InferredäÑä Safe-Inferredùüåæç Safe-Inferred1ù,èé Safe-Inferred)*/1ÂÃÄÅÆÍØÚÛÝù rel8The Sqlß type class describes both null and not null database values, constrained by a specific class.For example, if you see  Sql DBEq a<, this means any database type that supports equality, and a can either be exactly an a, or it could also be Maybe a.rel8 Nullable a means that rel8 is able to check if the type a is a type that can take null values or not.rel8Homonullable a b means that both a and b can be null, or neither a or b can be null.rel8 nullify a means a cannot take null as a value. êëìíîï Safe-Inferred%&Àéòùþrel8œA name of an object (such as a table, view, function or sequence) qualified by an optional schema. In the absence of an explicit schema, the connection's  search_path will be used implicitly. rel8The name of the object. rel8+The schema that this object belongs to. If ð#, whatever is on the connection's  search_path will be used.ñrel8 Constructs s with   set to ð. òó Safe-Inferred%'9Àéòù* rel8âThe schema for a table. This is used to specify the name and schema that a table belongs to (the FROMÏ part of a SQL query), along with the schema of the columns within this table.ÂFor each selectable table in your database, you should provide a  TableSchema. in order to interact with the table via Rel8.rel8The name of the table.rel84The columns of the table. Typically you would use a ' data type here, parameterized by the  context. ô Safe-Inferred/01ÂÃÄÍØÚÛÝðùsõö  Safe-Inferred')*9ÀùZrel83How to deserialize from PostgreSQL's binary format.rel81How to deserialize from PostgreSQL's text format.rel8ëThe delimiter that is used in PostgreSQL's text format in arrays of this type (this is almost always ',').÷rel8Apply a parser to .ÖThis can be used if the data stored in the database should only be subset of a given :. The parser is applied when deserializing rows returned. øùúû÷! Safe-Inferred%&òårel8 A PostgreSQL type consists of a  (name, schema), and optional  and .  will usually be [], but a type like  numeric(6, 2) will have  ["6", "2"].  is always 0 for non-array types.rel8"The name (and schema) of the type.rel8-Any modifiers applied to the underlying type.rel83If this is an array type, the depth of that array (1 for [], 2 for [][], etc).ürel8 Constructs s with schema set to ð,  set to [] and  set to 0.ý" Safe-Inferred')*òùËrel8TypeInformationÖ describes how to encode and decode a Haskell type to and from database queries. The typeNameÖ is the name of the type in the database, which is used to accurately type literals. rel89How to encode a single Haskell value as a SQL expression.rel83How to deserialize a single result back to Haskell.rel8The name of the SQL type.rel8œSimultaneously map over how a type is both encoded and decoded, while retaining the name of the type. This operation is useful if you want to essentially newtype another #.ÉThe mapping is required to be total. If you have a partial mapping, see  . rel8Apply a parser to .ÖThis can be used if the data stored in the database should only be subset of a given ˆ. The parser is applied when deserializing rows returned - the encoder assumes that the input data is already in the appropriate form. $ Safe-Inferredùþ% Safe-Inferred"'()*äð , ÿ€�‚ƒ„…†‡ˆ& Safe-Inferred"ð j‰' Safe-Inferred"ð –Š‹Œ�Ž( Safe-Inferred "ÂÃÄÝäåðù%ô!rel8äHaskell types that can be represented as expressions in a database. There should be an instance of DBType6 for all column types in your database schema (e.g., int,  timestamptz, etc).åRel8 comes with stock instances for most default types in PostgreSQL, so you should only need to derive instances of this class for custom database types, such as types defined in PostgreSQL extensions, or custom domain types.�rel8Corresponds to inet�rel8Corresponds to jsonb‘rel8Corresponds to uuid’rel8Corresponds to bytea“rel8Corresponds to bytea”rel8Corresponds to citext•rel8Corresponds to citext–rel8Corresponds to text—rel8Corresponds to text˜rel8Corresponds to interval™rel8Corresponds to timešrel8Corresponds to  timestamp›rel8Corresponds to dateœrel8Corresponds to  timestamptz�rel8Corresponds to numeric(1000, log�A€A n)žrel8Corresponds to numericŸrel8Corresponds to float8 rel8Corresponds to float4¡rel8Corresponds to int8¢rel8Corresponds to int4£rel8Corresponds to int2¤rel8Corresponds to char¥rel8Corresponds to bool!") Safe-Inferredù&É#rel8ëA deriving-via helper type for column types that store a Haskell value using a JSON encoding described by aeson's ¦ and § type classes.#$%* Safe-Inferred"ù'4&rel8Like +, but works for jsonb columns.&'(, Safe-InferredÂÃÄÅÆù(.)rel8ÚDatabase types that can be compared for equality in queries. If a type is an instance of )Â, it means we can compare expressions for equality using the SQL = operator.)- Safe-InferredÂÃÄÅÆù)ƒ*rel8-The class of database types that support the min aggregation function.+rel8-The class of database types that support the max aggregation function.,rel8-The class of database types that support the <, <=, > and >= operators.,+*. Safe-Inferred 1ÂÃÄÅÆÍÛù+…-rel8-The class of database types that support the / operator..rel8-The class of database types that support the / operator./rel8�The class of database types that can be coerced to from integral expressions. This is a Rel8 concept, and allows us to provide ¨.0rel8-The class of database types that support the +, *, - operators, and the abs, negate, sign functions.0/.-/ Safe-Inferred1ÂÃÄÍØÚÛÝäðù/ø1rel8ÔTypes that are sum types, where each constructor is unary (that is, has no fields).2rel8DBEnum: contains the necessary metadata to describe a PostgreSQL enum type.3rel87Map Haskell values to the corresponding element of the enumç type. The default implementation of this method will use the exact name of the Haskell constructors.4rel8The name of the PostgreSQL enum type that a maps to.5rel8›A deriving-via helper type for column types that store an "enum" type (in Haskell terms, a sum type where all constructors are nullary) using a Postgres enum type.áNote that this should map to a specific type in your database's schema (explicitly created with CREATE TYPE ... AS ENUM). Use 2“ to specify the name of this Postgres type and the names of the individual values. If left unspecified, the names of the values of the Postgres enum€ are assumed to match exactly exactly the names of the constructors of the Haskell type (up to and including case sensitivity).5623410 Safe-InferredÃù0*©ª«¬­®1 Safe-Inferred ')*1ÍÛù1J7rel8The Result7 context is the context used for decoded query results.óWhen a query is executed against a PostgreSQL database, Rel8 parses the returned rows, decoding each row into the Result context.7¯°±²³2 Safe-Inferred1ÍÛù2z8rel8/This type family is used to specify columns in Rel8ables. In  Column f a, fÄ is the context of the column (which should be left polymorphic in Rel8able definitions), and a is the type of the column.8´3 Safe-Inferred 1=ÂÃÄÅÆÈÍØÚÛÝäðù4"µrel8)A HField type for indexing into HProduct.9rel8A HTableÆ is a functor-indexed/higher-kinded data type that is representable (¶/·), constrainable (¸), and specified (¹).÷This is an internal concept for Rel8, and you should not need to define instances yourself or specify this constraint.9º»·¶¸¹¼½¾¿ÀÁÂÃ4 Safe-Inferred)*-/13ÂÄÅÆÍØÛÝðù4† ÄÅÆÇÈÉÊËÌÍÎ5 Safe-Inferred%&')*/1<>ÀÂÄÅÆÍØÛÝäõù5*Ïrel8 Transform a Ð by allowing it to be null.ÑÒÏÓÔÕÖ×6 Safe-Inferred %&1ÍØÛÝðù5sØÙÚÛÜ7 Safe-Inferred01ÂÃÄÅÆÍØÚÛÝðù5à ÝÞßàáâãäå8 Safe-Inferred-1ÂÄÅÆÍØÚÛÝðù6 æçèéêëìíîïð9 Safe-Inferred1ÃÍÛù6bñòó: Safe-Inferred1=ÂÃÄÅÆÈÍÚÛÝðù: :rel8Table¾s are one of the foundational elements of Rel8, and describe data types that have a finite number of columns. Each of these columns contains data under a shared context, and contexts describe how to interpret the metadata about a column to a particular Haskell type. In Rel8, we have contexts for expressions (the ; context), aggregations (the < context), insert values (the = contex), among others.?In typical usage of Rel8 you don't need to derive instances of :. yourself, as anything that's an instance of  is always a :.;rel8The 91 functor that describes the schema of this table.<rel8=The common context that all columns use as an interpretation.=rel8The  FromExprs type family maps a type in the Expr, context to the corresponding Haskell type.:;<@?=AB>ôõö÷øùú> Safe-Inferred 1ÂÄÅÆÈÍÚÛù;šCrel8C from to a b means that a and b are : s, in the from and toÔ contexts respectively, which share the same underlying structure. In other words, b is a version of a transposed from the from context to the to context (and vice versa).C? Safe-Inferred 1ÂÄÅÆÍÚÛù;Öûüýþ@ Safe-Inferred%&')*/19<>ÀÁÂÃÄÅÆÍØÛÝäðù<0 ÿ€�‚ƒ„…†‡ˆ‰Š‹A Safe-Inferred1ù b whereby the resulting b> is guaranteed to be composed only from columns contained in a.Jrel8The constraint J a b ensures that I a b is a usable I.IGHEFJ�G Safe-Inferred 'ÃÍÛÝðA›Orel89Cast an expression to a different type. Corresponds to a CAST() function call.Prel82Unsafely construct an expression from literal SQL.×This is an escape hatch, and can be used if Rel8 can not adequately express the query you need. If you find yourself using this function, please let us know, as it may indicate that something is missing from Rel8! ‘O’“P”•–—˜™š›H Safe-Inferred'ÃÍÛBˆQrel8%Produce an expression from a literal.Note that you can usually use I, but litExpr6 can solve problems of inference in polymorphic code.Qœ�J Safe-Inferred)*F‡ Vrel8The SQL false literal.Wrel8The SQL true literal.Xrel8The SQL AND operator.Yrel8The SQL OR operator.Zrel8The SQL NOT operator.[rel8Fold AND" over a collection of expressions.\rel8Fold OR" over a collection of expressions.]rel8&Eliminate a boolean-valued expression.Corresponds to KL.^rel8A multi-way ifthen&else statement. The first argument to caseExprÇ is a list of alternatives. The first alternative that is of the form  (true, x)Ø will be returned. If no such alternative is found, a fallback expression is returned.Corresponds to a CASE expression in SQL._rel8 Convert a Expr (Maybe Bool) to a  Expr Bool by treating Nothing as False(. This can be useful when combined with M, which expects a BoolÌ, and produces expressions that optimize better than general case analysis. VWXYZ[\]^_X3Y2N Safe-Inferred1ÃÍÛJ$`rel8!Lift an expression that can't be null to a type that might be nullæ. This is an identity operation in terms of any generated query, and just modifies the query's type.žrel8Like Ÿ, but to eliminate null.arel8Like OP , but for null.brel8Like OQ , but for null.crel8Lift an operation on non-null$ values to an operation on possibly null values. When given null,  mapNull f returns null. This is like   for ¡.drel8Lift a binary operation on non-null; expressions to an equivalent binary operator on possibly null4 expressions. If either of the final arguments are null,  liftOpNull returns null. This is like ¢ for ¡.erel8Corresponds to SQL null. e£ž¤ab`¥cd¦§R Safe-Inferred%&ÂÃÄÅÆÍÚÛùL5frel8This type class is basically : N, where each column of the :Í is an argument to the function, but it also has an additional instance for ()) for calling functions with no arguments.grel8g name arguments runs the PostgreSQL function name with the arguments  arguments returning an N a.hrel8ÎConstruct an expression by applying an infix binary operator to two operands.fg¨hS Safe-Inferred1ÃÍÛLj©ª«¬­®¯T Safe-Inferred(ÝðùM0Krel8ÚA deriving-via helper type for column types that store a Haskell value using a Haskell's ° and ± type classes.KLMU Safe-Inferred -1ÂÃÄÅÆÍÛùN$Rrel8 The class of #Øs that form a semigroup. This class is purely a Rel8 concept, and exists to mirror the  Semigroup class.Srel8An associative operation.RSS6V Safe-Inferred "1ÂÃÄÅÆÍÛùNñTrel8 The class of #Øs that form a semigroup. This class is purely a Rel8 concept, and exists to mirror the ² class.TUW Safe-Inferred"1ÀÂÃÄÅÆÍÛÝðùOWNrel8Typed SQL expressions.N³X Safe-Inferred'ÃÍÛOŠ´Y Safe-Inferred'ÂÃÄÅÆÈÍÚÛÝðùR|rel8 Serializable; witnesses the one-to-one correspondence between the type sql/, which contains SQL expressions, and the type haskell:, which contains the Haskell decoding of rows containing sql SQL expressions.}rel8ToExprs exprs a is evidence that the types exprs and a* describe essentially the same type, but exprs is in the N context, and a is a normal Haskell type.~rel8Use lit2 to turn literal Haskell values into expressions. lit is capable of lifting single Exprs to full tables.|~µ¶}Z Safe-Inferred(ÃÍÛTÍrel8%An if-then-else expression on tables. bool x y p returns x if p is False, and returns y if p is True.Îrel8ÛProduce a table expression from a list of alternatives. Returns the first table where the  Expr Bool expression is True>. If no alternatives are true, the given default is returned.Ïrel8Like Ÿ, but to eliminate null.ÍÎÏ[ Safe-InferredÃÍÛùVirel8Like  Alternative in Haskell, some :)s form a monoid on applicative functors.jrel8The identity of l.krel8Like Altð in Haskell. This class is purely a Rel8 concept, and allows you to take a choice between two tables. See also i.For example, using l on \Û allows you to combine two tables and to return the first one that is a "just" MaybeTable.lrel8#An associative binary operation on :s.klijl3] Safe-Inferred)*1ÀÂÃÄÅÆÍÒØÛÝùWñmrel8 Selects a b means that a is a schema (i.e., a : of n s) for the N columns in b.nrel8A Name÷ is the name of a column, as it would be defined in a table's schema definition. You can construct names by using the OverloadedStringsÒ extension and writing string literals. This is typically done when providing a  TableSchema value.n·m¸^ Safe-Inferred %'(-1ÃÍØÛÝY qrel8Transform a table by adding CASTª to all columns. This is most useful for finalising a SELECT or RETURNING statement, guaranteed that the output matches what is encoded in each columns TypeInformation.¹º»¼½¾¿ÀÁÂÃÄqÅ_ Safe-Inferred'(1ÂÃÄÅÆÍÛÝð[úorel8Construct a table in the nÙ context containing the names of all columns. Nested column names will be combined with /. See also: p.prel8Construct a table in the në context containing the names of all columns. The supplied function can be used to transform column names.ÃThis function can be used to generically derive the columns for a  TableSchema. For example, ómyTableSchema :: TableSchema (MyTable Name) myTableSchema = TableSchema { columns = namesFromLabelsWith last } will construct a  TableSchemaÐ where each columns names exactly corresponds to the name of the Haskell field.opÆÇÈ` Safe-Inferred\*Éa Safe-Inferred'\UÊb Safe-Inferred"%&')*ÃÚÛäéòùbM rrel8The ON CONFLICT (...) DO UPDATE clause of an INSERT$ statement, also known as "upsert".ÃWhen an existing row conflicts with a row proposed for insertion, ON CONFLICT DO UPDATE¢ allows you to instead update this existing row. The conflicting row proposed for insertion is then "excluded", but its values can still be referenced from the SET and WHERE clauses of the UPDATE statement.ÆUpsert in Postgres a "conflict target" to be specified ”@ this is the UNIQUE½ index from conflicts with which we would like to recover. Indexes are specified by listing the columns that comprise them along with an optional predicate in the case of partial indexes.trel8"The set of columns comprising the UNIQUEÞ index that forms our conflict target, projected from the set of columns for the whole tableurel8)An optional predicate used to specify a  + operator. Note that this differs from SQL > as null3 will sort below any other value. For a version of > that exactly matches SQL, see Ú.×rel8Corresponds to the SQL >=+ operator. Note that this differs from SQL > as null3 will sort below any other value. For a version of >= that exactly matches SQL, see Û.Ørel8Corresponds to the SQL < operator. Returns null if either arguments are null.Ùrel8Corresponds to the SQL <= operator. Returns null if either arguments are null.Úrel8Corresponds to the SQL > operator. Returns null if either arguments are null.Ûrel8Corresponds to the SQL >= operator. Returns null if either arguments are null.Ürel8ÍGiven two expressions, return the expression that sorts less than the other.Corresponds to the SQL least() function.Ýrel8ÐGiven two expressions, return the expression that sorts greater than the other.Corresponds to the SQL  greatest() function. ÔÕÖרÙÚÛÜÝÔ4Õ4Ö4×4Ø4Ù4Ú4Û4l Safe-InferredÃp€�‚åæçƒm Safe-Inferredè„…†èéê‡n Safe-Inferred()*ÃÝð„êÞrel8&Compare two expressions for equality. This corresponds to the SQL IS NOT DISTINCT FROM operator, and will equate null values as true. This differs from = which would return null#. This operator matches Haskell's ë- operator. For an operator identical to SQL =, see à.ßrel82Test if two expressions are different (not equal).This corresponds to the SQL IS DISTINCT FROM operator, and will return false when comparing two null$ values. This differs from ordinary <> which would return null'. This operator is closer to Haskell's ì- operator. For an operator identical to SQL <>, see á.àrel8µTest if two expressions are equal. This operator is usually the best choice when forming join conditions, as PostgreSQL has a much harder time optimizing a join that has multiple í conditions.This corresponds to the SQL =+ operator, though it will always return a î.árel8'Test if two expressions are different. This corresponds to the SQL <>+ operator, though it will always return a î.ârel8 Like the SQL IN8 operator, but implemented by folding over a list with Þ and Y.ÞßàáâÞ4ß4à4á4o Safe-Inferred%(-1=ÂÃÄÍÚÛÝðù‡‚ãrel8 The class of :“s that can be compared for equality. Equality on tables is defined by equality of all columns all columns, so this class means "all columns in a : have an instance of )".årel8 Compare two :ÿs for equality. This corresponds to comparing all columns inside each table for equality, and combining all comparisons with AND.ærel8 Test if two :‚s are different. This corresponds to comparing all columns inside each table for inequality, and combining all comparisons with OR.ãäåæå4æ4p Safe-Inferred%(1=ÂÃÄÍÚÛÝðù‹)çrel8 The class of Table�s that can be ordered. Ordering on tables is defined by their lexicographic ordering of all columns, so this class means "all columns in a Table have an instance of ,".érel8 Test if one Table sorts before another. Corresponds to comparing all columns with ï.êrel8 Test if one TableÓ sorts before, or is equal to, another. Corresponds to comparing all columns with ð.ërel8 Test if one TableÁ sorts after another. Corresponds to comparing all columns with ñ.ìrel8 Test if one TableÁ sorts after another. Corresponds to comparing all columns with ò.írel8 Given two Table0s, return the table that sorts before the other.îrel8 Given two Table/s, return the table that sorts after the other.çèéêëìíîé4ê4ë4ì4q Safe-Inferred '1ÍÛÝðŒËïrel8 Construct an  for a TableÙ by sorting all columns into ascending orders (any nullable columns will be sorted with  NULLS FIRST).ðrel8 Construct an  for a TableÚ by sorting all columns into descending orders (any nullable columns will be sorted with  NULLS LAST).ïðr Safe-InferredÃ�‹òrel8ÎCombine the results of two queries of the same type, collapsing duplicates.  union a b" is the same as the SQL statement  a UNION b.órel8ÌCombine the results of two queries of the same type, retaining duplicates.  unionAll a b" is the same as the SQL statement  a UNION ALL b.ôrel8>Find the intersection of two queries, collapsing duplicates. intersect a b" is the same as the SQL statement  a INTERSECT b.õrel8=Find the intersection of two queries, retaining duplicates. intersectAll a b" is the same as the SQL statement a INTERSECT ALL b.örel8:Find the difference of two queries, collapsing duplicates  except a b# is the same as the SQL statement  a EXCEPT b.÷rel8;Find the difference of two queries, retaining duplicates.  exceptAll a b# is the same as the SQL statement a EXCEPT ALL b.òóôõö÷s Safe-InferredÃù‘Öñrel8The Query monad allows you to compose a SELECT7 query. This monad has semantics similar to the list ([]) monad.órel8ô = ø [].õrel8Û = ó.örel8j = ø [].÷rel8l = ó.ñøt Safe-Inferred)*1ù’ùúûüýþÿu Safe-Inferred’kùrel8#Order the rows returned by a query.ùv Safe-InferredÙ¯úrel8úÀ allows the construction of recursive queries, using Postgres'  Ðhttps://www.postgresql.org/docs/current/queries-with.html#QUERIES-WITH-RECURSIVEWITH RECURSIVE( under the hood. The first argument to úà is what the Postgres documentation refers to as the "non-recursive term" and the second argument is the "recursive term", which is defined in terms of the result of the "non-recursive term". ú uses  UNION ALL3 to combine the recursive and non-recursive terms.Denotionally, ú s f is the smallest set of rows r such that r == s `w ` (r >>= f) Operationally, ú s f" takes each row in an initial set s and supplies it to fƒ, resulting in a new generation of rows which are added to the result set. Each row from this new generation is then fed back to fÉ, and this process is repeated until a generation comes along for which f+ returns an empty set for each row therein.ûrel8û is like ú but uses UNION instead of  UNION ALL3 to combine the recursive and non-recursive terms.Denotationally, û s f is the smallest set of rows r such that r == s `d ` (r >>= f) Operationally, û s f takes each distinct row in an initial set s and supplies it to f?, resulting in a new generation of rows. Any rows returned by fÙ that already exist in the result set are not considered part of this new generation by û (in contrast to úâ). This new generation is then added to the result set, and each row therein is then fed back to fÉ, and this process is repeated until a generation comes along for which f= returns no rows that don't already exist in the result set.úûx Safe-InferredšÕürel8limit n select at most n rows from a query. limit n is equivalent to the SQL LIMIT n.ýrel8offset n drops the first n rows from a query. offset n is equivalent to the SQL OFFSET n.üýy Safe-InferredÛíþrel8þä takes a variable name, some expressions, and binds each of them to a new variable in the SQL. The aÀ returned consists only of these variables. It's essentially a let" binding for Postgres expressions.þ€z Safe-InferredÞ¼ÿrel8ÿ takes a ñÜ and fully evaluates it and caches the results thereof, and passes to a continuation a new ñò that simply looks up these cached results. It's usually best not to use this and to let the Postgres optimizer decide for itself what's best, but if you know what you're doing this can sometimes help to nudge it in a particular direction.ÿ1 is currently implemented in terms of Postgres'  9https://www.postgresql.org/docs/current/queries-with.html@WITH syntax, specifically the WITH _ AS MATERIALIZED (_)4 form introduced in PostgreSQL 12. This means that ÿ/ can only be used with PostgreSQL 12 or newer.ÿ{ Safe-Inferredßa€rel8ÐSelect each row from a function that returns a relation. This is equivalent to FROM function(input).€| Safe-Inferred¡,�rel8 filter f x will be a zero-row query when f x is False, and will return x unchanged when f x is True. This is similar to }~Ú, but as the predicate is separate from the argument, it is easy to use in a pipeline of ñ transformations.‚rel8-Drop any rows that don't match a predicate.  where_ expr is equivalent to the SQL  WHERE expr.�‚ Safe-InferredÃÕ¢ƒrel8ƒÔ takes expressions that could potentially have side effects and "runs" them in the ñÐ monad. The returned expressions have no side effects and can safely be reused.ƒ€ Safe-Inferred⥄rel8?Select each row from a table definition. This is equivalent to  FROM table.„� Safe-Inferred1¥r…rel8+Checks if a query returns at least one row.†rel8 Query b yields no rows.‹rel8Like without$, but with a custom membership test.…�†ˆ‰‡Š‹‚ Safe-Inferred¨Œrel8=Select all distinct rows from a query, removing duplicates.  distinct q% is equivalent to the SQL statement SELECT DISTINCT q.�rel8ÌSelect all distinct rows from a query, where rows are equivalent according to a projection. If multiple rows have the same projection, it is unspecified which row will be returned. If this matters, use Ž.Žrel8¼Select all distinct rows from a query, where rows are equivalent according to a projection. If there are multiple rows with the same projection, the first row according to the specified  will be returned.Œ�Ž Safe-Inferred"ÃÍÛ­u �rel8Cast / types to 0À types. For example, this can be useful if you need to turn an  Expr Int32 into an  Expr Double.�rel8Cast 0 types to .4 types. For example, this can be useful to convert  Expr Float to  Expr Double.‘rel8Round a . to a /, by rounding to the nearest larger integer.Corresponds to the  ceiling() function.’rel8/Emulates the behaviour of the Haskell function ƒ„ in PostgreSQL.“rel8/Emulates the behaviour of the Haskell function ƒ… in PostgreSQL.”rel8 Simultaneous ’ and “.•rel8.Perform integral division. Corresponds to the div()7 function in PostgreSQL, which behaves like Haskell's ƒ† rather than ƒ„.–rel8Corresponds to the mod()7 function in PostgreSQL, which behaves like Haskell's ƒ‡ rather than ƒ….—rel8 Simultaneous • and –.˜rel8Round a  DFractional to a /. by rounding to the nearest smaller integer. Corresponds to the floor() function.™rel8Round a . to a /% by rounding to the nearest integer.Corresponds to the round() function.šrel8Round a . to a /2 by rounding to the nearest integer towards zero. ��’“”•–—‘˜™š ��’“”•–—‘˜™šˆ Safe-Inferred²'Ìrel8Corresponds to the SQL DEFAULT expression.This N> is unsafe for numerous reasons, and should be used with care: This N only makes sense in an INSERT or UPDATE statement.ÄRel8 is not able to verify that a particular column actually has a DEFAULT value. Trying to use  unsafeDefault6 where there is no default will cause a runtime crashDEFAULTÆ values can not be transformed. For example, the innocuous Rel8 code unsafeDefault + 1# will crash, despite type checking./Also note, PostgreSQL's syntax rules mean that DEFAULT can only appear in INSERT, expressions whose rows are specified using VALUES. This means that if the rows field of your = record doesn't look like  values [..], then  unsafeDefault won't work.ïGiven all these caveats, we suggest avoiding the use of default values where possible, instead being explicit. A common scenario where default values are used is with auto-incrementing identifier columns. In this case, we suggest using ‰ instead.ÌŠ Safe-Inferred)*1ÍÝù½Ü›rel8An ›$ takes a collection of rows of type aÄ, groups them, and transforms each group into a single row of type b). This corresponds to aggregators using GROUP BY0 in SQL. If given an empty collection of rows, ›Ñ will have no groups and will therefore also return an empty collection of rows.› is a special form of � parameterised by .œrel8An � takes a  ) producing a collection of rows of type a and transforms it into a  ! producing a single row of type b. If the given  Í produces an empty collection of rows, then the single row in the resulting  Ë contains the identity values of the aggregation functions comprising the � (i.e., 0 for ‹, Œ for �, etc.).� is a special form of � parameterised by .�rel8�5 is the most general form of "aggregator", of which � and › are special cases. �1s are comprised of aggregation functions and/or GROUP BY clauses..Aggregation functions operating on individual ; s such as ‹ can be combined into �'s operating on larger types using the ‚, ƒ and „ interfaces. Working with ƒ(s can sometimes be awkward so for every ‹ we also provide a Ž which bundles an ��Ì. For complex aggregations, we recommend using these functions along with  ApplicativeDo, BlockArguments, OverloadedRecordDot and RecordWildCards: “ data Input f = Input { orderId :: Column f OrderId , customerId :: Column f CustomerId , productId :: Column f ProductId , quantity :: Column f Int64 , price :: Column f Scientific } deriving (Generic, Rel8able) totalPrice :: Input Expr -> Expr Scientific totalPrice input = fromIntegral input.quantity * input.price data Result f = Result { customerId :: Column f CustomerId , totalOrders :: Column f Int64 , productsOrdered :: Column f Int64 , totalPrice :: Column Scientific } deriving (Generic, Rel8able) allResults :: Query (Result Expr) allResults = aggregate do customerId <- groupByOn (.customerId) totalOrders <- countDistinctOn (.orderId) productsOrdered <- countDistinctOn (.productId) totalPrice <- sumOn totalPrice pure Result {..} do order <- each orderSchema orderLine <- each orderLineSchema where_ $ order.id ==. orderLine.orderId pure Input { orderId = order.id , customerId = order.customerId , productId = orderLine.productId , quantity = orderLine.quantity , price = orderLine.price } žrel8ž turns an � into an ›.Ÿrel8ÅGiven a value to fall back on if given an empty collection of rows, Ÿ turns an › into an �.�…œ›Ÿž†‡‘ Safe-Inferred'1ÂÃÄÅÆÍÚÛÝäðù¾2ˆ‰Š‹’ Safe-Inferredþû rel8 „ allows the use use of custom aggregation functions or PostgreSQL aggregation functions which are not otherwise supported by Rel8. “ Safe-InferredÂÃÄÅÆù¿‘¡rel8)The class of data types that support the  string_agg() aggregation function.¡” Safe-Inferred 1ÂÃÄÅÆÍÛùÀ*¢rel8-The class of database types that support the sum() aggregation function.¢• Safe-Inferred "%'1ÃÍÛÝðÏ+£rel88Count the occurances of a single column. Corresponds to COUNT(a)¤rel8Applies £. to the column selected by the given function.¥rel8ÍCount the number of distinct occurrences of a single column. Corresponds to COUNT(DISTINCT a)¦rel8Applies ¥. to the column selected by the given function.§rel8Corresponds to COUNT(*).¨rel85A count of the number of times a given expression is true.©rel8Applies ¨. to the column selected by the given function.ªrel8Corresponds to bool_and.«rel8Applies ª. to the column selected by the given function.¬rel8Corresponds to bool_or.­rel8Applies ¬. to the column selected by the given function.®rel8Produce an aggregation for Expr a using the max function.¯rel8Applies ®. to the column selected by the given function.°rel8Produce an aggregation for Expr a using the min function.±rel8Applies °. to the column selected by the given function.²rel8Corresponds to sum. Note that in SQL, sum% is type changing - for example the sum of integer returns a bigint½. Rel8 doesn't support this, and will add explicit casts back to the original input type. This can lead to overflows, and if you anticipate very large sums, you should upcast your input.³rel8Applies ². to the column selected by the given fucntion.´rel8´ is a combination of – and ³.µrel8Corresponds to avg. Note that in SQL, avg& is type changing - for example, the avg of integer returns a numeric². Rel8 doesn't support this, and will add explicit casts back to the original input type. If you need a fractional result on an integral column, you should cast your input to Œ or —˜ before calling µ.¶rel8Applies µ. to the column selected by the given fucntion.·rel8Corresponds to  string_agg().�rel8Applies ·. to the column selected by the given function.¸rel8Corresponds to  mode() WITHIN GROUP (ORDER BY _).¹rel8Applies ¸. to the column selected by the given function.ºrel8Corresponds to ,percentile_disc(_) WITHIN GROUP (ORDER BY _).»rel8Applies º. to the column selected by the given function.¼rel8Corresponds to ,percentile_cont(_) WITHIN GROUP (ORDER BY _).½rel8Applies ¼/ to the column selected by the given function.¾rel8Corresponds to !rank(_) WITHIN GROUP (ORDER BY _).¿rel8Corresponds to 'dense_rank(_) WITHIN GROUP (ORDER BY _).Àrel8Corresponds to )percent_rank(_) WITHIN GROUP (ORDER BY _).Árel8Corresponds to &cume_dist(_) WITHIN GROUP (ORDER BY _).Žrel8$Aggregate a value by grouping by it.�rel8Applies Ž. to the column selected by the given function.Ârel8%Collect expressions values as a list.Ãrel8Applies Â. to the column selected by the given function.Ärel8/Collect expressions values as a non-empty list.Årel8Applies Ä. to the column selected by the given function.Ærel8%Concatenate lists into a single list.Çrel8Applies Æ. to the column selected by the given function.Èrel89Concatenate non-empty lists into a single non-empty list.Érel8Applies È. to the column selected by the given function.Êrel8Ê modifies an …° to consider only distinct values of each particular column. Note that this "distinction" only happens within each column individually, not across all columns simultaneously.0£¤§¥¦¨©ª«¬­°±®¯²³´µ¶·�¸¹º»¼½¾¿ÀÁŽ�ʆÂÃÄÅÆÇÈÉ�‘’“™ Safe-Inferred1>ÀÁÒùÏ“ ”•–—˜™š›œš Safe-Inferred1<>ÀùÏÔ�žŸ ¡¢› Safe-Inferred1<>ÀùУ¤¥¦œ Safe-Inferred'19ÀÂÃÄÅÆÍÚÛÝðù×e Ërel8 MaybeTable t is the table tå, but as the result of an outer join. If the outer join fails to match any rows, this is essentialy Nothing7, and if the outer join does match rows, this is like Justœ. Unfortunately, SQL makes it impossible to distinguish whether or not an outer join matched any rows based generally on the row contents - if you were to join a row entirely of nulls, you can't distinguish if you matched an all null row, or if the match failed. For this reason  MaybeTableã contains an extra field - a "nullTag" - to track whether or not the outer join produced any rows.Ìrel8 Check if a  MaybeTable is absent of any row. Like OP.Írel8 Check if a  MaybeTable contains a row. Like §.Îrel8Perform case analysis on a Ë. Like Ÿ.Ïrel8The null table. Like ð.Ðrel8Lift any table into Ë. Like ¨. Note you can also use ©.Ñrel8ª for Ës.Òrel8%Project a single expression out of a Ë+. You can think of this operator like the «2 operator, but it also has the ability to return null.Órel8#Lift an aggregator to operate on a Ë.  nothingTables and  justTables are grouped separately.Ôrel8 Construct a Ë in the n, context. This can be useful if you have a Ë: that you are storing in a table and need to construct a  TableSchema.¬rel8Has the same behavior as the Monad instance for Maybe.­rel8Has the same behavior as the  Applicative instance for Maybe . See also: �.Ôrel83The name of the column to track whether a row is a Ð or Ï.rel8Names of the columns in a.Ë®¯°ÎÏÐÌÍÑÒÓÔ±Ò4ž Safe-Inferred'19ÀÂÃÄÅÆÍÕÚÛÝðùß·Õrel8TheseTable a b0 is a Rel8 table that contains either the table a , the table b, or both tables a and b. You can construct  TheseTable s using Þ, ß and à.  TheseTable+s can be eliminated/pattern matched using á. TheseTable( is operationally the same as Haskell's ²& type, but adapted to work with Rel8.Örel8 Test if a Õ was constructed with Þ.Corresponds to Ÿ .×rel8 Test if a Õ was constructed with ß.Corresponds to Ÿ¡.Ørel8 Test if a Õ was constructed with à.Corresponds to Ÿ¢.Ùrel8 Test if the a side of TheseTable a b is present.Corresponds to Ÿ£.Úrel8 Test if the b table of TheseTable a b is present.Corresponds to Ÿ¤.Ûrel8Attempt to project out the a table of a TheseTable a b.Corresponds to ³.Ürel8Attempt to project out the b table of a TheseTable a b.Corresponds to ´.Ýrel8 Construct a  TheseTable from two Ës.Þrel8 Construct a  TheseTable. Corresponds to µ.ßrel8 Construct a  TheseTable. Corresponds to ¶.àrel8 Construct a  TheseTable. Corresponds to ².árel8Pattern match on a Õ. Corresponds to these.ârel8(Lift a pair aggregators to operate on a Õ.  thisTables,  thatTables are  thoseTables are grouped separately.ãrel8 Construct a Õ in the n, context. This can be useful if you have a Õ: that you are storing in a table and need to construct a  TableSchema.ãrel84The name of the column to track the presence of the a table.rel84The name of the column to track the presence of the b table.rel8Names of the columns in the a table.rel8Names of the columns in the b table.Õ·¸¹áÞßàÖרÙÚÛÜÝâ㥠Safe-Inferred 1ÍÛùàÐärel8Nest an ² value within a Rel8able.  HThese f a b will produce a Õ a b in the Expr context, and a ² a b in the 7 context.ä¦ Safe-Inferred1ÂÃÄÅÆÍÚÛÝðùå{ årel8 NullTable t is the table t, but where all the columns in t have the possibility of being §. This is very similar to \Ô, except that it does not use an extra tag field, so it cannot distinguish between Nothing and  Just Nothing: if nested. In other words, if all of the columns of the t passed to  NullTable are already nullable, then  NullTable has no effect.ærel8+Check if any of the non-nullable fields of a are § under the å . Returns Œ if a has no non-nullable fields.çrel8The inverse of æ.èrel8Like ¨.érel8The null table. Like §.êrel8Lift any table into å. Like ©.ërel8 Construct a å in the n, context. This can be useful if you have a å: that you are storing in a table and need to construct a  TableSchema.ìrel8 Convert a å to a Ë.írel8 Convert a Ë to a å. Note that if the underlying a9 has no non-nullable fields, this is a lossy conversion. åºèéê»æçëìíª Safe-Inferred'1ÂÃÄÅÆÍÚÛÝðùéTîrel8A  NonEmptyTable) value contains one or more instances of a. You construct  NonEmptyTables with « or  nonEmptyAgg.ïrel8%Project a single expression out of a î.ðrel8 Construct a  NonEmptyTable& from a non-empty list of expressions.ñrel8 Construct a î in the n, context. This can be useful if you have a î: that you are storing in a table and need to construct a  TableSchema.òrel8Get the first element of a î.órel8ó i as extracts a single element from as , returning ¬ if iù is out of range. Note that although PostgreSQL array indexes are 1-based (by default), this function is always 0-based.ôrel8Get the last element of a î.õrel8Get the length of a îñrel81The names of the columns of elements of the list. î¼ïðñòóôõï4­ Safe-Inferred 1ÍÛùê]örel8Nest a ½ list within a Rel8able.  HNonEmpty f a will produce a î a in the Expr context, and a ½ a in the 7 context.ö® Safe-Inferred'1ÂÃÄÅÆÍÚÛÝðùî7÷rel8A  ListTable* value contains zero or more instances of a. You construct  ListTables with ¯ or °.ørel8%Project a single expression out of a ÷.ùrel8 Construct a  ListTable from a list of expressions.úrel8 Construct a ÷ in the n, context. This can be useful if you have a ÷: that you are storing in a table and need to construct a  TableSchema.ûrel8Get the first element of a ÷ (or ¬ if empty).ürel8ü i as extracts a single element from as , returning ¬ if iù is out of range. Note that although PostgreSQL array indexes are 1-based (by default), this function is always 0-based.ýrel8Get the last element of a ÷ (or ¬ if empty).þrel8Get the length of a ÷úrel81The names of the columns of elements of the list. ÷¾øùúûüýþø4± Safe-Inferred 1ÍÛùï+ÿrel8Nest a list within a Rel8able.  HList f a will produce a ÷ a in the Expr context, and a [a] in the 7 context.ÿ Safe-InferredïT÷û„ü…ý†þ‡îò€ó�ô‚õƒ÷û„ü…ý†þ‡îò€ó�ô‚õƒ² Safe-InferredÃðÓ€rel8 Filter a ñ that might return null to a ñ without any nulls.Corresponds to O³.�rel8 Filter a ñ that might return  nullTable to a ñ without any  nullTables.Corresponds to O³.€�´ Safe-Inferred 1ÍÛùñÄ‚rel8Nest a Null value within a Rel8able.  HNull f a will produce a å a in the Expr context, and a ¡ a in the 7 context.‚µ Safe-Inferred '-ÃÍÛÝðü$ƒrel8ÜGroup equal tables together. This works by aggregating each column in the given table with  groupByExpr.àFor example, if we have a table of items, we could group the items by the order they belong to: ÙitemsByOrder :: Query (OrderId Expr, ListTable Expr (Item Expr)) itemsByOrder = aggregate do orderId <- groupByOn (.orderId) items <- listAgg pure (orderId, items) do each itemSchema „rel8Applies ƒ/ to the columns selected by the given function.…rel8… allows an �€ to filter out rows from the input query before considering them for aggregation. Note that because the predicate supplied to … could return Œ for every row, … needs an � as opposed to an ›Ë, so that it can return a default value in such a case. For a variant of … that can work with ›s, see †.†rel8 A variant of … that can be used with an › (upgrading it to an � in the process). It returns Ï3 in the case where the predicate matches zero rows.‡rel8ŒAggregate rows into a single row containing an array of all aggregated rows. This can be used to associate multiple rows with a single row, without changing the over cardinality of the query. This allows you to essentially return a tree-like structure from queries.ŸFor example, if we have a table of orders and each orders contains multiple items, we could aggregate the table of orders, pairing each order with its items: ¿ordersWithItems :: Query (Order Expr, ListTable Expr (Item Expr)) ordersWithItems = do order <- each orderSchema items <- aggregate listAgg (itemsFromOrder order) return (order, items) ˆrel8Applies ‡/ to the columns selected by the given function.‰rel8Like ‡6, but the result is guaranteed to be a non-empty list.Šrel8Applies ‰/ to the columns selected by the given function.‹rel8%Concatenate lists into a single list.Œrel8Applies ‹, to the list selected by the given function.�rel89Concatenate non-empty lists into a single non-empty list.Žrel8Applies �7 to the non-empty list selected by the given function.�rel8/Order the values within each aggregation in an �û using the given ordering. This is only relevant for aggregations that depend on the order they get their elements, like ° and ¶.�rel8� upgrades an › into an � by having it return Ï4 when aggregating over an empty collection of rows.ƒ„‡ˆ‰Š‹Œ�Ž…†��· Safe-Inferred')*är‘rel8ÝConvert a query that might return zero rows to a query that always returns at least one row.!To speak in more concrete terms, ‘ is most useful to write  LEFT JOINs.’rel8 Filter out Ë/s, returning only the tables that are not-null.3This operation can be used to "undo" the effect of ‘), which operationally is like turning a  LEFT JOIN back into a full JOIN*. You can think of this as analogous to O³.“rel8ãExtend an optional query with another query. This is useful if you want to step through multiple  LEFT JOINs. Note that traverseMaybeTable takes a  a -> Query bã function, which means you also have the ability to "expand" one row into multiple rows. If the  a -> Query bî function returns no rows, then the resulting query will also have no rows. However, regardless of the given  a -> Query b function, if the input is  nothingTable", you will always get exactly one  nothingTable back.‘’“¸ Safe-InferredÃݶ”rel8 Apply an � to all rows returned by a ñ . If the ñ‚ is empty, then a single "fallback" row is returned, composed of the identity elements of the constituent aggregation functions.•rel8 Apply an ¹ to all rows returned by a ñ . If the ñ' is empty, then zero rows are returned.–rel8ÐCount the number of rows returned by a query. Note that this is different from  countStar-, as even if the given query yields no rows,  countRows will return 0.”•¿–º Safe-Inferred%&')*9ÀÁÃØÝäðù Þ—rel8—Õ represents a single PostgreSQL statement. Most commonly, this is constructed using », ¼, ½ or ¾.However, in addition to SELECT, INSERT, UPDATE and DELETEÊ, PostgreSQL also supports compositions thereof via its statement-level WITHî syntax (with some caveats). Each such "sub-statement" can reference the results of previous sub-statements. — provides a À/ instance that captures this "binding" pattern.!The caveat with this is that the  Ðhttps://www.postgresql.org/docs/current/queries-with.html#QUERIES-WITH-MODIFYINGÍside-effects of these sub-statements are not visible to other sub-statements>; only the explicit results of previous sub-statements (from SELECTs or  RETURNING+ clauses) are visible. So, for example, an INSERT) into a table followed immediately by a SELECTê therefrom will not return the inserted rows. However, it is possible to return the inserted rows using  RETURNING, wing this with the result of a SELECT6 from the same table will produce the desired result.ˆAn example of where this can be useful is if you want to delete rows from a table and simultaneously log their deletion in a log table. âdeleteFoo :: (Foo Expr -> Expr Bool) -> Statement () deleteFoo predicate = do foos <- delete Delete { from = fooSchema , using = pure () , deleteWhere = _ -> predicate , returning = Returning id } insert Insert { into = deletedFooSchema , rows = do Foo {..} <- foos let deletedAt = ¿Û pure DeletedFoo {..} , onConflict = Abort , returning = NoReturning } —ÁÂÃÀ Safe-Inferred 19:;ÀÃÝðù I˜rel8Build a SELECT —.˜ÄÅÆÇÈÉÊÁ Safe-Inferred" ‚ËÌ Safe-Inferredà ™rel8 Convert a ñ to a Í containing a SELECT statement.™Ã Safe-InferredÏšrel8 Convert a — to a runnable Î7, disregarding the results of that statement (if any).›rel8 Convert a — to a runnable ÎÀ, returning the number of rows affected by that statement (for ¼s, ½s or Rel8.delete's with Ä).œrel8 Convert a — to a runnable Î’, processing the result of the statement as a single row. If the statement returns a number of rows other than 1, a runtime exception is thrown.�rel8 Convert a — to a runnable Î-, processing the result of the statement as ùë a single row. If the statement returns a number of rows other than 0 or 1, a runtime exception is thrown.žrel8 Convert a — to a runnable Î<, processing the result of the statement as a list of rows.Ÿrel8 Convert a — to a runnable Î/, processing the result of the statement as a ù of rows.š›œ�žŸÅ Safe-Inferred ')*1ÃØÝäðòù• rel8=, Æ and Ç all support an optional  RETURNING clause.¡rel8No  RETURNING clause¢rel8 Û allows you to project out of the affected rows, which can be useful if you want to log exactly which rows were deleted, or to view a generated id (for example, if using a column with an autoincrementing counter via ‰). ¡¢ÏÐÈ Safe-Inferred %&')*Ãéòù”£rel8The constituent parts of an UPDATE statement.¥rel8Which table to update.¦rel8FROMã clause ”@ this can be used to join against other tables, and its results can be referenced in the SET and WHERE clauses.§rel8 How to update each selected row.¨rel8 Which rows to select for update.©rel8What to return from the UPDATE statement.ªrel8 Build an UPDATE —. £¤¦§©¨¥ªÑÉ Safe-Inferred %&')*Ãéòùl«rel8The constituent parts of a SQL INSERT statement.­rel8Which table to insert into.®rel8:The rows to insert. This can be an arbitrary query ”@ use Ê insert a static list of rows.¯rel8ÉWhat to do if the inserted rows conflict with data already in the table.°rel8)What information to return on completion.±rel8 Build an INSERT —. «¬°®­¯±ÒÓË Safe-InferredÃ¥²rel8Given a   and ñ,  createView runs a  CREATE VIEW„ statement that will save the given query as a view. This can be useful if you want to share Rel8 queries with other applications.³rel8Given a   and ñ, createOrReplaceView runs a CREATE OR REPLACE VIEW· statement that will save the given query as a view, replacing the current view definition if it exists and adheres to the restrictions in place for replacing a view in PostgreSQL.²³Ì Safe-Inferred %&')*Ãéòùp´rel8The constituent parts of a DELETE statement.¶rel8Which table to delete from.·rel8USINGã clause ”@ this can be used to join against other tables, and its results can be referenced in the WHERE clause¸rel8+Which rows should be selected for deletion.¹rel8What to return from the DELETE statement.ºrel8Build a DELETE —.´µ¶¹·¸ºÔÍ Safe-Inferredë»rel8 Convert a ´ to a Í containing a DELETE statement.¼rel8 Convert an « to a Í containing an INSERT statement.½rel8 Convert an £ to a Í containing an UPDATE statement.¾rel8 Convert a — to a Í containing an SQL statement.»¼½¾Î Safe-Inferred')*à ž¿rel8 Aggregate a ñ into a ÷Æ. If the supplied query returns 0 rows, this function will produce a ñ, that returns one row containing the empty  ListTable. If the supplied Query does return rows, many& will return exactly one row, with a  ListTable collecting all returned rows.many is analogous to ϯ from Control.Applicative.Àrel8 Aggregate a ñ into a îÆ. If the supplied query returns 0 rows, this function will produce a ñ- that is empty - that is, will produce zero  NonEmptyTables. If the supplied Query does return rows, some% will return exactly one row, with a  NonEmptyTable collecting all returned rows.some is analogous to Ï« from Control.Applicative.Árel8 A version of ¿# specialised to single expressions.Ârel8 A version of ¿# specialised to single expressions.Ãrel8 Expand a ÷ into a ñ:, where each row in the query is an element of the given  ListTable. catListTable is an inverse to ¿.Ärel8 Expand a î into a ñ:, where each row in the query is an element of the given  NonEmptyTable.catNonEmptyTable is an inverse to À.Årel81Expand an expression that contains a list into a ñ?, where each row in the query is an element of the given list.catList is an inverse to Á.Ærel8;Expand an expression that contains a non-empty list into a ñ?, where each row in the query is an element of the given list. catNonEmpty is an inverse to Â.¿ÀÁÂÃÄÅÆÐ Safe-Inferred 1ÍÛù!œÇrel8Nest a ¡ value within a Rel8able.  HMaybe f a will produce a Ë a in the Expr context, and a ¡ a in the 7 context.ÇÑ Safe-Inferred1<>Àù!ÍÕÖרÙÒ Safe-Inferred'19ÀÂÃÄÅÆÍÚÛÝäðù&•Èrel8An EitherTable a b0 is a Rel8 table that contains either the table a or the table b. You can construct an  EitherTable using Ì and Í$, and eliminate/pattern match using Ë.An  EitherTable( is operationally the same as Haskell's Ú& type, but adapted to work with Rel8.Érel8 Test if an È is a Ì.Êrel8 Test if an È is a Í.Ërel8Pattern match/eliminate an È , by providing mappings from a Ì and Í.Ìrel8Construct a left È. Like Û.Írel8Construct a right È. Like Ü.Îrel8)Lift a pair aggregators to operate on an È.  leftTables and  rightTables are grouped separately.Ïrel8 Construct a È in the n, context. This can be useful if you have a È: that you are storing in a table and need to construct a  TableSchema.Ïrel83The name of the column to track whether a row is a Ì or Í.rel8Names of the columns in the a table.rel8Names of the columns in the b table. ÈÝÞßàËÌÍÉÊÎÏÓ Safe-InferredÃ)AÐrel8Filter Ès, keeping only  leftTables.Ñrel8Filter Ès, keeping only  rightTables.Òrel8bitraverseEitherTable f g x will pass all  leftTable s through f and all  rightTable s through g). The results are then lifted back into  leftTable and  rightTable#, respectively. This is similar to  bitraverse for Ú. For example,:{ select do: x <- values (map lit [ Left True, Right (42 :: Int32) ])Ë bitraverseEitherTable (\y -> values [y, not_ y]) (\y -> pure (y * 100)) x:} [ Left True , Left False , Right 4200]ÐÑÒÔ Safe-Inferred 1ÍÛù*=Órel8Nest an Ú value within a Rel8able.  HEither f a b will produce a È a b in the Expr context, and a Ú a b in the 7 context.ÓÕ Safe-Inferred)*Ã*´Ôrel8Corresponds to a FULL OUTER JOIN between two queries. ÔÕÖרÙÚÛÜÝÞß Safe-InferredÃÕÝùLÜ!àrel8A à k a is like a ñ a', except that each row also has a key k in addition to the value a. à)s can be composed monadically just like ñ*s, but the resulting join is more like a  NATURAL JOIN$ (based on the common key column(s) k ) than the  CROSS JOIN given by ñ.Another way to think of à k a is as analogous to Map k a in the same way ñ a is analogous to [a]'. However, there's nothing stopping a à from containing multiple rows with the same key, so technically Map k (NonEmpty a) is more accurate.às can be created from ñs with á and ã and converted back to ñs with å and â6 (though note the caveats that come with the latter).árel8Any ñ of key-value pairs (k, a) can be a à k a.ârel8 Convert a à k a back into a ñ of key-value pairs.Note that the result of a â1 is undefined (will always return zero rows) on às constructed with ã or © . So while toQuery . fromQuery is always id, fromQuery . toQuery is not.)A safer, more predictable alternative to â is to use å with an explicit set of keys: ;do k <- keys a <- lookup k tabulation pure (k, a) 7Having said that, in practice, most legitimate uses of à will have a well-defined â•. It would be possible in theory to encode the necessary invariants at the type level using an indexed monad, but we would lose the ability to use do0-notation, which is the main benefit of having à as a monad in the first place.In particular, â t is well-defined for any à t defined as t = fromQuery _. â t is also well-defined for any à t defined as  t = t' >>= _ or  t = t' *> _ where â t'Ù is well-defined. There are other valid permutations too. Generally, anything that uses á/ at some point, unless wrapped in a top-level ï or ð, will have a well-defined â.ãrel8A ñ a can be treated as a à k a where the given a% values exist at every possible key k.ärel8Run a Kleisli arrow in the the ñ monad "through" a à. Useful for Öing a à. Ö ((>=. 30) . userAge) `through' usersById årel8å k t! returns the value(s) at the key k in the tabulation t.ærel8æ produces a "magic" à< whereby the values within each group of keys in the given àË is aggregated according to the given aggregator, and every other possible key contains a single "fallback" row is returned, composed of the identity elements of the constituent aggregation functions.çrel8ç- aggregates the values within each key of a à. There is an implicit GROUP BY on all the key columns.èrel8è ensures a àà has at most one value for each key, i.e., it drops duplicates. In general it keeps only the "first" value it encounters for each key, but note that "first" is undefined unless you first call é.érel8é orders the values of a àà within their respective keys. This specifies a defined order for è6. It also defines the order of the lists produced by ì and í.êrel8ê7 returns a count of how many entries are in the given à at each key.The resulting à is "magic" in that the value 08 exists at every possible key that wasn't in the given à.ërel8ë produces a "magic" à" whereby each entry in the given à is wrapped in ×2, and every other possible key contains a single Ø.This is used to implement ô.ìrel8ìè aggregates each entry with a particular key into a single entry with all of the values contained in a ÷.é can be used to give this ÷ a defined order.The resulting à is "magic" in that the value 'Rel8.listTable []'8 exists at every possible key that wasn't in the given à.írel8íè aggregates each entry with a particular key into a single entry with all of the values contained in a î.é can be used to give this î a defined order.îrel8î produces a "magic" à which contains the value Ù at each key in the given à, and the value Œ at every other possible key.ïrel8ï produces a à where a single ()9 row exists for every key that was present in the given à.This is used to implement ù.ðrel8ð produces a à where a single ()> row exists at every possible key that absent from the given à.This is used to implement ú.ñrel8 Performs a NATURAL FULL OUTER JOIN! based on the common key columns. Analogous to ÚÛ.òrel8 Performs a NATURAL FULL OUTER JOIN! based on the common key columns. Analogous to ÚÜ.órel8 Performs a NATURAL LEFT OUTER JOIN! based on the common key columns. Analogous to ÚÝ./Note that you can achieve the same effect with ë and the ‚ instance for à, i.e., this is just Âleft right -> liftA2 (,) left (optional right). You can also use  do@-notation.ôrel8 Performs a NATURAL LEFT OUTER JOIN! based on the common key columns. Analogous to ÚÞ./Note that you can achieve the same effect with ë and the ‚ instance for à, i.e., this is just Âf left right -> liftA2 f left (optional right). You can also use  do@-notation.õrel8 Performs a NATURAL RIGHT OUTER JOIN! based on the common key columns. Analogous to Úß./Note that you can achieve the same effect with ë and the ‚ instance for à, i.e., this is just Éleft right -> liftA2 (flip (,)) right (optional left). You can also use  do@-notation.örel8 Performs a NATURAL RIGHT OUTER JOIN! based on the common key columns. Analogous to Úà./Note that you can achieve the same effect with ë and the ‚ instance for à, i.e., this is just Éf left right -> liftA2 (flip f) right (optional left). You can also use  do@-notation.÷rel8 Performs a NATURAL INNER JOIN! based on the common key columns. Analagous to Úá.3Note that you can achieve the same effect with the ‚ instance of à, i.e., this is just  'liftA2 (,)'. You can also use do -notation.ørel8 Performs a NATURAL INNER JOIN! based on the common key columns. Analagous to Úâ.3Note that you can achieve the same effect with the ‚ instance of à, i.e., this is just ¢. You can also use do -notation.ùrel8 Performs a  Øhttps://en.wikipedia.org/wiki/Relational_algebra#Semijoin_%28%E2%8B%89%29%28%E2%8B%8A%29NATURAL SEMI JOIN" based on the common key columns.„The result is a subset of the left tabulation where only entries which have a corresponding entry in the right tabulation are kept.0Note that you can achieve a similar effect with ï and the ‚ instance of à, i.e., this is just #left right -> left <* present right. You can also use do -notation.úrel8 Performs a  Éhttps://en.wikipedia.org/wiki/Relational_algebra#Antijoin_%28%E2%96%B7%29NATURAL ANTI JOIN" based on the common key columns.‹The result is a subset of the left tabulation where only entries which do not have a corresponding entry in the right tabulation are kept.0Note that you can achieve a similar effect with ð and the ‚ instance of à, i.e., this is just "left right -> left <* absent right. You can also use do -notation.ûrel8ÿ for às.árel8às can be produced with either á or ã?, and in some cases we might want to treat these differently. á uses á to determine which type of à we have.€rel8If à k a is Map k (NonEmpty a), then (<>) is unionWith (liftA2 (<>)).‚rel8If à k a is Map k (NonEmpty a), then ( |:) is unionWith (<>).…rel8 pure = ã . pure†rel8If à k a is Map k (NonEmpty a), then ( .) is intersectionWith (liftA2 ( *))àáâãäåæçèéûêëìíîïðñòóôõö÷øùúàáâãäåæçèéûêëìíîïðñòóôõö÷øùúä1ã Safe-Inferred1ÂÃÄÅÆÍØÚÛÝäðùMšâãäåæçä Safe-Inferred1ÂÃÄÅÆÍØÚÛÝðùMìèéêëìå Safe-Inferred /01=ÂÃÄÅÆÍÚÛÝäðõùS‹rel8,This type class allows you to define custom :Ús using higher-kinded data types. Higher-kinded data types are data types of the pattern: ¨data MyType f = MyType { field1 :: Column f T1 OR HK1 f , field2 :: Column f T2 OR HK2 f , ... , fieldN :: Column f Tn OR HKn f } where Tn is any Haskell type, and HKn is any higher-kinded type.ãThat is, higher-kinded data are records where all fields in the record are all either of the type  Column f T (for any T)), or are themselves higher-kinded data: Nested Ùdata Nested f = Nested { nested1 :: MyType f , nested2 :: MyType f } The Rel8ableã type class is used to give us a special mapping operation that lets us change the type parameter f.  Supplying Rel8able instancesëThis type class should be derived generically for all table types in your project. To do this, enable the DeriveAnyClass and  DeriveGeneric language extensions: Ž{-# LANGUAGE DeriveAnyClass, DeriveGeneric #-} data MyType f = MyType { fieldA :: Column f T } deriving ( GHC.Generics.Generic, Rel8able ) Œrel8 The kind of ‹ types Œ‹íîïðñòóôõö÷æ Safe-Inferred-1ÂÃÄÅÆÍÕØÚÛÝðùSvøùúûüýþëÿ€�‚ƒ„…†‡ˆç Safe-Inferred'(/1ÃÍÚÛÝðùSÙ ‰Š‹Œ�Ž��‘’“èNone1ÂÃÄÅÆÍØÚÛÝðùT-’”‘•�“–�”Ž•—�–˜é Safe-Inferred1ÍÛùT|—ê Safe-Inferred 1ÂÃÄÅÆÍØÛÝðùTÄ�™œš›ž›šŸ™ œ˜¡�ë Safe-Inferred1ÂÄÅÆÍÚÛÝðùU#ì Safe-Inferred"%'()*-1ÃÝðùYX¢rel8¢à is used to associate composite type metadata with a Haskell type.£rel83The names of all fields in the composite type that a maps to.¤rel8$The name of the composite type that a maps to.¥rel8‹A deriving-via helper type for column types that store a Haskell product type in a single Postgres column using a Postgres composite type.ÛNote that this must map to a specific extant type in your database's schema (created with  CREATE TYPE). Use ¢é to specify the name of this Postgres type and the names of the individual fields (for projecting with ¨).§rel8 Collapse a ’" into a PostgreSQL composite type.’é values are represented in queries by having a column for each field in the corresponding Haskell type. §ï collapses these columns into a single column expression, by combining them into a PostgreSQL composite type.¨rel8Expand a composite type into a ’.¨ is the inverse of §.¥¦¢£¤§¨í Safe-Inferred1ÍÛùY—©î Safe-InferredÀÁÃÒÝðù^ªrel8„In PostgreSQL, window functions must specify the "window" or "partition" over which they operate. The syntax for this looks like: *SUM(salary) OVER (PARTITION BY department). The Rel8 type ª) represents everything that comes after OVER.ª is a ², so «s created with ­ and  orderWindowBy can be combined using Û.«rel8«Æ is an applicative functor that represents expressions that contain  ® (salary >$< ) @@­rel8øRestricts a window function to operate only the group of rows that share the same value(s) for the given expression(s).®rel8ƒControls the order in which rows are processed by window functions. This does not need to match the ordering of the overall query.«žª¬­®¬1ï Safe-Inferred`-¯rel8¯2 runs a query composed of expressions containing  ;<=@?AB9Cklijãäåæçèéêëìïðîí~ÍÎqËÎÒÏÐÌÍÑ‘’“ÓÔÈËÌÍÉÊÐÑÒÎÏÕáÞßàÖרÙÚÛÜÝÔÕÖרÙÚÛÜÝÞßâã÷ùøú¿ÁÃÅîðïñÀÂÄÆåèéêæç�ëí옡�œ™ ›žšŸ’‘�“�”Ž•�–  nopNQOPe`Ïabcd€_)WVZX[Y\Þßàáâ]^ÊË,ÔÕÖרÙÚÛÜÝfgh€ñ™IGHEFJDm„ø�‚†‡Œ�Žüýòóôõö÷…ˆ‰Š‹ÿúûœ›�Ÿž”•…†Ê��–ƒ„‡ˆÂËŒÆÇ‰ŠÄÅ�ŽÈÉ+®¯*°±¢²³´µ¶¡·£¤§¥¦¨©ª«¬­ ¸¹º»¼½¾¿ÀÁùÐÑÒÓ«¯ª¬­®°·±²³´µ¶¸¹º»¼½¾¿ÀÁÂþ|}7žš›œ�Ÿ˜«¬°®­¯xzy{rstvuw±Ì¼´µ¶¹·¸º»£¤¦§©¨¥ª½ ¢¡—¾²³ƒº!"#$%&'(KLM¥¦¢£¤§¨562341 RSTU0/.-‹Œ8©ÓÇÿö‚ä—:>;<=@?AB9Cklijãäåæçèéêëìïðîí~ÍÎqËÎÒÏÐÌÍÑ‘’“ÓÔÈËÌÍÉÊÐÑÒÎÏÕáÞßàÖרÙÚÛÜÝÔÕÖרÙÚÛÜÝÞßâã÷ùøú¿ÁÃÅîðïñÀÂÄÆåèéêæç�ëí옡�œ™ ›žšŸ’‘�“�”Ž•�–  nopNQOPe`Ïabcd€_)WVZX[Y\Þßàáâ]^ÊË,ÔÕÖרÙÚÛÜÝfgh€ñ™IGHEFJDm„ø�‚†‡Œ�Žüýòóôõö÷…ˆ‰Š‹ÿúûœ›�Ÿž”•…†Ê��–ƒ„‡ˆÂËŒÆÇ‰ŠÄÅ�ŽÈÉ+®¯*°±¢²³´µ¶¡·£¤§¥¦¨©ª«¬­ ¸¹º»¼½¾¿ÀÁùÐÑÒÓ«¯ª¬­®°·±²³´µ¶¸¹º»¼½¾¿ÀÁÂþ|}7žš›œ�Ÿ˜«¬°®­¯xzy{rstvuw±Ì¼´µ¶¹·¸º»£¤¦§©¨¥ª½ ¢¡—¾²³ƒ©÷øùúûüýþÿÿ€�‚‚ƒ„ … … † ‡ ˆ!‰!‰!Š!‹!Œ"�"�"Ž"�"�"‘"’(#(“)+)+)”*•*•*–,—-˜-™-š.›.œ.�.ž/Ÿ/ /¡/¢/£/£1¤2¥3¦:F:§:¨:©:ª:«:¬:­:®>¯C°E±E²E³E´EDEµT¶T¶T·W;G¸G¹HºU»U¼V½V¾JŒJÙJ¿JÀJÁJÂJÃJÄJÅJÆN©NÇNÈNÉNÊN§RËRÌRÍ[Î[Ï[Ð[Ñ]Ò]_Ó_Ô^ÕbÖbÖb×bØbÙbÚbÛbÜbÝbÞYßYàYIh‰lálâlãlämåmæmçmèéêëìíî¿ïðñòóôõö÷øùúûüýþÿ€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž���Ž‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ˆªZLZ«Z¨jjj¬j­k®k¯k°k±k²k³k´kµk¶k·n¸n¹nºn»n¼o½o¾o¿oÀpÁpÂpÃpÄpÅpÆpÇpÈqÉqÊs rdrwrËrÌrÍrÎcÊuÏvÐvÑxÒxÓyÔzÕ{Ö|Ö|M×€Ø�Ù�Ú�Û�Ü�Ý�Þ�ß‚à‚á‚âãä儅憇çèéꊹŠëŠìŠíŠî’ï“ð”ñ•ò•ó•ô•õ•ö•÷•ø•ù•ú•�•û•ü•ý•þ•ÿ•‹•Ž•€•�•‚•¶•ƒ•„•…•†•‡•ˆ•‰•Š•‹•Œ•�•Ž•�•�•‘•’•“•”••œ\œ–œ—œ˜œØœ×œ™œšœ›œœž�žžžŸž ž¡ž¢ž£ž¤ž¥ž¦ž§ž¨ž©žªž«¥¬¦­¦®¦¯¦°¦¬¦±¦²¦³¦´ªµª¶ª·ª¸ª¹ªºª»ª¼­½®¾®¿®À®Á®Â®Ã®Ä®“±Å²Æ²Ç´ÈµÉµÊµ–µËµ°µÌµÍµÎµÏµÐµÑµÒµÓµÔ·Õ·Ö·�¸ó¸×¸ØºÙÀ»ÂÚÃÛÃÜÃÝÃÞÃßÃàÅáÅÄÅáÈÆÈÆÈâÈãÈäÈåÈæÈ½É=É=ÉçÉèÉéÉêɼËëËìÌÇÌÇÌíÌîÌïÌð̾ÍñÍòÍóÍôίΫÎõÎöÎ÷ÎøÎùÎúÐûÒüÒýÒþÒÿÒ€Ò�Ò‚ÒƒÓ„Ó…Ó†Ô‡ÕˆÕ‰ÕŠÕ‹ÕŒÕ�ÕŽÕ�Õ�Õ‘Õ’Õ“”•–—˜™ó×àšòÕ¯«ÙÚÛÛÜ›œ�žá⟠ա¢£¤¥¦§¨©ª«¬­®¯åå°è±è²è³è´èµè¶è·è¸è¹èºé»ê¼ê½ê¾ê¿êÀêÁêÂêÃêÄêÅìÆìÇìÈìÉìÉìÊìËíÌîÍîÎîÏîÐîõïðôòôÑôÒôÓôÔôÕôÖñ×ñØñÙñÚñÛñÜñÝñÞñßñàñáöâãäåæçæ è é ê ë ìííîïðñòóôõö÷øùúãûüúýþÿ€�‚‚ƒ¨¦„„…†‡ˆþ¨ã‰Š‹Œ�Ž�� ‘ ’ ü “ ”!•!–$—%˜%™%š%›%œ%�%Â%Ã%Ä%“&ž'Ÿ'ù' '¡'¢(£(¤(¥(¦(§(¨(©(ª(«(¬(­(®(¯(°(±(²(³(´(µ(¶(·(¸(¹º»¼º½¾ã¿ã0À0À0Á0Â0Ã0Ä1§1Å1Æ1Ç1È2É3Ê3Ë3Ì3Í3Î3Ï3Ð3Ñ3Ò3Ó3Ô3Õ3Ö3×3Ø4Ù4Ù4Ú4Û4Ü4Ý4Ý4Þ4ß4ß4à5…áâã5ä5ä5å5æ5ç5è5à6é6ê6ë6ì6à7í7î7ï7ð7ñ7ò7ó7ô7õ8ö8÷8ø8ù8ú8û8ü8ý8þ8ÿ8€9�9�9‚:ƒ:„:…:†:‡:ˆ:‰?Š?Š?‹?Œ@�@Ž@�@�@ç@‘@’@à@“@”@•@•@–A—B˜C°C™EšG›GœG�GžGŸG G¡G¢G£G¤G¥H¦H§N¨ãO©ãûªã‰«ãû¬N­N®N¯N°N±R²S³S´SµS¶S·S¸S¹ãº»ã¼½ãû¾W;X¿YÀY—]]Á^Â^Ã^Ä^Å^Æ^Ç^È^É^Ê^Ë^Ì^Í^Î_Ï_Ð_Ñ`ÒaÓbÔãûÕeÖe×eØeÙeÚeÛeÜfÝfÞfßfàfáfâfãfäfåfæfçfÅfÆèéêgëiìiílîlïlðmñmòmóáôõáôöáâ÷áâøáôùáôúáôûáôüsýãûþsÿs€s�s t‚tƒt«t„t…t†t‡yˆ�‰ãûŠ‹Œ�Ž��ŠëБВ‘…‘“‘~‘Çá┕••–•—•˜•™•š•›™œ™�™ž™Ÿ™ ™¡™¢™£™£š¤š¤š¥š¦š§š¨›©›©›ª›«ãOQ㉬ãû­ãO®ãû¯œ°œ±œ\œ²œ³œ´µ¶·µŸ¸µŸ¹µ¶ºµ¶»ž�ž¼ž½¦­¦¾ªµãû¿®¾¸ÀãûÁºÂºÃºÄÀÅÀÆÀçÀÇÀÆÀÈÀÉÁÊÁËãûÌÍÎÙÅÏÅÐÈÑÉÒÉÓÌÔÑÕÑÕѪÑÖÑ×ãØÙãØÚãØÛÒüÒ¡Ò’Ò²ÜãÝãÞãßãàãáãâäãäääåäæäçåñåîåïåèåôåõåóåéå‰åêåëæìæíæîæïæðæñæòæóæôæõæöæ÷æøæùæúæûæüçýçþçÿç€ ç� ç‚ çƒ ç„ ç… ç† ç‡ è¶èˆ è‰ èŠ è‹ êÁêŒ ê� êŽ ê� îÎô� ô‘ ô’ ô“ ô” ô• ô– ô— ô˜ ô™ š #rel8-1.5.0.0-25E6M9IAX179DMBaddopt0Rel8 Rel8.ArrayRel8.Expr.TimeRel8.Expr.Text Rel8.Expr.Num Rel8.Tabulaterel8Rel8.Aggregate.FoldData.Semigroup.FoldablefoldMap1QueryRel8.FCFRel8.Generic.MapRel8.Generic.RecordRel8.Kind.Algebra Rel8.OrderascdescData.Functor.Contravariant>$<Rel8.Query.OpaleyeRel8.Schema.DictRel8.Schema.EscapeRel8.Schema.KindRel8.Schema.HTable.ProductRel8.Schema.NullRel8.Schema.QualifiedNameRel8.Schema.TableRel8ableNameRel8.Type.DecimalRel8.Type.DecoderRel8.Type.NameRel8.Type.InformationDBTypeRel8.Type.ParserRel8.Type.ArrayRel8.Type.Parser.ByteStringRel8.Type.Parser.Time Rel8.TypeRel8.Type.JSONEncodedRel8.Type.JSONBEncoded JSONEncoded Rel8.Type.Eq Rel8.Type.Ord Rel8.Type.NumRel8.Type.EnumRel8.Schema.SpecRel8.Schema.Result Rel8.ColumnRel8.Schema.HTableRel8.Schema.HTable.MapTableRel8.Schema.HTable.NullifyRel8.Schema.HTable.LabelRel8.Generic.Table.Record Rel8.Generic.Construction.RecordRel8.Schema.HTable.Identity Rel8.TableExpr AggregateInsertRel8.Table.TransposeRel8.Table.ColsRel8.Schema.HTable.VectorizeRel8.Schema.HTable.NonEmptyRel8.Schema.HTable.ListRel8.Schema.Field ProjectionRel8.Table.ProjectionTableRel8.Expr.OpaleyeRel8.Expr.SerializelitRel8.Expr.Bool Data.Boolboolwhere_Rel8.Expr.Null Data.Maybe isNothingisJustRel8.Expr.FunctionRel8.Expr.ArrayRel8.Type.ReadShowRel8.Type.SemigroupRel8.Type.Monoid Rel8.ExprRel8.Table.UndefinedRel8.Table.SerializeRel8.Table.BoolRel8.Table.Alternative MaybeTableRel8.Schema.NameRel8.Table.OpaleyeRel8.Table.NameRel8.Statement.WhereRel8.Statement.SetRel8.Statement.OnConflictRel8.Query.ValuesunionRel8.Kind.ContextRel8.Schema.Context.NullifyRel8.Expr.ShowRel8.Expr.SequenceRel8.Expr.ReadRel8.Expr.Order Rel8.Expr.OrdRel8.Expr.NonEmptyRel8.Expr.List Rel8.Expr.Eq Rel8.Table.EqRel8.Table.OrdRel8.Table.OrderRel8.Query.Set Rel8.QueryRel8.Statement.RowsRel8.Query.OrderRel8.Query.LoopunionAllRel8.Query.LimitRel8.Query.RebindRel8.Query.MaterializeRel8.Query.FunctionRel8.Query.Filter Control.MonadguardRel8.Query.EvaluateRel8.Query.EachRel8.Query.ExistsRel8.Query.DistinctPreludedivmodquotremRel8.Expr.DefaultnextvalRel8.AggregatesumfalseorsumOnData.ProfunctorlmapRel8.Table.NullifyRel8.Aggregate.FunctionRel8.Type.String Rel8.Type.SumRel8.Expr.Aggregate filterWhereData.Scientific Scientific Rel8.Type.TagRel8.Schema.HTable.TheseRel8.Schema.HTable.MaybeRel8.Table.MaybetraverseMaybeTableRel8.Table.TheseData.These.CombinatorsisThisisThatisThesehasHerehasThereRel8.Column.TheseRel8.Table.NullnullnullablenullifyRel8.Table.NonEmptysome nullTableRel8.Column.NonEmptyRel8.Table.ListmanylistAggRel8.Column.ListRel8.Query.Null catMaybesRel8.Column.NullRel8.Table.Aggregate stringAggRel8.Query.MaybeRel8.Query.Aggregate Aggregator1Rel8.StatementselectinsertupdatedeletenowRel8.Statement.SelectRel8.Statement.UsingRel8.Query.SQLRel8.Statement.Run NoReturningRel8.Statement.ReturningUpdateDeleteRel8.Statement.UpdateRel8.Statement.InsertvaluesRel8.Statement.ViewRel8.Statement.DeleteRel8.Statement.SQLRel8.Query.ListControl.ApplicativeRel8.Column.MaybeRel8.Schema.HTable.EitherRel8.Table.EitherRel8.Query.EitherRel8.Column.EitherRel8.Query.Thesefilter justTable nothingTabletrueData.Semialignalign alignWithrpadZip rpadZipWithlpadZip lpadZipWithzipzipWithRel8.Generic.Table.ADTRel8.Generic.TableRel8.Generic.Rel8ableRel8.Generic.Construction.ADTRel8.Generic.ConstructionRel8.Table.HKDRel8.Column.LiftRel8.Table.ADTRel8.Table.Rel8ableRel8.Type.CompositeRel8.Column.ADT Rel8.WindowRel8.Query.WindowwindowRel8.Table.Window cumulative aggregateRel8.Expr.WindoworderPartitionByRel8.Query.IndexedFoldSemiFullOrderSqlNullable HomonullableNotNull QualifiedName$sel:name:QualifiedName$sel:schema:QualifiedName TableSchema$sel:name:TableSchema$sel:columns:TableSchemaDecoderbinaryparser delimiterTypeNamename modifiers arrayDepthTypeInformationencodedecodetypeNamemapTypeInformationparseTypeInformationtypeInformationfromJSONEncoded JSONBEncodedfromJSONBEncodedDBEqDBMinDBMaxDBOrd DBFloating DBFractional DBIntegralDBNumEnumableDBEnum enumValue enumTypeNameEnumResultColumnHTableColumnsContext FromExprs Transpose toColumns fromColumns fromResulttoResult TransposesField Biprojectable biproject Projectableproject ProjectingReadShow fromReadShowunsafeCastExpr unsafeLiterallitExpr DBSemigroup<>.DBMonoid memptyExpr&&.||.not_and_or_boolExprcaseExprcoalesceisNull isNonNullmapNull liftOpNull ArgumentsfunctionbinaryOperatorAlternativeTable emptyTableAltTable<|>:SelectsnamesFromLabelsnamesFromLabelsWith castTableUpsert$sel:index:Upsert$sel:predicate:Upsert$sel:set:Upsert$sel:updateWhere:Upsert OnConflictAbort DoNothingDoUpdate SerializableToExprs head1Expr index1Expr last1Expr length1ExprheadExpr indexExprlastExpr lengthExprtodaytoDayfromDayaddDaysdiffDays subtractDaysaddTimediffTime subtractTime scaleIntervalsecondsecondsminuteminuteshourhoursdaydaysweekweeksmonthmonthsyearyears++.~.~*!~!~* bitLength charLengthlower octetLengthupperasciibtrimchrconvert convertFrom convertToinitcapleftlengthlengthEncodinglpadltrimmd5pgClientEncoding quoteIdent quoteLiteral quoteNullable regexpReplaceregexpSplitToArrayrepeatreplacereverserightrpadrtrim splitPartstrpossubstr translatelikeilike unsafeDefaultcase_ nullsFirst nullsLast<.<=.>.>=.?>=? leastExpr greatestExpr==./=.==?/=?in_EqTableeqTable==:/=:OrdTableordTable<:<=:>:>=:leastgreatestascTable descTable intersect intersectAllexcept exceptAllorderByloop loopDistinctlimitoffsetrebind materialize queryFunctionevaluateeachexistspresentabsentwithwithBywithout withoutBydistinct distinctOn distinctOnBy fromIntegral realToFracceilingdivModquotRemfloorroundtruncate Aggregator Aggregator' toAggregator1 toAggregatoraggregateFunctionDBStringDBSumcountcountOn countDistinctcountDistinctOn countStar countWhere countWhereOnandandOnorOnmaxmaxOnminminOnsumWhereavgavgOnmodemodeOn percentile percentileOnpercentileContinuouspercentileContinuousOnhypotheticalRankhypotheticalDenseRankhypotheticalPercentRankhypotheticalCumeDist listAggExpr listAggExprOnnonEmptyAggExprnonEmptyAggExprOn listCatExpr listCatExprOnnonEmptyCatExprnonEmptyCatExprOndistinctAggregateisNothingTable isJustTable maybeTablefromMaybeTable$?aggregateMaybeTablenameMaybeTable TheseTable isThisTable isThatTable isThoseTable hasHereTable hasThereTable justHereTablejustThereTablealignMaybeTable thisTable thatTable thoseTable theseTableaggregateTheseTablenameTheseTableHThese NullTable isNullTableisNonNullTable nullableTable nullifyTable nameNullTable toMaybeTable toNullTable NonEmptyTable$+ nonEmptyTablenameNonEmptyTablehead1index1last1length1 HNonEmpty ListTable$* listTable nameListTableheadindexlastHListcatNull catNullTableHNullgroupBy groupByOnfilterWhereOptional listAggOn nonEmptyAgg nonEmptyAggOnlistCat listCatOn nonEmptyCat nonEmptyCatOnorderAggregateByoptionalAggregateoptional catMaybeTable aggregate1 countRows Statement showQueryrun_runNrun1runMayberun runVector Returning$sel:target:Update$sel:from:Update$sel:set:Update$sel:updateWhere:Update$sel:returning:Update$sel:into:Insert$sel:rows:Insert$sel:onConflict:Insert$sel:returning:Insert createViewcreateOrReplaceView$sel:from:Delete$sel:using:Delete$sel:deleteWhere:Delete$sel:returning:Delete showDelete showInsert showUpdate showStatementmanyExprsomeExpr catListTablecatNonEmptyTablecatList catNonEmptyHMaybe EitherTable isLeftTable isRightTable eitherTable leftTable rightTableaggregateEitherTablenameEitherTable keepLeftTablekeepRightTablebitraverseEitherTableHEitheralignBy keepHereTable loseHereTablekeepThereTableloseThereTable keepThisTable loseThisTable keepThatTable loseThatTablekeepThoseTableloseThoseTablebitraverseTheseTable Tabulation fromQuerytoQuery liftQuerythroughlookuporder leftAlign leftAlignWith rightAlignrightAlignWith similarity difference$fMonoidPredicate$fSemigroupPredicate$fContravariantPredicate$fMonoidTabulation$fSemigroupTabulation$fAlternativeTableTabulation$fAltTableTabulation$fMonadTabulation$fBindTabulation$fApplicativeTabulation$fApplyTabulation$fProjectableTabulation$fFunctorTabulation$fBifunctorTabulation$fBiprojectableTabulation KRel8ableNameHKDDeconstructHKD ConstructHKDBuildHKDHKDableHKDbuildHKD constructHKDdeconstructHKDnameHKDLiftNameADTDeconstructADT ConstructADTBuildADTADTableADTbuildADT constructADTdeconstructADTnameADT DBCompositecompositeFieldscompositeTypeName Compositecompose decomposeHADT PartitionWindowover partitionBy rowNumberrank denseRank percentRankcumeDistntile currentRowlaglagOnleadleadOn firstValue firstValueOn lastValue lastValueOnnthValue nthValueOnindexedbase Data.FoldablefoldMapFallbackEmptyExpEvalIdMapGMapRecordunrecord GRecordablegrecord gunrecordGRecordAlgebraProductSumSAlgebraSProductSSum KnownAlgebra algebraSingGHC.Base<> fromOpaleye toOpaleye mapOpaleyezipOpaleyeWithunsafePeekQueryDictescapeHProductNullify UnnullifyNullityNull GHC.MaybeNothing$fIsStringQualifiedNameppQualifiedNameshowQualifiedNameppTable PowerOf10 resolution parseDecoder NullableOrNot NonNullableParser$fIsStringTypeName showTypeNameparsearrayencodeArrayElementextractArrayElement arrayTypeNamelistTypeInformationnonEmptyTypeInformation bytestringcalendarDiffTime localTime timeOfDayutcTime$fDBTypeNetAddr $fDBTypeValue $fDBTypeUUID$fDBTypeByteString$fDBTypeByteString0 $fDBTypeCI $fDBTypeCI0 $fDBTypeText $fDBTypeText0$fDBTypeCalendarDiffTime$fDBTypeTimeOfDay$fDBTypeLocalTime $fDBTypeDay$fDBTypeUTCTime $fDBTypeFixed$fDBTypeScientific$fDBTypeDouble $fDBTypeFloat $fDBTypeInt64 $fDBTypeInt32 $fDBTypeInt16 $fDBTypeChar $fDBTypeBool$aeson-2.2.1.0-GDdkXghubmC25HKLD48EAjData.Aeson.Types.ToJSONToJSONData.Aeson.Types.FromJSONFromJSONGHC.RealSpeclabelsinfonullity specification nullifier unnullifier vectorizer unvectorizerTColumn HProductField htabulatehfieldhdictshspecsHFieldHConstrainTable htraversehfoldMaphmap htabulateA htabulateP htraverse_ htraversePhtraversePWithField HMapTable unHMapTableMapSpecmapInfo Precompose precomposedHMapTableFieldhprojectghc-prim GHC.TypesTypeHNullifyhguardhnullshnullify hunnullifyHLabelhlabelhrelabelhunlabelGTable gfromColumns gtoColumnsgtableGColumnsGContext GSerialize gfromResult gtoResult GConstructor GConstructGConstructable gconstruct gdeconstructGFields Representable gtabulategindex FromColumns ToColumns HIdentity unHIdentity CongruentTTableTColumnsTContext TFromExprs TTranspose TSerializeColsfromColstoCols HVectorize hvectorize hvectorizeA hunvectorizehappendhemptyhtraverseVectorPhcolumnFirstgetFirstHNonEmptyTable HListTablefieldsapplycastExpr scastExprsunsafeCastExpr fromPrimExpr toPrimExpr mapPrimExprzipPrimExprsWithtraversePrimExprtoColumn fromColumntraverseFieldPslitExpr sparseValue nullableExprmaybefmapMaybeliftA2snull nullableOfunsafeUnnullify unsafeMapNullunsafeLiftOpNull primFunctionlistOf nonEmptyOfslistOf snonEmptyOfsappendsappend1semptyGHC.ReadReadGHC.ShowShowMonoid undefined litHTableppColumn attributes binaryspec distinctspecexprsexprsWithNamesifPP relExprPPtable tableFields unpackspec valuesspecview fromOrdernamesFromLabelsWithA showLabels showNamesppWhereppSet ppOnConflictreturn Reifiable contextSingSContextSExprSFieldSNameSResultNullifiabilityNExprNNameNonNullifiabilityNFieldNResultnullifiableOrNotabsurd Nullifiablenullifiabilityguarder time-1.12.2Data.Time.Calendar.DaysDayshowreadsread shead1Expr sindex1Expr slast1Expr sheadExpr sindexExpr slastExpr GHC.Classes==/=TrueBool<<=>>= $fMonoidQuerymempty$fSemigroupQuery$fAlternativeTableQuery$fAltTableQueryRowsListVoidVectorSingle RowsAffectedhrebindinQuery Applicative(profunctors-5.6.2-L89nGFlhxzl2nxOo9BohfkData.Profunctor.Unsafe Profunctor3product-profunctors-0.11.1.1-297q3Vz7a13293pWUYo2NaData.Profunctor.Product.ClassProductProfunctorfilterWhereExplicitunsafeMakeAggregatoraggregateNullifyDouble stringAggOn groupByExpr groupByExprOn slistAggExprsnonEmptyAggExpr slistCatExprsnonEmptyCatExpr EitherTagIsLeftIsRightisLeftisRightMaybeTagIsJustTag HTheseTablehhereTaghhere hthereTaghthere HMaybeTablehtaghjustJustpure fromMaybe$$fMonadMaybeTable$fApplicativeMaybeTabletagjustmakeMaybeTable these-1.2-9dTO1WAtoij6lM1RWTDZZq Data.TheseThesejustHere justThereThisThatherethereunsafeUnnullifyTableNonEmpty aggregateUMonadstatementReturningstatementNoReturningppDecodeStatementppSelect OptimizedUnit ppPrimSelectppRowsppFromppUsingString$hasql-1.6.4.1-10txfIkIY3r2ZUb5u8HXcVHasql.Statement runReturning ppReturningppUpdateppInsertppIntoppDelete HEitherTablehlefthright Data.EitherEitherLeftRightpeek GSerializeADTgfromResultADT gtoResultADT GColumnsADTGSerializeADT' GColumnsADT' GGSerialize GGColumns ggfromResult ggtoResultGAlgebra GFromExprsGRep serialize deserializeGConstructableADT gbuildADT gunbuildADT gconstructADTgdeconstructADT GBuildADT GConstructADTRepresentableFields gftabulategfindex GConstructorsRepresentableConstructors gctabulategcindexGConstructorADT GMakeableADTgmakeADT GGBuildableGGBuildggbuildGGConstructable GGConstruct ggconstruct GGDeconstruct ggdeconstructggdeconstructAGGNameggname BuildableHKDConstructableHKDdeconstructAHKDHKDRep BuildableADTConstructableADTdeconstructAADTADTReplagExpr lagExprOnleadExpr leadExprOnfirstValueExprfirstValueExprOn lastValueExprlastValueExprOn nthValueExprnthValueExprOn