--- haxml-1.13.2/src/Text/XML/HaXml/Html/Parse.hs~	2006-09-08 02:08:07.000000000 -0700
+++ haxml-1.13.2/src/Text/XML/HaXml/Html/Parse.hs	2007-12-17 10:06:19.000000000 -0800
@@ -48,6 +49,10 @@
 htmlParse name = simplify . sanitycheck . Prelude.either error id
                  . papply' document () . xmlLex name
 
+htmlParseEither :: String -> String -> Either String Document
+htmlParseEither name = Prelude.either Left (Right . simplify . sanitycheck)
+                  . papply' document () . xmlLex name
+
 sanitycheck :: Show p => [(a,s,[Either String (p,t)])] -> a
 sanitycheck [] = error "***Error at line 0: document not HTML?"
 sanitycheck ((x,_,[]):_) = x

