diff --git a/.travis.yml b/.travis.yml
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,19 +10,19 @@
 # - CABALVER=1.16 GHCVER=7.2.1
 # - CABALVER=1.16 GHCVER=7.2.2
 # - CABALVER=1.16 GHCVER=7.4.1
- - CABALVER=1.16 GHCVER=7.4.2
+# - CABALVER=1.16 GHCVER=7.4.2
 # - CABALVER=1.16 GHCVER=7.6.1
 # - CABALVER=1.16 GHCVER=7.6.2
  - CABALVER=1.18 GHCVER=7.6.3
 # - CABALVER=1.18 GHCVER=7.8.1  # see note about Alex/Happy for GHC >= 7.8
 # - CABALVER=1.18 GHCVER=7.8.2
  - CABALVER=1.18 GHCVER=7.8.3
- - CABALVER=1.22 GHCVER=7.10.1
+ - CABALVER=1.22 GHCVER=7.10.2
 # - CABALVER=head GHCVER=head   # see section about GHC HEAD snapshots
 
 matrix:
   allow_failures:
-   - env: CABALVER=1.22 GHCVER=7.10.1
+   - env: CABALVER=1.18 GHCVER=7.6.3
 
 # Note: the distinction between `before_install` and `install` is not important.
 before_install:
@@ -42,6 +42,7 @@
  - cabal --version
  - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
  - travis_retry cabal update
+ - if [ $GHCVER = "head" ] || [ ${GHCVER%.*} = "7.10" ]; then cabal install 'ersatz >=0.3 && <0.4' -f-examples; fi # to avoid compilation error of ersatz
  - cabal install --only-dependencies -fexamples --enable-tests --enable-benchmarks
 
 # Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail.
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
 ersatz-toysat
 =============
 
-[![Build Status](https://secure.travis-ci.org/msakai/ersatz-toysat.png?branch=master)](http://travis-ci.org/msakai/ersatz-toysat)
+[![Build Status](https://secure.travis-ci.org/msakai/ersatz-toysat.png?branch=master)](http://travis-ci.org/msakai/ersatz-toysat) [![Hackage](https://budueba.com/hackage/ersatz-toysat)](https://hackage.haskell.org/package/ersatz-toysat)
 
 toysat driver as backend for ersatz
 
diff --git a/ersatz-toysat.cabal b/ersatz-toysat.cabal
--- a/ersatz-toysat.cabal
+++ b/ersatz-toysat.cabal
@@ -2,7 +2,7 @@
 --  http://haskell.org/cabal/users-guide/
 
 name:                ersatz-toysat
-version:             0.2.0.0
+version:             0.2.1.0
 synopsis:            toysat driver as backend for ersatz
 description:         toysat driver as backend for ersatz
 homepage:            https://github.com/msakai/ersatz-toysat
@@ -28,12 +28,12 @@
 library
   exposed-modules:     Ersatz.Solver.Toysat
   build-depends:
-    base >=4.5 && <4.9,
+    base >=4.6 && <4.9,
     array >= 0.4 && < 0.6,
     containers >= 0.4.2.1 && < 0.6,
-    transformers == 0.3.*,
-    ersatz >=0.2.6.1 && <0.3.0,
-    toysolver >=0.2.0  && <0.3.0
+    transformers >=0.3 && <0.5,
+    ersatz >=0.3 && <0.4,
+    toysolver >=0.2.0  && <0.4.0
   hs-source-dirs:      src
   default-language:    Haskell2010
 
@@ -60,6 +60,12 @@
   default-language: Haskell2010
   ghc-options: -Wall
   hs-source-dirs: examples/regexp-grid
+  other-extensions:
+    TupleSections
+    TemplateHaskell
+    TypeFamilies
+    DeriveGeneric
+    DeriveDataTypeable
 
 executable ersatz-toysat-sudoku
   -- description:   An example program that solves a sudoku problem using Ersatz.
@@ -81,3 +87,8 @@
     Sudoku.Problem
   ghc-options: -Wall
   hs-source-dirs: examples/sudoku
+  other-extensions:
+    TypeFamilies
+    DeriveGeneric
+    DeriveDataTypeable
+    FlexibleContexts
diff --git a/examples/regexp-grid/RegexpGrid/Types.hs b/examples/regexp-grid/RegexpGrid/Types.hs
--- a/examples/regexp-grid/RegexpGrid/Types.hs
+++ b/examples/regexp-grid/RegexpGrid/Types.hs
@@ -37,12 +37,9 @@
 instance Variable  Field
 instance Equatable Field
 
-instance Decoding Field where
+instance Codec Field where
   type Decoded Field = Char
   decode s (Field f) = chr . (+ origin) . fromIntegral <$> decode s f
-
-instance Encoding Field where
-  type Encoded Field = Char
   encode = Field . encode . fromIntegral . subtract origin . ord
 
 -- Encode 0 as the character preceding A.
diff --git a/examples/sudoku/Sudoku/Cell.hs b/examples/sudoku/Sudoku/Cell.hs
--- a/examples/sudoku/Sudoku/Cell.hs
+++ b/examples/sudoku/Sudoku/Cell.hs
@@ -18,11 +18,8 @@
 instance Variable  Cell
 instance Equatable Cell
 
-instance Decoding Cell where
+instance Codec Cell where
   type Decoded Cell = Word8
   decode s (Cell b) = decode s b
-
-instance Encoding Cell where
-  type Encoded Cell = Word8
   encode n | 1 <= n && n <= 9 = Cell (encode n)
            | otherwise = error ("Cell encode: invalid value " ++ show n)
diff --git a/examples/sudoku/Sudoku/Problem.hs b/examples/sudoku/Sudoku/Problem.hs
--- a/examples/sudoku/Sudoku/Problem.hs
+++ b/examples/sudoku/Sudoku/Problem.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE FlexibleContexts #-}
 module Sudoku.Problem (problem, range) where
 
 import Prelude hiding ((&&), (||), not, and, or, all, any)
