From 726996023cb5de9c873bc21d76db10c18f9d9607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B2=A0=5F=E0=B2=A0?= Date: Sat, 8 Nov 2025 11:25:38 +0100 Subject: [PATCH 1/3] Link to nu commands on "Nu Map from Functional Languages" page --- book/nushell_map_functional.md | 82 +++++++++++++++++----------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/book/nushell_map_functional.md b/book/nushell_map_functional.md index d66018e3a76..a2b007a13d1 100644 --- a/book/nushell_map_functional.md +++ b/book/nushell_map_functional.md @@ -4,44 +4,44 @@ The idea behind this table is to help you understand how Nu builtins and plugins Note: this table assumes Nu 0.43 or later. -| Nushell | Clojure | Tablecloth (Ocaml / Elm) | Haskell | -| ------------ | ---------------------------- | ------------------------------- | ------------------------ | -| append | conj, into, concat | append, (++), concat, concatMap | (++) | -| into binary | Integer/toHexString | | showHex | -| count | count | length, size | length, size | -| date | java.time.LocalDate/now | | | -| each | map, mapv, iterate | map, forEach | map, mapM | -| exit | System/exit | | | -| first | first | head | head | -| format | format | | Text.Printf.printf | -| group-by | group-by | | group, groupBy | -| help | doc | | | -| is-empty | empty? | isEmpty | | -| last | last, peek, take-last | last | last | -| lines | | | lines, words, split-with | -| match | | match (Ocaml), case (Elm) | case | -| nth | nth | Array.get | lookup | -| open | with-open | | | -| transpose | (apply mapv vector matrix) | | transpose | -| prepend | cons | cons, :: | :: | -| print | println | | putStrLn, print | -| range, 1..10 | range | range | 1..10, 'a'..'f' | -| reduce | reduce, reduce-kv | foldr | foldr | -| reverse | reverse, rseq | reverse, reverseInPlace | reverse | -| select | select-keys | | | -| shuffle | shuffle | | | -| size | count | | size, length | -| skip | rest | tail | tail | -| skip until | drop-while | | | -| skip while | drop-while | dropWhile | dropWhile, dropWhileEnd | -| sort-by | sort, sort-by, sorted-set-by | sort, sortBy, sortWith | sort, sortBy | -| split row | split, split-{at,with,lines} | split, words, lines | split, words, lines | -| str | clojure.string functions | String functions | | -| str join | join | concat | intercalate | -| str trim | trim, triml, trimr | trim, trimLeft, trimRight | strip | -| sum | apply + | sum | sum | -| take | take, drop-last, pop | take, init | take, init | -| take until | take-while | takeWhile | takeWhile | -| take while | take-while | takeWhile | takeWhile | -| uniq | set | Set.empty | Data.Set | -| where | filter, filterv, select | filter, filterMap | filter | +| Nushell | Clojure | Tablecloth (Ocaml / Elm) | Haskell | +|--------------------------------------------|------------------------------|---------------------------------|--------------------------| +| [append](../commands/docs/append.md) | conj, into, concat | append, (++), concat, concatMap | (++) | +| into binary | Integer/toHexString | | showHex | +| count | count | length, size | length, size | +| [date](../commands/docs/date.md) | java.time.LocalDate/now | | | +| [each](../commands/docs/each.md) | map, mapv, iterate | map, forEach | map, mapM | +| [exit](../commands/docs/each.md) | System/exit | | | +| [first](../commands/docs/first.md) | first | head | head | +| [format](../commands/docs/format.md) | format | | Text.Printf.printf | +| [group-by](../commands/docs/group-by.md) | group-by | | group, groupBy | +| help | doc | | | +| [is-empty](../commands/docs/is-empty.md) | empty? | isEmpty | | +| [last](../commands/docs/last.md) | last, peek, take-last | last | last | +| [lines](../commands/docs/lines.md) | | | lines, words, split-with | +| [match](../commands/docs/match.md) | | match (Ocaml), case (Elm) | case | +| nth | nth | Array.get | lookup | +| [open](../commands/docs/open.md) | with-open | | | +| [transpose](../commands/docs/transpose.md) | (apply mapv vector matrix) | | transpose | +| [prepend](../commands/docs/prepend.md) | cons | cons, :: | :: | +| [print](../commands/docs/print.md) | println | | putStrLn, print | +| range, 1..10 | range | range | 1..10, 'a'..'f' | +| [reduce](../commands/docs/reduce.md) | reduce, reduce-kv | foldr | foldr | +| [reverse](../commands/docs/reverse.md) | reverse, rseq | reverse, reverseInPlace | reverse | +| [select](../commands/docs/select.md) | select-keys | | | +| [shuffle](../commands/docs/shuffle.md) | shuffle | | | +| size | count | | size, length | +| [skip](../commands/docs/skip.md) | rest | tail | tail | +| skip until | drop-while | | | +| skip while | drop-while | dropWhile | dropWhile, dropWhileEnd | +| [sort-by](../commands/docs/sort-by.md) | sort, sort-by, sorted-set-by | sort, sortBy, sortWith | sort, sortBy | +| split row | split, split-{at,with,lines} | split, words, lines | split, words, lines | +| [str](../commands/docs/str.md) | clojure.string functions | String functions | | +| str join | join | concat | intercalate | +| str trim | trim, triml, trimr | trim, trimLeft, trimRight | strip | +| sum | apply + | sum | sum | +| [take](../commands/docs/take.md) | take, drop-last, pop | take, init | take, init | +| take until | take-while | takeWhile | takeWhile | +| take while | take-while | takeWhile | takeWhile | +| [uniq](../commands/docs/uniq.md) | set | Set.empty | Data.Set | +| [where](../commands/docs/where.md) | filter, filterv, select | filter, filterMap | filter | From e09bd2ca994fdaa000200e4f201d157b6e69895b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B2=A0=5F=E0=B2=A0?= Date: Sat, 8 Nov 2025 19:41:24 +0100 Subject: [PATCH 2/3] Add more commands --- book/nushell_map_functional.md | 83 +++++++++++++++++----------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/book/nushell_map_functional.md b/book/nushell_map_functional.md index a2b007a13d1..5e8ed5040e2 100644 --- a/book/nushell_map_functional.md +++ b/book/nushell_map_functional.md @@ -4,44 +4,45 @@ The idea behind this table is to help you understand how Nu builtins and plugins Note: this table assumes Nu 0.43 or later. -| Nushell | Clojure | Tablecloth (Ocaml / Elm) | Haskell | -|--------------------------------------------|------------------------------|---------------------------------|--------------------------| -| [append](../commands/docs/append.md) | conj, into, concat | append, (++), concat, concatMap | (++) | -| into binary | Integer/toHexString | | showHex | -| count | count | length, size | length, size | -| [date](../commands/docs/date.md) | java.time.LocalDate/now | | | -| [each](../commands/docs/each.md) | map, mapv, iterate | map, forEach | map, mapM | -| [exit](../commands/docs/each.md) | System/exit | | | -| [first](../commands/docs/first.md) | first | head | head | -| [format](../commands/docs/format.md) | format | | Text.Printf.printf | -| [group-by](../commands/docs/group-by.md) | group-by | | group, groupBy | -| help | doc | | | -| [is-empty](../commands/docs/is-empty.md) | empty? | isEmpty | | -| [last](../commands/docs/last.md) | last, peek, take-last | last | last | -| [lines](../commands/docs/lines.md) | | | lines, words, split-with | -| [match](../commands/docs/match.md) | | match (Ocaml), case (Elm) | case | -| nth | nth | Array.get | lookup | -| [open](../commands/docs/open.md) | with-open | | | -| [transpose](../commands/docs/transpose.md) | (apply mapv vector matrix) | | transpose | -| [prepend](../commands/docs/prepend.md) | cons | cons, :: | :: | -| [print](../commands/docs/print.md) | println | | putStrLn, print | -| range, 1..10 | range | range | 1..10, 'a'..'f' | -| [reduce](../commands/docs/reduce.md) | reduce, reduce-kv | foldr | foldr | -| [reverse](../commands/docs/reverse.md) | reverse, rseq | reverse, reverseInPlace | reverse | -| [select](../commands/docs/select.md) | select-keys | | | -| [shuffle](../commands/docs/shuffle.md) | shuffle | | | -| size | count | | size, length | -| [skip](../commands/docs/skip.md) | rest | tail | tail | -| skip until | drop-while | | | -| skip while | drop-while | dropWhile | dropWhile, dropWhileEnd | -| [sort-by](../commands/docs/sort-by.md) | sort, sort-by, sorted-set-by | sort, sortBy, sortWith | sort, sortBy | -| split row | split, split-{at,with,lines} | split, words, lines | split, words, lines | -| [str](../commands/docs/str.md) | clojure.string functions | String functions | | -| str join | join | concat | intercalate | -| str trim | trim, triml, trimr | trim, trimLeft, trimRight | strip | -| sum | apply + | sum | sum | -| [take](../commands/docs/take.md) | take, drop-last, pop | take, init | take, init | -| take until | take-while | takeWhile | takeWhile | -| take while | take-while | takeWhile | takeWhile | -| [uniq](../commands/docs/uniq.md) | set | Set.empty | Data.Set | -| [where](../commands/docs/where.md) | filter, filterv, select | filter, filterMap | filter | +| Nushell | Clojure | Tablecloth (Ocaml / Elm) | Haskell | +|------------------------------------------------|------------------------------|---------------------------------|--------------------------| +| [append](../commands/docs/append.md) | conj, into, concat | append, (++), concat, concatMap | (++) | +| [into binary](../commands/docs/into_binary.md) | Integer/toHexString | | showHex | +| count | count | length, size | length, size | +| [date](../commands/docs/date.md) | java.time.LocalDate/now | | | +| [each](../commands/docs/each.md) | map, mapv, iterate | map, forEach | map, mapM | +| [exit](../commands/docs/each.md) | System/exit | | | +| [first](../commands/docs/first.md) | first | head | head | +| [format](../commands/docs/format.md) | format | | Text.Printf.printf | +| [group-by](../commands/docs/group-by.md) | group-by | | group, groupBy | +| help | doc | | | +| [is-empty](../commands/docs/is-empty.md) | empty? | isEmpty | | +| [last](../commands/docs/last.md) | last, peek, take-last | last | last | +| [lines](../commands/docs/lines.md) | | | lines, words, split-with | +| [match](../commands/docs/match.md) | | match (Ocaml), case (Elm) | case | +| nth | nth | Array.get | lookup | +| [open](../commands/docs/open.md) | with-open | | | +| [transpose](../commands/docs/transpose.md) | (apply mapv vector matrix) | | transpose | +| [prepend](../commands/docs/prepend.md) | cons | cons, :: | :: | +| [print](../commands/docs/print.md) | println | | putStrLn, print | +| range, 1..10 | range | range | 1..10, 'a'..'f' | +| [reduce](../commands/docs/reduce.md) | reduce, reduce-kv | foldr | foldr | +| [reverse](../commands/docs/reverse.md) | reverse, rseq | reverse, reverseInPlace | reverse | +| [select](../commands/docs/select.md) | select-keys | | | +| [shuffle](../commands/docs/shuffle.md) | shuffle | | | +| size | count | | size, length | +| [skip](../commands/docs/skip.md) | rest | tail | tail | +| [skip until](../commands/docs/skip_until.md) | drop-while | | | +| [skip while](../commands/docs/skip_while.md) | drop-while | dropWhile | dropWhile, dropWhileEnd | +| [sort-by](../commands/docs/sort-by.md) | sort, sort-by, sorted-set-by | sort, sortBy, sortWith | sort, sortBy | +| [split row](../commands/docs/split_row.md) | split, split-{at,with,lines} | split, words, lines | split, words, lines | +| [str](../commands/docs/str.md) | clojure.string functions | String functions | | +| [str join](../commands/docs/str_join.md) | join | concat | intercalate | +| [str trim](../commands/docs/str_trim.md) | trim, triml, trimr | trim, trimLeft, trimRight | strip | +| sum | apply + | sum | sum | +| [take](../commands/docs/take.md) | take, drop-last, pop | take, init | take, init | +| [take until](../commands/docs/take_until.md) | take-while | takeWhile | takeWhile | +| [take while](../commands/docs/take_while.md) | take-while | takeWhile | takeWhile | +| [uniq](../commands/docs/uniq.md) | set | Set.empty | Data.Set | +| [where](../commands/docs/where.md) | filter, filterv, select | filter, filterMap | filter | + From 4bd5c9bdf5e72cc361ce15707b917a7268622bc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=B2=A0=5F=E0=B2=A0?= Date: Sun, 9 Nov 2025 08:38:39 +0100 Subject: [PATCH 3/3] Add other commands --- book/nushell_map_functional.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/book/nushell_map_functional.md b/book/nushell_map_functional.md index 5e8ed5040e2..dc3e17aac1f 100644 --- a/book/nushell_map_functional.md +++ b/book/nushell_map_functional.md @@ -8,29 +8,29 @@ Note: this table assumes Nu 0.43 or later. |------------------------------------------------|------------------------------|---------------------------------|--------------------------| | [append](../commands/docs/append.md) | conj, into, concat | append, (++), concat, concatMap | (++) | | [into binary](../commands/docs/into_binary.md) | Integer/toHexString | | showHex | -| count | count | length, size | length, size | +| [length](../commands/docs/length.md) | count | length, size | length, size | | [date](../commands/docs/date.md) | java.time.LocalDate/now | | | | [each](../commands/docs/each.md) | map, mapv, iterate | map, forEach | map, mapM | | [exit](../commands/docs/each.md) | System/exit | | | | [first](../commands/docs/first.md) | first | head | head | | [format](../commands/docs/format.md) | format | | Text.Printf.printf | | [group-by](../commands/docs/group-by.md) | group-by | | group, groupBy | -| help | doc | | | +| [help](../cookbook/help.md) | doc | | | | [is-empty](../commands/docs/is-empty.md) | empty? | isEmpty | | | [last](../commands/docs/last.md) | last, peek, take-last | last | last | | [lines](../commands/docs/lines.md) | | | lines, words, split-with | | [match](../commands/docs/match.md) | | match (Ocaml), case (Elm) | case | -| nth | nth | Array.get | lookup | +| [select](../commands/docs/select.md) | nth | Array.get | lookup | | [open](../commands/docs/open.md) | with-open | | | | [transpose](../commands/docs/transpose.md) | (apply mapv vector matrix) | | transpose | | [prepend](../commands/docs/prepend.md) | cons | cons, :: | :: | | [print](../commands/docs/print.md) | println | | putStrLn, print | -| range, 1..10 | range | range | 1..10, 'a'..'f' | +| [slice](../commands/docs/slice.md), 1..10 | range | range | 1..10, 'a'..'f' | | [reduce](../commands/docs/reduce.md) | reduce, reduce-kv | foldr | foldr | | [reverse](../commands/docs/reverse.md) | reverse, rseq | reverse, reverseInPlace | reverse | | [select](../commands/docs/select.md) | select-keys | | | | [shuffle](../commands/docs/shuffle.md) | shuffle | | | -| size | count | | size, length | +| [length](../commands/docs/length.md) | count | | size, length | | [skip](../commands/docs/skip.md) | rest | tail | tail | | [skip until](../commands/docs/skip_until.md) | drop-while | | | | [skip while](../commands/docs/skip_while.md) | drop-while | dropWhile | dropWhile, dropWhileEnd | @@ -39,10 +39,9 @@ Note: this table assumes Nu 0.43 or later. | [str](../commands/docs/str.md) | clojure.string functions | String functions | | | [str join](../commands/docs/str_join.md) | join | concat | intercalate | | [str trim](../commands/docs/str_trim.md) | trim, triml, trimr | trim, trimLeft, trimRight | strip | -| sum | apply + | sum | sum | +| [math sum](../commands/docs/math_sum.md) | apply + | sum | sum | | [take](../commands/docs/take.md) | take, drop-last, pop | take, init | take, init | | [take until](../commands/docs/take_until.md) | take-while | takeWhile | takeWhile | | [take while](../commands/docs/take_while.md) | take-while | takeWhile | takeWhile | | [uniq](../commands/docs/uniq.md) | set | Set.empty | Data.Set | | [where](../commands/docs/where.md) | filter, filterv, select | filter, filterMap | filter | -