-
Notifications
You must be signed in to change notification settings - Fork 28
Initial #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial #1
Conversation
I'm not at my desk right now so will review properly when I get home, but just from skimming on my phone this looks cool! From a meta point of view, maybe we should break these up into separate repos though? Date and number formatting don't have much in common together, even though date formatting probably depends on number formatting. |
map f (Placeholder str a) = Placeholder str $ f a | ||
map f End = End | ||
|
||
type Formatter = Mu FormatterF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the idea with using Mu
here, rather than something like newtype Formatter = List FormatterF
? I mean, it definitely works! But it wouldn't have occurred to me to use Mu
for any non-tree structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I don't know why I chosed Mu
rather then List
. That was my first intent and it works, so I didn't even try List
We could probably do with adding some documentation explaining the options for the format strings. The date ones I'm familiar with already, so had no problem there, but I'm having difficulty figuring out how the number format patterns actually work: does it matter where the comma appears, for instance, and what does "after" and "before" refer to with that? Places before/after the decimal point? I'm not sure the numeric formats are actually working correctly either:
|
I think it's ok to have both formatters in one library because
|
|
||
Formatter has following properties | ||
+ Number of digits before dot | ||
+ Numberr of digits after dot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor typo: "numberr" 😄
Updated readme |
then use formatter to result of division of input number and that power. | ||
+ `0a`: `1234567 -> "1M"`, `1 -> "1"` | ||
|
||
## Datetim formatters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Datetim" -> "Date/Time"? 😄
When the tests pass this time (:wink:) :+1: from me. I'll hook up the dependency badges and stuff like that before making a release though, so if you just merge this I can make the actual release shortly after, if that's good with you? |
Yep, I was thinking about making something like Thanks for review! |
Ah good point! Go ahead with the release then and I'll get the other stuff in place for the bumped version release. |
There is no real tests, just couple checks that this works. I'll add them during work on
purescirpt-echarts
update.Fixes slamdata/slamdata#954
@garyb Please review