Get the latest tech news
Types as Interfaces
For the past few days, I have been toying with an idea for a board game. To test it out, I wanted to write a simple implementation of it.
In that phase, values of this type need to be communicated back and forth between players in a unicast fashion, so we might want to add fields to indicate who sent it and who received it. Image data might be stored in a tga file with headers giving information on how to interpret it. does a switch hold up an ethernet frame to the light and ask, “So what http content type are you transmitting?” We have designed these protocols to be layered with meaningful structure from outside to in.
Or read this on Hacker News