Some documentation.
[hs-java.git] / Java / ClassPath / Types.hs
index 6efb1553e551af4810fad6005ad365527c0d957a..cffd0eaec41bf86f2ae56800c4c6702367681966 100644 (file)
@@ -6,6 +6,7 @@ import Data.List
 
 import JVM.ClassFile
 
+-- | Directories tree
 data Tree a =
     Directory FilePath [Tree a]
   | File a
@@ -15,11 +16,12 @@ instance Show a => Show (Tree a) where
   show (Directory dir forest) = dir ++ "/{" ++ intercalate ", " (map show forest) ++ "}"
   show (File a) = show a
 
+-- | ClassPath entry
 data CPEntry =
-    NotLoaded FilePath
-  | Loaded FilePath (Class Direct)
-  | NotLoadedJAR FilePath FilePath
-  | LoadedJAR FilePath (Class Direct)
+    NotLoaded FilePath                -- ^ Not loaded .class file
+  | Loaded FilePath (Class Direct)    -- ^ Class loaded from .class file
+  | NotLoadedJAR FilePath FilePath    -- ^ Not loaded .jar file
+  | LoadedJAR FilePath (Class Direct) -- ^ Class loaded from .jar file
   deriving (Eq)
 
 instance Show CPEntry where
@@ -28,5 +30,6 @@ instance Show CPEntry where
   show (NotLoadedJAR jar path) = "<Not loaded JAR: " ++ jar ++ ": " ++ path ++ ">"
   show (LoadedJAR path cls) = "<Read JAR: " ++ path ++ ": " ++ toString (thisClass cls) ++ ">"
 
+-- | ClassPath monad
 type ClassPath a = StateT [Tree CPEntry] IO a