[Haskell-beginners] represent data sturcture using function