diff --git a/djinn.cabal b/djinn.cabal
--- a/djinn.cabal
+++ b/djinn.cabal
@@ -1,5 +1,5 @@
 Name:		djinn
-Version:	2009.9.3
+Version:	2011.7.23
 License:	BSD3
 License-file:	LICENSE
 Author:		Lennart Augustsson
@@ -10,7 +10,7 @@
 Homepage:	http://www.augustsson.net/Darcs/Djinn/
 Synopsis:	Generate Haskell code from a type
 Build-type:	Simple
-Build-Depends:	base >= 3 && < 4, mtl, editline -any, pretty, array, containers
+Build-Depends:	base >= 4 && < 5, mtl, haskeline -any, pretty, array, containers
 
 Executable:     djinn
 Main-Is:        Djinn.hs
diff --git a/src/Djinn.hs b/src/Djinn.hs
--- a/src/Djinn.hs
+++ b/src/Djinn.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
 --
 -- Copyright (c) 2005 Lennart Augustsson
 -- See LICENSE for licensing details.
@@ -9,7 +10,6 @@
 import Text.ParserCombinators.ReadP
 import Control.Monad(when)
 import Control.Monad.Error()
-import System.IO
 import System.Exit
 import System.Environment
 
@@ -22,7 +22,7 @@
 --import Debug.Trace
 
 version :: String
-version = "version 2009-09-04"
+version = "version 2011-07-23"
 
 main :: IO ()
 main = do
diff --git a/src/HTypes.hs b/src/HTypes.hs
--- a/src/HTypes.hs
+++ b/src/HTypes.hs
@@ -1,3 +1,4 @@
+{-# OPTIONS_GHC -fno-warn-unused-do-bind #-}
 --
 -- Copyright (c) 2005 Lennart Augustsson
 -- See LICENSE for licensing details.
diff --git a/src/REPL.hs b/src/REPL.hs
--- a/src/REPL.hs
+++ b/src/REPL.hs
@@ -3,11 +3,11 @@
 -- See LICENSE for licensing details.
 --
 module REPL(REPL(..), repl) where
-import qualified Control.Exception
-import System.Console.Editline.Readline(readline, addHistory)
+import Control.Monad.Trans
+import System.Console.Haskeline
 
 data REPL s = REPL {
-    repl_init :: IO (String, s),                -- prompt and initial state
+    repl_init :: IO (String, s),                        -- prompt and initial state
     repl_eval :: s -> String -> IO (Bool, s),           -- quit flag and new state
     repl_exit :: s -> IO ()
     }
@@ -15,6 +15,24 @@
 repl :: REPL s -> IO ()
 repl p = do
     (prompt, state) <- repl_init p
+    let loop s = do
+            mline <- getInputLine prompt
+            case mline of
+                Nothing -> loop s
+                Just line -> do
+                     (quit, s') <- liftIO $ repl_eval p s line
+                     if quit then
+                         liftIO $ repl_exit p s'
+                      else
+                         loop s'
+    runInputT defaultSettings (loop state)
+
+
+
+{-
+repl :: REPL s -> IO ()
+repl p = do
+    (prompt, state) <- repl_init p
     let loop s = (do
             mline <- readline prompt
             case mline of
@@ -32,3 +50,4 @@
                     loop s
             )
     loop state
+-}
