2 module Java.ClassPath.Types where
4 import Control.Monad.State
10 Directory FilePath [Tree a]
14 instance Show a => Show (Tree a) where
15 show (Directory dir forest) = dir ++ "/{" ++ intercalate ", " (map show forest) ++ "}"
16 show (File a) = show a
20 | Loaded FilePath (Class Direct)
21 | NotLoadedJAR FilePath FilePath
22 | LoadedJAR FilePath (Class Direct)
25 instance Show CPEntry where
26 show (NotLoaded path) = "<Not loaded file: " ++ path ++ ">"
27 show (Loaded path cls) = "<Loaded from " ++ path ++ ": " ++ toString (thisClass cls) ++ ">"
28 show (NotLoadedJAR jar path) = "<Not loaded JAR: " ++ jar ++ ": " ++ path ++ ">"
29 show (LoadedJAR path cls) = "<Read JAR: " ++ path ++ ": " ++ toString (thisClass cls) ++ ">"
31 type ClassPath a = StateT [Tree CPEntry] IO a