[Haskell-beginners] More Context for Failures (Data.Aeson)

Brent Yorgey byorgey at seas.upenn.edu
Fri Feb 24 02:22:37 CET 2012


On Thu, Feb 23, 2012 at 02:51:57PM -0500, Brent Yorgey wrote:
> 
>   failureContext :: String -> Parser a -> Parser a
>   failureContext branch p = Parser (\f s -> runParser p (f . (++(branch ++ ": "))) s)

Whoops, of course that should be

  ((branch ++ ": ") ++)

instead of

  (++ (branch ++ ": "))

to put the branch tag on the beginning instead of the end of the
message.

-Brent



More information about the Beginners mailing list