# \#functional

**URL:** https://discourse.julialang.org/tag/functional/840.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [More idiomatic way of phrasing \`reduce(\\circ, repeated(f, x))(y)\`?](https://discourse.julialang.org/t/more-idiomatic-way-of-phrasing-reduce-circ-repeated-f-x-y/138647)

<div class="topic-metadata">

**Author:** [@rokke](https://discourse.julialang.org/u/rokke)\
**Replies:** 24\
**Last updated:** [August 15, 2026, 2:49pm UTC](https://discourse.julialang.org/t/more-idiomatic-way-of-phrasing-reduce-circ-repeated-f-x-y/138647 "2026-08-15T14:49:08Z")

</div>

I usually use reduce(∘, repeated(func, x))(a) when I need to apply func to a x times, but apparently it spends most of the time creating the single composed function; averaging ~20x as long as an equivalent accumulate in…

---

## [FixFunctionArgument.jl: Fix a function positional argument to a callable. Stand-in replacement for Base.Fix](https://discourse.julialang.org/t/fixfunctionargument-jl-fix-a-function-positional-argument-to-a-callable-stand-in-replacement-for-base-fix/132532)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 0\
**Last updated:** [September 21, 2025, 7:45am UTC](https://discourse.julialang.org/t/fixfunctionargument-jl-fix-a-function-positional-argument-to-a-callable-stand-in-replacement-for-base-fix/132532 "2025-09-21T07:45:42Z")

</div>

Suboptimal design in Base.Fix, also applying to Base.Fix1 and Base.Fix2, causes things like Base.Fix1(convert, Bool) to have a greater than zero representation in memory, because Bool isa Type. Fixing this in Base would …

---

## [When I grow up I want to be a function](https://discourse.julialang.org/t/when-i-grow-up-i-want-to-be-a-function/127425)

<div class="topic-metadata">

**Author:** [@NonDairyNeutrino](https://discourse.julialang.org/u/NonDairyNeutrino)\
**Replies:** 2\
**Last updated:** [March 27, 2025, 7:48pm UTC](https://discourse.julialang.org/t/when-i-grow-up-i-want-to-be-a-function/127425 "2025-03-27T19:48:57Z")

</div>

I learned programming in my undergrad through using Mathematica for homework assignments (B.S. Physics, B.S. Pure Math), and later for some undergrad physics research. It always made perfect sense to me because it was j…

---

## [PureFun.jl: implementations from Okasaki's \*Purely Functional Data Structures\*](https://discourse.julialang.org/t/purefun-jl-implementations-from-okasakis-purely-functional-data-structures/91815)

<div class="topic-metadata">

**Author:** [@tarakc02](https://discourse.julialang.org/u/tarakc02)\
**Replies:** 7\
**Last updated:** [March 18, 2023, 10:15pm UTC](https://discourse.julialang.org/t/purefun-jl-implementations-from-okasakis-purely-functional-data-structures/91815 "2023-03-18T22:15:19Z")

</div>

Hello, I’ve been implementing the data structures presented in Chris Okasaki’s book Purely Functional Data Structures in Julia, and wanted to share what I’ve got with you: PureFun.jl. It’s not quite every structure prese…

---

## [Best practice for passing parameters to functions passed as parameters](https://discourse.julialang.org/t/best-practice-for-passing-parameters-to-functions-passed-as-parameters/85479)

<div class="topic-metadata">

**Author:** [@nsquare](https://discourse.julialang.org/u/nsquare)\
**Replies:** 5\
**Last updated:** [August 9, 2022, 3:47pm UTC](https://discourse.julialang.org/t/best-practice-for-passing-parameters-to-functions-passed-as-parameters/85479 "2022-08-09T15:47:13Z")

</div>

Hello! I want to write a general function with several subroutines. I would like this method to be able to use different functions as subroutines, by taking them as parameters, as shown in the toy example below. functi…

---

## [Is there no declarative / functional solution for "between" problems?](https://discourse.julialang.org/t/is-there-no-declarative-functional-solution-for-between-problems/80528)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 2\
**Last updated:** [May 5, 2022, 9:11am UTC](https://discourse.julialang.org/t/is-there-no-declarative-functional-solution-for-between-problems/80528 "2022-05-05T09:11:56Z")

</div>

I was wondering what a more declarative approach is to the simple problem space of doing something between the elements of some iterator. I feel like that is a task that constantly comes up but can’t be solved with just m…

---

## [Inspect inferred types and generated codes for inner functions](https://discourse.julialang.org/t/inspect-inferred-types-and-generated-codes-for-inner-functions/77688)

<div class="topic-metadata">

**Author:** [@Uroc327](https://discourse.julialang.org/u/Uroc327)\
**Replies:** 5\
**Last updated:** [March 11, 2022, 1:58pm UTC](https://discourse.julialang.org/t/inspect-inferred-types-and-generated-codes-for-inner-functions/77688 "2022-03-11T13:58:04Z")

</div>

Often it is convenient to have inner functions, eg for functional ones like mapreduce. How can I apply code inspection macros like @code\_llvm or @code\_warntype to the “full” function? Example: julia\> function test(a) …

---

## [Iterator tool similar to zip (mesh?)](https://discourse.julialang.org/t/iterator-tool-similar-to-zip-mesh/77137)

<div class="topic-metadata">

**Author:** [@reinermartin](https://discourse.julialang.org/u/reinermartin)\
**Replies:** 23\
**Last updated:** [February 28, 2022, 9:35pm UTC](https://discourse.julialang.org/t/iterator-tool-similar-to-zip-mesh/77137 "2022-02-28T21:35:50Z")

</div>

Sometimes I would find it useful to ‘zip’ or ‘mesh’ two or more iterators in a way that each iterator runs in turn, and once one is exhausted it continues to use the remaining ones. For example, when I want to search thr…

---

## [Approaching Julia coming from Mathematica](https://discourse.julialang.org/t/approaching-julia-coming-from-mathematica/73914)

<div class="topic-metadata">

**Author:** [@Dario-Rosa85](https://discourse.julialang.org/u/Dario-Rosa85)\
**Replies:** 7\
**Last updated:** [January 2, 2022, 2:27pm UTC](https://discourse.julialang.org/t/approaching-julia-coming-from-mathematica/73914 "2022-01-02T14:27:26Z")

</div>

I am a proficient user of Mathematica and I love its functional programming style and its way of programming by means of lists. However, I would like to move most of my programs from Mathematica to Julia. The main reason…

---

## [Can Programming in Julia Be "Pure"?](https://discourse.julialang.org/t/can-programming-in-julia-be-pure/71165)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 13\
**Last updated:** [November 12, 2021, 10:13pm UTC](https://discourse.julialang.org/t/can-programming-in-julia-be-pure/71165 "2021-11-12T22:13:09Z")

</div>

Hi all, I am learning about pure functions. The definition I have is: A pure function is one in which the same result is always produced with no side effects given the same input. This comes from Category Theory for…

---

## [Map and reduce with multiple parameters](https://discourse.julialang.org/t/map-and-reduce-with-multiple-parameters/70109)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 8\
**Last updated:** [October 21, 2021, 4:35am UTC](https://discourse.julialang.org/t/map-and-reduce-with-multiple-parameters/70109 "2021-10-21T04:35:39Z")

</div>

The following Python-to-Julia exercise is taken from https://maryrosecook.com/blog/post/a-practical-introduction-to-functional-programming Generally I am having difficulties with map and reduce when dealing with multip…
