Skip to main content

Questions tagged [functional-programming]

This tag is for challenges related to the functional programming paradigm.

0 votes
4 answers
337 views

A monad is a type that wraps another type, that represents the available operations on the wrapped type. Monads have the following associated operations, where M is ...
bigyihsuan's user avatar
  • 11.5k
10 votes
14 answers
2k views

Task I need a function that accept string and return a function f1. That f1 function should also accept string and return a <...
talex's user avatar
  • 927
24 votes
19 answers
2k views

The golfing language Jelly has a built-in ƭ called "tie", that cycles through a list of functions every time it's called. For example, ...
emanresu A's user avatar
  • 46.2k
3 votes
1 answer
605 views

The goal of this challenge is to compare how well different programming languages support functional programming, by seeing how much code it takes to implement BLC8, the simplest functional ...
John Tromp's user avatar
  • 1,461
12 votes
3 answers
1k views

In this programming-puzzle, your goal is to write the following function in JavaScript, using (essentially) point-free (tacit) programming: (f) => void(f()) ...
rydwolf's user avatar
  • 19.3k
10 votes
6 answers
778 views

A fixed-point combinator is a higher order function \$\mathrm{fix}\$ that returns the fixed point of its argument function. If the function \$f\$ has one or more fixed points, then $$\mathrm{fix} f=f(\...
Legendary Wizard's user avatar
28 votes
19 answers
3k views

Ruby has a strange operator, .., called flip-flop (not to be confused with the range operator, which looks the same). Used in a loop, flip-flop takes two conditions ...
Jordan's user avatar
  • 11.9k
16 votes
14 answers
2k views

The persistence of a number \$x = d_1d_2d_3...d_n\$, with \$d_1 \ne 0\$, under some function \$f : \mathbb N_0 \times \mathbb N_0 \to \mathbb N_0\$ is defined as the number of applications of \$f\$ to ...
caird coinheringaahing's user avatar
11 votes
2 answers
928 views

Curry is the Language of the Month this month and some users are starting to get into it, so let's get some tips together. Haskell and Curry are similar in a lot of ways and a lot of tips for Haskell ...
Wheat Wizard's user avatar
  • 103k
27 votes
44 answers
3k views

The \$\text{argwhere}\$ function takes a list of values and a predicate/boolean function as arguments and returns a list of indices where the predicate function returns true in the input list. For ...
chunes's user avatar
  • 27.8k
18 votes
9 answers
1k views

Background K functions have a feature called projection, which is essentially partial application of values to a function. The syntax for projections is a natural extension of the regular function ...
Bubbler's user avatar
  • 79.3k
7 votes
4 answers
350 views

Background Supplementary reading 1, Supplementary reading 2 Linear lambda calculus is a limited form of lambda calculus, where every bound variable must be used exactly once. For example, ...
Bubbler's user avatar
  • 79.3k
19 votes
16 answers
2k views

Task Haskell's and Scala's standard libraries have an unfold function that builds a list from an initial state s and a function <...
user's user avatar
  • 457
17 votes
2 answers
1k views

Background Lambda calculus is a model of computation using lambda terms. A variable \$x\$ is a lambda term. If \$E\$ is a lambda term, the lambda abstraction \$\lambda x. E\$ is a lambda term. If \$...
Bubbler's user avatar
  • 79.3k
23 votes
46 answers
3k views

Think of cleave as the conceptual inverse of map. If map applies a function to each number in a list... map([1, 2, 3], x -> x * 5) -> ...
chunes's user avatar
  • 27.8k

15 30 50 per page