summaryrefslogtreecommitdiff
path: root/src/Grasp/IP.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-12-06 00:32:49 +1100
committerJed Barber <jjbarber@y7mail.com>2014-12-06 00:32:49 +1100
commitd3a9803cf89ea94975934dd8abb18bbc12408a7e (patch)
tree321ddb45e29a10d3dc1cd1c0ac9387d447db5afc /src/Grasp/IP.hs
parent2aa0bab498cffbc12d485d2c59f7aed04c69c409 (diff)
All newtype stubs now in their own files in their own subdir
Diffstat (limited to 'src/Grasp/IP.hs')
-rw-r--r--src/Grasp/IP.hs47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/Grasp/IP.hs b/src/Grasp/IP.hs
deleted file mode 100644
index 4f042a1..0000000
--- a/src/Grasp/IP.hs
+++ /dev/null
@@ -1,47 +0,0 @@
-module Grasp.IP (
- IP,
-
- singleton,
- empty,
- isEmpty,
- peek,
- push,
- pop,
- shift
- ) where
-
-
-
-
-import Grasp.GNode( GNode )
-
-
-
-
-newtype IP = IP [GNode]
- deriving (Eq, Show)
-
-
-
-
-singleton :: GNode -> IP
-singleton n = IP [n]
-
-empty :: IP
-empty = IP []
-
-isEmpty :: IP -> Bool
-isEmpty (IP p) = (length p == 0)
-
-peek :: IP -> Maybe GNode
-peek (IP p) = if (length p == 0) then Nothing else Just (head p)
-
-push :: GNode -> IP -> IP
-push n (IP p) = IP (n:p)
-
-pop :: IP -> IP
-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))
-