diff options
Diffstat (limited to 'src/Grasp/Types.hs')
-rw-r--r-- | src/Grasp/Types.hs | 41 |
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) + |