dhall-lang / dhall-haskell

Maintainable configuration files
https://dhall-lang.org/
BSD 3-Clause "New" or "Revised" License
908 stars 211 forks source link

Add Natural/showHex builtin #2538

Closed kukimik closed 8 months ago

kukimik commented 9 months ago

Implementation of https://github.com/dhall-lang/dhall-lang/pull/1351.

Mostly copy-pasted from https://github.com/dhall-lang/dhall-haskell/commit/3aadd5730bc23d39f765aea99bd2ee38a38f6947.

kukimik commented 8 months ago

Unfortunately I don't know nix and I wasn't able to add a proper nix interpretation of showHex in dhall-nix/src/Dhall/Nix.hs. I've found something called lib.trivial.toHexString, but this probably can't be used directly.

I've learnt enough nix to write this function down :tada: (which turned out to be rather easy), now I just need to find a moment to hnix-ify it.

kukimik commented 8 months ago

I added a nix translation of Natural/showHex. I don't really like the elemAt approach; I'd rather do it like this, but I didn't have the time to dig through hnix's Antiquotes. Perhaps the current solution is good enough.

Gabriella439 commented 8 months ago

Just FYI: I'm probably going to cut a release of the Haskell implementation before merging this and the corresponding dhall-lang PR, just because I'm a bit overdue on cutting a release

kukimik commented 8 months ago

Closing the PR for now; see the discussion in https://github.com/dhall-lang/dhall-lang/pull/1351.