2025/04/26

Newest at the top

2025-04-26 15:25:11 +0200skiusually calls a local worker `loop', if no other relevant name suggests itself
2025-04-26 15:22:07 +0200 <haskellbridge> <Liamzee> ah
2025-04-26 15:21:58 +0200 <__monty__> For operators.
2025-04-26 15:20:34 +0200 <haskellbridge> <Liamzee> for go? or for this kind of code replication reduction?
2025-04-26 15:17:48 +0200 <__monty__> I most commonly use `op` actually.
2025-04-26 15:13:47 +0200 <haskellbridge> <Liamzee> because no one ever uses it, fearing as pattern collision, and if it does cause an as pattern collision, the code will refuse to compile if both arguments are used (unless you're overriding something so a default vaule will continue to exist)
2025-04-26 15:10:30 +0200 <haskellbridge> <Liamzee> @ is actually safest
2025-04-26 15:07:05 +0200gorignak(~gorignak@user/gorignak) gorignak
2025-04-26 15:06:04 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2025-04-26 15:01:58 +0200 <haskellbridge> <Liamzee> come to think of it, why am i even bothering with fold?
2025-04-26 15:01:27 +0200 <haskellbridge> <Liamzee> so it doesn't pollute the operator namespace
2025-04-26 15:01:18 +0200 <haskellbridge> <Liamzee> it's a local binding precisely because it's an operator
2025-04-26 15:01:16 +0200LainIwakura(~LainIwaku@user/LainIwakura) LainIwakura
2025-04-26 15:00:41 +0200 <__monty__> If there's a useful name for the helper it should have that name instead. And if it is more generally useful, it shouldn't be a local binding at all.
2025-04-26 15:00:38 +0200 <haskellbridge> <Liamzee> why am I even attempting to fold anyways, at this length I might as well manually use the semigroup operator
2025-04-26 14:59:56 +0200 <__monty__> Haven't really seen `go` outside of recursive functions that pass in an initial value for an accumulator or such.
2025-04-26 14:58:07 +0200 <haskellbridge> <Liamzee> tilde is actually not used, since it'd be syntax for irrefutable pattern match, hmmm
2025-04-26 14:57:42 +0200sixfourtwelve(~ethanmorg@82.18.82.103) sixfourtwelve
2025-04-26 14:56:56 +0200 <haskellbridge> <Liamzee> go usually indicates a helper function, at least for me, as opposed to an attempt to avoid code repetition
2025-04-26 14:56:40 +0200 <haskellbridge> <Liamzee> if i didn't have block patterns on, you could say it would be to avoid having to stuff a $ before the lambda
2025-04-26 14:55:18 +0200LainIwakura(~LainIwaku@user/LainIwakura) (Ping timeout: 240 seconds)
2025-04-26 14:49:47 +0200 <__monty__> I don't see a good reason to use an operator here.
2025-04-26 14:49:12 +0200 <haskellbridge> <Liamzee> this is interesting, ~ works
2025-04-26 14:49:08 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn
2025-04-26 14:49:02 +0200Square2(~Square@user/square) Square
2025-04-26 14:48:19 +0200 <haskellbridge> <Liamzee> imagine the code sample with the helper operator inlined
2025-04-26 14:48:01 +0200 <haskellbridge> <Liamzee> the easiest way, imo, is to do a scoped override of *, but that feels cursed
2025-04-26 14:47:51 +0200 <haskellbridge> <Liamzee> erm, the typing (variable typing) meant I couldn't use foldmap to handle it
2025-04-26 14:47:40 +0200 <haskellbridge> <Liamzee> basically, i had a ton of code repetition, i'd have normally handled it via a helper but the data format meant that i couldn't use foldMap to handle it
2025-04-26 14:47:09 +0200 <__monty__> And I think the pattern using a local `go` is called worker-wrapper?
2025-04-26 14:46:33 +0200 <haskellbridge> <Liamzee> ah
2025-04-26 14:46:08 +0200 <__monty__> Don't think there is one because of the convenient backtick syntax.
2025-04-26 14:45:55 +0200 <haskellbridge> <Liamzee> "cursed" technically counts, I guess, hmmm
2025-04-26 14:45:38 +0200 <haskellbridge> <Liamzee> erm, standard Haskell operator helper?
2025-04-26 14:45:16 +0200sixfourtwelve(~ethanmorg@82.18.82.103) (Ping timeout: 252 seconds)
2025-04-26 14:43:34 +0200target_i(~target_i@user/target-i/x-6023099) target_i
2025-04-26 14:40:35 +0200 <haskellbridge> <Liamzee> what's the standard symbolic Haskell override?
2025-04-26 14:40:28 +0200 <haskellbridge> <Liamzee> go is the standard Haskell way to indicate what OCamlers mean by aux
2025-04-26 14:40:16 +0200 <haskellbridge> <Liamzee> https://paste.tomsmeding.com/az4bXqgs
2025-04-26 14:40:15 +0200 <haskellbridge> <Liamzee> there we go
2025-04-26 14:37:01 +0200merijn(~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds)
2025-04-26 14:34:24 +0200 <jackdk> I stand corrected, then
2025-04-26 14:34:14 +0200 <__monty__> I think there's a Simon who's wont to do exactly that.
2025-04-26 14:34:11 +0200 <jackdk> (To at least a first approximation)
2025-04-26 14:33:44 +0200 <jackdk> Also, nobody writes Haskell with braces and semicolons.
2025-04-26 14:33:24 +0200 <jackdk> If you don't write Haskell with braces and semicolons, it's a layout-sensitive language
2025-04-26 14:32:38 +0200 <Miroboru> I am sure I tried it before though, but I think that I indented it by one space which leads to an error... A bit brittle methinks, but now I know
2025-04-26 14:30:59 +0200 <Miroboru> I was using Char (case x of) where x is a Char. I just tried using just _ with no quotes and it works...
2025-04-26 14:29:32 +0200 <__monty__> Miroboru: Wildcard pattern (might not actually be the name) `_`?
2025-04-26 14:27:21 +0200 <Miroboru> I am getting "Pattern matching is non-exhaustive"