aboutsummaryrefslogtreecommitdiff
path: root/src/Distribution/Haddock.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Distribution/Haddock.hs')
-rw-r--r--src/Distribution/Haddock.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Distribution/Haddock.hs b/src/Distribution/Haddock.hs
new file mode 100644
index 00000000..c6e2dd3b
--- /dev/null
+++ b/src/Distribution/Haddock.hs
@@ -0,0 +1,17 @@
+module Distribution.Haddock (
+ readInterfaceFile,
+ H.writeInterfaceFile,
+ H.InterfaceFile
+) where
+
+import Haddock.Exception
+import qualified Haddock.InterfaceFile as H
+
+import Control.Exception
+import Control.Monad
+
+readInterfaceFile :: FilePath -> IO (Either String H.InterfaceFile)
+readInterfaceFile f =
+ liftM Right (H.readInterfaceFile f)
+ `catchDyn`
+ (\(e::HaddockException) -> return $ Left $ show e)