From 73c926bed24e4dabe8efc3acc9b2a892c680bacd Mon Sep 17 00:00:00 2001 From: Jed Barber Date: Thu, 18 Dec 2014 10:15:29 +1100 Subject: IPs changed to be lists of Nodes instead of GNodes --- src/Grasp/Types/IP.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Grasp/Types/IP.hs') diff --git a/src/Grasp/Types/IP.hs b/src/Grasp/Types/IP.hs index a548cc3..8f7a74f 100644 --- a/src/Grasp/Types/IP.hs +++ b/src/Grasp/Types/IP.hs @@ -15,18 +15,18 @@ module Grasp.Types.IP ( -import Grasp.Types.GNode( GNode ) +import Grasp.Graph( Node ) -newtype IP = IP [GNode] +newtype IP = IP [Node] deriving (Eq, Show) -singleton :: GNode -> IP +singleton :: Node -> IP singleton n = IP [n] empty :: IP @@ -35,18 +35,18 @@ empty = IP [] isEmpty :: IP -> Bool isEmpty (IP p) = (length p == 0) -peek :: IP -> Maybe GNode +peek :: IP -> Maybe Node peek (IP p) = if (length p == 0) then Nothing else Just (head p) -push :: GNode -> IP -> IP +push :: Node -> 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 :: Node -> IP -> IP shift n (IP p) = if (length p == 0) then empty else IP (n:(tail p)) -toList :: IP -> [GNode] +toList :: IP -> [Node] toList (IP p) = p -- cgit