diff --git a/hspec2.cabal b/hspec2.cabal
--- a/hspec2.cabal
+++ b/hspec2.cabal
@@ -1,5 +1,5 @@
 name:             hspec2
-version:          0.1.0
+version:          0.1.1
 license:          MIT
 license-file:     LICENSE
 copyright:        (c) 2011-2014 Simon Hengel,
diff --git a/src/Test/Hspec.hs b/src/Test/Hspec.hs
--- a/src/Test/Hspec.hs
+++ b/src/Test/Hspec.hs
@@ -24,6 +24,7 @@
 , pending
 , pendingWith
 , before
+, beforeWith
 , after
 , after_
 , around
@@ -87,6 +88,10 @@
 -- | Run a custom action before every spec item.
 before :: IO a -> SpecWith a -> Spec
 before action = around (action >>=)
+
+-- | Run a custom action before every spec item.
+beforeWith :: (b -> IO a) -> SpecWith a -> SpecWith b
+beforeWith action = aroundWith $ \e x -> action x >>= e
 
 -- | Run a custom action after every spec item.
 after :: ActionWith a -> SpecWith a -> SpecWith a
diff --git a/src/Test/Hspec/Runner/Eval.hs b/src/Test/Hspec/Runner/Eval.hs
--- a/src/Test/Hspec/Runner/Eval.hs
+++ b/src/Test/Hspec/Runner/Eval.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE DeriveFunctor #-}
 module Test.Hspec.Runner.Eval (runFormatter) where
 
 import           Control.Applicative
diff --git a/src/Test/Hspec/Runner/Tree.hs b/src/Test/Hspec/Runner/Tree.hs
--- a/src/Test/Hspec/Runner/Tree.hs
+++ b/src/Test/Hspec/Runner/Tree.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE DeriveFunctor #-}
 module Test.Hspec.Runner.Tree where
 
 import           Test.Hspec.Core.Type
@@ -6,7 +5,12 @@
 data Tree a
   = Node String [Tree a]
   | Leaf String a
-  deriving (Eq, Show, Functor)
+  deriving (Eq, Show)
+
+instance Functor Tree where
+  fmap f t = case t of
+    Node s xs -> Node s (map (fmap f) xs)
+    Leaf s x -> Leaf s (f x)
 
 toTree :: SpecTree () -> Tree (Item ())
 toTree spec = case spec of
diff --git a/test/Test/HspecSpec.hs b/test/Test/HspecSpec.hs
--- a/test/Test/HspecSpec.hs
+++ b/test/Test/HspecSpec.hs
@@ -129,6 +129,14 @@
           H.it "foo" $ property $ append "foo"
         readIORef ref `shouldReturn` (take 200 . cycle) ["before", "foo"]
 
+  describe "beforeWith" $ do
+    it "runs an action before every spec item" $ do
+      let action :: Int -> IO String
+          action n = return (show n)
+      property $ \n -> do
+        silence $ H.hspec $ H.before (return n) $ H.beforeWith action $ do
+          H.it "foo" $ (`shouldBe` show n)
+
   describe "after" $ do
     it "must be used with a before action" $ do
       ref <- newIORef ([] :: [String])
