I would like to use these utility functions in my hledger-interest tool, and I'd rather avoid duplicating the definitions of these functions (even though they are quite short).
export failIfInvalidMonth/Day (fixes #216)
Very cool, thank you! I need to parse any kind of ISO'ish date, i.e. anything that resembles the YYYY-MM-DD format. I considered using the smart date parser from HLedger, but that parser accepts all kind of crazy formats like "today" which I don't want to recognize. So I ended up writing my own little parser. It feels silly to duplicate that functionality, though. Is there maybe a better alternative available in hledger-lib that I missed?
They're in Hledger.Data.Dates (code) - how about parsedate or parsedateM ? Or the currently unexported ymd parser. parsetimewith shows how to use Data.Time.Format to parse any format.
It looks like ymd is the parser I want -- its code looks pretty much exactly like the function I have now. parsedateM looks good, too, though. It's nice that the function doesn't depend on Parsec. I'll to have to think about this subject for a moment before I can figure out what works best for me. Thanks for the comments!