diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -3,6 +3,7 @@
     ) where
 
 import Data.Generics ( mkT, everywhere )
+import Data.List ( isPrefixOf, tails )
 import Language.Haskell.Exts ( prettyPrint
                              , ParseResult(..), parseFileWithExts
                              , Module(..), Exp(..), QOp(..)
@@ -25,8 +26,14 @@
              writeFile fout $ magicLine ++ prettyPrint (transform m)
 
 transform :: Module -> Module
-transform = addDecl . everywhere (mkT trans)
+transform = addNecessaryDecls . everywhere (mkT trans)
     where
+      addNecessaryDecls m
+          | strstr "^-^" (prettyPrint m) = addDecl m
+          | otherwise                    = m
+
+      strstr w = any id . map (isPrefixOf w) . tails
+
       addDecl :: Module -> Module
       addDecl (Module sl mn mps mwt mes ids ds) =
           let ids' = (ImportDecl{ importLoc = SrcLoc { srcFilename = ""
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,6 @@
-TESTS1 := Simple One String
-TESTS2 := Standalone Pure
+TESTS1 := Simple One String NoImport
+TESTS2 := Standalone Pure PureString NoWarn JustShow
+GHC := ghc -Wall -Werror
 
 .PHONY: all build dist install clean clean-tests test doc
 
@@ -27,8 +28,8 @@
 endef
 
 test: install clean-tests
-	$(foreach t,$(TESTS1),cd Test && ghc -F -pgmF interpol $(t)${\n})
-	$(foreach t,$(TESTS2),cd Test && ghc $(t)${\n})
+	$(foreach t,$(TESTS1),cd Test && $(GHC) -F -pgmF interpol $(t)${\n})
+	$(foreach t,$(TESTS2),cd Test && $(GHC) $(t)${\n})
 	$(foreach t,$(TESTS1) $(TESTS2),cd Test && [ "`./$(t)`" = "I have 23 apples." ]${\n})
 
 dist/setup-config: interpol.cabal
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -51,6 +51,10 @@
 
     {-# OPTIONS_GHC -F -pgmF interpol #-}
 
+Note that, unless you use this latter pragma,
+[ghc-mod](http://www.mew.org/~kazu/proj/ghc-mod/en/) and other
+`flymake`-based Emacs modes will probably complain about unused
+variables.
 
 Operation
 ---------
diff --git a/Test/JustShow.hs b/Test/JustShow.hs
new file mode 100644
--- /dev/null
+++ b/Test/JustShow.hs
@@ -0,0 +1,15 @@
+-- | This checks that a Show instance is enough to interpolate custom
+-- data types.
+
+import Text.Interpol
+
+data Foo = Foo Int
+
+instance Show Foo where
+    show (Foo n) = show n
+
+myVar :: Foo
+myVar = Foo 23
+
+main :: IO ()
+main = putStrLn $ "I have " ^-^ myVar ^-^ " apples."
diff --git a/Test/NoImport.hs b/Test/NoImport.hs
new file mode 100644
--- /dev/null
+++ b/Test/NoImport.hs
@@ -0,0 +1,7 @@
+module Main where
+
+val :: Int
+val = 23
+
+main :: IO ()
+main = putStrLn "I have {val} apples."
diff --git a/Test/NoWarn.hs b/Test/NoWarn.hs
new file mode 100644
--- /dev/null
+++ b/Test/NoWarn.hs
@@ -0,0 +1,13 @@
+{-# OPTIONS_GHC -F -pgmF interpol #-}
+
+-- | The idea here is to check that @foo n@ will not result in an
+-- "unused variable" warning.  Of course, it doesn't really work
+-- unless you open the file in Emacs or something.
+
+module Main where
+
+main :: IO ()
+main = foo 23
+
+foo :: Int -> IO ()
+foo n = putStrLn "I have {n} apples."
diff --git a/Test/PureString.hs b/Test/PureString.hs
new file mode 100644
--- /dev/null
+++ b/Test/PureString.hs
@@ -0,0 +1,9 @@
+-- | This checks that 'String's do not get unnecessarily quoted.
+
+import Text.Interpol
+
+myVar :: String
+myVar = "23"
+
+main :: IO ()
+main = putStrLn $ "I have " ^-^ myVar ^-^ " apples."
diff --git a/Text/Interpol.hs b/Text/Interpol.hs
--- a/Text/Interpol.hs
+++ b/Text/Interpol.hs
@@ -1,10 +1,10 @@
+{-# LANGUAGE FlexibleInstances, UndecidableInstances, OverlappingInstances #-}
+
 -- | Support module for the @interpol@ preprocessor.
 module Text.Interpol (
         (^-^)
     ) where
 
-import Data.Typeable ( Typeable, cast )
-
 infixl 3 ^-^
 
 -- | Append a showable value to a 'String' in a smart way.  In
@@ -16,7 +16,14 @@
 --   x ^-^ y = x ++ y
 --   x ^-^ y = x ++ show y
 -- @
-(^-^) :: (Typeable a, Show a) => String -> a -> String
-s ^-^ st = case cast st of
-             Just s' -> s ++ s'
-             Nothing -> s ++ show st
+(^-^) :: Interpol a => String -> a -> String
+(^-^) = interpol
+
+class Interpol a where
+    interpol :: String -> a -> String
+
+instance Interpol [Char] where
+    interpol s x = s ++ x
+
+instance Show a => Interpol a where
+    interpol s x = s ++ show x
diff --git a/interpol.cabal b/interpol.cabal
--- a/interpol.cabal
+++ b/interpol.cabal
@@ -1,5 +1,5 @@
 Name:           interpol
-Version:        0.2.0
+Version:        0.2.1
 Cabal-Version:  >= 1.6
 License:        GPL-3
 License-File:   LICENSE
@@ -13,20 +13,25 @@
 Description:    This preprocessor enables variable interpolation in strings.
                 See the README.md file for details.
 
-Extra-source-files:     Test/Simple.hs,
+Extra-source-files:     Makefile,
+                        Test/JustShow.hs,
+                        Test/NoImport.hs,
+                        Test/NoWarn.hs,
                         Test/One.hs,
-                        Test/Standalone.hs,
                         Test/Pure.hs,
+                        Test/PureString.hs,
+                        Test/Simple.hs,
+                        Test/Standalone.hs,
                         Test/String.hs
 
-Data-files:             Makefile, README.md
+Data-files:             README.md
 
 Source-repository head
   Type:                 git
   Location:             git://github.com/scvalex/interpol.git
 
 Executable interpol
-  Build-Depends:        base >=4 && <5, syb, haskell-src-exts, regex-posix
+  Build-Depends:        base >= 4 && <5, syb, haskell-src-exts, regex-posix
   Main-Is:              Main.hs
 
 Library
