Talk:Elm (programming language): Difference between revisions

Content deleted Content added
Untitled: Reply
Tags: Mobile edit Mobile web edit 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">
<code>
enumFrom : number -> List number
enumFrom n = n :: (enumFrom (n+1))
</syntaxhighlight>
</code>
testing the function I got:
<syntaxhighlight lang="text">
<code>
> List.take 5 (enumFrom 1)
too much recursion
</syntaxhighlight>
</code>
a lazy language (call by need) would eval to:
<syntaxhighlight lang="text">
<code>
[1,2,3,4,5]
</syntaxhighlight>
</code>
There are more things to fix in this article <!-- Template:Unsigned IP --><small class="autosigned">—&nbsp;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-->