Building a Z-Machine in the worst possible language

In which a 1980s virtual machine for text adventures is reimplemented in a pure functional language, against all better judgement, and somehow emerges working.