Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-29 14:17:37 is_null joins (~jpic@pdpc/supporter/professional/is-null)
2021-04-29 14:17:50 × lleb quits (5c91ba7e@amarseille-158-1-23-126.w92-145.abo.wanadoo.fr) (Quit: Connection closed)
2021-04-29 14:18:25 ddellacosta joins (~ddellacos@86.106.143.229)
2021-04-29 14:20:26 × is_null quits (~jpic@pdpc/supporter/professional/is-null) (Read error: Connection reset by peer)
2021-04-29 14:20:39 × sh9 quits (~sh9@softbank060116136158.bbtec.net) (Quit: WeeChat 2.9)
2021-04-29 14:21:03 <absence> ReaderT has the withReaderT function that can modify the type of the environment, but MonadReader only has the local function which can modify the value of the environment, but not the type. is this a limitation of how typeclasses work? would it be necessary/possible to use a different effect system to implement the ability to change the environment's type?
2021-04-29 14:21:06 × is_null_ quits (~jpic@pdpc/supporter/professional/is-null) (Ping timeout: 240 seconds)
2021-04-29 14:22:37 is_null joins (~jpic@pdpc/supporter/professional/is-null)
2021-04-29 14:22:47 × ddellacosta quits (~ddellacos@86.106.143.229) (Ping timeout: 246 seconds)
2021-04-29 14:22:56 <merijn> absence: MonadReader can't guarantee the type is changeable
2021-04-29 14:25:15 alx741 joins (~alx741@181.196.68.118)
2021-04-29 14:26:06 bitmagie joins (~Thunderbi@200116b80605cb00d83ce53866d6a8fa.dip.versatel-1u1.de)
2021-04-29 14:26:57 ulidtko|kk joins (~ulidtko@31.133.98.224)
2021-04-29 14:27:00 × bitmagie quits (~Thunderbi@200116b80605cb00d83ce53866d6a8fa.dip.versatel-1u1.de) (Client Quit)
2021-04-29 14:28:26 ram19890 joins (~ram@49.205.84.15)
2021-04-29 14:29:03 <absence> merijn: because other layers in the stack could depend on it?
2021-04-29 14:29:13 <merijn> Who says there is a stack
2021-04-29 14:29:29 × ulidtko|k quits (~ulidtko@194.54.80.38) (Ping timeout: 260 seconds)
2021-04-29 14:30:18 <absence> merijn: if there isn't, why wouldn't the type be changeable?
2021-04-29 14:30:56 <geekosaur> MonadReader says only that there's some vaguely Reader-like thing there, not that it's something one could change the type of
2021-04-29 14:31:02 <geekosaur> I think
2021-04-29 14:32:42 rond_ joins (5940206b@89-64-32-107.dynamic.chello.pl)
2021-04-29 14:33:07 <merijn> Semi-relatedly: All the typeclasses in mtl are terrible and should never be part of any public API
2021-04-29 14:33:44 <absence> merijn: what do you suggest instead?
2021-04-29 14:34:08 <merijn> for what
2021-04-29 14:35:01 <tdammers> my guess would be "for abstracting 'ask' beyond literally Reader / ReaderT"
2021-04-29 14:35:19 <merijn> "don't"
2021-04-29 14:35:27 <merijn> ask is part of the problem
2021-04-29 14:35:53 LKoen joins (~LKoen@22.249.88.92.rev.sfr.net)
2021-04-29 14:36:00 <tdammers> ask is what Reader is all about, isn't it
2021-04-29 14:36:13 <merijn> Sure
2021-04-29 14:36:26 × stree quits (~stree@68.36.8.116) (Ping timeout: 246 seconds)
2021-04-29 14:36:40 <merijn> But Reader, while useful for some early prototyping, is a terrible public API
2021-04-29 14:38:25 <merijn> Wrap it with an application/use specific newtype (see LoggingT, for example)
2021-04-29 14:38:32 × jpe90 quits (~user@pool-108-31-85-19.washdc.fios.verizon.net) (Ping timeout: 246 seconds)
2021-04-29 14:40:28 <absence> a newtype for each part of the environment?
2021-04-29 14:41:09 <merijn> What do you mean "each part"
2021-04-29 14:41:24 jao joins (~jao@pdpc/supporter/professional/jao)
2021-04-29 14:41:55 <absence> you used logger as one example, but there are usually other things, like a database handle, a kafka handle, some metrics stuff, etc
2021-04-29 14:42:57 <merijn> You define "MonadLogging", "MonadKafka" that provide you the primitives you need, then have one single type that implements all those things
2021-04-29 14:43:10 <merijn> The problem with MonadReader is that is overly broad
2021-04-29 14:43:10 cfricke joins (~cfricke@unaffiliated/cfricke)
2021-04-29 14:43:39 <merijn> You can only ever have exactly *one* MonadReader instance, and making that class part of your public API means your hosed when 2 APIs use MonadReader for different thing
2021-04-29 14:44:02 <tdammers> arguably, the "s" parameter to the MonadReader class (or "r" or whatever letter you pick) could make that distinction for you, if it weren't that typeclasses don't quite work that way
2021-04-29 14:44:12 <merijn> The tagless final style classes like MonadX are ok, but only if there's a sensible globally unique meaning for them
2021-04-29 14:44:51 <tdammers> otherwise, you could have sth like (MonadReader Foo m, MonadReader Bar m) => ..., and then instantiate that as ReaderT Foo (Reader Bar) or sth
2021-04-29 14:45:20 <absence> right, i see what you mean
2021-04-29 14:45:23 <merijn> tdammers: Right, but that's just the same as having meaningful MonadX classes
2021-04-29 14:45:28 <merijn> absence: Example: https://github.com/merijn/Belewitte/blob/master/benchmark-analysis/src/Sql/Core.hs#L130-L133
2021-04-29 14:45:39 <merijn> absence: All my query logic is built on those 3 functions
2021-04-29 14:45:41 <tdammers> merijn: sure, totally agree there
2021-04-29 14:46:07 <merijn> absence: Whether you get those from a ReaderT, some other type or dark voodoo really isn't important to my querying logic
2021-04-29 14:46:45 <merijn> absence: This also makes refactoring easier
2021-04-29 14:46:45 × whatisRT quits (~whatisRT@ip5b416a33.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds)
2021-04-29 14:46:48 nut joins (~gtk@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
2021-04-29 14:47:07 <merijn> absence: Instead of having "a specific monad stack" you just have "a type that lets me implement these primitives"
2021-04-29 14:47:43 <merijn> absence: most of my logic is just a single opaque newtype (that internally uses some transformers, but the fact that I do is irrelevant to the code using that type)
2021-04-29 14:49:32 whatisRT joins (~whatisRT@ip5b416a33.dynamic.kabel-deutschland.de)
2021-04-29 14:49:48 stree joins (~stree@68.36.8.116)
2021-04-29 14:49:55 <tdammers> the mtl classes kind of try to give you "a type that lets me implement these primitives", it's just that the primitives are too meaning-agnostic, a bit like the Boolean Blindness problem
2021-04-29 14:49:57 <absence> merijn: i can see there would be benefits in general, but i'm not sure my original problem would be solvable with specific MonadX classes either. say you have some class "MonadLogger msg m" where msg is the type of whatever you want to log. while the name is less likely to clash when there are multiple apis, could the class have a function that changes the msg type?
2021-04-29 14:49:58 acidjnk_new2 joins (~acidjnk@p5487d90a.dip0.t-ipconnect.de)
2021-04-29 14:50:07 Sgeo joins (~Sgeo@ool-18b9875e.dyn.optonline.net)
2021-04-29 14:50:25 × olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Remote host closed the connection)
2021-04-29 14:50:26 ddellacosta joins (~ddellacos@86.106.143.21)
2021-04-29 14:55:38 × ddellacosta quits (~ddellacos@86.106.143.21) (Ping timeout: 268 seconds)
2021-04-29 15:00:18 × nut quits (~gtk@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 260 seconds)
2021-04-29 15:00:35 × frozenErebus quits (~frozenEre@37.231.244.249) (Ping timeout: 268 seconds)
2021-04-29 15:03:21 × Raito_Bezarius quits (~Raito@unaffiliated/raito-bezarius/x-8764578) (Ping timeout: 250 seconds)
2021-04-29 15:03:29 × L29Ah quits (~L29Ah@unaffiliated/l29ah) (Quit: Gateway shutdown)
2021-04-29 15:04:12 <kuribas> yay, I can make our next service in haskell! :-)
2021-04-29 15:09:21 cr3 joins (~cr3@192.222.143.195)
2021-04-29 15:09:57 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-04-29 15:11:26 × kritzefitz quits (~kritzefit@2003:5b:203b:200::10:49) (Remote host closed the connection)
2021-04-29 15:13:32 × chele quits (~chele@5.53.222.202) (Remote host closed the connection)
2021-04-29 15:14:41 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-04-29 15:16:40 Raito_Bezarius joins (~Raito@unaffiliated/raito-bezarius/x-8764578)
2021-04-29 15:18:03 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2021-04-29 15:19:57 ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net)
2021-04-29 15:20:37 × zebrag quits (~inkbottle@aaubervilliers-654-1-79-166.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!)
2021-04-29 15:22:07 L29Ah joins (~L29Ah@unaffiliated/l29ah)
2021-04-29 15:22:13 proofofkeags joins (~proofofke@205.209.28.54)
2021-04-29 15:26:11 mmfood joins (~mmfood@185.176.246.118)
2021-04-29 15:26:15 ddellac__ joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-29 15:26:23 nineonine joins (~nineonine@2604:3d08:7785:9600:b972:f5c7:dd8f:5421)
2021-04-29 15:30:32 × ddellac__ quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds)
2021-04-29 15:33:51 <[exa]> kuribas: well good luck. :D
2021-04-29 15:38:27 × __minoru__shirae quits (~shiraeesh@46.34.207.120) (Remote host closed the connection)
2021-04-29 15:38:38 __minoru__shirae joins (~shiraeesh@46.34.207.120)
2021-04-29 15:38:46 <kuribas> it'll be a small service for now, but we can make it bigger later.
2021-04-29 15:39:12 nineonin_ joins (~nineonine@50.216.62.2)
2021-04-29 15:43:00 joncol joins (~jco@c83-248-173-38.bredband.comhem.se)
2021-04-29 15:43:04 × nineonine quits (~nineonine@2604:3d08:7785:9600:b972:f5c7:dd8f:5421) (Ping timeout: 276 seconds)
2021-04-29 15:44:11 × enoq quits (~textual@194-208-146-143.lampert.tv) (Quit: Textual IRC Client: www.textualapp.com)
2021-04-29 15:46:47 minoru_shiraeesh joins (~shiraeesh@46.34.207.120)
2021-04-29 15:48:03 × malumore_ quits (~malumore@151.62.116.76) (Ping timeout: 268 seconds)
2021-04-29 15:48:07 × __minoru__shirae quits (~shiraeesh@46.34.207.120) (Remote host closed the connection)
2021-04-29 15:48:21 <maerwald> why write it in haskell?
2021-04-29 15:49:46 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-04-29 15:49:49 <kuribas> maerwald: why not?

All times are in UTC.