diff --git a/Text/HTML/TagSoup/Parsec.hs b/Text/HTML/TagSoup/Parsec.hs
--- a/Text/HTML/TagSoup/Parsec.hs
+++ b/Text/HTML/TagSoup/Parsec.hs
@@ -1,8 +1,10 @@
 module Text.HTML.TagSoup.Parsec 
    ( module Text.HTML.TagSoup
    , TagParser
+   , TagParserSt
    , WholeTag 
    , tParse
+   , tStParse
    , openTag 
    , maybeOpenTag
    , eitherOpenTag
@@ -38,15 +40,22 @@
 type TagParser =
    GenParser Tag ( )
 
+-- | A stateful tag parser
+-- This is a new type alias to allow backwards compatibility with old code.
+type TagParserSt =
+   GenParser Tag
+
 -- | Used to invoke parsing of Tags.
 tParse :: TagParser a -> [ Tag ] -> a
 tParse p ts =
-   case parse p "tagsoup" ts of
-      Left err ->
-         error $ show err
-      Right crap ->
-         crap
+   either ( error . show ) id $ parse p "tagsoup" ts
 
+-- | Simply run a stateful tag parser
+tStParse :: TagParserSt st a -> st -> [ Tag ] -> a
+tStParse p state tos =
+   either ( error . show ) id $ runParser p state "tagsoup" tos
+      
+
 -- Tag eater is the basic tag matcher, it increments the line number for each tag parsed.
 tagEater matcher =
    tokenPrim show 
@@ -61,12 +70,12 @@
 
 
 -- | openTag matches a TagOpen with the given name.  It is not case sensitive.
-openTag :: String -> TagParser Tag
+openTag :: String -> TagParserSt st Tag
 openTag soughtName =
    openTagMatch soughtName ( Just ) $ \ _ -> Nothing
 
 -- | notOpenTag will match any tag which is not a TagOpen with the given name.  It is not case sensitive.
-notOpenTag :: String -> TagParser Tag
+notOpenTag :: String -> TagParserSt st Tag
 notOpenTag avoidName =
    openTagMatch avoidName ( \ _ -> Nothing ) Just
 
@@ -100,7 +109,7 @@
 -- then all intervening tags,
 -- until it reaches a TagClose with the given name.
 -- It is not case sensitive.
-wholeTag :: String -> TagParser WholeTag
+wholeTag :: String -> TagParserSt st WholeTag
 wholeTag soughtName = do
    open <- openTag soughtName
    ts <- many $ notCloseTag soughtName
@@ -108,55 +117,55 @@
    return ( open , ts , close )
 
 -- | closeTag matches a TagClose with the given name.  It is not case sensitive.
-closeTag :: String -> TagParser Tag
+closeTag :: String -> TagParserSt st Tag
 closeTag soughtName =
    closeTagMatch soughtName ( Just ) $ \ _ -> Nothing
 
 -- | notCloseTag will match any tag which is not a TagClose with the given name.  It is not case sensitive.
-notCloseTag :: String -> TagParser Tag
+notCloseTag :: String -> TagParserSt st Tag
 notCloseTag avoidName =
    closeTagMatch avoidName ( \ _ -> Nothing ) Just
 
 -- | maybeOpenTag will return `Just` the tag if it gets a TagOpen with he given name,
 -- It will return `Nothing` otherwise.
 -- It is not case sensitive.
-maybeOpenTag :: String -> TagParser ( Maybe Tag )
+maybeOpenTag :: String -> TagParserSt st ( Maybe Tag )
 maybeOpenTag =
    maybeP . openTag
 
 -- | maybeCloseTag will return `Just` the tag if it gets a TagClose with he given name,
 -- It will return `Nothing` otherwise.
 -- It is not case sensitive.
-maybeCloseTag :: String -> TagParser ( Maybe Tag )
+maybeCloseTag :: String -> TagParserSt st ( Maybe Tag )
 maybeCloseTag =
    maybeP . closeTag
 
 -- | maybeWholeTag will return `Just` the tag if it gets a WholeTag with he given name,
 -- It will return `Nothing` otherwise.
 -- It is not case sensitive.
-maybeWholeTag :: String -> TagParser ( Maybe WholeTag )
+maybeWholeTag :: String -> TagParserSt st ( Maybe WholeTag )
 maybeWholeTag =
    maybeP . wholeTag
 
 -- | allOpenTags will return all TagOpen with the given name.
 -- It is not case sensitive.
-allOpenTags :: String -> TagParser [ Tag ]
+allOpenTags :: String -> TagParserSt st [ Tag ]
 allOpenTags =
    allP . maybeOpenTag
 
 -- | allCloseTags will return all TagClose with the given name.
 -- It is not case sensitive.
-allCloseTags :: String -> TagParser [ Tag ]
+allCloseTags :: String -> TagParserSt st [ Tag ]
 allCloseTags =
    allP . maybeCloseTag
 
 -- | allWholeTags will return all WholeTag with the given name.
 -- It is not case sensitive.
-allWholeTags :: String -> TagParser [ WholeTag ]
+allWholeTags :: String -> TagParserSt st [ WholeTag ]
 allWholeTags =
    allP . maybeWholeTag
 
--- | eitherP takes a parser, and becomes its `Either` equivalent -- returning `Right` if it matches, and `Left` if it doesn't.
+-- | eitherP takes a parser, and becomes its `Either` equivalent -- returning `Right` if it matches, and `Left` of anyToken if it doesn't.
 eitherP :: Show tok => GenParser tok st a -> GenParser tok st ( Either tok a )
 eitherP p = do
    try ( do t <- p
@@ -165,17 +174,17 @@
                   return $ Left t
              )
 -- | either a Right TagOpen or a Left arbitary tag.
-eitherOpenTag :: String -> TagParser ( Either Tag Tag )
+eitherOpenTag :: String -> TagParserSt st ( Either Tag Tag )
 eitherOpenTag = 
    eitherP . openTag
 
 -- | either a Right TagClose or a Left arbitary tag.
-eitherCloseTag :: String -> TagParser ( Either Tag Tag )
+eitherCloseTag :: String -> TagParserSt st ( Either Tag Tag )
 eitherCloseTag =
    eitherP . closeTag
 
 -- | either a Right WholeTag or a Left arbitary tag.
-eitherWholeTag :: String -> TagParser ( Either Tag WholeTag )
+eitherWholeTag :: String -> TagParserSt st ( Either Tag WholeTag )
 eitherWholeTag = 
    eitherP . wholeTag
 
diff --git a/tagsoup-parsec.cabal b/tagsoup-parsec.cabal
--- a/tagsoup-parsec.cabal
+++ b/tagsoup-parsec.cabal
@@ -1,5 +1,5 @@
 Name:           tagsoup-parsec 
-Version:        0.0.5
+Version:        0.0.6
 License:        BSD3 
 License-file:   LICENSE
 Author:         Johnny Morrice
@@ -14,5 +14,5 @@
 Cabal-version:  >=1.2.0
 
 Library
-   Build-Depends:  base, tagsoup, parsec<3
+   Build-Depends:  base<5, tagsoup, parsec<3
    Exposed-modules: Text.HTML.TagSoup.Parsec
