diff --git a/exception-hierarchy.cabal b/exception-hierarchy.cabal
--- a/exception-hierarchy.cabal
+++ b/exception-hierarchy.cabal
@@ -2,7 +2,7 @@
 cabal-version: >= 1.10
 
 name: exception-hierarchy
-version: 0.1.0.8
+version: 0.1.0.9
 stability: Experimental
 author: Yoshikuni Jujo <PAF01143@nifty.ne.jp>
 maintainer: Yoshikuni Jujo <PAF01143@nifty.ne.jp>
diff --git a/src/Control/Exception/Hierarchy.hs b/src/Control/Exception/Hierarchy.hs
--- a/src/Control/Exception/Hierarchy.hs
+++ b/src/Control/Exception/Hierarchy.hs
@@ -65,8 +65,9 @@
 	where
 	he = ec
 	ec' = toLowerH $ nameBase ec
-	toEx = mkName $ ec' ++ "ToException"
-	fromEx = mkName $ ec' ++ "FromException"
+	ec'' = maybe ec' (++ ('.' : ec')) $ nameModule ec
+	toEx = mkName $ ec'' ++ "ToException"
+	fromEx = mkName $ ec'' ++ "FromException"
 	e = mkName "e"
 	se = mkName "se"
 	d = mkName "d"
@@ -85,8 +86,9 @@
 		valD (varP $ mkName "fromException") (normalB $ varE fe) [] ]
 	where
 	ec' = toLowerH $ nameBase ec
-	te = mkName $ ec' ++ "ToException"
-	fe = mkName $ ec' ++ "FromException"
+	ec'' = maybe ec' (++ ('.' : ec')) $ nameModule ec
+	te = mkName $ ec'' ++ "ToException"
+	fe = mkName $ ec'' ++ "FromException"
 
 toLowerH :: String -> String
 toLowerH (c : cs) = toLower c : cs
