Commit Graph

59 Commits

Author SHA1 Message Date
Kirill Elagin
1b6156f286 meta: Use haskell.nix flake lib 2021-11-03 19:14:31 -04:00
Kirill Elagin
e401b2175a meta: Run checks against 8.10.7 2021-11-03 17:41:16 -04:00
Kirill Elagin
369ecd4c86 meta: Use Serokell flake registry
Previously, we were pinning Nix dependencies, such as haskell.nix
manually. Now we simply rely on Serokell’s flake registry, which has the
right versions pinned that are available in the binary cache.
2021-11-03 17:41:16 -04:00
Kirill Elagin
5d67e834a4 meta: Bump LTS to 18.14 (GHC 8.10.7) 2021-11-03 16:19:02 -04:00
Kirill Elagin
63b26842be deps: Allow GHC 9.0.1
* Bump the upper bound on `base` to allow GHC 9.
* Add GHC 9.0.1 to the set of flake checks.
* Add hedgehog-1.0.5 to extra-deps (it fixes GHC 9).
2021-03-29 10:42:40 -04:00
Kirill Elagin
addd9ce503 ci: Add checks for different GHC versions
Repin haskell.nix and generate checks for multiple chosen versions of GHC.
2021-03-29 08:37:05 -04:00
Kirill Elagin
b60991303f Release v1.0.2.2 2021-02-17 22:24:51 -05:00
Kirill Elagin
ad7ffd99e2 Bump Stackage LTS 2021-02-17 22:13:31 -05:00
Kirill Elagin
c916ad47c3 Convert to a proper flake
* Get rid of Niv
* Repin haskell.nix
* Repin nixpkgs
2021-02-17 22:13:07 -05:00
Kirill Elagin
f26ba120c2
Merge pull request #11 from serokell/heitor.toledo/#9-fix-compilation-on-windows
[#9] Fix compilation of executable on Windows
2021-02-17 20:58:36 -05:00
Heitor Toledo Lassarote de Paula
19bcaa2419 [#9] Fix compilation of executable on Windows
Problem: Compilation of the executable on Windows fails with 'Module
`GHC.IO.Encoding.Iconv' does not export `localeEncodingName'`

Solution: Check if we are on Windows, and don't import such module or
use `localeEncodingName` if it's the case.
2021-02-15 11:29:35 -03:00
Kirill Elagin
57b6845f5e doc: Clarify a bit 2020-06-11 15:58:50 +03:00
Kirill Elagin
7b44ddcb01 doc: Make the blog link more visible 2020-06-11 15:56:10 +03:00
Kirill Elagin
d684f37997 stack.yaml: Bump th-env 2020-06-11 15:55:48 +03:00
Kirill Elagin
fdcc1ef258 Bump to v1.0.2.1 2020-05-20 01:32:53 +03:00
Kirill Elagin
f30fc05be0 utf8-troubleshoot: Specify bounds on deps 2020-05-20 01:26:18 +03:00
Kirill Elagin
a6f79bf38d utf-troubleshoot: Fix build with GHC 8.2.2 2020-05-20 01:26:18 +03:00
Kirill Elagin
d0c01c253c Fix a typo 2020-05-20 01:13:02 +03:00
Kirill Elagin
1f195f8052 Release v1.0.2.0 2020-05-15 16:32:49 +03:00
Kirill Elagin
90e730eaf2 meta: Commit the .cabal file 2020-05-15 16:29:45 +03:00
Kirill Elagin
5aaec58eaf license: Clarify nix/* licenses 2020-05-15 16:28:40 +03:00
Kirill Elagin
01f0ccc38c license: Move tags from dep5 to .license files 2020-05-15 16:25:44 +03:00
Kirill Elagin
7f0d0d619c license: Remove header from changelog to make Hackage happy 2020-05-15 16:24:53 +03:00
Kirill Elagin
2a671c261b troubleshoot: Remove unneeded full stops 2020-05-15 16:22:53 +03:00
Kirill Elagin
c5221f4f1c troubleshoot: Detect Nix builds and show LOCALE_ARCHIVE 2020-05-15 16:22:53 +03:00
Kirill Elagin
f9aea084bb troubleshoot: Show listing locale-archive early
In case something bad happens with `localedef --list`, print the header
early to make it clear what failed.
Also, print the exception, if it happened.
2020-05-15 16:22:53 +03:00
Kirill Elagin
b5451aa606 utf8-troubleshoot: Only show relevant env vars 2020-05-15 16:22:53 +03:00
Kirill Elagin
e595be6575 utf8-troubleshoot: Update Changelog 2020-05-15 16:22:53 +03:00
Kirill Elagin
6626507c16 troubleshoot: Add C stuff 2020-05-15 16:22:53 +03:00
Kirill Elagin
4074fe8f8d troubleshoot: Improve locale detection
* Use `localectl list-locales` if possible.
* Otherwise list `/usr/lib/locale` and try to use `localedef` to list
  `/usr/lib/locale/locale-archive`.
* Do not bother with `/usr/share/locale` as, it turns out, it is only used
  for localisations by third-party programs on Linux. Strangely, macOS
  seems to have actual locale definitions in there, but this tool is
  mostly aimed at Linux, since macOS installations are pretty uniform.
2020-04-21 14:05:53 +03:00
Kirill Elagin
976e81391a Release v1.0.1.0 2020-04-21 02:19:08 +03:00
Kirill Elagin
28a16678d5 Bump base for GHC 8.10 2020-04-21 02:15:19 +03:00
Kirill Elagin
bf51f1208b troubleshoot: Show basic system info 2020-04-21 01:51:15 +03:00
Kirill Elagin
b42026b313 troubleshoot: Make the troubleshooting tool 2020-04-21 01:40:36 +03:00
Kirill Elagin
380afc64d4 Release v1.0.0.0 2020-03-04 00:06:35 -05:00
Kirill Elagin
5344dd7654 Add upper bounds on library deps 2020-02-26 22:46:45 -05:00
Kirill Elagin
d364dcf52c Relax bound on base (allow 8.2 and 8.8) 2020-02-26 22:46:31 -05:00
Kirill Elagin
f1407c5e7a meta: Rename to with-utf8 2020-02-26 22:00:59 -05:00
Kirill Elagin
6aa91803d8 Remove license header from README
* Move README licensing information to .reuse/dep5
  to make Hackage happy (it doesn’t know to ignore HTML comments
  in Markdown).
2020-02-18 00:35:32 -05:00
Kirill Elagin
ad3837c595 cabal: Update metainfo
* Add dependency version bounds for the library
* Add category
2020-02-18 00:32:12 -05:00
Kirill Elagin
7cab5d1b7c Update documentation
* Add links to the prospective blog post everywhere.
* Fix tiny issues.
* Add package description for Hackage.
2020-02-17 20:00:13 -05:00
Kirill Elagin
c68db4da46 Merge branch 'kirelagin/do-not-change-std' 2020-02-17 19:41:01 -05:00
Kirill Elagin
0744864fd0 Fixup documentation 2020-02-17 19:39:55 -05:00
Kirill Elagin
40069d4b2b Allow not changing file handles to UTF-8
The old interface only allowed one to perform terminal detection on a
handle and change it to UTF-8 if it was not a terminal. Turns our, it
makes sense to sometimes leave the original encoding on a handle even if
it does not point to a terminal.

* Change the interface to separate these two use-cases.
* Extract main-wrappers to a new `Main` module.
2020-02-17 19:39:40 -05:00
Kirill Elagin
8a76bb2577 Add test for a binary terminal 2020-02-17 17:58:29 -05:00
Kirill Elagin
93bf56ea57 test: Use a pseudo-terminal for testing
Previously the code was using stdout for testing the terminal detection
functionality. However, there is no guarantee that the tests will always
be running with stdout attached to a terminal.

Create a fresh pseudo-terminal instead and use it instead of stdout.
2020-02-17 17:58:29 -05:00
Kirill Elagin
f6bc3fc0ca Add correctness tests
* Split out the actual encoding choice logic into a separate Internal
  module to make it possible to cover it with tests.
* Make this function a little more efficient compared to the previous
  purely pure function.
* Keep a completely pure function as a specficiation for ease of reading
  and for testing by comparing the actualy function to the pure one.

* Add tests that check that the pure function makes sense.
* Add tests that compare the output of the real function to the output
  of the pure function on some real handles.
* Add tests that check that functions that are supposed to actually
  modify the encoding of a handle actually do modify it.
2020-02-17 17:58:29 -05:00
Kirill Elagin
59af11bc28
Merge pull request #2 from serokell/kirelagin/haskell-nix
Build with haskell.nix
2020-02-17 17:57:31 -05:00
Kirill Elagin
5cce9dcbd2
Merge pull request #1 from serokell/kirelagin/first-version
[INT-146] First version imported from nixfmt
2020-02-17 17:57:12 -05:00
Kirill Elagin
83f7b5967e Add lazy versions of Text functions
We had `readFile` and `writeFile` fot strict `Text`, but not for
lazy.

Add lazy versions of the same functions, basically, by copy-pasting.
2020-02-17 17:53:04 -05:00