Object oriented Haskell

This week’s most exciting announcement is that I am learning a bit of object-oriented programming and how that translates into Haskell.

Timepieces

The Timepieces course has a new lesson. This week’s lesson focuses on a relatively small task – resizing a window – in order to better understand the widget hierarchy of FLTK. How can we pass a Ref DoubleWindow to a function that expects a Ref Group argument? Those aren’t the same type! But the author of fltkhs went to great lengths to preserve the workings of the inheritance and “overloading” of functions that the original library has. As a native Haskeller, I found it difficult to think about – so I wrote about it! Next week, we’ll integrate some of the time and stm work that Chris did in the gtk3 clock app in order to modify our fltkhs clock to display a different time than our system time.

Web Servers

Chris is back with the penultimate lesson of the Web Servers course. This week’s lesson focuses on parsing message bodies, and we also learn to read from sockets. Now that the server we’ve been building is capable of understanding requests, we’ve finished laying the groundwork for a web server that can do useful things.

More underscores

We also discovered a new use for the humble underscore – in numeric literals. A GHC language extension called NumericUnderscores allows you to put underscores as place markers – the way you might use a comma or dot in large numbers like 1,000,000 – in numeric literals.

Enjoy! Because, honestly, we’re freezing up here.