I couldn’t resist a catchy title for this one, as CIS 194 is all about lazy evaluation, which in turn can be used to create (virtually) infinite data structures.
Recently I started wondering how Boolean algebra actually worked in Hy. I knew that we followed usual Python conventions and was sort of aware of them, but decided to dig into deeper and see how things actually are.
Granted, Boolean algebra maybe doesn’t sound the most exciting subject, but I found the results interesting. This post looks into things if Python 3.4 and 0.12.1 development version of Hy are used.
Many games feature iron man mode where saving is limited in a way or another in order to make the game more exciting or real. You can’t go back in your decisions in the real life either, or can you?
4th week of CIS 194 got into meat of functional programming: higher order functions. These are functions that either take other functions as parameters or return functions when called. While I was very familiar with them before, Haskell has neat trick in the sleeve for them. Topics covered included anonymous functions, function composition, partial application and folds (again).
Week 3 of CIS 194 was about how to abstract different kinds of recursion patterns with help of map, folds and filter. As a side note, polymorphism was touched upon to show how to define functions that work on several different kinds of data types. Prelude (one of the standard modules of Haskell) was mentioned and encouraged to be explored a bit. Finally total and partial functions were discussed and their differences outlined.