diff options
author | Jed Barber <jjbarber@y7mail.com> | 2014-11-21 19:04:03 +1100 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2014-11-21 19:04:03 +1100 |
commit | d0cab364562ba696dfd5396a10b698de6a1a5f02 (patch) | |
tree | 5f5b1c21f6a546a26571f457442766d7a7497ed5 /src/Grasp/Node.hs | |
parent | 0c49b3f13dc00eb5811002f230e1a6e4cc52d705 (diff) |
Incorporated Grasp.Edge and Grasp.Node into the one Grasp.Graph module, loosely based on Data.Graph.Inductive.Graph
Diffstat (limited to 'src/Grasp/Node.hs')
-rw-r--r-- | src/Grasp/Node.hs | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/src/Grasp/Node.hs b/src/Grasp/Node.hs deleted file mode 100644 index ce84163..0000000 --- a/src/Grasp/Node.hs +++ /dev/null @@ -1,47 +0,0 @@ -module Grasp.Node ( - GNode, - GNodeType, - - singleton, - uSingleton, - fromStringList, - lab, - inst, - idNo - ) where - - - -import Data.Graph.Inductive.Graph( LNode ) -import Data.Map( Map ) -import qualified Data.Map as Map - - - -type GNode = LNode (Maybe String, String) -type GNodeType = (Maybe String, String) - - - -singleton :: Int -> String -> String -> GNode -singleton i m s = (i,(Just m,s)) - -uSingleton :: Int -> String -> GNode -uSingleton i s = (i,(Nothing,s)) - -fromStringList :: Map String Int -> [(String,String)] -> [GNode] -fromStringList m ns = - let change x = case (Map.lookup x m) of - Just a -> a - Nothing -> error "Grasp.Node.fromStringList: no value for key " ++ x - in map (\(x,y) -> (change x, (Just x, y))) ns - -lab :: GNode -> Maybe String -lab (_,(x,_)) = x - -inst :: GNode -> String -inst (_,(_,x)) = x - -idNo :: GNode -> Int -idNo (x,(_,_)) = x - |