summaryrefslogtreecommitdiff
path: root/src/Grasp/Types.hs
diff options
context:
space:
mode:
authorJed Barber <jjbarber@y7mail.com>2014-05-02 15:20:24 +1000
committerJed Barber <jjbarber@y7mail.com>2014-05-02 15:20:24 +1000
commit62d12ce058f61577aeb17adc5619eef449eac79b (patch)
tree4130f592de214ab2f81d8d0700e6d9f44f128531 /src/Grasp/Types.hs
parent4b0fd5fe80607e1487659acfdc51cc95a1b7effe (diff)
Separated GraspProgram type and associated functions into own module
Diffstat (limited to 'src/Grasp/Types.hs')
-rw-r--r--src/Grasp/Types.hs41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/Grasp/Types.hs b/src/Grasp/Types.hs
new file mode 100644
index 0000000..0211281
--- /dev/null
+++ b/src/Grasp/Types.hs
@@ -0,0 +1,41 @@
+module Grasp.Types (
+ GraspProgram(..),
+
+ nodesWithName,
+ normalise,
+ iso
+ ) where
+
+
+import Data.Graph.Inductive.Graph( Node, LNode, LEdge, (&) )
+import qualified Data.Graph.Inductive.Graph as Graph
+import Data.Graph.Inductive.Tree
+import Data.List
+
+
+
+
+type GraspProgram = Gr String String
+
+
+
+instance (Ord a, Ord b) => Eq (Gr a b) where
+ a == b = ((sort . Graph.labNodes $ a) == (sort . Graph.labNodes $ b)) &&
+ ((sort . Graph.labEdges $ a) == (sort . Graph.labEdges $ b))
+
+
+
+
+nodesWithName :: GraspProgram -> String -> [LNode String]
+nodesWithName g s = []
+
+
+
+normalise :: GraspProgram -> GraspProgram
+normalise g = Graph.mkGraph [] []
+
+
+
+iso :: GraspProgram -> GraspProgram -> Bool
+iso a b = (normalise a) == (normalise b)
+