This year LambdaDays, hosted in beautiful Kraków, Poland, were themed around teaching functional programming and trends in functional programming. The vibe was more formal than the ZuriHack we went to this June with Tomasz. Anyway, we attended a few interesting talks that sparked discussions later. Here is my subjective and non-exhaustive list of the teaching insights and new things to learn from the LambdaDays lectures.
By an interface I understand an object (in a general sense) that abstracts out operations common for some concrete objects. In fact, those concrete objects may be defined by “having certain operations”. Example of such interface from mathematics is a vector V space over a field K, having:
Among concrete classes of vector space, we have a coordinate space and space of all continuous functions. The interface definition may be used both ways - to construct an object that is a vector space and to check if an existing object fulfills the criteria and is therefore a vector space.
Writing software usually involves abstracting out some parts of code to a common interface. Following Real Python article we will explore using different implementation of interfaces in Python and see how they relate to interface defined above.
The story begins with writing a test that checks if two boolean expressions are the same.
A boolean expressions may not be easy to transform to canonical form and the code that was being tested did not ensure a canonical form of the statements.
In such situation, writing a “brute force” algorithm that checks if statement A and B result in the same Bool value for all possible combinations of Bool values was the best idea. As a part of the solution, an algorithm that generates a list of lists of all possible combinations of True/False for an arbitrary list length n was needed.
Bool
True
False
n
From time to time I come across the code that triggers thoughts like: “oh, it would be much simpler in Haskell”, “why author did not use more functional style” or “f*ing mutability”. The last is usually related to hard to track bugs…
We were thinking about making a blog for a long time. As we gathered more and more experience, we think that the right time come.