data structures implementation in haskell