Language.Haskell.GhcMod.HomeModuleGraph

ghc-mod-5.8.0.0: Happy Haskell Hacking

Safe Haskell | None
Language | Haskell2010

Language.Haskell.GhcMod.HomeModuleGraph

Synopsis

- data GmModuleGraph = GmModuleGraph {
  - gmgGraph :: Map ModulePath (Set ModulePath)
  }
- data ModulePath = ModulePath {
  - mpModule :: ModuleName
  - mpPath :: FilePath
  }
- mkFileMap :: Set ModulePath -> Map FilePath ModulePath
- mkModuleMap :: Set ModulePath -> Map ModuleName ModulePath
- mkMainModulePath :: FilePath -> ModulePath
- findModulePath :: HscEnv -> ModuleName -> IO (Maybe ModulePath)
- findModulePathSet :: HscEnv -> [ModuleName] -> IO (Set ModulePath)
- fileModuleName :: (IOish m, GmEnv m, GmState m) => HscEnv -> FilePath -> m (Either [String] (Maybe ModuleName))
- canonicalizeModulePath :: ModulePath -> IO ModulePath
- homeModuleGraph :: (IOish m, Gm m) => HscEnv -> Set ModulePath -> m GmModuleGraph
- updateHomeModuleGraph :: (IOish m, Gm m) => HscEnv -> GmModuleGraph -> Set ModulePath -> Set ModulePath -> m GmModuleGraph
- canonicalizeModuleGraph :: MonadIO m => GmModuleGraph -> m GmModuleGraph
- reachable :: Set ModulePath -> GmModuleGraph -> Set ModulePath
- moduleGraphToDot :: GmModuleGraph -> String

# Documentation

data GmModuleGraph #

Constructors

GmModuleGraph |
Fields gmgGraph :: Map ModulePath (Set ModulePath)

Instances

Eq GmModuleGraph # |
Methods (==) :: GmModuleGraph -> GmModuleGraph -> Bool # (/=) :: GmModuleGraph -> GmModuleGraph -> Bool #
Ord GmModuleGraph # |
Methods compare :: GmModuleGraph -> GmModuleGraph -> Ordering # (<) :: GmModuleGraph -> GmModuleGraph -> Bool # (<=) :: GmModuleGraph -> GmModuleGraph -> Bool # (>) :: GmModuleGraph -> GmModuleGraph -> Bool # (>=) :: GmModuleGraph -> GmModuleGraph -> Bool # max :: GmModuleGraph -> GmModuleGraph -> GmModuleGraph # min :: GmModuleGraph -> GmModuleGraph -> GmModuleGraph #
Read GmModuleGraph # |
Methods readsPrec :: Int -> ReadS GmModuleGraph # readList :: ReadS [GmModuleGraph] # readPrec :: ReadPrec GmModuleGraph # readListPrec :: ReadPrec [GmModuleGraph] #
Show GmModuleGraph # |
Methods showsPrec :: Int -> GmModuleGraph -> ShowS # show :: GmModuleGraph -> String # showList :: [GmModuleGraph] -> ShowS #
Generic GmModuleGraph # |
Associated Types type Rep GmModuleGraph :: * -> * # Methods from :: GmModuleGraph -> Rep GmModuleGraph x # to :: Rep GmModuleGraph x -> GmModuleGraph #
Monoid GmModuleGraph # |
Methods mempty :: GmModuleGraph # mappend :: GmModuleGraph -> GmModuleGraph -> GmModuleGraph # mconcat :: [GmModuleGraph] -> GmModuleGraph #
Binary GmModuleGraph # |
Methods put :: GmModuleGraph -> Put # get :: Get GmModuleGraph # putList :: [GmModuleGraph] -> Put #
type Rep GmModuleGraph # |
type Rep GmModuleGraph = D1 (MetaData "GmModuleGraph" "Language.Haskell.GhcMod.Types" "ghc-mod-5.8.0.0-F8vAdWvD0qS3Xr8veWnSaa" False) (C1 (MetaCons "GmModuleGraph" PrefixI True) (S1 (MetaSel (Just Symbol "gmgGraph") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Map ModulePath (Set ModulePath)))))

data ModulePath #

Constructors

ModulePath |
Fields mpModule :: ModuleName mpPath :: FilePath

Instances

Eq ModulePath # |
Methods (==) :: ModulePath -> ModulePath -> Bool # (/=) :: ModulePath -> ModulePath -> Bool #
Ord ModulePath # |
Methods compare :: ModulePath -> ModulePath -> Ordering # (<) :: ModulePath -> ModulePath -> Bool # (<=) :: ModulePath -> ModulePath -> Bool # (>) :: ModulePath -> ModulePath -> Bool # (>=) :: ModulePath -> ModulePath -> Bool # max :: ModulePath -> ModulePath -> ModulePath # min :: ModulePath -> ModulePath -> ModulePath #
Read ModulePath # |
Methods readsPrec :: Int -> ReadS ModulePath # readList :: ReadS [ModulePath] # readPrec :: ReadPrec ModulePath # readListPrec :: ReadPrec [ModulePath] #
Show ModulePath # |
Methods showsPrec :: Int -> ModulePath -> ShowS # show :: ModulePath -> String # showList :: [ModulePath] -> ShowS #
Generic ModulePath # |
Associated Types type Rep ModulePath :: * -> * # Methods from :: ModulePath -> Rep ModulePath x # to :: Rep ModulePath x -> ModulePath #
Binary ModulePath # |
Methods put :: ModulePath -> Put # get :: Get ModulePath # putList :: [ModulePath] -> Put #
type Rep ModulePath # |
type Rep ModulePath = D1 (MetaData "ModulePath" "Language.Haskell.GhcMod.Types" "ghc-mod-5.8.0.0-F8vAdWvD0qS3Xr8veWnSaa" False) (C1 (MetaCons "ModulePath" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "mpModule") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 ModuleName)) (S1 (MetaSel (Just Symbol "mpPath") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 FilePath))))

mkFileMap :: Set ModulePath -> Map FilePath ModulePath #

mkModuleMap :: Set ModulePath -> Map ModuleName ModulePath #

mkMainModulePath :: FilePath -> ModulePath #

findModulePath :: HscEnv -> ModuleName -> IO (Maybe ModulePath) #

findModulePathSet :: HscEnv -> [ModuleName] -> IO (Set ModulePath) #

fileModuleName :: (IOish m, GmEnv m, GmState m) => HscEnv -> FilePath -> m (Either [String] (Maybe ModuleName)) #

canonicalizeModulePath :: ModulePath -> IO ModulePath #

homeModuleGraph :: (IOish m, Gm m) => HscEnv -> Set ModulePath -> m GmModuleGraph #

updateHomeModuleGraph #

Arguments

:: (IOish m, Gm m) |
=> HscEnv |
-> GmModuleGraph |
-> Set ModulePath | Initial set of modules
-> Set ModulePath | Updated set of modules
-> m GmModuleGraph |

canonicalizeModuleGraph :: MonadIO m => GmModuleGraph -> m GmModuleGraph #

reachable :: Set ModulePath -> GmModuleGraph -> Set ModulePath #

moduleGraphToDot :: GmModuleGraph -> String #

Turn module graph into a graphviz dot file

    dot -Tpng -o modules.png modules.dot