ezyang’s blog

the arc of software bends towards understanding

Implementing the Haskell Heap in Python, v1

New to the series? Go to the beginning. Here is a simple implementation of all of the parts of the Haskell heap we have discussed up until now, ghosts and all. heap = {} # global # ---------------------------------------------------------------------# class Present(object): # Thunk def __init__(self, ghost): self.ghost = ghost # Ghost haunting the present self.opened = […]

  • April 25, 2011