Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,804,110 events total
2021-08-19 11:33:13 × fef quits (~thedawn@user/thedawn) (Ping timeout: 244 seconds)
2021-08-19 11:33:56 × dsrt^ quits (~dsrt@209.65.131.194) (Remote host closed the connection)
2021-08-19 11:34:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-08-19 11:35:29 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-19 11:38:55 vs^ joins (~vs@209.65.131.194)
2021-08-19 11:40:59 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-08-19 11:42:00 × Atum_ quits (~IRC@user/atum/x-2392232) (Ping timeout: 244 seconds)
2021-08-19 11:42:16 × MidAutumnMoon quits (~MidAutumn@user/midautumnmoon) (Quit: Leaving for a break - theLounge)
2021-08-19 11:42:54 Atum_ joins (~IRC@user/atum/x-2392232)
2021-08-19 11:44:02 MidAutumnMoon joins (~MidAutumn@user/midautumnmoon)
2021-08-19 11:45:58 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 252 seconds)
2021-08-19 11:47:18 burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk)
2021-08-19 11:50:42 × turlando quits (~turlando@user/turlando) (Ping timeout: 258 seconds)
2021-08-19 11:55:47 gehmehgeh joins (~user@user/gehmehgeh)
2021-08-19 11:56:34 × gehmehgeh quits (~user@user/gehmehgeh) (Client Quit)
2021-08-19 11:56:48 gehmehgeh joins (~user@user/gehmehgeh)
2021-08-19 12:01:29 × TheCoffeMaker quits (~TheCoffeM@user/thecoffemaker) (Ping timeout: 252 seconds)
2021-08-19 12:08:06 timCF joins (~timCF@m91-129-108-244.cust.tele2.ee)
2021-08-19 12:08:09 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2021-08-19 12:08:35 stiell joins (~stiell@gateway/tor-sasl/stiell)
2021-08-19 12:11:09 <timCF> Hello! Is there some easy method to make derived Show instances of my data more readable when ByteString fields/newtypes are presented? Default ByteString Show instance kinda hard to read, I definitely would prefer representation which looks like just list of bytes, for example `[43, 23, 0, 1]`.
2021-08-19 12:12:30 <merijn> You shouldn't really be using Show for "readable" things anyway. You'd wanna use a pretty printer for that. When it comes to debug readability you can look at stuff like
2021-08-19 12:12:34 <merijn> @hackage pretty-show
2021-08-19 12:12:34 <lambdabot> https://hackage.haskell.org/package/pretty-show
2021-08-19 12:12:41 <merijn> Which can reformat existing Show output
2021-08-19 12:12:53 TheCoffeMaker joins (~TheCoffeM@user/thecoffemaker)
2021-08-19 12:14:36 <timCF> merijn: so it still can use default derived Show instances? All what I want is to not write them by hand or TH, but have different ByteString representation, literally as list of bytes
2021-08-19 12:15:43 <merijn> timCF: There's missing context of when/for what you wanna use this output
2021-08-19 12:16:07 <timCF> merijn: for logging
2021-08-19 12:17:21 <merijn> timCF: I mean, you could also just use a newtype around the bytestring with a custom implementation of show
2021-08-19 12:17:27 <merijn> timCF: Or add a Loggable class
2021-08-19 12:18:57 <timCF> merijn: true, but I want also be able to log values of types which I do not control (can't add newtypes that easy to foreign codebase)
2021-08-19 12:21:20 <timCF> probably introducing my own ShowDebug class with some smart deriving based on GHC.Generics is the easiest way?
2021-08-19 12:22:08 arjun joins (~user@user/arjun)
2021-08-19 12:22:34 <merijn> Depends on how frequently you log, because that will probably be slow
2021-08-19 12:23:51 <timCF> merijn: Hmm. I'm logging a lot. It definitely should be fast in runtime. And preferrably compile-time as well (otherwise probably TH is the way to go)
2021-08-19 12:23:54 <dminuoso> In my experience when Show/pretty-show is not enough, just go write ppr* functions.,
2021-08-19 12:24:22 <dminuoso> I hated myself every time I used a typeclass for it and reverted it.
2021-08-19 12:25:45 <timCF> dminuoso: merijn: I'll take a look at pretty-show, maybe with it I can somehow make ByteString fields more readable without creating new classes, using GHC.Generics or TH
2021-08-19 12:26:15 × Obo quits (~roberto@78.77.166.185) (Quit: WeeChat 2.8)
2021-08-19 12:28:17 × arjun quits (~user@user/arjun) (Ping timeout: 248 seconds)
2021-08-19 12:30:00 arjun joins (~user@user/arjun)
2021-08-19 12:30:45 MoC joins (~moc@user/moc)
2021-08-19 12:32:59 × arjun quits (~user@user/arjun) (Remote host closed the connection)
2021-08-19 12:34:01 × chomwitt quits (~chomwitt@2a02:587:dc0c:e200:12c3:7bff:fe6d:d374) (Ping timeout: 258 seconds)
2021-08-19 12:34:47 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2021-08-19 12:37:43 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
2021-08-19 12:38:15 × dschrempf quits (~dominik@92-249-159-252.pool.digikabel.hu) (Quit: WeeChat 3.2)
2021-08-19 12:41:24 acidjnk_new3 joins (~acidjnk@p200300d0c72b950070172e7c3c578523.dip0.t-ipconnect.de)
2021-08-19 12:44:30 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
2021-08-19 12:44:37 × acidjnk_new quits (~acidjnk@p200300d0c72b952850c7a959aba8feb6.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
2021-08-19 12:46:02 × xsperry quits (~as@user/xsperry) (Ping timeout: 256 seconds)
2021-08-19 12:50:30 sim590 joins (~simon@modemcable090.207-203-24.mc.videotron.ca)
2021-08-19 12:57:28 × mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Ping timeout: 252 seconds)
2021-08-19 13:03:08 × burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Remote host closed the connection)
2021-08-19 13:03:38 burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk)
2021-08-19 13:05:27 × kenran quits (~kenran@b2b-37-24-119-190.unitymedia.biz) (Quit: WeeChat info:version)
2021-08-19 13:06:43 <siers> Is there some operation for Just a +++ Just b = Just (a max b)? the "max" could probably be something generic implemented by some typeclass
2021-08-19 13:06:56 × Atum_ quits (~IRC@user/atum/x-2392232) (Remote host closed the connection)
2021-08-19 13:07:12 <siers> and the rest would be like for monad alternative – Nothing^2 = Nothing, Just + Nothing = Just and vice versa
2021-08-19 13:07:13 <merijn> siers: Yes!
2021-08-19 13:07:27 <merijn> siers: That's just Monoid + Max newtype :p
2021-08-19 13:07:40 <merijn> > Just (Max 1) <> Just (Max 3)
2021-08-19 13:07:42 <lambdabot> error:
2021-08-19 13:07:42 <lambdabot> • Data constructor not in scope: Max :: t0 -> a
2021-08-19 13:07:42 <lambdabot> • Perhaps you meant variable ‘max’ (imported from Data.Ord)error:
2021-08-19 13:07:47 <merijn> aww
2021-08-19 13:08:01 <merijn> > Just (Data.Semigroup.Max 1) <> Just (Data.Semigroup.Max 3)
2021-08-19 13:08:03 <lambdabot> error:
2021-08-19 13:08:03 <lambdabot> Not in scope: data constructor ‘Data.Semigroup.Max’
2021-08-19 13:08:03 <lambdabot> No module named ‘Data.Semigroup’ is imported.error:
2021-08-19 13:08:07 × burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Ping timeout: 268 seconds)
2021-08-19 13:08:08 <siers> what about Nothing +++ Just 1 = Just 1?
2021-08-19 13:08:16 Atum_ joins (~IRC@user/atum/x-2392232)
2021-08-19 13:08:30 <merijn> siers: Nothing is the identity elements, so yes :)
2021-08-19 13:08:45 <merijn> Or you want Alternative maybe?
2021-08-19 13:09:07 <merijn> :t mplus
2021-08-19 13:09:08 <lambdabot> MonadPlus m => m a -> m a -> m a
2021-08-19 13:09:14 <siers> hm, I was certain it's not going to be a monoid... good that it is
2021-08-19 13:09:40 <merijn> % import Data.Semigroup(Max(..))
2021-08-19 13:09:40 <yahb> merijn:
2021-08-19 13:09:53 <merijn> % Just (Max 1) <> Just (Max 2)
2021-08-19 13:09:53 <yahb> merijn: Just (Max {getMax = 2})
2021-08-19 13:10:00 <merijn> % Just (Max 1) <> Nothing
2021-08-19 13:10:00 <yahb> merijn: Just (Max {getMax = 1})
2021-08-19 13:10:10 <siers> nice... I really like monoids
2021-08-19 13:10:26 <merijn> You'll need to fmap a getMax over the Maybe in the end, but other than that it just works
2021-08-19 13:10:30 <merijn> Everyone loves monoids :)
2021-08-19 13:11:52 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2021-08-19 13:12:18 derelict joins (~derelict@user/derelict)
2021-08-19 13:12:36 favonia joins (~favonia@user/favonia)
2021-08-19 13:13:16 img joins (~img@user/img)
2021-08-19 13:14:29 <maerwald> packBytes uses `List.length` on the input, does that mean it won't fuse? https://hackage.haskell.org/package/bytestring-0.11.1.0/docs/src/Data.ByteString.Internal.html#packBytes
2021-08-19 13:15:43 Obo joins (~roberto@78.77.166.185)
2021-08-19 13:19:29 × azeem quits (~azeem@dynamic-adsl-94-34-33-6.clienti.tiscali.it) (Read error: Connection reset by peer)
2021-08-19 13:21:00 slowButPresent joins (~slowButPr@user/slowbutpresent)
2021-08-19 13:21:07 × sleblanc quits (~sleblanc@user/sleblanc) (Ping timeout: 252 seconds)
2021-08-19 13:21:29 xsperry joins (~as@user/xsperry)
2021-08-19 13:24:17 × Obo quits (~roberto@78.77.166.185) (Ping timeout: 248 seconds)
2021-08-19 13:26:23 <kuribas> Is there a decent defaults package?

All times are in UTC.