By the definition closures are
Scala Closures are functions which use one or more free variables and the return value of this function is dependent of these variable. The free variables are defined outside of the Closure Function and is not included as a parameter of this function.
and the definition of a pure function is
A pure function is a function that depends only on its declared inputs and its internal algorithm to produce its output. It does not read any other values from “the outside world” — the world outside of the function's scope — and it does not modify any values in the outside world.
when functional programming is all about writing code in terms of pure functions,: how come concept like closure is justified in functional programming
please help to clear the understanding