[Haskell-beginners] explaining effects (was: Doubts about functional programming paradigm)

Daniel Bergey bergey at alum.mit.edu
Sat Dec 12 13:38:44 UTC 2015


I have pedagogical questions.  Why do you prefer "effect" to "side
effect"?  I know that "pure" is misleading to programmers new to
Haskell, but I have thought that "side effect" was more likely to be
self-explanatory.

I also reach for longer phrases like "free from side effects" if I'm
talking to my students.

cheers,
bergey

On 2015-12-11 at 16:36, Christopher Allen <cma at bitemyapp.com> wrote:
> Side bar: although using "pure" with respect to effects is the common usage
> now, I'd urge you to consider finding a different wording since the
> original (and IMHO more meaningful) denotation of pure functional
> programming was about semantics and not the presence or absence of effects.
> The meaning was that you had a programming language whose semantics were
> lambda-calculus-and-nothing-more. This can be contrasted with ML where the
> lambda calculus is augmented with an imperative language that isn't
> functional or a lambda calculus. Part of the problem with making purity
> about effects rather than semantics is the terrible imprecision confuses
> new people. They'll often misunderstand it as, "Haskell programs can't
> perform effects" or they'll think it means stuff in "IO" isn't pure - which
> is false. We benefit from having a pure functionalal programming language
> _especially_ in programs that emit effects. Gabriel Gonzalez has a nice
> article demonstrating some of this:
> http://www.haskellforall.com/2015/03/algebraic-side-effects.html
>
> When I want to talk about effects, I say "effect". When I want to say
> something that doesn't emit effects, I say "effect-free" and when it does,
> "effectful". Sometimes I'll say "in IO" for the latter as well, where "in
> IO" can be any type that has IO in the outermost position of the final
> return type.


More information about the Beginners mailing list