Re: Named procedure; RE: SRFI 197: Threading Macros Arne Babenhauserheide 09 Jun 2020 16:59 UTC

Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> writes:

> Am Di., 9. Juni 2020 um 17:47 Uhr schrieb Arne Babenhauserheide
> <xxxxxx@web.de>:
>
>> maybe chaining?
>
> Chaining is nice because it reminds one of the chaining rule in
> calculus, which is about the composition of functions.

I thought about a chain of operations.

Java calls a concept close to what we’re doing here a stream, but
streams are already taken as name.

Short thought experiment because it’s inviting right now (not a concrete
proposal):

(chain-with x
            (+ 3)
            (* 8)
            (expt <> 4))

Then pure chain could be the calls after x:

(define operations
  (chain (+ 3) (* 8) (expt <> 4)))

And this could be valid:

(chain-apply x operations)

> However, `->' does not only compose functions, it also applies the
> composition to some initial argument. So it is really the monadic
> bind, not just a compose/chain operation.
>
> (bind x f g h)
>
> doesn't look too bad, does it?

It does not look too bad, but I would not know what it does. With bind
my first thought was "bind to variable". It’s too generic for my taste.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken