diff --git a/Text/Blaze.hs b/Text/Blaze.hs
--- a/Text/Blaze.hs
+++ b/Text/Blaze.hs
@@ -1,5 +1,4 @@
-{-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving, Rank2Types,
-             FlexibleInstances #-}
+{-# LANGUAGE TypeSynonymInstances #-}
 -- | BlazeHtml is an HTML combinator library. It provides a way to embed HTML in
 -- Haskell in an efficient and convenient way, with a light-weight syntax.
 --
@@ -45,14 +44,13 @@
     , customAttribute
 
       -- * Converting values to HTML.
+    , ToHtml (..)
     , text
     , preEscapedText
     , lazyText
     , preEscapedLazyText
     , string
     , preEscapedString
-    , showHtml
-    , preEscapedShowHtml
     , unsafeByteString
 
       -- * Creating tags.
@@ -60,6 +58,7 @@
     , stringTag
 
       -- * Converting values to attribute values.
+    , ToValue (..)
     , textValue
     , preEscapedTextValue
     , lazyTextValue
@@ -72,4 +71,104 @@
     , (!)
     ) where
 
+import Data.Text (Text)
+import qualified Data.Text.Lazy as LT
+
 import Text.Blaze.Internal
+
+-- | Class allowing us to use a single function for HTML values
+--
+class ToHtml a where
+    -- | Convert a value to HTML.
+    --
+    toHtml :: a -> Html
+    {-# INLINE toHtml #-}
+
+instance ToHtml Html where
+    toHtml = id
+    {-# INLINE toHtml #-}
+
+instance ToHtml Text where
+    toHtml = text
+    {-# INLINE toHtml #-}
+
+instance ToHtml LT.Text where
+    toHtml = lazyText
+    {-# INLINE toHtml #-}
+
+instance ToHtml String where
+    toHtml = string
+    {-# INLINE toHtml #-}
+
+instance ToHtml Int where
+    toHtml = string . show
+    {-# INLINE toHtml #-}
+
+instance ToHtml Char where
+    toHtml = string . return
+    {-# INLINE toHtml #-}
+
+instance ToHtml Bool where
+    toHtml = string . show
+    {-# INLINE toHtml #-}
+
+instance ToHtml Integer where
+    toHtml = string . show
+    {-# INLINE toHtml #-}
+
+instance ToHtml Float where
+    toHtml = string . show
+    {-# INLINE toHtml #-}
+
+instance ToHtml Double where
+    toHtml = string . show
+    {-# INLINE toHtml #-}
+
+
+-- | Class allowing us to use a single function for attribute values
+--
+class ToValue a where
+    -- | Convert a value to an HTML attribute value
+    --
+    toValue :: a -> AttributeValue
+    {-# INLINE toValue #-}
+
+instance ToValue AttributeValue where
+    toValue = id
+    {-# INLINE toValue #-}
+
+instance ToValue Text where
+    toValue = textValue
+    {-# INLINE toValue #-}
+
+instance ToValue LT.Text where
+    toValue = lazyTextValue
+    {-# INLINE toValue #-}
+
+instance ToValue String where
+    toValue = stringValue
+    {-# INLINE toValue #-}
+
+instance ToValue Int where
+    toValue = stringValue . show
+    {-# INLINE toValue #-}
+
+instance ToValue Char where
+    toValue = stringValue . return
+    {-# INLINE toValue #-}
+
+instance ToValue Bool where
+    toValue = stringValue . show
+    {-# INLINE toValue #-}
+
+instance ToValue Integer where
+    toValue = stringValue . show
+    {-# INLINE toValue #-}
+
+instance ToValue Float where
+    toValue = stringValue . show
+    {-# INLINE toValue #-}
+
+instance ToValue Double where
+    toValue = stringValue . show
+    {-# INLINE toValue #-}
diff --git a/Text/Blaze/Internal.hs b/Text/Blaze/Internal.hs
--- a/Text/Blaze/Internal.hs
+++ b/Text/Blaze/Internal.hs
@@ -30,8 +30,6 @@
     , preEscapedLazyText
     , string
     , preEscapedString
-    , showHtml
-    , preEscapedShowHtml
     , unsafeByteString
 
       -- * Converting values to tags.
@@ -260,23 +258,6 @@
                  -> Html    -- ^ Resulting HTML fragment.
 preEscapedString = Content . PreEscaped . String
 {-# INLINE preEscapedString #-}
-
--- | Create an HTML snippet from a datatype that instantiates 'Show'.
---
-showHtml :: Show a
-         => a       -- ^ Value to insert.
-         -> Html    -- ^ Resulting HTML fragment.
-showHtml = string . show
-{-# INLINE showHtml #-}
-
--- | Create an HTML snippet from a datatype that instantiates 'Show'. This
--- function will not do any HTML entity escaping.
---
-preEscapedShowHtml :: Show a
-                   => a     -- ^ Value to insert.
-                   -> Html  -- ^ Resulting HTML fragment.
-preEscapedShowHtml = preEscapedString . show
-{-# INLINE preEscapedShowHtml #-}
 
 -- | Insert a 'ByteString'. This is an unsafe operation:
 --
diff --git a/Text/Blaze/Renderer/String.hs b/Text/Blaze/Renderer/String.hs
--- a/Text/Blaze/Renderer/String.hs
+++ b/Text/Blaze/Renderer/String.hs
@@ -22,12 +22,12 @@
                    -> String  -- ^ Resulting string
 escapeHtmlEntities []     k = k
 escapeHtmlEntities (c:cs) k = case c of
-    '<'  -> "&lt;"   ++ escapeHtmlEntities cs k
-    '>'  -> "&gt;"   ++ escapeHtmlEntities cs k
-    '&'  -> "&amp;"  ++ escapeHtmlEntities cs k
-    '"'  -> "&quot;" ++ escapeHtmlEntities cs k
-    '\'' -> "&#39;"  ++ escapeHtmlEntities cs k
-    x    -> x : escapeHtmlEntities cs k
+    '<'  -> '&' : 'l' : 't' : ';'             : escapeHtmlEntities cs k
+    '>'  -> '&' : 'g' : 't' : ';'             : escapeHtmlEntities cs k
+    '&'  -> '&' : 'a' : 'm' : 'p' : ';'       : escapeHtmlEntities cs k
+    '"'  -> '&' : 'q' : 'u' : 'o' : 't' : ';' : escapeHtmlEntities cs k
+    '\'' -> '&' : '#' : '3' : '9' : ';'       : escapeHtmlEntities cs k
+    x    -> x                                 : escapeHtmlEntities cs k
 
 -- | Render a 'ChoiceString'.
 --
diff --git a/blaze-html.cabal b/blaze-html.cabal
--- a/blaze-html.cabal
+++ b/blaze-html.cabal
@@ -7,7 +7,7 @@
 -- The package version. See the Haskell package versioning policy
 -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
 -- standards guiding when and how versions should be incremented.
-Version:             0.3.2.1
+Version:             0.4.0.0
 
 -- A short (one-line) description of the package.
 Synopsis:            A blazingly fast HTML combinator library.
