Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [fold]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
43 views

How to generate nested expression?

I've found some related questions, but nothing has really helped me to do what I want to do. Given a list of variables L and a parameter ...
3
votes
1answer
41 views

Alternating Fold[] of two functions, each having 3 arguments

I have a function s, which has a list and two numbers as arguments and creates a list: s[list,n1,n2], and a function t, which also has a list and two numbers as ...
5
votes
2answers
123 views

Building Truncatable Primes using Nest(List), While, Fold

Here is a video on Truncatable Primes. I tried to build it myself. Here is what I have tried using the method in the video for left Truncatable Primes. ...
1
vote
2answers
73 views

How to iteratively (or most efficiently) create such list?

Update A very crude attemp ...
3
votes
1answer
43 views

Changing one argument of a multivariable function at each step of Fold

I have a function, call it F[a_List,b_,c_,d_] which takes in 4 arguments. Now I want to compose this function with itself, where the number of compositions I want ...
0
votes
1answer
57 views

Variable nesting depth inside table

I hope my title makes sense. The idea is the make a function in which a set of variables, $l_1$, $l_2$, etc. are accessible inside the innermost body of a nested (/folded) function. Each of these ...
1
vote
0answers
112 views

Surprising result using operator form of FoldList [closed]

I was trying to implement some Graph related functions in Functional form and came accross this result which I found surprising. I want a function that does various operations on a graph. The ...
5
votes
1answer
218 views

Applying a Function within a Function

How do I define a function with a function? Ok, so lets take a positive integer n and output the result iteratively summing and squaring the integers from 1 to n... ...
5
votes
3answers
205 views

How to use FoldList / NestList and Pure function for this?

...
3
votes
1answer
45 views

Code shortcut for multiple joins

does it exist a simple construct to express the following expression in a more succinct manner: ...
3
votes
2answers
285 views

explanation of #1 and #2 [duplicate]

EDIT: This was marked as a possible duplicate. While the referenced other question does talk about slots, my question is more about how to understand how multiple slots (#1 and #2) work. Also, my ...