From 31b722e16e6a0f6b0f08e8409b2c7e240937bfed Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Wed, 27 Apr 2022 22:21:50 -0400 Subject: Documentation for Under --- docs/commentary/problems.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/commentary/problems.html') diff --git a/docs/commentary/problems.html b/docs/commentary/problems.html index ca964274..38d41ea9 100644 --- a/docs/commentary/problems.html +++ b/docs/commentary/problems.html @@ -37,7 +37,7 @@

Trains don't like monads

If you have the normal mix of monads and dyads you'll need a lot of parentheses and might end up abusing . Largely solved with the Nothing syntax ·, which acts like J's Cap ([:) in a train, but still a minor frustration.

Under/bind combination is awkward

-

It's most common to use Under with dyadic structural functions in the form (iF), for example where F is one of / or . This is frustrating for two reasons: it requires parentheses, and it doesn't allow i to be computed tacitly. If there's no left argument then the modifier {𝔽(𝕨𝔾)𝕩} can be more useful, but it doesn't cover some useful cases such as mask a (u/) b.

+

It's most common to use Under with dyadic structural functions in the form (iF), for example where F is one of / or . This is frustrating for two reasons: it requires parentheses, and it doesn't allow i to be computed tacitly. If there's no left argument then the modifier {𝔽(𝕨𝔾)𝕩} can be more useful, but it doesn't cover some useful cases such as mask a (u/) b. Another form of Under that's sometimes wanted is {𝕨𝔽𝔾𝕩}. One modifier can only do so much.

List splicing is fiddly

It's common when manipulating text to want to replace a slice with a different slice with an unrelated length. Structural Under works well for this if the new slice has the same length but doesn't otherwise (an implementation could choose to support it, but only if the slice is extracted using two Drops, not Take). So in general the programmer has to cut off initial and final segments and join them to the new slice. If the new slice is computed from the old one it's much worse, as there will be duplication between the code to extract that slice and the other segments. The duplication can be avoided with Group using ∾F(1)(se⍋↕), but this is a lot of work and will execute slowly without some special support. In fact, everything here is liable to run slowly, making too many copies of the unmodified part of the stream.

Dyalog's solution here (and dzaima/BQN's) is Regex, which is a nice feature but also an entire second language to learn.

-- cgit v1.2.3