Purely functional data structure: Difference between revisions

Content deleted Content added
more precise: technically you ''can'' implement a non-purely-functional data structure by modeling state in some way (e.g. in the IO monad)
Line 15:
In order to ensure that a data structure is used in a purely functional way in an impure functional language, [[modular programming|modules]] or [[class (computer programming)|classes]] can be used to ensure manipulation via authorized functions only.{{citation needed|date=December 2018}}
 
==Using Purelypurely Functionalfunctional Datadata Structuresstructures==
One of the central challenges in adapting existing code to use purely functional data structures lies in the fact that mutable data
structures provide "hidden outputs" for functions that use them. Rewriting these functions to use purely functional data structures