Content deleted Content added
→Untitled: Reply |
syntaxhighlight & fix lint |
||
Line 59:
In a quick browse to Elm site I could not find how it evaluate functions. Because it transliterate to JavaScript, functions are called by value.
I did the following experiment:
<syntaxhighlight lang="text">
enumFrom : number -> List number
enumFrom n = n :: (enumFrom (n+1))
</syntaxhighlight>
testing the function I got:
<syntaxhighlight lang="text">
> List.take 5 (enumFrom 1)
too much recursion
</syntaxhighlight>
a lazy language (call by need) would eval to:
<syntaxhighlight lang="text">
[1,2,3,4,5]
</syntaxhighlight>
There are more things to fix in this article <!-- Template:Unsigned IP --><small class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/2806:106E:B:AA51:21CD:CEA5:1433:EC66|2806:106E:B:AA51:21CD:CEA5:1433:EC66]] ([[User talk:2806:106E:B:AA51:21CD:CEA5:1433:EC66#top|talk]]) 06:45, 23 November 2021 (UTC)</small> <!--Autosigned by SineBot-->
|