I had an impartial haskell implementation