Leveraging Algebraic Data Types – In Any Programming Language (bobkonf2020)


Feb 28 2020 44 mins   2
In functional programming languages, Algebraic Data Types and Pattern Matching are ubiquitous, and they are a very powerful and expressive tool. Unfortunately, many mainstream languages, especially in the object-oriented spectrum, lack these features and resort to rather cumbersome subtyping and inheritance. But not all is lost! Leveraging an old GoF pattern together with Lambda syntax that by now has spread to most modern programming languages, we can emulate ADTs and pattern matching in virtually any programming language. Applications range from implementation of standard ADTs like `Maybe`, Tuples and `Either` over standard functional data structures like Linked Lists and Fingertrees, up to complex structures like ASTs or DSLs. about this event: https://bobkonf.de/2020/thoma.html