diff --git a/CHANGELOG.markdown b/CHANGELOG.markdown
--- a/CHANGELOG.markdown
+++ b/CHANGELOG.markdown
@@ -1,3 +1,8 @@
+0.3.1
+=====
+
+  * `Typeable`, `Data`, `Generic`, and `Generic1` instances for `Window`.
+
 0.3.0
 =====
 
diff --git a/src/System/Console/Terminal/Common.hs b/src/System/Console/Terminal/Common.hs
--- a/src/System/Console/Terminal/Common.hs
+++ b/src/System/Console/Terminal/Common.hs
@@ -1,24 +1,45 @@
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE DeriveFoldable #-}
+{-# LANGUAGE DeriveFunctor #-}
+{-# LANGUAGE DeriveTraversable #-}
 
+#if __GLASGOW_HASKELL__ >= 702
+#define LANGUAGE_DeriveGeneric
+{-# LANGUAGE DeriveGeneric #-}
+#endif
+
 module System.Console.Terminal.Common
   ( Window(..)
   ) where
 
-import Control.Applicative
-import Data.Foldable (Foldable(..))
-import Data.Traversable (Traversable(..))
-import Data.Monoid (mappend)
+import Data.Data (Typeable, Data)
 
+#if __GLASGOW_HASKELL__ < 710
+import Data.Foldable (Foldable)
+import Data.Traversable (Traversable)
+#endif
+
+#ifdef LANGUAGE_DeriveGeneric
+import GHC.Generics
+  ( Generic
+#if __GLASGOW_HASKELL__ >= 706
+  , Generic1
+#endif
+  )
+#endif
+
 -- | Terminal window width and height
 data Window a = Window
   { height :: !a
   , width  :: !a
-  } deriving (Show, Eq, Read)
-
-instance Functor Window where
-  fmap f (Window { height = h, width = w }) = Window { height = f h, width = f w }
-
-instance Foldable Window where
-  foldMap f (Window { height = h, width = w }) = f h `mappend` f w
-
-instance Traversable Window where
-  traverse f (Window { height = h, width = w }) = Window <$> f h <*> f w
+  } deriving
+    ( Show, Eq, Read, Data, Typeable
+    , Foldable, Functor, Traversable
+#ifdef LANGUAGE_DeriveGeneric
+    , Generic
+#if __GLASGOW_HASKELL__ >= 706
+    , Generic1
+#endif
+#endif
+    )
diff --git a/src/System/Console/Terminal/Size.hs b/src/System/Console/Terminal/Size.hs
--- a/src/System/Console/Terminal/Size.hs
+++ b/src/System/Console/Terminal/Size.hs
@@ -5,9 +5,11 @@
 Based on answer by Andreas Hammar at <http://stackoverflow.com/a/12807521/972985>
 -}
 module System.Console.Terminal.Size
-  ( Window(..), size
+  ( Window(..)
+  , size
 #if !defined(mingw32_HOST_OS)
-    ,fdSize, hSize
+  , fdSize
+  , hSize
 #endif
   ) where
 
diff --git a/terminal-size.cabal b/terminal-size.cabal
--- a/terminal-size.cabal
+++ b/terminal-size.cabal
@@ -1,5 +1,5 @@
 name:                terminal-size
-version:             0.3.0
+version:             0.3.1
 synopsis:            Get terminal window height and width
 description:
   Get terminal window height and width without ncurses dependency.
@@ -14,20 +14,41 @@
   README.markdown
   CHANGELOG.markdown
 
+source-repository head
+  type:     git
+  location: https://github.com/biegunka/terminal-size
+
+source-repository this
+  type:     git
+  location: https://github.com/biegunka/terminal-size
+  tag:      0.3.1
+
 library
-  default-language:  Haskell2010
-  build-depends:     base >= 4 && < 5
-  build-tools:       hsc2hs
-  hs-source-dirs:    src
-  exposed-modules:   System.Console.Terminal.Size
-  other-modules:     System.Console.Terminal.Common
+  default-language:
+    Haskell2010
+
+  build-depends:
+    base >= 4 && < 5
+  if impl(ghc >= 7.4 && < 7.6)
+     build-depends:
+       ghc-prim
+
+  build-tools:
+    hsc2hs
+  hs-source-dirs:
+    src
+  exposed-modules:
+    System.Console.Terminal.Size
+
+  other-modules:
+    System.Console.Terminal.Common
   if os(Windows)
-    other-modules:   System.Console.Terminal.Windows
+    other-modules:
+      System.Console.Terminal.Windows
   else
-    other-modules:   System.Console.Terminal.Posix
-  ghc-options:       -Wall
-                     -fno-warn-unused-do-bind
+    other-modules:
+      System.Console.Terminal.Posix
 
-source-repository head
-  type:     git
-  location: https://github.com/biegunka/terminal-size
+  ghc-options:
+    -Wall
+    -fno-warn-unused-do-bind
