diff --git a/IOSpec.cabal b/IOSpec.cabal
--- a/IOSpec.cabal
+++ b/IOSpec.cabal
@@ -1,8 +1,8 @@
 Name:		        IOSpec
-Version:        	0.2
+Version:        	0.2.1
 License:        	BSD3
 License-file:		LICENSE
-Author:			Wouter Swierstra
+Author:			Wouter Swierstra, Yusaku Hashimoto
 Maintainer:     	Wouter Swierstra <wss@cs.nott.ac.uk>
 Homepage:       	http://www.cs.nott.ac.uk/~wss/repos/IOSpec
 Synopsis:       	A pure specification of the IO monad.
@@ -42,9 +42,9 @@
 			with the source distribution.
 Category:       	Testing
 Build-Type:		Simple
-Build-Depends:  	base, mtl, QuickCheck < 2.0, Stream
-Extensions:		MultiParamTypeClasses
-Ghc-options:		-Wall -fglasgow-exts
+Build-Depends:  	base >= 2 && < 4, mtl, QuickCheck >= 2 && < 3, Stream
+Extensions:		MultiParamTypeClasses, OverlappingInstances
+Ghc-options:		-Wall
 Hs-source-dirs:		src
 Extra-source-files:	README
 			, examples/Channels.hs
diff --git a/examples/Channels.hs b/examples/Channels.hs
--- a/examples/Channels.hs
+++ b/examples/Channels.hs
@@ -85,8 +85,8 @@
 -- Using QuickCheck to generate a random stream, we can use the
 -- streamSched to implement a random scheduler -- thereby testing as
 -- many interleavings as possible.
-chanProp :: [Int] -> Scheduler -> Bool
-chanProp ints sched =
+chanProp :: NonEmptyList Int -> Scheduler -> Bool
+chanProp (NonEmpty ints) sched =
   fmap sort (evalIOSpec (chanTest ints) sched)
   ===  Done (sort ints)
 
diff --git a/examples/Echo.hs b/examples/Echo.hs
--- a/examples/Echo.hs
+++ b/examples/Echo.hs
@@ -40,15 +40,11 @@
 -- desired specification: that is that for every input the user
 -- enters, every finite prefix of runTT echo input and copy input is
 -- the same.
-echoProp :: Int -> Stream.Stream Char -> Property
-echoProp n input =
-  n > 0 ==>
+echoProp :: Stream.Stream Char -> Property
+echoProp input =
+    forAll (choose (1,10000)) $ \n ->
     takeOutput n (withInput input (evalIOSpec echo singleThreaded))
     == takeOutput n (withInput input copy)
-
-instance Arbitrary Char where
-  arbitrary = choose ('a','z')
-  coarbitrary = variant . ord
 
 main = do
   Prelude.putStrLn "Testing echo..."
diff --git a/examples/Sudoku.hs b/examples/Sudoku.hs
--- a/examples/Sudoku.hs
+++ b/examples/Sudoku.hs
@@ -289,7 +289,6 @@
   arbitrary  = do
     xs <- arbitrary
     return (Sudoku $ blankOut xs (concat solution))
-  coarbitrary = error "No instance coarbitrary for Sudoku grids"
 
 blankOut :: [Int] -> [Value] -> [[Value]]
 blankOut [] grid     = chop (boxsize * boxsize) grid
diff --git a/src/Test/IOSpec.hs b/src/Test/IOSpec.hs
--- a/src/Test/IOSpec.hs
+++ b/src/Test/IOSpec.hs
@@ -7,7 +7,7 @@
   , module Test.IOSpec.STM
   , module Test.IOSpec.Teletype
 -- * The basic types
-  , module Test.IOSpec.Types
+  , module Test.IOSpec.Types 
 -- * The virtual machine
   , module Test.IOSpec.VirtualMachine
   ) where
@@ -17,5 +17,5 @@
 import Test.IOSpec.IORef
 import Test.IOSpec.STM
 import Test.IOSpec.Teletype
-import Test.IOSpec.Types
+import Test.IOSpec.Types (IOSpec, (:+:)(..), inject, (:<:))
 import Test.IOSpec.VirtualMachine
diff --git a/src/Test/IOSpec/Fork.hs b/src/Test/IOSpec/Fork.hs
--- a/src/Test/IOSpec/Fork.hs
+++ b/src/Test/IOSpec/Fork.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE ExistentialQuantification, FlexibleContexts #-}
 -- | A pure specification of 'forkIO'.
 module Test.IOSpec.Fork
    (
diff --git a/src/Test/IOSpec/IORef.hs b/src/Test/IOSpec/IORef.hs
--- a/src/Test/IOSpec/IORef.hs
+++ b/src/Test/IOSpec/IORef.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE FlexibleContexts #-}
 -- | A pure specification of mutable variables.
 module Test.IOSpec.IORef
    (
diff --git a/src/Test/IOSpec/MVar.hs b/src/Test/IOSpec/MVar.hs
--- a/src/Test/IOSpec/MVar.hs
+++ b/src/Test/IOSpec/MVar.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE DeriveDataTypeable, FlexibleContexts #-}
 -- | A pure specification of basic operations on MVars.
 
 module Test.IOSpec.MVar
diff --git a/src/Test/IOSpec/STM.hs b/src/Test/IOSpec/STM.hs
--- a/src/Test/IOSpec/STM.hs
+++ b/src/Test/IOSpec/STM.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE ExistentialQuantification, FlexibleContexts #-}
+
 module Test.IOSpec.STM
    (
    -- * The specification of STM
diff --git a/src/Test/IOSpec/Surrogate.hs b/src/Test/IOSpec/Surrogate.hs
--- a/src/Test/IOSpec/Surrogate.hs
+++ b/src/Test/IOSpec/Surrogate.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE EmptyDataDecls #-}
 -- | This module contains a few type signatures to help replace pure
 -- specifications by their effectful counterparts.
 module Test.IOSpec.Surrogate
diff --git a/src/Test/IOSpec/Teletype.hs b/src/Test/IOSpec/Teletype.hs
--- a/src/Test/IOSpec/Teletype.hs
+++ b/src/Test/IOSpec/Teletype.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE FlexibleContexts #-}
 -- | A pure specification of getChar and putChar.
 module Test.IOSpec.Teletype
    (
diff --git a/src/Test/IOSpec/Types.hs b/src/Test/IOSpec/Types.hs
--- a/src/Test/IOSpec/Types.hs
+++ b/src/Test/IOSpec/Types.hs
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -fallow-overlapping-instances#-}
+{-# LANGUAGE OverlappingInstances, TypeOperators, FlexibleInstances #-}
 -- | This module contains the basic data types underlying the
 -- 'IOSpec' library. Most of the types and classes in this module
 -- are described in
@@ -33,8 +33,8 @@
 
 -- | The fold over 'IOSpec' values.
 foldIOSpec :: Functor f => (a -> b) -> (f b -> b) -> IOSpec f a -> b
-foldIOSpec pure _ (Pure x)        = pure x
-foldIOSpec pure impure (Impure t) = impure (fmap (foldIOSpec pure impure) t)
+foldIOSpec pure _      (Pure x)    = pure x
+foldIOSpec pure impure (Impure t)  = impure (fmap (foldIOSpec pure impure) t)
 
 -- | The coproduct of functors
 data (f :+: g) x = Inl (f x) | Inr (g x)
diff --git a/src/Test/IOSpec/VirtualMachine.hs b/src/Test/IOSpec/VirtualMachine.hs
--- a/src/Test/IOSpec/VirtualMachine.hs
+++ b/src/Test/IOSpec/VirtualMachine.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE ExistentialQuantification, TypeOperators #-}
+
 -- | The virtual machine on which the specifications execute.
 module Test.IOSpec.VirtualMachine
   (
@@ -50,6 +52,8 @@
 
 instance Arbitrary ThreadId where
   arbitrary                = liftM ThreadId arbitrary
+
+instance CoArbitrary ThreadId where
   coarbitrary (ThreadId k) = coarbitrary k
 
 newtype Scheduler =
@@ -57,8 +61,6 @@
 
 instance Arbitrary Scheduler where
   arbitrary   = liftM streamSched arbitrary
-  coarbitrary = internalError
-    "Test.IOSpec: no definition of coarbitrary for Schedulers."
 
 instance Show Scheduler where
   show _ = "Test.IOSpec.Scheduler"
@@ -215,6 +217,14 @@
   (ReadChar t) >>= f = ReadChar (\c -> t c >>= f)
   (Print c t) >>= f = Print c (t >>= f)
   (Fail msg) >>= _ = Fail msg
+
+instance Eq a => Eq (Effect a) where
+  (Done x) == (Done y) = x == y
+  (ReadChar f) == (ReadChar g) =
+    all (\x -> f x == g x) [minBound .. maxBound]
+  (Print c t) == (Print d u) = c == d && t == u
+  (Fail s) == (Fail t) = s == t
+  _ == _ = False
 
 -- $schedulerDoc
 --
