Using types to keep yourself honest

A very interesting post on design and Swift language features. The problem is to represent a Matrix and support the multiply operation on matrices. Starting with the simplest solution but then trying to find the right way to make sure that compilation will fail if 2 matrices can’t be multiplied.
http://matthijshollemans.com/2016/03/25/using-types-to-keep-yourself-honest/

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s