garlic-bread: A monad transformer for keeping track of where you've come from.

[ bsd3, control, library ] [ Propose Tags ] [ Report a vulnerability ]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1
Change log ChangeLog.md
Dependencies base (>=4.9 && <5), mtl, transformers [details]
License BSD-3-Clause
Copyright 2018 Matt Parsons
Author Matt Parsons
Maintainer parsonsmatt@gmail.com
Category Control
Home page https://github.com/parsonsmatt/garlic-bread#readme
Bug tracker https://github.com/parsonsmatt/garlic-bread/issues
Source repo head: git clone https://github.com/parsonsmatt/garlic-bread
Uploaded by parsonsmatt at 2018-03-17T07:23:42Z
Distributions NixOS:0.1.0.1
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1403 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-03-17 [all 1 reports]

Readme for garlic-bread-0.1.0.1

[back to package description]

garlic-bread

Build Status

A monad transformer for remembering where you've been.

Example: XML parsing

The initial inspiration for this library came in the form of parsing XML. Buggy, underspecified, weird XML. I'd write a parser, and it would work OK on the test data, but then we'd release it into production, and suddenly it found parse errors. These documents were huge, repetitive, deeply nested, and unweildy.

I quickly realized that I needed a way to remember where I've been. Remembering the tales of Theseus and the Minotaur and was Hansel and Gretel, I started writing some combinators to remember the path through the XML document. When a parse failed, I bubbled the breadcrumbs up.

Suddenly, reading the error messages became easy: it told me exactly how to get to the data that failed the test!