Talk:Y combinator: Difference between revisions
Content deleted Content added
GordonBGood (talk | contribs) →Temporary reversion of a recent Haskell edit: response after reversion... |
GordonBGood (talk | contribs) →Temporary reversion of a recent Haskell edit: report removing non-Y-combinator and a problem with a Haskell Applicative version... |
||
Line 318: | Line 318: | ||
::::As always, I monitor this Talk page and the main page if anyone would like to discuss it...--[[User:GordonBGood|GordonBGood]] ([[User talk:GordonBGood|talk]]) 12:05, 11 October 2018 (UTC) |
::::As always, I monitor this Talk page and the main page if anyone would like to discuss it...--[[User:GordonBGood|GordonBGood]] ([[User talk:GordonBGood|talk]]) 12:05, 11 October 2018 (UTC) |
||
:::::I've been asked to remove the non-Y-combinator versions as off the topic of this task and am in process of doing so. I believe the task should be modified in two ways: 1) to clarify if function recursion is allowed although binding recursion clearly isn't: if function recursion isn't allowed then the second Haskell example wouldn't be allowed either, and 2) it should be noted that, other than as an interesting intellectual exercise, the Y-combinator/Z-combinator is rarely of practical use other than for implementing recursion for languages that don't support it, as for languages that do support recursion (the majority of modern languages at least support function recursion) its use comes at a sometimes major performance cost.--[[User:GordonBGood|GordonBGood]] ([[User talk:GordonBGood|talk]]) 01:47, 13 October 2018 (UTC) |
|||
==Problem with the first non function recursive Haskell version of Y-combinator== |
|||
The first non function recursive implementation of the Y-combinator <code>fix</code> doesn't compile using either GHC version 8.4.3 or 8.6.1 on 64-bit Windows other than in non-optimized interpretive mode (-O0), with an error message about exceeding the "tick count", but increasing this "tick count" immensely doesn't help. Error message as follows: |
|||
<pre>Simplifier ticks exhausted |
|||
When trying UnfoldingDone x_s3FU |
|||
To increase the limit, use -fsimpl-tick-factor=N (default 100). |
|||
If you need to increase the limit substantially, please file a |
|||
bug report and indicate the factor you needed. |
|||
If GHC was unable to complete compilation even with a very large factor |
|||
(a thousand or more), please consult the "Known bugs or infelicities" |
|||
section in the Users Guide before filing a report. There are a |
|||
few situations unlikely to occur in practical programs for which |
|||
simplifier non-termination has been judged acceptable. |
|||
To see detailed counts use -ddump-simpl-stats |
|||
Total ticks: 11445</pre> |
|||
Someone more knowledgeable than I should investigate whether it is possible to modify this to fully compile with optimizations. Without this, the only versions of the Y-combinator usable on current GHC versions are the built-in one using binding recursion or the second version using function recursion posted here--[[User:GordonBGood|GordonBGood]] ([[User talk:GordonBGood|talk]]) 01:47, 13 October 2018 (UTC) |