2021/10/15

2021-10-15 00:00:48 +0200fendor_(~fendor@77.119.208.38.wireless.dyn.drei.com) (Remote host closed the connection)
2021-10-15 00:01:22 +0200max22-(~maxime@2a01cb0883359800f362ea56be7f8960.ipv6.abo.wanadoo.fr) (Quit: Leaving)
2021-10-15 00:01:27 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-10-15 00:02:25 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-10-15 00:02:41 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-10-15 00:03:40 +0200geekosaur(~geekosaur@xmonad/geekosaur) (Quit: Leaving)
2021-10-15 00:05:07 +0200geekosaur(~geekosaur@xmonad/geekosaur)
2021-10-15 00:08:15 +0200echoone(~echoone@2a02:8109:a1c0:5d05:58b9:5c9f:8b69:dc13) (Quit: Client closed)
2021-10-15 00:08:49 +0200zebrag(~chris@user/zebrag)
2021-10-15 00:16:36 +0200agoraphobic_(~agoraphob@ip11-173.bon.riksnet.se) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
2021-10-15 00:16:37 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-15 00:16:49 +0200agoraphobic(~agoraphob@ip11-173.bon.riksnet.se)
2021-10-15 00:17:31 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
2021-10-15 00:17:42 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-15 00:18:04 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-10-15 00:18:24 +0200Tuplanolla(~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.)
2021-10-15 00:21:17 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
2021-10-15 00:25:31 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Ping timeout: 245 seconds)
2021-10-15 00:26:09 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 265 seconds)
2021-10-15 00:28:15 +0200hexfive(~eric@50.35.83.177)
2021-10-15 00:31:04 +0200zerozzz
2021-10-15 00:33:52 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2021-10-15 00:35:45 +0200zzzyin
2021-10-15 00:36:54 +0200hexfive(~eric@50.35.83.177) (Quit: WeeChat 3.0.1)
2021-10-15 00:37:38 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 00:40:28 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
2021-10-15 00:40:36 +0200jollygood2(~bc8165b6@217.29.117.252) (Quit: http://www.okay.uz/ (Session timeout))
2021-10-15 00:41:56 +0200markusde(~makrus@2604:3d08:6f80:6b00::2ba7)
2021-10-15 00:42:01 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-10-15 00:52:35 +0200Null_A(~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10)
2021-10-15 00:52:35 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-10-15 00:52:46 +0200MQ-17J(~MQ-17J@8.6.144.117)
2021-10-15 00:53:01 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
2021-10-15 00:53:46 +0200abrantesasf(~abrantesa@187.36.170.211)
2021-10-15 00:55:51 +0200idris(~idris@184.105.6.88)
2021-10-15 00:56:04 +0200idrishippoid
2021-10-15 01:04:39 +0200 <ph88> So when the S combinator in lambda calculus is written as S=λxyz.(xz)(yz). And <*> is the S combinator for the applicative instance. Then how can the type signature of <*> be compared with the lambda equation ? S=λxyz.(xz)(yz). VS (<*>) :: Applicative f => f (a -> b) -> f a -> f b
2021-10-15 01:05:00 +0200Everything(~Everythin@37.115.210.35) (Quit: leaving)
2021-10-15 01:06:48 +0200 <hpc> that lambda term more corresponds to the value of (<*>) for a specific instance
2021-10-15 01:07:22 +0200 <hpc> you can probably work out which instance yourself
2021-10-15 01:07:29 +0200 <hpc> hint: look at x
2021-10-15 01:07:30 +0200 <hippoid> typeclassopedia talks about `Applicative` as a way to "encapsulate certain sorts of effectful computations". What are "effectful computations"?
2021-10-15 01:08:15 +0200 <hippoid> wow, I jumped into this conversation at the right time apparently
2021-10-15 01:08:24 +0200 <hpc> heh
2021-10-15 01:09:17 +0200 <hippoid> is "effectful computations" the same things as "functions with side effects"?
2021-10-15 01:09:45 +0200 <hpc> hippoid: it's shorthand for a fairly specific notion of "this thing expresses more than just being an integer or boolean or whatever"
2021-10-15 01:09:58 +0200 <ph88> hpc, not sure what you are talking about
2021-10-15 01:10:49 +0200 <hippoid> hmm
2021-10-15 01:10:50 +0200 <hpc> ph88: S=λxyz.(xz)(yz) is value-level and Applicative f => f (a -> b) -> f a -> f b is type-level
2021-10-15 01:11:01 +0200 <hpc> hippoid: so for example, IO or Maybe
2021-10-15 01:11:12 +0200 <hippoid> :i Maybe
2021-10-15 01:11:21 +0200 <hpc> or [] (the type, not the value)
2021-10-15 01:11:35 +0200 <hpc> > (+) <$> [10, 20] <*> [1, 2]
2021-10-15 01:11:37 +0200 <lambdabot> [11,12,21,22]
2021-10-15 01:12:01 +0200 <hippoid> so what part of that expression is the "effectful computation"?
2021-10-15 01:12:01 +0200 <ph88> hippoid, i also don't know but i have the idea that if you have a function a -> b it's just a function. And then when you box it (Just (a -> b)) it suddenly becomes a "computation" which needs to be unwrapped first
2021-10-15 01:12:26 +0200 <hpc> the "effect" here is that you're doing all of the combinations and not just one specific addition
2021-10-15 01:12:35 +0200 <hpc> in IO, the effect might be that the numbers come from stdin
2021-10-15 01:12:44 +0200 <hpc> in Maybe, you might not have one of the numbers
2021-10-15 01:13:04 +0200 <hpc> but underneath that you still have addition, or whatever other thing you want to do
2021-10-15 01:13:19 +0200 <ph88> hpc, ye on value level there are 3 input parameters x, y, and z and on type level i just see two input type f (a -> b) and f a
2021-10-15 01:13:28 +0200 <dminuoso> hippoid: The crucial part is that "effectful computation" is not something that will help you understand what we mean.
2021-10-15 01:13:41 +0200 <hippoid> hpc: ok i think that makes sense. Typeclassopedia also talks about Applicative allowing a context for a computation, so the context could be Maybe or [] or Either ...
2021-10-15 01:13:44 +0200 <dminuoso> hippoid: By that I mean, it's a notion that people usually adapt *after* they've grokked it.
2021-10-15 01:13:57 +0200 <hpc> ph88: it only looks that way, some value of 'f' might be able to help you out there
2021-10-15 01:14:09 +0200 <hpc> like how this use of id has more parameters than it should
2021-10-15 01:14:12 +0200 <hpc> > id (+) 1 2
2021-10-15 01:14:14 +0200 <lambdabot> 3
2021-10-15 01:14:22 +0200 <hippoid> I'm grokking the Effect word is used somewhat differently than the meaning in "side effect"
2021-10-15 01:14:48 +0200 <c_wraith> it's the same meaning in most senses, but crucially no longer on the side.
2021-10-15 01:15:12 +0200 <hippoid> c_wraith: thats a good clarification
2021-10-15 01:15:13 +0200 <dminuoso> hippoid: So the thing is, we usually mean it in a very lose, most general, notion.
2021-10-15 01:15:29 +0200 <ph88> dminuoso, well interesting, been programming for a while and also didnt know what this term was supposed to mean
2021-10-15 01:15:42 +0200 <Axman6> :t \x y z -> (x z) (y z)
2021-10-15 01:15:42 +0200 <hpc> hippoid: it might help to look at it straight from the laws too, with no intuition
2021-10-15 01:15:43 +0200 <lambdabot> (t1 -> t2 -> t3) -> (t1 -> t2) -> t1 -> t3
2021-10-15 01:15:47 +0200 <hpc> and let the two ideas meet in the middle
2021-10-15 01:15:50 +0200 <dminuoso> The effect of [] is that of non-determinism, the effect of Maybe is anonymous exceptions
2021-10-15 01:16:01 +0200 <dminuoso> With Cont its.. uh. I dont even know how to describe that one
2021-10-15 01:16:06 +0200 <Axman6> :t (<*>) `asTypeOf` \x y z -> (x z) (y z)
2021-10-15 01:16:07 +0200 <lambdabot> (t1 -> t2 -> t3) -> (t1 -> t2) -> t1 -> t3
2021-10-15 01:16:13 +0200_bo(~bo@217.18.216.247) (Quit: Leaving)
2021-10-15 01:16:20 +0200 <hpc> there's a lot of ways that the idea of "side effects" can fail to fit with Applicative
2021-10-15 01:16:43 +0200 <dminuoso> Personally I think "effects" is a red herring when it comes to Applicative.
2021-10-15 01:16:46 +0200 <ph88> hpc, so you are saying the parameters are a, b, a of f (a -> b) -> f a ?
2021-10-15 01:17:23 +0200 <hpc> not quite
2021-10-15 01:17:43 +0200 <hpc> try taking the type Axman6 gave and making it fit the type of (<*>)
2021-10-15 01:17:59 +0200 <hpc> or in unification speak, solve the equation (t1 -> t2 -> t3) -> (t1 -> t2) -> t1 -> t3 = f (a -> b) -> f a -> f b
2021-10-15 01:18:21 +0200 <ph88> that's useful Axman6 thanks !
2021-10-15 01:18:42 +0200 <hippoid> ok, i'm going to be satisfied with my current vague understandindg of that term and move on to more code
2021-10-15 01:18:49 +0200 <ph88> hpc, i can see that t1 is analogous with f .. that explain all for me
2021-10-15 01:18:58 +0200 <hpc> almost
2021-10-15 01:19:01 +0200 <dminuoso> hippoid: Indeed. The intution will come on its own when you discover and work with more instances.
2021-10-15 01:19:02 +0200 <Axman6> the type (t1 -> t2 -> t3) -> (t1 -> t2) -> t1 -> t3 can be written as: ((->) t1 (t2 -> t3) -> ((->) t1 t2) -> ((->) t1 t3) or even (((->) t1) (t2 -> t3) -> (((->) t1) t2) -> (((->) t1) t3)
2021-10-15 01:19:06 +0200 <hpc> you're forgetting the (->)
2021-10-15 01:19:15 +0200 <ph88> hpc, what about the -> ?
2021-10-15 01:19:26 +0200 <Axman6> ph88: it's not t1, t1 has the wrong kind, you need something of type * -> * (or Type -> Type)
2021-10-15 01:19:27 +0200 <hpc> well, f :: Type -> Type
2021-10-15 01:19:34 +0200 <markusde> IMO Applicatives are the sacaffolding for effects, a monad is a way to combine effects. Like, in the Maybe applicative you can have computations that short circuit to Nothing, and you can combine expreession you know won't, but combining a -> Maybe a expressions needs a monad
2021-10-15 01:19:34 +0200 <hpc> and t1 :: Type
2021-10-15 01:19:44 +0200 <Axman6> :kind (->)
2021-10-15 01:19:45 +0200 <hpc> (to jump up to the kind level for a moment)
2021-10-15 01:19:56 +0200 <Axman6> % :kind (->)
2021-10-15 01:19:56 +0200 <yahb> Axman6: * -> * -> *
2021-10-15 01:20:00 +0200 <Axman6> % :kind (->) Int
2021-10-15 01:20:00 +0200 <yahb> Axman6: * -> *
2021-10-15 01:20:04 +0200 <c_wraith> try @kind to get lambdabot's attention
2021-10-15 01:20:05 +0200 <Axman6> % :kind (->) Int Bool
2021-10-15 01:20:05 +0200 <yahb> Axman6: *
2021-10-15 01:20:14 +0200 <dminuoso> My personal interpretation is that Monads are inherently about sequencing things, and Applicatives are about branching and joining (in a diamond shape)
2021-10-15 01:20:32 +0200 <ph88> hippoid, it's not so vague as you think. When you normally have a pure function doing 1 + 1 or whatever. Now if you have a box like Maybe you can also choose between Just x or Nothing .. that would be "the effect" of the Maybe. that's it really (afaik). So you have computation (1 + 1) put in box Just (1 + 1) and now you have a effectful computation
2021-10-15 01:20:46 +0200 <Axman6> ph88: so, in the case of the function applicative, f ~ ((->) a)
2021-10-15 01:20:48 +0200 <dminuoso> There's some ways in which this makes sense, but it's really just an analogy you end up when you have established a particular perspective. It's particularly terrible to explain any of this.
2021-10-15 01:20:59 +0200 <markusde> dminuoso: I don't think that's incorrect, but it's incomplete. The sequencing operator (>>) doesn't imply bind
2021-10-15 01:21:31 +0200 <dminuoso> markusde: In what way do you feel it to be incomplete?
2021-10-15 01:21:56 +0200 <Axman6> hippoid: it's definitely fair to think that our use of "effect" is very general, because it definitely is general. What effect does Identity have? Well none. And what about Proxy? Even less than none! >_>
2021-10-15 01:22:11 +0200 <hpc> haha, "less than none"
2021-10-15 01:22:23 +0200 <dminuoso> And [] doesnt *really* model non-determinism, because there's still an ordering going on
2021-10-15 01:22:24 +0200 <Axman6> =)
2021-10-15 01:22:28 +0200 <dminuoso> But Logic does
2021-10-15 01:22:31 +0200 <ph88> dminuoso, can you elaborate on branching and joining ?
2021-10-15 01:22:38 +0200 <markusde> <dminuoso>: Bind does sequence, but sequence doesn't do bind! You need a way to combine effects and values.
2021-10-15 01:23:09 +0200 <Axman6> hpc: in a sense, if the compiler is smart enough, then using the Proxy applicative will compile to doing nothing at all, which I think is fair to call doing less than no work at runtime :P
2021-10-15 01:23:14 +0200 <dminuoso> markusde: and sequence is about traversable, your point?
2021-10-15 01:23:17 +0200 <ph88> Axman6, should i be able to fill in ((->) a) for t1 and figure it out ?
2021-10-15 01:23:50 +0200 <Axman6> ph88: no, you should be able to fil in f ~ ((->) a) (<*>)'s type
2021-10-15 01:23:50 +0200 <hpc> for f, not t1
2021-10-15 01:23:53 +0200 <Axman6> :t (<*>)
2021-10-15 01:23:54 +0200 <lambdabot> Applicative f => f (a -> b) -> f a -> f b
2021-10-15 01:23:54 +0200 <markusde> dminuoso: That's my bad. When I said sequence I meant (>>).
2021-10-15 01:24:09 +0200 <dminuoso> % :t (<@>) -- ph88
2021-10-15 01:24:09 +0200 <yahb> dminuoso: ComonadApply w => w (a -> b) -> w a -> w b
2021-10-15 01:24:11 +0200 <dminuoso> % :t ident -- ph88
2021-10-15 01:24:12 +0200 <yahb> dminuoso: Applicative f => f ()
2021-10-15 01:24:15 +0200 <Axman6> % :t (<*>) @((->) Int)
2021-10-15 01:24:16 +0200 <yahb> Axman6: (Int -> (a -> b)) -> (Int -> a) -> Int -> b
2021-10-15 01:24:17 +0200 <dminuoso> Uh wait.
2021-10-15 01:24:20 +0200 <dminuoso> Someone reset yahb
2021-10-15 01:24:44 +0200 <dminuoso> % :t (<@>) -- ph88
2021-10-15 01:24:44 +0200 <yahb> dminuoso: Applicative f => f a -> f b -> f (a, b)
2021-10-15 01:24:46 +0200 <dminuoso> % :t ident -- ph88
2021-10-15 01:24:46 +0200 <yahb> dminuoso: Applicative f => f ()
2021-10-15 01:25:07 +0200 <c_wraith> Why must I constantly stumble over the line between clean and obfuscated?
2021-10-15 01:25:08 +0200 <dminuoso> ph88: We can think of these two things as fully descriptive of Applicative, as an alternative to <*> and pure
2021-10-15 01:25:43 +0200 <dminuoso> (Side note: In some edge cases of infinite structures it doesnt hold true, but lets gloss over this)
2021-10-15 01:26:08 +0200 <dminuoso> ph88: Compare that with
2021-10-15 01:26:11 +0200 <dminuoso> % :t (>>=)
2021-10-15 01:26:11 +0200 <yahb> dminuoso: Monad m => m a -> (a -> m b) -> m b
2021-10-15 01:26:35 +0200 <dminuoso> ph88: See how (>>=) has a sort of sequencing baked in? We can observe this even better if we adopt this notion:
2021-10-15 01:26:48 +0200 <dminuoso> join :: f :*: f ~> f
2021-10-15 01:27:00 +0200 <dminuoso> And think about associativity
2021-10-15 01:27:00 +0200 <hpc> c_wraith: go full php filthy
2021-10-15 01:27:08 +0200 <hpc> instance Num String, (<>) = getLine, the works
2021-10-15 01:27:13 +0200yin(~z@user/zero) ()
2021-10-15 01:27:27 +0200 <ph88> Axman6, is (Int -> (a -> b)) -> (Int -> a) -> Int -> b supposed to look like S=λxyz.(xz)(yz) or what are you saying ?
2021-10-15 01:27:34 +0200 <dminuoso> ph88: With the <@> description, you can see there's no dependencies. Conceptually we can think these two arguments as branches that come back together.
2021-10-15 01:27:39 +0200 <dminuoso> Like a diamond
2021-10-15 01:28:13 +0200 <c_wraith> hpc: that's... a different case. I'm talking like line 12 in https://paste.tomsmeding.com/1IQ276S4
2021-10-15 01:28:25 +0200 <dminuoso> ph88: There's a pretty deep rabbit hole in which we can generalize applicative to running two separate/incompatible effects.
2021-10-15 01:28:46 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
2021-10-15 01:28:48 +0200 <Axman6> ph88: it is exactly the type of that, assuming z has type Int
2021-10-15 01:29:06 +0200 <hpc> oh yikes
2021-10-15 01:29:38 +0200 <monochrom> c_wraith: I don't think it's obfuscated/ing
2021-10-15 01:29:39 +0200 <ph88> dminuoso, i've never seen <@> and ident before
2021-10-15 01:29:42 +0200 <dminuoso> ph88: Interesting side note, with the <@> and ident description, you end up with pretty cool and readable applicative laws, like `ident` being an identity with respect to <@> (up to an isomorphism)
2021-10-15 01:30:00 +0200 <c_wraith> monochrom: I dunno, I get nervous when I see an uncurry
2021-10-15 01:30:15 +0200 <c_wraith> It almost hurt to write it!
2021-10-15 01:30:19 +0200 <hpc> there's probably a way to not have "maybe" there
2021-10-15 01:30:29 +0200 <c_wraith> sure, pattern match. :P
2021-10-15 01:30:39 +0200 <hpc> i was thinking do-notation
2021-10-15 01:30:43 +0200 <monochrom> Then perhaps (\(x,y) -> PQ.insert x y)
2021-10-15 01:30:52 +0200 <hpc> just shamelessly make it a few extra lines long
2021-10-15 01:31:57 +0200 <hpc> give catMaybes . map uncons a name
2021-10-15 01:32:18 +0200 <c_wraith> that line is a local minima for difficulty parsing it mentally. It just moves that difficulty into the semantic space.
2021-10-15 01:32:35 +0200 <ph88> Axman6, ah ye i see it now. Still have to understand how the lambda expression represents the more general s combinator and <*> only for the instance of ((->) a) ... ill look at the equations for a bit
2021-10-15 01:33:02 +0200 <monochrom> You know, go looks like an unfoldr, if you want obfuscating :)
2021-10-15 01:33:33 +0200 <dminuoso> ph88: If you ever heard this "a monad is just a monoid..." joke, there's a cute interesting bit too. Applicative are monoids too (in the very same sense of that joke!), and you can in fact see this monoidal shape come into existence with this representatoin
2021-10-15 01:33:47 +0200notzmv(~zmv@user/notzmv)
2021-10-15 01:33:58 +0200 <c_wraith> monochrom: I think it's more of an unfoldr
2021-10-15 01:34:09 +0200 <dminuoso> Say: f <@> (g <@> h) ~~~ (f <@> h) <@> h
2021-10-15 01:34:22 +0200 <dminuoso> Or `f <@> ident ~~~ f` and `ident <@> f ~~~ f`
2021-10-15 01:34:40 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 01:34:41 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 01:34:41 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 01:34:44 +0200 <hpc> you can also see a monoidal structure in Alternative - that one stands out quite a bit imo
2021-10-15 01:34:56 +0200 <dminuoso> Monoids are everywhere.
2021-10-15 01:35:20 +0200 <hpc> it's like the CS version of linearity
2021-10-15 01:35:23 +0200 <hpc> when you have it, everything is easy
2021-10-15 01:35:27 +0200 <c_wraith> it works over a seed value, updating it and emitting an element one update at a time. definitely an unfoldr. But that's not pleasant to write!
2021-10-15 01:36:25 +0200 <ph88> dminuoso, so you can split and combine ? or how to get to diamond shape ?
2021-10-15 01:36:41 +0200 <dminuoso> ph88: Imagine branching like haxl
2021-10-15 01:36:50 +0200 <dminuoso> or perhaps optparse-applicative in a non-deterministic sense
2021-10-15 01:37:16 +0200 <monochrom> (++) is at the same time <> and <|>
2021-10-15 01:37:44 +0200 <monochrom> This should give you a whole ton of confusions until you sort it out, and then it's a whole ton of mathematical beauty.
2021-10-15 01:37:56 +0200 <dminuoso> ph88: `f <@> g` in haxl would simply run two things in parallel and wait on the result of both.
2021-10-15 01:39:47 +0200 <dminuoso> The only reason we never think of Applicative as perhaps generalizing "running in parallel" has to do with two facts. For one, most applicative instances also have a monad instance, and the other - this is related to the other - once you have a monad instance (which is semantically all about sequencing), there's this unwritten law demanding coherence between applicative and monad.
2021-10-15 01:40:06 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-10-15 01:41:42 +0200 <dminuoso> So as soon as there's a monad instance, the very same applicative instance would have the monadic sequencing via a trivial instance (being defined in terms of monad)
2021-10-15 01:41:53 +0200 <dminuoso> Making applicative mostly blant.
2021-10-15 01:42:38 +0200 <dminuoso> So more of then than not <$> is just a monadic interface, there's strangely very few things that are Applicative (or Selective, even) but not Monadic.
2021-10-15 01:45:38 +0200acidjnk_new3(~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de)
2021-10-15 01:46:02 +0200 <markusde> Hey I have a question about a monad transformer (?) I'm not sure exists
2021-10-15 01:46:16 +0200 <markusde> I
2021-10-15 01:46:48 +0200 <markusde> 'm looking to promote a Maybe monad into a list, so Nothing -> [] and Just x -> [x]
2021-10-15 01:47:16 +0200 <markusde> Is this a monad transformer thing? or is it some other structure
2021-10-15 01:47:29 +0200 <dminuoso> markusde: This is not a monad transformer
2021-10-15 01:47:46 +0200 <dminuoso> The technical term is called "natural transformation", and its a thing
2021-10-15 01:48:06 +0200 <dminuoso> % import Data.Maybe
2021-10-15 01:48:06 +0200 <yahb> dminuoso:
2021-10-15 01:48:08 +0200 <dminuoso> % :t maybeToList
2021-10-15 01:48:08 +0200 <yahb> dminuoso: Maybe a -> [a]
2021-10-15 01:48:12 +0200 <dminuoso> % :t listToMaybe
2021-10-15 01:48:12 +0200 <yahb> dminuoso: [a] -> Maybe a
2021-10-15 01:49:10 +0200 <monochrom> But natural transformation is very broad.
2021-10-15 01:49:16 +0200acidjnk_new(~acidjnk@p200300d0c703cb2624cf652eb5c49df1.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
2021-10-15 01:49:37 +0200 <markusde> dminuoso: I see! In CT Natrual transformations map functors to functors, right?
2021-10-15 01:49:45 +0200 <markusde> I'm a little rusty
2021-10-15 01:50:00 +0200 <dminuoso> Yes.
2021-10-15 01:52:19 +0200 <c_wraith> monochrom: thanks, unfoldr made it both cleaner to look at and harder to understand! https://paste.tomsmeding.com/8u8NaXTp
2021-10-15 01:52:35 +0200 <markusde> dminuoso: ty!
2021-10-15 01:52:43 +0200 <c_wraith> and it's not using ViewPatterns anymore, so a double-win!
2021-10-15 01:53:07 +0200 <monochrom> bwahahahaha
2021-10-15 01:53:34 +0200Cale(~cale@cpef48e38ee8583-cm0c473de9d680.cpe.net.cable.rogers.com) (Ping timeout: 252 seconds)
2021-10-15 01:54:05 +0200 <monochrom> markusde: I think "monad morphism" is more specific.
2021-10-15 01:54:18 +0200 <monochrom> https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html may help
2021-10-15 01:56:07 +0200zaquest(~notzaques@5.128.210.178) (Remote host closed the connection)
2021-10-15 01:57:05 +0200yin(~z@user/zero)
2021-10-15 01:57:08 +0200 <yin> hello
2021-10-15 01:57:33 +0200 <geekosaur> hi
2021-10-15 01:57:48 +0200 <yin> i'm trying to understand continuations
2021-10-15 01:57:57 +0200zaquest(~notzaques@5.128.210.178)
2021-10-15 01:57:58 +0200 <yin> the Continuation Monad
2021-10-15 01:57:58 +0200acidjnk_new3(~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2021-10-15 01:58:24 +0200 <monochrom> My http://www.vex.net/~trebla/haskell/cont.xhtml may help.
2021-10-15 01:58:25 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2021-10-15 01:58:46 +0200 <yin> i've started reading 3 different sources with 3 different approaches and i'm getting "Monad tutorial" flashbacks
2021-10-15 01:59:09 +0200 <yin> thanks! let's give it a try
2021-10-15 01:59:36 +0200 <c_wraith> It occurs to me...
2021-10-15 01:59:42 +0200 <markusde> monochrom:that looks like it too. lots to read today ty!
2021-10-15 01:59:48 +0200 <monochrom> I don't do analogies or intuitions. I do testable theories.
2021-10-15 02:00:49 +0200 <c_wraith> :t \x f xs -> maybe x (uncurry f) (uncons xs)
2021-10-15 02:00:50 +0200 <lambdabot> b -> (a -> [a] -> b) -> [a] -> b
2021-10-15 02:00:59 +0200 <c_wraith> that's just a fold
2021-10-15 02:00:59 +0200 <monochrom> "theories" gets a bad rap. "models".
2021-10-15 02:01:11 +0200 <c_wraith> For like... Scott encoding?
2021-10-15 02:01:24 +0200 <monochrom> Yeah
2021-10-15 02:01:57 +0200 <c_wraith> I kind of want that fold in base. (I know it's in some other libraries)
2021-10-15 02:03:12 +0200 <monochrom> You know what, suppose I break that into 2 stages. 1st stage: [a] -> Maybe x. 2nd stage: Maybe x -> b, with a default for the Nothing case.
2021-10-15 02:03:26 +0200 <yin> monochrom: thanks for the link! it's helping A LOT
2021-10-15 02:03:52 +0200 <monochrom> Err nevermind. I wanted to say that the 1st stage is a monad morphism from [] to Maybe, haha.
2021-10-15 02:04:08 +0200 <monochrom> But a monad morphism doesn't really change a to x.
2021-10-15 02:05:02 +0200 <dsal> Ugh, trying microlens and kept getting an error that didn't make any sense to me. Finally tried regular lens and it worked correctly. `x ^.. folded . someMap . ix "x"` complains about not having an instance `Show (IxValue (Map Text Text))`
2021-10-15 02:05:03 +0200 <monochrom> However! The 2nd stage is Maybe's catamorphism.
2021-10-15 02:05:18 +0200jgeerds(~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 268 seconds)
2021-10-15 02:06:17 +0200 <awpr> dsal: looks like a stuck type family, i.e. there's no Ix instance for Map?
2021-10-15 02:07:00 +0200 <awpr> yeah, it's missing that instance
2021-10-15 02:07:20 +0200 <awpr> https://hackage.haskell.org/package/microlens-0.4.12.0/docs/Lens-Micro-Internal.html#t:IxValue
2021-10-15 02:07:42 +0200 <dsal> Oh weird. Heh. That's dumb. I guess it doesn't matter here since I can just use lookup or whatever.
2021-10-15 02:08:01 +0200 <awpr> oh, they hid the instances in a secret package: "You can also use ix with types from array, bytestring, and containers by using microlens-ghc"
2021-10-15 02:08:48 +0200 <dsal> Ah. I didn't think to look there.
2021-10-15 02:09:32 +0200 <markusde> monochrom: The thing that I'm trying to model is the fact that the list monad can emulate Maybe. I think this monad morphism thing will allow me to embed (hoist? >=>?) my Maybe's into a list and all my maybe computations into list computations... right?
2021-10-15 02:09:36 +0200 <monochrom> This is when you appreciate big-data-driven personalized advertising. "Based on your browsing history, you may like: microlens-ghc".
2021-10-15 02:09:38 +0200 <dsal> Woo. Thanks, awpr !
2021-10-15 02:10:38 +0200 <monochrom> markusde: I haven't tried. I only recalled the word "monad morphism" and gave it a try.
2021-10-15 02:11:14 +0200 <markusde> monochrom: gotcha
2021-10-15 02:11:32 +0200 <monochrom> But I am impressed that "tick :: State Int ()" can be black-box generalized.
2021-10-15 02:12:29 +0200 <monochrom> and it is not an entirely "only works for State -> StateT m"
2021-10-15 02:13:02 +0200Cajun(~Cajun@user/cajun)
2021-10-15 02:15:26 +0200ec(~ec@gateway/tor-sasl/ec) (Quit: ec)
2021-10-15 02:20:33 +0200rbocquet(~weechat@2001:bc8:47a8:44e::1) (Quit: WeeChat 2.8)
2021-10-15 02:23:28 +0200Guest9936(~Guest99@50.47.115.102)
2021-10-15 02:26:40 +0200 <ph88> maybe dump question but in parsing i have combinators some / many .. but how do i do some operation exactly x times ?
2021-10-15 02:27:04 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Remote host closed the connection)
2021-10-15 02:27:20 +0200 <c_wraith> replicateM
2021-10-15 02:27:27 +0200 <c_wraith> :t replicateM
2021-10-15 02:27:28 +0200 <lambdabot> Applicative m => Int -> m a -> m [a]
2021-10-15 02:27:34 +0200 <c_wraith> as you can see, it's happy with Applicative
2021-10-15 02:27:42 +0200 <ph88> ya looks very happy !
2021-10-15 02:27:49 +0200 <c_wraith> Or replicateM_ if you don't need the results
2021-10-15 02:27:56 +0200 <monochrom> In parsec, you also have "count".
2021-10-15 02:28:17 +0200 <monochrom> But "count" is hardcoded to ParsecT.
2021-10-15 02:31:42 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 02:31:42 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 02:31:42 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 02:33:19 +0200 <ph88> i use trifecta
2021-10-15 02:36:05 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
2021-10-15 02:39:41 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 02:39:48 +0200fvr(uid503686@id-503686.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-15 02:45:50 +0200Inst(~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97)
2021-10-15 02:47:59 +0200Guest9936(~Guest99@50.47.115.102) (Ping timeout: 256 seconds)
2021-10-15 02:48:06 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 02:52:25 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
2021-10-15 02:52:58 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2021-10-15 02:53:43 +0200 <Axman6> dminuoso: you shared this with me the other day, but I'm struggling to understand the type (it's from optics yeah?) summing :: (Is k A_Fold, Is l A_Fold) => Optic' k is s a -> Optic' l js s a -> Fold s a - also I was curious to hear more about the SDN stuff you're working on
2021-10-15 02:56:57 +0200slack1256(~slack1256@45.4.2.52) (Ping timeout: 265 seconds)
2021-10-15 02:57:22 +0200slowtyper(~slowtyper@user/slowtyper) (Ping timeout: 252 seconds)
2021-10-15 03:01:20 +0200trillp(~trillp@69.233.98.238)
2021-10-15 03:02:43 +0200jespada(~jespada@host196.190-3-30.dynamic.telmex.net.ar) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-10-15 03:03:12 +0200jespada(~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a)
2021-10-15 03:08:12 +0200jespada(~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a) (Ping timeout: 268 seconds)
2021-10-15 03:11:57 +0200markusde(~makrus@2604:3d08:6f80:6b00::2ba7) (Quit: Leaving)
2021-10-15 03:12:25 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-10-15 03:12:40 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2021-10-15 03:13:21 +0200lbseale(~lbseale@user/ep1ctetus) (Read error: Connection reset by peer)
2021-10-15 03:13:47 +0200albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2021-10-15 03:14:26 +0200Player001(~Player001@2600:6c54:7e00:1a19:f0ca:556e:dcc6:b559)
2021-10-15 03:19:21 +0200meinside(uid24933@id-24933.helmsley.irccloud.com)
2021-10-15 03:21:56 +0200hololeap(~hololeap@user/hololeap)
2021-10-15 03:23:50 +0200ph88(~ph88@2a02:8109:9e00:7e5c::3d56) (Ping timeout: 260 seconds)
2021-10-15 03:39:52 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
2021-10-15 03:40:13 +0200trillp(~trillp@69.233.98.238) (Ping timeout: 252 seconds)
2021-10-15 03:41:21 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-15 03:45:34 +0200jespada(~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a)
2021-10-15 03:46:33 +0200justsomeguy(~justsomeg@user/justsomeguy)
2021-10-15 03:47:14 +0200trillp(~trillp@69.233.98.238)
2021-10-15 03:47:40 +0200slowtyper(~slowtyper@user/slowtyper)
2021-10-15 04:01:10 +0200xff0x(~xff0x@2001:1a81:5210:a600:1bfc:35a2:5bfe:31) (Ping timeout: 252 seconds)
2021-10-15 04:02:12 +0200fizzsegfaultbuzz(~segfaultf@135-180-0-138.static.sonic.net) (Ping timeout: 265 seconds)
2021-10-15 04:02:43 +0200xff0x(~xff0x@2001:1a81:524d:6800:a178:5c71:40d3:e997)
2021-10-15 04:15:39 +0200trillp(~trillp@69.233.98.238) (Quit: nyaa~)
2021-10-15 04:22:37 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 252 seconds)
2021-10-15 04:27:20 +0200Katarushisu(~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Quit: Ping timeout (120 seconds))
2021-10-15 04:27:29 +0200justsomeguy(~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2)
2021-10-15 04:27:41 +0200Katarushisu(~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net)
2021-10-15 04:31:25 +0200jespada(~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a) (Ping timeout: 252 seconds)
2021-10-15 04:32:19 +0200ikex(~ash@user/ikex) (Ping timeout: 265 seconds)
2021-10-15 04:32:36 +0200ikex(~ash@user/ikex)
2021-10-15 04:38:34 +0200emf(~emf@2620:10d:c090:400::5:c2a5) (Ping timeout: 252 seconds)
2021-10-15 04:38:51 +0200CiaoSen(~Jura@p200300c95730dd002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
2021-10-15 04:40:23 +0200bitmapper(uid464869@id-464869.lymington.irccloud.com)
2021-10-15 04:40:57 +0200emf(~emf@163.114.132.1)
2021-10-15 04:45:47 +0200[_](~itchyjunk@user/itchyjunk/x-7353470)
2021-10-15 04:46:20 +0200[itchyjunk]Guest1997
2021-10-15 04:46:20 +0200Guest1997(~itchyjunk@user/itchyjunk/x-7353470) (Killed (cadmium.libera.chat (Nickname regained by services)))
2021-10-15 04:46:20 +0200[_][itchyjunk]
2021-10-15 04:47:52 +0200td_(~td@94.134.91.160) (Ping timeout: 252 seconds)
2021-10-15 04:49:36 +0200td_(~td@muedsl-82-207-238-175.citykom.de)
2021-10-15 04:50:07 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 252 seconds)
2021-10-15 04:52:10 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2021-10-15 04:53:28 +0200Inst(~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97) (Remote host closed the connection)
2021-10-15 04:53:44 +0200Inst(~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97)
2021-10-15 04:54:04 +0200Player001(~Player001@2600:6c54:7e00:1a19:f0ca:556e:dcc6:b559) (Quit: Client closed)
2021-10-15 04:58:45 +0200machinedgod(~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 265 seconds)
2021-10-15 05:03:13 +0200falafel(~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com)
2021-10-15 05:03:25 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 05:06:24 +0200Player001(~Player001@2600:6c54:7e00:1a19:f0ca:556e:dcc6:b559)
2021-10-15 05:13:15 +0200abrantesasf(~abrantesa@187.36.170.211) (Remote host closed the connection)
2021-10-15 05:24:16 +0200falafel(~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com) (Ping timeout: 245 seconds)
2021-10-15 05:25:14 +0200Null_A(~null_a@2601:645:8700:2290:e4f7:cf97:bec9:9d10) (Remote host closed the connection)
2021-10-15 05:26:46 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 245 seconds)
2021-10-15 05:38:29 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 05:38:29 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 05:38:29 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 05:40:01 +0200emf(~emf@163.114.132.1) (Quit: emf)
2021-10-15 05:40:53 +0200lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-10-15 05:43:25 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-15 05:45:43 +0200zebrag(~chris@user/zebrag) (Remote host closed the connection)
2021-10-15 05:47:41 +0200img(~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2021-10-15 05:48:48 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
2021-10-15 05:50:32 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 05:52:12 +0200img(~img@user/img)
2021-10-15 05:55:42 +0200visortelle(~visortell@37.214.28.39)
2021-10-15 05:56:17 +0200visortelle(~visortell@37.214.28.39) (Remote host closed the connection)
2021-10-15 06:05:31 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 06:06:13 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2021-10-15 06:22:58 +0200img(~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2021-10-15 06:33:25 +0200emf(~emf@2620:10d:c090:400::5:c2a5)
2021-10-15 06:37:20 +0200connrs_(~connrs@conners.plus.com)
2021-10-15 06:37:21 +0200img(~img@user/img)
2021-10-15 06:37:22 +0200connrs(~connrs@conners.plus.com) (Ping timeout: 252 seconds)
2021-10-15 06:37:37 +0200connrs_connrs
2021-10-15 06:40:15 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-10-15 06:43:55 +0200emf(~emf@2620:10d:c090:400::5:c2a5) (Quit: emf)
2021-10-15 06:46:05 +0200 <dsal> OK, feeling dumb. If I have a thing that derives MonadIO, how can I have liftIO for internal use, but not export it. i.e., I don't want to derive MonadIO, but I want lift to do the right thing.
2021-10-15 06:51:02 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 268 seconds)
2021-10-15 06:55:11 +0200Player001(~Player001@2600:6c54:7e00:1a19:f0ca:556e:dcc6:b559) (Changing host)
2021-10-15 06:55:11 +0200Player001(~Player001@user/player001)
2021-10-15 07:00:04 +0200fvr(uid503686@id-503686.uxbridge.irccloud.com)
2021-10-15 07:02:58 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 07:02:58 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 07:02:58 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 07:04:51 +0200 <nitrix> A newtype wrapping some monad transformer on IO, (since those all have MonadIO instances too). Then your module imports Control.Monad.State to have access to liftIO internally. Then your export only the newtype, not the constructors.
2021-10-15 07:05:39 +0200 <nitrix> And you'll probably want a myTypeLiftIO :: IO a -> MyType a, and the implementation would be MyTypeConstructor . liftIO
2021-10-15 07:05:50 +0200abraham(~abraham@143.244.185.86)
2021-10-15 07:06:10 +0200slowButPresent(~slowButPr@user/slowbutpresent) (Quit: leaving)
2021-10-15 07:07:36 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 245 seconds)
2021-10-15 07:09:00 +0200shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 260 seconds)
2021-10-15 07:09:00 +0200 <nitrix> dsal, https://gist.github.com/nitrix/e7d04267fc91bbb764bdbb2e8879a47f#file-gistfile1-hs-L33-L34
2021-10-15 07:10:10 +0200 <nitrix> Old piece of code when I ran into the same situation, might be useful to you.
2021-10-15 07:11:06 +0200wyrd(~wyrd@gateway/tor-sasl/wyrd) (Remote host closed the connection)
2021-10-15 07:11:18 +0200wyrd(~wyrd@gateway/tor-sasl/wyrd)
2021-10-15 07:11:53 +0200 <dsal> Well that was hilariously easier than I expected.
2021-10-15 07:12:26 +0200 <dsal> Actually, it was as easy as I expected, but I spent a hilariously long amount of time trying to do that in various dumb ways. heh
2021-10-15 07:12:31 +0200 <dsal> thanks, nitrix ! :)
2021-10-15 07:13:42 +0200Inst(~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97) (Remote host closed the connection)
2021-10-15 07:14:00 +0200Inst(~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97)
2021-10-15 07:22:08 +0200mei6(~mei@user/mei)
2021-10-15 07:28:41 +0200img(~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
2021-10-15 07:30:31 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2021-10-15 07:37:33 +0200img(~img@user/img)
2021-10-15 07:39:47 +0200mei6(~mei@user/mei) (Quit: mei6)
2021-10-15 07:40:22 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
2021-10-15 07:41:00 +0200mei6(~mei@user/mei)
2021-10-15 07:46:31 +0200emf(~emf@2601:602:9400:84d:4d0:b06a:6fc2:88e4)
2021-10-15 07:50:16 +0200lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-10-15 07:50:29 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 07:50:37 +0200lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-10-15 07:54:31 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-10-15 07:56:36 +0200 <dsal> I'm probably going to get yelled at tomorrow for introducing microlens into this test code, but it would've been ridiculously tedious to do this without it. I conflict with opinionated management. heh
2021-10-15 08:00:44 +0200 <Axman6> dsal: do you specifically need MonadIO/liftIO, or do you need to be able to call IO from your monad?
2021-10-15 08:01:04 +0200 <dsal> Axman6: I want to call IO from my monad but I don't want anyone else to.
2021-10-15 08:01:12 +0200 <dsal> The above pattern was almost exactly what I had except for the lift thing.
2021-10-15 08:03:02 +0200 <dsal> The monad in question is a `Transaction` thing that runs postgres transactions inside my app. I don't want any side effects inside the transaction.
2021-10-15 08:03:04 +0200 <Axman6> sorry, was still catching up, yeah the myLiftIO approach is the right one
2021-10-15 08:03:58 +0200 <dsal> It does some logging and, you know, IO, but I don't want someone making a TCP connection or launching missiles or whatever kids do these days while holding open a transaction.
2021-10-15 08:04:18 +0200michalz(~michalz@185.246.204.93)
2021-10-15 08:04:22 +0200 <dsal> I've not shared this code yet, but I figure it'd be nice to treat it like STM.
2021-10-15 08:04:28 +0200 <dsal> (but without the retries)
2021-10-15 08:04:55 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-15 08:05:47 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-10-15 08:06:32 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-10-15 08:10:16 +0200_ht(~quassel@82-169-194-8.biz.kpn.net)
2021-10-15 08:11:33 +0200 <nitrix> Ah yeah, so you keep the myLift private and you're good.
2021-10-15 08:11:38 +0200Cale(~cale@72.139.192.117)
2021-10-15 08:13:18 +0200 <nitrix> Err, myLiftIO, since you may still want a myLift operation as well.
2021-10-15 08:21:07 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 08:25:43 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
2021-10-15 08:26:42 +0200benin(~benin@183.82.206.194)
2021-10-15 08:27:00 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2021-10-15 08:29:35 +0200ubert(~Thunderbi@77.119.168.192.wireless.dyn.drei.com)
2021-10-15 08:32:32 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:7767:27e:419a:f863)
2021-10-15 08:32:50 +0200truckasaurus(sid457088@helmsley.irccloud.com) (Ping timeout: 245 seconds)
2021-10-15 08:32:58 +0200truckasaurus(sid457088@id-457088.helmsley.irccloud.com)
2021-10-15 08:33:19 +0200justHaunt1(~justache@user/justache)
2021-10-15 08:34:45 +0200SrPx_(sid108780@id-108780.uxbridge.irccloud.com)
2021-10-15 08:34:47 +0200edwtjo_(~edwtjo@h-109-228-137-133.A213.priv.bahnhof.se)
2021-10-15 08:34:54 +0200SrPx(sid108780@uxbridge.irccloud.com) (Ping timeout: 245 seconds)
2021-10-15 08:34:54 +0200ridcully(~ridcully@p57b523cc.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
2021-10-15 08:34:54 +0200edwtjo(~edwtjo@user/edwtjo) (Ping timeout: 245 seconds)
2021-10-15 08:34:54 +0200justHaunt(~justache@user/justache) (Ping timeout: 245 seconds)
2021-10-15 08:34:54 +0200Techcable(~Techcable@168.235.93.147) (Ping timeout: 245 seconds)
2021-10-15 08:34:54 +0200ozzymcduff(~mathieu@81-234-151-21-no94.tbcn.telia.com) (Ping timeout: 245 seconds)
2021-10-15 08:34:56 +0200justHaunt1justHaunt
2021-10-15 08:35:19 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-10-15 08:35:42 +0200ridcully(~ridcully@p57b523cc.dip0.t-ipconnect.de)
2021-10-15 08:36:08 +0200Techcable(~Techcable@168.235.93.147)
2021-10-15 08:36:26 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 08:36:33 +0200ozzymcduff(~mathieu@81-234-151-21-no94.tbcn.telia.com)
2021-10-15 08:39:20 +0200bitmapper(uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-15 08:39:59 +0200jonathanx__(~jonathan@dyn-8-sc.cdg.chalmers.se) (Ping timeout: 250 seconds)
2021-10-15 08:43:15 +0200emf(~emf@2601:602:9400:84d:4d0:b06a:6fc2:88e4) (Quit: emf)
2021-10-15 08:46:49 +0200jonathanx(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
2021-10-15 08:47:58 +0200jonathanx(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
2021-10-15 08:48:07 +0200d34df00d(~d34df00d@2600:1700:8c60:3a10::48) ()
2021-10-15 08:48:15 +0200jonathanx(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
2021-10-15 08:49:01 +0200jakalx(~jakalx@base.jakalx.net) ()
2021-10-15 08:53:13 +0200_ht(~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-10-15 09:03:52 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
2021-10-15 09:06:43 +0200fendor(~fendor@178.165.162.11.wireless.dyn.drei.com)
2021-10-15 09:14:05 +0200mc47(~mc47@xmonad/TheMC47)
2021-10-15 09:15:24 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Remote host closed the connection)
2021-10-15 09:15:46 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 252 seconds)
2021-10-15 09:17:18 +0200 <mc47> Hey, is there a way to get a list of modules and their descriptions from the hackage docs of a package? Something like this https://xmonad.github.io/xmonad-docs/xmonad-contrib-0.16.999/
2021-10-15 09:19:38 +0200chele(~chele@user/chele)
2021-10-15 09:27:29 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 265 seconds)
2021-10-15 09:28:59 +0200edwtjo_edwtjo
2021-10-15 09:29:29 +0200edwtjoGuest9561
2021-10-15 09:30:52 +0200Guest9561(~edwtjo@h-109-228-137-133.A213.priv.bahnhof.se) (Changing host)
2021-10-15 09:30:52 +0200Guest9561(~edwtjo@user/edwtjo)
2021-10-15 09:31:09 +0200ph88(~ph88@2a02:8109:9e00:7e5c::3d56)
2021-10-15 09:31:10 +0200 <merijn> mc47: I don't think there's a builtin way to get that atm
2021-10-15 09:32:30 +0200mikoto-chan(~mikoto-ch@84.199.144.235)
2021-10-15 09:32:36 +0200 <mc47> merijn: we thought so as well, I guess we'll have to rely on our self-hosted haddock docs then
2021-10-15 09:32:37 +0200 <mc47> thank you
2021-10-15 09:35:49 +0200cfricke(~cfricke@user/cfricke)
2021-10-15 09:35:57 +0200jakalx(~jakalx@base.jakalx.net)
2021-10-15 09:36:19 +0200jinsun__(~quassel@user/jinsun)
2021-10-15 09:36:37 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-10-15 09:37:43 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 09:39:58 +0200jinsun(~quassel@user/jinsun) (Ping timeout: 252 seconds)
2021-10-15 09:41:47 +0200[exa](exa@user/exa/x-3587197)
2021-10-15 09:42:11 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
2021-10-15 09:42:15 +0200jinsun__jinsun
2021-10-15 09:43:25 +0200dschrempf(~dominik@070-207.dynamic.dsl.fonira.net)
2021-10-15 09:44:56 +0200abhixec(~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Remote host closed the connection)
2021-10-15 09:55:54 +0200Xraell(~yourname@45.157.15.145)
2021-10-15 09:57:31 +0200tdaeayusr^^(~tdaeayusr@70.166.66.234) (Ping timeout: 252 seconds)
2021-10-15 09:58:26 +0200mikoto-chan(~mikoto-ch@84.199.144.235) (Quit: mikoto-chan)
2021-10-15 10:00:23 +0200 <absence> when resolving typeclass instances, the compiler can't tell the difference between "C a => A a" and "A a", because constraints are checked later, so they're reported as duplicates in an error. is it possible to work around that somehow by changing the structure, using language extensions, etc?
2021-10-15 10:02:59 +0200vpan(~0@212.117.1.172)
2021-10-15 10:03:37 +0200srk(~sorki@user/srk) (Ping timeout: 252 seconds)
2021-10-15 10:03:59 +0200srk(~sorki@user/srk)
2021-10-15 10:04:39 +0200 <merijn> absence: Not really, tbh
2021-10-15 10:04:56 +0200 <merijn> absence: I would strongly advice avoiding scenarios like that
2021-10-15 10:05:38 +0200 <merijn> absence: 90% of the time people (try to) do that because they want a "sensible default instance". In which case I'd advice just using DefaultSignatures and get 100x saner code for a tiny bit more verbosity
2021-10-15 10:06:55 +0200ph88(~ph88@2a02:8109:9e00:7e5c::3d56) (Ping timeout: 260 seconds)
2021-10-15 10:07:07 +0200hololeap_(~hololeap@user/hololeap)
2021-10-15 10:07:44 +0200hololeap(~hololeap@user/hololeap) (Read error: Connection reset by peer)
2021-10-15 10:08:13 +0200hendursa1(~weechat@user/hendursaga)
2021-10-15 10:08:48 +0200hendursaga(~weechat@user/hendursaga) (Ping timeout: 276 seconds)
2021-10-15 10:11:07 +0200Guest9561edwtjo_
2021-10-15 10:11:18 +0200 <sm> hey all. I'm using System.Process.spawnCommand to run background threads, each playing a sound effect. They end quickly, but the processes remain, in some kind of zombie state, as long as the app is running. pstree shows them parenthesised, htop shows state Z, pgrep doesn't show them at all. Do you know what's happening ?
2021-10-15 10:12:05 +0200 <merijn> sm: You need to wait(2) on dead children
2021-10-15 10:12:11 +0200 <merijn> You can't just blindly ignore them
2021-10-15 10:12:20 +0200 <merijn> Else they turn into zombies
2021-10-15 10:12:23 +0200 <sm> I am discarding their thread ids when I spawn. Is laziness biting somehow ?
2021-10-15 10:12:52 +0200 <merijn> sm: Eh, you sound confused? spawnCommand spawns *processes* not threads?
2021-10-15 10:12:52 +0200 <sm> wait, eh. process haddock did not mention this I think
2021-10-15 10:13:37 +0200 <sm> sorry, not thread ids: ProcessHandle's
2021-10-15 10:13:53 +0200 <sm> https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#v:spawnCommand
2021-10-15 10:14:00 +0200 <merijn> sm: If you drop them and never wait on subprocesses, then they will all turn into zombies, yes
2021-10-15 10:14:31 +0200smis currently surrounded by an army of 1862 undead
2021-10-15 10:14:59 +0200 <merijn> sm: See https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#t:ProcessHandle and https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#v:waitForProcess
2021-10-15 10:15:43 +0200 <sm> merijn, thank you very much, most helpful
2021-10-15 10:15:48 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
2021-10-15 10:16:20 +0200 <sm> this seems to be one of things you're supposed to just know
2021-10-15 10:17:28 +0200 <merijn> sm: The exit code is only real way child processes can report errors to their parent, so posix requires parents use wait(2) to query the exit code of the child processes. Which means the child has to stick around until the parent does that
2021-10-15 10:17:42 +0200geekosaur(~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
2021-10-15 10:17:49 +0200allbery_b(~geekosaur@xmonad/geekosaur)
2021-10-15 10:17:52 +0200allbery_bgeekosaur
2021-10-15 10:18:05 +0200 <sm> waitForProcess will block I think ? the haddock is a little unclear
2021-10-15 10:18:09 +0200 <sm> "..in order to call waitForProcess without blocking all the other threads in the system.."
2021-10-15 10:18:28 +0200 <merijn> It blocks, yes. But without -threaded it *also* blocks all other threads
2021-10-15 10:18:41 +0200 <sm> gotcha
2021-10-15 10:18:57 +0200acidjnk_new3(~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de)
2021-10-15 10:19:09 +0200ub(~Thunderbi@178.165.181.201.wireless.dyn.drei.com)
2021-10-15 10:19:41 +0200ubert(~Thunderbi@77.119.168.192.wireless.dyn.drei.com) (Ping timeout: 265 seconds)
2021-10-15 10:19:42 +0200ububert
2021-10-15 10:19:51 +0200 <sm> my goal was fire and forget processes, that I can start and which disappear by themselves
2021-10-15 10:20:06 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Ping timeout: 245 seconds)
2021-10-15 10:20:08 +0200 <merijn> sm: You can poll using getProcessExitCode
2021-10-15 10:20:29 +0200 <merijn> sm: That is fairly tricky on unix in general
2021-10-15 10:20:44 +0200max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
2021-10-15 10:20:54 +0200 <sm> darn
2021-10-15 10:20:55 +0200 <merijn> sm: I can shill my usual (entirely underrated and underread) book: Advanced Programming in the UNIX Environment, 3rd edition
2021-10-15 10:20:56 +0200 <absence> merijn: thanks, i'll look into DefaultSignatures
2021-10-15 10:21:17 +0200 <merijn> absence: Basically, those let you give a default implementation with a type signature that doesn't match the *real* signature
2021-10-15 10:21:59 +0200 <merijn> absence: So, suppose you wanted "instance Show a => Foo a" (so a default version using Show), you'd instead have "class Foo a where ..." and then use Show on the default implemenation (via DefaultSignatures)
2021-10-15 10:22:13 +0200 <maerwald> sm: all a zombie does is occupy a entry in the process table
2021-10-15 10:22:32 +0200 <merijn> absence: That means that you can simply write "instance Foo MyData" and it will use the Show default implementation (assuming MyData has a Show instance)
2021-10-15 10:22:39 +0200ubert1(~Thunderbi@178.165.181.201.wireless.dyn.drei.com)
2021-10-15 10:22:49 +0200 <maerwald> in a long-running backend, you probably don't want that
2021-10-15 10:22:53 +0200 <maerwald> otherwise it doesn't matter
2021-10-15 10:23:03 +0200 <sm> maerwald: yes, and that is bad when you're playing a lot of sound effects.. after a while your system can't fork anything new :)
2021-10-15 10:23:05 +0200 <merijn> absence: Since you explicitly define the instance, you avoid overlapping instances, but you don't have to write the actual implementation either
2021-10-15 10:23:23 +0200 <merijn> absence: See, for example, https://github.com/merijn/validated-literals/blob/master/ValidLiterals.hs#L86-L88
2021-10-15 10:23:44 +0200 <merijn> absence: Basically, if 'b' has a Lift instance you can just use the default implementation, if it doesn't, you have to write a custom one
2021-10-15 10:25:11 +0200 <merijn> sm: tbh, you could just have a "spawn command and immediately wait" action and fork that into it's own forkIO thread and it should "Just Work (TM)" (assuming you use -threaded)
2021-10-15 10:25:34 +0200 <merijn> sm: forkIO thread are cheap as hell, so you can easily afford 1 per sub-process
2021-10-15 10:25:41 +0200 <sm> merijn, won't that thread hang around for the same reason ?
2021-10-15 10:25:48 +0200 <sm> process.
2021-10-15 10:25:55 +0200 <sm> thread ?
2021-10-15 10:25:57 +0200 <sm> hmm
2021-10-15 10:25:57 +0200 <noctux> if you call wait, noe
2021-10-15 10:26:06 +0200 <noctux> because you collect the zombi with wait
2021-10-15 10:26:09 +0200 <merijn> sm: forkIO threads are gced when they finish executing
2021-10-15 10:26:24 +0200 <merijn> sm: So the thread will wait until the subprocess ends, then terminate
2021-10-15 10:26:47 +0200 <merijn> You don't have to wait for GHC threads to get rid of them
2021-10-15 10:27:09 +0200 <sm> that's exactly what I wanted. I think I even started out using forkIO, but switched to spawnCommand for some reason
2021-10-15 10:27:43 +0200 <merijn> This should work fine without zombies: forkIO (spawnCommand "foo" >>= waitForProcess)
2021-10-15 10:28:22 +0200 <merijn> Silently swallows all errors from subprocesses, but if that's fine, you're set
2021-10-15 10:28:31 +0200hnOsmium0001(uid453710@id-453710.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-15 10:29:12 +0200azeem(~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c) (Read error: Connection reset by peer)
2021-10-15 10:30:12 +0200azeem(~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c)
2021-10-15 10:31:26 +0200 <sm> (void . forkIO . void . waitForProcess <=< spawnCommand) ... works perfectly. Thanks! I would not have figured this out from docs.
2021-10-15 10:31:57 +0200 <merijn> Don't need void before forkIO, I think?
2021-10-15 10:31:59 +0200 <merijn> :t forkIO
2021-10-15 10:32:01 +0200 <lambdabot> error: Variable not in scope: forkIO
2021-10-15 10:32:08 +0200azeem(~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c) (Read error: Connection reset by peer)
2021-10-15 10:32:11 +0200 <merijn> % :t Control.Concurrent.forkIO
2021-10-15 10:32:11 +0200 <yahb> merijn: IO () -> IO ThreadId
2021-10-15 10:32:15 +0200 <merijn> ah, you do
2021-10-15 10:32:21 +0200azeem(~azeem@emp-85-170.eduroam.uu.se)
2021-10-15 10:32:26 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
2021-10-15 10:32:57 +0200jgeerds(~jgeerds@55d4da80.access.ecotel.net)
2021-10-15 10:33:16 +0200 <sm> actual code:
2021-10-15 10:33:31 +0200smsent a haskell code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/6cd0955684e08aa5ba4bbc242241e0f13aab…
2021-10-15 10:33:54 +0200aegon(~mike@174.127.249.180) (Remote host closed the connection)
2021-10-15 10:34:07 +0200 <maerwald> why not use `withCreateProcess`?
2021-10-15 10:34:22 +0200 <merijn> Needs more bindings
2021-10-15 10:34:32 +0200 <merijn> maerwald: Because he doesn't wanna wait for it to finish?
2021-10-15 10:45:25 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-10-15 10:47:40 +0200gehmehgeh(~user@user/gehmehgeh)
2021-10-15 10:48:24 +0200tdaeausr^(~tdaeausr@70.166.66.234)
2021-10-15 10:48:41 +0200cheater(~Username@user/cheater) (Ping timeout: 265 seconds)
2021-10-15 10:51:31 +0200statusbot(~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com) (Read error: Connection reset by peer)
2021-10-15 10:51:40 +0200statusbot(~statusbot@ec2-34-198-122-184.compute-1.amazonaws.com)
2021-10-15 10:55:25 +0200cheater(~Username@user/cheater)
2021-10-15 10:57:47 +0200shriekingnoise(~shrieking@186.137.144.80) (Quit: Quit)
2021-10-15 10:58:34 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-10-15 11:00:56 +0200 <absence> merijn: hm, maybe i misunderstood how to use it, but i run into the same problem when using DefaultSignatures. if i want one implementation for types that have a Generic instance, and another for those that don't, i still end up with "Generic a => A a" (with uses the default implementation that depends on Generic) and "A a" (with explicit non-Generic implementation)
2021-10-15 11:01:21 +0200ph88(~ph88@2a02:8109:9e00:7e5c::3d56)
2021-10-15 11:01:36 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-10-15 11:02:06 +0200 <merijn> absence: You control the source of class 'A' yeah?
2021-10-15 11:02:21 +0200 <merijn> can you pastebin the class and instance definition?
2021-10-15 11:02:57 +0200 <merijn> absence: oh, wait, you use the default implementation and then define "instance Generic a => A a where ..."?
2021-10-15 11:03:33 +0200 <merijn> absence: If you use DefaultSignatures you don't define "instane Generic a => A a" that will always be an overlapping mess and you can't fix that
2021-10-15 11:04:24 +0200 <merijn> absence: The idea with DefaultSignatures is that you still define an instance for each individual type, you just never need to define an *implementation*, so "instance A Foo" becomes the entire complete code to make Foo an instance of A (since it can just use the default implementations)
2021-10-15 11:04:52 +0200 <merijn> Downside: You need to write out "instance A Foo" for every type
2021-10-15 11:04:57 +0200 <merijn> Upside: No overlapping clusterfuck
2021-10-15 11:07:25 +0200MQ-17J(~MQ-17J@8.6.144.117) (Ping timeout: 252 seconds)
2021-10-15 11:12:30 +0200 <absence> merijn: ahh i see! and then i have to write instances (with the same explicit implementation) for all the non-Generic types? instance A Int where f = nonGeneric, instance A String where f = nonGeneric, etc?
2021-10-15 11:13:23 +0200 <merijn> absence: If they can't work with the default, yeah
2021-10-15 11:13:30 +0200tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
2021-10-15 11:15:06 +0200wyrd(~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
2021-10-15 11:16:33 +0200azeem(~azeem@emp-85-170.eduroam.uu.se) (Read error: Connection reset by peer)
2021-10-15 11:16:59 +0200 <absence> actually maybe lists do have a Generic instance, so String was a bad example. stuff like Int, Text, Bool, etc don't and can't use the default. it's going to be LOTS of instances for both Generic and non-Generic types it seems, which is what i was hoping to avoid to begin with
2021-10-15 11:17:11 +0200azeem(~azeem@emp-85-170.eduroam.uu.se)
2021-10-15 11:17:53 +0200 <merijn> I'm not really sure how you'd end up in a situation where there is a single implementation that works for all non-Generics and another that works for all Generics
2021-10-15 11:18:25 +0200 <merijn> What are you trying to accomplish that this is a problem
2021-10-15 11:18:59 +0200__monty__(~toonn@user/toonn)
2021-10-15 11:24:27 +0200wyrd(~wyrd@gateway/tor-sasl/wyrd)
2021-10-15 11:28:49 +0200 <absence> merijn: i have a bunch of records, defined outside my control, and containing sub-records inside Maybe, etc. for all the fields of a specific type (say Text) i want to do some validation, e.g. Text -> Either SomeError Text, but doing that manually would be very error-prone as the records change over time. i thought i could do it with Generic, but for each value i end up wanting to ask is the type Text?
2021-10-15 11:28:55 +0200 <absence> validate. else does the value have a Generic instance? recurse over all fields and propagate the Either SomeError with traverse. else dummy-validate with "pure". as you can imagine, i'm having some problems expressing those questions to the compiler :)
2021-10-15 11:29:44 +0200 <merijn> It's the same validation for all values of the same type?
2021-10-15 11:29:56 +0200 <absence> yes
2021-10-15 11:30:54 +0200 <merijn> Isn't that the kinda atrocity uniplate can simplify?
2021-10-15 11:31:07 +0200 <sm> how would you silence stdout and stderr of just a particular callCommand or spawnCommand ?
2021-10-15 11:31:32 +0200 <sm> I just relearned that https://hackage.haskell.org/package/silently is not the way, despite appearances
2021-10-15 11:31:41 +0200 <absence> merijn: ooh, i had completely forgotten uniplate exists. you may be right!
2021-10-15 11:31:48 +0200 <merijn> sm: silently is hacky as hell
2021-10-15 11:31:58 +0200 <merijn> sm: You can't with spawnCommand
2021-10-15 11:32:17 +0200 <merijn> sm: You'll have to use the CreateProcess interface
2021-10-15 11:32:34 +0200 <lortabac> absence: if you use lens, there is also Control.Lens.Plated
2021-10-15 11:32:36 +0200 <merijn> sm: By default children inherit stdin/stdout/stderr from their parent (i.e. your terminal)
2021-10-15 11:32:44 +0200 <sm> merijn: well since the spawnCommand is in a forkIO child thread.. I thought I could do something in there
2021-10-15 11:33:16 +0200 <merijn> sm: No, because it never goes to your Haskell code
2021-10-15 11:33:25 +0200 <merijn> sm: The child process is just directly writing to the same terminal
2021-10-15 11:33:32 +0200 <sm> woah
2021-10-15 11:33:33 +0200 <merijn> sm: https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#t:StdStream
2021-10-15 11:33:53 +0200 <sm> merijn++, again you enlighten me
2021-10-15 11:33:54 +0200 <merijn> the CreateProcess record lets you specify how to setup the stdin/stdout/stderr of the child process
2021-10-15 11:34:02 +0200 <sm> thanks
2021-10-15 11:34:04 +0200epolanski(uid312403@id-312403.helmsley.irccloud.com)
2021-10-15 11:34:50 +0200 <merijn> sm: You can open a read/write handle to /dev/null and pass that to swallow all output, alternatively you can use CreatePipe to get a handle to intercept output on and, say, log it or something
2021-10-15 11:35:59 +0200 <sm> phew.. hard work to run things and ignore them
2021-10-15 11:38:06 +0200 <maerwald> or just use the unix package
2021-10-15 11:38:18 +0200 <merijn> sm: tbh, I like process, it's very solid and comprehensive, but it's best thought of as fairly low level. A lot of the "simple" things like spawnCommand are kinda limited in the real world. Generally I just end up writing a custom application specific wrapper around createProcess/withCreateProcess
2021-10-15 11:38:36 +0200 <maerwald> process API is atrocious
2021-10-15 11:38:39 +0200 <merijn> maerwald: I don't think anyone else in here besides you is principled enough to use unix correctly, tbh
2021-10-15 11:38:47 +0200 <merijn> maerwald: How so?
2021-10-15 11:38:54 +0200 <maerwald> I dunno, everything
2021-10-15 11:39:07 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 11:39:11 +0200 <sm> maerwald: this needs to be cross platform, and I assume unix-compat won't do
2021-10-15 11:39:20 +0200 <merijn> maerwald: Unix API is way worse, forkProcess is an insanely dangerous non-option
2021-10-15 11:39:37 +0200smchecks async
2021-10-15 11:39:43 +0200 <maerwald> sm: here's what I do cross-platform: I write an abstraction that uses `unix` on unix and `process` on windows :p
2021-10-15 11:39:55 +0200 <merijn> maerwald: You just gotta ignore the "high level" process API and only use createProcess/withCreateProcess
2021-10-15 11:39:57 +0200 <arahael> I haven't tried the process api, but outside of haskell, the only "process" library I've liked has been... Python's subprocess module.
2021-10-15 11:40:08 +0200 <arahael> (And I've used a *lot* of different systems and languages)
2021-10-15 11:40:16 +0200 <merijn> arahael: The low level process API is fine and does exactly what you'd expect
2021-10-15 11:40:18 +0200dschrempf(~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
2021-10-15 11:40:20 +0200 <sm> maerwald: any chance you have a robust forkAndIgnore ? :)
2021-10-15 11:40:23 +0200 <ph88> how can i make with trifecta that if a line doesn't match it goes on to try the next line ? I can add the function `try` on my parser, but that doesn't forward it to the next line if it doesn't match i think
2021-10-15 11:40:25 +0200 <arahael> merijn: That's good.
2021-10-15 11:40:27 +0200 <merijn> The "high" level api is kinda bad, imo
2021-10-15 11:40:37 +0200 <merijn> arahael: It simplifies things in invalid ways, imo
2021-10-15 11:40:48 +0200 <arahael> merijn: What's not good are yeah, 'high level' api's that do magic. Python's subprocess has a very nice and elegant middle-of-the-line approach.
2021-10-15 11:41:14 +0200 <arahael> Ruby's process stuff by contrast, are awful, imho.
2021-10-15 11:41:16 +0200 <merijn> arahael: I mean: "createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)" as is straightforward you can get for posix processes
2021-10-15 11:41:24 +0200 <arahael> Very nice.
2021-10-15 11:41:26 +0200 <[exa]> ph88: you need alternative parser that eats the rest of the line
2021-10-15 11:41:35 +0200 <merijn> arahael: Where CreateProcess is a record that handles all kinds of configuration like pipes, etc.
2021-10-15 11:41:42 +0200 <arahael> I figured.
2021-10-15 11:42:46 +0200 <arahael> merijn: What I particularly dislike are systems that try to provide a magical unix facade over windows.
2021-10-15 11:42:47 +0200 <[exa]> ph88: parsix package is basically trifecta with sensible error recovery
2021-10-15 11:43:01 +0200theproffesor(~theproffe@user/theproffesor) (Ping timeout: 245 seconds)
2021-10-15 11:43:02 +0200 <[exa]> (suggest trying that out)
2021-10-15 11:43:08 +0200 <merijn> maerwald: I mean, how do you even deal with subprocess at all using unix? forkProcess?
2021-10-15 11:43:23 +0200 <maerwald> yeah
2021-10-15 11:43:30 +0200 <merijn> I am 110% convinced not a single person on this planet is able to correctly and safely use forkProcess
2021-10-15 11:43:43 +0200 <merijn> It's one of the most crazy/insanely dangerous functions in existence
2021-10-15 11:43:47 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-10-15 11:44:13 +0200theproffesor(~theproffe@2601:282:847f:8010::be7d)
2021-10-15 11:44:13 +0200theproffesor(~theproffe@2601:282:847f:8010::be7d) (Changing host)
2021-10-15 11:44:13 +0200theproffesor(~theproffe@user/theproffesor)
2021-10-15 11:44:22 +0200 <arahael> Just saw the docs: "forkProcess corresponds to the POSIX fork system call. " <-- That tells me everything I need to know.
2021-10-15 11:44:27 +0200 <maerwald> you have to wiggle the code for a while and perform some dark shaman rituals, but it eventually works
2021-10-15 11:44:30 +0200 <[exa]> merijn: implying there are people who can safely fork() with custom fd's open
2021-10-15 11:45:11 +0200 <merijn> [exa]: Implying anyone can safely use fork at all
2021-10-15 11:45:25 +0200 <merijn> maerwald: Incorrect. It will eventually *seem* to work
2021-10-15 11:45:40 +0200 <maerwald> that's programming in general
2021-10-15 11:45:46 +0200 <[exa]> :]
2021-10-15 11:45:53 +0200 <merijn> [exa]: I don't understand how it's 2021 and people still think fork is a remotely sensible function/API
2021-10-15 11:46:11 +0200 <merijn> Like, it's been superceded by posix_spawn for, like, 3 decades now
2021-10-15 11:46:19 +0200 <merijn> The semantics are entirely unreasonable
2021-10-15 11:46:31 +0200 <arahael> It was bad enough when it was mostly defined how fork(), followed immediately by exec(), was reasonable, but today even that is problematic.
2021-10-15 11:46:32 +0200 <[exa]> merijn: it is, in a totally isolated usecase of a 300line C program that terminates in the first clone and execs in the second one
2021-10-15 11:46:42 +0200 <maerwald> does unix even have spawn?
2021-10-15 11:46:56 +0200 <merijn> maerwald: I dunno if unix has it, but that's a failure of unix if it doesn't
2021-10-15 11:47:00 +0200 <arahael> maerwald: It has the various clone system calls.
2021-10-15 11:47:18 +0200 <maerwald> I can't find it
2021-10-15 11:47:23 +0200 <merijn> maerwald: posix_spawn is *old* by now and the recommended way of creating new processes
2021-10-15 11:47:46 +0200 <merijn> But everyone still teaches fork, because we like damaging future programmers
2021-10-15 11:48:08 +0200 <merijn> [exa]: I had a colleague come to me with weird concurrency issues
2021-10-15 11:48:12 +0200 <merijn> Walk through the code
2021-10-15 11:48:24 +0200 <arahael> maerwald: There's https://www.man7.org/linux/man-pages/man2/clone.2.html but I'd _still_ avoid it.
2021-10-15 11:48:27 +0200 <merijn> "ok, so this is where we fork the new processes..."
2021-10-15 11:48:41 +0200 <merijn> '!!! you exec immediately after, right?'
2021-10-15 11:48:46 +0200 <merijn> "eh, no? Why?"
2021-10-15 11:48:46 +0200 <arahael> Heh.
2021-10-15 11:48:47 +0200 <[exa]> clone() is nicer but not sure how portable
2021-10-15 11:48:55 +0200 <merijn> me: *sobbing*
2021-10-15 11:48:59 +0200 <arahael> [exa]: That's the best thing about it! It's not portable. :D
2021-10-15 11:49:04 +0200 <merijn> arahael: In a multi-threaded parallelised program too :(
2021-10-15 11:49:05 +0200 <[exa]> lovable
2021-10-15 11:49:19 +0200 <merijn> [exa]: posix_spawn is the portable way
2021-10-15 11:49:19 +0200 <arahael> [exa]: But then, neither is fork().
2021-10-15 11:49:50 +0200 <merijn> Incidentally, posix_spawn looks a lot like the Windows API
2021-10-15 11:50:13 +0200 <arahael> merijn: And lovely. A decade ago I came to the conclusion that the only safe time to use fork and exec was at the very start of your program.
2021-10-15 11:50:17 +0200twitu(~twitu@223.236.227.132)
2021-10-15 11:50:19 +0200 <maerwald> merijn: https://github.com/haskell/unix/issues/196
2021-10-15 11:50:26 +0200 <merijn> Because the NT kernel was written by proper engineers and not insane cowboys >.>
2021-10-15 11:50:48 +0200 <[exa]> arahael: I meant "at least to BSDs"
2021-10-15 11:51:25 +0200 <arahael> [exa]: Ah, so you mean it in the same way Microsoft and Apple mean it when they say "portable".
2021-10-15 11:51:30 +0200 <merijn> maerwald: You might hate on process' API, but at least the underlying process spawning makes a serious/robust attempt at being portable
2021-10-15 11:51:33 +0200 <arahael> [exa]: Portable only to their particular preferred OS's.
2021-10-15 11:51:58 +0200 <ph88> [exa], what is your experience with parsix ?
2021-10-15 11:52:00 +0200 <merijn> maerwald: tbh, I think the main problem with the process API is that it has those "high level" operations and makes them seem reasonable
2021-10-15 11:52:01 +0200 <[exa]> arahael: yeah, portable to unixes not portable to whatever software out there :D
2021-10-15 11:53:11 +0200 <arahael> merijn: Just to clarify, which specific process API are you referring to in hackage?
2021-10-15 11:53:12 +0200 <maerwald> https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#v:readCreateProcessW…
2021-10-15 11:53:19 +0200 <arahael> merijn: So that I can take note. :)
2021-10-15 11:53:21 +0200 <maerwald> stdout and stderr as String
2021-10-15 11:53:24 +0200 <maerwald> wow
2021-10-15 11:53:34 +0200 <[exa]> ph88: not much honestly, I saw a project where it replaced trifecta, and it's got `withRecovery` so I assumed it could help you :]
2021-10-15 11:53:42 +0200 <merijn> maerwald: Like I said, that API is bad
2021-10-15 11:53:43 +0200 <maerwald> I had to copy paste large chunks of process and fix it in my own code
2021-10-15 11:53:46 +0200 <merijn> maerwald: Just use createProcess
2021-10-15 11:54:28 +0200 <arahael> Ah, so the createProcess in *that* process api. Yep, that one does look good.
2021-10-15 11:54:38 +0200 <merijn> arahael: Anything that pretends returning result as string is reasonable
2021-10-15 11:54:45 +0200 <ph88> [exa], i'm not sure what should be the return type for the alternative for a line that i want to skip. Like when i do some/many it will build up a list, but a skipped line i don't want in the list at all
2021-10-15 11:55:07 +0200 <arahael> merijn: Hmm?
2021-10-15 11:55:43 +0200 <merijn> arahael: those are bad, I mean :p
2021-10-15 11:55:44 +0200 <[exa]> ph88: you need to represent the skip somehow; preferably just add `| SkippedLine` to your AST and remove that later?
2021-10-15 11:55:50 +0200 <merijn> arahael: Really just anything in the "Simpler functions for common tasks
2021-10-15 11:55:51 +0200 <arahael> merijn: Ok, now that makes sense. ;)
2021-10-15 11:55:53 +0200 <merijn> " section
2021-10-15 11:56:04 +0200 <merijn> besides cleanupProcess/withCreateProcess, which are fine
2021-10-15 11:56:17 +0200 <[exa]> ph88: the other way would be to skip the line and recursively retry on the next one, returning actual data
2021-10-15 11:56:32 +0200 <merijn> maerwald: If you just use createProcess directly, there isn't significantly more boilerplate than (attempting to use) forkProcess
2021-10-15 11:56:49 +0200 <maerwald> except now I have to guess what the abstraction does
2021-10-15 11:56:59 +0200 <ph88> [exa], thanks, i like that second option much better not creating uncessary data types
2021-10-15 11:57:00 +0200 <merijn> maerwald: What abstraction?
2021-10-15 11:57:11 +0200 <maerwald> `createProcess`
2021-10-15 11:57:37 +0200 <merijn> maerwald: It spawns a process with stdin/stdout/stderr setup and give you those handles and a ProcessHandle
2021-10-15 11:57:42 +0200 <merijn> maerwald: What is there to guess?
2021-10-15 11:57:49 +0200 <maerwald> what does it do on windows?
2021-10-15 11:57:53 +0200 <[exa]> ph88: actually it may be worse, it shifts the complexity from data (1 more alternative) to execution (so much possible backtracks if you reach EOF on retries)
2021-10-15 11:57:56 +0200 <maerwald> what system calls it uses?
2021-10-15 11:58:15 +0200 <[exa]> ph88: but well I have no idea what your usecase is, so either may be fine :D
2021-10-15 11:58:15 +0200 <merijn> maerwald: it uses posix_spawn wherever available
2021-10-15 11:58:48 +0200 <arahael> maerwald: See also https://hackage.haskell.org/package/process-1.6.13.2/docs/System-Process.html#t:CmdSpec
2021-10-15 11:59:04 +0200 <arahael> maerwald: I just drilled down the types.
2021-10-15 11:59:04 +0200 <maerwald> arahael: ?
2021-10-15 11:59:08 +0200 <ph88> [exa], it shouldn't backtrack beyond 1 line o_O
2021-10-15 11:59:20 +0200 <arahael> maerwald: That explains how some things are implemented.
2021-10-15 11:59:38 +0200 <arahael> maerwald: (In terms of the sematnics on windows vs unix)
2021-10-15 11:59:47 +0200 <arahael> *semantics
2021-10-15 11:59:50 +0200 <[exa]> ph88: yeah, just take care about that :]
2021-10-15 11:59:52 +0200 <maerwald> is says "execvp semantics is used"... when I grep the code there's all sorts of C wrappers
2021-10-15 11:59:53 +0200 <ph88> [exa], how can i test if a parser succeeded from within the parser code so i know i have to recursively try again ?
2021-10-15 12:00:02 +0200 <maerwald> I'm not sure what it really does unless I read all of the code
2021-10-15 12:00:21 +0200 <[exa]> do you guys discuss CreateProcess, CreateProcessEx, CreateProcessAsUser, CreateProcessWithLogonEx, or CreateProcessA2 ?
2021-10-15 12:00:44 +0200 <arahael> maerwald: I'm not sure I follow your line of thought, there, then.
2021-10-15 12:01:02 +0200 <[exa]> oh it's the haskell createProcess
2021-10-15 12:01:07 +0200 <merijn> maerwald: That logic applies to literally every library ever
2021-10-15 12:01:07 +0200 <[exa]> I was getting confused. :D
2021-10-15 12:01:15 +0200 <maerwald> arahael: https://github.com/haskell/process/blob/master/cbits/win32/runProcess.c
2021-10-15 12:01:27 +0200 <maerwald> https://github.com/haskell/process/blob/master/cbits/posix/posix_spawn.c
2021-10-15 12:01:37 +0200 <arahael> maerwald: Yeah, well, I'm just looking at the (quite good) docs here.
2021-10-15 12:01:50 +0200 <arahael> maerwald: I'd hope I don't need to read all the implementation.
2021-10-15 12:01:53 +0200 <maerwald> merijn: well, there are primitives and then there are abstractions
2021-10-15 12:01:59 +0200 <merijn> maerwald: What, exactly, is your complaint
2021-10-15 12:02:07 +0200 <maerwald> it's an abstraction, not primitives
2021-10-15 12:02:32 +0200 <merijn> maerwald: If you want primitives you can trivially directly call those via the FFI, so why even use any library at all
2021-10-15 12:02:48 +0200 <maerwald> yeah, `unix` does the bindings for me
2021-10-15 12:03:02 +0200 <merijn> unix also does a bunch of wrapping
2021-10-15 12:03:08 +0200 <merijn> maerwald: What does fork do, for example?
2021-10-15 12:03:20 +0200 <merijn> maerwald: It very obviously (looking at the code) doesn't directly call fork
2021-10-15 12:03:29 +0200 <merijn> So you don't know what those wrappers are doing either
2021-10-15 12:03:50 +0200 <maerwald> merijn: I think those wrappers have usually two reasons 1. avoid using CApi (a wrapper will have a similar effect) and 2. interaction with RTS?
2021-10-15 12:04:38 +0200 <merijn> maerwald: Ok, please explain me exactly what forkProcess does, according to you
2021-10-15 12:04:45 +0200 <maerwald> lol
2021-10-15 12:04:53 +0200 <merijn> Besides introducing a billion potential deadlocks
2021-10-15 12:05:28 +0200 <merijn> maerwald: I'm serious. I used forkProcess in the past, I'd studied the unix code and I *literally* can't tell what it does
2021-10-15 12:05:44 +0200DNH(~DNH@2a02:8108:1100:16d8:31ac:ed04:1cbf:a354)
2021-10-15 12:06:45 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-15 12:07:29 +0200 <merijn> maerwald: As far as I can tell, it create a stable pointer to an IO action, then forks the process into a (potentially wildly invalid, incoherent) state where it then attempts to execute the IO
2021-10-15 12:07:35 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-10-15 12:08:37 +0200Pickchea(~private@user/pickchea)
2021-10-15 12:08:47 +0200 <merijn> maerwald: https://github.com/haskell/unix/blob/4291a5bf644449b57bb1d6e8c75ef582c09a8803/System/Posix/Process… <- what's this do?
2021-10-15 12:08:52 +0200 <maerwald> you just make a point why posix_spawn is better, not why I should use the process package
2021-10-15 12:08:53 +0200 <merijn> It's clearly *not* fork
2021-10-15 12:09:14 +0200 <merijn> maerwald: Well, feel free to use posix_spawn directly
2021-10-15 12:09:14 +0200 <maerwald> sure, I want better primitives
2021-10-15 12:09:33 +0200 <maerwald> but I don't want cloudy API that's neither primitives, nor a good abstraction
2021-10-15 12:09:37 +0200 <merijn> maerwald: Because process handles the boilerplate of using posix_spawn so I don't have to
2021-10-15 12:10:00 +0200 <merijn> maerwald: The createProcess is minimal posix_spawn boilerplate, tbh
2021-10-15 12:10:08 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-15 12:10:18 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-10-15 12:10:38 +0200 <maerwald> if your documentation starts with "On unix..." then you already have no abstraction, but a dual-primitive
2021-10-15 12:11:29 +0200 <maerwald> "it does something roughly similar on other platforms"
2021-10-15 12:13:12 +0200 <maerwald> if you have a specific use case... such a thing can be reasonable... but as a library? not sure
2021-10-15 12:13:53 +0200 <arahael> maerwald: From what I saw of those types I referred earlier, what's the problem with windows/
2021-10-15 12:14:05 +0200 <arahael> maerwald: I mean, what's wrong with these abstractions that are preventing you from using them?
2021-10-15 12:14:10 +0200 <merijn> maerwald: The irony is that you complain about this, but the unix API you advocate instead is actively worse in *literally* every way
2021-10-15 12:14:35 +0200 <maerwald> arahael: I didn't say something is wrong
2021-10-15 12:14:46 +0200 <maerwald> you sound like I have to prove a bug here
2021-10-15 12:14:52 +0200 <merijn> It's fine to think the process API *should* be better, but don't pretend unix isn't infinitely worse
2021-10-15 12:14:53 +0200 <maerwald> that wasn't the point
2021-10-15 12:15:22 +0200 <merijn> maerwald: Well, if it wasn't, why did you tell someone to use unix instead? :p
2021-10-15 12:15:43 +0200 <merijn> Or are you in the habit of recommending worse alternatives? :p
2021-10-15 12:15:43 +0200 <maerwald> because then you clearly see what primitives you depend on
2021-10-15 12:15:50 +0200 <merijn> Except you can't...
2021-10-15 12:15:58 +0200 <merijn> Because nobody knows wtf forkProcess does
2021-10-15 12:16:07 +0200 <merijn> I literally can't even find the C code for it in the unix repo
2021-10-15 12:16:31 +0200 <maerwald> again: you're just saying there are better primitives
2021-10-15 12:16:46 +0200 <merijn> maerwald: No, forkProcess *isn't even a primitive*
2021-10-15 12:16:50 +0200 <maerwald> `process` doesn't even expose them
2021-10-15 12:17:12 +0200 <sm> I believe I've done it, using typed-process
2021-10-15 12:17:13 +0200smsent a haskell code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/ae7de1c81f698a64dfe8efc29973da02fd9c…
2021-10-15 12:17:41 +0200 <merijn> maerwald: Neither does unix
2021-10-15 12:18:29 +0200azeem(~azeem@emp-85-170.eduroam.uu.se) (Ping timeout: 268 seconds)
2021-10-15 12:19:36 +0200 <arahael> I just tried to use forkProcess in C: int main() { forkProcess(); }
2021-10-15 12:19:39 +0200 <arahael> Failed to link.
2021-10-15 12:20:07 +0200 <merijn> arahael: I think it's foreign import of a GHC primitive
2021-10-15 12:21:11 +0200 <merijn> arahael: Although there's no forkProcess in base docs either, so who knows what the hell it's really calling
2021-10-15 12:21:33 +0200 <arahael> merijn: And it's not defined anywhere in the haskell compiler?
2021-10-15 12:23:03 +0200azeem(~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c)
2021-10-15 12:23:29 +0200azeem(~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c) (Read error: Connection reset by peer)
2021-10-15 12:23:29 +0200 <maerwald> https://gitlab.haskell.org/ghc/ghc/-/blob/481e6b546cdbcb646086cd66f22f588c47e66151/rts/Schedule.c#…
2021-10-15 12:24:22 +0200 <maerwald> those are shenanigans due to GHC rts I think
2021-10-15 12:25:00 +0200azeem(~azeem@emp-85-170.eduroam.uu.se)
2021-10-15 12:25:13 +0200kuribas(~user@ptr-25vy0i8rjj87ltkm4em.18120a2.ip6.access.telenet.be)
2021-10-15 12:25:22 +0200 <maerwald> and that doesn't seem like an abstraction, rather than a necessity
2021-10-15 12:26:13 +0200 <arahael> maerwald: Notice how it's deliberately holding all the locks it knows about?
2021-10-15 12:26:42 +0200 <arahael> maerwald: And consider what that means for any other library you might happen to have loaded into your process whose locks did not get held.
2021-10-15 12:29:55 +0200 <absence> merijn: it seens like uniplate is more focused on type constructors of a sum type than on record fields, so i'm not sure if it's possible to e.g. apply a transformation to all fields of type Text?
2021-10-15 12:31:16 +0200 <maerwald> https://github.com/haskell/process/blob/e448450049ac51a6fcd5d1f0be86448d0931d71a/cbits/posix/posix…
2021-10-15 12:31:26 +0200 <maerwald> not sure why this isn't in `unix` package
2021-10-15 12:31:45 +0200jinsun__(~quassel@user/jinsun)
2021-10-15 12:33:11 +0200max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Remote host closed the connection)
2021-10-15 12:33:51 +0200max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
2021-10-15 12:33:58 +0200geekosaur(~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
2021-10-15 12:35:22 +0200jinsun(~quassel@user/jinsun) (Ping timeout: 252 seconds)
2021-10-15 12:38:19 +0200geekosaur(~geekosaur@xmonad/geekosaur)
2021-10-15 12:39:10 +0200 <sm> as a respite from the horrors of process management, here's my little WIP game:
2021-10-15 12:39:10 +0200 <sm> https://github.com/simonmichael/games/tree/main/caverunner
2021-10-15 12:45:53 +0200 <maerwald> sm: what's your highscore?
2021-10-15 12:46:20 +0200jacks2(~bc8165b6@199.204.85.195)
2021-10-15 12:46:21 +0200 <jacks2> hi
2021-10-15 12:46:28 +0200 <jacks2> can I do something like this with sortOn?
2021-10-15 12:46:29 +0200 <maerwald> https://imgur.com/NuYtc92.png
2021-10-15 12:46:40 +0200 <jacks2> > sortBy (comparing length <> compare) ["bb", "aaaa", "bbbb", "aa"]
2021-10-15 12:46:42 +0200 <lambdabot> ["aa","bb","aaaa","bbbb"]
2021-10-15 12:46:46 +0200 <sm> maerwald: glad you asked! currently trying to beat cave 1 at speed 20, high score is 449
2021-10-15 12:46:49 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2021-10-15 12:47:00 +0200 <maerwald> x(
2021-10-15 12:47:19 +0200 <sm> I had a session where I was just beating them all at speed 15. But that was some kind of weird anomaly
2021-10-15 12:51:07 +0200 <sm> 450 🤣
2021-10-15 12:51:47 +0200 <maerwald> you're cheating
2021-10-15 12:52:06 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
2021-10-15 12:52:27 +0200 <sm> practicing!
2021-10-15 12:52:37 +0200 <arahael> That game looks fun.
2021-10-15 12:53:17 +0200 <sm> I would be glad to hear of any setup/gameplay (sound) issues on other machines (old ones, windows..)
2021-10-15 12:53:38 +0200 <maerwald> I had to fix the shebang header so it doesn't use stack :p
2021-10-15 12:54:11 +0200tcard_(~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp)
2021-10-15 12:54:37 +0200Flonk(~Flonk@ec2-52-40-29-25.us-west-2.compute.amazonaws.com) (Quit: Ping timeout (120 seconds))
2021-10-15 12:54:37 +0200tcard(~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp) (Read error: Connection reset by peer)
2021-10-15 12:54:54 +0200 <sm> nod, I'll provide more instructions for folks who won't install stack later
2021-10-15 12:55:02 +0200 <arahael> stack is still installing.
2021-10-15 12:55:04 +0200Flonk(~Flonk@ec2-52-40-29-25.us-west-2.compute.amazonaws.com)
2021-10-15 12:55:05 +0200Cale(~cale@72.139.192.117) (Read error: Connection reset by peer)
2021-10-15 12:55:07 +0200 <sm> it's hard to make it just work for both stack/non-stack people
2021-10-15 12:55:24 +0200 <sm> arahael: slow to install, noted.. how are you installing it ?
2021-10-15 12:56:05 +0200 <arahael> sm: The documented way. curl -sSL https://get.haskellstack.org/ | sh
2021-10-15 12:56:28 +0200 <maerwald> arahael: ahah
2021-10-15 12:56:30 +0200 <sm> what's taking the time ? downloading stack ?
2021-10-15 12:56:37 +0200 <maerwald> arahael: I have a patch for cabal
2021-10-15 12:56:45 +0200 <arahael> sm: Installing it.
2021-10-15 12:56:52 +0200 <arahael> sm: The download was just a hundred MB or two or three.
2021-10-15 12:57:02 +0200 <maerwald> arahael: https://paste.tomsmeding.com/c06MnidK
2021-10-15 12:57:04 +0200 <maerwald> apply that
2021-10-15 12:57:16 +0200 <sm> I think you're running the script by now, and the slowness is stack installing ghc ?
2021-10-15 12:58:01 +0200 <arahael> Ah, yes, indeed, but the script had to install ghc and everything.
2021-10-15 12:58:12 +0200 <arahael> maerwald: A bit late, but I'll keep that patch for reference. :)
2021-10-15 12:58:18 +0200 <arahael> Oh, and now it says "game over".
2021-10-15 12:58:25 +0200jgeerds(~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 260 seconds)
2021-10-15 12:58:36 +0200 <sm> yes, that part is definitely slow (and I have silenced the progress output)
2021-10-15 12:58:37 +0200 <maerwald> stack or the game xD
2021-10-15 12:59:07 +0200 <arahael> Ok, first attempt: caverunner! ## cave 1 @ 15 high score 0268 ###### score 0268 #### speed 15
2021-10-15 12:59:18 +0200 <maerwald> you're last
2021-10-15 12:59:50 +0200 <arahael> maerwald: I prefer to think of myself as have come... third here, or something like that. :)
2021-10-15 12:59:59 +0200 <sm> nice! :)
2021-10-15 13:00:12 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-10-15 13:00:25 +0200 <sm> needs a real-time highscore server
2021-10-15 13:01:21 +0200 <maerwald> now write a successor of https://crawl.develz.org/
2021-10-15 13:01:24 +0200 <ph88> Could someone help me understand this type error ? https://bpa.st/Y4MA
2021-10-15 13:01:26 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 13:01:45 +0200 <arahael> maerwald: I'm trying your version, the cabalified one. :)
2021-10-15 13:02:30 +0200xff0x(~xff0x@2001:1a81:524d:6800:a178:5c71:40d3:e997) (Ping timeout: 260 seconds)
2021-10-15 13:02:34 +0200 <arahael> maerwald: I notice it uses process. ;)
2021-10-15 13:02:42 +0200 <maerwald> arahael: =(
2021-10-15 13:02:56 +0200 <sm> maerwald: that's LamdaHack & Allure of the Stars
2021-10-15 13:03:06 +0200 <sm> LambdaHack
2021-10-15 13:03:38 +0200 <sm> typed-process
2021-10-15 13:05:05 +0200 <arahael> Hmm, difference between cabal and stack for these one-line scripts... I think I'd have to go with stack - the first time I tried this, I wasn't up to date so cabal just simply failed to find the packages.
2021-10-15 13:05:20 +0200 <arahael> I do prefer cabal, though, somehow.
2021-10-15 13:05:28 +0200 <oak-> ph88: I guess this calls for a need of FunctionalDependencies
2021-10-15 13:05:38 +0200 <ph88> how so ?
2021-10-15 13:05:58 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
2021-10-15 13:07:11 +0200 <oak-> or this might be the case, I didn't read the code very throughfully yet
2021-10-15 13:07:32 +0200Cajun(~Cajun@user/cajun) (Quit: Client closed)
2021-10-15 13:08:58 +0200xff0x(~xff0x@2001:1a81:524d:6800:a178:5c71:40d3:e997)
2021-10-15 13:10:07 +0200 <sm> maerwald, arahael do you think terminal games like this are a good fit for ghcjs ?
2021-10-15 13:10:28 +0200 <oak-> but I encountered similar kind of thing when playing with MultiParamTypeClasses not so long ago
2021-10-15 13:10:30 +0200 <arahael> sm: I don't think so - why?
2021-10-15 13:10:43 +0200 <arahael> sm: You mean for the browser?
2021-10-15 13:11:00 +0200 <__monty__> Would be pretty cool to be able to try them out without installing/building anything.
2021-10-15 13:11:07 +0200hololeap_(~hololeap@user/hololeap) (Remote host closed the connection)
2021-10-15 13:11:08 +0200 <sm> exactly
2021-10-15 13:11:11 +0200 <__monty__> Having to install GHC is a pretty big hurdle.
2021-10-15 13:11:22 +0200 <sm> now that I think of it, LambdaHack/Allure do it
2021-10-15 13:11:45 +0200 <arahael> So, for the browser, then? That would work.
2021-10-15 13:11:50 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2021-10-15 13:11:58 +0200 <arahael> But I definitely wouldn't want to install it myself, and it would discourage me from modifying it.
2021-10-15 13:12:06 +0200 <sm> if it's in the browser, there's a chance I could share games with family
2021-10-15 13:12:21 +0200 <arahael> sm: The other option is to provide a shell for it.
2021-10-15 13:12:32 +0200azeem(~azeem@emp-85-170.eduroam.uu.se) (Ping timeout: 268 seconds)
2021-10-15 13:12:38 +0200hololeap_(~hololeap@user/hololeap)
2021-10-15 13:12:39 +0200 <maerwald> don't say nix-shell, because then I wouldn't want to install it :
2021-10-15 13:12:44 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 13:13:08 +0200 <arahael> sm: Eg, what they do in #hardfought: ssh hardfought.org
2021-10-15 13:13:13 +0200 <sm> lol good work maerwald , nip that in the bud
2021-10-15 13:13:40 +0200xiongxin(~quassel@113.116.224.79)
2021-10-15 13:13:48 +0200 <arahael> maerwald: Ha. I've been working on a PR for documentation, and I've had to study *arcane bash* for it.
2021-10-15 13:14:17 +0200 <arahael> maerwald: For nix-shell. :)
2021-10-15 13:14:27 +0200 <sm> arahael: no visible download or install info on that page
2021-10-15 13:14:43 +0200 <maerwald> ph88: what's the expected type signature of `go`?
2021-10-15 13:14:58 +0200 <arahael> sm: Did you miss the ssh bit? :)
2021-10-15 13:15:13 +0200Cajun(~Cajun@user/cajun)
2021-10-15 13:15:18 +0200 <ph88> maerwald, f [Line] i think
2021-10-15 13:16:01 +0200 <maerwald> ph88: well... if you remove the offending line and add a type hole to the sig, you get `[Line] -> [Line]`
2021-10-15 13:16:04 +0200 <sm> arahael: yes. It's very small. So you were saying, serve it over ssh ? Good idea, I never thought of that
2021-10-15 13:16:25 +0200 <maerwald> `fmap (:) (pure line) go` looks odd
2021-10-15 13:16:28 +0200smwas thinking "shell" = Electron or some such
2021-10-15 13:16:33 +0200o1lo01ol_(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
2021-10-15 13:16:36 +0200 <arahael> sm: Yep!
2021-10-15 13:16:41 +0200azeem(~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c)
2021-10-15 13:16:55 +0200 <ph88> maerwald, ye it does .. didnt know how else to write it o_O
2021-10-15 13:17:06 +0200azeem(~azeem@2a00:801:44b:8c08:deb2:1ae7:691a:354c) (Read error: Connection reset by peer)
2021-10-15 13:17:09 +0200 <maerwald> start with the type signature you want
2021-10-15 13:17:22 +0200 <ph88> ok
2021-10-15 13:18:10 +0200azeem(~azeem@emp-85-170.eduroam.uu.se)
2021-10-15 13:18:12 +0200 <arahael> sm: Yeah, I gave the command, and you were then saying "nothing on that page", and I was thinking... "page"? :D
2021-10-15 13:19:12 +0200 <maerwald> ph88: I got it
2021-10-15 13:19:27 +0200ph88listening attentively :p
2021-10-15 13:19:28 +0200 <maerwald> https://paste.tomsmeding.com/KFVG50x0
2021-10-15 13:19:34 +0200 <ph88> thanks ! i'll check it out
2021-10-15 13:19:42 +0200lisq(~quassel@lis.moe) (Quit: lisq)
2021-10-15 13:20:01 +0200 <arahael> sm: That said, most people will find a website _familiar_.
2021-10-15 13:20:13 +0200xiongxin(~quassel@113.116.224.79) (Read error: Connection reset by peer)
2021-10-15 13:20:15 +0200 <dminuoso> ph88: Add more type signatures
2021-10-15 13:20:27 +0200 <maerwald> ph88: `go` is already of the Parser type, so you just fmap into the parser and prepend the line
2021-10-15 13:20:41 +0200 <maerwald> `fmap (:) (pure line) go` makes no sense imo
2021-10-15 13:20:46 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 268 seconds)
2021-10-15 13:20:47 +0200o1lo01ol_(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 240 seconds)
2021-10-15 13:21:11 +0200xiongxin(~quassel@113.116.224.79)
2021-10-15 13:21:15 +0200 <maerwald> so it's not the `manyTill` line that's wrong... it's just the type inference falling flat
2021-10-15 13:21:39 +0200 <ph88> wow that's weird it doesn't compile without the type signature on `go`
2021-10-15 13:21:52 +0200rond_(~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
2021-10-15 13:21:52 +0200 <dminuoso> ph88: Next time you have a type error where GHC infers things that seem silly, just add more type signatures. It's important to constraint inference from having mistaken inferenced type go too far
2021-10-15 13:21:56 +0200lis(~quassel@lis.moe)
2021-10-15 13:22:25 +0200 <ph88> ye i was trying that on the maybeLine but i could do more places
2021-10-15 13:22:32 +0200 <maerwald> especially since you didn't use `go` anywhere (except recursively)
2021-10-15 13:26:31 +0200 <sm[i]> arahael: oops, I didn't even see your command, just jumped to hardfought.org :)
2021-10-15 13:26:45 +0200 <maerwald> sm[i]: electron?
2021-10-15 13:26:54 +0200 <maerwald> you want to ship an entire browser with your game?
2021-10-15 13:27:17 +0200 <arahael> maerwald: I think sm's suggesting literally serve it himself and tell his family to hit the website in their browser.
2021-10-15 13:27:46 +0200 <arahael> maerwald: And it makes sense; they already have a browser.
2021-10-15 13:28:15 +0200 <maerwald> but electron ships with its own browser :p
2021-10-15 13:28:37 +0200 <maerwald> every app is a browser, essentially
2021-10-15 13:29:00 +0200 <sm[i]> maerwald, we can forget electron, I was just misunderstanding what arahael was saying. I'd like a way to put the game in a web page, like https://lambdahack.github.io
2021-10-15 13:29:51 +0200 <maerwald> ah
2021-10-15 13:29:59 +0200 <maerwald> well, just use the library then?
2021-10-15 13:30:08 +0200xiongxin(~quassel@113.116.224.79) (Ping timeout: 265 seconds)
2021-10-15 13:30:21 +0200xiongxin(~quassel@113.116.224.79)
2021-10-15 13:30:40 +0200 <arahael> sm[i]: That's what I thought you were saying, and I was suggesting maybe host it on ssh instead. That lambdahack.github.io looks like a nice idea, but it doesn't display correctly on my system.
2021-10-15 13:30:46 +0200 <arahael> sm[i]: Display's weirdly wide and truncated here.
2021-10-15 13:30:56 +0200 <maerwald> that might be "correctly" :D
2021-10-15 13:31:20 +0200 <arahael> Ha. And it's hard to read. Very hard to read.
2021-10-15 13:31:31 +0200 <maerwald> it's retro roguelike
2021-10-15 13:31:49 +0200 <arahael> maerwald: I'm playing nethack at the moment, on ssh! It's nothing like that.
2021-10-15 13:32:16 +0200 <sm[i]> fonts for roguelikes are apparently a really hard thing (Man of Letters knows)
2021-10-15 13:33:17 +0200 <Cajun> what makes rougulike fonts difficult?
2021-10-15 13:33:37 +0200 <arahael> sm[i]: Eh, just regular fixed-width fonts, really.
2021-10-15 13:33:42 +0200rond_(~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
2021-10-15 13:33:55 +0200 <maerwald> it looks fixed-width
2021-10-15 13:34:21 +0200 <sm[i]> I don't know all the details, I think it's that chars need to be square for layout and movement and square letters are hard to read
2021-10-15 13:34:47 +0200 <sm[i]> (for starters)
2021-10-15 13:35:28 +0200 <arahael> sm[i]: Definitely doesn't need to be square. Have you tried 'ssh hardfought.org'? :)
2021-10-15 13:36:00 +0200 <merijn> I was about to say, most fixed-width fonts aren't square and nethack works fine...
2021-10-15 13:36:02 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-15 13:36:10 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.3)
2021-10-15 13:36:25 +0200 <sm[i]> ManofLetters[m] can explain better than I
2021-10-15 13:36:45 +0200 <maerwald> I think it gives it a medieval vibe
2021-10-15 13:37:15 +0200 <sm[i]> maybe he wanted accurate diagonals but nethack players don't care/are used to tall chars
2021-10-15 13:37:32 +0200tdaeausr^(~tdaeausr@70.166.66.234) (Remote host closed the connection)
2021-10-15 13:39:08 +0200 <maerwald> it looks like it took a while to code :D
2021-10-15 13:39:33 +0200rond_(~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
2021-10-15 13:40:36 +0200 <sm[i]> maerwald, my thing ? 80h and counting :(
2021-10-15 13:40:47 +0200 <maerwald> I mean the game engine
2021-10-15 13:41:00 +0200 <sm[i]> ansi-terminal-game ?
2021-10-15 13:41:05 +0200 <maerwald> LambdaHack
2021-10-15 13:41:24 +0200 <sm[i]> oh, never mind. Yes I bet.
2021-10-15 13:42:00 +0200twitu(~twitu@223.236.227.132) (Quit: Client closed)
2021-10-15 13:45:13 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 252 seconds)
2021-10-15 13:52:47 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-15 13:53:57 +0200max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Ping timeout: 265 seconds)
2021-10-15 13:54:06 +0200cfricke(~cfricke@user/cfricke)
2021-10-15 13:55:31 +0200berberman(~berberman@user/berberman) (Quit: ZNC 1.8.2 - https://znc.in)
2021-10-15 13:55:51 +0200berberman(~berberman@user/berberman)
2021-10-15 13:56:30 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-10-15 14:00:16 +0200Cajun(~Cajun@user/cajun) (Quit: Client closed)
2021-10-15 14:00:38 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 268 seconds)
2021-10-15 14:01:12 +0200 <arahael> sm[i]: Just been reading your game implementation a bit, the main thing I'm noting is the 'if' statmenets, those are multiway ifs, right?
2021-10-15 14:01:23 +0200 <sm[i]> correct!
2021-10-15 14:01:26 +0200 <sm[i]> I like them
2021-10-15 14:01:58 +0200 <arahael> They do seem somewhat elegant. :)
2021-10-15 14:02:05 +0200 <sm[i]> but I wish we didn't have = vs ->
2021-10-15 14:02:08 +0200 <arahael> Particularly when there's a lot of logic.
2021-10-15 14:02:20 +0200 <arahael> No, I like the difference between = and ->
2021-10-15 14:02:27 +0200 <sm[i]> I am always getting it wrong
2021-10-15 14:03:13 +0200bitdex_(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2021-10-15 14:03:26 +0200Pickchea(~private@user/pickchea) (Ping timeout: 245 seconds)
2021-10-15 14:03:51 +0200 <arahael> Actually, now that you mention it, there is an inconsistency there.
2021-10-15 14:04:02 +0200 <hpc> is there?
2021-10-15 14:04:03 +0200ski. o O ( using `=' for case branches, or `->' for defining equations, is just wrong )
2021-10-15 14:04:04 +0200 <arahael> I mean, defining a function: foo bar baz = ...
2021-10-15 14:04:11 +0200 <arahael> As opposed to: foo bar baz -> ...
2021-10-15 14:04:22 +0200 <hpc> no, = is correct there
2021-10-15 14:04:31 +0200 <hpc> definitions of functions use equational reasoning
2021-10-15 14:04:31 +0200 <ski> (e.g. Erlang does `foo(Bar,Baz) -> ...' :/ )
2021-10-15 14:04:44 +0200 <hpc> "foo bar baz" is actually equal to the rhs
2021-10-15 14:04:49 +0200 <arahael> hpc: Even when you're defining various patterns?
2021-10-15 14:04:56 +0200 <hpc> even then
2021-10-15 14:04:57 +0200 <ski> arahael : yes
2021-10-15 14:05:19 +0200 <ski> (modulo some inputs being handled by earlier matching equations)
2021-10-15 14:05:24 +0200 <arahael> And why is that different to: case foo of ... -> stuff?
2021-10-15 14:05:39 +0200 <ski> in `case ... of Just x -> print x', `Just x' is not equal to `print x'
2021-10-15 14:05:44 +0200 <arahael> Mind you, there's no function /name/ there, that's the bit that gets assigned, imho.
2021-10-15 14:05:48 +0200 <hpc> say you wrote case foo of {Nothing -> 5; Just _ -> 10}
2021-10-15 14:05:51 +0200 <ski> they're even of different types
2021-10-15 14:05:57 +0200 <hpc> there's no way that Nothing is equal to 5
2021-10-15 14:06:17 +0200 <arahael> Well, `foo bar baz = ...` is effectively assigning to *foo*, but the rest of it is a pattern match, isn't it?
2021-10-15 14:06:28 +0200 <merijn> arahael: It's not assigning
2021-10-15 14:06:34 +0200 <merijn> arahael: It's stating equality
2021-10-15 14:07:09 +0200 <arahael> Ah, and <- is "assignment".
2021-10-15 14:07:20 +0200 <merijn> Well, I don't agree
2021-10-15 14:07:23 +0200 <hpc> <- is syntax sugar, but that's a whole other thing
2021-10-15 14:07:47 +0200 <ski> `case foo of {Nothing -> 5; Just _ -> 10}' is of course equivalent to `(\case {Nothing -> 5; Just _ -> 10}) foo' .. in SML, that's written `(fn NONE => 5 | SOME _ => 10) foo' (`fn' being lambda in SML, which was multi-way from the start), which is what `case foo of NONE => 5 | SOME _ => 10' is defined as sugar for
2021-10-15 14:08:07 +0200 <arahael> To be honest, it's 11pm so I'm half asleep, but I was trying to appeal to sm's point of view that those symbols can be confusing.
2021-10-15 14:09:34 +0200talismanick(~talismani@76.78.246.30)
2021-10-15 14:09:35 +0200 <ski> i'd suggest that that confusion then likely corresponds to a confusion (conflation ?) of defining equations vs. case branches (perhaps also involving other notions like "assignment")
2021-10-15 14:09:48 +0200 <talismanick> Just tried moving my Haskell setup to a new computer
2021-10-15 14:09:58 +0200 <talismanick> Installed everything from the other computer's package list
2021-10-15 14:10:00 +0200jacks2(~bc8165b6@199.204.85.195) (Quit: CGI:IRC (Error))
2021-10-15 14:10:15 +0200 <merijn> talismanick: which package list would that be?
2021-10-15 14:10:17 +0200 <geekosaur> package databases do not move well
2021-10-15 14:10:18 +0200 <talismanick> but "cabal install brittany" still mysteriously fails on compiling aeson
2021-10-15 14:10:26 +0200jacks2(~bc8165b6@199.204.85.195)
2021-10-15 14:10:36 +0200 <jacks2> arahael foo bar baz = ... is syntax sugar for foo = \bar -> \baz -> ...
2021-10-15 14:10:44 +0200 <talismanick> merijn: I'm not sure what you mean? I just echo'd all the packages I have installed via the system package manager.
2021-10-15 14:10:44 +0200 <merijn> talismanick: Well, which version of GHC and cabal-install do you have on the old and new machines?
2021-10-15 14:10:47 +0200 <talismanick> into a file
2021-10-15 14:10:54 +0200 <arahael> jacks2: Yes, I'll agree with that, perhaps I should've lead with that.
2021-10-15 14:11:05 +0200 <talismanick> merijn: Both are the latest, installed via ghcup
2021-10-15 14:11:07 +0200 <merijn> talismanick: Just checking that you weren't talking about GHC's package list
2021-10-15 14:11:30 +0200 <merijn> talismanick: What
2021-10-15 14:11:36 +0200 <merijn> talismanick: What's the error aeson gives?
2021-10-15 14:11:55 +0200 <talismanick> Let me find that log again....
2021-10-15 14:11:59 +0200 <maerwald> maybe the aeson 2 bump
2021-10-15 14:12:16 +0200 <merijn> maerwald: I was betting on some broken version bounds
2021-10-15 14:12:21 +0200 <talismanick> Although, I will say: I haven't recompiled britanny in a while
2021-10-15 14:12:23 +0200 <maerwald> they look good
2021-10-15 14:12:24 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-15 14:12:31 +0200 <merijn> maerwald: On which package? :p
2021-10-15 14:12:34 +0200 <talismanick> so it's possible it'd fail if I was trying from scratch again on this machine
2021-10-15 14:12:35 +0200 <maerwald> brittany
2021-10-15 14:12:40 +0200 <maerwald> it will force aeson <1.6
2021-10-15 14:13:31 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
2021-10-15 14:13:47 +0200 <unit73e> hello
2021-10-15 14:13:47 +0200 <talismanick> https://0x0.st/-kW4.log
2021-10-15 14:13:51 +0200gehmehgeh(~user@user/gehmehgeh) (Ping timeout: 276 seconds)
2021-10-15 14:14:01 +0200 <maerwald> ?
2021-10-15 14:14:07 +0200 <maerwald> where's the error
2021-10-15 14:14:09 +0200 <talismanick> maerwald: You are indeed correct. It's trying to build Aeson 1.5.6.
2021-10-15 14:14:20 +0200 <talismanick> maerwald: See, that's the part which confuses me.
2021-10-15 14:14:35 +0200 <geekosaur> unit73e, hello
2021-10-15 14:14:36 +0200 <talismanick> (otherwise, I'd have Google'd it first and hopefully resolved it before resorting to IRC)
2021-10-15 14:14:46 +0200 <unit73e> are lens used often nowadays? because I probably need to learn more about that
2021-10-15 14:14:49 +0200 <maerwald> I can't follow
2021-10-15 14:14:52 +0200 <talismanick> It just silently failed on aeson and said "go look at the logs"
2021-10-15 14:14:57 +0200 <talismanick> "compilation failed"
2021-10-15 14:15:07 +0200 <geekosaur> unit73e, some people love lens, others of us avoid it
2021-10-15 14:15:26 +0200 <talismanick> I suppose I could try compiling again and piping stderr to a logfile of its own to show that I'm telling the truth
2021-10-15 14:15:32 +0200 <geekosaur> it has its uses, but when overused it can mjake code *very* hard to read (imo)
2021-10-15 14:15:41 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-10-15 14:15:44 +0200 <maerwald> try `cabal repl --build-depends aeson --constraint 'aeson == 1.5.6.0'`
2021-10-15 14:15:54 +0200 <merijn> unit73e: It depends who you ask
2021-10-15 14:16:02 +0200 <unit73e> geekosaur, ok. not a bad idea to learn more about it either way. the package doc seems good enough. kind of looks like the get/set of Java.
2021-10-15 14:16:09 +0200 <geekosaur> yes
2021-10-15 14:16:35 +0200 <geekosaur> also there is optics, which does much the same thing but provides better error messages (at the price of not being as easily extensible)
2021-10-15 14:16:57 +0200 <geekosaur> so you might want to start with optics first and nmove on to lens later
2021-10-15 14:17:03 +0200 <talismanick> I thiiiiiink I might be missing a distro package, though
2021-10-15 14:17:19 +0200 <unit73e> ok thanks geekosaur . I'll do that.
2021-10-15 14:17:25 +0200 <talismanick> because Void, like some other distros, splits packages between "packagename" and "packagename-devel"
2021-10-15 14:17:33 +0200 <unit73e> merijn, it does look kind of weird compared to everything else
2021-10-15 14:17:37 +0200 <unit73e> but that's just me
2021-10-15 14:17:48 +0200 <merijn> unit73e: I still rarely use lens
2021-10-15 14:18:07 +0200 <merijn> Don't think I've written more, than, 20 or so lines with it in the past decade :p
2021-10-15 14:18:09 +0200 <geekosaur> right, that's why I said "imo" and specified that some people love it and others avoid it
2021-10-15 14:18:11 +0200 <talismanick> where you don't install -devel onto a system permanently, if at all possible, because they're meant to be installed inside ephemeral build containers
2021-10-15 14:18:35 +0200 <geekosaur> there's no one right answer and a lot of personal taste involved
2021-10-15 14:18:38 +0200 <unit73e> I'm still working on SDL2 lazyfoo port btw: https://gitlab.com/unit73e/lazyfoo-examples
2021-10-15 14:18:46 +0200 <merijn> geekosaur: Yes there is. Mine! :p
2021-10-15 14:18:51 +0200 <talismanick> but I have several -devel files installed anyways because I can't be arsed to figure out how to containerize all my Haskell compilations without breaking everything.
2021-10-15 14:18:54 +0200 <unit73e> but I got to a point were I noticed lazyfoo does things in a weird way
2021-10-15 14:19:01 +0200 <unit73e> the move lesson is god awful
2021-10-15 14:19:09 +0200 <merijn> talismanick: That sounds like terrible distro design, tbh
2021-10-15 14:19:12 +0200 <talismanick> (e.g. I need file-devel, or else GHC won't compile - I don't know why)
2021-10-15 14:19:15 +0200 <unit73e> so I'm starting to make my own examples
2021-10-15 14:19:38 +0200 <maerwald> merijn: 90% of binary distros do that
2021-10-15 14:19:44 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb)
2021-10-15 14:19:52 +0200 <talismanick> It does actually cut down on a lot of bloat
2021-10-15 14:19:56 +0200 <merijn> maerwald: Well, >90% of linux distros are terrible, so that sounds about right :)
2021-10-15 14:20:03 +0200 <maerwald> no
2021-10-15 14:20:06 +0200 <maerwald> 100%
2021-10-15 14:20:22 +0200 <talismanick> e.g. I once installed cairo-devel (to compile a C binary outside of the package manager), and it pulled down >20 other packages
2021-10-15 14:20:26 +0200 <merijn> maerwald: I was just hedging on the possibility of a hypothetical distro I don't hate existing :p
2021-10-15 14:20:57 +0200 <geekosaur> it's called freebsd :þ
2021-10-15 14:21:03 +0200 <maerwald> ahahaha
2021-10-15 14:21:04 +0200 <merijn> I wish the 386BSD lawsuit never happened and we lived in a version of the world where BSD dominated
2021-10-15 14:21:06 +0200 <unit73e> basically lazyfoo did the motion moves a dot in 10 pixels with you press an arrow key. most games don't do that... anyway I got to a point were I understand SDL2 so might as well make my own examples
2021-10-15 14:21:08 +0200 <merijn> geekosaur: Yes
2021-10-15 14:21:45 +0200 <arahael> merijn: Only one 9? :)
2021-10-15 14:21:47 +0200sagax(~sagax_nb@user/sagax) (Quit: Konversation terminated!)
2021-10-15 14:21:49 +0200 <maerwald> FreeBSD, where you have two versions of one library installed and they interact weird with one another and break GHC
2021-10-15 14:21:59 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 265 seconds)
2021-10-15 14:22:24 +0200 <merijn> maerwald: Sounds like user error
2021-10-15 14:22:35 +0200 <maerwald> FreeBSD is a user error
2021-10-15 14:22:38 +0200 <maerwald> :D
2021-10-15 14:22:41 +0200 <geekosaur> sounds like iconv to me
2021-10-15 14:22:46 +0200 <talismanick> wat: https://0x0.st/-kWt.txt
2021-10-15 14:22:54 +0200 <geekosaur> which is a historical wart
2021-10-15 14:23:05 +0200 <arahael> unit73e: I'm a somewhat novice haskeller, still, but I find the lens theory confusing - I find lens are useful, but best kept to a minimum; I like them for *simple* data structures.
2021-10-15 14:23:05 +0200 <talismanick> You see the logfile from earlier - it says it halted at 10 compilations out of 24
2021-10-15 14:23:14 +0200 <talismanick> Yet I repeated it now
2021-10-15 14:23:17 +0200 <talismanick> and it finished
2021-10-15 14:23:37 +0200 <maerwald> nice, just reboot
2021-10-15 14:23:45 +0200 <talismanick> I didn't install any systemwide packages, set extra envvars or try with different compilation flags
2021-10-15 14:23:51 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:21fb:d4a:1e2:e3eb) (Ping timeout: 245 seconds)
2021-10-15 14:23:55 +0200 <geekosaur> fake-package-0 sounds like something went wrong computing dependencies
2021-10-15 14:24:02 +0200 <talismanick> maerwald: I did. Is that why it succeeded?
2021-10-15 14:24:06 +0200 <merijn> geekosaur: No
2021-10-15 14:24:07 +0200 <maerwald> geekosaur: no, that's what happens with `cabal repl`
2021-10-15 14:24:15 +0200 <maerwald> talismanick: no idea
2021-10-15 14:24:20 +0200 <merijn> geekosaur: That's what cabal uses to have a proper/sane temp environment
2021-10-15 14:24:37 +0200 <merijn> geekosaur: It basically generates a valid "fake-package" with your constraints then does the normal package workflow
2021-10-15 14:24:39 +0200 <geekosaur> weird. then again ghci is a bit of a wart itself
2021-10-15 14:24:54 +0200 <maerwald> are we hating on everything now? :D
2021-10-15 14:25:08 +0200 <talismanick> Doesn't it take expressions which ghc itself considers invalid?
2021-10-15 14:25:10 +0200 <geekosaur> is there ever a time not to hate on everything?
2021-10-15 14:25:13 +0200 <talismanick> Or is it the other way around?
2021-10-15 14:25:15 +0200 <arahael> maerwald: Your fork() started it. :)
2021-10-15 14:25:17 +0200 <merijn> maerwald: It's a matter or how much to hate something
2021-10-15 14:25:48 +0200 <talismanick> It's a byte-compiling interpreter wholly separate from the AOT compiler everyone thinks of as GHC, right?
2021-10-15 14:26:02 +0200 <arahael> talismanick: I thought ghci compiles it.
2021-10-15 14:26:03 +0200 <merijn> Not wholly separate
2021-10-15 14:26:14 +0200Pickchea(~private@user/pickchea)
2021-10-15 14:26:16 +0200 <geekosaur> it can be but usually isn't
2021-10-15 14:26:23 +0200 <merijn> talismanick: Not the same way GHC does. ghci (by default) does bytecode interpretation
2021-10-15 14:26:32 +0200 <geekosaur> sadly nobody kept ghci-ng up to date
2021-10-15 14:27:06 +0200 <Hecate> last time I checked it was Intero right?
2021-10-15 14:27:13 +0200 <talismanick> arahael: When I ran "cabal repl" and used that to install aeson, do you mean I installed a byte-compiled version instead of the "real thing" which GHC (rightly or wrongly) rejected earlier?
2021-10-15 14:27:26 +0200 <maerwald> I doubt that
2021-10-15 14:27:39 +0200 <geekosaur> what, -ng? no, that was where things like :doc and import syntax were tested before being broyught into ghci proper
2021-10-15 14:27:54 +0200 <talismanick> That would explain why it succeeded with no extra changes, although I doubt a "correctness-first" language like Haskell would default to such rash behavior
2021-10-15 14:27:55 +0200 <arahael> talismanick: I have no idea. :)
2021-10-15 14:28:16 +0200 <maerwald> `ghc-pkg --package-db ~/.cabal/store/ghc-8.10.7/package.db list | grep aeson` should show something
2021-10-15 14:28:27 +0200azeem(~azeem@emp-85-170.eduroam.uu.se) (Read error: Connection reset by peer)
2021-10-15 14:28:45 +0200 <geekosaur> ghci itself is just a simple ghc-api client and can quite readily live outside of ghc; it'd just be a royal pain to keep up to date with ghc-api changes
2021-10-15 14:29:37 +0200 <geekosaur> plus having it inside ghc means it can share code with TH
2021-10-15 14:29:50 +0200 <talismanick> maerwald: Yes, it shows " aeson-1.5.6.0"
2021-10-15 14:29:57 +0200 <maerwald> you're good to go tthen
2021-10-15 14:30:28 +0200jakalx(~jakalx@base.jakalx.net)
2021-10-15 14:31:18 +0200 <geekosaur> >> "correctness-first"
2021-10-15 14:31:33 +0200 <geekosaur> there are a lot of dark corners you don't want to peek into…
2021-10-15 14:31:35 +0200azeem(~azeem@emp-85-170.eduroam.uu.se)
2021-10-15 14:32:16 +0200machinedgod(~machinedg@135-23-192-217.cpe.pppoe.ca)
2021-10-15 14:32:31 +0200 <maerwald> I've never viewed haskell as correctness-first
2021-10-15 14:32:37 +0200 <maerwald> that wasn't the motivation of it
2021-10-15 14:33:02 +0200 <maerwald> correctness first is usually very unpractical
2021-10-15 14:37:08 +0200gehmehgeh(~user@user/gehmehgeh)
2021-10-15 14:37:49 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 14:39:53 +0200 <kuribas> correctness-first sounds like pdd (proof driven development).
2021-10-15 14:40:05 +0200 <kuribas> where you first write the proof, then the code than fits the proof :)
2021-10-15 14:40:47 +0200Pickchea(~private@user/pickchea) (Quit: Leaving)
2021-10-15 14:41:22 +0200 <kuribas> I'd rather describe haskell as "abstraction first".
2021-10-15 14:42:24 +0200 <kuribas> or better, "abstraction whenever desirable".
2021-10-15 14:42:28 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
2021-10-15 14:45:18 +0200dsrt^(~dsrt@70.166.66.234)
2021-10-15 14:45:53 +0200slowButPresent(~slowButPr@user/slowbutpresent)
2021-10-15 14:46:57 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-15 14:48:09 +0200ubert(~Thunderbi@178.165.181.201.wireless.dyn.drei.com) (Remote host closed the connection)
2021-10-15 14:48:58 +0200jespada(~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a)
2021-10-15 14:50:52 +0200 <kuribas> The strong point in haskell is the ability to create abstractions, not to write correctness proofs.
2021-10-15 14:51:12 +0200 <kuribas> But abstractions can help a lot in creating well-behaving programs.
2021-10-15 14:51:26 +0200 <ManofLetters[m]> @arahael: could you kindly file a ticket about what's wrong with LambdaHack web display, ideally with a screenshot? does allureofthestars.com have he same problem? what browser (Firefox fares worst (IE not counted))
2021-10-15 14:51:26 +0200 <lambdabot> Unknown command, try @list
2021-10-15 14:52:03 +0200 <ski> kuribas : wouldn't you rather extract the code from the proof (hopefully with some irrelevancy erasure) ?
2021-10-15 14:52:08 +0200 <ManofLetters[m]> arahael: and regarding fonts, the web version sticks with the square ones (until I code a Canvas frontend), but the binaries have proportional fonts for your reading pleasure
2021-10-15 14:52:29 +0200 <ManofLetters[m]> s/@//
2021-10-15 14:52:46 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 265 seconds)
2021-10-15 14:53:19 +0200zebrag(~chris@user/zebrag)
2021-10-15 14:54:32 +0200 <kuribas> ski: yeah, I'd be nice to write how you want the code to behave, and then have some AI generate the code that behaves like that.
2021-10-15 14:54:54 +0200ianon(~igloo@c-68-83-22-43.hsd1.nj.comcast.net)
2021-10-15 14:55:19 +0200 <geekosaur> hope to God you're not writing it in English
2021-10-15 14:56:29 +0200 <ski> reminds me of how someone (Cale ?) mentioned someone showed some Haskell solving a problem, and then the other person wanted to see the "real code" (figuring the Haskell was pseudo-code)
2021-10-15 14:57:20 +0200 <ManofLetters[m]> s/@//, s/he/the/
2021-10-15 14:57:27 +0200jinsun__jinsun
2021-10-15 14:58:13 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-15 15:05:19 +0200max22-(~maxime@2a01cb0883359800813c3288fb4e8a2c.ipv6.abo.wanadoo.fr)
2021-10-15 15:05:31 +0200ianon(~igloo@c-68-83-22-43.hsd1.nj.comcast.net) (Ping timeout: 252 seconds)
2021-10-15 15:06:45 +0200 <kuribas> ski: was that the department of defense project?
2021-10-15 15:07:53 +0200 <ski> hm, i dunno ?
2021-10-15 15:08:04 +0200skionly has a vague recollection of the anecdote
2021-10-15 15:08:09 +0200 <kuribas> ski: http://www.cs.yale.edu/publications/techreports/tr1049.pdf
2021-10-15 15:08:37 +0200 <ski> (or perhaps there's been more than one incident like that)
2021-10-15 15:10:38 +0200 <kuribas> ski: "It is significant that Mr. Domanski, Mr Banowetz and Dr. Brosgol were all surprised and syspicious when we told them that Haskell prototype P1 is a complete tested executable program."
2021-10-15 15:11:24 +0200 <kuribas> "We provided them with a copy of P1 without explaining that it was a program, and based on preconceptions from their past experience, they had studied P1 under the assumption that it was a mixture of requirements specification and top level design. They were convinced it was incomplete because it did not address issues such as data structure design and execution order."
2021-10-15 15:12:05 +0200 <LiaoTao> Sounds like a regular day at my current company
2021-10-15 15:12:11 +0200 <kuribas> LiaoTao: lol
2021-10-15 15:12:22 +0200ski. o O ( SNAFU ? )
2021-10-15 15:12:31 +0200 <LiaoTao> I provide a solution and people begin complaining that it can't possibly work
2021-10-15 15:12:36 +0200LiaoTaoshrugs
2021-10-15 15:13:07 +0200 <LiaoTao> TGIF and all that
2021-10-15 15:13:13 +0200 <kuribas> LiaoTao: in haskell?
2021-10-15 15:13:14 +0200 <ski> kuribas : page ?
2021-10-15 15:13:17 +0200dschrempf(~dominik@070-207.dynamic.dsl.fonira.net)
2021-10-15 15:13:28 +0200 <kuribas> ski: 14
2021-10-15 15:13:32 +0200 <ski> ty
2021-10-15 15:13:33 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 265 seconds)
2021-10-15 15:13:39 +0200 <LiaoTao> kuribas, In any language with any libraries that's not exactly what people have been using for 20 years
2021-10-15 15:14:04 +0200fendor(~fendor@178.165.162.11.wireless.dyn.drei.com) (Remote host closed the connection)
2021-10-15 15:14:23 +0200fendor(~fendor@178.165.162.11.wireless.dyn.drei.com)
2021-10-15 15:14:24 +0200 <ski> ("TGIF" ?)
2021-10-15 15:14:29 +0200 <kuribas> LiaoTao: does that include lisp?
2021-10-15 15:14:53 +0200 <LiaoTao> ski, Thank God It's Friday so I can get away from this misery
2021-10-15 15:15:04 +0200 <LiaoTao> kuribas, You name it and they'll shame it
2021-10-15 15:15:44 +0200 <LiaoTao> Anyway I didn't mean for this to become a diatribe
2021-10-15 15:16:02 +0200 <kuribas> LiaoTao: time to start looking for another company?
2021-10-15 15:16:21 +0200 <LiaoTao> Just waiting out my yearly bonus
2021-10-15 15:16:38 +0200 <ski> ah, ty
2021-10-15 15:17:02 +0200 <talismanick> Is it possible to use Obelisk with just cabal-install instead of Nix?
2021-10-15 15:17:06 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 15:17:06 +0200 <kuribas> LiaoTao: you don't need to change yet, just look :)
2021-10-15 15:18:20 +0200 <kuribas> "it is safe to say that some observers have simply discounted the results because in their minds the use of higher-order functions to capture regions was just a trick that would probably not be useful in other contexts"
2021-10-15 15:18:31 +0200 <kuribas> I've seen this prejudice.
2021-10-15 15:18:42 +0200 <ski> "regions" in which sense ?
2021-10-15 15:18:52 +0200fendor(~fendor@178.165.162.11.wireless.dyn.drei.com) (Ping timeout: 265 seconds)
2021-10-15 15:19:07 +0200 <kuribas> ski: geometric regions
2021-10-15 15:19:47 +0200 <kuribas> I've seen criticism for the lack of introspection of HOFs. However in my experience it is rarely a problem.
2021-10-15 15:19:57 +0200 <kuribas> You write your program so that you don't need to inspect data.
2021-10-15 15:20:38 +0200alzgh(~alzgh@user/alzgh)
2021-10-15 15:21:23 +0200fendor(~fendor@178.165.162.11.wireless.dyn.drei.com)
2021-10-15 15:23:59 +0200 <ski> kuribas : geometric regions, as in graphics, or perhaps spatial modelling ? or regions of programs ?
2021-10-15 15:24:36 +0200 <kuribas> ski: page 4
2021-10-15 15:24:41 +0200acowley(~acowley@c-68-83-22-43.hsd1.nj.comcast.net)
2021-10-15 15:26:51 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
2021-10-15 15:28:41 +0200 <ski> hm, p. 2 mentions "geometric region server"
2021-10-15 15:29:02 +0200 <ski> (haven't seen any mention of HOFs yet, though)
2021-10-15 15:30:09 +0200kuribas(~user@ptr-25vy0i8rjj87ltkm4em.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
2021-10-15 15:31:30 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 268 seconds)
2021-10-15 15:31:36 +0200 <jacks2> is there a cross-platform haskell library for printing colored terminal characters?
2021-10-15 15:31:52 +0200 <ph88> I have a bit of a problem following my own program, it doesn't go into `go` on line 60 and i'm not sure why. I put trace everywhere but even then .. https://bpa.st/47IA
2021-10-15 15:32:14 +0200 <LiaoTao> "For those who object to this use of functional languages, we suggest reading the rest of this paper as if it were about a video game. We do not intend this as a joke; [...]"
2021-10-15 15:32:57 +0200rond_(~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
2021-10-15 15:33:07 +0200 <LiaoTao> I'm sure video games radiated even more credibility back then.
2021-10-15 15:34:03 +0200 <sm> jacks2: ansi-terminal
2021-10-15 15:34:05 +0200 <ski> maybe `ansi-terminal' or `text-ansi' ?
2021-10-15 15:34:43 +0200Xraell(~yourname@45.157.15.145) (Remote host closed the connection)
2021-10-15 15:35:03 +0200 <jacks2> nice
2021-10-15 15:35:43 +0200 <jacks2> I didn't know windows supports ANSI codes
2021-10-15 15:38:51 +0200 <jacks2> s/codes/colors
2021-10-15 15:39:06 +0200Profpatsch(~Profpatsc@static.88-198-193-255.clients.your-server.de)
2021-10-15 15:39:20 +0200twitu(~twitu@223.236.227.132)
2021-10-15 15:40:29 +0200 <Profpatsch> I have a foo :: Ctx Foo and a bar :: Ctx Bar and a do1 :: Ctx a -> IO () and a do2 :: Ctx a -> IO ()
2021-10-15 15:40:44 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2021-10-15 15:41:03 +0200 <Profpatsch> Is it possible to do { x <- if … then foo else bar; do1 x; do2 x } somehow?
2021-10-15 15:41:52 +0200 <Profpatsch> Or I guess I can create a do3 = do1 >> do2 and use different branches
2021-10-15 15:42:23 +0200 <ski> not without using existentials
2021-10-15 15:43:35 +0200 <Profpatsch> It’s fun cause I said to myself “I don’t need no stinkin typeclass” and now my data Ctx err = Ctx { fn1 :: IO (Either err a); printErr :: err -> Text }
2021-10-15 15:43:43 +0200 <Profpatsch> and
2021-10-15 15:43:52 +0200 <Profpatsch> you suddenly run into problems like that
2021-10-15 15:44:19 +0200slack1256(~slack1256@45.4.2.52)
2021-10-15 15:44:36 +0200 <Profpatsch> but even better, if I make err existential (which it totally could be), I can’d do fn1 ctx anymore
2021-10-15 15:44:38 +0200 <ski> do you rely on having `Cxt Foo' & `Cxt Bar', rather than just `SomeCxt' ?
2021-10-15 15:44:50 +0200 <Profpatsch> cause of escaping skolems
2021-10-15 15:45:19 +0200 <Profpatsch> Alternative I can see is a HasX typeclass and associated type
2021-10-15 15:45:27 +0200 <Profpatsch> But I have a distaste for those
2021-10-15 15:45:29 +0200 <ski> you could have `do1,do2 :: SomeCxt -> IO ()'. or `withCxt :: SomeCxt -> (forall a. Cxt a -> b) -> b' or somesuch
2021-10-15 15:45:51 +0200 <Profpatsch> ski: I actually have two impls for Ctx yeah
2021-10-15 15:46:01 +0200 <ski> (perhaps replacing `b' with `IO b' or `IO ()', if you prefer)
2021-10-15 15:46:17 +0200 <Profpatsch> One for an in-memory database that has err~Void and one for the real db that has err~Error
2021-10-15 15:46:31 +0200jakalx(~jakalx@base.jakalx.net)
2021-10-15 15:46:49 +0200 <ski> Profpatsch : yea, but that's not what i asked about
2021-10-15 15:47:19 +0200 <Profpatsch> ski: SomeCxt similar to SomeException?
2021-10-15 15:47:27 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds)
2021-10-15 15:47:36 +0200 <ski> do you actually need be transparent in which of those two you're using, somewhere ? or can you just inject the particular choice of implementation, once, at the start, and then not care/bother about which that is, henceforth ?
2021-10-15 15:47:49 +0200 <ski> `SomeCxt' being `exists a. Cxt a'
2021-10-15 15:48:06 +0200 <Profpatsch> ski: I have everything I need in my code in the Ctx yes
2021-10-15 15:48:11 +0200 <Profpatsch> so I don’t need to be transparent about it
2021-10-15 15:48:15 +0200endless(~endlessed@51.81.211.147) (Quit: The Lounge - https://thelounge.chat)
2021-10-15 15:49:01 +0200 <ski> (e.g. `data SomeCxt = forall err. MkSomeCxt { fn1 :: IO (Error err a),printErr :: err -> Text}' (hm, i suppose `a' should be another param ?))
2021-10-15 15:49:22 +0200 <Profpatsch> hm hm
2021-10-15 15:49:29 +0200 <ski> Profpatsch : in that case, it seems to me you don't need `Cxt', you just need `SomeCxt' (which you can rename to `Cxt' then, if you like)
2021-10-15 15:50:23 +0200 <Profpatsch> ski: But now if you have a Ctx in hand, and try to use the accessors, you get a problem
2021-10-15 15:50:33 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2021-10-15 15:50:34 +0200 <ski> yes
2021-10-15 15:50:40 +0200 <ski> when do you need to do that ?
2021-10-15 15:51:25 +0200 <Profpatsch> ski: Ah, I was using the record as a collection functions that contain the database implementation
2021-10-15 15:51:49 +0200 <ski> `exists err. (IO (Either err a),err -> Text)' is of course equivalent to just `IO (Either Text a)' .. but perhaps you have more fields in there ?
2021-10-15 15:52:12 +0200 <Profpatsch> So you want to call the functions in the code, and they would dispatch to the actual implementation that you pass in from the toplevle
2021-10-15 15:52:40 +0200 <ski> and the type of that actual implementation mentions `err' ?
2021-10-15 15:53:01 +0200lislisq
2021-10-15 15:53:15 +0200 <ski> (`err' being either `Void' or `Error' there)
2021-10-15 15:53:39 +0200 <Profpatsch> e.g. I’d do (ctx & db & readSomeValues :: IO (Either err Val)) and when I want to print the errors, I’d call (ctx & db & printError :: err -> IO ())
2021-10-15 15:54:10 +0200 <Profpatsch> It’s a little dsl that you can give different implementations
2021-10-15 15:54:32 +0200 <ski> what's the types of `ctx',`db',`readSomeValues',`printError' ?
2021-10-15 15:55:54 +0200 <Profpatsch> I’m sorry, (ctx & db :: Ctx)
2021-10-15 15:56:24 +0200 <Profpatsch> you can ignore the db, I should have just written (ctx & readSomeValues :: …) here
2021-10-15 15:56:34 +0200dibblego(~dibblego@haskell/developer/dibblego) (Ping timeout: 265 seconds)
2021-10-15 15:57:04 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com)
2021-10-15 15:57:04 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
2021-10-15 15:57:04 +0200dibblego(~dibblego@haskell/developer/dibblego)
2021-10-15 15:57:23 +0200 <Profpatsch> ctx :: Ctx, readSomeValues and printError are accessors of Ctx
2021-10-15 15:57:53 +0200pbrisbin(~patrick@pool-173-49-152-45.phlapa.fios.verizon.net)
2021-10-15 15:58:12 +0200 <ski> hm, so i guess you want to "coordinate" your implementation, whose type mentions `err', with contexts, whose type should mention the same `err'
2021-10-15 15:58:13 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 15:58:13 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 15:58:13 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 15:58:18 +0200 <Profpatsch> Which have :: Ctx err -> IO (Either err Val) and :: Ctx err -> err -> IO ()
2021-10-15 15:58:38 +0200 <Profpatsch> But now I see how the variables are escaping if you use existentials
2021-10-15 15:59:02 +0200 <Profpatsch> cause then it turns into Ctx -> IO (Either err Val) and how would the compiler know what `err` is from the signature of the accessor
2021-10-15 15:59:18 +0200 <ski> (just to be clear, this `Ctx err' is not the implementation itself, that you want to select at the start, right ?)
2021-10-15 16:00:00 +0200 <Profpatsch> I have two implementations, inMemoryDb :: Ctx Void and postgres :: Ctx Error
2021-10-15 16:00:20 +0200 <Profpatsch> which I pass to the main function main :: Ctx err -> IO ()
2021-10-15 16:00:30 +0200 <ski> hm, ok (so that *is* then the "implementation" you spoke of)
2021-10-15 16:00:36 +0200 <Profpatsch> And they define all functions of these two implementations
2021-10-15 16:00:46 +0200 <Profpatsch> I guess there was not enough X to the Y :)
2021-10-15 16:00:50 +0200 <ManofLetters[m]> BTW, most of the time when you think you need an existential to worth with both A and B, what really worse best is `Either A B`
2021-10-15 16:00:50 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
2021-10-15 16:00:51 +0200 <ManofLetters[m]> s/worse/works/
2021-10-15 16:01:11 +0200 <ski> so, what *else* do you want to do with the `err' in `IO (Either err Val)', *apart* from passing it to your `err -> IO ()' ?
2021-10-15 16:01:33 +0200 <Profpatsch> ski: Nothing, really
2021-10-15 16:01:35 +0200dschrempf(~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 260 seconds)
2021-10-15 16:01:44 +0200 <Profpatsch> Errors that happen should be printed at one point
2021-10-15 16:02:08 +0200 <ManofLetters[m]> s/BTW, most of the time when you think you need an existential to worth with both A and B, what really worse best is `Either A B`/BTW, most of the time when you think you need an existential to worth with both A and B, what really works best is `Either A B` [edit: or an equivalent datatype with no implementation exposed, but only some functions]/
2021-10-15 16:02:19 +0200 <ski> Profpatsch : ok, then instead of passing in `data Ctx err = Ctx { fn1 :: IO (Either err a),printErr :: err -> Text }', just pass in a `data Ctx = Ctx { fn1 :: IO (Either Text a) }', no ?
2021-10-15 16:03:11 +0200 <ski> Profpatsch : or else, manually define your `Ctx err -> IO (Either Text a)', in terms of the former definition of `Ctx' (which you could then wrap into `SomeCtx', as aforementioned)
2021-10-15 16:03:24 +0200 <Profpatsch> ski: The original idea was that all of the fn1 .. fn2 .. fnN functions return Error for one impl, but Void for the in-memory db
2021-10-15 16:03:47 +0200 <Profpatsch> Cause there obviously can’t be any e.g. Connection errors when not haviang any database to talk to
2021-10-15 16:04:00 +0200 <ski> Profpatsch : afaiui, you don't actually need to get `Error' vs. `Void', but only need to get `Text', no ?
2021-10-15 16:05:22 +0200 <ski> or is there some reason you'd like to know that you'll get a `Void', in that case ?
2021-10-15 16:05:45 +0200 <Profpatsch> If I get a Void, the implementation of printError is `absurd`
2021-10-15 16:05:50 +0200 <Profpatsch> so it can’t ever be called
2021-10-15 16:06:11 +0200 <ski> yes, but that doesn't change, if you do my suggestion
2021-10-15 16:06:32 +0200 <ski> only difference is that you fuse/inline `printError' with `fn1'
2021-10-15 16:07:06 +0200 <Profpatsch> Hm, not sure I understand
2021-10-15 16:07:31 +0200 <ski> so, the question is if you ever would like to know, in case you know that you passed in the `Ctx Void' implementation, that in the `Void' case of the `Either', "this can't happen" .. apart from knowing `printErr' can't happen
2021-10-15 16:07:40 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 268 seconds)
2021-10-15 16:08:56 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1)
2021-10-15 16:09:07 +0200attoboy(~attoboy@47.186.214.206)
2021-10-15 16:09:11 +0200 <ski> new_fn1 = fmap (left printErr) old_fn1 -- how the new `fn1' is related to the old one
2021-10-15 16:09:44 +0200 <Profpatsch> Ah but it’s not that simple
2021-10-15 16:10:05 +0200 <ski> yes ?
2021-10-15 16:10:14 +0200 <Profpatsch> Actually fn1 returns a (Either (Either err Error) Val)
2021-10-15 16:10:22 +0200 <Profpatsch> Where the error can either be internal or a user error
2021-10-15 16:10:38 +0200 <Profpatsch> I mean I guess it’s isomorphic still
2021-10-15 16:10:38 +0200 <ski> new_fn1 = fmap ((left . left) printErr) old_fn1 -- how the new `fn1' is related to the old one
2021-10-15 16:10:52 +0200 <Profpatsch> But the logic is still central to one place
2021-10-15 16:10:54 +0200 <codygman[m]> Can anyone help me understand why `named` (i.e. `<<foo>>` ) isn't being consumed using attoparsec?... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/da86a98b126638c75e003c6332f280433a19…)
2021-10-15 16:10:55 +0200 <ski> (assuming you still have `IO' wrapping that)
2021-10-15 16:10:56 +0200 <Profpatsch> and shouldn’t be in fn1
2021-10-15 16:11:00 +0200 <ManofLetters[m]> s/BTW, most of the time when you think you need an existential to worth with both A and B, what really worse best is `Either A B`/BTW, most of the time when you think you need an existential to work with both A and B, what really works best is `Either A B` [edit: or an equivalent datatype with no implementation exposed, but only some functions]/
2021-10-15 16:11:18 +0200 <Profpatsch> ManofLetters[m]: not sure what you are trying to say?
2021-10-15 16:11:53 +0200 <ski> Profpatsch : you could still do `SomeCtx -> IO (Either Text a)', even if you do `data SomeCtx = forall err. MkSomeCtx { fn1 :: IO (Either (Either err Error) a),printErr :: err -> Text}'
2021-10-15 16:12:24 +0200 <ski> ManofLetters[m] : fwiw, i'm not convinced that's the case here
2021-10-15 16:12:42 +0200jacks2(~bc8165b6@199.204.85.195) (Quit: CGI:IRC (Ping timeout))
2021-10-15 16:13:09 +0200 <Profpatsch> I’m not sure how all of this fits together
2021-10-15 16:13:19 +0200 <ski> Profpatsch : that way, `printErr' is not inside `fn1', but your `SomeCtx -> IO (Either (Either Text Error) a)' mixes them together in the obvious way
2021-10-15 16:13:26 +0200 <Profpatsch> ski: so you are saying what I really should be doing is change fn1 to return Text instead of err?
2021-10-15 16:13:40 +0200 <ski> Profpatsch : or define a `SomeCtx -> IO (Either (Either Text Error) a)'
2021-10-15 16:13:54 +0200 <Profpatsch> There’s like fn1 to fn10
2021-10-15 16:14:08 +0200 <ph88> codygman[m], i also would like to know that
2021-10-15 16:14:15 +0200 <ski> .. unless you actually depend somewhere on being able to "see" the `Void' vs. `Error' .. but i haven't seen you saying that, yet
2021-10-15 16:14:16 +0200 <Profpatsch> And more fns are being added or removed all the time, most of them return err
2021-10-15 16:14:37 +0200 <Profpatsch> So i’d need to implement a SomeCtx -> … for all of them separately?
2021-10-15 16:14:48 +0200 <ph88> codygman[m], what if you write your code in do-notation and add a view Debug.Trace (traceShow) in there ?
2021-10-15 16:15:54 +0200 <ski> Profpatsch : hm, maybe you could write `Cxt err -> Cxt Text' (which you'll have to extend, everytime you add a `fn')
2021-10-15 16:15:58 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:e9a1:1385:aea9:e3d1) (Ping timeout: 252 seconds)
2021-10-15 16:16:19 +0200 <ManofLetters[m]> I'm saying `do { x <- if … then Left <$> foo else Right <$> bar; do1 x; do2 x }`
2021-10-15 16:16:38 +0200 <ski> then you could use the original `fn1',&c. accessors, after calling this `Cxt err -> Cxt Text'
2021-10-15 16:17:09 +0200 <codygman[m]> ph88: Hmm, I'll try that. Good idea
2021-10-15 16:17:21 +0200kawzeg(kawzeg@2a01:7e01::f03c:92ff:fee2:ec34) (Quit: WeeChat 3.1)
2021-10-15 16:17:56 +0200 <ski> ManofLetters[m] : so far, it seems to me Profpatsch's code (apart from the "implementation" that is fed in at the start) is truly agnostic in whether it's `Void' or `Error' .. and so doing `Either Void Error' seems like a useless complication, both in terms of source, and operationally
2021-10-15 16:19:07 +0200 <Profpatsch> ski: why is that, in one case internal errors can happen and in the other it can’t
2021-10-15 16:19:11 +0200sedeki(~textual@user/sedeki)
2021-10-15 16:19:16 +0200 <ski> why is what ?
2021-10-15 16:19:26 +0200 <Profpatsch> Or do you mean since it is always going to return a Right the Text on the left doesn’t matter?
2021-10-15 16:19:36 +0200 <ski> yes
2021-10-15 16:19:38 +0200 <Profpatsch> Hmmmm
2021-10-15 16:19:46 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-10-15 16:20:01 +0200 <Profpatsch> I mean you get a few guarantees by looking at the code
2021-10-15 16:20:23 +0200 <ski> unless you somewhere really want to exploit it being `Void' on the left, rather than any old `Text', which actually can't happen .. in that case, you'd not be transparent/agnostic in `err'
2021-10-15 16:20:24 +0200 <Profpatsch> or can’t do a mistake when writing the handlers for memorydb and suddenly return a Left
2021-10-15 16:21:06 +0200kawzeg(kawzeg@2a01:7e01::f03c:92ff:fee2:ec34)
2021-10-15 16:21:06 +0200 <Profpatsch> The only thing I’ve now added to the setup code is that it does two branches which have two different types
2021-10-15 16:21:24 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-15 16:21:48 +0200Sgeo(~Sgeo@user/sgeo)
2021-10-15 16:21:48 +0200skireponders "Is it possible to do { x <- if … then foo else bar; do1 x; do2 x } somehow?"
2021-10-15 16:22:09 +0200 <Profpatsch> I mean apparently it’s not, but you can kinda work around it by having separate branches
2021-10-15 16:22:16 +0200 <ManofLetters[m]> ski: I see what you mean, but in this case hide the Either type in newtype in a module and only expose enough to pack it at the start and use it somewhere at the end (don't import the module with the type in all the intervening code that only passes the errors along)
2021-10-15 16:22:28 +0200 <ski> if you truly want that, you either need existentials, or `Either' (per ManofLetters[m]), afaics
2021-10-15 16:22:44 +0200 <codygman[m]> ph88 it's because manyTill consumes named. Here is a simpler example:... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/0986f2910032d18911f03d2da64e4de88fb5…)
2021-10-15 16:22:47 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-15 16:22:55 +0200 <Profpatsch> ManofLetters[m]: Usually I’m with you yes
2021-10-15 16:23:03 +0200 <Profpatsch> otoh it’s Haskell not Ocaml
2021-10-15 16:23:34 +0200 <Profpatsch> Both HasX typeclasses and this approach are solved by module functors in Ocaml
2021-10-15 16:23:40 +0200 <ski> if `do do1 x; do2 x' is large, you could define that to be `doAll x', and go `if … then doAll foo else doAll bar' ..
2021-10-15 16:23:55 +0200 <ManofLetters[m]> I'm writing OCaml in Haskell for a decade and I don't complain :)
2021-10-15 16:23:57 +0200 <Profpatsch> yeah, that’s essentially what I have now
2021-10-15 16:24:03 +0200sedeki(~textual@user/sedeki) (Quit: Textual IRC Client: www.textualapp.com)
2021-10-15 16:24:13 +0200 <Profpatsch> I’m just super against abusing type classes as a module system
2021-10-15 16:24:27 +0200 <Profpatsch> I’d rather abuse records as a module system :P
2021-10-15 16:24:45 +0200 <ski> i haven't really heard anything suggesting to use type classes, yet
2021-10-15 16:24:54 +0200 <ManofLetters[m]> Profpatsch: you can do that in Haskell, partially by convention (like, don't use FooInternal modules, etc.)
2021-10-15 16:25:10 +0200 <Profpatsch> (or rather this was kind of an experiment on whether it’s feasible to use records for this use case, and currently it still looks like it’s superior to Has* typeclasses)
2021-10-15 16:25:18 +0200cadsOxDEADBEEF
2021-10-15 16:25:52 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Ping timeout: 252 seconds)
2021-10-15 16:26:52 +0200 <codygman[m]> > <@codygman:matrix.org> ph88 it's because manyTill consumes named. Here is a simpler example:... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/ecc2a960b618eb6d9f195daeca0e37719d6f…)
2021-10-15 16:26:53 +0200 <lambdabot> <hint>:1:1: error: parse error on input ‘<@’
2021-10-15 16:26:57 +0200 <ski> (fun fact, using existential records, you can simulate an ML functor, generating a module/structure including an opaque type .. (in fact, it even corresponds to run-time module functor instantiation) -- i learned this from some posts by (i think) Joachim Durcholtz (sp?), on <news:comp.lang.functional>, many years ago)
2021-10-15 16:28:00 +0200 <ski> (or maybe it was Adrian Hay ?)
2021-10-15 16:29:26 +0200segfaultfizzbuzz(~segfaultf@135-180-0-138.static.sonic.net)
2021-10-15 16:30:07 +0200 <ski> Profpatsch : anyway, `do { x <- if … then WrapCtx foo else WrapCtx bar; withCtx doAll x }' ought to work, too
2021-10-15 16:30:34 +0200 <ManofLetters[m]> of if it's truly the case that the code is "truly agnostic in whether it's `Void' or `Error'", then print the error to Text ASAP and store Text --- it's lazy anywa
2021-10-15 16:30:35 +0200shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net)
2021-10-15 16:30:36 +0200 <ManofLetters[m]> s/anywa/anyway/
2021-10-15 16:30:49 +0200 <ManofLetters[m]> s/'/`/, s/anywa/anyway/
2021-10-15 16:30:53 +0200 <ManofLetters[m]> s/'/`/, s/'/`/, s/anywa/anyway/
2021-10-15 16:30:53 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-10-15 16:31:16 +0200 <ph88> codygman[m], i am happy you figured out the problem ! did you found a workaround for it ?
2021-10-15 16:31:18 +0200 <ski> ManofLetters[m] : yea, what i was suggesting :)
2021-10-15 16:31:26 +0200 <ManofLetters[m]> oh :D
2021-10-15 16:31:45 +0200 <ph88> codygman[m], on which matrix channel are you ?
2021-10-15 16:32:40 +0200 <ski> (but apparently it is desired not to inline `printErr' .. which is ok, one can make a wrapper. possibly along the `Ctx err -> Ctx Text' line, if one wants to be able to use the original accessors. but then there's no existentials, mind)
2021-10-15 16:32:43 +0200 <ph88> Could anyone take a look at my code ? ski maybe ? https://bpa.st/47IA i wonder why it doesn't go into `go` on line 60 when the debug trace is being print in the same location
2021-10-15 16:35:03 +0200shriekingnoise(~shrieking@186.137.144.80)
2021-10-15 16:35:56 +0200acidjnk_new3(~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
2021-10-15 16:39:23 +0200 <ski> ph88 : hm, seems to me it does go into it .. one time ?
2021-10-15 16:40:20 +0200skiidly realizes ManofLetters[m] is on Matrix[m]
2021-10-15 16:41:28 +0200hendursa1(~weechat@user/hendursaga) (Quit: hendursa1)
2021-10-15 16:42:01 +0200hendursaga(~weechat@user/hendursaga)
2021-10-15 16:42:52 +0200 <ManofLetters[m]> oh, this is IRC? greetings from the future! ;D
2021-10-15 16:43:11 +0200 <ManofLetters[m]> we will remember you fondly
2021-10-15 16:43:23 +0200 <ski> i was wondering why you were sedding like crazy
2021-10-15 16:44:30 +0200ski. o O ( <https://xkcd.com/1782/> )
2021-10-15 16:44:32 +0200 <codygman[m]> <ph88> "codygman, i am happy you figured..." <- Oh I didn't figure it out, only that I can't use `manyTill (manyTill ..)` and I'm not sure how to proceed 😅
2021-10-15 16:44:32 +0200 <ph88> ski, ye but not the last time ?
2021-10-15 16:45:21 +0200 <ph88> codygman[m], looking at the implementation of manyTill might give you ideas as well (i also don't know)
2021-10-15 16:46:13 +0200 <ManofLetters[m]> oh, dear, so all my dozens of edits actually end up us separate posts?
2021-10-15 16:46:18 +0200 <ManofLetters[m]> s/,//
2021-10-15 16:46:22 +0200kawzeg(kawzeg@2a01:7e01::f03c:92ff:fee2:ec34) (Quit: WeeChat 3.2)
2021-10-15 16:46:59 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-10-15 16:47:05 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2021-10-15 16:47:14 +0200 <ManofLetters[m]> you should have seen this coming when Matrix tricked you into letting them assimilate you
2021-10-15 16:47:36 +0200funsafe(~funsafe@2601:1c1:4200:e53:2875:5507:42e4:4e14) (Ping timeout: 245 seconds)
2021-10-15 16:47:48 +0200hyiltiz(~quassel@31.220.5.250) (Ping timeout: 265 seconds)
2021-10-15 16:49:02 +0200 <ski> ph88 : not sure sure `z start' and `z 0' isn't output a second time .. oh, actually, i think i know that. the `traceShow' isn't attached to the parsing, but to evaluating the parser action
2021-10-15 16:49:13 +0200 <geekosaur> someday someone will come up with an IRC client which interprets them
2021-10-15 16:49:22 +0200 <geekosaur> it shouldn't even be all that difficult
2021-10-15 16:49:27 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-15 16:50:00 +0200 <ski> ManofLetters[m] : yes. including "<ManofLetters[m]> s/BTW, most of the time when .. is `Either A B`/BTW, most of the time when .. is `Either A B` [edit: or an .. only some functions]/"
2021-10-15 16:50:04 +0200 <geekosaur> I admit I'd been wondering if that needed to be traceIO or some variant thereof
2021-10-15 16:50:33 +0200ptrcmd_ptrcmd
2021-10-15 16:51:09 +0200 <ManofLetters[m]> 🤦
2021-10-15 16:51:23 +0200 <ski> now and then, people in ##math have been saying something similar, about an IRC client interpreting TeX
2021-10-15 16:52:06 +0200 <ski> (ManofLetters[m] : not repeating most of that message, to spare the guilty)
2021-10-15 16:52:15 +0200 <geekosaur> probably do that with current clients if someone cares to write the plugin
2021-10-15 16:52:30 +0200hyiltiz(~quassel@31.220.5.250)
2021-10-15 16:52:34 +0200 <geekosaur> I am for example almost certain hexchat could do it
2021-10-15 16:52:52 +0200 <ski> the question is, would people actually want it, if they tried it, or do they only think they would ?
2021-10-15 16:53:00 +0200 <geekosaur> right
2021-10-15 16:53:19 +0200 <geekosaur> like browser TeX plugins, which IIRC was actually written but nobody used it
2021-10-15 16:53:26 +0200 <ski> (leaky abstractions and all that)
2021-10-15 16:53:26 +0200yinzzz
2021-10-15 16:55:31 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-15 16:55:40 +0200 <ski> (ph88 : oh, also `f' and `P.Parser' are not type classes)
2021-10-15 16:56:37 +0200vpan(~0@212.117.1.172) (Ping timeout: 252 seconds)
2021-10-15 16:57:03 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 16:57:03 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 16:57:03 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 16:58:27 +0200 <slack1256> Does a lsp-function exist such that it that searches for the call-tree of a function?
2021-10-15 16:58:49 +0200dibblego(~dibblego@haskell/developer/dibblego) (Ping timeout: 252 seconds)
2021-10-15 16:58:49 +0200xiongxin(~quassel@113.116.224.79) (Ping timeout: 252 seconds)
2021-10-15 16:58:55 +0200 <slack1256> Mmm I guess the access to that functionality will be wrapped on a emacs function. If you know the name it would help me.
2021-10-15 16:59:01 +0200xiongxin(~quassel@113.116.224.79)
2021-10-15 16:59:02 +0200acidjnk_new3(~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de)
2021-10-15 17:00:12 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 17:00:25 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com)
2021-10-15 17:00:25 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
2021-10-15 17:00:25 +0200dibblego(~dibblego@haskell/developer/dibblego)
2021-10-15 17:03:05 +0200twitu(~twitu@223.236.227.132) (Ping timeout: 256 seconds)
2021-10-15 17:04:19 +0200 <zzz> is there any reason, performance wise or otherwise, to keep functions inside of where/let bindings when we could just not, besides keeping the global space unpolluted or being able to benefit from scoped variables?
2021-10-15 17:04:52 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-10-15 17:05:40 +0200 <[exa]> zzz: monomorphism restriction and perhaps some specialization, other than that not much
2021-10-15 17:06:13 +0200 <ski> more clearly grouping helper operations with their helpee ?
2021-10-15 17:06:34 +0200skimisses `local'-`in'-`end' in Haskell
2021-10-15 17:06:46 +0200 <zzz> so it's mostly a matter of style for readability
2021-10-15 17:07:17 +0200 <zzz> ski: what's local in end?
2021-10-15 17:07:40 +0200 <slack1256> zzz: you can specify types on the where/let biding that are more restrictive versions of other functions. I use it all the time when I have access to a Rank2 function and I want to specify some types because I have ScopedTypeVariables specified.
2021-10-15 17:07:46 +0200 <slack1256> But yeah, not much more than that.
2021-10-15 17:08:05 +0200 <zzz> yes
2021-10-15 17:08:06 +0200cfricke(~cfricke@user/cfricke) (Ping timeout: 268 seconds)
2021-10-15 17:08:10 +0200dsrt^(~dsrt@70.166.66.234) (Ping timeout: 252 seconds)
2021-10-15 17:08:15 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 265 seconds)
2021-10-15 17:08:29 +0200dsrt^(~dsrt@70.166.66.234)
2021-10-15 17:09:11 +0200 <ski> zzz : `let <decls> in <expr> end' vs. `local <decls> in <decls> end'. this is SML
2021-10-15 17:09:26 +0200 <ski> the former is an expression, the latter is a declaration
2021-10-15 17:09:39 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-15 17:09:54 +0200 <ski> so you can go
2021-10-15 17:09:57 +0200 <ski> local
2021-10-15 17:10:00 +0200 <geekosaur> yeh, I mostly use it for things that only make sense in the context of one particular function. but sometimes I end up floating them out because I turn out to need them elsewhere
2021-10-15 17:10:11 +0200 <ski> ..private/helper definitions in here..
2021-10-15 17:10:13 +0200 <ski> in
2021-10-15 17:10:21 +0200 <ski> ..public definitions, using the private ones..
2021-10-15 17:10:22 +0200 <ski> end
2021-10-15 17:11:19 +0200vpan(~0@212.117.1.172)
2021-10-15 17:11:46 +0200 <ski> note "public definitions". plural, not singular. since doing `(foo,bar,baz) = (myFoo,myBar,myBaz) where myFoo = ...; myBar = ...; myBaz = ...; ..private definitions..' gets tired
2021-10-15 17:14:22 +0200hnOsmium0001(uid453710@id-453710.hampstead.irccloud.com)
2021-10-15 17:15:40 +0200 <ski> .. having `if' and `case' declarations could also occasionally be useful
2021-10-15 17:16:26 +0200lbseale(~lbseale@user/ep1ctetus)
2021-10-15 17:21:16 +0200lortabac(~lortabac@2a01:e0a:541:b8f0:7767:27e:419a:f863) (Ping timeout: 268 seconds)
2021-10-15 17:22:19 +0200 <codygman[m]> <dminuoso> "Aeson comes with TH helpers..." <- TH makes recompilation avoidance worse in my experience and can slow ghcid workflows on large codebases.
2021-10-15 17:22:29 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-15 17:25:59 +0200 <maerwald> and breaks cross compilation and haskell parsers and makes HLS crash, and...
2021-10-15 17:27:27 +0200attoboy(~attoboy@47.186.214.206) (Ping timeout: 256 seconds)
2021-10-15 17:27:31 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2021-10-15 17:29:29 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 264 seconds)
2021-10-15 17:31:52 +0200dibblego(~dibblego@haskell/developer/dibblego) (Ping timeout: 252 seconds)
2021-10-15 17:32:59 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com)
2021-10-15 17:32:59 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
2021-10-15 17:32:59 +0200dibblego(~dibblego@haskell/developer/dibblego)
2021-10-15 17:33:50 +0200 <Hecate> §2
2021-10-15 17:34:07 +0200 <shapr> §3
2021-10-15 17:34:07 +0200twitu(~twitu@223.236.227.132)
2021-10-15 17:34:26 +0200 <ski> §5
2021-10-15 17:35:07 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2021-10-15 17:35:50 +0200 <Hecate> :O
2021-10-15 17:36:19 +0200 <shapr> Hecate: I thought you were gonna do §8 !
2021-10-15 17:37:14 +0200 <fryguybob> What am I doing wrong: data T a = T a a a deriving (Semigroup) via ((a,a,a)) ?
2021-10-15 17:39:12 +0200 <Hecate> shapr: oh I'm still recovering from my lunch, don't ask too much of me ;_;_
2021-10-15 17:39:16 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
2021-10-15 17:39:16 +0200xiongxin(~quassel@113.116.224.79) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2021-10-15 17:39:22 +0200 <Hecate> erm, *;_;
2021-10-15 17:39:28 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-15 17:39:48 +0200 <Hecate> % data T a = T a a a deriving (Semigroup) via ((a,a,a))
2021-10-15 17:39:48 +0200 <yahb> Hecate: ; <interactive>:74:30: error:; * Couldn't match representation of type: (a, a, a); with that of: T a; arising from the coercion of the method `<>' from type `(a, a, a) -> (a, a, a) -> (a, a, a)' to type `T a -> T a -> T a'; * When deriving the instance for (Semigroup (T a)); <interactive>:74:30: error:; * Couldn't match representation of type: (a, a, a)
2021-10-15 17:41:03 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 17:41:12 +0200 <Hecate> fryguybob: I'm curious, you are trying to piggy-back on the Semigroup instance for (a,a,a) right?
2021-10-15 17:41:20 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
2021-10-15 17:41:21 +0200 <fryguybob> Right
2021-10-15 17:41:43 +0200 <Hecate> fryguybob: where is this instance defined?
2021-10-15 17:42:22 +0200 <fryguybob> instance (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) -- Defined in ‘GHC.Base’
2021-10-15 17:42:53 +0200 <fryguybob> Oops, I meant Semigroup there.
2021-10-15 17:43:01 +0200 <fryguybob> Same answer
2021-10-15 17:45:34 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-15 17:45:59 +0200 <Hecate> ah yes quite right
2021-10-15 17:46:56 +0200 <fryguybob> % ("hello", "My") <> (" world", " friend")
2021-10-15 17:46:56 +0200 <yahb> fryguybob: ("hello world","My friend")
2021-10-15 17:47:37 +0200 <Hecate> maybe koz knows about this
2021-10-15 17:47:45 +0200xff0x(~xff0x@2001:1a81:524d:6800:a178:5c71:40d3:e997) (Ping timeout: 260 seconds)
2021-10-15 17:47:47 +0200 <Hecate> (koz knows many things)
2021-10-15 17:47:58 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 17:47:58 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 17:47:58 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 17:48:09 +0200xff0x(~xff0x@2001:1a81:524d:6800:54c0:a41d:5321:6f97)
2021-10-15 17:48:51 +0200 <monochrom> Is it just because T is not "newtype T a = MkT (a,a,a)"?
2021-10-15 17:48:55 +0200dibblego(~dibblego@haskell/developer/dibblego) (Ping timeout: 252 seconds)
2021-10-15 17:49:16 +0200 <fryguybob> That works fine without deriving via.
2021-10-15 17:50:03 +0200 <fryguybob> "Couldn't match representation of type: (a, a, a)
2021-10-15 17:50:04 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-10-15 17:50:15 +0200 <fryguybob> Is there a ghci way to ask for the representation?
2021-10-15 17:50:59 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com)
2021-10-15 17:51:00 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
2021-10-15 17:51:00 +0200dibblego(~dibblego@haskell/developer/dibblego)
2021-10-15 17:51:05 +0200DNH(~DNH@2a02:8108:1100:16d8:31ac:ed04:1cbf:a354) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-10-15 17:51:51 +0200 <monochrom> See, that's my point, IIRC "same representation" just means "just a newtype away", not any real structural comparison.
2021-10-15 17:53:06 +0200 <geekosaur> :seti -fprint-explicit-runtime-reps ?
2021-10-15 17:54:00 +0200chele(~chele@user/chele) (Remote host closed the connection)
2021-10-15 17:54:23 +0200 <geekosaur> hrm, actually I'd expect those to have the same runtimerep
2021-10-15 17:54:36 +0200 <fryguybob> geekosaur: I think that's what I was thinking of.
2021-10-15 17:55:07 +0200Profpatsch(~Profpatsc@static.88-198-193-255.clients.your-server.de) (WeeChat 3.3)
2021-10-15 17:55:23 +0200 <Hecate> monochrom: is this a case of DerivingVia bringing nothing more than what deriving newtype would?
2021-10-15 17:55:54 +0200 <monochrom> Do you mean s/deriving newtype/GND/ ?
2021-10-15 17:56:35 +0200 <monochrom> I think DerivingVia adds, for example: if Coercible s t, then Coercible (Maybe s) (Maybe t), etc.
2021-10-15 17:56:36 +0200 <edwardk> nominal determinism at its best: https://twitter.com/i/events/1448993852904202244
2021-10-15 17:57:07 +0200 <edwardk> oops
2021-10-15 17:57:11 +0200 <edwardk> _wrong_ channel
2021-10-15 17:57:27 +0200edwardkwaves hello.
2021-10-15 17:57:38 +0200 <geekosaur> œ
2021-10-15 17:58:07 +0200 <Hecate> monochrom: yeah
2021-10-15 17:58:15 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 260 seconds)
2021-10-15 17:58:20 +0200 <Hecate> % newtype T a = T (a, a, a) deriving (Semigroup) via (a,a,a)
2021-10-15 17:58:20 +0200 <yahb> Hecate:
2021-10-15 17:58:26 +0200 <Hecate> % newtype Y a = Y (a,a,a) deriving newtype Semigroup
2021-10-15 17:58:27 +0200 <yahb> Hecate:
2021-10-15 17:58:46 +0200 <edwardk> fryguybob: deriving via can work with newtypes, not isomorphic types
2021-10-15 17:58:51 +0200 <monochrom> But I don't think it adds: "if "data S a = S Int a" and "data T a = T Int a" look obviously the same, then Coercible s t.
2021-10-15 17:59:03 +0200 <Hecate> edwardk: aptly named fellow
2021-10-15 17:59:06 +0200 <edwardk> you can use hecate's version, and then use a pattern synonym if the (,,)'s are ugly
2021-10-15 17:59:35 +0200_ht(~quassel@82-169-194-8.biz.kpn.net)
2021-10-15 17:59:35 +0200 <fryguybob> edwardk: Huh, I thought the point was just having a matching runtime representation.
2021-10-15 17:59:51 +0200 <edwardk> its not that clever, it just uses coercible instances
2021-10-15 18:00:09 +0200 <fryguybob> I suppose I'm clever enough to write the instances :D
2021-10-15 18:00:15 +0200 <edwardk> if you upgrade Coercible you can have it
2021-10-15 18:00:26 +0200 <geekosaur> suppose that prevents you from violating a role?
2021-10-15 18:00:49 +0200 <edwardk> or in that case i think the semigroups package even exports a template haskell splice thing for generating the instance
2021-10-15 18:00:56 +0200 <edwardk> and a ghc.generics version
2021-10-15 18:01:15 +0200 <edwardk> if i don't ryan has a version of it
2021-10-15 18:01:18 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 18:01:18 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 18:01:18 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 18:01:19 +0200 <edwardk> er other ryan
2021-10-15 18:01:22 +0200 <fryguybob> :D
2021-10-15 18:02:15 +0200 <monochrom> Wait, how do you upgrade Coercibe?
2021-10-15 18:02:27 +0200 <edwardk> monochrom: ?
2021-10-15 18:02:28 +0200 <geekosaur> presumably adding nbew rules/cases to it
2021-10-15 18:02:38 +0200 <edwardk> none of those things change Coercible
2021-10-15 18:02:53 +0200 <edwardk> the instance wasn't the Coercible one, it was the Semigroup he was generating
2021-10-15 18:02:58 +0200 <edwardk> that was what i was referring to
2021-10-15 18:05:32 +0200 <dsal> Argh, fighting lens hate when using it on something that lens is really good at and would be a huge pain to write without.
2021-10-15 18:06:29 +0200 <monochrom> Or generally hate.
2021-10-15 18:07:04 +0200acidjnk_new3(~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2021-10-15 18:08:54 +0200acidjnk_new3(~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de)
2021-10-15 18:09:12 +0200vpan(~0@212.117.1.172) (Quit: Leaving.)
2021-10-15 18:10:27 +0200 <fryguybob> The plate has been applied to the boiler.
2021-10-15 18:12:52 +0200dibblego(~dibblego@haskell/developer/dibblego) (Ping timeout: 265 seconds)
2021-10-15 18:14:00 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-10-15 18:14:01 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com)
2021-10-15 18:14:01 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
2021-10-15 18:14:01 +0200dibblego(~dibblego@haskell/developer/dibblego)
2021-10-15 18:14:50 +0200 <dsal> Yeah, but I'm not talking plated. I've got a list of records that contain a Maybe JSON object that I want a list of the string values out of. I *can* write that without lenses, but apparently newbies can't run the lens stuff at a glance. Which I'm having trouble believing, honestly.
2021-10-15 18:15:28 +0200 <dsal> `things ^.. folded . data . _Just . key "formatted" . _String` is not objectively hard to read.
2021-10-15 18:16:20 +0200 <geekosaur> I, uh, wouldn't call it obvious
2021-10-15 18:16:24 +0200max22-(~maxime@2a01cb0883359800813c3288fb4e8a2c.ipv6.abo.wanadoo.fr) (Quit: Leaving)
2021-10-15 18:21:18 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
2021-10-15 18:21:41 +0200 <dsal> The alternative without lens looks like this: https://www.irccloud.com/pastebin/DBK968rO/lensless.hs
2021-10-15 18:22:07 +0200 <dsal> (and, of course, breaks with an aeson upgrade for reasons nobody working on this piece of code cares about)
2021-10-15 18:22:16 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-15 18:24:32 +0200wonko(~wjc@62.115.229.50)
2021-10-15 18:24:57 +0200azeem(~azeem@emp-85-170.eduroam.uu.se) (Ping timeout: 265 seconds)
2021-10-15 18:26:21 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
2021-10-15 18:26:27 +0200 <ski> f lm = [s | Just (Object (HM.lookup "formatted" -> Just (String s))) <- [logData lm]]
2021-10-15 18:26:35 +0200 <ski> or
2021-10-15 18:26:55 +0200 <ski> f (logData -> Just (Object (HM.lookup "formatted" -> Just (String s)))) = [s]
2021-10-15 18:27:18 +0200 <ski> f _ = [ ]
2021-10-15 18:29:00 +0200 <ski> formatted = (`foldMap` things) \case (logData -> Just (Object (HM.lookup "formatted" -> Just (String s)))) -> [s]; _ -> [] -- i guess
2021-10-15 18:29:36 +0200 <dsal> I don't think any of these are more obvious than simple lens things.
2021-10-15 18:30:57 +0200azeem(~azeem@2a00:801:238:7fcb:5228:4a72:5b90:f025)
2021-10-15 18:31:16 +0200 <Rembane> I'm cool with reading the lens code, but I don't think I could write it, on a good day I could probably change it.
2021-10-15 18:32:06 +0200 <dsal> A lot of the arguments are "newbies wouldn't understand this code." I don't want to get super weird with things, but I don't want to only write code for the least experienced person.
2021-10-15 18:33:00 +0200skiidly wonders whether the median, or average/expected, person would understand it
2021-10-15 18:33:19 +0200dibblego(~dibblego@haskell/developer/dibblego) (Ping timeout: 265 seconds)
2021-10-15 18:34:32 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com)
2021-10-15 18:34:32 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
2021-10-15 18:34:32 +0200dibblego(~dibblego@haskell/developer/dibblego)
2021-10-15 18:34:53 +0200twitu(~twitu@223.236.227.132) (Ping timeout: 256 seconds)
2021-10-15 18:37:17 +0200 <maerwald> the time to understand old lens code is rarely worth it for me
2021-10-15 18:37:19 +0200 <dsal> There's a lot of conversations about where to draw the line as far as features and stuff. Apparently lenses are definitely a bad idea and they're never needed and nobody should ever use them for anything.
2021-10-15 18:38:01 +0200 <dsal> I don't even know what the equivalent code looks like in the latest version of aeson. I don't expect the lens code to break there, though.
2021-10-15 18:38:10 +0200 <maerwald> if you use them regularly, it probably makes sense... but if you use them occasinally, you forget things quickly, because none of it is really intuitive
2021-10-15 18:38:54 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 18:43:47 +0200dibblego(~dibblego@haskell/developer/dibblego) (Ping timeout: 240 seconds)
2021-10-15 18:44:50 +0200 <shapr> maerwald: I agree
2021-10-15 18:46:49 +0200fluffyballoon(~user@131.93.208.196)
2021-10-15 18:48:54 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-10-15 18:50:29 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-15 18:50:46 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 18:50:55 +0200emliunix(~emliunix@2a09:bac0:23::815:b6d)
2021-10-15 18:51:26 +0200emliunix(~emliunix@2a09:bac0:23::815:b6d) ()
2021-10-15 18:53:26 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
2021-10-15 18:55:23 +0200 <monochrom> There is "write to the level of the audience". But there is also "what about encouraging the audience to raise their level?".
2021-10-15 18:56:31 +0200 <dsal> I don't really want to work with people who get confused when I use something like `*>` instead of a `do` block.
2021-10-15 18:56:58 +0200 <monochrom> I think almost everyone writes in their CV "career goal: ... blah blah ... growth ... blah blah...". You can call it out on that whenever they resist progress.
2021-10-15 18:57:29 +0200 <dsal> i.e., I don't mind people not knowing something right away, but we can learn better. I do think there's a line where something is just too fancy.
2021-10-15 18:57:36 +0200 <monochrom> If I write only code that you perfectly understand, will you grow?
2021-10-15 18:57:59 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-15 18:58:16 +0200MQ-17J(~MQ-17J@8.6.144.117)
2021-10-15 19:00:16 +0200 <maerwald> I don't think it's about progress. It's about the balance of learning/using something compared to the gain. When someone tells me to learn nix to build their project, I say "no".
2021-10-15 19:00:31 +0200vladomiro(~vladomiro@2806:106e:23:c05a:523e:aaff:feb9:bb5c)
2021-10-15 19:01:00 +0200ski. o O ( ‟Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?” -- "Kernighan's lever" by Linus Åkesson in 2012-12-11 at <https://www.linusakesson.net/programming/kernighans-lever/index.php> )
2021-10-15 19:01:13 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 19:01:32 +0200 <dsal> Heh. Sure, but you have an argument against nix that isn't just "I don't know what any of these functions do at first glance"
2021-10-15 19:01:49 +0200 <maerwald> ski: except many Haskellers think they don't need to debug Haskell, because "types" :p
2021-10-15 19:02:03 +0200 <Hecate> those people are blessed with ignorance
2021-10-15 19:02:21 +0200 <monochrom> You know what, I challenge the premise that debugging is twice as hard as writing.
2021-10-15 19:02:44 +0200 <maerwald> monochrom: oh really... wait until you get user bug reports from platforms you're not using :D
2021-10-15 19:02:57 +0200 <monochrom> haha
2021-10-15 19:03:30 +0200 <monochrom> But fixing that is writing not debugging.
2021-10-15 19:03:44 +0200 <dsal> I have the "every few million times you do this, a thing hangs" kind of bugs sometimes.
2021-10-15 19:04:18 +0200 <monochrom> Before fixing, the spec was merely "works on my platform". After fixing, the spec becomes "works on more platforms". This is not debugging, this is adding features. This is writing.
2021-10-15 19:05:42 +0200 <monochrom> But my premise is that my "writing" already includes what other people consider "don't do it until debugging".
2021-10-15 19:06:37 +0200 <monochrom> In some critical parts, my "writing" includes "proving", which is twice as hard as "debugging".
2021-10-15 19:06:43 +0200 <koz> What do I supposedly know about?
2021-10-15 19:07:06 +0200 <monochrom> So, my writing is 4 times as hard as debugging? Or did I accidentally make a strange loop there?
2021-10-15 19:07:15 +0200 <maerwald> well, tbf... that statement is in he context of C programs I guess
2021-10-15 19:07:35 +0200 <maerwald> 10 lines of C code usually lead to 2 hours of debugging
2021-10-15 19:07:42 +0200 <monochrom> Oh heh koz, about why "data T a = T a a a deriving Semigroup via (a,a,a)" is rejected.
2021-10-15 19:08:24 +0200 <koz> Because you can't via-derive if you're not coercible.
2021-10-15 19:08:34 +0200 <geekosaur> yeh, we already got there
2021-10-15 19:08:34 +0200 <monochrom> Yeah :)
2021-10-15 19:08:52 +0200 <koz> maerwald: So much this.
2021-10-15 19:08:54 +0200 <monochrom> We figured it out eventually.
2021-10-15 19:09:14 +0200 <geekosaur> the error message could be clearer since it sounds like it's enough to have the same RuntimeRep
2021-10-15 19:10:12 +0200 <monochrom> Yeah, it misleads one to "let me check GHC Execution Model again to prove that T a and (a,a,a) are the same at the machine level"
2021-10-15 19:10:25 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-10-15 19:10:34 +0200 <monochrom> which the compiler totally doesn't care
2021-10-15 19:11:29 +0200emf(~emf@2620:10d:c090:400::5:57e9)
2021-10-15 19:11:32 +0200klunk(~klunk@user/klunk)
2021-10-15 19:11:50 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
2021-10-15 19:12:28 +0200hyiltiz(~quassel@31.220.5.250) (Ping timeout: 265 seconds)
2021-10-15 19:12:54 +0200 <geekosaur> don't even need the Execution Model, you can get ghc to dump the RuntimeRep of a type (set the flag I pointed to earlier and use :k, I think) and confirm they're the same
2021-10-15 19:13:09 +0200 <monochrom> The error message says one thing right and one thing wrong.
2021-10-15 19:13:15 +0200hyiltiz(~quassel@31.220.5.250)
2021-10-15 19:13:37 +0200 <monochrom> The wrong part is bringing up "representation" as though it meant what most humans mean by that.
2021-10-15 19:14:39 +0200 <monochrom> The right part is "can't coerce from (a,a,a)->(a,a,a)->(a,a,a) to T a -> T a -> T a"
2021-10-15 19:14:41 +0200bitmapper(uid464869@id-464869.lymington.irccloud.com)
2021-10-15 19:15:07 +0200 <monochrom> As usual, the human mind always fixates on the wrong part.
2021-10-15 19:16:52 +0200klunk(~klunk@user/klunk) (Quit: Client closed)
2021-10-15 19:17:52 +0200econo(uid147250@user/econo)
2021-10-15 19:18:45 +0200hyiltiz(~quassel@31.220.5.250) (Ping timeout: 260 seconds)
2021-10-15 19:19:06 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2021-10-15 19:21:29 +0200conphiz[m](~conphizma@2001:470:69fc:105::c052)
2021-10-15 19:21:33 +0200favonia(~favonia@user/favonia)
2021-10-15 19:24:01 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-15 19:26:07 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-15 19:29:29 +0200hyiltiz(~quassel@31.220.5.250)
2021-10-15 19:29:31 +0200favonia(~favonia@user/favonia) (Ping timeout: 252 seconds)
2021-10-15 19:29:44 +0200ec(~ec@gateway/tor-sasl/ec)
2021-10-15 19:31:35 +0200MQ-17J(~MQ-17J@8.6.144.117) (Ping timeout: 264 seconds)
2021-10-15 19:33:35 +0200benin(~benin@183.82.206.194) (Ping timeout: 265 seconds)
2021-10-15 19:35:29 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 19:35:30 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 19:35:30 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 19:35:47 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
2021-10-15 19:36:11 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 19:37:25 +0200 <zzz> > False && True
2021-10-15 19:37:27 +0200 <lambdabot> False
2021-10-15 19:37:30 +0200 <zzz> monochrom: ^
2021-10-15 19:38:03 +0200 <monochrom> Yeah but why && rather than || ?
2021-10-15 19:38:17 +0200 <monochrom> And why not == or /= ?
2021-10-15 19:38:59 +0200 <zzz> because
2021-10-15 19:39:07 +0200 <zzz> wait i've got a good response for that
2021-10-15 19:39:41 +0200 <monochrom> And did you know that all four of them are monoid operators for Bool? :)
2021-10-15 19:39:52 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-10-15 19:41:08 +0200neurocyte0132889(~neurocyte@45.14.189.246)
2021-10-15 19:41:08 +0200neurocyte0132889(~neurocyte@45.14.189.246) (Changing host)
2021-10-15 19:41:08 +0200neurocyte0132889(~neurocyte@user/neurocyte)
2021-10-15 19:41:14 +0200 <monochrom> One of which gives a very slick, free-of-case-analysis, just-do-algebra solution to logic puzzles such as "there is a angle or demon (you don't know which) at the crossroad..."
2021-10-15 19:41:57 +0200DNH(~DNH@2a02:8108:1100:16d8:31ac:ed04:1cbf:a354)
2021-10-15 19:42:03 +0200 <Rembane> All monoids lie and speak the truth at the same time?
2021-10-15 19:42:20 +0200 <zzz> monochrom: because `Left l >>= _ = Left l`
2021-10-15 19:42:59 +0200 <monochrom> Yeah but why >>= rather than mplus? :)
2021-10-15 19:43:06 +0200 <monochrom> @quote monochrom crossroad
2021-10-15 19:43:06 +0200 <lambdabot> monochrom says: at a crossroad you meet an angel (always tells the truth) or demon (always lies). the crossroad gives you two choices of roads, one to heaven, one to hell, and only the angel or
2021-10-15 19:43:06 +0200 <lambdabot> demon knows which is which. if you ask "how would you answer if I asked 'what is a monad?'", what will happen?
2021-10-15 19:43:22 +0200 <zzz> monochrom: "if i asked the other one.."
2021-10-15 19:43:55 +0200 <zzz> wait what
2021-10-15 19:44:07 +0200 <monochrom> hahaha
2021-10-15 19:44:12 +0200 <monochrom> But here: http://www.cs.utoronto.ca/~trebla/eq-wiltink.pdf
2021-10-15 19:45:11 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
2021-10-15 19:45:24 +0200OscarZ(~oscarz@95.175.104.139)
2021-10-15 19:46:01 +0200 <monochrom> And yeah the logic puzzle is still solvable if you don't have two guards, only one guard.
2021-10-15 19:46:30 +0200 <monochrom> You don't need your question to refer to "the other guard" or even a hypothetical other guard.
2021-10-15 19:47:56 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 19:48:29 +0200 <monochrom> The gist of the solution (with or without another guard) is "what would ... if ..." indirection. That's all you need. "What would you do if you were..." already works.
2021-10-15 19:48:49 +0200 <zzz> this reminds of https://html.scribdassets.com/4zoxm0xb5syrh9w/images/1-4e83966743.jpg
2021-10-15 19:49:26 +0200 <monochrom> Yeah, Smullyan is great.
2021-10-15 19:51:04 +0200 <Franciman> we will not let the dictator take us all in the cage. Fork till the end
2021-10-15 19:51:20 +0200 <Franciman> ops wrong chat
2021-10-15 19:52:42 +0200 <zzz> monochrom: i don't agree with the casket thing
2021-10-15 19:53:02 +0200 <zzz> you have to assume the inscriptions are truthful
2021-10-15 19:53:55 +0200 <zzz> if you don't, the portrait can be in either casket
2021-10-15 19:54:41 +0200 <monochrom> Perhaps [1] contains the detailed assumptions.
2021-10-15 19:56:11 +0200zincy(~tom@2a00:23c8:970c:4801:f4b9:dbfb:6f14:3bca)
2021-10-15 19:57:21 +0200 <zincy> If you have two lists how would you join them into a map where keys are elem of list A and members are elems of list B?
2021-10-15 19:57:42 +0200ec(~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
2021-10-15 19:57:56 +0200 <monochrom> zip?
2021-10-15 19:57:57 +0200 <ski> which key corresponds to which member ?
2021-10-15 19:58:35 +0200 <zincy> So the map keys would be members of list A
2021-10-15 19:58:49 +0200 <zincy> where values of the map are related members of list B
2021-10-15 19:58:49 +0200 <zzz> monochrom: ah yes
2021-10-15 19:58:49 +0200 <ski> you said that, yes
2021-10-15 19:58:56 +0200 <ski> related, how ?
2021-10-15 19:59:17 +0200 <zincy> one field in the product type == another field by another name in the other product type
2021-10-15 19:59:34 +0200 <zincy> Both fields are Int
2021-10-15 20:00:00 +0200 <ski> dunno how these fields and product types are related to your two lists
2021-10-15 20:00:29 +0200 <zincy> Sorry I am being really unclear
2021-10-15 20:00:48 +0200 <zincy> I'll have a play and come back here
2021-10-15 20:01:18 +0200 <monochrom> zzz: OK, as with the angel-demon puzzle, the assumption is "a statement is either knowingly honest or knowingly lying".
2021-10-15 20:02:12 +0200ec(~ec@gateway/tor-sasl/ec)
2021-10-15 20:03:16 +0200 <monochrom> Actually, it can be weakened to "either true or false".
2021-10-15 20:04:19 +0200 <tomsmeding> are you now rejecting intuitionism right there?
2021-10-15 20:04:27 +0200 <monochrom> heh
2021-10-15 20:04:38 +0200 <Franciman> what wiki software does haskellwiki use?
2021-10-15 20:05:11 +0200neurocyte0132889(~neurocyte@user/neurocyte) (Ping timeout: 264 seconds)
2021-10-15 20:05:16 +0200emliunix(~user@101.88.126.148)
2021-10-15 20:05:30 +0200 <Franciman> looks like mediawiki
2021-10-15 20:05:41 +0200 <Franciman> but I am not able to find any pointer
2021-10-15 20:05:53 +0200ski. o O ( hawiki was MoinMoin )
2021-10-15 20:06:23 +0200 <Franciman> oh indeed it is mediawiki
2021-10-15 20:06:27 +0200 <Franciman> https://github.com/haskell/haskell-wiki-configuration found here
2021-10-15 20:06:27 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
2021-10-15 20:06:30 +0200 <Franciman> thanks ski!
2021-10-15 20:06:32 +0200 <monochrom> Nah, it is a contrapositive way to say: if you don't assume classical logic, then yeah the statements don't let you draw conclusions.
2021-10-15 20:07:23 +0200 <Franciman> moin moin looks nice for my language aiming to replace haskell
2021-10-15 20:07:31 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
2021-10-15 20:07:31 +0200 <Franciman> for my personal use
2021-10-15 20:07:33 +0200 <Franciman> I mean
2021-10-15 20:09:00 +0200 <zzz> monochrom: yes we are assuming the inscriptions are consistent
2021-10-15 20:09:11 +0200 <ski> @quote replace
2021-10-15 20:09:12 +0200 <lambdabot> yottis says: i thought there were like 10 haskell jobs in the world, all in the "let's replace excel sheets with something else" industry < kalven> there are at least 20
2021-10-15 20:12:57 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-10-15 20:13:19 +0200rond_(~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438)
2021-10-15 20:13:32 +0200tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-10-15 20:20:31 +0200 <zwro[m]> if we have a logic that is sound and we establish that an argument is only valid if derivable, does it necessary follow that we can derive all truths?
2021-10-15 20:20:38 +0200markusde(~makrus@206.12.14.188)
2021-10-15 20:20:42 +0200favonia(~favonia@user/favonia)
2021-10-15 20:21:43 +0200 <monochrom> Yes.
2021-10-15 20:21:46 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Ping timeout: 252 seconds)
2021-10-15 20:22:16 +0200gehmehgeh(~user@user/gehmehgeh)
2021-10-15 20:22:34 +0200emliunix(~user@101.88.126.148) (Quit: ERC (IRC client for Emacs 28.0.50))
2021-10-15 20:23:23 +0200 <markusde> Conduit newbie here- docs say that it's "downstream driven", but one of the middle stages in my conduit is slow. Is there a way to make sure that the conduit won't close until all of my input data (finite, file) is processed?
2021-10-15 20:23:55 +0200 <markusde> Or will a different library be better suited for this
2021-10-15 20:24:10 +0200rond_(~rond_@2a02:a31a:a23c:f480:2fd7:e087:5546:a438) (Quit: Client closed)
2021-10-15 20:24:12 +0200 <c_wraith> "downstream driven" (or more usually, "pull-based") just means that things happen when they are requested by the last steps in the pipeline
2021-10-15 20:24:31 +0200 <c_wraith> As opposed to happening when the first step in the pipeline generates data
2021-10-15 20:25:12 +0200 <zwro[m]> that's what tickles me. i think there is a possible alternative interpretation to "arguments are only valid of derivable" but i can't quite explain it
2021-10-15 20:25:41 +0200 <c_wraith> So... as long as your last step is to consume all the input, the upstream stuff will produce all the output to feed it.
2021-10-15 20:25:45 +0200 <tomsmeding> zwro[m]: what do you mean with "argument"?
2021-10-15 20:26:16 +0200 <markusde> c_wraith: I think I see. So I need to do something like generate Maybe data, and have my downstream continue asking for data when it's Just, or stop asking when there's Nothing?
2021-10-15 20:26:33 +0200 <markusde> c_wraith: (ie. the downstream has to decide when the file is done being processed)
2021-10-15 20:26:58 +0200 <c_wraith> markusde: well, the upstream can signal that it's out of data.
2021-10-15 20:27:02 +0200 <zwro[m]> tomsmeding: as in formal deductible?
2021-10-15 20:27:18 +0200 <tomsmeding> zwro[m]: isn't that the same as "derivable"?
2021-10-15 20:27:22 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 20:27:35 +0200 <c_wraith> markusde: the important thing is that the pipeline operates when something is requested.
2021-10-15 20:27:36 +0200 <monochrom> I suppose "argument" and "valid" can all be vague.
2021-10-15 20:28:23 +0200 <markusde> c_wraith: Okay cool, I get it now. Last question- is there a cannoncial way to do this in the library anywhere?
2021-10-15 20:28:44 +0200 <tomsmeding> zwro[m]: in my understanding (but I'm not a logician), a logic (also called a theory) gives a set of symbols etc and a set of assumptions and deduction rules. A theory has a set of statements that are provable.
2021-10-15 20:29:15 +0200 <tomsmeding> Then you can have a _model_ of that theory, and a model has a set of statements that are _true_
2021-10-15 20:29:28 +0200 <c_wraith> markusde: to do which? process the entirety of something? That should just be what happens by default unless you have a step that intentionally terminates early
2021-10-15 20:29:36 +0200 <tomsmeding> and then you can prove that a theory is sound and/or complete or not for a model
2021-10-15 20:29:53 +0200 <tomsmeding> but I may be conflating set theory and logic here :D
2021-10-15 20:30:24 +0200 <tomsmeding> my point being: you can't answer your question without first pinning down exactly what the words in the question mean
2021-10-15 20:31:00 +0200 <tomsmeding> actually I'm fairly sure I'm conflating set theory and logic, so take my model stuff with a large grain of sale
2021-10-15 20:31:01 +0200 <tomsmeding> *salt
2021-10-15 20:31:12 +0200 <zwro[m]> i never really studied logic
2021-10-15 20:31:13 +0200 <zwro[m]> :(
2021-10-15 20:31:29 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:d886:e076:3ba:7fac)
2021-10-15 20:31:30 +0200 <tomsmeding> I took a course like 4 years ago lol
2021-10-15 20:31:35 +0200 <tomsmeding> and that was set theory actually
2021-10-15 20:31:40 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
2021-10-15 20:31:41 +0200 <zwro[m]> is classical logic both consistent and complete?
2021-10-15 20:31:53 +0200 <monochrom> Yes.
2021-10-15 20:32:19 +0200 <tomsmeding> Gödel's First Incompleteness Theorem: "Any consistent formal system F within which a certain amount of elementary arithmetic can be carried out is incomplete; i.e., there are statements of the language of F which can neither be proved nor disproved in F."
2021-10-15 20:33:01 +0200 <c_wraith> classic propositional logic is consistent and complete. That word "propositional" is important.
2021-10-15 20:33:04 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 20:33:11 +0200 <markusde> c_wraith: oh- right lol. Thanks for the help, I'm sure the rest will make sence when I have some actual code
2021-10-15 20:33:13 +0200 <monochrom> No one mentions Gödel's first completeness theorem any more :( >:)
2021-10-15 20:33:22 +0200 <c_wraith> I was about to!
2021-10-15 20:33:22 +0200 <tomsmeding> c_wraith: right
2021-10-15 20:33:42 +0200 <c_wraith> first-order logic is also complete and consistent. that was Goedel's completeness theorem.
2021-10-15 20:33:46 +0200 <monochrom> It still works if you s/propositional/first-order/
2021-10-15 20:33:54 +0200 <Franciman> is there a second completeness theorem too?
2021-10-15 20:34:13 +0200 <monochrom> I don't know :)
2021-10-15 20:34:21 +0200 <Franciman> sad
2021-10-15 20:34:31 +0200 <zwro[m]> sometimes there's a zeroth
2021-10-15 20:34:37 +0200 <zwro[m]> keep your hopes up
2021-10-15 20:35:03 +0200 <Franciman> what do you think about this proposal? https://mail.haskell.org/pipermail/libraries/2021-October/031454.html ?
2021-10-15 20:35:13 +0200 <Franciman> making read deprecated
2021-10-15 20:35:30 +0200 <Franciman> oh wait, that's the answer to the proposal
2021-10-15 20:35:37 +0200 <Inst> hi
2021-10-15 20:35:39 +0200 <Franciman> not sure I understand that answer, tho
2021-10-15 20:35:40 +0200 <Inst> if i want a haskell textbook
2021-10-15 20:35:45 +0200 <Franciman> https://mail.haskell.org/pipermail/libraries/2021-October/031453.html
2021-10-15 20:35:46 +0200 <Inst> for a non-programmer / fisrt language
2021-10-15 20:35:51 +0200 <Inst> what would be the best textbook?
2021-10-15 20:35:56 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:d886:e076:3ba:7fac) (Ping timeout: 245 seconds)
2021-10-15 20:36:13 +0200 <monochrom> I understand "NOPE", especially given the all-caps.
2021-10-15 20:36:29 +0200 <Franciman> heh
2021-10-15 20:36:36 +0200 <Franciman> I also understand it as a bit of a rude
2021-10-15 20:36:38 +0200 <Franciman> but I am not native
2021-10-15 20:36:41 +0200 <Franciman> I may lose a lot of context
2021-10-15 20:37:01 +0200 <monochrom> It may be rude but I support rudeness in this case, it is justified.
2021-10-15 20:37:07 +0200 <Franciman> can I ask why?
2021-10-15 20:37:19 +0200 <Franciman> it's becaus ethe proposal is not well argumented?
2021-10-15 20:37:21 +0200 <zwro[m]> Inst: learn you a haskell for a great good is usually beginner friendly
2021-10-15 20:37:39 +0200 <Inst> yeah, i'm already working on the web version of it
2021-10-15 20:37:40 +0200 <geekosaur> I think some important distinctions were made a bit after the original proposal, such as marking it deprecated with readMaybe moved to Prelude and leaving it in that state for 10+ years instead of just removing it after 2 ghc releases or so as would normally be meant by "deprecation"
2021-10-15 20:37:56 +0200 <monochrom> Political correctness do-gooders thinking that time is well spent on tiny little matters like "read is bad", "head is bad" deserve to be given a blunt and direct "NOPE".
2021-10-15 20:38:19 +0200 <zwro[m]> Inst: https://www.haskellfromtheverybeginning.com/ this one also
2021-10-15 20:38:33 +0200 <geekosaur> @where books
2021-10-15 20:38:33 +0200 <lambdabot> https://www.extrema.is/articles/haskell-books, see also @where LYAH, RWH, YAHT, SOE, HR, PIH, TFwH, wikibook, PCPH, HPFFP, HTAC, TwT, FoP, PFAD, WYAH, non-haskell-books
2021-10-15 20:38:38 +0200 <Inst> Any ratings of "Programming in Haskell"?
2021-10-15 20:38:38 +0200 <geekosaur> take your pick
2021-10-15 20:38:39 +0200ec(~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
2021-10-15 20:39:19 +0200markusde(~makrus@206.12.14.188) (Remote host closed the connection)
2021-10-15 20:39:35 +0200 <Franciman> lol monochrom sure
2021-10-15 20:39:36 +0200 <geekosaur> Hutton (PiH) is generally quite good
2021-10-15 20:39:36 +0200 <Franciman> why not
2021-10-15 20:40:16 +0200 <Franciman> thank you for letting us know what is important and what's not
2021-10-15 20:40:19 +0200 <Franciman> :)
2021-10-15 20:40:20 +0200 <geekosaur> even though we kinda hosed him by making a bunch of changes right after he'd released his second edition
2021-10-15 20:40:47 +0200 <geekosaur> (I think AMP and FTP landed right after he released?)
2021-10-15 20:41:02 +0200 <awpr> free excuse for a third edition to make even more money? sounds like a win to me
2021-10-15 20:41:26 +0200 <unit73e> I feel like the basics are relatively easy
2021-10-15 20:41:40 +0200 <geekosaur> if only it were that simple (or cheap)
2021-10-15 20:41:51 +0200 <monochrom> I think PiH2 has got AMP. Let me check again.
2021-10-15 20:42:00 +0200 <unit73e> to me it was harder to truly understand monads and all the friends
2021-10-15 20:42:21 +0200 <Franciman> long live the haskell foundation
2021-10-15 20:42:26 +0200 <awpr> hmm, hadn't considered publication costs
2021-10-15 20:42:27 +0200 <unit73e> it's best just to use monads and later figure out why those work like that
2021-10-15 20:42:31 +0200 <unit73e> at least that worked for me
2021-10-15 20:42:40 +0200favonia(~favonia@user/favonia) (Ping timeout: 252 seconds)
2021-10-15 20:42:42 +0200 <Franciman> fork and fork hard
2021-10-15 20:42:52 +0200 <unit73e> otherwise it just doesn't work, specially with crappy metaphors
2021-10-15 20:43:08 +0200 <monochrom> Yeah he has got AMP.
2021-10-15 20:43:32 +0200vladomiro(~vladomiro@2806:106e:23:c05a:523e:aaff:feb9:bb5c) (Quit: Leaving)
2021-10-15 20:43:34 +0200 <Inst> grrr, i wish i could go through all the textbooks
2021-10-15 20:43:45 +0200 <unit73e> much better to get "NOPE" from the compiler and figure out why :P
2021-10-15 20:44:12 +0200 <unit73e> shouldn't the wokes complain about GHC rudeness?
2021-10-15 20:44:23 +0200 <monochrom> What is FTP again? Is it just having Foldable, Travserable, and for example foldl and foldr works for all Foldable? He has got those, too.
2021-10-15 20:44:47 +0200 <geekosaur> yeh, essentially
2021-10-15 20:45:07 +0200ec(~ec@gateway/tor-sasl/ec)
2021-10-15 20:45:14 +0200 <geekosaur> hm, maybe it was just before release and it was alll the last minute changes that hosed him
2021-10-15 20:45:38 +0200cfricke(~cfricke@user/cfricke)
2021-10-15 20:46:18 +0200 <monochrom> Franciman: Yes, it is very important that I speak up and say, at least, what I think is unimportant and not even worth more time than a simple "NOPE".
2021-10-15 20:46:46 +0200 <geekosaur> I do recall we got a very grumpy letter to -cafe about it
2021-10-15 20:47:12 +0200 <monochrom> You see, the irony is that "no one should ever tell each other what's important" is not how we find out what's important.
2021-10-15 20:47:22 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-15 20:47:50 +0200fluffyballoon(~user@131.93.208.196) (Ping timeout: 246 seconds)
2021-10-15 20:47:52 +0200 <Franciman> I fail to see your point
2021-10-15 20:48:03 +0200 <monochrom> Instead, we must all be brave to speak up "here is what I think is important" and only then can we collect statistics to find out what's the consensus.
2021-10-15 20:48:20 +0200 <Franciman> I didn't say you should not say what's important
2021-10-15 20:48:43 +0200 <monochrom> OK, so explain what you mean by <Franciman> thank you for letting us know what is important and what's not
2021-10-15 20:48:54 +0200 <Franciman> I mean
2021-10-15 20:48:54 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Remote host closed the connection)
2021-10-15 20:49:03 +0200 <Franciman> you said that saying read is bad is a tiny matter
2021-10-15 20:49:15 +0200 <Franciman> I said thanks for clarifying that
2021-10-15 20:49:38 +0200 <monochrom> Or you used sarcasm.
2021-10-15 20:49:47 +0200 <Franciman> nope
2021-10-15 20:49:55 +0200 <Franciman> I used sarcasm when I said I didn't understand that answer
2021-10-15 20:50:01 +0200 <monochrom> See, if you s/us/me/ I would not take it as sarcasm.
2021-10-15 20:50:41 +0200 <Franciman> I see
2021-10-15 20:50:50 +0200 <Franciman> no I was not sarcastic
2021-10-15 20:51:19 +0200 <monochrom> And your track record.
2021-10-15 20:51:27 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Remote host closed the connection)
2021-10-15 20:51:40 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:78df:ce33:6c9c:5cc0)
2021-10-15 20:51:45 +0200 <monochrom> Not too long ago you spent so much time asserting that a few people acted as dictators.
2021-10-15 20:52:05 +0200 <Franciman> yes
2021-10-15 20:52:07 +0200 <Franciman> I recall
2021-10-15 20:52:15 +0200 <Franciman> and I also recall saying I was sorry
2021-10-15 20:52:19 +0200 <Franciman> I overreacted
2021-10-15 20:52:28 +0200 <Franciman> now if you believe I can't change
2021-10-15 20:52:39 +0200 <Franciman> that's ok
2021-10-15 20:52:59 +0200 <Franciman> in fact my initial question is what do you think about the proposal
2021-10-15 20:53:03 +0200 <Franciman> not about the answer
2021-10-15 20:53:37 +0200 <monochrom> OK I see now.
2021-10-15 20:54:46 +0200 <monochrom> I use "read" in contexts of "x <- read <$> some digits" in parsers. I will need it.
2021-10-15 20:55:15 +0200 <monochrom> I might not like even "deprecate after 10 years".
2021-10-15 20:55:58 +0200 <monochrom> If it were really removed, I would just be "x <- fromJust . readMaybe <$> some digits".
2021-10-15 20:56:11 +0200 <geekosaur> "leave around forever" was also posed as an option
2021-10-15 20:56:31 +0200 <tomsmeding> then it's not deprecation, it's "advise not to use"
2021-10-15 20:56:38 +0200 <Franciman> I like the idea of having readMaybe in the prelude, tbh
2021-10-15 20:56:39 +0200 <monochrom> This is why I said "political correctness do-gooders".
2021-10-15 20:56:44 +0200 <geekosaur> yes, but deprecation is the mechanism we have
2021-10-15 20:56:45 +0200 <zzz> we should remove fromJust
2021-10-15 20:56:48 +0200 <Franciman> indipendently of what read has
2021-10-15 20:56:52 +0200 <Franciman> as its faith
2021-10-15 20:56:54 +0200 <monochrom> Oh, readMaybe is a godsent, too.
2021-10-15 20:57:40 +0200 <geekosaur> and I'm not sure an ADVISE pragma belongs in ghc
2021-10-15 20:57:58 +0200 <Franciman> readEither seems strange, as pointed in the ML thread, because there would be no error message
2021-10-15 20:58:03 +0200 <geekosaur> (as opposed to, say, hlint)
2021-10-15 20:58:07 +0200 <monochrom> I painstakingly wrote http://www.vex.net/~trebla/haskell/reads.xhtml because readMaybe did not exist. Using reads is very annoying, even after my explanation. readMaybe is objectively simpler and more direct.
2021-10-15 20:58:34 +0200 <monochrom> But if I have "some digits" then "read" is the correct solution.
2021-10-15 20:59:03 +0200 <Franciman> would you like to have read redefined as `read = fromJust . readMaybe` ?
2021-10-15 20:59:13 +0200 <Franciman> and readMaybe as the only element of Read typeclass
2021-10-15 20:59:23 +0200 <monochrom> hlint is too dumb to discern good uses vs bad uses of read, or generally good code vs bad code.
2021-10-15 20:59:49 +0200 <Franciman> also I like the idea of the documentation being consistent vs having to use an external tool to get these info
2021-10-15 21:00:05 +0200 <monochrom> read is not an element of Read in the first place.
2021-10-15 21:00:10 +0200 <monochrom> even reads is not.
2021-10-15 21:00:14 +0200 <Franciman> oh is it not?
2021-10-15 21:00:49 +0200 <tomsmeding> interesting, that's asymmetric with Show
2021-10-15 21:01:10 +0200 <tomsmeding> (not sure that it matters really though)
2021-10-15 21:01:52 +0200 <Franciman> interesting that we have readEither in the stdlib
2021-10-15 21:02:00 +0200 <Franciman> and readMaybe too!
2021-10-15 21:02:03 +0200 <Franciman> but not in prelude
2021-10-15 21:04:21 +0200alx741(~alx741@181.196.68.37)
2021-10-15 21:05:43 +0200geekosauragrees that readEither is a lie and should probably be removed
2021-10-15 21:06:00 +0200 <Franciman> +1
2021-10-15 21:06:32 +0200 <tomsmeding> there's only two possible errors?
2021-10-15 21:06:50 +0200 <tomsmeding> should've made a datatype for that, data ReadError = NoParse | AmbiguousParse
2021-10-15 21:06:53 +0200 <geekosaur> and readEither reports none of them
2021-10-15 21:07:30 +0200 <tomsmeding> it does, right? in String form, which is not useful
2021-10-15 21:07:33 +0200 <awpr> > readEither @Bool "NotTrue"
2021-10-15 21:07:35 +0200 <lambdabot> error:
2021-10-15 21:07:35 +0200 <lambdabot> Pattern syntax in expression context: readEither@Bool
2021-10-15 21:07:35 +0200 <lambdabot> Did you mean to enable TypeApplications?
2021-10-15 21:07:50 +0200 <tomsmeding> % readEither @Bool "NotTrue"
2021-10-15 21:07:50 +0200 <yahb> tomsmeding: ; <interactive>:88:1: error:; * Variable not in scope: readEither :: String %t0 -> t; * Perhaps you meant one of these: `readLitChar' (imported from Data.Char), `M.mapEither' (imported from Data.Map), `IM.mapEither' (imported from Data.IntMap)
2021-10-15 21:07:59 +0200 <tomsmeding> % import Text.Read
2021-10-15 21:07:59 +0200 <yahb> tomsmeding:
2021-10-15 21:08:01 +0200 <tomsmeding> % readEither @Bool "NotTrue"
2021-10-15 21:08:01 +0200 <yahb> tomsmeding: Left "Prelude.read: no parse"
2021-10-15 21:08:05 +0200 <monochrom> I don't think the ambiguity allowed by [(a,String)] has ever been actually used.
2021-10-15 21:08:12 +0200 <geekosaur> hm, maybe it does
2021-10-15 21:09:12 +0200ec(~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
2021-10-15 21:14:13 +0200o1lo01ol1o(~o1lo01ol1@2001:8a0:6d7a:df01:78df:ce33:6c9c:5cc0) (Remote host closed the connection)
2021-10-15 21:16:29 +0200ec(~ec@gateway/tor-sasl/ec)
2021-10-15 21:20:05 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
2021-10-15 21:23:54 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
2021-10-15 21:24:23 +0200emf(~emf@2620:10d:c090:400::5:57e9) (Quit: emf)
2021-10-15 21:25:06 +0200defanor_defanor
2021-10-15 21:27:23 +0200zzzonion
2021-10-15 21:30:44 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Remote host closed the connection)
2021-10-15 21:32:36 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 245 seconds)
2021-10-15 21:33:00 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 21:34:47 +0200DNH(~DNH@2a02:8108:1100:16d8:31ac:ed04:1cbf:a354) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-10-15 21:36:42 +0200mei6(~mei@user/mei) (Quit: mei6)
2021-10-15 21:37:35 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-15 21:38:47 +0200cfricke(~cfricke@user/cfricke) (Ping timeout: 264 seconds)
2021-10-15 21:39:44 +0200lavaman(~lavaman@98.38.249.169)
2021-10-15 21:39:45 +0200ec(~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
2021-10-15 21:40:28 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 21:40:28 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 21:40:28 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 21:42:11 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 21:44:11 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
2021-10-15 21:46:17 +0200 <dolio> Right, the instances in base don't have ambiguous parses. That doesn't mean no type could possibly have an ambiguou parse.
2021-10-15 21:46:52 +0200 <dolio> Also derived instances won't have ambiguous parses, I think.
2021-10-15 21:47:22 +0200ec(~ec@gateway/tor-sasl/ec)
2021-10-15 21:51:12 +0200cfricke(~cfricke@user/cfricke)
2021-10-15 21:52:28 +0200 <dolio> Ambiguity in `ReadS` is probably necessary to properly handle intermediate states of the parse, rather than full parses. I.E. there might be multiple incomplete parses that are eventually resolved to a single full parse.
2021-10-15 21:54:08 +0200 <dolio> But the first incomplete parse isn't necessarily the one that gets completed, so you can't use Maybe.
2021-10-15 21:54:37 +0200 <tomsmeding> perhaps the intermediate state after parsing "(" when parsing a value of tuple type? Could be the tuple, could be a normal parenthesis
2021-10-15 21:57:23 +0200hyiltiz(~quassel@31.220.5.250) (Ping timeout: 264 seconds)
2021-10-15 21:58:12 +0200 <dolio> I don't have a specific example, but it's a common occurrence during parsing. It's what `try` is for in parsec.
2021-10-15 21:59:48 +0200hyiltiz(~quassel@31.220.5.250)
2021-10-15 22:00:06 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 245 seconds)
2021-10-15 22:00:19 +0200 <dolio> If you don't want to use it, you have to factor your grammar a lot.
2021-10-15 22:01:03 +0200 <ski> monochrom : that doesn't mention `ReadS', nor use list comprehensions (nor `lex' to remove trailing whitespace) :/
2021-10-15 22:01:53 +0200 <dolio> And I think you basically can't factor the grammar in `Read` by its very nature.
2021-10-15 22:04:23 +0200hyiltiz(~quassel@31.220.5.250) (Ping timeout: 265 seconds)
2021-10-15 22:05:08 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-15 22:05:21 +0200juhp(~juhp@128.106.188.220) (Ping timeout: 265 seconds)
2021-10-15 22:06:44 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 22:06:44 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 22:06:44 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 22:07:45 +0200juhp(~juhp@128.106.188.220)
2021-10-15 22:08:11 +0200ubert(~Thunderbi@178.165.181.201.wireless.dyn.drei.com)
2021-10-15 22:09:52 +0200OxDEADBEEF(~asdf@ip-64-72-99-234.lasvegas.net) (Quit: Leaving)
2021-10-15 22:12:10 +0200kjak(~kjak@pool-108-45-56-21.washdc.fios.verizon.net)
2021-10-15 22:12:11 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
2021-10-15 22:15:56 +0200 <dsal> I'm trying to use generic deriving for a monoid, but the compiler is warning that I forgot <> and stuff. Is there more to this than -XDeriveGeneric, derive (Generic), and `instance Semigroup X` ?
2021-10-15 22:19:47 +0200hyiltiz(~quassel@31.220.5.250)
2021-10-15 22:27:02 +0200kritzefitz[m](~m-eem4n6@212.86.56.80)
2021-10-15 22:27:47 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-15 22:28:17 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-15 22:28:32 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2021-10-15 22:28:32 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Client Quit)
2021-10-15 22:29:25 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-15 22:30:53 +0200wootehfoot(~wootehfoo@user/wootehfoot)
2021-10-15 22:30:53 +0200aegon(~mike@174.127.249.180)
2021-10-15 22:31:03 +0200DNH(~DNH@2a02:8108:1100:16d8:547f:5c76:6b1:9692)
2021-10-15 22:31:09 +0200jgeerds(~jgeerds@55d4da80.access.ecotel.net)
2021-10-15 22:31:19 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
2021-10-15 22:31:30 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-15 22:31:30 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-15 22:31:30 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 22:35:31 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Ping timeout: 245 seconds)
2021-10-15 22:36:59 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 264 seconds)
2021-10-15 22:37:02 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
2021-10-15 22:38:09 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Remote host closed the connection)
2021-10-15 22:40:22 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
2021-10-15 22:40:33 +0200 <[exa]> dsal: wasn't DeriveAnyClass needed for this?
2021-10-15 22:40:46 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 22:41:04 +0200 <[exa]> also check if you get all prerequisities for deriving, e.g. if type parameters need to be semigroups or so
2021-10-15 22:41:06 +0200Cajun(~Cajun@user/cajun)
2021-10-15 22:41:08 +0200 <awpr> neither of those will do anything meaningful if Semigroup doesn't provide a default implementation based on Generic
2021-10-15 22:41:23 +0200 <[exa]> it doesn't?
2021-10-15 22:41:45 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 265 seconds)
2021-10-15 22:42:38 +0200 <[exa]> :<
2021-10-15 22:42:49 +0200 <awpr> https://hackage.haskell.org/package/wrapped-0.1.0.1/docs/Data-Wrapped.html#t:Wrapped provides that kind of instance to be used with `DerivingVia` like `data X = ... deriving Semigroup via Wrapped Generic X`
2021-10-15 22:42:52 +0200 <dolio> DeriveAnyClass just lets you add `C` to the deriving clause instead of writing `instance C T`.
2021-10-15 22:43:05 +0200 <awpr> but there are surely other implementations somewhere on Hackage
2021-10-15 22:43:06 +0200 <dsal> My members are all either `Set Text` or `[Text]`
2021-10-15 22:43:09 +0200kritzefitz(~kritzefit@picard.host.weltraumschlangen.de) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
2021-10-15 22:43:21 +0200kritzefitz[m]kritzefitz
2021-10-15 22:43:22 +0200 <dsal> deriving-generic claims to have support, but it just didn't go.
2021-10-15 22:45:01 +0200emf(~emf@2620:10d:c090:400::5:35f6)
2021-10-15 22:45:09 +0200 <awpr> DeriveGeneric doesn't make other classes have default implementations, it just provides the Generic instance. it's still up to someone else to write the methods against the Generic form, and up to you to get them into the instance somehow
2021-10-15 22:45:47 +0200 <awpr> can choose "someone" = `wrapped` and "somehow" = `DerivingVia`, for example
2021-10-15 22:46:29 +0200 <dsal> I've not paid much attention, usually just using generic deriving with stuff like JSON and not having to do a via or anything.
2021-10-15 22:46:53 +0200 <awpr> if an empty instance decl works, it's because the class intentionally provided a default implementation
2021-10-15 22:47:02 +0200 <geekosaur> right, JSON has a default implementation usinbg Generics. Semigroup doesn't
2021-10-15 22:47:39 +0200 <geekosaur> but someone needs to provide that default impl and it has to use Generics
2021-10-15 22:47:53 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds)
2021-10-15 22:47:54 +0200 <awpr> without a default implementation, it's down to either manually writing an instance with something like `(<>) = genericSAppend` or adopting an instance with DerivingVia
2021-10-15 22:48:06 +0200 <geekosaur> otherwise deriving Generic does nothing but take time
2021-10-15 22:48:25 +0200 <dsal> Ah. I just thought that was magic that generic-deriving would conjure up.
2021-10-15 22:48:27 +0200unmanbearpig(~unmanbear@user/unmanbearpig) (Ping timeout: 250 seconds)
2021-10-15 22:48:37 +0200wroathe(~wroathe@50-205-197-50-static.hfc.comcastbusiness.net)
2021-10-15 22:48:37 +0200wroathe(~wroathe@50-205-197-50-static.hfc.comcastbusiness.net) (Changing host)
2021-10-15 22:48:37 +0200wroathe(~wroathe@user/wroathe)
2021-10-15 22:48:44 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-10-15 22:51:54 +0200 <dsal> Hopefully I can delete this manual instance because it's kind of gross.
2021-10-15 22:52:27 +0200 <geekosaur> wait until you see the code Generics comes up with >:)
2021-10-15 22:52:42 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Remote host closed the connection)
2021-10-15 22:52:46 +0200 <dsal> Oh, I'm sure that's bad. I just don't want all this junk in a stupid test thing where I'm just trying to flatten and collect some fields.
2021-10-15 22:52:52 +0200 <awpr> the most convenient thing I'm aware of is `deriving Semigroup via Wrapped Generic X` from `wrapped`
2021-10-15 22:52:55 +0200 <monochrom> ski: ReadS is a type alias, so, not mandatory :)
2021-10-15 22:52:57 +0200 <Franciman> Generics :')
2021-10-15 22:54:02 +0200 <awpr> it should be able to generate perfectly fine code for Semigroup of moderate-sized records. it's only when things get too big for the inliner that it summons cthulhu
2021-10-15 22:59:29 +0200machinedgod(~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 265 seconds)
2021-10-15 23:02:23 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-10-15 23:02:24 +0200kritzefitz_(~kritzefit@picard.host.weltraumschlangen.de)
2021-10-15 23:04:38 +0200kritzefitz(~m-eem4n6@212.86.56.80) (Remote host closed the connection)
2021-10-15 23:04:38 +0200kritzefitz_kritzefitz
2021-10-15 23:04:46 +0200kritzefitz_(~kritzefit@212.86.56.80)
2021-10-15 23:04:55 +0200kritzefitzkritzefitz__
2021-10-15 23:04:58 +0200kritzefitz_kritzefitz
2021-10-15 23:06:32 +0200 <dsal> Ick, I can't figure out how to use the generics here. I don't have `wrapped` and trying to hack these instances into place with the supplied defaults is a recursive nightmare.
2021-10-15 23:07:28 +0200kritzefitz__(~kritzefit@picard.host.weltraumschlangen.de) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in)
2021-10-15 23:07:46 +0200 <dsal> Pages of code because someone decided nobody will ever be able to read `logs ^.. folded . logData . _Just . key "formatted" . _String`
2021-10-15 23:08:11 +0200emf(~emf@2620:10d:c090:400::5:35f6) (Quit: emf)
2021-10-15 23:08:27 +0200 <awpr> I don't understand. what supplied defaults? are you trying to write your own implementation of Generics-based Semigroup instances?
2021-10-15 23:09:04 +0200 <dsal> Yeah, the generic-deriving stuff just has `class GSemigroup a => GMonoid a where` and a default implementation of that.
2021-10-15 23:09:27 +0200 <dsal> I don't have `wrapped` so I can't use that directly for the deriving via, so I'd have to reinvent it or something.
2021-10-15 23:09:54 +0200 <dsal> There's no yak to be found here. None of this related to what I set out to do.
2021-10-15 23:10:02 +0200 <awpr> sounds like `instance Semigroup X where (<>) = gsappend` should do it?
2021-10-15 23:10:37 +0200 <monochrom> Today is automatic instance derivation day :(
2021-10-15 23:10:42 +0200 <awpr> oh, that wants GSemigroup instances for the whole transitive closure of everything :(
2021-10-15 23:11:33 +0200 <dsal> Yeah, that's about as far as I got.
2021-10-15 23:11:33 +0200 <awpr> "It is worth emphasizing that these modules are primarly intended for educational purposes"
2021-10-15 23:11:34 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
2021-10-15 23:11:37 +0200 <dsal> haha
2021-10-15 23:11:42 +0200 <dsal> I guess I learned something today,.
2021-10-15 23:12:09 +0200shailangsa(~shailangs@host217-39-45-200.range217-39.btcentralplus.com) ()
2021-10-15 23:12:41 +0200 <dsal> This seemed like the dumbest easiest thing. I've got a record full of monoids. Monoid me.
2021-10-15 23:12:42 +0200 <awpr> if you can't depend on `wrapped` for whatever reason, it sounds like the easiest way is just to write the instance. unless you're lucky with all the fields already having `GSemigroup`
2021-10-15 23:13:29 +0200 <dsal> I'd already written the instances just to see if the idea would even work. They just seem very mechanical.
2021-10-15 23:13:50 +0200 <awpr> yeah, it is pretty easy. check out the implementation in `wrapped`, it's like 10 lines
2021-10-15 23:14:16 +0200 <dsal> It's just `a <> b = foreachfield $\f -> on (<>) f a b` ish
2021-10-15 23:14:41 +0200 <awpr> yeah, it's just that spelled out in the language of GHC.Generics
2021-10-15 23:15:25 +0200 <awpr> only reason it's turning out to be hard is the inability to depend on the implementation that makes it easy :)
2021-10-15 23:15:50 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 23:15:51 +0200_ht(~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-10-15 23:16:36 +0200 <awpr> which I still don't actually understand, are there some strict rules about dependencies you have to follow? even in the test suite?
2021-10-15 23:16:38 +0200 <dsal> I'll just complain about that in my implementation. Actually, I should verify I understand the mechanism first.
2021-10-15 23:16:50 +0200 <dsal> Well, apparently nothing related to lens is a new strict rule today.
2021-10-15 23:17:02 +0200 <dsal> But `wrapped` isn't available because of how packages come in.
2021-10-15 23:17:22 +0200 <dsal> It's an older nix snapshot or something and not worth updating for just this test.
2021-10-15 23:17:28 +0200 <dsal> Which was fine with microlens.
2021-10-15 23:19:58 +0200 <sshine> first hacktoberfest PR, and I'm running into some obscure code that fails because of aeson's KeyMap.
2021-10-15 23:20:18 +0200 <geekosaur> aeson 2 by any chance?
2021-10-15 23:20:28 +0200 <sshine> yup :P
2021-10-15 23:20:39 +0200 <geekosaur> can you just tell it to use an older version?
2021-10-15 23:20:45 +0200 <sshine> yeah.
2021-10-15 23:21:04 +0200 <dsal> Yeah, this is also super annoying. I'm going to have to change this code upon aeson upgrade because it's specific to hashmap instead of just like, ix.
2021-10-15 23:21:05 +0200zebrag(~chris@user/zebrag) (Ping timeout: 264 seconds)
2021-10-15 23:21:14 +0200 <geekosaur> otherwise, I understand the changes are supposed to be fairly simple
2021-10-15 23:21:34 +0200 <geekosaur> justr annoying
2021-10-15 23:21:48 +0200 <sshine> yup. this person just decided to make their own Value-traversing functions.
2021-10-15 23:22:50 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Ping timeout: 265 seconds)
2021-10-15 23:24:21 +0200kritzefitz(~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-10-15 23:24:22 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2021-10-15 23:24:57 +0200kritzefitz(~kritzefit@212.86.56.80)
2021-10-15 23:25:51 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2021-10-15 23:25:57 +0200Player001(~Player001@user/player001) (Quit: Quitting)
2021-10-15 23:26:20 +0200Player001(~Player001@user/player001)
2021-10-15 23:26:26 +0200kritzefitz(~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-10-15 23:27:03 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds)
2021-10-15 23:27:11 +0200Lord_of_Life_Lord_of_Life
2021-10-15 23:27:18 +0200emf(~emf@2620:10d:c090:400::5:35f6)
2021-10-15 23:27:31 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
2021-10-15 23:28:40 +0200kritzefitz(~kritzefit@212.86.56.80)
2021-10-15 23:29:06 +0200takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2021-10-15 23:29:19 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 23:30:33 +0200kritzefitz(~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-10-15 23:30:55 +0200kritzefitz(~kritzefit@212.86.56.80)
2021-10-15 23:30:59 +0200kritzefitz(~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-10-15 23:31:17 +0200kritzefitz(~kritzefit@212.86.56.80)
2021-10-15 23:33:35 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-15 23:33:48 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 265 seconds)
2021-10-15 23:35:02 +0200 <monochrom> Ugh cabal-install-parsers pulls in a ton of dependencies.
2021-10-15 23:40:19 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
2021-10-15 23:40:19 +0200cfricke(~cfricke@user/cfricke) (Ping timeout: 252 seconds)
2021-10-15 23:40:24 +0200 <monochrom> No matter! I now have a good program that prunes my cabal store after I'm done :)
2021-10-15 23:40:36 +0200MQ-17J(~MQ-17J@8.6.144.117)
2021-10-15 23:44:52 +0200douglascorrea_io(~douglasco@200.146.85.128.static.gvt.net.br)
2021-10-15 23:48:39 +0200ubert(~Thunderbi@178.165.181.201.wireless.dyn.drei.com) (Remote host closed the connection)
2021-10-15 23:49:19 +0200wootehfoot(~wootehfoo@user/wootehfoot) (Quit: Leaving)
2021-10-15 23:50:11 +0200MQ-17J(~MQ-17J@8.6.144.117) (Ping timeout: 264 seconds)
2021-10-15 23:50:27 +0200 <monochrom> Then again, it includes aeson-2.0.1.0. That's a keeper for my next project :)
2021-10-15 23:52:02 +0200__monty__(~toonn@user/toonn) (Quit: leaving)
2021-10-15 23:53:01 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 245 seconds)
2021-10-15 23:53:33 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-15 23:54:03 +0200shailangsa(~shailangs@host217-39-45-200.range217-39.btcentralplus.com)
2021-10-15 23:55:45 +0200gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-10-15 23:56:11 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
2021-10-15 23:57:01 +0200fendor(~fendor@178.165.162.11.wireless.dyn.drei.com) (Remote host closed the connection)