diff --git a/LICENSE b/LICENSE
new file mode 100644
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,31 @@
+Copyright 2001-2005, The University Court of the University of
+Glasgow, Bjorn Bringert, Andy Gill, Ian Lynagh, Erik Meijer, Sven Panne
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+- Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+ 
+- Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+ 
+- Neither name of the University nor the names of its contributors may be
+used to endorse or promote products derived from this software without
+specific prior written permission. 
+
+THIS SOFTWARE IS PROVIDED BY THE UNIVERSITY COURT OF THE UNIVERSITY OF
+GLASGOW AND THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+UNIVERSITY COURT OF THE UNIVERSITY OF GLASGOW OR THE CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
diff --git a/Network/CGI/Undecidable.hs b/Network/CGI/Undecidable.hs
new file mode 100644
--- /dev/null
+++ b/Network/CGI/Undecidable.hs
@@ -0,0 +1,25 @@
+{-# OPTIONS_GHC -fglasgow-exts -fallow-undecidable-instances -fallow-overlapping-instances #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module      :  Network.CGI.Undecidable
+-- Copyright   :  (c) Bjorn Bringert 2005-2007, (c) Ian Lynagh 2005
+-- License     :  BSD-style
+--
+-- Maintainer  :  bjorn@bringert.net
+-- Stability   :  experimental
+-- Portability :  non-portable
+--
+-- Scary but useful type class instances for the cgi package.
+--
+-----------------------------------------------------------------------------
+
+module Network.CGI.Undecidable where
+
+import Control.Monad.Trans (MonadTrans, lift)
+
+import Network.CGI.Monad
+
+-- requires -fallow-undecidable-instances and -fallow-overlapping-instances
+instance (MonadTrans t, MonadCGI m, Monad (t m)) => MonadCGI (t m) where
+    cgiAddHeader n v = lift $ cgiAddHeader n v
+    cgiGet = lift . cgiGet
diff --git a/Setup.lhs b/Setup.lhs
new file mode 100644
--- /dev/null
+++ b/Setup.lhs
@@ -0,0 +1,4 @@
+> import Distribution.Simple
+
+> main :: IO ()
+> main = defaultMain
diff --git a/cgi-undecidable.cabal b/cgi-undecidable.cabal
new file mode 100644
--- /dev/null
+++ b/cgi-undecidable.cabal
@@ -0,0 +1,17 @@
+Name: cgi-undecidable
+Version: 3000.0.0
+Copyright: Bjorn Bringert, Ian Lynagh
+Maintainer: bjorn@bringert.net
+License: BSD3
+License-file: LICENSE
+Build-depends: base, mtl, cgi >= 3000.0.0
+Extensions: OverlappingInstances, UndecidableInstances
+Synopsis: Undecidable instances for the cgi package.
+Description:
+ This package adds some useful type class instances to the
+  cgi package. This is in a separate package to allow the cgi
+  package to be compatible with Haskell implementations that
+  don't support undecidable instances.
+Exposed-Modules: 
+   Network.CGI.Undecidable
+ghc-options: -O2 -Wall
