aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/world
diff options
context:
space:
mode:
authorEduardo Julian2021-09-10 03:09:37 -0400
committerEduardo Julian2021-09-10 03:09:37 -0400
commit343fda007c09deb70917a4afda19891cacf54504 (patch)
treec20fab9561daf8753750b75c1cb81a9fdc50e044 /stdlib/source/library/lux/world
parentf71ec9cb4ead1e7f9573a37686c87e6a9206a415 (diff)
Undid the foolish re-design of "abstract:" and "actor:".
Diffstat (limited to 'stdlib/source/library/lux/world')
-rw-r--r--stdlib/source/library/lux/world/db/sql.lux816
-rw-r--r--stdlib/source/library/lux/world/file/watch.lux82
-rw-r--r--stdlib/source/library/lux/world/net/http/mime.lux12
-rw-r--r--stdlib/source/library/lux/world/program.lux4
4 files changed, 457 insertions, 457 deletions
diff --git a/stdlib/source/library/lux/world/db/sql.lux b/stdlib/source/library/lux/world/db/sql.lux
index a4b94f517..60abb4484 100644
--- a/stdlib/source/library/lux/world/db/sql.lux
+++ b/stdlib/source/library/lux/world/db/sql.lux
@@ -21,7 +21,7 @@
... Kind
(template [<declaration>]
- [(abstract: .public <declaration> Any [])]
+ [(abstract: .public <declaration> Any)]
[Literal']
[Column']
@@ -66,415 +66,415 @@
Text
... SQL
- [(template [<declaration> <kind>]
- [(type: .public <declaration>
- (SQL <kind>))]
-
- [Literal (Value' Literal')]
- [Column (Value' Column')]
- [Placeholder (Value' Placeholder')]
- [Value (Value' Any)]
-
- [Function Function']
- [Condition Condition']
-
- [Index Index']
-
- [Table Table']
- [View View']
- [Source Source']
- [DB DB']
-
- [Order Order']
-
- [(Schema kind) (Schema' kind)]
-
- [(Query where having order group limit offset) (Statement' (Action' where having (Query' order group limit offset)))]
- [(Command where having) (Statement' (Action' where having Command'))]
- [(Action where having kind) (Statement' (Action' where having kind))]
-
- [Definition (Statement' Definition')]
- [Statement (Statement' Any)]
- )
-
- (def: Base_Query (.type (Query No_Where No_Having No_Order No_Group No_Limit No_Offset)))
- (def: Any_Query (.type (Query Any Any Any Any Any Any)))
-
- ... Only use this function for debugging purposes.
- ... Do not use this function to actually execute SQL code.
- (def: .public read
- (-> (SQL Any) Text)
- (|>> :representation))
-
- (def: .public (sql action)
- (-> Statement Text)
- (format (:representation action) ";"))
-
- (def: listing
- (-> (List (SQL Any)) Text)
- (|>> (list\each (|>> :representation))
- (text.interposed ", ")))
-
- ... Value
- (def: .public ? Placeholder (:abstraction "?"))
-
- (def: literal
- (-> Text Literal)
- (|>> :abstraction))
-
- (def: .public null Literal (..literal "NULL"))
-
- (def: .public (int value)
- (-> Int Literal)
- (..literal (if (i.< +0 value)
- (%.int value)
- (%.nat (.nat value)))))
-
- (def: .public function
- (-> Text Function)
- (|>> :abstraction))
-
- (def: .public (call function parameters)
- (-> Function (List Value) Value)
- (:abstraction (format (:representation function)
- (..parenthesize (..listing parameters)))))
-
- ... Condition
- (template [<name> <sql_op>]
- [(def: .public (<name> reference sample)
- (-> Value Value Condition)
- (:abstraction
- (..parenthesize
- (format (:representation sample)
- " " <sql_op> " "
- (:representation reference)))))]
-
- [= "="]
- [<> "<>"]
- [is? "IS"]
- [> ">"]
- [>= ">="]
- [< "<"]
- [<= "<="]
- [like? "LIKE"]
- [ilike? "ILIKE"]
- )
-
- (def: .public (between from to sample)
- (-> Value Value Value Condition)
- (:abstraction
- (..parenthesize
- (format (:representation sample)
- " BETWEEN " (:representation from)
- " AND " (:representation to)))))
-
- (def: .public (in options value)
- (-> (List Value) Value Condition)
- (:abstraction
- (format (:representation value)
- " IN "
- (..parenthesize (listing options)))))
-
- (template [<func_name> <sql_op>]
- [(def: .public (<func_name> left right)
- (-> Condition Condition Condition)
- (:abstraction
- (format (..parenthesize (:representation left))
- " " <sql_op> " "
- (..parenthesize (:representation right)))))]
-
- [and "AND"]
- [or "OR"]
- )
-
- (template [<name> <type> <sql>]
- [(def: .public <name>
- (-> <type> Condition)
- (|>> :representation ..parenthesize (format <sql> " ") :abstraction))]
-
- [not Condition "NOT"]
- [exists Any_Query "EXISTS"]
- )
-
- ... Query
- (template [<name> <type> <decoration>]
- [(def: .public <name>
- (-> <type> Source)
- (|>> :representation <decoration> :abstraction))]
-
- [from_table Table (<|)]
- [from_view View (<|)]
- [from_query Any_Query ..parenthesize]
- )
-
- (template [<func_name> <op>]
- [(def: .public (<func_name> columns source)
- (-> (List [Column Alias]) Source Base_Query)
- (:abstraction
- (format <op>
- " "
- (case columns
- #.End
- "*"
-
- _
- (|> columns
- (list\each (.function (_ [column alias])
- (if (text\= ..no_alias alias)
- (:representation column)
- (format (:representation column) " AS " alias))))
- (text.interposed ", ")))
- " FROM " (:representation source))))]
-
-
- [select "SELECT"]
- [select_distinct "SELECT DISTINCT"]
- )
-
- (template [<name> <join_text>]
- [(def: .public (<name> table condition prev)
- (-> Table Condition Base_Query Base_Query)
- (:abstraction
- (format (:representation prev)
- " " <join_text> " "
- (:representation table)
- " ON " (:representation condition))))]
-
- [inner_join "INNER JOIN"]
- [left_join "LEFT JOIN"]
- [right_join "RIGHT JOIN"]
- [full_outer_join "FULL OUTER JOIN"]
- )
-
- (template [<function> <sql_op>]
- [(def: .public (<function> left right)
- (-> Any_Query Any_Query (Query Without_Where Without_Having No_Order No_Group No_Limit No_Offset))
- (:abstraction
- (format (:representation left)
+ (template [<declaration> <kind>]
+ [(type: .public <declaration>
+ (SQL <kind>))]
+
+ [Literal (Value' Literal')]
+ [Column (Value' Column')]
+ [Placeholder (Value' Placeholder')]
+ [Value (Value' Any)]
+
+ [Function Function']
+ [Condition Condition']
+
+ [Index Index']
+
+ [Table Table']
+ [View View']
+ [Source Source']
+ [DB DB']
+
+ [Order Order']
+
+ [(Schema kind) (Schema' kind)]
+
+ [(Query where having order group limit offset) (Statement' (Action' where having (Query' order group limit offset)))]
+ [(Command where having) (Statement' (Action' where having Command'))]
+ [(Action where having kind) (Statement' (Action' where having kind))]
+
+ [Definition (Statement' Definition')]
+ [Statement (Statement' Any)]
+ )
+
+ (def: Base_Query (.type (Query No_Where No_Having No_Order No_Group No_Limit No_Offset)))
+ (def: Any_Query (.type (Query Any Any Any Any Any Any)))
+
+ ... Only use this function for debugging purposes.
+ ... Do not use this function to actually execute SQL code.
+ (def: .public read
+ (-> (SQL Any) Text)
+ (|>> :representation))
+
+ (def: .public (sql action)
+ (-> Statement Text)
+ (format (:representation action) ";"))
+
+ (def: listing
+ (-> (List (SQL Any)) Text)
+ (|>> (list\each (|>> :representation))
+ (text.interposed ", ")))
+
+ ... Value
+ (def: .public ? Placeholder (:abstraction "?"))
+
+ (def: literal
+ (-> Text Literal)
+ (|>> :abstraction))
+
+ (def: .public null Literal (..literal "NULL"))
+
+ (def: .public (int value)
+ (-> Int Literal)
+ (..literal (if (i.< +0 value)
+ (%.int value)
+ (%.nat (.nat value)))))
+
+ (def: .public function
+ (-> Text Function)
+ (|>> :abstraction))
+
+ (def: .public (call function parameters)
+ (-> Function (List Value) Value)
+ (:abstraction (format (:representation function)
+ (..parenthesize (..listing parameters)))))
+
+ ... Condition
+ (template [<name> <sql_op>]
+ [(def: .public (<name> reference sample)
+ (-> Value Value Condition)
+ (:abstraction
+ (..parenthesize
+ (format (:representation sample)
" " <sql_op> " "
- (:representation right))))]
-
- [union "UNION"]
- [union_all "UNION ALL"]
- [intersect "INTERSECT"]
- )
-
- (template [<name> <sql> <variables> <input> <output>]
- [(`` (def: .public (<name> value query)
- (All (_ (~~ (template.spliced <variables>)))
- (-> Nat <input> <output>))
- (:abstraction
- (format (:representation query)
- " " <sql> " "
- (%.nat value)))))]
-
- [limit "LIMIT" [where having order group offset]
- (Query where having order group No_Limit offset)
- (Query where having order group With_Limit offset)]
-
- [offset "OFFSET" [where having order group limit]
- (Query where having order group limit No_Offset)
- (Query where having order group limit With_Offset)]
- )
-
- (template [<name> <sql>]
- [(def: .public <name>
- Order
- (:abstraction <sql>))]
-
- [ascending "ASC"]
- [descending "DESC"]
- )
-
- (def: .public (order_by pairs query)
- (All (_ where having group limit offset)
- (-> (List [Value Order])
- (Query where having No_Order group limit offset)
- (Query where having With_Order group limit offset)))
- (case pairs
- #.End
- (|> query :representation :abstraction)
-
- _
+ (:representation reference)))))]
+
+ [= "="]
+ [<> "<>"]
+ [is? "IS"]
+ [> ">"]
+ [>= ">="]
+ [< "<"]
+ [<= "<="]
+ [like? "LIKE"]
+ [ilike? "ILIKE"]
+ )
+
+ (def: .public (between from to sample)
+ (-> Value Value Value Condition)
+ (:abstraction
+ (..parenthesize
+ (format (:representation sample)
+ " BETWEEN " (:representation from)
+ " AND " (:representation to)))))
+
+ (def: .public (in options value)
+ (-> (List Value) Value Condition)
+ (:abstraction
+ (format (:representation value)
+ " IN "
+ (..parenthesize (listing options)))))
+
+ (template [<func_name> <sql_op>]
+ [(def: .public (<func_name> left right)
+ (-> Condition Condition Condition)
+ (:abstraction
+ (format (..parenthesize (:representation left))
+ " " <sql_op> " "
+ (..parenthesize (:representation right)))))]
+
+ [and "AND"]
+ [or "OR"]
+ )
+
+ (template [<name> <type> <sql>]
+ [(def: .public <name>
+ (-> <type> Condition)
+ (|>> :representation ..parenthesize (format <sql> " ") :abstraction))]
+
+ [not Condition "NOT"]
+ [exists Any_Query "EXISTS"]
+ )
+
+ ... Query
+ (template [<name> <type> <decoration>]
+ [(def: .public <name>
+ (-> <type> Source)
+ (|>> :representation <decoration> :abstraction))]
+
+ [from_table Table (<|)]
+ [from_view View (<|)]
+ [from_query Any_Query ..parenthesize]
+ )
+
+ (template [<func_name> <op>]
+ [(def: .public (<func_name> columns source)
+ (-> (List [Column Alias]) Source Base_Query)
+ (:abstraction
+ (format <op>
+ " "
+ (case columns
+ #.End
+ "*"
+
+ _
+ (|> columns
+ (list\each (.function (_ [column alias])
+ (if (text\= ..no_alias alias)
+ (:representation column)
+ (format (:representation column) " AS " alias))))
+ (text.interposed ", ")))
+ " FROM " (:representation source))))]
+
+
+ [select "SELECT"]
+ [select_distinct "SELECT DISTINCT"]
+ )
+
+ (template [<name> <join_text>]
+ [(def: .public (<name> table condition prev)
+ (-> Table Condition Base_Query Base_Query)
+ (:abstraction
+ (format (:representation prev)
+ " " <join_text> " "
+ (:representation table)
+ " ON " (:representation condition))))]
+
+ [inner_join "INNER JOIN"]
+ [left_join "LEFT JOIN"]
+ [right_join "RIGHT JOIN"]
+ [full_outer_join "FULL OUTER JOIN"]
+ )
+
+ (template [<function> <sql_op>]
+ [(def: .public (<function> left right)
+ (-> Any_Query Any_Query (Query Without_Where Without_Having No_Order No_Group No_Limit No_Offset))
+ (:abstraction
+ (format (:representation left)
+ " " <sql_op> " "
+ (:representation right))))]
+
+ [union "UNION"]
+ [union_all "UNION ALL"]
+ [intersect "INTERSECT"]
+ )
+
+ (template [<name> <sql> <variables> <input> <output>]
+ [(`` (def: .public (<name> value query)
+ (All (_ (~~ (template.spliced <variables>)))
+ (-> Nat <input> <output>))
+ (:abstraction
+ (format (:representation query)
+ " " <sql> " "
+ (%.nat value)))))]
+
+ [limit "LIMIT" [where having order group offset]
+ (Query where having order group No_Limit offset)
+ (Query where having order group With_Limit offset)]
+
+ [offset "OFFSET" [where having order group limit]
+ (Query where having order group limit No_Offset)
+ (Query where having order group limit With_Offset)]
+ )
+
+ (template [<name> <sql>]
+ [(def: .public <name>
+ Order
+ (:abstraction <sql>))]
+
+ [ascending "ASC"]
+ [descending "DESC"]
+ )
+
+ (def: .public (order_by pairs query)
+ (All (_ where having group limit offset)
+ (-> (List [Value Order])
+ (Query where having No_Order group limit offset)
+ (Query where having With_Order group limit offset)))
+ (case pairs
+ #.End
+ (|> query :representation :abstraction)
+
+ _
+ (:abstraction
+ (format (:representation query)
+ " ORDER BY "
+ (|> pairs
+ (list\each (.function (_ [value order])
+ (format (:representation value) " " (:representation order))))
+ (text.interposed ", "))))))
+
+ (def: .public (group_by pairs query)
+ (All (_ where having order limit offset)
+ (-> (List Value)
+ (Query where having order No_Group limit offset)
+ (Query where having order With_Group limit offset)))
+ (case pairs
+ #.End
+ (|> query :representation :abstraction)
+
+ _
+ (:abstraction
+ (format (:representation query)
+ " GROUP BY "
+ (..listing pairs)))))
+
+ ... Command
+ (def: .public (insert table columns rows)
+ (-> Table (List Column) (List (List Value)) (Command Without_Where Without_Having))
+ (:abstraction
+ (format "INSERT INTO " (:representation table) " "
+ (..parenthesize (..listing columns))
+ " VALUES "
+ (|> rows
+ (list\each (|>> ..listing ..parenthesize))
+ (text.interposed ", "))
+ )))
+
+ (def: .public (update table pairs)
+ (-> Table (List [Column Value]) (Command No_Where No_Having))
+ (:abstraction (format "UPDATE " (:representation table)
+ (case pairs
+ #.End
+ ""
+
+ _
+ (format " SET " (|> pairs
+ (list\each (.function (_ [column value])
+ (format (:representation column) "=" (:representation value))))
+ (text.interposed ", ")))))))
+
+ (def: .public delete
+ (-> Table (Command No_Where No_Having))
+ (|>> :representation (format "DELETE FROM ") :abstraction))
+
+ ... Action
+ (def: .public (where condition prev)
+ (All (_ kind having)
+ (-> Condition (Action No_Where having kind) (Action With_Where having kind)))
+ (:abstraction
+ (format (:representation prev)
+ " WHERE "
+ (:representation condition))))
+
+ (def: .public (having condition prev)
+ (All (_ where kind)
+ (-> Condition (Action where No_Having kind) (Action where With_Having kind)))
+ (:abstraction
+ (format (:representation prev)
+ " HAVING "
+ (:representation condition))))
+
+ ... Schema
+ (def: .public type
+ (-> Text (Schema Value))
+ (|>> :abstraction))
+
+ (template [<name> <attr>]
+ [(def: .public (<name> attr)
+ (-> (Schema Value) (Schema Value))
(:abstraction
- (format (:representation query)
- " ORDER BY "
- (|> pairs
- (list\each (.function (_ [value order])
- (format (:representation value) " " (:representation order))))
- (text.interposed ", "))))))
-
- (def: .public (group_by pairs query)
- (All (_ where having order limit offset)
- (-> (List Value)
- (Query where having order No_Group limit offset)
- (Query where having order With_Group limit offset)))
- (case pairs
- #.End
- (|> query :representation :abstraction)
-
- _
+ (format (:representation attr) " " <attr>)))]
+
+ [unique "UNIQUE"]
+ [not_null "NOT NULL"]
+ [stored "STORED"]
+ )
+
+ (def: .public (default value attr)
+ (-> Value (Schema Value) (Schema Value))
+ (:abstraction
+ (format (:representation attr) " DEFAULT " (:representation value))))
+
+ (def: .public (define_column name type)
+ (-> Column (Schema Value) (Schema Column))
+ (:abstraction
+ (format (:representation name) " " (:representation type))))
+
+ (def: .public (auto_increment offset column)
+ (-> Int (Schema Column) (Schema Column))
+ (:abstraction
+ (format (:representation column) " AUTO_INCREMENT=" (:representation (..int offset)))))
+
+ (def: .public (create_table or_replace? table columns)
+ (-> Bit Table (List (Schema Column)) Definition)
+ (let [command (if or_replace?
+ "CREATE OR REPLACE TABLE"
+ "CREATE TABLE IF NOT EXISTS")]
+ (:abstraction
+ (format command " " (:representation table)
+ (..parenthesize (..listing columns))))))
+
+ (def: .public (create_table_as table query)
+ (-> Table Any_Query Definition)
+ (:abstraction
+ (format "CREATE TABLE " (:representation table) " AS " (:representation query))))
+
+ (template [<name> <sql>]
+ [(def: .public (<name> table)
+ (-> Table Definition)
(:abstraction
- (format (:representation query)
- " GROUP BY "
- (..listing pairs)))))
-
- ... Command
- (def: .public (insert table columns rows)
- (-> Table (List Column) (List (List Value)) (Command Without_Where Without_Having))
- (:abstraction
- (format "INSERT INTO " (:representation table) " "
- (..parenthesize (..listing columns))
- " VALUES "
- (|> rows
- (list\each (|>> ..listing ..parenthesize))
- (text.interposed ", "))
- )))
-
- (def: .public (update table pairs)
- (-> Table (List [Column Value]) (Command No_Where No_Having))
- (:abstraction (format "UPDATE " (:representation table)
- (case pairs
- #.End
- ""
-
- _
- (format " SET " (|> pairs
- (list\each (.function (_ [column value])
- (format (:representation column) "=" (:representation value))))
- (text.interposed ", ")))))))
-
- (def: .public delete
- (-> Table (Command No_Where No_Having))
- (|>> :representation (format "DELETE FROM ") :abstraction))
-
- ... Action
- (def: .public (where condition prev)
- (All (_ kind having)
- (-> Condition (Action No_Where having kind) (Action With_Where having kind)))
- (:abstraction
- (format (:representation prev)
- " WHERE "
- (:representation condition))))
-
- (def: .public (having condition prev)
- (All (_ where kind)
- (-> Condition (Action where No_Having kind) (Action where With_Having kind)))
- (:abstraction
- (format (:representation prev)
- " HAVING "
- (:representation condition))))
-
- ... Schema
- (def: .public type
- (-> Text (Schema Value))
- (|>> :abstraction))
-
- (template [<name> <attr>]
- [(def: .public (<name> attr)
- (-> (Schema Value) (Schema Value))
- (:abstraction
- (format (:representation attr) " " <attr>)))]
-
- [unique "UNIQUE"]
- [not_null "NOT NULL"]
- [stored "STORED"]
- )
-
- (def: .public (default value attr)
- (-> Value (Schema Value) (Schema Value))
- (:abstraction
- (format (:representation attr) " DEFAULT " (:representation value))))
-
- (def: .public (define_column name type)
- (-> Column (Schema Value) (Schema Column))
- (:abstraction
- (format (:representation name) " " (:representation type))))
-
- (def: .public (auto_increment offset column)
- (-> Int (Schema Column) (Schema Column))
- (:abstraction
- (format (:representation column) " AUTO_INCREMENT=" (:representation (..int offset)))))
-
- (def: .public (create_table or_replace? table columns)
- (-> Bit Table (List (Schema Column)) Definition)
- (let [command (if or_replace?
- "CREATE OR REPLACE TABLE"
- "CREATE TABLE IF NOT EXISTS")]
+ (format <sql> " TABLE " (:representation table))))]
+
+ [drop "DROP"]
+ [truncate "TRUNCATE"]
+ )
+
+ (def: .public (add_column table column)
+ (-> Table (Schema Column) Definition)
+ (:abstraction
+ (format "ALTER TABLE " (:representation table) " ADD " (:representation column))))
+
+ (def: .public (drop_column table column)
+ (-> Table Column Definition)
+ (:abstraction
+ (format "ALTER TABLE " (:representation table) " DROP COLUMN " (:representation column))))
+
+ (template [<name> <type>]
+ [(def: .public (<name> name)
+ (-> Text <type>)
+ (:abstraction name))]
+
+ [column Column]
+ [table Table]
+ [view View]
+ [index Index]
+ [db DB]
+ )
+
+ (template [<name> <type> <sql>]
+ [(def: .public <name>
+ (-> <type> Definition)
+ (|>> :representation (format <sql> " ") :abstraction))]
+
+ [create_db DB "CREATE DATABASE"]
+ [drop_db DB "DROP DATABASE"]
+ [drop_view View "DROP VIEW"]
+ )
+
+ (template [<name> <sql>]
+ [(def: .public (<name> view query)
+ (-> View Any_Query Definition)
(:abstraction
- (format command " " (:representation table)
- (..parenthesize (..listing columns))))))
-
- (def: .public (create_table_as table query)
- (-> Table Any_Query Definition)
- (:abstraction
- (format "CREATE TABLE " (:representation table) " AS " (:representation query))))
-
- (template [<name> <sql>]
- [(def: .public (<name> table)
- (-> Table Definition)
- (:abstraction
- (format <sql> " TABLE " (:representation table))))]
-
- [drop "DROP"]
- [truncate "TRUNCATE"]
- )
-
- (def: .public (add_column table column)
- (-> Table (Schema Column) Definition)
- (:abstraction
- (format "ALTER TABLE " (:representation table) " ADD " (:representation column))))
-
- (def: .public (drop_column table column)
- (-> Table Column Definition)
- (:abstraction
- (format "ALTER TABLE " (:representation table) " DROP COLUMN " (:representation column))))
-
- (template [<name> <type>]
- [(def: .public (<name> name)
- (-> Text <type>)
- (:abstraction name))]
-
- [column Column]
- [table Table]
- [view View]
- [index Index]
- [db DB]
- )
-
- (template [<name> <type> <sql>]
- [(def: .public <name>
- (-> <type> Definition)
- (|>> :representation (format <sql> " ") :abstraction))]
-
- [create_db DB "CREATE DATABASE"]
- [drop_db DB "DROP DATABASE"]
- [drop_view View "DROP VIEW"]
- )
-
- (template [<name> <sql>]
- [(def: .public (<name> view query)
- (-> View Any_Query Definition)
- (:abstraction
- (format <sql> " " (:representation view) " AS " (:representation query))))]
-
- [create_view "CREATE VIEW"]
- [create_or_replace_view "CREATE OR REPLACE VIEW"]
- )
-
- (def: .public (create_index index table unique? columns)
- (-> Index Table Bit (List Column) Definition)
- (:abstraction
- (format "CREATE " (if unique? "UNIQUE" "") " INDEX " (:representation index)
- " ON " (:representation table) " " (..parenthesize (..listing columns)))))
-
- (def: .public (with alias query body)
- (All (_ where having order group limit offset)
- (-> Table Any_Query
- (Query where having order group limit offset)
- (Query where having order group limit offset)))
- (:abstraction
- (format "WITH " (:representation alias)
- " AS " (..parenthesize (:representation query))
- " " (:representation body))))]
+ (format <sql> " " (:representation view) " AS " (:representation query))))]
+
+ [create_view "CREATE VIEW"]
+ [create_or_replace_view "CREATE OR REPLACE VIEW"]
+ )
+
+ (def: .public (create_index index table unique? columns)
+ (-> Index Table Bit (List Column) Definition)
+ (:abstraction
+ (format "CREATE " (if unique? "UNIQUE" "") " INDEX " (:representation index)
+ " ON " (:representation table) " " (..parenthesize (..listing columns)))))
+
+ (def: .public (with alias query body)
+ (All (_ where having order group limit offset)
+ (-> Table Any_Query
+ (Query where having order group limit offset)
+ (Query where having order group limit offset)))
+ (:abstraction
+ (format "WITH " (:representation alias)
+ " AS " (..parenthesize (:representation query))
+ " " (:representation body))))
)
diff --git a/stdlib/source/library/lux/world/file/watch.lux b/stdlib/source/library/lux/world/file/watch.lux
index e014fc157..51ac92a90 100644
--- a/stdlib/source/library/lux/world/file/watch.lux
+++ b/stdlib/source/library/lux/world/file/watch.lux
@@ -38,47 +38,47 @@
#modification Bit
#deletion Bit])
- [(def: none
- Concern
- (:abstraction
- [#creation false
- #modification false
- #deletion false]))
-
- (template [<concern> <predicate> <event> <create> <modify> <delete>]
- [(def: .public <concern>
- Concern
- (:abstraction
- [#creation <create>
- #modification <modify>
- #deletion <delete>]))
-
- (def: .public <predicate>
- (Predicate Concern)
- (|>> :representation (value@ <event>)))]
-
- [creation creation? #creation
- true false false]
- [modification modification? #modification
- false true false]
- [deletion deletion? #deletion
- false false true]
- )
-
- (def: .public (also left right)
- (-> Concern Concern Concern)
- (:abstraction
- [#creation (or (..creation? left) (..creation? right))
- #modification (or (..modification? left) (..modification? right))
- #deletion (or (..deletion? left) (..deletion? right))]))
-
- (def: .public all
- Concern
- ($_ ..also
- ..creation
- ..modification
- ..deletion
- ))]
+ (def: none
+ Concern
+ (:abstraction
+ [#creation false
+ #modification false
+ #deletion false]))
+
+ (template [<concern> <predicate> <event> <create> <modify> <delete>]
+ [(def: .public <concern>
+ Concern
+ (:abstraction
+ [#creation <create>
+ #modification <modify>
+ #deletion <delete>]))
+
+ (def: .public <predicate>
+ (Predicate Concern)
+ (|>> :representation (value@ <event>)))]
+
+ [creation creation? #creation
+ true false false]
+ [modification modification? #modification
+ false true false]
+ [deletion deletion? #deletion
+ false false true]
+ )
+
+ (def: .public (also left right)
+ (-> Concern Concern Concern)
+ (:abstraction
+ [#creation (or (..creation? left) (..creation? right))
+ #modification (or (..modification? left) (..modification? right))
+ #deletion (or (..deletion? left) (..deletion? right))]))
+
+ (def: .public all
+ Concern
+ ($_ ..also
+ ..creation
+ ..modification
+ ..deletion
+ ))
)
(type: .public (Watcher !)
diff --git a/stdlib/source/library/lux/world/net/http/mime.lux b/stdlib/source/library/lux/world/net/http/mime.lux
index ba7811ed2..fb80bdc86 100644
--- a/stdlib/source/library/lux/world/net/http/mime.lux
+++ b/stdlib/source/library/lux/world/net/http/mime.lux
@@ -11,13 +11,13 @@
(abstract: .public MIME
Text
- [(def: .public mime
- (-> Text MIME)
- (|>> :abstraction))
+ (def: .public mime
+ (-> Text MIME)
+ (|>> :abstraction))
- (def: .public name
- (-> MIME Text)
- (|>> :representation))]
+ (def: .public name
+ (-> MIME Text)
+ (|>> :representation))
)
... https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types
diff --git a/stdlib/source/library/lux/world/program.lux b/stdlib/source/library/lux/world/program.lux
index 4858d01f0..5d5604777 100644
--- a/stdlib/source/library/lux/world/program.lux
+++ b/stdlib/source/library/lux/world/program.lux
@@ -292,8 +292,8 @@
... @.scheme
... (as_is (ffi.import: (exit [Int] "io" Nothing))
... ... https://srfi.schemers.org/srfi-98/srfi-98.html
- ... (abstract: Pair Any [])
- ... (abstract: PList Any [])
+ ... (abstract: Pair Any)
+ ... (abstract: PList Any)
... (ffi.import: (get-environment-variables [] "io" PList))
... (ffi.import: (car [Pair] Text))
... (ffi.import: (cdr [Pair] Text))