Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,802,977 events total
2021-07-18 16:58:06 <Guest31> What would be an example of good style with Where monochrom?
2021-07-18 16:58:15 <Guest31> in your opinion
2021-07-18 16:58:20 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
2021-07-18 16:59:37 <monochrom> <monochrom> This is why the line of "where" should contain nothing else.
2021-07-18 16:59:47 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
2021-07-18 17:01:23 <c_wraith> I've been working hard recently to style my haskell code such that no indentation depends on any token length
2021-07-18 17:01:54 chris_ joins (~chris@81.96.113.213)
2021-07-18 17:01:57 <c_wraith> It's awkward in some places, but it's got huge advantages
2021-07-18 17:03:22 <monochrom> Yeah, "f x | x>0 = ..." is fairly natural, to always split it takes way too much discipline.
2021-07-18 17:04:11 <monochrom> Furthermore if you split at both | and = it looks ugly for short code. (But makes perfect sense for long code.)
2021-07-18 17:04:48 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2021-07-18 17:05:55 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
2021-07-18 17:06:09 × chris_ quits (~chris@81.96.113.213) (Ping timeout: 255 seconds)
2021-07-18 17:09:48 <dsal> I might have to start using oumolu which, as tweag says in their blog post: ormolu: format haskell code like never before (except they did that in all caps)
2021-07-18 17:10:34 falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net)
2021-07-18 17:12:07 <Franciman> I personally try to shy away from any tool
2021-07-18 17:12:10 <Franciman> i use just ghc
2021-07-18 17:12:25 <Franciman> ghc --make
2021-07-18 17:12:27 <Franciman> is all I need
2021-07-18 17:12:32 <Franciman> oh and ghcup
2021-07-18 17:12:37 <Franciman> ghcup is unvaluable
2021-07-18 17:12:52 <davean> I still haven't used ghcup
2021-07-18 17:12:57 <dsal> If you're not the first member on an established team, they might be upset with you if you decided to ignore all their ways.
2021-07-18 17:13:34 <davean> I'd be upset to end up with the mess that is oumolu how ever it happened :-p
2021-07-18 17:13:58 <dsal> :( Yeah. That's the biggest downside I'm facing.
2021-07-18 17:14:22 <davean> oumolu has no concept of the code its formating
2021-07-18 17:14:29 <davean> it can only consider syntax, not content
2021-07-18 17:14:42 <davean> so every human element is thrown out the window
2021-07-18 17:14:43 <dsal> They took a lot from elm which prioritized reading diffs over reading code.
2021-07-18 17:14:49 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2021-07-18 17:15:35 <dsal> IMO, fixing the stuff that renders diffs would be a saner approach than making all the code harder to read.
2021-07-18 17:15:55 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
2021-07-18 17:16:14 oso joins (~oso@2601:58c:c080:a950:e67d:b4e2:c5be:433f)
2021-07-18 17:18:23 <geekosaur> --make hasn't been needed for a while now (since ghc 6.12 iirc)
2021-07-18 17:19:03 <dsal> I lose most of my excitement about elm, dhall, etc... when I have to do things their One True Way™. I passed a thing I wrote in elm through their standard formatter and got this: https://www.irccloud.com/pastebin/lIpmTDCu/format.elm
2021-07-18 17:19:14 <geekosaur> I'm a little surprised it hasn't been deprecated
2021-07-18 17:19:32 <dsal> I've not used ormolu much myself, but I expect I'll be seeing more such doublings where I can't read a function on my screen anymore.
2021-07-18 17:21:13 burnsidesLlama joins (~burnsides@dhcp168-011.wadham.ox.ac.uk)
2021-07-18 17:22:06 <monochrom> In comp.lang.functional there was once a detractor who praised imperative programming for "one thing at a time, one concept per line" and attacked functional programming for the opposite.
2021-07-18 17:22:29 <monochrom> You have just shown an answer similar to mine :)
2021-07-18 17:22:55 <davean> lol. I've seen a lot of mixed concerns in imperative programming
2021-07-18 17:23:30 <maerwald> if you do imperative programming with shared mutability tamed, then that is workable
2021-07-18 17:24:09 × Null_A quits (~null_a@2601:645:8700:2290:a961:38e5:e25d:7cd0) (Ping timeout: 255 seconds)
2021-07-18 17:25:03 <monochrom> My reverse thinking is that whoever imposed that oversplitting style must have been an imperative bonehead who couldn't even understand in C "x = cos(t); y = sin(t);" if I wrote that as one line.
2021-07-18 17:25:24 <geekosaur> or a Python programmer
2021-07-18 17:25:29 × fef quits (~thedawn@user/thedawn) (Remote host closed the connection)
2021-07-18 17:25:54 <dsal> monochrom: please state your variable names in the form of complete sentences.
2021-07-18 17:26:12 <monochrom> haha yikes
2021-07-18 17:26:27 <davean> the_variable_x
2021-07-18 17:26:29 <geekosaur> I haven't programmed cobol in decades
2021-07-18 17:26:29 <dsal> I got in an argument with someone who said he had some kind of neurodivergence and couldn't possible comprehend code that used such short variable names.
2021-07-18 17:26:30 <davean> Done?
2021-07-18 17:26:45 <monochrom> COMPUTE COSINE OF T INTO X
2021-07-18 17:26:51 × burnsidesLlama quits (~burnsides@dhcp168-011.wadham.ox.ac.uk) (Ping timeout: 255 seconds)
2021-07-18 17:26:55 <monochrom> (let's go COBOL for complete sentences)
2021-07-18 17:26:58 P1RATEZ joins (piratez@user/p1ratez)
2021-07-18 17:28:23 <monochrom> COMPUTE COSINE OF T INTO THE_VAR_THAT_WOULD_BE_COSINE_OF_T
2021-07-18 17:28:35 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
2021-07-18 17:28:37 <monochrom> (inspired by the movie name "the kid that would be king" :) )
2021-07-18 17:29:05 <monochrom> "lady of the trig functions, please return the cosine of t"
2021-07-18 17:29:11 <monochrom> OK I'll stop.
2021-07-18 17:29:11 <oso> needs more "Please"
2021-07-18 17:29:23 hendursaga joins (~weechat@user/hendursaga)
2021-07-18 17:29:25 <davean> no, should be worded must
2021-07-18 17:29:29 <davean> we want to have confidence in it
2021-07-18 17:30:03 <oso> i was referencing INTERCAL, which wouldn't compile if you didn't say "please" enough but also wouldn't compile if you said it too much because you were being a suckup
2021-07-18 17:30:51 <davean> Yes but a function like "please_compute_the_cosine_of_t" might not
2021-07-18 17:30:56 <davean> you can't rely on your code being agreeable!
2021-07-18 17:31:26 <oso> true; on the contrary, i find my code to be most disagreeable
2021-07-18 17:33:00 × falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Remote host closed the connection)
2021-07-18 17:33:23 falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net)
2021-07-18 17:37:38 × mnrmnaugh quits (~mnrmnaugh@pool-96-252-87-182.bstnma.fios.verizon.net) (Quit: Leaving)
2021-07-18 17:40:04 <dsal> In go, we use Must as a prefix for things that will panic if they don't work.
2021-07-18 17:40:34 <davean> Ugh, like usuall go gets it wrong
2021-07-18 17:40:45 <davean> "must" should make it a total function that matches the specification
2021-07-18 17:40:53 × ph88^ quits (~ph88@ip5f5af6fd.dynamic.kabel-deutschland.de) (Ping timeout: 258 seconds)
2021-07-18 17:41:05 <davean> What part of "must" did they understand?
2021-07-18 17:41:18 <monochrom> mustHead (x:xs) = x \∩/
2021-07-18 17:42:00 <davean> monochrom: thats exactly the sort of thing "must" must fix!
2021-07-18 17:42:20 <monochrom> mustFix f = let x = f x in x
2021-07-18 17:42:40 × azeem quits (~azeem@dynamic-adsl-94-34-39-251.clienti.tiscali.it) (Ping timeout: 268 seconds)
2021-07-18 17:43:01 × neurocyte quits (~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
2021-07-18 17:43:21 azeem joins (~azeem@176.200.195.170)
2021-07-18 17:43:49 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2021-07-18 17:43:52 × oso quits (~oso@2601:58c:c080:a950:e67d:b4e2:c5be:433f) (Ping timeout: 246 seconds)
2021-07-18 17:44:14 <monochrom> OTOH perhaps "if they don't work" means "you can assume it works, only a system bug would be a reason why it doesn't, which is not your responsibility"
2021-07-18 17:44:57 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
2021-07-18 17:45:42 <davean> lets just always assume it works.
2021-07-18 17:45:43 <monochrom> OTOOH under multiple-world non-determinism and the convention "ignore those worlds that don't survive", the function works in all surviving worlds, so the modal quantifier "must" is right.
2021-07-18 17:45:57 <davean> Yah, now you're getting it
2021-07-18 17:46:03 <monochrom> :)
2021-07-18 17:46:53 lavaman joins (~lavaman@98.38.249.169)
2021-07-18 17:47:11 <davean> mustSort = randomizeOrder
2021-07-18 17:47:47 <dsal> must sort eventually
2021-07-18 17:48:06 <davean> dsal: No, quantum bogosort sorts in O(n)
2021-07-18 17:48:39 <dsal> I've been meaning to get a new computer for a while. Might as well be a quantum one.
2021-07-18 17:48:52 h98 joins (~h98@187.83.249.216.dyn.smithville.net)
2021-07-18 17:49:13 <davean> So, launch missiles is in IO, whats the monad of universes?
2021-07-18 17:49:43 <monochrom> []
2021-07-18 17:50:22 <monochrom> Dr. Strange and the LogicT monad transformer of madness

All times are in UTC.