Closed tel closed 11 years ago
I'm aware of this. If you have control over the input, please use delimiters. (ISO-8601's YYYY-mm-dd
is nice... there's even an XKCD strip about it.)
It was a conscious decision on my part to avoid any assumptions about the number of digits for the year (consider the years outside of [1000,9999]
...). I'll see if I can make the parser backtrack in this case, although that will probably affect performance.
Unfortunately, no I'm trying to parse someone else's dates. I do think it's fairly common to write non-delimited dates, despite the speed impact. Perhaps it'd be best to have a compliant parser by default (since the String-based routes will be slow regardless) but provide a fast timeParserFast with commentary that it requires delimited dates?
Joseph
On Sat, Sep 21, 2013 at 3:28 AM, Liyang HU notifications@github.com wrote:
I'm aware of this. If you have control over the input, please use delimiters. (ISO-8601's
YYYY-mm-dd
is nice... there's even an XKCD strip about it.)It was a conscious decision on my part to avoid any assumptions about the number of digits for the year (consider the years outside of
[1000,9999]
...). I'll see if I can make the parser backtrack in this case, although that will probably affect performance.Reply to this email directly or view it on GitHub: https://github.com/liyang/thyme/issues/5#issuecomment-24857680
I really do wish people would just use ISO though.
Joseph
On Sat, Sep 21, 2013 at 3:28 AM, Liyang HU notifications@github.com wrote:
I'm aware of this. If you have control over the input, please use delimiters. (ISO-8601's
YYYY-mm-dd
is nice... there's even an XKCD strip about it.)It was a conscious decision on my part to avoid any assumptions about the number of digits for the year (consider the years outside of
[1000,9999]
...). I'll see if I can make the parser backtrack in this case, although that will probably affect performance.Reply to this email directly or view it on GitHub: https://github.com/liyang/thyme/issues/5#issuecomment-24857680
When parsing a non-delimited time expression like
YYYYMMDD
formatTime
properly emits it byreadTime
fails to parse it.I believe this is because the underlying attoparsec parser is consuming the entire string while reading a number instead of limiting itself to just the first 4 digits.