News for hackers. Stuff that matters.
Re:What are potential disadvantages of functional programming? by anaphor on Thursday July 27, 2017 @10:39PM (#14871515)
I was planning on mentioning it as soon as I saw this post as well. I think most people who try using a functional programming language that encourages you to use sum types (at least when you're beginning) run into this in some way, but most people probably aren't aware that it has an actual name.

Here's a post on solving it using type classes in Haskell, if people are curious! http://koerbitz.me/posts/Solving-the-Expression-Problem-in-H...

Re:What are potential disadvantages of functional programming? by jfoutz on Thursday July 27, 2017 @10:43PM (#14871538)
I was going to link the same article!

I think the interesting part is the similarity between haskell and clojure. Essetially programming to very small classes/protocols. The linked article is cool, because i think the java approach would generalize to the OP's C++ solution, and be able to eliminate that gross dynamic cast.