Questions tagged [fixpoint-combinators]

Questions about fixed-point combinators, used to encode recursion. For fixed-point arithmetic, use [fixed-point] instead. For the numerical method, used [fixed-point-iteration] instead.

A fixed-point (or fixpoint) combinator produces fixed points of functions given to it. If fix is such a combinator, we have fix f = f (fix f).

The best known fixpoint combinator is the Y combinator, which makes it possible to encode recursive definitions in the untyped lambda calculus. It has its own tag, . Another example is Haskell's fix function, which is of necessity different from the Y combinator (see Y Combinator in Haskell).

There are also type-level fixpoint combinators, such as Haskell's Fix type constructor, which also fall under the scope of this tag. When these are concerned, depending on the focus of the question it may be appropriate to use or in addition to, or instead of, .

77 questions
-1
votes
1 answer

Haskell List function (map, zip, etc..) with fix

I try to learn haskell and have exercise -try to rewrite standart list operation(map, foldr, zip, iterate, etc.) with function fix. I have example with repeat: repeat a = fix $ \xs -> a : xs and it's further simplify repeat a = fix (a:) repeat =…
VengeQ
  • 1
  • 1
-8
votes
2 answers

Tricky factorial in Haskell

Is there is a way to create function to calculate factorial in Haskell, using the following function: fix f = f (fix f)
1 2 3 4 5
6