I have Haslell Directions and how to make it Ints? : <p>I have Directions and I step 1 like that</p>

<p>THis is the directions:</p>

<pre><code> North (x,y) = (x,y+1)
 East (x,y) = (x+1,y)
South (x,y) = (x, y-1)
 West (x,y) = (x-1, y)
</code></pre>

<p>How to implement like that?</p>

<pre><code>   f13 :: [Dir] -&gt; (Int,Int)
    f13 [North, North]                == (0,2)
    f13 [North, East, South, West]    == (0,0)
    f13 (replicate 10 East)           == (10,0)
</code></pre>

<p>My code:</p>

<pre><code>a = 0
b = 0
f13 :: [Dir] -&gt; (Int,Int)
--f13 xs  = (a,b+1)
f13 xs | xs == North = (a,b+1)
       | xs == East = (a+1,b)
       | xs == South = (a,b-1)
       | xs == West = (a-1,b)
       | otherwise = (a,b)
</code></pre>
