Two Vexing Problems in Functional Programming
I&#x27;ve been coding in functional languages for 10 years, and they have problems, but these are not them.<p>The first problem is solved in every functional language I&#x27;ve used (clojure, F#, OCaml) by immutable data structures (aka purely functional data structures, which is also the name of the de facto book on the topic, which is excellent but also you don&#x27;t need to know any of this to use them. [1]). I&#x27;m surprised to see this critique without a mention of this.<p>The second problem seems to be due to trying to do OO in FP. The thing is you don&#x27;t have a glyph, you have a whole system which contains glyphs. So you can&#x27;t do an update on a glyph because it won&#x27;t update the system.<p>This is a common frustration when you&#x27;re used to OO and can be really annoying in FP but it&#x27;s also part of the design modelling that FP forces you to do: the problem was that he was modeling in the small and not the large.<p>The solution is not the 1, 2, or 3 from the article (1 and 2 are bad, 3 is not as bad but not FP), but is straightforward. When you want to update a glyph, you use a function like `updateGlyph(pathToGlyph, functionToExecuteOnGlyph)`. That&#x27;s at the top-level, and it allows you compose your lower level `updateGlyph` functions.<p>[1] <a href="https:&#x2F;&#x2F;citeseerx.ist.psu.edu&#x2F;viewdoc&#x2F;download?doi=10.1.1.64.3080&amp;rep=rep1&amp;type=pdf" rel="nofollow">https:&#x2F;&#x2F;citeseerx.ist.psu.edu&#x2F;viewdoc&#x2F;download?doi=10.1.1.64...</a>