Logs: liberachat/#haskell
| 2021-07-19 17:16:10 | <jumper149> | I want to choose a Haskell formatter. Are there any nice comparisons? Maybe a blog post? |
| 2021-07-19 17:16:12 | → | gioyik joins (~gioyik@gateway/tor-sasl/gioyik) |
| 2021-07-19 17:17:00 | <[exa]> | jumper149: probably best to ask yourself why you want the formatting at first |
| 2021-07-19 17:17:07 | <dsal> | Haskell In Depth went over them slightly, but didn't offer an opinion. |
| 2021-07-19 17:17:32 | <dsal> | IMO, ormolu is weird and wrong, but it's the new kid and at least some people like it. |
| 2021-07-19 17:17:34 | <dminuoso> | I chose emacs as my formatter. I can press enter, and it formats the code nicely. |
| 2021-07-19 17:17:35 | → | azeem joins (~azeem@176.200.239.190) |
| 2021-07-19 17:17:35 | → | benin0369 joins (~benin@183.82.176.182) |
| 2021-07-19 17:17:49 | <dminuoso> | If it does it wrong, I can change the indentation with a single keypress. |
| 2021-07-19 17:17:55 | <[exa]> | fourmolu is kinda less bad than ormolu |
| 2021-07-19 17:18:17 | geekosaur | formats man8ually as no formatter matches his preference |
| 2021-07-19 17:18:30 | <dsal> | I use stylish-haskell when I remember. It usually does OK. |
| 2021-07-19 17:18:41 | <jumper149> | I want formatting to be consistent over a project. And I would like something that makes sense with git. |
| 2021-07-19 17:18:48 | <maerwald> | brittany got close to my needs, but it tends to pull apart code so much that stuff becomes overly verbose |
| 2021-07-19 17:18:55 | <dsal> | I mainly like my imports tidy. |
| 2021-07-19 17:18:59 | <dminuoso> | jumper149: A consistent style is already a bizarre thing. |
| 2021-07-19 17:19:02 | <dsal> | jumper149: git just stores blobs, so that's not a big deal. :) |
| 2021-07-19 17:19:11 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-19 17:19:11 | <dminuoso> | jumper149: Code formatting communicates intent and structure, its highly contextual. |
| 2021-07-19 17:19:22 | → | burnsidesLlama joins (~burnsides@dhcp168-011.wadham.ox.ac.uk) |
| 2021-07-19 17:19:39 | <maerwald> | dminuoso: yes, the consistency argument is mostly nonsense imo. The "I'm too lazy argument" I can get behind |
| 2021-07-19 17:19:42 | <maerwald> | because I am |
| 2021-07-19 17:19:43 | <dsal> | ormolu was inspired by elm's canonical format in a lot of way and they prioritized making it easy to read diffs generated by whatever tools they happened to use. This is a terrible mistake, IMO. |
| 2021-07-19 17:19:45 | <monochrom> | Perhaps "makes sense with git" means "makes sense with diff". |
| 2021-07-19 17:19:49 | <dminuoso> | It's sort of the equivalent of saying "a paragraph must always have 3 sentences". It's a stupid proposition to begin with. |
| 2021-07-19 17:20:01 | <jumper149> | monochrom: exactly! |
| 2021-07-19 17:20:21 | <dminuoso> | Yes, if each paragraph has 3 sentences, you have a consistent formatting of your natural language. But it really hampers readability |
| 2021-07-19 17:20:25 | <dsal> | Most of the time when I'm reading code, I'm not reading diffs. I'd rather prioritize the code over the diffs. |
| 2021-07-19 17:20:32 | <monochrom> | People keep XYing their diction all the time. Remember that one time when someone said "haddock" to mean doctest? |
| 2021-07-19 17:20:33 | × | xff0x_ quits (~xff0x@2001:1a81:5299:ea00:490d:5ed2:61e8:145d) (Ping timeout: 255 seconds) |
| 2021-07-19 17:20:38 | × | azeem quits (~azeem@176.200.239.190) (Read error: Connection reset by peer) |
| 2021-07-19 17:21:24 | → | xff0x_ joins (~xff0x@2001:1a81:5299:ea00:2c16:bae7:eca6:fd06) |
| 2021-07-19 17:21:48 | → | azeem joins (~azeem@dynamic-adsl-94-34-39-251.clienti.tiscali.it) |
| 2021-07-19 17:21:49 | <maerwald> | dsal: in a lot of PRs I've seen at work there was no way to understand anything from the diff without a walkthrough by the author. Even looking at my own PRs I don't understand anything. In some companies the author writes a walkthrough in the diff comments, but even then: diffs lie |
| 2021-07-19 17:22:16 | <maerwald> | you don't see the code you changed, only the lines you changed |
| 2021-07-19 17:22:26 | <jumper149> | I particularly want a formatter for stuff like same style Haddocks (-- vs {- -}), sorted imports and extensions. |
| 2021-07-19 17:22:36 | → | favonia joins (~favonia@user/favonia) |
| 2021-07-19 17:22:43 | <dminuoso> | jumper149: For import/extensions sorting, I find stylish-haskell to be agreeable. |
| 2021-07-19 17:22:49 | <dminuoso> | (It just breaks in the presence of QQs and TH) |
| 2021-07-19 17:22:54 | <maerwald> | and CPP |
| 2021-07-19 17:23:16 | <dminuoso> | jumper149: But note, you should chose your tool to fit *your* style. |
| 2021-07-19 17:23:16 | <dsal> | maerwald: yeah. I have that problem reading diffs sometimes. Like, cool you changed x to y... but what was x and what's y? |
| 2021-07-19 17:23:34 | <maerwald> | also: reverse dependencies of your code |
| 2021-07-19 17:23:57 | <maerwald> | you might need to re-read the entire codebase from a different perspective |
| 2021-07-19 17:24:21 | <maerwald> | while the scrum master is asking why the PR is still not merged |
| 2021-07-19 17:24:34 | × | burnsidesLlama quits (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Ping timeout: 240 seconds) |
| 2021-07-19 17:24:56 | <maerwald> | but hey... not everyone works in security critical code: just push and hope for the best |
| 2021-07-19 17:25:02 | <monochrom> | "the closer you look, the less you see" |
| 2021-07-19 17:25:30 | <dminuoso> | monochrom: Yes, that was the mentality of openssl. Distance yourself from the code and embrace Heartbleed! |
| 2021-07-19 17:25:32 | <dsal> | These modern "diff-friendly" things take something small, clear and readable and make me have to scroll to understand what's going on. https://www.irccloud.com/pastebin/dhodxIZ7/ok.elm |
| 2021-07-19 17:25:42 | <monochrom> | haha |
| 2021-07-19 17:26:11 | <geekosaur> | I somewhat regularly have to click on the extend buttons in github to understand a diff |
| 2021-07-19 17:26:26 | <geekosaur> | which is the simple version of this |
| 2021-07-19 17:26:54 | <monochrom> | Clearly, the logical conclusion is one token per line. >:) |
| 2021-07-19 17:27:08 | <dsal> | There are lots of cases where formatters seem to do that. |
| 2021-07-19 17:27:13 | <maerwald> | There is a very grumpy C coder on my LinkedIn feed, always riling about security and code correctness. Then one day he wrote why: his bug actually killed people, because it was some control system about pressure valves. |
| 2021-07-19 17:27:16 | <dsal> | With lines between them. |
| 2021-07-19 17:28:05 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 2021-07-19 17:28:09 | <dsal> | monochrom: Like, imagine how hard this would be to read if that 'o' shared a line with any of the other code: https://www.irccloud.com/pastebin/lIpmTDCu/format.elm |
| 2021-07-19 17:28:18 | <maerwald> | but I don't know what he thinks of code formatters |
| 2021-07-19 17:28:40 | <maerwald> | then again: that's a solved issue in C anyway |
| 2021-07-19 17:29:15 | <dsal> | I really like tools that do static analysis and stuff in my code to tell me when I could do things better. That's an unreasonably hard problem to solve well, though. |
| 2021-07-19 17:29:49 | → | Deide joins (~Deide@user/deide) |
| 2021-07-19 17:34:15 | → | o1lo01ol1o joins (~o1lo01ol1@bl11-109-140.dsl.telepac.pt) |
| 2021-07-19 17:34:59 | <maerwald> | I think the main question is: do you align code or just do syntactical indenting |
| 2021-07-19 17:36:35 | → | euouae joins (~euouae@user/euouae) |
| 2021-07-19 17:36:50 | <euouae> | Hello |
| 2021-07-19 17:37:15 | <euouae> | I want to create a lazy list whose nth element is a function of its predecessor |
| 2021-07-19 17:37:21 | × | dajoer quits (~david@user/gvx) (Quit: leaving) |
| 2021-07-19 17:37:27 | <monochrom> | iterate |
| 2021-07-19 17:37:38 | <euouae> | What do you mean |
| 2021-07-19 17:37:49 | <monochrom> | Look for that function name in the standard library. |
| 2021-07-19 17:39:21 | <euouae> | Thank you ! |
| 2021-07-19 17:39:53 | <maerwald> | @hoogle iterate |
| 2021-07-19 17:39:53 | <lambdabot> | Prelude iterate :: (a -> a) -> a -> [a] |
| 2021-07-19 17:39:53 | <lambdabot> | Data.List iterate :: (a -> a) -> a -> [a] |
| 2021-07-19 17:39:53 | <lambdabot> | Data.List.NonEmpty iterate :: (a -> a) -> a -> NonEmpty a |
| 2021-07-19 17:40:27 | <maerwald> | @where hoogle |
| 2021-07-19 17:40:27 | <lambdabot> | http://haskell.org/hoogle http://hoogle.haskell.org http://fpcomplete.com/hoogle – See also Hayoo, which searches more packages: http://hayoo.fh-wedel.de/ |
| 2021-07-19 17:40:40 | <maerwald> | hayoo is dead no? |
| 2021-07-19 17:40:44 | × | benin0369 quits (~benin@183.82.176.182) (Ping timeout: 268 seconds) |
| 2021-07-19 17:41:01 | <maerwald> | and the fpcomplete link too |
| 2021-07-19 17:41:16 | <monochrom> | yikes |
| 2021-07-19 17:41:44 | <geekosaur> | yeh, nobody's updated that |
| 2021-07-19 17:42:03 | → | chomwitt joins (~chomwitt@athedsl-32487.home.otenet.gr) |
| 2021-07-19 17:42:24 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2021-07-19 17:42:39 | <euouae> | Has anyone tried Haskell on a supercomputer? |
| 2021-07-19 17:42:48 | <geekosaur> | @where+ hoogle https://hoogle.haskell.org see also https://haskell.org/hoogle which searches a different default set of libraries |
| 2021-07-19 17:42:48 | <lambdabot> | I will remember. |
| 2021-07-19 17:43:04 | <geekosaur> | define supercomputer |
| 2021-07-19 17:43:15 | <maerwald> | for me, both links are the same |
| 2021-07-19 17:43:33 | <geekosaur> | interesting, maybe they made the old one go away |
| 2021-07-19 17:43:34 | <maerwald> | haskell.org/hoogle redirects to hoogle.haskell.org |
| 2021-07-19 17:43:40 | <euouae> | Hmm I’m trying to run a lot of computations and get an answer |
| 2021-07-19 17:43:46 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 240 seconds) |
| 2021-07-19 17:43:53 | <euouae> | for now I have like 100 cores etc |
| 2021-07-19 17:43:56 | <geekosaur> | @where+ hoogle https://hoogle.haskell.org |
| 2021-07-19 17:43:56 | <lambdabot> | Nice! |
| 2021-07-19 17:44:47 | → | maxie joins (~IceChat95@45.100.3.196) |
| 2021-07-19 17:44:49 | <dmj`> | Someone should write a library for parsing XML with GHC.Generics |
All times are in UTC.