title: Haskell getter of data type
body: <p>Basically, I have 2 different structures - Point and Cell. Since there is an aggregation between them, I would like to somehow get the value of the Point just by having the cell - let's say at a moment, I only have a cell but I wish to get its location.
  Like this <code>a = Wall(Point(1,2)</code>. Can I somehow get it? Like <code>a.point</code>? And if so, can I get <code>x</code> and <code>y</code> somehow like this?  <code>a.point.x</code>.</p>
  
  <pre><code>data Point = Point(Int, Int) -- y, x
  instance Show Point where
    show (Point(x, y)) = "(" ++ show x ++ "," ++ show y ++ ")"
  
  data Cell = Wall(Point) | Path(Point) | Start(Point) | End(Point)
  instance Show Cell where
    show (Wall(Point(x, y))) = "X"
    show (Path(Point(x, y))) = "("++show x ++ "," ++ show y ++ ")"
    show (Start(Point(x, y))) = "S"
    show (End(Point(x, y))) = "E"
  </code></pre>