summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Grasp/IP.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Grasp/IP.hs b/src/Grasp/IP.hs
index 6a4d452..294c92d 100644
--- a/src/Grasp/IP.hs
+++ b/src/Grasp/IP.hs
@@ -6,7 +6,8 @@ module Grasp.IP (
isEmpty,
peek,
push,
- pop
+ pop,
+ shift
) where
@@ -39,5 +40,8 @@ push :: GNode -> IP -> IP
push n (IP p) = IP (n:p)
pop :: IP -> IP
-pop (IP p) = if (length p == 0) then IP p else IP (tail p)
+pop (IP p) = if (length p == 0) then empty else IP (tail p)
+
+shift :: GNode -> IP -> IP
+shift n (IP p) = if (length p == 0) then empty else IP (n:(tail p))