triallax changed the topic of #numbat to: The Official Numbat channel https://numbat.dev | This channel is publicly logged at https://libera.irclog.whitequark.org/numbat | Please read https://workaround.org/getting-help-on-irc/ if you're new to IRC!
sharkdp has joined #numbat
sharkdp has quit [Remote host closed the connection]
sharkdp has joined #numbat
<achin> this new support for functions looks very cool
<sharkdp> I'm pretty excited about it :-) I just updated the description in https://github.com/sharkdp/numbat/pull/200 with some examples
<sharkdp> I'm thinking if we should embed timezone conversion in this new framework. It would be *slightly* less convenient (more to type)... but remove quite a bit of code.
<sharkdp> We would have to write something like `now() -> timezone("US/Pacific")` or `now() -> tz("US/Pacific")`
<achin> neat, you can chain operations like `now() -> unixtime -> hex`
<sharkdp> an `tz` would be a function with the signature `String -> Fn[(DateTime) -> DateTime]` that we would implement in ffi.rs
<sharkdp> "can you chain operations": yes
<achin> i assume "hex" is implement as "let hex = base(16)" ?
<achin> oh, nevermind, i had it backwards. base() is implemented in terms of bin and hex and friends
<sharkdp> yeah, that's a bit sad. We can't do this yet because we don't have closures/anonymous functions
<sharkdp> (or partial application)
sharkdp has quit [Remote host closed the connection]
sharkdp has joined #numbat
<sharkdp> The changes are now live on https://numbat.dev/, there is also some new documentation here: https://numbat.dev/doc/conversion-functions.html
sharkdp has quit [Remote host closed the connection]