Skip to main content

Questions tagged [pure-functions]

For questions about functions that give identical outputs for identical inputs between separate calls and do not have any program-visible side effects.

Filter by
Sorted by
Tagged with
7 votes
3 answers
504 views

How to verify function purity in an imperative language?

A pure function in an imperative language means one with no observable side-effects, which when called multiple times with identical arguments will always return identical results, and which doesn't ...
8 votes
1 answer
302 views

Can total (primitive) corecursion be implemented?

I'm trying to understand how to implement corecursion in a total functional context. I've already implemented recursion using standard techniques (for loops) but I ...
3 votes
3 answers
193 views

What are the downsides, if any, of using implicit function purity in an impure language?

An idea I had for one of my languages recently was this: function purity makes it easier to do certain optimizations. However, the language I'm designing is an impure imperative language that has an ...