From 5f558463973474128b0272c59f0165adb1e625b9 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Sat, 13 Jul 2024 15:29:38 -0500 Subject: [PATCH 1/9] updates to reference documentation From 1e5137fc5e16b7e8ca0b9ffc98d6b6ffd7d9516c Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Tue, 16 Jul 2024 15:48:21 -0500 Subject: [PATCH 2/9] finish reference doc updates for container types From f10b6df520298ab25844ebd365c6709d152bb15b Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Thu, 18 Jul 2024 09:05:00 -0500 Subject: [PATCH 3/9] a bunch more reference documentation for collections and std libs --- docs/reference/comprehension.rst | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/reference/comprehension.rst b/docs/reference/comprehension.rst index 941bebb4..e4306b08 100644 --- a/docs/reference/comprehension.rst +++ b/docs/reference/comprehension.rst @@ -105,29 +105,29 @@ Specification * ``{ e | x in xs, gs } = $join(each(\x. {e | gs}, xs))`` * ``{ e | g, gs } = {? { e | gs } if g, {} otherwise ?}`` - ``$join`` is not directly available to users, but can be accessed - by enabling the ``Primitives`` :doc:`extension `. In - general, ``$join`` turns a thing-of-things into a thing - (list-of-lists into a list, bag-of-bags into a bag, *etc.*). + ``$join`` is not directly available to users, but can be accessed + by enabling the ``Primitives`` :doc:`extension `. In + general, ``$join`` turns a thing-of-things into a thing + (list-of-lists into a list, bag-of-bags into a bag, *etc.*). - - For lists, ``$join`` is equivalent to ``concat``. + - For lists, ``$join`` is equivalent to ``concat``. - :: + :: - Disco> $join [[1,2,3], [4], [5,6]] - [1, 2, 3, 4, 5, 6] + Disco> $join [[1,2,3], [4], [5,6]] + [1, 2, 3, 4, 5, 6] - - For sets, ``$join`` is equivalent to ``unions``. + - For sets, ``$join`` is equivalent to ``unions``. - :: + :: - Disco> $join {{1,2,3}, {2,3,4}, {3,5,6}} - {1, 2, 3, 4, 5, 6} + Disco> $join {{1,2,3}, {2,3,4}, {3,5,6}} + {1, 2, 3, 4, 5, 6} - - For bags, ``$join`` is equivalent to a straightforward - generalization of ``unions`` to work on bags instead of sets. + - For bags, ``$join`` is equivalent to a straightforward + generalization of ``unions`` to work on bags instead of sets. - :: + :: - Disco> $join (bag [bag [1,1,2], bag [1,1,2], bag [2,3,4], bag [2,5,6]]) - ⟅1 # 4, 2 # 4, 3, 4, 5, 6⟆ + Disco> $join (bag [bag [1,1,2], bag [1,1,2], bag [2,3,4], bag [2,5,6]]) + ⟅1 # 4, 2 # 4, 3, 4, 5, 6⟆ From 767ddc004a7227d74c62e02e2a7d18ee9de543c4 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Thu, 18 Jul 2024 22:43:42 -0400 Subject: [PATCH 4/9] bit more cleanup and add missing documentation From 17e36c6d1312e64adb264445a0686629cb93b84c Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Thu, 18 Jul 2024 23:03:00 -0400 Subject: [PATCH 5/9] REPL command reference --- docs/reference/.#string.rst | 1 + 1 file changed, 1 insertion(+) create mode 120000 docs/reference/.#string.rst diff --git a/docs/reference/.#string.rst b/docs/reference/.#string.rst new file mode 120000 index 00000000..723f8b41 --- /dev/null +++ b/docs/reference/.#string.rst @@ -0,0 +1 @@ +brent@diophantus.10955:1721342881 \ No newline at end of file From 5500e2fded1e5105d8cab9e1d47bbb05945a8552 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Fri, 19 Jul 2024 07:15:30 -0400 Subject: [PATCH 6/9] remove stray file --- docs/reference/.#string.rst | 1 - 1 file changed, 1 deletion(-) delete mode 120000 docs/reference/.#string.rst diff --git a/docs/reference/.#string.rst b/docs/reference/.#string.rst deleted file mode 120000 index 723f8b41..00000000 --- a/docs/reference/.#string.rst +++ /dev/null @@ -1 +0,0 @@ -brent@diophantus.10955:1721342881 \ No newline at end of file From eda837076c76249b655ffe8fa0e70f56729f6629 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Fri, 19 Jul 2024 07:30:52 -0400 Subject: [PATCH 7/9] add maps and graphs to reference documentation --- docs/reference/collections.rst | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/docs/reference/collections.rst b/docs/reference/collections.rst index f8a17bb6..b76caeb5 100644 --- a/docs/reference/collections.rst +++ b/docs/reference/collections.rst @@ -1,25 +1,19 @@ Collections =========== -Disco has several built-in collection types (such as :doc:`lists -`, :doc:`bags `, and :doc:`sets `) which represent -collections of values. The pages linked below explain the different -ways to create and use collections, and the operations which can be -used on them. +Disco has several built-in :doc:`collection types ` +(such as :doc:`lists `, :doc:`bags `, and :doc:`sets `) +which represent collections of values. The pages linked below explain +the different ways to create and use collections, and the operations +which can be used on them. .. toctree:: - list - string - set - bag size cp ellipsis - collection-ops + set-ops power - each - filter comprehension boom map From 4020bd3e3bd17e88c59e01d94dc887914f4d0c1a Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Fri, 19 Jul 2024 20:59:37 -0400 Subject: [PATCH 8/9] write about extensions, and add a bit of info about collections --- docs/reference/comprehension.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/reference/comprehension.rst b/docs/reference/comprehension.rst index e4306b08..24d72088 100644 --- a/docs/reference/comprehension.rst +++ b/docs/reference/comprehension.rst @@ -1,7 +1,7 @@ Comprehensions ============== -*Comprehension* notation can be used to describe :doc:`collections ` such as +*Comprehension* notation can be used to describe collections such as :doc:`sets ` or :doc:`lists `. The general syntax for a set comprehension is @@ -15,8 +15,7 @@ some examples below; for the precise details, see the `Details`_ section. :doc:`List ` comprehensions are similar, but use square brackets -(``[``, ``]``) instead of curly braces (``{``, ``}``); :doc:`bag -` comprehensions use bag brackets (``⟅``, ``⟆``). +(``[``, ``]``) instead of curly braces (``{``, ``}``). Examples -------- @@ -97,7 +96,7 @@ Specification .. note:: In case you are curious about the precise definition and are not - afraid of the details, the exact way that comprehensions + afraid of the details, the exact way that set comprehensions work can be defined by the following three equations, making use of the standard functions :doc:`each ` and ``$join``: From 93f817dc163b5616ce96678163661336ca7d7c04 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Fri, 19 Jul 2024 21:27:26 -0400 Subject: [PATCH 9/9] write about inductive definition of lists