diff --git a/Adelie/Colour.hs b/Adelie/Colour.hs
--- a/Adelie/Colour.hs
+++ b/Adelie/Colour.hs
@@ -15,7 +15,7 @@
     off2
 ) where
 
-import Monad (when)
+import Control.Monad (when)
 
 import Adelie.Options
 
diff --git a/Adelie/CompareVersion.hs b/Adelie/CompareVersion.hs
--- a/Adelie/CompareVersion.hs
+++ b/Adelie/CompareVersion.hs
@@ -4,7 +4,7 @@
 
 module Adelie.CompareVersion (compareVersion) where
 
-import Char (isDigit)
+import Data.Char (isDigit)
 
 import Adelie.ListEx (digitsToInt)
 
diff --git a/Adelie/Contents.hs b/Adelie/Contents.hs
--- a/Adelie/Contents.hs
+++ b/Adelie/Contents.hs
@@ -11,8 +11,9 @@
   readContents
 ) where
 
-import Char (isDigit, isHexDigit, isSpace)
-import IO
+import Data.Char (isDigit, isHexDigit, isSpace)
+import qualified Adelie.Error as E
+import System.IO
 
 import Adelie.Colour
 import Adelie.ListEx
@@ -33,15 +34,15 @@
 
 readContents :: (Contents -> a -> IO (Bool, a)) -> FilePath -> a -> IO a
 readContents f fn a = do
-  r <- try read'
+  r <- E.try read'
   case r of
     Left  _  -> return a
     Right a' -> return a'
   where
     read' =
-      bracket (openFile fn ReadMode)
-              hClose
-              (readContents' f a)
+      E.bracket (openFile fn ReadMode)
+                hClose
+                (readContents' f a)
 
 readContents' :: (Contents -> a -> IO (Bool, a)) -> a -> Handle -> IO a
 readContents' f a fp = do
diff --git a/Adelie/Error.hs b/Adelie/Error.hs
new file mode 100644
--- /dev/null
+++ b/Adelie/Error.hs
@@ -0,0 +1,15 @@
+-- Module to wrap all exception code
+-- TODO: distinct different kinds of error in own datatype
+
+module Adelie.Error
+    ( try
+    , bracket
+) where
+
+import qualified Control.Exception.Extensible as E
+
+try :: IO a -> IO (Either E.SomeException a)
+try = E.try
+
+bracket :: IO a -> (a -> IO b) -> (a -> IO c) -> IO c
+bracket = E.bracket
diff --git a/Adelie/ListEx.hs b/Adelie/ListEx.hs
--- a/Adelie/ListEx.hs
+++ b/Adelie/ListEx.hs
@@ -12,9 +12,9 @@
   pad
 ) where
 
-import Char       (digitToInt)
-import Data.List  (foldl')
-import Monad      (liftM)
+import Data.Char (digitToInt)
+import Data.List (foldl')
+import Control.Monad (liftM)
 
 ----------------------------------------------------------------
 
diff --git a/Adelie/Options.hs b/Adelie/Options.hs
--- a/Adelie/Options.hs
+++ b/Adelie/Options.hs
@@ -1,5 +1,4 @@
-{-# OPTIONS -fglasgow-exts #-}
-
+{-# LANGUAGE ForeignFunctionInterface #-}
 -- Options.hs
 --
 -- We keep some globals in C so we don't have to pass them around everywhere.
diff --git a/Adelie/Provide.hs b/Adelie/Provide.hs
--- a/Adelie/Provide.hs
+++ b/Adelie/Provide.hs
@@ -7,7 +7,7 @@
   readProvide
 ) where
 
-import Monad (liftM)
+import Control.Monad (liftM)
 
 import Adelie.Portage
 
diff --git a/Adelie/QChangelog.hs b/Adelie/QChangelog.hs
--- a/Adelie/QChangelog.hs
+++ b/Adelie/QChangelog.hs
@@ -7,8 +7,8 @@
   qLogFile
 ) where
 
-import Char   (isDigit, isSpace)
-import Monad  (unless)
+import Data.Char (isDigit, isSpace)
+import Control.Monad (unless)
 
 import Adelie.Colour
 import Adelie.CompareVersion
diff --git a/Adelie/QCheck.hs b/Adelie/QCheck.hs
--- a/Adelie/QCheck.hs
+++ b/Adelie/QCheck.hs
@@ -4,8 +4,8 @@
 
 module Adelie.QCheck (qCheck) where
 
-import Char               (isHexDigit)
-import IO
+import Data.Char          (isHexDigit)
+import System.IO
 
 import System.Process     (runProcess, waitForProcess, ProcessHandle)
 import System.Posix.Files (getFileStatus)
@@ -13,6 +13,7 @@
 
 import Adelie.Colour
 import Adelie.Contents
+import qualified Adelie.Error as E
 import Adelie.Portage
 import Adelie.Pretty
 
@@ -37,7 +38,7 @@
 check' (Dir _) (g, b) = return (False, (g+1, b))
 
 check' (Obj o m _) (g, b) = do
-  r <- try (getFileStatus o)
+  r <- E.try (getFileStatus o)
   case r of
     Left _e -> do
       inRed (putStr "!!! ") >> putStr o >> putStrLn " does not exist"
diff --git a/Adelie/QHasUse.hs b/Adelie/QHasUse.hs
--- a/Adelie/QHasUse.hs
+++ b/Adelie/QHasUse.hs
@@ -4,7 +4,7 @@
 
 module Adelie.QHasUse (qHasUse) where
 
-import Monad (when)
+import Control.Monad (when)
 
 import Adelie.Colour
 import Adelie.Portage
diff --git a/Adelie/QOwn.hs b/Adelie/QOwn.hs
--- a/Adelie/QOwn.hs
+++ b/Adelie/QOwn.hs
@@ -7,8 +7,8 @@
   qOwnRegex
 ) where
 
-import List       (delete)
-import Monad      (when)
+import Data.List (delete)
+import Control.Monad (when)
 import Text.Regex (Regex, matchRegex, mkRegex)
 
 import Adelie.Contents
diff --git a/Adelie/QSize.hs b/Adelie/QSize.hs
--- a/Adelie/QSize.hs
+++ b/Adelie/QSize.hs
@@ -4,14 +4,14 @@
 
 module Adelie.QSize (qSize) where
 
-import Directory            (doesDirectoryExist)
-import IO                   (try)
-import Monad                (mapM_, when)
+import System.Directory     (doesDirectoryExist)
+import Control.Monad        (when)
 import System.Posix.Files   (fileSize, getFileStatus)
 import System.Posix.Types   (FileOffset)
 
 import Adelie.Colour
 import Adelie.Contents
+import qualified Adelie.Error as E
 import Adelie.Portage
 import Adelie.Pretty
 
@@ -48,7 +48,7 @@
     else return (False, (s,w,x,y,z+1)) 
 
 count (Obj o _ _) (s,w,x,y,z) = do
-  r <- try (getFileStatus o)
+  r <- E.try (getFileStatus o)
   case r of
     Left _err -> return (False, (s, w, x, y, z+1))
     Right st -> return (False, (s+fileSize st, w, x+1, y, z))
diff --git a/Adelie/QUse.hs b/Adelie/QUse.hs
--- a/Adelie/QUse.hs
+++ b/Adelie/QUse.hs
@@ -5,7 +5,7 @@
 module Adelie.QUse (qUse) where
 
 import Data.HashTable as HashTable
-import Monad (mapM_, unless)
+import Control.Monad (unless)
 
 import Adelie.Colour
 import Adelie.ListEx
diff --git a/Adelie/Use.hs b/Adelie/Use.hs
--- a/Adelie/Use.hs
+++ b/Adelie/Use.hs
@@ -10,8 +10,8 @@
   readIUse
 ) where
 
-import List   (nub, sort)
-import Monad  (liftM)
+import Data.List (nub, sort)
+import Control.Monad (liftM)
 
 import Adelie.Portage
 
diff --git a/Adelie/UseDesc.hs b/Adelie/UseDesc.hs
--- a/Adelie/UseDesc.hs
+++ b/Adelie/UseDesc.hs
@@ -8,9 +8,9 @@
   readUseDescPackage
 ) where
 
-import Char (isSpace)
+import Data.Char (isSpace)
 import Data.HashTable as HashTable
-import Monad (when)
+import Control.Monad (when)
 
 import Adelie.ListEx
 import Adelie.Portage
diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -4,7 +4,7 @@
 
 module Main (main) where
 
-import System (getArgs, getProgName)
+import System.Environment (getArgs, getProgName)
 
 import Adelie.Colour
 import Adelie.Options
diff --git a/TODO b/TODO
--- a/TODO
+++ b/TODO
@@ -1,4 +1,4 @@
  * make fquery a drop-in replacement of equery:
-    o outpout compatible
-    o options full
- * explore attoparsec in search of faster performance
+    o output compatible
+    o option complete
+ * explore attoparsec/alex in search of faster performance
diff --git a/fquery.cabal b/fquery.cabal
--- a/fquery.cabal
+++ b/fquery.cabal
@@ -1,55 +1,66 @@
-Name:		fquery
-Version:	0.2.1.2
+Name:          fquery
+Version:       0.2.1.3
 
-Author:		David Wang <millimillenary@gmail.com>, Sergei Trofimovich <slyfox@inbox.ru>
-Maintainer:	Sergei Trofimovich <slyfox@inbox.ru>
-Copyright:	2006 David Wang, 2009 Sergei Trofimovich
+Author:        David Wang <millimillenary@gmail.com>, Sergei Trofimovich <slyfox@inbox.ru>
+Maintainer:    Sergei Trofimovich <slyfox@inbox.ru>
+Copyright:     2006 David Wang, 2009-2011 Sergei Trofimovich
 
-License-File:	LICENCE.txt
-License:	OtherLicense
+License-File:  LICENCE.txt
+License:       OtherLicense
 
-Synopsis:	Installed package query tool for Gentoo Linux
-Description:	Installed package query tool for Gentoo Linux
-		.
-		Home page <http://home.exetel.com.au/tjaden/fquery/>
-		.
-		Public repository is at <http://repo.or.cz/w/fquery.git>
+Synopsis:      Installed package query tool for Gentoo Linux
+Description:   Installed package query tool for Gentoo Linux
+               .
+               Home page <http://home.exetel.com.au/tjaden/fquery/>
+Category:      Gentoo
 
-Category:	Gentoo
+Build-Type:    Configure
+Cabal-Version: >=1.6
 
-Build-Type:	Configure
-Build-Depends:	base >= 2 && < 5, haskell98, parsec, unix, regex-compat, process, directory
 
 Extra-Source-Files:
-		configure
-		Adelie/Config.hs.in
-		Adelie/opts.h
-		TODO
+        configure
+        Adelie/Config.hs.in
+        Adelie/opts.h
+        TODO
 
-Executable:	fquery
-Main-is:	Main.hs
-Other-Modules:	Adelie.Colour
-		Adelie.CompareVersion
-		Adelie.Contents
-		Adelie.Depend
-		Adelie.ListEx
-		Adelie.Options
-		Adelie.Portage
-		Adelie.Pretty
-		Adelie.Provide
-		Adelie.QChangelog
-		Adelie.QCheck
-		Adelie.QDepend
-		Adelie.QHasUse
-		Adelie.QList
-		Adelie.QOwn
-		Adelie.QSize
-		Adelie.QUse
-		Adelie.QWant
-		Adelie.Use
-		Adelie.UseDesc
+Executable fquery
+    Main-is: Main.hs
+    Other-Modules:
+        Adelie.Colour
+        Adelie.CompareVersion
+        Adelie.Contents
+        Adelie.Depend
+        Adelie.Error
+        Adelie.ListEx
+        Adelie.Options
+        Adelie.Portage
+        Adelie.Pretty
+        Adelie.Provide
+        Adelie.QChangelog
+        Adelie.QCheck
+        Adelie.QDepend
+        Adelie.QHasUse
+        Adelie.QList
+        Adelie.QOwn
+        Adelie.QSize
+        Adelie.QUse
+        Adelie.QWant
+        Adelie.Use
+        Adelie.UseDesc
+    GHC-Options: -O2 -Wall
+    -- GHC-Options: -Werror
+    C-Sources: Adelie/opts.c
 
-GHC-Options:	-O2 -Wall
--- GHC-Options:	-Werror
+    Build-Depends:
+        base >= 2 && < 5,
+        directory,
+        extensible-exceptions,
+        parsec,
+        process,
+        regex-compat,
+        unix
 
-c-sources:	Adelie/opts.c
+Source-Repository head
+  type:     git
+  location: git://repo.or.cz/fquery.git
