2025/04/06

Newest at the top

2025-04-06 19:14:41 +0200 <emojelly> Type applications seem at least a bit cleaner than "gratuitous" arguments...
2025-04-06 19:11:01 +0200 <haskellbridge> ... long message truncated: https://kf8nh.com/_heisenbridge/media/kf8nh.com/JYSfMNZqjiXzhkfTeJfRrGsX/9kwQ5Tzz6so (4 lines)
2025-04-06 19:11:01 +0200 <haskellbridge> <hellwolf> options:
2025-04-06 19:10:26 +0200 <emojelly> Yeah that's possible... I don't quite remember if I had to disambiguate both.
2025-04-06 19:10:03 +0200 <emojelly> Yeah. I've been wondering about using proxies... but then I think I have to pass a Proxy instead?
2025-04-06 19:09:51 +0200 <c_wraith> But you still should only need to disambiguate t itself somehow, not m1 m2 a1 or a2
2025-04-06 19:09:33 +0200 <emojelly> It's actually a type family from MonadTransControl (which is a relatively common class), but it's the same if I define it myself of course.
2025-04-06 19:09:16 +0200 <c_wraith> well that makes it a ton more complicated.
2025-04-06 19:09:06 +0200 <emojelly> it is, yeah!
2025-04-06 19:08:24 +0200 <c_wraith> unless StT is a type family?
2025-04-06 19:07:30 +0200 <c_wraith> with that particular class definition, all that you normally should need to disambiguate is t
2025-04-06 19:06:42 +0200 <emojelly> All the information about the (t m1 a1) and (t m2 a2) are containing in (StT t a1) (StT t a2) respectively, that's pretty much their point.
2025-04-06 19:05:55 +0200 <emojelly> Is there a more elegant way to do that, than passing arguments which are not actually used for anything?
2025-04-06 19:05:37 +0200tzh(~tzh@c-76-115-131-146.hsd1.or.comcast.net)
2025-04-06 19:05:36 +0200 <emojelly> Those first two arguments, of type (t m1 a1) and (t m2 a2), are only there to disambiguate the type. Otherwise, ghc complains that all the "St t"s are ambiguous.
2025-04-06 19:04:48 +0200 <emojelly> combineC :: forall m1 m2 a1 a2. (t m1 a1) -> (t m2 a2) -> Maybe (StT t a1) -> Maybe (StT t a2) -> StT t (Maybe a1, Maybe a2)
2025-04-06 19:04:46 +0200 <emojelly> ...
2025-04-06 19:04:44 +0200 <emojelly> class MonadTransControl t => MonadTransCombine t where
2025-04-06 19:04:42 +0200 <emojelly> So I have the following function in my type class:
2025-04-06 19:04:04 +0200emojelly(~eselber_p@user/endojelly) endojelly
2025-04-06 19:03:32 +0200__monty__(~toonn@user/toonn) toonn
2025-04-06 19:01:31 +0200ss4(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2025-04-06 19:01:13 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer)
2025-04-06 19:00:54 +0200ss4(~wootehfoo@user/wootehfoot) wootehfoot
2025-04-06 18:53:22 +0200tromp(~textual@2001:1c00:3487:1b00:c873:d422:44c2:cc0c) (Quit: My iMac has gone to sleep. ZZZzzz…)
2025-04-06 18:43:49 +0200 <ski> er .. i suppose, not with `0'. same issue, though
2025-04-06 18:42:57 +0200 <ski> but we want the neutral element of the given group to be identified with `-1', not with `1', of the group of integers
2025-04-06 18:42:06 +0200 <ski> hmm .. no, that doesn't quite work. coproduct would identify the neutral elements of the two groups
2025-04-06 18:39:39 +0200 <ski> (note, arbitrary groups, not abelian ones)
2025-04-06 18:39:11 +0200 <ski> i suppose you could take coproduct of the given group, and the group of integers
2025-04-06 18:37:40 +0200__monty__(~toonn@user/toonn) (Quit: Lost terminal)
2025-04-06 18:37:21 +0200 <mauke> and inverse x' = -x - 2?
2025-04-06 18:37:19 +0200skiidly ponders making this into a word group
2025-04-06 18:36:05 +0200hattckory(~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca)
2025-04-06 18:33:46 +0200 <monochrom> Spin-off exercise: Suppose x +++ y = x + y + 1. Prove that +++ is a monoid operation with -1 as the identity. >:)
2025-04-06 18:29:21 +0200 <ski> it sounded like thirdofmay18081814goya wanted something a bit reminiscent of the caching part, but for every bind automatically
2025-04-06 18:28:32 +0200 <ski> i recall doing a CGI monad, which had an `io :: (Show a,Read a) => IO a -> CGI a' operation, caching the result of `IO' operations, serializing them into the generated page (when a query was generated), so that the program could then be resumed, fastforwarded to the point where it left off, to continue on
2025-04-06 18:28:06 +0200 <monochrom> s/is the/in the/
2025-04-06 18:27:50 +0200 <monochrom> Of course we know the right way is to hide the counter increment is the something else.
2025-04-06 18:27:42 +0200 <enikar> let monads do their job :)
2025-04-06 18:27:12 +0200 <monochrom> Not to endorse it, but presumably the monad also does something else, and the author hides a counter increment in bind as a proxy to count cost.
2025-04-06 18:26:58 +0200amadaluzia(~amadaluzi@user/amadaluzia) (Ping timeout: 244 seconds)
2025-04-06 18:24:52 +0200 <monochrom> :)
2025-04-06 18:24:51 +0200 <enikar> I don't understand the use case.
2025-04-06 18:24:34 +0200 <ski> dubious reasons
2025-04-06 18:24:19 +0200 <enikar> why one would want to count bind?
2025-04-06 18:22:52 +0200toby-bro(~toby-bro@user/toby-bro) toby-bro
2025-04-06 18:20:01 +0200 <monochrom> This is what the model "monad/>>= is programmable semicolon" gets right. In C programming, do people even imagine writing a program that counts its own lines of code?
2025-04-06 18:15:45 +0200hattckory(~hattckory@bras-base-toroon4524w-grc-30-70-27-118-207.dsl.bell.ca) (Ping timeout: 248 seconds)
2025-04-06 18:15:22 +0200 <monochrom> But I don't like to tell people about this. Counting binds is every beginners favourite anti-monad anti-pattern.