A Haskell implementation of a Rete algorithm