diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -5,7 +5,6 @@
 import Plugin.Pl.Parser
 import Plugin.Pl.Transform
 
-import Data.List (intersperse)
 import System.Environment (getArgs)
 import System.Console.GetOpt
 
diff --git a/Plugin/Pl/Common.hs b/Plugin/Pl/Common.hs
--- a/Plugin/Pl/Common.hs
+++ b/Plugin/Pl/Common.hs
@@ -1,5 +1,3 @@
-{-# OPTIONS -fvia-C #-}
-
 module Plugin.Pl.Common (
         Fixity(..), Expr(..), Pattern(..), Decl(..), TopLevel(..),
         bt, sizeExpr, mapTopLevel, mapTopLevel', getExpr,
diff --git a/Plugin/Pl/Optimize.hs b/Plugin/Pl/Optimize.hs
--- a/Plugin/Pl/Optimize.hs
+++ b/Plugin/Pl/Optimize.hs
@@ -1,14 +1,13 @@
-{-# OPTIONS -fvia-C -O2 -optc-O3 #-}
+{-# LANGUAGE ImplicitParams #-}
 module Plugin.Pl.Optimize (
     optimize,
   ) where
 
 import Plugin.Pl.Common
 import Plugin.Pl.Rules
-import Plugin.Pl.PrettyPrinter
+import Plugin.Pl.PrettyPrinter ()
 
 import Data.List (nub)
-import Control.Monad.State
 
 cut :: [a] -> [a]
 cut = take 1
diff --git a/Plugin/Pl/Parser.hs b/Plugin/Pl/Parser.hs
--- a/Plugin/Pl/Parser.hs
+++ b/Plugin/Pl/Parser.hs
@@ -1,4 +1,3 @@
-{-# OPTIONS -fvia-C -O2 -optc-O3 #-}
 --
 -- Todo, use Language.Haskell
 --
@@ -25,8 +24,8 @@
 brackets :: Parser a -> Parser a
 brackets = T.brackets tp
 
-symbol :: String -> Parser String
-symbol = T.symbol tp
+symbol :: String -> Parser ()
+symbol = fmap (const ()) . T.symbol tp
 
 atomic :: Parser String
 atomic = try (show `fmap` T.natural tp) <|> T.identifier tp
@@ -55,7 +54,7 @@
 
   inf :: (String, (Assoc, Int)) -> Operator Char st Expr
   inf (name, (assoc, _)) = Infix (try $ do 
-      string name
+      _ <- string name
       notFollowedBy $ oneOf opchars
       spaces
       let name' = if head name == '`' 
@@ -197,7 +196,7 @@
 endsIn :: Parser a -> Parser b -> Parser [a]
 endsIn p end = do
   xs <- many p
-  end
+  _ <- end
   return $ xs
 
 input :: Parser TopLevel
diff --git a/Plugin/Pl/PrettyPrinter.hs b/Plugin/Pl/PrettyPrinter.hs
--- a/Plugin/Pl/PrettyPrinter.hs
+++ b/Plugin/Pl/PrettyPrinter.hs
@@ -1,4 +1,5 @@
-{-# OPTIONS -fvia-C -fno-warn-orphans #-}
+{-# LANGUAGE PatternGuards #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
 module Plugin.Pl.PrettyPrinter (Expr) where
 
 -- Dummy export to make ghc -Wall happy
diff --git a/Plugin/Pl/Rules.hs b/Plugin/Pl/Rules.hs
--- a/Plugin/Pl/Rules.hs
+++ b/Plugin/Pl/Rules.hs
@@ -1,7 +1,6 @@
-{-# OPTIONS -fvia-C #-}
-{-# OPTIONS -fno-warn-name-shadowing #-}
--- 6.4 gives a name shadow warning I haven't tracked down.
-
+{-# LANGUAGE ExistentialQuantification #-}
+{-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE ScopedTypeVariables #-}
 --
 -- | This marvellous module contributed by Thomas J\344ger
 --
diff --git a/Plugin/Pl/Transform.hs b/Plugin/Pl/Transform.hs
--- a/Plugin/Pl/Transform.hs
+++ b/Plugin/Pl/Transform.hs
@@ -1,10 +1,10 @@
-{-# OPTIONS -fvia-C -O2 -optc-O3 #-}
+{-# LANGUAGE FlexibleInstances #-}
 module Plugin.Pl.Transform (
     transform,
   ) where
 
 import Plugin.Pl.Common
-import Plugin.Pl.PrettyPrinter
+import Plugin.Pl.PrettyPrinter ()
 
 import qualified Data.Map as M
 
@@ -74,7 +74,7 @@
 
   -- act like a reader monad
   inEnv :: State s a -> State s a
-  inEnv (State f) = State $ \s -> (fst $ f s, s)
+  inEnv f = gets $ evalState f
 
   alphaPat (PVar v) = do
     fm <- get
diff --git a/pointfree.cabal b/pointfree.cabal
--- a/pointfree.cabal
+++ b/pointfree.cabal
@@ -1,29 +1,43 @@
-name:                pointfree
-version:             1.0.3
-synopsis:            Pointfree refactoring tool
-description:         Stand-alone command-line version of the point-less plugin for lambdabot.
-license:             OtherLicense
-license-file:        LICENSE
-author:              Thomas Jäger
-homepage:            http://haskell.org/haskellwiki/Pointfree
-category:            Tool
-build-depends:       base, parsec, mtl, containers, array
-build-type:          Simple
+Cabal-Version: >= 1.6
 
-extra-source-files:
-                      Plugin/Pl/PrettyPrinter.hs
-                    , Plugin/Pl/Parser.hs
-                    , Plugin/Pl/Optimize.hs
-                    , Plugin/Pl/Rules.hs
-                    , Plugin/Pl/Transform.hs
-                    , Plugin/Pl/Common.hs
-                    , test/Makefile
-                    , test/Test.hs
-                    , README
+Name:     pointfree
+Version:  1.0.4
+Category: Tool
+Synopsis: Tool for refactoring expressions into pointfree form
 
+Description:
+    The pointfree tool is a standalone command-line version of the pl
+    plugin for lambdabot.
 
+Author:       Thomas Jäger
+Maintainer:   Ben Millwood <haskell@benmachine.co.uk>
+License:      OtherLicense
+License-file: LICENSE
 
+Build-type:         Simple
+Extra-source-files: README test/Makefile test/Test.hs
 
-executable:          pointfree
-main-is:             Main.hs
-ghc-options:         -Wall -funbox-strict-fields -fglasgow-exts
+Source-repository head
+  type:     git
+  location: git://github.com/benmachine/stepeval.git
+
+Executable pointfree
+  Main-is:       Main.hs
+  GHC-options:   -Wall
+  Extensions:    ExistentialQuantification,
+                 FlexibleInstances,
+                 ImplicitParams,
+                 PatternGuards,
+                 ScopedTypeVariables
+  Build-depends: base >= 3 && < 4.4,
+                 array >= 0.3 && < 0.4,
+                 containers >= 0.3 && < 0.5,
+                 parsec >= 2 && < 3.2,
+                 mtl >= 2 && < 2.1
+  Other-modules: Plugin.Pl.Common
+                 Plugin.Pl.Parser
+                 Plugin.Pl.PrettyPrinter
+                 Plugin.Pl.Optimize
+                 Plugin.Pl.Rules
+                 Plugin.Pl.Transform
+
