-- * Functions related to parsing

-- | Like normal parse but does not accept Partial
parseNoPartial :: P.Parser a -> Text -> P.IResult Text a
parseNoPartial p t = finalize result
  where result = P.parse p t
        finalize r = case r of
                       P.Partial f -> finalize $ f ""
                       _ -> r

-- | Only test if the pattern is valid, don't use results
parseNoPartial :: P.Parser a -> Text -> P.IResult Text a
parseNoPartial p t = finalize result
  where result = P.parse p t
        finalize r = case r of
                       P.Partial f -> finalize $ f ""
                       _ -> r

-- | Only test if the pattern is valid, don't use results
parseNoPartial p t = finalize result
  where result = P.parse p t
        finalize r = case r of
                       P.Partial f -> finalize $ f ""
                       _ -> r

-- | Only test if the pattern is valid, don't use results