ZDD implementation in Haskell