Commit 6159472
authored
Interval formatters (#17)
* WIP Interval formatters
* fix number parser in duration
* update Data.Interval
* refactor Duration parser
at this point we need to upgrade to ps@0.11
* add is valid iso duration test
* add interval parsers
* extract parsers in seperate module
* move 'digit' to parser.number
* remove State from unformatParser
* use weaker hoistParserT
* use ParserT instead of Parser
* use more oneOfAs
* export unformatParser from DateTime; fix interval related parser tests
* un-export HasDuration for Duration (live one for IsoDuration only)
* add tests for all variation of valid Recurringinterval
* add Eq and Show instance for datetime.FormatterF
* make formatterF parser error a bit more usable
* include error position in error string of parser result
* use ps-spec and refactor tests to more generative style
* remove some outdated commets
* fix let usage
* remove 'Q', 'X', 'W' from restricted chars of placeholder
* fix failing test
* make Number.Formatter newtype
reason is that we need to use it in tests where values need to implement Eq and Show
* refactor numeralTests
* refactor tests
* merge Parser/DateTime back into DateTime
* fix warning
* update ps-parser
* add invalid interval/durations; fix parsing of PT1M
* update ps-spec
* update ps-parser
* remove Has{Duration,Date} class; add EOF to runP
we want to fully consume input when parsers are executed
* remove unused ps-debug
* add format function; refactor interval tests
* use forAll for testing
* refactor padDoubleDigit
* add resoliutions
* fix resolution
* add space to formatterFShow
* use <?>
* refactor digit parsing
* remove unneeded range checks
the range check is not relevent then we have know exact length of digits and range is min and max for the number
* reorder parseInt validations so that we don't need parens
* add noValidate
* refactor datetime parser
* don't use MonadState with P.ParserT
* use readFloat in parseFractional
* refactor parseMaybeInteger
* refactor unEither
* refactor foldFoldableMaybe
* fix where indentation
* more where indentation
* add Newtype instance for Number.Formatter; derive Eq
* derive Eq for DateTime.FormatterF
* derive Functor for DateTime.FormatterF
* replace -> with →
* replace :: with ∷
* replace <- with ←
* replace => with ⇒
* replace forall with ∀
* replace more => with ⇒
* use monoid instance of ReaderT in parser validators
* change Formatter to List FormatterCommands
* unflip
* remove unused
* fix parsing formats like 'HHmm' (without seperators)
* fix build
* fix 'SS' and 'S' parsing
* export printFormatterCommand
* update ps-datetime
* remove unused
* use published version of purescript-lists
* update ps-transformers
* use unsafePartial instead of unsafePartialBecause
* update datetime
* fix number test
* remove some old todos
* use released version of ps-datetime
* fix first char case in errors.
* add todo on negative numbers
* fix lifts
* fix arrows and forall
* fix double let
* use lift2 and sort imports
* remove outdated anotation
* let on next line
* rename notEmpty to failIfEmpty1 parent 39816bd commit 6159472
File tree
15 files changed
+1049
-669
lines changed- src/Data/Formatter
- Parser
- test/src
15 files changed
+1049
-669
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
| 29 | + | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
| 33 | + | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
26 | 29 | | |
27 | 30 | | |
28 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
29 | 35 | | |
30 | 36 | | |
0 commit comments