Flix (programming language): Difference between revisions

Content deleted Content added
Link to DAB page repaired
Polymorphic effects: 2x dab-needed tag
Line 175:
The requirement that <code>f</code> must be impure ensures that the code makes sense: It would be meaningless to call <code>List.foreach</code> with a pure function since it always returns <code>Unit</code>.
 
The type and effect is [[sound]]{{dn|date=January 2021}}, but not [[complete]]{{dn|date=January 2021}}. That is, if a function is pure then it ''cannot'' cause an effect, whereas if a function is impure then it ''may'', but not necessarily, cause an effect. For example, the following expression is impure even though it cannot produce an effect at run-time:
 
<syntaxhighlight lang="flx">