Home freenode/#haskell: Logs Calendar

Logs on 2020-10-05 (freenode/#haskell)

00:00:00 <quintasan> Is there any way I could write a function Hasql.Decoders.Result (Int32, Text) -> Tea where Tea is Tea { id :: Int32, name :: Text }? https://hackage.haskell.org/package/hasql-1.4.4.2/docs/Hasql-Decoders.html here are the docs. If my approach is not the correct one then let me know as well because I'm a beginner
00:00:02 × Hellaenergy quits (~Hellaener@185.244.214.216) ()
00:00:10 × atk quits (~Arch-TK@ircpuzzles/staff/Arch-TK) (Quit: Well this is unexpected.)
00:00:30 atk joins (~Arch-TK@ircpuzzles/staff/Arch-TK)
00:02:08 brettgilio joins (~brettgili@brettgilio.com)
00:04:25 × mav2 quits (~mav@p5b02806a.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
00:04:54 × sep2 quits (49dc4892@c-73-220-72-146.hsd1.ca.comcast.net) (Remote host closed the connection)
00:04:55 × DavidEichmann quits (~david@43.240.198.146.dyn.plus.net) (Ping timeout: 240 seconds)
00:05:01 nineonine joins (~nineonine@216-19-190-182.dyn.novuscom.net)
00:05:26 alp joins (~alp@2a01:e0a:58b:4920:d122:6c79:ff7:b4e4)
00:06:01 nineonin_ joins (~nineonine@50.216.62.2)
00:09:29 × nineonine quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Ping timeout: 260 seconds)
00:12:24 × nineonin_ quits (~nineonine@50.216.62.2) (Ping timeout: 258 seconds)
00:13:12 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Ping timeout: 272 seconds)
00:14:21 pfurla joins (~pfurla@64.145.79.141)
00:18:08 × seanvert quits (~user@177.84.244.242) (Read error: Connection reset by peer)
00:19:30 nineonine joins (~nineonine@50.216.62.2)
00:20:01 seanvert joins (~user@177.84.244.242)
00:23:27 hackage crc 0.1.1.0 - Implements various Cyclic Redundancy Checks (CRC) https://hackage.haskell.org/package/crc-0.1.1.0 (MichaelXavier)
00:24:27 × emmanuel_erc quits (~user@2604:2000:1382:ce03:88f9:ad61:775c:c25) (Ping timeout: 240 seconds)
00:25:24 snakemasterflex joins (~snakemast@213.100.206.23)
00:25:27 hackage crc 0.1.1.1 - Implements various Cyclic Redundancy Checks (CRC) https://hackage.haskell.org/package/crc-0.1.1.1 (MichaelXavier)
00:25:49 × nineonine quits (~nineonine@50.216.62.2) (Ping timeout: 258 seconds)
00:27:39 × alp quits (~alp@2a01:e0a:58b:4920:d122:6c79:ff7:b4e4) (Ping timeout: 272 seconds)
00:28:29 × seanvert quits (~user@177.84.244.242) (Read error: Connection reset by peer)
00:29:14 × ahmr88 quits (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) (Remote host closed the connection)
00:29:55 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 240 seconds)
00:33:23 emmanuel_erc joins (~user@2604:2000:1382:ce03:88f9:ad61:775c:c25)
00:34:11 × Wuzzy quits (~Wuzzy@p5790e6f5.dip0.t-ipconnect.de) (Remote host closed the connection)
00:34:13 <JohnTalent> sounds like a honeypot.
00:34:23 <sm[m]> JohnTalent: also yesod, IHP, maybe clckwrks
00:34:42 <JohnTalent> sm[m]: yeah, that makes perfect sense in english.
00:34:44 × elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 272 seconds)
00:34:56 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Quit: leaving)
00:35:00 <sm[m]> nobody uses clckwrks but it keeps on ticking, maybe it's good!
00:35:35 seanvert joins (~user@177.84.244.242)
00:36:33 polyrain joins (~polyrain@2001:8003:e501:6901:5451:58df:dd7d:42b9)
00:38:54 × mathlover2 quits (~mathlover@2604:6000:1013:129e:c3f:af24:28bd:eee4) (Quit: Leaving)
00:39:20 × seanvert quits (~user@177.84.244.242) (Read error: Connection reset by peer)
00:40:26 × pfurla quits (~pfurla@64.145.79.141) (Ping timeout: 272 seconds)
00:41:33 pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net)
00:45:36 <jackdk> quintasan: The key is that the `Result` type has a `Functor` instance. This means you can `fmap` over it. Let me prepare a snippet
00:49:09 × raehik quits (~raehik@cpc96984-rdng25-2-0-cust109.15-3.cable.virginm.net) (Ping timeout: 260 seconds)
00:50:37 <jackdk> quintasan: Here are some examples that may clear things up: https://www.irccloud.com/pastebin/RNBBmdUn/Tea.hs
00:51:16 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
00:56:06 torax joins (~torax@185.163.110.116)
00:57:19 plutoniix joins (~q@ppp-223-24-188-55.revip6.asianet.co.th)
00:58:38 <quintasan> jackdk: This still gives me Result Tea which... not exactly what I wanted. Hasql uses some weird (to me of course) idea of Encoders and Decoders and I wanted to write a decoder once and reuse it multiple times but it seems that my approach is either incorrect or I'm not good enough
00:58:39 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:c50d:40d9:7a86:602b) (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:58:58 <jackdk> quintasan: Oh I must've misread you sorry
00:59:01 <quintasan> And I'm still having problems with Text vs. [Char]
00:59:59 <ski> jackdk : nitpick, that's using function extensionality, not eta-reduction
01:00:06 <quintasan> jackdk: No worries, I'm trying to build a web application in Haskell coming from Rails so it's kind of frustrating when I can't do simple stuff like writing things to database and getting hashes back
01:00:25 <jackdk> ski: thank you
01:00:44 × Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 256 seconds)
01:00:47 <ski> function extensionality says that if `f x = g x' for every `x', then `f = g'
01:01:25 <jackdk> makes sense, cheers
01:01:41 <ski> eta-conversion says that `\x -> (...) x' (where `x' doesn't occur (freely) in `...') is equal to `...'. (forward direction is eta-reduction, backward is eta-expansion)
01:01:43 wei2912 joins (~wei2912@unaffiliated/wei2912)
01:01:58 <ski> they're closely related, though. you can prove they're equivalent
01:03:59 <dolio> Sometimes.
01:04:00 <ski> (you could try to prove this, if you want to. it's not terribly complicated. you'll need to know beta-conversion, though, that `(\x -> <body>) <argument>' is equal to `<body>' with all (free) occurances of `x' replaced by `<argument>')
01:04:03 × plutoniix quits (~q@ppp-223-24-188-55.revip6.asianet.co.th) (Ping timeout: 260 seconds)
01:04:42 × ddellacosta quits (~dd@86.106.121.168) (Ping timeout: 256 seconds)
01:05:28 <ski> mm .. i suppose it depends on what ambient theory one has
01:05:39 <jackdk> quintasan: looking at the examples in https://github.com/nikita-volkov/hasql , it looks like Result is passed to the constructor of Statement, and you run Statements using Hasql.Session.statement
01:05:47 <ski> (one'll need some version of congruence as well, i think)
01:06:10 <jackdk> quintasan: then you use Hasql.Session.run to turn a (Session a) and a Connection into IO (Either QueryError a)
01:07:08 <dolio> Yeah. For instance, Agda's "propositional equality" admits eta, but not extensionality.
01:07:10 <jackdk> quintasan: the bottom of the readme on github talks about a hasql-th lib that automatically generates the Statement for you from the SQL string, so that might be a little easier
01:07:47 <dolio> At least in the normal mode.
01:08:08 × conal quits (~conal@209.58.132.107) (Quit: Computer has gone to sleep.)
01:08:45 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
01:14:10 <ski> dolio : hm, so one can't formalize `f = \x -> f x = \x -> g x = g', then ?
01:14:54 × polyrain quits (~polyrain@2001:8003:e501:6901:5451:58df:dd7d:42b9) (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:15:38 <dolio> There's no way to apply the extensionality hypothesis for the middle step.
01:16:40 <dolio> You basically want to apply both sides to an abstract variable, but there's no way to do that.
01:16:52 plutoniix joins (~q@175.176.222.7)
01:17:01 × irc_user quits (uid423822@gateway/web/irccloud.com/x-jgthhmutdxudiomv) (Quit: Connection closed for inactivity)
01:18:32 <ski> mhm, i see. so it's the congruence step that's problematic
01:18:38 <dolio> Yeah.
01:19:25 <dolio> Congruence holds judgmentally, but has no propositional equivalent.
01:19:34 <ski> is this related to decidability of type-checking ? intensional vs. extensional type theory ?
01:19:43 <dolio> The way to write it propositionally is basically extensionality.
01:19:52 <ski> (i don't think i understand the latter distinction that well)
01:20:15 <dolio> Or, it's extensionality up to eta.
01:20:55 × ericsagnes quits (~ericsagne@2405:6580:0:5100:a157:330d:992b:2b45) (Ping timeout: 240 seconds)
01:20:56 <dolio> Yeah, extensional type theory can do it somehow, because the propositional equalities can be turned back into judgmental equalities.
01:21:28 <ski> yea .. discarding the proof term. which seems like hocus pocus, to me
01:22:06 <ski> (hopefully some version of HoTT will improve on this ?)
01:22:08 <dolio> But, cubical type theory also allows it, basically because it has a mechanism for the variable thing.
01:22:42 <dolio> You can abstract over a 'dimension' to prove the equality, and then you can give a lambda expression which is doing the variable abstraction.
01:23:17 <dolio> I think that might be one of the insights of this paper, too: https://arxiv.org/abs/2008.08533
01:23:55 <ski> oh, is that the square root thing ?
01:24:39 <dolio> It's a generalization of that (apparently) and other stuff. I hadn't heard of the square root thing until this paper.
01:24:52 <ski> (i recall reading about 2-dimensional (directed) type theory (Licata, iirc). thinking i could express some of the things there more nicely, with my notation)
01:25:12 <ski> mhm. ty for the suggestion
01:25:26 <dolio> Also one of the examples is fresh names in nominal logic, which seems like the sort of thing you'd need for this.
01:25:41 <dolio> Or, one possible sort of thing.
01:26:22 <ski> hm. i remember briefly taking a look at nominal logic, at some point, but not quite getting it, or possibly not quite liking it
01:26:44 conal joins (~conal@209.58.132.107)
01:26:55 <dolio> Yeah, I think it's not ideal.
01:26:58 ski . o O ( lambdaProlog,MacroML,MetaML,MetaOCaml )
01:28:23 <dolio> Like, in this situation you want sort of a 'fresh variable of a type', but the variables in nominal logic aren't typed.
01:29:50 <ski> and it's not entirely straight-forward to make a multi -sorted / -typed version of it ?
01:30:08 <dolio> Well, I don't know. There are other things like that.
01:30:22 <dolio> Like contextual modal type theory.
01:30:38 <ski> mm. that's interesting, i recall
01:30:42 jle` joins (~mstksg@unaffiliated/mstksg)
01:31:20 × dcoutts_ quits (~duncan@unaffiliated/dcoutts) (Remote host closed the connection)
01:31:32 <ski> (relativizing the modality by a context, iirc)
01:32:11 nineonine joins (~nineonine@50.216.62.2)
01:33:29 snakemasterflex joins (~snakemast@213.100.206.23)
01:34:19 ericsagnes joins (~ericsagne@2405:6580:0:5100:97e:4c35:feee:3de8)
01:34:30 ski . o O ( "A Combinatorial Theory of Formal Series" (about (combinatorial) species) by André Joyal in 1981 (partial (in-progress) translation by Brent A. Yorgey) at <http://ozark.hendrix.edu/~yorgey/pub/series-formelles.pdf> )
01:35:59 <quintasan> https://github.com/nikita-volkov/hasql-tutorial1/blob/master/library/HasqlTutorial1/Transaction.hs – why is Write and Serializable visible in this file, I don't get it. My module is even simpler (https://pastebin.com/XD1nAVA4) but I'm getting Data constructor not in scope: Write. I'm pretty much sure Write and Serializable come from https://hackage.haskell.org/package/hasql-transaction-1.0.0.1/docs/Hasql-Transaction-Sessions.html
01:37:38 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:68ef:3717:d255:fea6)
01:38:01 <dolio> Anyhow, there's definitely work on HoTT-adjacent stuff that has a better story than the proof term just disappearing.
01:38:04 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 272 seconds)
01:38:24 <dolio> That's the sort of thing that makes things undecidable.
01:38:56 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:68ef:3717:d255:fea6) (Client Quit)
01:39:47 × murphy_ quits (~murphy_@2604:2000:1281:8a9e:79f9:b15f:8bb9:7d0e) (Ping timeout: 240 seconds)
01:40:53 <dolio> I actually read a paper a couple days ago about how it's even a problem for constructing models in extensional type theory. Like, even if the extensional type theory is constructive, if you use its features to build a model for another theory, you end up with an uncomputable model.
01:40:54 murphy_ joins (~murphy_@2604:2000:1281:8a9e:c24e:de35:eb75:8dab)
01:41:45 <dolio> Because the part that needs to be decidable in practice (judgmental equality) gets modelled by the undecidable extensional equality.
01:41:50 <ski> quintasan : tried importing `Hasql.Transaction.Sessions' ?
01:42:32 <ski> dolio : mhm, i see
01:43:10 <quintasan> ski: Yeah, now it's even worse
01:43:26 <quintasan> https://pastebin.com/mZKS16v8
01:44:49 <quintasan> https://pastebin.com/G8M1XsMp without highlighting
01:45:14 <quintasan> I'm having a bad time here, it's either me doing something wrong or the docs being wrong (I think it's the former)
01:46:02 ddellacosta joins (~dd@86.106.121.168)
01:46:07 <quintasan> https://gitlab.com/Quintasan/teadb in case anyone wants to inspect what I've done https://gitlab.com/Quintasan/teadb
01:46:37 polyrain joins (~polyrain@2001:8003:e501:6901:5451:58df:dd7d:42b9)
01:46:49 × xff0x quits (~fox@2001:1a81:52c9:f600:e0a1:2683:5939:2315) (Ping timeout: 272 seconds)
01:47:01 <ski> quintasan : well .. you seem to be passing four parameters, where only two are expected (as the type error says)
01:48:06 <quintasan> ski: Well... you are probably right but I've tried to do what the documentation tells you to do and I'm stuck :D
01:48:17 xff0x joins (~fox@2001:1a81:5300:fe00:7915:3d42:ba93:76ea)
01:48:23 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:68ef:3717:d255:fea6)
01:49:02 <ski> quintasan : where's `insertTeaStatement' ?
01:49:32 <quintasan> ski: src/Statements.hs
01:51:13 <ski> what is `name' ?
01:52:04 <quintasan> name to insert in the database, it's supposed to be plain Text
01:52:25 <ski> what's the type of it ?
01:52:29 <ski> mhm
01:53:23 <ski> insertTea name = transaction Write Serializable (statement Statements.insertTeaStatement name)
01:53:52 <ski> is probably still not right, i suspect. but perhaps closer
01:54:01 <quintasan> I'm suspecting the tutorial is wrong because https://github.com/nikita-volkov/hasql-tutorial1/blob/master/library/HasqlTutorial1/Transaction.hs has `import Hasql.Transaction` and then calls `statement` and https://hackage.haskell.org/package/hasql-transaction-1.0.0.1/docs/Hasql-Transaction.html says `statement` takes a -> Statement a b -> Transaction b
01:54:15 <ski> oh, sorry, wrong order
01:54:20 <ski> insertTea name = transaction Serializable Write (statement Statements.insertTeaStatement name)
01:54:50 <ski> yea, that says `statement' only takes two parameters, now four
01:56:01 <quintasan> https://hackage.haskell.org/package/hasql-transaction-1.0.0.1/docs/Hasql-Transaction-Sessions.html has `transaction` which accepts IsolationLevel -> Mode -> Transaction a -> Session a
01:56:04 <quintasan> I'm confused
01:56:58 <Squarism> infinisil, thanks about that existential type trick from yesterday. It was what I needed.
01:57:04 <ski> and `Serializable' (an `IsolationLevel'), and `Write' (a `Mode'), seems like you wanted to feed them to `transaction' (which will also take a `Transaction b' (which is what `statement' will produce, if you feed it an `a', and a `Statement a b', which seems to fit what `insertTeaStatement' is ..), producing a `Session b')
01:57:47 × darjeeling_ quits (~darjeelin@122.245.210.179) (Ping timeout: 240 seconds)
01:58:05 <ski> quintasan : yes. but in your paste(s), you only called `statement', not `transaction'. but you tried to pass `Serializable' and `Write' to the former, not the latter ..
01:58:21 ski idly wonders what Squarism did with existentials
01:58:27 × polyrain quits (~polyrain@2001:8003:e501:6901:5451:58df:dd7d:42b9) (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:58:40 jedws joins (~jedws@121.209.186.103)
01:58:58 <Squarism> ski, cheating the type system. What else is there? =D
01:59:25 <quintasan> ski: I'm holding on to provided tutorials for my dear life but at this point it looks to be flat-out wrong - https://github.com/nikita-volkov/hasql-tutorial1/blob/master/library/HasqlTutorial1/Transaction.hs#L42
01:59:38 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
01:59:44 <Squarism> I guess I could have done wo but it sorta works so I guess I'll settle for that
02:02:02 <ski> Squarism : well, i'm guessing (and guessed before), that the interface has changed, that possibly those two parameters (the `IsolationLevel' and the `Mode') previously was to be passed to `statement', but not longer goes there
02:03:29 <ski> er, sorry
02:03:37 <ski> quintasan : that ^ was meant for you
02:04:01 <ski> Squarism : .. still wondering what you used them for :)
02:08:03 elliott__ joins (~elliott@pool-108-51-141-12.washdc.fios.verizon.net)
02:08:53 <Squarism> ski, So I had a function. Say foo :: Bar a . Bar had a function that produced values who's type was independent of "a". So I got a bit dissapointed when I realized I had to know "a
02:08:56 <Squarism> "
02:09:08 <Squarism> upon invocation.
02:10:07 × ddellacosta quits (~dd@86.106.121.168) (Ping timeout: 246 seconds)
02:10:11 <ski> `Bar a' being a `data' type, which included a function inside ?
02:10:11 <Squarism> So I did foo :: GenBar. and data GenBar = forall a. Bar => GenBar { val :: a }
02:10:51 <ski> (if `foo :: Bar a', and `Bar a' is not a type synonym for a function type, then `foo' is not a function, btw)
02:11:03 <ski> hm
02:11:06 <Squarism> oh sorry. foo :: Bar a => a
02:11:13 <Squarism> Bar was a class
02:11:17 <ski> oh
02:11:22 <ski> and what's the methods of `Bar' ?
02:12:14 <Squarism> well it was gimmeString :: a -> String
02:12:26 <Squarism> sure, a is an argument there.
02:12:28 <ski> only that ?
02:12:40 <Squarism> I mean, I make it simpler for ease of discussion.
02:13:17 <ski> your `GenBar' expresses/encodes `exists a. Bar a *> a' (i presume you meant `Bar a', not just `Bar' in the definition of `GenBar' ..)
02:13:35 <Squarism> yep
02:13:43 <Squarism> Bar a
02:13:51 <ski> if `Bar a' only has `gimmeString :: a -> String', then `exists a. Bar a *> a' is basically the same as just `String'. so the existential is fairly useless, then
02:14:18 <ski> but perhaps you had some more methods, which perhaps mentioned `a' more than ones ? or perhaps mentioned `a' in return type ?
02:14:29 <ski> s/ones/once/
02:15:34 falafel joins (~falafel@2605:e000:1527:d491:706d:90a5:67aa:1cd9)
02:15:57 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 272 seconds)
02:17:25 <Squarism> I tend to confuse myself that classes are like java interface. I forget you have to parameterize all usage of them. a must be bound in scope I guess you say.
02:19:44 <ski> yea, in an implementation of methods of an interface in Java, you can use `this'
02:19:52 <ski> there is an object, associated with the interface
02:19:57 <dsal> I think java's worse at mentally contaminating people than basic.
02:20:01 <ski> not so, with type classes in Haskell
02:20:05 × elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
02:20:10 × urodna quits (~urodna@unaffiliated/urodna) (Quit: urodna)
02:21:25 elliott__ joins (~elliott@pool-108-51-141-12.washdc.fios.verizon.net)
02:21:53 <quintasan> \o/
02:21:54 <quintasan> I got it
02:22:39 <quintasan> But at what price, it's 4:21
02:22:42 <ski> `Comparable' in Java in Haskell terms would be `exists a. Comparable a *> a', where `Comparable' on the Haskell side would be a type class with a `compareTo :: a -> Object -> Int' method
02:23:16 <ski> or, with the later `Comparable<T>' in Java, in Haskell terms would be `exists a. Comparable a T *> a', where `Comparable a b' on the Haskell side would be a type class with a `compareTo :: a -> b -> Int' method
02:24:13 × machinedgod quits (~machinedg@d67-193-126-196.home3.cgocable.net) (Ping timeout: 264 seconds)
02:24:31 <Squarism> ski, what is that "exists .." thing called?
02:24:51 <ski> quintasan : hm, i think you might need to find where in the code you're converting from `Transaction' to `Session', and pass `Serializable' and `Write' to the `transaction' call, there ?
02:24:58 <ski> Squarism : existential quantification
02:25:06 <justsomeguy> Describing type classes by comparison with features of other languages is starting to become a pet peeve of mine. ...But whatever helps you learn, I guess.
02:25:27 <ski> (not to be confused with the `ExistentialQuantification' language extension, which, imho, is a misnomer)
02:25:28 SirClueless joins (42413686@cpe-66-65-54-134.nyc.res.rr.com)
02:25:43 × cp- quits (~cp-@b157153.ppp.asahi-net.or.jp) (Quit: Disappeared in a puff of smoke)
02:26:00 agrim is now known as agrif
02:26:22 agrif is now known as agrim
02:26:28 toorevitimirp joins (~tooreviti@117.182.181.38)
02:27:15 justsomeguy got confused by the java analogy since he didn't know java, and then to decipher how type classes (are like|differ from) interfaces he had to learn what the heck and interface is on top of what a type class is. The most readable description was actually from the haskell language report.
02:27:28 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 272 seconds)
02:27:32 <ski> justsomeguy : iirc, at least last time i looked, traits in Rust were also limited in this way. that is, with neither them, nor interfaces in Java, can you express something like `exists w. Widget w *> Map String w'. iow, they only support encoding `exists x. C x *> x', with the plain existentially quantified variable, after the `*>'
02:28:04 <SirClueless> I have a beginner question I think. On the wiki page for fibonacci numbers they have the following program for generating an infinite sequence of them: `fibs = 0 : 1 : zipWith (+) fibs (tail fibs)`. What I'm trying to understand is whether or not that function recurses an exponential amount of times or a linear amount of times. Or does Haskell not
02:28:04 <SirClueless> make any guarantees either way?
02:28:24 cp- joins (~cp-@b157153.ppp.asahi-net.or.jp)
02:28:45 <ski> justsomeguy : yea .. it's not intended that people should go learn Java interfaces, to better understand Haskell type classes. it's just that, often, people already have some idea of Java interfaces, and in that case, it might help a bit, to compare with that, when learning type classes. there are similarities, but there's also differences
02:29:18 <justsomeguy> It seems good for getting an intuition of it, I suppose.
02:29:42 <dsal> I don't think java is good for getting an intuition. If you have a java intuition, it would help to translate, but it's like any other language translation concept.
02:29:53 <dsal> i.e., idioms don't translate super well
02:30:01 ski . o O ( "Interface-passing style" by Fare (François-René Rideau) in 2010-02-17 at <https://fare.livejournal.com/155094.html> )
02:30:13 <justsomeguy> ¯\_(ツ)_/¯
02:30:16 <ski> dsal, yep
02:30:43 <ski> justsomeguy : perhaps not good, but possibly useful, to get into the right ballpark, at least
02:31:21 <ski> Squarism : it's not a function. and, with by-need / lazy evaluation/reduction, it'll run in linear, not exponential, time
02:31:54 <justsomeguy> Sure, as a first step, it seems useful. Then again, the idea of a type class isn't that hard. The description is only two paragraphs in the Haskell language report, and actually readable (not too much jargon).
02:32:11 <ski> (the reason is that the data structure (the list), will act as a cache for the elements of the Fibonacci sequence, not recomputing them)
02:32:29 <justsomeguy> So sometimes I wonder why people bother with the intermediary step of explaining type classes by comparison.
02:32:46 <dsal> The hard thing about a haskell typeclass if you're used to a java interface or go interface or C++ abstract class or something is that you can't have a "Show" value.
02:33:01 <dsal> You'll really want to have a [Show], but you can't do that.
02:33:02 <Squarism> Sorry to stir up such debate. I used to know this, I just went away for a year and lost details.
02:33:08 Samos joins (~Kira@201.192.165.173)
02:33:32 <ski> justsomeguy : being able to define your own derived overloaded operations, with (almost) no special care at all to ensure that happening, when calling other overloaded operations, is not something people tend to be used to, from other languages, though
02:33:40 <justsomeguy> Squarism: Hey, no problem. I think of this as a friendly conversation rather than a debate. :)
02:34:17 <Samos> greetings
02:34:18 <justsomeguy> Fair point, ski -- I suppose the main concept takes some getting used to.
02:34:26 <ski> dsal : you can have `[exists a. Show a *> a]' .. but (for `Show'), that's not terribly useful. it's more or less just a more hairy version of `[String]'
02:34:35 <ski> @src elem
02:34:36 <lambdabot> elem x = any (== x)
02:34:49 <ski> well, take this implementation
02:34:52 <SirClueless> @ski so this is a guaranteed part of the Haskell language then, that re-evaluating some early piece of the list will be efficient and not recompute the whole list? I'm just beginning to understand "thunks" so it's hard for me to understand why it's guaranteed by the language, even if it happens in practice
02:34:52 <lambdabot> Maybe you meant: wiki src ask
02:35:11 <ski> _ `elem` [ ] = False
02:35:21 <ski> x0 `elem` (x:xs)
02:35:55 × Amras quits (~Amras@unaffiliated/amras0000) (Ping timeout: 240 seconds)
02:36:01 <ski> = x0 == x
02:36:12 <ski> || x0 `elem` xs
02:36:31 <SirClueless> Like, I don't really understand yet how the language can guarantee that, in practice, the millionth fibonacci number is available cheaply when requested and won't be recomputed
02:36:44 <ski> because `(==)' is overloaded (being a method of `Eq'), this `elem' will automagically also be overloaded (requiring `Eq')
02:38:14 × Quarl quits (~Quarl@94.191.136.1.mobile.tre.se) (Ping timeout: 272 seconds)
02:38:20 <ski> Squarism : "so this is a guaranteed part of the Haskell language then, .." -- no. but it tends to be what implementations do, unless they have any particular reason to deviate from this (such as speculatively evaluating some sub-expressions that're not demanded (yet, at least), since you have some parallel cores available for use, and you think you might need the value soon)
02:38:55 <ski> "thunks" is an implementation method, for implementing lazy / by-need reduction/evaluation
02:39:10 <Squarism> ski, : was that for me?
02:39:26 <SirClueless> That's so scary to me. It's like saying the performance of the evaluation isn't part of the correctness of the evaluation.
02:39:44 <ski> Squarism : yes (not the one about uoverloading, but the two messages after that)
02:39:48 × oisdk quits (~oisdk@2001:bb6:3329:d100:89a1:5b05:b385:265f) (Quit: oisdk)
02:40:06 <SirClueless> (I think ski is responding to me sometimes while using your name, Squarism)
02:40:58 <ski> SirClueless : it's something i think all implementations have done by default, unless there's been any clear reason (like optimization) to do otherwise
02:41:31 <ski> oh. hm, yea, i think i managed to refer to the wrong person, in one message above -- sorry about that
02:41:38 <justsomeguy> SirClueless: If you enjoy watching videos, I recommend this explanation of thunks ... https://www.youtube.com/watch?v=j19amq73-qA&list=PLe7Ei6viL6jGp1Rfu0dil1JH1SHk9bgDV&index=26 ; I'm not sure it will satisfy your curiosity, but it should at least give you a taste, and maybe you'll find it fun.
02:42:43 × falafel quits (~falafel@2605:e000:1527:d491:706d:90a5:67aa:1cd9) (Remote host closed the connection)
02:42:54 justsomeguy chides himself for reccomending stuff even though he's a total noob.
02:42:55 <ski> SirClueless : note that the language doesn't specify an operational/procedural semantics, how to get to the answer. it only talks about denotational semantics, what the answer is
02:43:04 <SirClueless> It just seems super scary to say "It's exponential runtime, but in practice on every major Haskell implementation it's linear"
02:43:25 <SirClueless> Like, in my world that's the same as saying "It's broken, but in practice on every major Haskell implementation it's not broken"
02:43:37 <dolio> Maybe you should care about the actual implementation, then..
02:43:38 <dsal> Wait until you learn about optimizing compilers in other languages...
02:43:38 <ski> SirClueless : by-need / lazy reduction/evaluation is an operational semantics concept. and since the language report doesn't talk about operational semantics, it doesn't specify by-need / laziness
02:44:02 <SirClueless> It would be like writing non-portable C code that works everywhere in practice: yeah it's OK for now, but still a bit scary
02:44:18 brandly joins (~brandly@c-73-68-15-46.hsd1.ma.comcast.net)
02:44:30 <dsal> I've written portable C code that runs everywhere. Except ARM where it segfaults.
02:45:05 <SirClueless> Exponential vs. Linear Time isn't just operational semantics though: getting the result of Fibonacci in exponential time is just as bad as getting the wrong result from Fibonacci, in pretty much every computation environment I've ever been in
02:45:32 <ski> (and ditto for talking about time or space complexity. those are operational semantics concepts, and the report doesn't talk about that)
02:45:52 drbean joins (~drbean@TC210-63-209-23.static.apol.com.tw)
02:45:58 <SirClueless> Like if it was in a batch process in a data center it would take arbitrary resources, or if it was computed in response to a request to a server, it would timeout
02:46:11 <SirClueless> And not being able to make any guarantees about that stuff is scary
02:46:42 <ski> (perhaps one could argue that it ought to talk some about it. e.g. to specify "proper tail recursion" (another misnomer, since it doesn't have to do with recursion, per se), which is a space complexity thing (unbounded number of active tail calls in bounded space))
02:46:52 <dsal> I think, in practice, you wouldn't use that implementation of fibs as a list of all fibs in a real program. In practice, you write the code that does what you want, and if it can't do it to your efficiency requirements, you change the parts that need to be optimized. Refactoring is super easy in haskell.
02:47:27 falafel joins (~falafel@2605:e000:1527:d491:706d:90a5:67aa:1cd9)
02:47:54 <SirClueless> ski Yeah, tail recursion is another important one. Lots of languages end up *requiring* tail recursion as a result, because in practice it affects correctness even if you are a pure functional language for all formal purposes
02:48:14 <ski> GHC tends to try to not apply "optimizations" which worsen space or time complexity
02:48:39 × Samos quits (~Kira@201.192.165.173) (Quit: WeeChat 2.9)
02:48:43 <dsal> tail recursion is a "how" rather than a "what"
02:48:49 <ski> yes
02:49:10 <SirClueless> Sure, but it doesn't make guarantees that it *will* make certain optimizations, you just have to assume when it will or not
02:49:22 <ski> (e.g. CSE can cause worse space usage, so GHC doesn't do much of it)
02:49:54 <SirClueless> Whether or not you have tail recursion means that certain computations will either complete successfully in a reasonable amount of memory, or blow the stack of every machine ever produced
02:50:34 <SirClueless> Sure it's just "how" not "what" but at some point "how" becomes "this is no longer computable" and every software engineer in existence has to start caring
02:50:40 <ski> i think, as a first approximation, it's quite safe to assume that GHC does by-need / lazy reduction. one can also think of this as graph reduction (with e.g. shared nodes caching results)
02:51:17 <ski> iirc PFDS' analysis of algorithms take this into account
02:51:22 <ski> @where PFDS
02:51:22 <lambdabot> http://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504
02:52:25 <ski> anyway, even with "proper tail recursion" (which is what Scheme calls it), that doesn't exactly mandate how you'll implement it. it doesn't have to be TCO, e.g. ..
02:52:57 lagothrix is now known as Guest19440
02:52:57 × Guest19440 quits (~lagothrix@unaffiliated/lagothrix) (Killed (tolkien.freenode.net (Nickname regained by services)))
02:53:03 lagothrix joins (~lagothrix@unaffiliated/lagothrix)
02:53:55 <dolio> Yeah, scheme just says it's bounded, right?
02:54:37 <ski> yep
02:54:54 <ski> must support an unbounded number of active tail calls in bounded space
02:55:18 <dolio> Bounded by what?
02:55:20 zacts joins (~zacts@dragora/developer/zacts)
02:57:17 <dolio> Doesn't seem like it says.
02:59:13 <ski> iirc, Chicken just uses the C stack, with CPS code, making it ever deeper, never returning in C, instead GCing the "stack" (which acts like a heap), compacting it, when necessary
02:59:50 <SirClueless> I guess I'm too much of a systems programmer to enjoy Haskell :D "You can assume the graph is reduced in a reasonably efficient way" is missing an axis of correctness that matters to me just as much as actually delivering the correct result of the computation
02:59:58 ski . o O ( "CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A." by Henry G. Baker in 1995-09 at <https://web.archive.org/web/20200223051632/http://home.pipeline.com:80/~hbaker1/CheneyMTA.html> )
03:00:01 × torax quits (~torax@185.163.110.116) ()
03:00:46 <ski> (and, MIT Scheme remembers the last 100 calls (including tail calls), for debugging purposes)
03:01:44 <dolio> If you care about performance, then implementation details matter, not just the language specification.
03:02:14 × zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving)
03:02:32 <quintasan> holy smokes
03:02:46 <quintasan> I think I'm starting to get it but at the same time I'm not getting it
03:03:10 ski . o O ( "PCLSRing: Keeping Process State Modular" by Alan Bawden at <http://fare.tunes.org/tmp/emergent/pclsr.htm> ; <https://en.wikipedia.org/wiki/PCLSRing> ; "PCLSRING in Semantics" by Robert Harper in 2016-07-11 at <https://existentialtype.wordpress.com/tag/pclsring/> )
03:03:14 <SirClueless> ^^ Well sure, but for example, using a language whose definition is "it must behave the same as this abstract machine defined here" which is how C or C++ work, means that unless the implementation expands primitive machine ops into non-constant evaluations, you can make guarantees about runtime
03:03:17 zaquest joins (~notzaques@5.128.210.178)
03:04:19 <quintasan> If I get IO (Int32, Text) and have a record Tea then I can - `fmap (uncurry Tea) $ functionThatGivesIO`. How do I do this for IO [(Int32, Text)] to get IO [Tea]?
03:05:17 <koz_> quintasan: You fmap twice.
03:05:41 <dolio> I don't believe that C and C++ specify enough in the language specification to guarantee good performance.
03:05:55 × brandly quits (~brandly@c-73-68-15-46.hsd1.ma.comcast.net) (Ping timeout: 240 seconds)
03:06:08 <koz_> dolio: Since UB is a thing, they _can't_.
03:06:42 <quintasan> wait, so I just fmap . fmap (uncurry Tea) $ functionThatGivesIOArray ?
03:06:53 <koz_> quintasan: Not quite.
03:07:05 <koz_> But you're on the right track.
03:07:09 <koz_> Consider the type of fmap:
03:07:11 <koz_> :t fmap
03:07:13 <lambdabot> Functor f => (a -> b) -> f a -> f b
03:07:29 ski . o O ( "Exceptional Syntax" by Nick Benton,Andrew Kennedy in 2001-07 at <https://www.microsoft.com/en-us/research/publication/exceptional-syntax/>,<http://lambda-the-ultimate.org/node/1193>,.. )
03:07:30 <koz_> Now, if f ~ IO, you get (a -> b) -> IO a -> IO b
03:07:38 ski . o O ( ..,<https://web.archive.org/web/20161027043544/http://mjambon.com/extend-ocaml-syntax.html#lettry>,<https://blog.janestreet.com/pattern-matching-and-exception-handling-unite/> )
03:08:01 <SirClueless> koz_ they can't guarantee runtime of programs that contain UB, for sure, but other programs they might be able to (with a lot of assumptions about the machine you're executing on)
03:08:06 <koz_> Now, in your case, a ~ [(In32, Text)], and the b you want is [Tea].
03:08:11 <koz_> SirClueless: There's also IB.
03:08:24 <koz_> So no, even if we assume no UB, the standard cannot guarantee very much at all.
03:08:34 <koz_> s/In32/Int32/
03:08:46 <koz_> So therefore, your function has to have that type.
03:08:58 <koz_> Now, you have something that types that way - fmap (uncurry Tea).
03:08:58 <quintasan> So ideally I'd write a function for [(Int32, Text)] -> [Tea] and fmap this?
03:09:06 <koz_> You can, but in this case, you don't need to.
03:09:24 <koz_> You would have fmap (fmap (uncurry Tea)).
03:10:02 <ski> quintasan : `fmap (map (uncurry Tea)) actionThatGivesIOList',`(fmap . map) (uncurry Tea) actionThatGivesIOList',`(fmap . map . uncurry) Tea actionThatGivesIOList',`map (uncurry Tea) <$> actionThatGivesIOList',`(uncurry Tea <$>) <$> actionThatGivesIOList'
03:10:21 × bloodstalker quits (~bloodstal@46.166.187.154) (Read error: Connection reset by peer)
03:10:29 <koz_> That last one is a step too far IMHO.
03:10:49 <SirClueless> It sounds like they can guarantee more than Haskell can though -- if only because they can't really express lazy evaluation and whether or not its result is immediately available
03:11:08 <quintasan> I still have no idea what <$> and <*> do but I decided that won't stop me from making this work.
03:11:20 <koz_> quintasan: <$> is just infix fmap.
03:11:22 <quintasan> koz_, ski: thanks
03:12:13 <koz_> SirClueless: I don't know how much you could guarantee about the performance of a C program given the standard.
03:12:21 <koz_> You first must ensure that neither IB nor UB applies.
03:12:23 aarvar joins (~foewfoiew@50.35.43.33)
03:12:54 <koz_> Then after that point, you gotta deal with the fact that the standard makes few promises about, say, type widths.
03:13:05 <koz_> Which might _significantly_ alter, for instance, how many times a loop will execute.
03:13:54 <koz_> There's probably _thousands_ of other small things there too.
03:14:44 <koz_> Maybe it's _different_ to the Haskell case, but 'more'? I doubt it.
03:14:54 <ski> SirClueless : those last links were about interaction of tail calls with exception handlers (not having the dynamic extent of the handler include the tail call)
03:15:13 <ski> this suggests it may be a good idea, having `catchBind :: Exception e => IO a -> (e -> IO b) -> (a -> IO b) -> IO b)' / `handleBind :: Exception e => (e -> IO b) -> (a -> IO b) -> (IO a -> IO b)', and not just `catch :: Exception e => IO a -> (e -> IO a) -> IO a',`handle :: Exception e => (e -> IO a) -> (IO a -> IO a)',`try :: Exception e => IO a -> IO (Either e a)'
03:15:55 × drbean quits (~drbean@TC210-63-209-23.static.apol.com.tw) (Read error: Connection reset by peer)
03:18:14 <ski> (and perhaps some custom syntax for this, like the `let'-`try' above, which OCaml now supports as pattern-matching <https://caml.inria.fr/pub/docs/manual-ocaml/coreexamples.html#s%3Aexceptions>)
03:19:07 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) ()
03:19:09 <SirClueless> Maybe I just already understand all the tradeoffs in C better? Like, I can't think of any way to sneak exponential runtime into a C program -- it would take some *very* obscure interactions. But you can certainly sneak some UB into a C program and that's perhaps worse.
03:19:30 × perrier-jouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Quit: WeeChat 2.9)
03:20:08 perrier-jouet joins (~perrier-j@modemcable012.251-130-66.mc.videotron.ca)
03:20:49 Stanley00 joins (~stanley00@unaffiliated/stanley00)
03:21:29 snakemasterflex joins (~snakemast@213.100.206.23)
03:21:39 tekojo joins (~tekojo@s91904426.blix.com)
03:21:47 ski . o O ( "A Guide to Undefined Behavior in C and C++" by John Regehr, "Part 1" in 2010-07-09 at <https://blog.regehr.org/archives/213>,"Part 2" in 2010-07-23 at <https://blog.regehr.org/archives/226>,"Part 3" in 2010-07-30 at <https://blog.regehr.org/archives/232> )
03:22:29 <koz_> SirClueless: Do you understand C-as-the-standard-calls-it? Or C-as-your-favourite-compiler-implements-it?
03:22:36 <koz_> Those may, or may not, be the same thing.
03:23:39 <SirClueless> I try, as far as possible, to understand C (and more often C++) as the standard guarantees it. Obviously the C++ standard is like 10k pages or something stupid so there's no way to claim I understand it all.
03:25:16 <c_wraith> The standard guarantees so little in C. I don't think it's actually possible to write non-trivial code that's portable across all spec-compliant C compilers.
03:25:31 <SirClueless> But there are ways to guarantee some things even in standard C++ that you can't really in Haskell afaict. For example the ability to interpret bytes in an IO device DMA buffer as data without any copying.
03:25:38 <koz_> c_wraith: I remember that one C99 draft made memmove impossible to write.
03:25:55 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 240 seconds)
03:27:00 <c_wraith> SirClueless: sure you can... but it's going to be awkward to use because Haskell forces you to understand that the backing bytes could change at any time.
03:29:01 <SirClueless> Yes, but using C++ allows you to rely on memory guarantees provided by the device itself. FWIW C++ forces you to understand too that backing bytes can change at any time (it's just less strict about writing programs that fail to acknowledge that fact). This is basically the purpose of the volatile keyword.
03:29:19 <c_wraith> right. The point of Haskell is that you can't fail to acknowledge it.
03:29:46 × zacts quits (~zacts@dragora/developer/zacts) (Ping timeout: 256 seconds)
03:30:14 <dolio> DMA of an IO device is in the C++ standard?
03:33:08 <SirClueless> Yes. In that there are standard-compliant ways that a device vendor can provide you with a buffer that you can use in productive ways. When you do that you rely on the standard, the linux kernel, the x64 ISA, a certain pointer addressing mechanism, etc. but that's all stuff that's well defined even if it's not portable.
03:34:08 polyrain joins (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107)
03:35:35 <dolio> So that's actually a no.
03:36:03 <SirClueless> When you write a load from a memory address provided by an IO device's driver with a volatile keyword qualifier, the standard defines what kinds of bytes you will and will not access, and the ordering of that load with respect to the other statements in your program. In that sense the standard defines reading a DMA buffer.
03:36:42 <c_wraith> The standard tells you that you can read from a pointer. It doesn't say anything about DMA
03:36:47 × constR quits (uid58205@gateway/web/irccloud.com/x-tksgpowcrsjwxjgo) (Quit: Connection closed for inactivity)
03:37:14 <c_wraith> (of course, you can only read from *some* pointers. It's not clear how the driver generates that pointer and whether it's valid according to the spec)
03:38:59 <SirClueless> It tells you it will read exactly once and with well-defined ordering with respect to reading any other volatile memory addresses. That's enough to implement interoperating with a DMA buffer.
03:39:58 <c_wraith> You seem to have ignored the provenance of the pointer. the standard says a lot about when reading from a pointer is defined and when it isn't. I sincerely doubt that the way the pointer is acquired is standard-compliant.
03:40:17 <c_wraith> (The OS may guarantee it's fine, but that's not the same as the spec)
03:40:27 <koz_> I'm also unsure that you get a well-defined ordering across multiple volatile variables this way.
03:40:40 <koz_> (I'm open to being proved wrong here, but I don't think the standard goes quite that far)
03:40:43 <koz_> (at least not in C)
03:41:16 <SirClueless> I'm not sure I follow. If it's implementation-defined by the standard, and the OS guarantees certain behavior, then it's well-defined access.
03:41:54 <koz_> SirClueless: 'Implementation-defined' translates to 'read your compiler docs'.
03:42:02 <dolio> You mean like how the Haskell specification has implementation defined behavior, so you need to ask about the implementation you're using?
03:42:03 <koz_> The OS's guarantees may or may not matter.
03:42:23 <SirClueless> And it does provide some number of guarantees of ordering. Basically using the concept of "sequence points" as defined in the C abstract machine and the ability (or inability) of a compliant implementation to reorder certain loads and stores over sequence points.
03:42:25 × blasius quits (~blasius@4e69b241.skybroadband.com) (Ping timeout: 240 seconds)
03:42:56 <koz_> SirClueless: So I guess we're talking C11, since before that, there's no memory model.
03:44:53 <SirClueless> Well, technically even before that there were guarantees about some kinds of ordering. And compilers would in practice make guarantees like "we won't reorder around inline assembly" giving you a non-portable backdoor into your ISA's memory barrier instructions to try and do the right thing (inasmuch as that was possible).
03:44:57 <koz_> "What constitutes an access to an object thathas volatile-qualified type is implementation-defined." bodes well...
03:46:01 <SirClueless> Yeah, it was a crappy landscape for a long time. Recently things have gotten better (in C++ especially) with various flavors of standard-defined atomic data types.
03:46:08 × vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving)
03:46:37 × kupi quits (uid212005@gateway/web/irccloud.com/x-dndtziltoquslpzk) (Quit: Connection closed for inactivity)
03:48:23 × kreyren_ quits (~kreyren@fsf/member/kreyren) (Ping timeout: 240 seconds)
03:49:35 × miguicho quits (~miguel@host-186-101-215-54.netlife.ec) (Quit: Leaving)
03:50:57 × falafel quits (~falafel@2605:e000:1527:d491:706d:90a5:67aa:1cd9) (Ping timeout: 272 seconds)
03:52:02 <SirClueless> Anyways, I think it's interesting to discuss these things. Thanks for taking the time to go back and forth with me! I think there are a lot of interesting tradeoffs to make: In C you can write a type-checking program that blows up because you wrote a[n] for too large n. In Haskell you can write a type-checking program that blows up because you
03:52:02 <SirClueless> wrote `rfold` when you meant `lfold`. Ain't software fun.
03:52:54 × wei2912 quits (~wei2912@unaffiliated/wei2912) (Quit: Lost terminal)
03:53:06 <koz_> SirClueless: Those are different notions of 'blowing up' though.
03:53:15 <koz_> Former is 'the compiler can emit code that erases your hard drive'.
03:53:18 × conal quits (~conal@209.58.132.107) (Quit: Computer has gone to sleep.)
03:53:24 <koz_> Latter is 'if you don't have hilarious RAM you'll OOM'.
03:53:34 <koz_> Those aren't even in the same _universe_.
03:56:16 <SirClueless> That's where we disagree at a philosophical level, I suppose. Both of them could equally bring down a server.
03:57:41 <koz_> ... you're seriously saying that 'your server now lost all its data forever' is in the same ballpark as 'one program on said server crashed to OOM'?
03:58:24 <SirClueless> There are some differences to be sure: the former is much more likely than the latter to end in an attacker having control of your network. But both are stop-the-world disasters in the right context.
03:58:45 <koz_> 'In the right context' almost anything is anything.
03:59:05 <koz_> I'd say, in general, UB creates issues of far worse gore than laziness will ever afflict you with.
03:59:14 <SirClueless> Sure, the context for me is writing high-availability network services.
03:59:46 <koz_> It sure is great for availability when you've had your entire non-volatile storage nuked.
03:59:50 <koz_> Or your passwords dumped.
04:00:28 × ryansmccoy quits (~ryansmcco@193.37.254.27) (Ping timeout: 265 seconds)
04:00:32 <SirClueless> Yeah, that's a memory-safety problem. Utterly terrifying for C programs, a non-issue for Haskell programs.
04:00:42 <SirClueless> But DoS vectors are problems for both.
04:00:47 drbean joins (~drbean@TC210-63-209-50.static.apol.com.tw)
04:01:17 ryansmccoy joins (~ryansmcco@156.96.151.132)
04:02:15 conal joins (~conal@209.58.132.107)
04:02:25 × polyphem quits (~p0lyph3m@2a02:810d:640:776c:76d7:55f6:f85b:c889) (Ping timeout: 240 seconds)
04:02:26 × xelxebar quits (~xelxebar@gateway/tor-sasl/xelxebar) (Remote host closed the connection)
04:02:30 <koz_> Denial-of-service can also be done by attacking the hosting architecture, irrespective of what you wrote in or with.
04:02:46 <koz_> (in fact, I believe that's where it commonly arises, unless we're talking like, hash flooding or something)
04:02:55 xelxebar joins (~xelxebar@gateway/tor-sasl/xelxebar)
04:02:57 zacts joins (~zacts@dragora/developer/zacts)
04:04:53 vicfred joins (~vicfred@unaffiliated/vicfred)
04:05:53 × vicfred quits (~vicfred@unaffiliated/vicfred) (Max SendQ exceeded)
04:06:22 vicfred joins (~vicfred@unaffiliated/vicfred)
04:07:39 falafel joins (~falafel@2605:e000:1527:d491:706d:90a5:67aa:1cd9)
04:07:49 <SirClueless> The malicious kinds, yeah, probably. The kinds that are more like "2% of our RPC calls timeout because the host dies" and you go and investigate the machines where it happens and it turns out there's a legitimate use case for requesting 10000 records at a time from your service and somewhere in the network stack someone wrote an O(n^2) linear scan
04:07:49 <SirClueless> routine that they never expected to be exercised like this and now needs to be rearchitected
04:09:10 <koz_> But this isn't really unique to Haskell. No language will prevent you writing a quadratic scan.
04:09:18 <koz_> I don't think laziness makes it any more likely.
04:11:51 <SirClueless> So far I'm not experienced enough to say. Having made multiple "d'oh" style performance flubs like that in my limited time trying out Haskell it does seem somewhat more likely. Less to do with lazy evaluation I think and more to do with super concise ways of abstracting control flow. But I admit I'm not really giving Haskell a fair shot due to my
04:11:51 <SirClueless> inexperience.
04:23:00 × polyrain quits (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107) (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:30:30 sz0 joins (uid110435@gateway/web/irccloud.com/x-ghthpnxjfhyoidss)
04:39:39 day_ joins (~Unknown@unaffiliated/day)
04:41:10 todda7 joins (~torstein@athedsl-238951.home.otenet.gr)
04:41:58 × zacts quits (~zacts@dragora/developer/zacts) (Quit: leaving)
04:43:05 × day quits (~Unknown@unaffiliated/day) (Ping timeout: 256 seconds)
04:43:06 day_ is now known as day
04:44:26 × Sheilong quits (uid293653@gateway/web/irccloud.com/x-bxwmidpkndksabez) ()
04:44:37 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
04:49:51 × aweinstock quits (~aweinstoc@cpe-67-248-65-250.nycap.res.rr.com) (Ping timeout: 272 seconds)
04:49:55 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
04:50:09 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
04:50:47 GyroW joins (~GyroW@d54C03E98.access.telenet.be)
04:50:47 × GyroW quits (~GyroW@d54C03E98.access.telenet.be) (Changing host)
04:50:47 GyroW joins (~GyroW@unaffiliated/gyrow)
04:51:28 <koz_> Yeah, there's things to watch out for there, definitely.
05:00:48 × falafel quits (~falafel@2605:e000:1527:d491:706d:90a5:67aa:1cd9) (Remote host closed the connection)
05:02:21 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
05:02:37 aweinstock joins (~aweinstoc@cpe-67-248-65-250.nycap.res.rr.com)
05:04:07 <dsal> In practice, I write more correct and useful code in haskell than I ever did in C, even though (and likely because) I can't pay huge attention to all the implementation details all the time.
05:07:17 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
05:08:16 falafel joins (~falafel@2605:e000:1527:d491:99fe:5613:f0a7:56f0)
05:09:19 <dsal> optparse-applicative started doing this useful thing recently, it seems. https://www.irccloud.com/pastebin/CTguX34u/
05:16:35 × tomku quits (~tomku@unaffiliated/tomku) (Ping timeout: 240 seconds)
05:18:50 idhugo joins (~idhugo@563472ae.rev.stofanet.dk)
05:21:24 ym555 joins (~ym@41.42.210.219)
05:22:39 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:22:51 shafox joins (~shafox@106.51.234.111)
05:23:27 × ericsagnes quits (~ericsagne@2405:6580:0:5100:97e:4c35:feee:3de8) (Ping timeout: 240 seconds)
05:24:23 snakemasterflex joins (~snakemast@213.100.206.23)
05:25:36 coot joins (~coot@37.30.49.218.nat.umts.dynamic.t-mobile.pl)
05:26:44 × hyiltiz quits (~quassel@unaffiliated/hyiltiz) (Ping timeout: 258 seconds)
05:26:59 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 265 seconds)
05:28:23 shatriff joins (~vitaliish@217.27.153.240)
05:33:35 tomku joins (~tomku@unaffiliated/tomku)
05:36:17 ericsagnes joins (~ericsagne@2405:6580:0:5100:97e:4c35:feee:3de8)
05:37:20 × idhugo quits (~idhugo@563472ae.rev.stofanet.dk) (Ping timeout: 256 seconds)
05:38:37 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
05:39:59 hyiltiz joins (~quassel@82.118.227.47)
05:39:59 × hyiltiz quits (~quassel@82.118.227.47) (Changing host)
05:39:59 hyiltiz joins (~quassel@unaffiliated/hyiltiz)
05:42:25 × GyroW quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 240 seconds)
05:42:32 × olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Ping timeout: 272 seconds)
05:43:21 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
05:43:21 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
05:43:21 GyroW joins (~GyroW@unaffiliated/gyrow)
05:43:42 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:68ef:3717:d255:fea6) (Quit: My MacBook has gone to sleep. ZZZzzz…)
05:44:54 lpy joins (~lpyfist@unaffiliated/elysian)
05:44:54 zacts joins (~zacts@dragora/developer/zacts)
05:46:55 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
05:50:25 × aarvar quits (~foewfoiew@50.35.43.33) (Ping timeout: 240 seconds)
05:55:59 × tomku quits (~tomku@unaffiliated/tomku) (Ping timeout: 265 seconds)
05:56:08 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
05:58:39 machinedgod joins (~machinedg@d67-193-126-196.home3.cgocable.net)
06:00:02 × tekojo quits (~tekojo@s91904426.blix.com) ()
06:01:18 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
06:01:18 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
06:01:18 jle` joins (~mstksg@unaffiliated/mstksg)
06:05:46 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
06:07:34 tomku joins (~tomku@unaffiliated/tomku)
06:11:37 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 264 seconds)
06:12:35 zebrag joins (~inkbottle@aaubervilliers-654-1-80-159.w86-212.abo.wanadoo.fr)
06:12:35 × inkbottle quits (~inkbottle@aaubervilliers-654-1-101-122.w86-212.abo.wanadoo.fr) (Ping timeout: 240 seconds)
06:13:21 <Squarism> I often fall into this situation I want to shove a bunch of parameterized types into a big datastructure and foreget their types and then want to pick out values from the big structure and reconstruct their types. I gathered that this is not "right". Are there any "ugly tricks" you can use to atleast save the type info to be able to restore the values to their correct type?
06:14:37 <dsal> I've never needed to lose a type in Haskell code. It's not clear to me what pattern you're referring to.
06:15:00 <MarcelineVQ> yeah, don't forget their types. but you can google existential antipattern for some techniques
06:16:24 danvet_ joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa)
06:17:07 × jedws quits (~jedws@121.209.186.103) (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:19:01 × zacts quits (~zacts@dragora/developer/zacts) (Quit: leaving)
06:19:50 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 256 seconds)
06:27:29 hiroaki joins (~hiroaki@ip4d176049.dynamic.kabel-deutschland.de)
06:29:01 cfricke joins (~cfricke@unaffiliated/cfricke)
06:30:14 <jackdk> do you have a concrete instance of where you want this? Often it's a problem-solving impulse from other experience that doesn't work so well in Haskell
06:35:10 × conal quits (~conal@209.58.132.107) (Quit: Computer has gone to sleep.)
06:35:10 chele joins (~chele@ip5b416ea2.dynamic.kabel-deutschland.de)
06:35:57 × tzh quits (~tzh@2601:448:c500:5300::143b) (Quit: zzz)
06:37:02 <Squarism> jackdk, I have this idea atm : https://paste.ofcode.org/TGvEbepNQbjtWRqKzgkgkd
06:38:20 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
06:38:20 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
06:38:20 jle` joins (~mstksg@unaffiliated/mstksg)
06:38:49 sQVe joins (~sQVe@unaffiliated/sqve)
06:39:07 <Squarism> In this case I want to be able to traverse an SType and determine the type of the list. That should be any of the "data P..." types
06:39:40 whiteline joins (~whiteline@unaffiliated/whiteline)
06:43:59 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Quit: Textual IRC Client: www.textualapp.com)
06:44:33 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 258 seconds)
06:47:33 dhouthoo joins (~dhouthoo@ptr-eiv6509pb4ifhdr9lsd.18120a2.ip6.access.telenet.be)
06:47:36 p8m joins (p8m@gateway/vpn/protonvpn/p8m)
06:48:33 aarvar joins (~foewfoiew@50.35.43.33)
06:48:40 Sanchayan joins (~Sanchayan@136.185.184.11)
06:49:02 × todda7 quits (~torstein@athedsl-238951.home.otenet.gr) (Ping timeout: 272 seconds)
06:49:55 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 260 seconds)
06:51:45 idhugo joins (~idhugo@users-1190.st.net.au.dk)
06:52:41 snakemasterflex joins (~snakemast@213.100.206.23)
06:53:42 <dsal> What do you want to do with the type?
06:54:12 <dsal> I keep thinking you're bumping up against optics, but I don't fully understand your intention.
06:54:43 simonbusborg joins (~simonbusb@217.151.98.163)
06:54:56 × Noldorin quits (~noldorin@unaffiliated/noldorin) (Ping timeout: 246 seconds)
06:56:05 pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net)
06:56:07 <dsal> The P types don't seem to be doing anything of value here. You can already disambiguate with the S constructor.
06:57:47 <dsal> Do you mean `SList` should be `SList [SType]` ?
06:57:49 × shatriff quits (~vitaliish@217.27.153.240) (Remote host closed the connection)
06:57:52 × bitmapper quits (uid464869@gateway/web/irccloud.com/x-aodidipmuxccpmsk) (Quit: Connection closed for inactivity)
06:58:09 fendor joins (~fendor@77.119.129.78.wireless.dyn.drei.com)
07:00:43 <dsal> If so, then the type of that list will always be the same and can have values represented by any of the constructors. If you mean something else, I don't know what that'd be. (I don't understand what your forall is intended to do). You can't have a list of an unspecified type meaningfully.
07:01:44 <dsal> I think it'd be easier to understand what the code your were trying to write with this these data types would be doing instead of how you think you'd express the types.
07:02:12 <dsal> But I meant to go to bed before midnight, and failed, so oops.
07:03:38 jespada joins (~jespada@90.254.246.48)
07:03:58 × machinedgod quits (~machinedg@d67-193-126-196.home3.cgocable.net) (Ping timeout: 260 seconds)
07:06:43 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
07:06:44 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
07:06:44 jle` joins (~mstksg@unaffiliated/mstksg)
07:08:23 John20 joins (~John@82.46.59.122)
07:08:29 alp joins (~alp@2a01:e0a:58b:4920:710e:4c3d:416d:5e7c)
07:09:25 × Rudd0 quits (~Rudd0@185.189.115.108) (Ping timeout: 240 seconds)
07:11:52 × toorevitimirp quits (~tooreviti@117.182.181.38) (Ping timeout: 265 seconds)
07:13:09 jedws joins (~jedws@121.209.186.103)
07:14:33 × carlomagno1 quits (~cararell@inet-hqmc01-o.oracle.com) (Remote host closed the connection)
07:15:03 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 260 seconds)
07:15:11 carlomagno joins (~cararell@inet-hqmc01-o.oracle.com)
07:18:17 × michalrus quits (m@michalrus.com) (Ping timeout: 258 seconds)
07:18:18 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
07:18:18 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
07:18:18 jle` joins (~mstksg@unaffiliated/mstksg)
07:20:41 mav2 joins (~mav@p5b02806a.dip0.t-ipconnect.de)
07:21:12 michalrus joins (m@michalrus.com)
07:22:00 <dminuoso> I extract a list of IP addresses, and I want to bring them into a data structure in which I can coalesce adjoined IP ranges, or at give a coalesced representation.
07:22:29 <dminuoso> For the purpose of this, we could also consider IP addresses as just numbers, so Im getting a list of numbers (or some of them might be intervals).
07:23:35 tbreslein joins (~tbreslein@2a02:8108:140:44f8::3cc4)
07:24:45 × michalrus quits (m@michalrus.com) (Client Quit)
07:25:05 <dminuoso> My initial instinct was to just build up a binary trie and make some kind of algorithm on that, but I cant find a trivial algorithm for that
07:26:02 <dminuoso> There's of course the very naive approach of just taking the list, sorting it, and fusing adjoined neighbors repeatedly, but that has poor complexity
07:26:35 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 240 seconds)
07:27:42 <MarcelineVQ> What does 'coalesce adjoined IP ranges' mean?
07:28:24 chaosmasttter joins (~chaosmast@p200300c4a73b2e0100f3c5a701cd6e56.dip0.t-ipconnect.de)
07:28:29 <dminuoso> So say the list consists of ["10.0.0.0/24", "10.0.1.0/24", ...] I want those first two to merge into ["10.0.0.0/23", ...]
07:29:09 <dminuoso> Or, in terms of a more numeric view, if I have [Range 1 1, Range 2 2, Range 3 5, Range 6 7], I want to turn that into [Range 1 5, Range 6 7]
07:29:37 <dminuoso> Not necessarily directly, just some data structure in which I can coalesce them
07:29:51 <dminuoso> Oh wait
07:29:54 <dminuoso> THat example was bad
07:30:00 borne joins (~fritjof@200116b86471bb007fe01feb1760d29e.dip.versatel-1u1.de)
07:30:01 <dminuoso> that should turn into [Range 1 7] of course
07:30:08 × Sgeo quits (~Sgeo@ool-18b982ad.dyn.optonline.net) (Read error: Connection reset by peer)
07:30:26 <dminuoso> But if it was [Range 1 1, Range 2 2, Range 3 4, Range 6 7], then that should become [Range 1 4, Range 6 7], so I get all continguous ranges merged together
07:30:43 <MarcelineVQ> sort of an ip interval-map?
07:30:56 <dminuoso> Right
07:31:02 jgt joins (~jgt@194.143.137.49.users.breezein.net)
07:33:03 × hekkaidekapus} quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Quit: hekkaidekapus})
07:34:07 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
07:34:11 michalrus joins (m@michalrus.com)
07:34:25 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
07:34:25 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
07:34:25 GyroW joins (~GyroW@unaffiliated/gyrow)
07:34:31 <outerpassage> cabal seems to ignore the --bindir flag for v2-build, any ideas why that might be happening?
07:34:42 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
07:35:08 hekkaidekapus joins (~tchouri@gateway/tor-sasl/hekkaidekapus)
07:36:44 m0rphism joins (~m0rphism@HSI-KBW-046-005-177-122.hsi8.kabel-badenwuerttemberg.de)
07:38:10 kritzefitz joins (~kritzefit@fw-front.credativ.com)
07:39:43 × tomboy64 quits (~tomboy64@gateway/tor-sasl/tomboy64) (Ping timeout: 240 seconds)
07:39:55 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
07:39:58 jonathanx joins (~jonathan@dyn-8-sc.cdg.chalmers.se)
07:40:14 tomboy64 joins (~tomboy64@gateway/tor-sasl/tomboy64)
07:40:28 todda7 joins (~torstein@athedsl-4367507.home.otenet.gr)
07:42:53 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
07:42:58 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
07:43:04 GyroW joins (~GyroW@d54c03e98.access.telenet.be)
07:43:04 × GyroW quits (~GyroW@d54c03e98.access.telenet.be) (Changing host)
07:43:04 GyroW joins (~GyroW@unaffiliated/gyrow)
07:43:55 × simonbusborg quits (~simonbusb@217.151.98.163) (Ping timeout: 240 seconds)
07:44:44 <jackdk> back up another step; why do you want to do this thing?
07:44:50 <jackdk> Squarism: ^
07:47:08 × mav2 quits (~mav@p5b02806a.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
07:47:48 carlomagno1 joins (~cararell@inet-hqmc01-o.oracle.com)
07:48:10 × carlomagno quits (~cararell@inet-hqmc01-o.oracle.com) (Ping timeout: 256 seconds)
07:52:28 peel joins (uid145489@gateway/web/irccloud.com/x-gaoowxyrodcvmckl)
07:53:03 × livvy quits (~livvy@gateway/tor-sasl/livvy) (Ping timeout: 240 seconds)
07:58:22 × falafel quits (~falafel@2605:e000:1527:d491:99fe:5613:f0a7:56f0) (Ping timeout: 244 seconds)
08:00:30 oisdk joins (~oisdk@2001:bb6:3329:d100:ec91:550b:f86b:f744)
08:01:37 machinedgod joins (~machinedg@d67-193-126-196.home3.cgocable.net)
08:01:46 × jedws quits (~jedws@121.209.186.103) (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:02:23 thc202 joins (~thc202@unaffiliated/thc202)
08:04:35 × jgt quits (~jgt@194.143.137.49.users.breezein.net) (Ping timeout: 260 seconds)
08:04:56 × petersen quits (~petersen@redhat/juhp) (Quit: petersen)
08:05:13 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
08:06:02 jgt joins (~jgt@109.122.28.107)
08:07:17 ixlun joins (~matthew@213.205.241.94)
08:09:18 × sz0 quits (uid110435@gateway/web/irccloud.com/x-ghthpnxjfhyoidss) (Quit: Connection closed for inactivity)
08:09:19 polyrain joins (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107)
08:11:24 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 256 seconds)
08:11:30 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
08:11:30 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
08:11:30 jle` joins (~mstksg@unaffiliated/mstksg)
08:12:27 jgt joins (~jgt@109.122.28.107)
08:12:56 mav2 joins (~mav@i5E862F77.versanet.de)
08:16:50 blasius joins (~blasius@4e69b241.skybroadband.com)
08:19:40 petersen joins (~petersen@redhat/juhp)
08:20:45 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 240 seconds)
08:22:19 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 260 seconds)
08:22:28 jedws joins (~jedws@121.209.186.103)
08:24:16 × lpy quits (~lpyfist@unaffiliated/elysian) (Quit: lpy)
08:24:46 jgt joins (~jgt@109.122.28.107)
08:25:22 p-core joins (~Thunderbi@cst-prg-93-127.cust.vodafone.cz)
08:26:46 × hnOsmium0001 quits (uid453710@gateway/web/irccloud.com/x-ppmzllfatsxcxgfj) (Quit: Connection closed for inactivity)
08:27:03 × Unhammer quits (~Unhammer@gateway/tor-sasl/unhammer) (Ping timeout: 240 seconds)
08:29:06 Unhammer joins (~Unhammer@gateway/tor-sasl/unhammer)
08:29:36 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 256 seconds)
08:29:45 × jedws quits (~jedws@121.209.186.103) (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:31:55 gnumonik joins (~gnumonik@c-73-170-91-210.hsd1.ca.comcast.net)
08:33:33 <mimi_vx> bgamari: hello, who is responsible for uploading GHC source to Hackage ? hackage known ghc-8.10.1 as latest, which cases for examle for hie-bios and similiar packages with defined depends on ghc
08:33:56 jgt joins (~jgt@109.122.28.107)
08:34:07 RC-3004 joins (~RC-3004@195.206.169.184)
08:34:34 <mimi_vx> maybe hvr ? ^^
08:37:11 DavidEichmann joins (~david@43.240.198.146.dyn.plus.net)
08:37:23 Aquazi joins (uid312403@gateway/web/irccloud.com/x-truwgtvpybdfvjec)
08:37:28 × p-core quits (~Thunderbi@cst-prg-93-127.cust.vodafone.cz) (Ping timeout: 256 seconds)
08:38:34 p-core joins (~Thunderbi@cst-prg-17-128.cust.vodafone.cz)
08:38:39 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 260 seconds)
08:39:01 × fendor quits (~fendor@77.119.129.78.wireless.dyn.drei.com) (Remote host closed the connection)
08:39:20 fendor joins (~fendor@77.119.129.78.wireless.dyn.drei.com)
08:39:31 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 2.9)
08:39:52 cfricke joins (~cfricke@unaffiliated/cfricke)
08:39:53 GyroW_ joins (~GyroW@d54C03E98.access.telenet.be)
08:39:53 × GyroW_ quits (~GyroW@d54C03E98.access.telenet.be) (Changing host)
08:39:53 GyroW_ joins (~GyroW@unaffiliated/gyrow)
08:40:31 × GyroW quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 256 seconds)
08:40:55 × aarvar quits (~foewfoiew@50.35.43.33) (Ping timeout: 240 seconds)
08:41:11 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
08:41:11 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
08:41:11 jle` joins (~mstksg@unaffiliated/mstksg)
08:41:36 aarvar joins (~foewfoiew@50.35.43.33)
08:41:55 × glamas quits (~glamas@107.182.17.237) (Ping timeout: 240 seconds)
08:41:58 × DavidEichmann quits (~david@43.240.198.146.dyn.plus.net) (Ping timeout: 260 seconds)
08:42:43 jgt joins (~jgt@109.122.28.107)
08:42:56 petersen_ joins (~petersen@redhat/juhp)
08:43:33 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
08:43:55 × petersen quits (~petersen@redhat/juhp) (Ping timeout: 240 seconds)
08:44:18 petersen_ is now known as petersen
08:44:25 × mav2 quits (~mav@i5E862F77.versanet.de) (Ping timeout: 240 seconds)
08:44:25 × jespada quits (~jespada@90.254.246.48) (Ping timeout: 240 seconds)
08:44:34 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net)
08:45:24 × p-core quits (~Thunderbi@cst-prg-17-128.cust.vodafone.cz) (Ping timeout: 256 seconds)
08:45:27 × hive-mind quits (~hivemind@rrcs-67-53-148-69.west.biz.rr.com) (Disconnected by services)
08:45:51 hive-mind joins (~hivemind@rrcs-67-53-148-69.west.biz.rr.com)
08:45:55 × cp- quits (~cp-@b157153.ppp.asahi-net.or.jp) (Ping timeout: 240 seconds)
08:46:17 ekleog_ joins (~ii@prologin/ekleog)
08:46:38 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
08:46:50 mav2 joins (~mav@i5E862F77.versanet.de)
08:46:55 × sw1nn quits (~sw1nn@host86-173-104-87.range86-173.btcentralplus.com) (Ping timeout: 240 seconds)
08:46:59 coot_ joins (~coot@37.30.49.218.nat.umts.dynamic.t-mobile.pl)
08:47:19 sw1nn joins (~sw1nn@2a00:23c6:2385:3a00:f5c5:6984:9c64:d791)
08:47:34 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 265 seconds)
08:47:45 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
08:47:55 × coot quits (~coot@37.30.49.218.nat.umts.dynamic.t-mobile.pl) (Ping timeout: 240 seconds)
08:47:56 coot_ is now known as coot
08:48:11 jespada joins (~jespada@90.254.246.48)
08:48:25 × ekleog quits (~ii@prologin/ekleog) (Ping timeout: 240 seconds)
08:49:04 glamas joins (~glamas@107.182.17.237)
08:49:11 cp- joins (~cp-@b157153.ppp.asahi-net.or.jp)
08:49:23 p-core joins (~Thunderbi@cst-prg-5-175.cust.vodafone.cz)
08:50:45 × drbean quits (~drbean@TC210-63-209-50.static.apol.com.tw) (Quit: ZNC 1.8.2+cygwin1 - https://znc.in)
08:50:51 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Client Quit)
08:51:23 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 240 seconds)
08:51:53 jgt joins (~jgt@109.122.28.107)
08:51:58 Franciman joins (~francesco@host-212-171-42-250.retail.telecomitalia.it)
08:52:40 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
08:56:45 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 265 seconds)
08:58:25 × mav2 quits (~mav@i5E862F77.versanet.de) (Ping timeout: 264 seconds)
09:00:01 × RC-3004 quits (~RC-3004@195.206.169.184) ()
09:00:17 cosimone joins (~cosimone@2001:b07:ae5:db26:b248:7aff:feea:34b6)
09:00:38 × oisdk quits (~oisdk@2001:bb6:3329:d100:ec91:550b:f86b:f744) (Quit: oisdk)
09:00:59 jgt joins (~jgt@109.122.28.107)
09:02:07 cosimone_ joins (~cosimone@93-47-228-249.ip115.fastwebnet.it)
09:03:45 × cosimone quits (~cosimone@2001:b07:ae5:db26:b248:7aff:feea:34b6) (Read error: Connection reset by peer)
09:03:48 albert_99 joins (~Albert@p200300e5ff0b5b425d211d042df94ce7.dip0.t-ipconnect.de)
09:03:53 cosimone_ is now known as cosimone
09:05:25 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 240 seconds)
09:06:35 × GyroW_ quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 240 seconds)
09:07:27 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
09:07:27 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
09:07:27 GyroW joins (~GyroW@unaffiliated/gyrow)
09:07:44 jgt joins (~jgt@109.122.28.107)
09:11:55 × jgt quits (~jgt@109.122.28.107) (Ping timeout: 240 seconds)
09:17:14 Wuzzy joins (~Wuzzy@p5790e6f5.dip0.t-ipconnect.de)
09:18:11 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
09:18:11 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
09:18:11 jle` joins (~mstksg@unaffiliated/mstksg)
09:19:42 qapla_org joins (~qapla_org@s91904426.blix.com)
09:19:45 × p-core quits (~Thunderbi@cst-prg-5-175.cust.vodafone.cz) (Ping timeout: 240 seconds)
09:20:23 kuribas joins (~user@ptr-25vy0i8g17wkvauenpi.18120a2.ip6.access.telenet.be)
09:21:02 dyeplexer joins (~lol@unaffiliated/terpin)
09:22:03 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 260 seconds)
09:25:27 hackage free-functors 1.2.1 - Free functors, adjoint to functors that forget class constraints. https://hackage.haskell.org/package/free-functors-1.2.1 (SjoerdVisscher)
09:30:25 <gentauro> if I use the `network` package: https://hackage.haskell.org/package/network, can I then build the binary on a Windows 10 box?
09:31:03 × ericsagnes quits (~ericsagne@2405:6580:0:5100:97e:4c35:feee:3de8) (Ping timeout: 272 seconds)
09:31:14 DavidEichmann joins (~david@43.240.198.146.dyn.plus.net)
09:31:15 <sm[m]> yes
09:32:00 <gentauro> sm[m]: are there any "specific" *nix packages that can't be build on a Windows 10 box?
09:32:18 <gentauro> if yes, would it give sense to add that to `hackage`?
09:33:28 <sm[m]> gentauro: unix is one; vty is another
09:33:35 snakemasterflex joins (~snakemast@213.100.206.23)
09:33:47 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 256 seconds)
09:34:03 <sm[m]> Yes it would be nice to see that clearly on hackage, I'm not sure if it is shown
09:34:27 × machinedgod quits (~machinedg@d67-193-126-196.home3.cgocable.net) (Ping timeout: 265 seconds)
09:34:33 × Sanchayan quits (~Sanchayan@136.185.184.11) (Quit: leaving)
09:35:53 <sm[m]> basically I think if it depends transitively on unix, that's the signal
09:36:14 <jackdk> gentauro: make sure you have MSYS set up and that cabal knows about it. otherwise you'll get failures on any package that wants to run a `configure` script
09:36:47 <gentauro> jackdk: thx
09:36:49 <jackdk> the haskell-dev chocolatey package should do this correctly if you do a clean install
09:37:19 <jackdk> which I think is the current recommended way to get haskell on windows, but it's not an area I'm enormously familiar with
09:37:36 <sm[m]> using stack is the easiest
09:38:20 Guest_85 joins (5f66582c@adsl-dyn-44.95-102-88.t-com.sk)
09:38:23 da39a3ee5e6b4b0d joins (~textual@n11211935170.netvigator.com)
09:38:33 <gentauro> sm[m]: I intend to use `stack`, but it seems that `MSYS` is needed
09:38:37 oisdk joins (~oisdk@2001:bb6:3329:d100:1dc8:afe3:52e4:27ba)
09:38:41 × Guest_85 quits (5f66582c@adsl-dyn-44.95-102-88.t-com.sk) (Remote host closed the connection)
09:38:48 <sm[m]> stack provides it
09:39:03 <sm[m]> or ghc does, I'm not sure
09:40:57 mav2 joins (~mav@i5E862F77.versanet.de)
09:41:06 <gentauro> sm[m]: roget that. I will give it a try and if it fails, I will install MSYS
09:41:11 <gentauro> (as well)
09:41:23 <sm[m]> the stack binary is all you need to build most of hackage on windows
09:43:09 ericsagnes joins (~ericsagne@2405:6580:0:5100:b431:d8c5:c1de:6899)
09:43:19 <gentauro> oh. So jackdk might sugested that `MSYS` is needed when only using `cabal`. Got it (I think)
09:44:36 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
09:44:58 × carlomagno1 quits (~cararell@inet-hqmc01-o.oracle.com) (Ping timeout: 256 seconds)
09:45:06 <jackdk> I don't remember whether the stack installer brings along MSYS or not. But whatever build tool you use, you will need a way to run configure scripts, and that way is MSYS these days
09:45:13 raichoo joins (~raichoo@213.240.178.58)
09:45:15 __monty__ joins (~toonn@unaffiliated/toonn)
09:48:10 × da39a3ee5e6b4b0d quits (~textual@n11211935170.netvigator.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:48:32 × rprije quits (~rprije@203.214.95.251) (Remote host closed the connection)
09:48:45 fl0_id joins (~fl0_id@2a01:4f8:171:4de::40:2)
09:48:51 rprije joins (~rprije@203.214.95.251)
09:48:55 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
09:49:07 Lord_of_Life_ joins (~Lord@unaffiliated/lord-of-life/x-0885362)
09:51:27 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 260 seconds)
09:51:27 Lord_of_Life_ is now known as Lord_of_Life
09:52:26 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
09:52:26 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
09:52:26 jle` joins (~mstksg@unaffiliated/mstksg)
10:02:04 × peel quits (uid145489@gateway/web/irccloud.com/x-gaoowxyrodcvmckl) (Quit: Connection closed for inactivity)
10:02:06 <phadej> mimi_vx: `ghc` is not buildable package. It's uploaded to hackage purely for haddock purposes
10:02:11 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 260 seconds)
10:02:23 dcoutts joins (~duncan@33.14.75.194.dyn.plus.net)
10:02:23 × dcoutts quits (~duncan@33.14.75.194.dyn.plus.net) (Changing host)
10:02:23 dcoutts joins (~duncan@unaffiliated/dcoutts)
10:02:37 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 246 seconds)
10:02:47 <mimi_vx> phadej yes, but for example try build hie-bios on system with ghc-8.10.2
10:03:12 <mimi_vx> phadej: using cabal , from hackage
10:03:29 snakemasterflex joins (~snakemast@213.100.206.23)
10:03:36 dincio joins (~dincio@host-87-0-5-208.retail.telecomitalia.it)
10:03:41 <fl0_id> hey, what is a good way / guideline to compile ghc (etc) for repackaging? this is necessary for conda-forge (conda-forge.org) so that we do not rely on distribution packages. And because of the old ghc version used by centos 6, I think I would have to start from ghc 7.4 to bootstrap. It just give weird linker errors and stuff like that. Is here a good place to ask questions about that?
10:03:53 <mimi_vx> phadej: you end with https://pastebin.com/TvXYZ8d1
10:04:28 Rudd0 joins (~Rudd0@185.189.115.103)
10:04:40 <mimi_vx> phadej: so not only haddock docu , but also dependency resolution for packages which depends on GHC
10:05:04 <maerwald> fl0_id: is conda-forge centos7 compatible?
10:05:32 <mimi_vx> phadej: well , prtially main problem is different base package for 8.10.1 and 8.10.2
10:06:00 <phadej> mimi_vx: are you sure you don't have some freeze file or something which makes solver want to pick up 8.10.1
10:06:04 × jchia__ quits (~jchia@58.32.35.239) (Quit: Leaving.)
10:06:08 <phadej> because there is no such bound on hie-bios itself
10:06:11 <mimi_vx> clean cabal
10:06:18 <mimi_vx> hie-bios depends onb ghc
10:06:39 <mimi_vx> and hackage return as last ghc 8.10.1 which has base 4.14.0.0
10:06:47 <maerwald> I don't think the solver looks up the ghc package from hackage, because it's always installed with a GHC
10:06:48 × seanparsons quits (~sean@cpc145088-gill21-2-0-cust281.20-1.cable.virginm.net) (Quit: ZNC 1.7.5 - https://znc.in)
10:07:00 <fl0_id> maerwald it is an option yes, but by default it is centos 6
10:07:14 <phadej> he left
10:07:16 <mimi_vx> but ghc 8.10.2 has base 4.14.1.0 so it isnt possible satisfy ghc deps of hie-bios
10:07:19 × ambiso quits (~ambiso@209.182.239.205) (Quit: The Lounge - https://thelounge.chat)
10:07:19 <fl0_id> and still centos 7 uses an non-current ghc iirc
10:07:23 <maerwald> fl0_id: https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-x86_64-centos67-linux.tar.xz
10:07:25 <phadej> mimi_vx: I don't believe you, https://pastebin.com/3vsPE9z9 it works here
10:07:26 <phadej> fine
10:07:27 seanparsons joins (~sean@cpc145088-gill21-2-0-cust281.20-1.cable.virginm.net)
10:07:38 <maerwald> fl0_id: https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-centos7-linux.tar.xz
10:07:44 <phadej> hie-bios doesn't have 4.14.1.0 bound
10:07:51 <phadej> or specifically, hie-bios-0.7.1
10:08:01 <mimi_vx> hmm, -w flag
10:08:02 ambiso joins (~ambiso@209.182.239.205)
10:08:17 <fl0_id> maerwald yeah, that I know. but we want to build because there are no binaries for aarch64 and ppc64le at least.
10:08:26 <maerwald> ah
10:08:35 <fl0_id> (or at least not anymore / not consistently)
10:08:48 <maerwald> yeah, that's gonna be fun, you might get more help in #ghc
10:09:27 <fl0_id> mmh ok
10:09:48 <fl0_id> maerwald thansk
10:10:03 <phadej> mimi_vx: your paste is unclear, it doesn't tell whether `ghc` in your path is ghc-8.10.2 or some else
10:11:57 × mav2 quits (~mav@i5E862F77.versanet.de) (Quit: WeeChat 2.9)
10:12:15 <mimi_vx> phadej: https://pastebin.com/HL8dRErY
10:12:28 × dincio quits (~dincio@host-87-0-5-208.retail.telecomitalia.it) (Quit: WeeChat 2.9)
10:12:57 × kori quits (~kori@arrowheads/kori) (Ping timeout: 260 seconds)
10:12:59 × aarvar quits (~foewfoiew@50.35.43.33) (Ping timeout: 240 seconds)
10:13:46 <phadej> I'm sure that either you are in a project folder, or you have ~/.ghc/*-8.10.2/default or something which confuses the solver
10:14:03 <mimi_vx> no
10:14:11 ralejs joins (~ralejs@2620:10d:c093:400::5:2842)
10:14:12 <mimi_vx> look at paste ...
10:14:12 Guest18 joins (567e8866@gateway/web/cgi-irc/kiwiirc.com/ip.86.126.136.102)
10:14:14 <phadej> but you removed them, so I don't know what's wrong on your system
10:14:16 <mimi_vx> claen , after rm
10:14:26 <mimi_vx> clean system ghc-8.10.2
10:14:49 <mimi_vx> and [__2] rejecting: base-4.14.1.0/installed-4.14.1.0 (conflict: ghc => base<0 &&
10:14:51 <mimi_vx> ==4.14.*)
10:14:53 × plutoniix quits (~q@175.176.222.7) (Quit: Leaving)
10:15:27 <mimi_vx> states installed base-4.14.1.0 --> shipped with ghc-8.10.2
10:15:30 <phadej> yes, that is a way to say "don't ever try to reinstall base"
10:16:38 <mimi_vx> phadej: nobody reinstalled / upgraded base outside shipped with ghc, and ghc-8.10.2 updated version of base
10:16:41 <phadej> what your `ghc-pkg list` says
10:17:17 × xff0x quits (~fox@2001:1a81:5300:fe00:7915:3d42:ba93:76ea) (Ping timeout: 272 seconds)
10:17:19 da39a3ee5e6b4b0d joins (~textual@n11211935170.netvigator.com)
10:17:21 aarvar joins (~foewfoiew@50.35.43.33)
10:17:45 xff0x joins (~fox@2001:1a81:5300:fe00:a1a2:2812:1aa4:a833)
10:18:07 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
10:18:07 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
10:18:07 jle` joins (~mstksg@unaffiliated/mstksg)
10:19:07 <mimi_vx> phadej: https://pastebin.com/AzWHkt0Y
10:19:45 <phadej> that is screwed one, why there is so much stuff?
10:19:50 <phadej> and specifically, there is no `ghc`
10:19:52 jgt joins (~jgt@233724.soborka.net)
10:20:14 <phadej> do you try to use systems' own GHC on some bleeding edge distro? (don't)
10:21:03 <phadej> you probably do, because "/usr/lib64/ghc-8.10.2/package.conf.d"
10:21:24 <phadej> why they remove `ghc` package, I don't know. But that means there is no way you can install hie-bios
10:21:34 <phadej> `ghc` is not buildable with cabal-install
10:21:34 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 244 seconds)
10:21:53 <phadej> complain to your distro packages.
10:21:56 <mimi_vx> ahh, thx
10:21:56 <phadej> packagers*
10:22:31 <mimi_vx> now find why isnt correctlyu added ghc-8.10.2 to package config
10:23:04 <maerwald> arch linux? :p
10:23:59 Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas)
10:24:54 × ralejs quits (~ralejs@2620:10d:c093:400::5:2842) (Read error: Connection reset by peer)
10:25:18 ralejs joins (~ralejs@2620:10d:c093:400::5:2842)
10:26:57 hackage lists-flines 0.1.0.0 - Additional data and structures to some 'String'-related lists. https://hackage.haskell.org/package/lists-flines-0.1.0.0 (OleksandrZhabenko)
10:28:41 × alp quits (~alp@2a01:e0a:58b:4920:710e:4c3d:416d:5e7c) (Ping timeout: 272 seconds)
10:29:36 × oisdk quits (~oisdk@2001:bb6:3329:d100:1dc8:afe3:52e4:27ba) (Quit: oisdk)
10:29:55 × rprije quits (~rprije@203.214.95.251) (Ping timeout: 240 seconds)
10:31:53 × SirClueless quits (42413686@cpe-66-65-54-134.nyc.res.rr.com) (Remote host closed the connection)
10:33:21 carlomagno joins (~cararell@inet-hqmc01-o.oracle.com)
10:34:20 snakemasterflex joins (~snakemast@213.100.206.23)
10:35:20 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 256 seconds)
10:37:15 × da39a3ee5e6b4b0d quits (~textual@n11211935170.netvigator.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:40:12 raehik joins (~raehik@cpc96984-rdng25-2-0-cust109.15-3.cable.virginm.net)
10:43:40 alp joins (~alp@88.126.45.36)
10:43:50 × ixlun quits (~matthew@213.205.241.94) (Ping timeout: 256 seconds)
10:45:38 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
10:47:15 tito_04 is now known as taurux
10:50:20 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds)
10:52:52 mav1 joins (~mav@dynamic-002-247-240-164.2.247.pool.telefonica.de)
10:53:49 × mav1 quits (~mav@dynamic-002-247-240-164.2.247.pool.telefonica.de) (Client Quit)
10:55:44 × taurux quits (~taurux@net-93-151-203-67.cust.dsl.teletu.it) (Ping timeout: 256 seconds)
10:56:58 hackage stylish-haskell 0.12.1.0 - Haskell code prettifier https://hackage.haskell.org/package/stylish-haskell-0.12.1.0 (JasperVanDerJeugt)
10:57:02 taurux joins (~taurux@net-93-151-203-67.cust.vodafonedsl.it)
11:00:55 × bgavran quits (sid393312@gateway/web/irccloud.com/x-utpuhsntfvyeuxwq) (Quit: Connection closed for inactivity)
11:02:02 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
11:02:02 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
11:02:02 jle` joins (~mstksg@unaffiliated/mstksg)
11:04:27 hackage lists-flines 0.1.0.1 - Additional data and structures to some 'String'-related lists. https://hackage.haskell.org/package/lists-flines-0.1.0.1 (OleksandrZhabenko)
11:05:46 × kuribas quits (~user@ptr-25vy0i8g17wkvauenpi.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
11:07:13 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 260 seconds)
11:14:54 jgt1 joins (~jgt@94.153.49.138)
11:17:03 kupi joins (uid212005@gateway/web/irccloud.com/x-yncctbtvpcjbjnzz)
11:17:16 × jgt quits (~jgt@233724.soborka.net) (Ping timeout: 256 seconds)
11:18:45 × Buntspecht quits (~user@unaffiliated/siracusa) (Quit: Bye!)
11:19:29 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
11:19:29 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
11:19:29 jle` joins (~mstksg@unaffiliated/mstksg)
11:22:51 totallynotnate joins (~nate@125.160.143.17)
11:25:15 darjeeling_ joins (~darjeelin@115.215.43.235)
11:27:25 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 240 seconds)
11:28:03 × berberman quits (~berberman@123.118.108.235) (Ping timeout: 260 seconds)
11:28:19 da39a3ee5e6b4b0d joins (~textual@n11211935170.netvigator.com)
11:29:51 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
11:29:51 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
11:29:51 jle` joins (~mstksg@unaffiliated/mstksg)
11:32:02 berberman joins (~berberman@123.118.106.9)
11:36:03 hekkaidekapus_ joins (~tchouri@gateway/tor-sasl/hekkaidekapus)
11:36:23 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 260 seconds)
11:37:00 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
11:37:43 × hekkaidekapus quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 240 seconds)
11:38:53 × jgt1 quits (~jgt@94.153.49.138) (Read error: Connection reset by peer)
11:38:59 × berberman quits (~berberman@123.118.106.9) (Ping timeout: 240 seconds)
11:40:32 berberman joins (~berberman@123.118.110.73)
11:41:25 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
11:46:32 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
11:47:09 ggole joins (~ggole@2001:8003:8119:7200:18b6:6ff8:b669:283)
11:48:02 jedws joins (~jedws@121.209.186.103)
11:48:18 × jedws quits (~jedws@121.209.186.103) (Client Quit)
11:49:25 × totallynotnate quits (~nate@125.160.143.17) (Quit: WeeChat 2.9)
11:50:55 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
11:51:36 drbean joins (~drbean@TC210-63-209-192.static.apol.com.tw)
11:51:47 × tsrt^ quits (tsrt@ip98-184-89-2.mc.at.cox.net) ()
11:52:48 henninb joins (~henninb@63-226-191-96.mpls.qwest.net)
11:53:07 berberman_ joins (~berberman@2408:8207:256e:d930:584e:a9ff:fe9b:d3fe)
11:53:25 entkme^ joins (entkme@ip98-184-89-2.mc.at.cox.net)
11:53:45 reppertj joins (~textual@pool-96-246-209-59.nycmny.fios.verizon.net)
11:54:59 × berberman quits (~berberman@123.118.110.73) (Ping timeout: 240 seconds)
11:55:28 × henninb quits (~henninb@63-226-191-96.mpls.qwest.net) (Client Quit)
12:00:02 × qapla_org quits (~qapla_org@s91904426.blix.com) ()
12:00:06 henninb joins (~henninb@63-226-191-96.mpls.qwest.net)
12:02:44 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Quit: gone to sleep. ZZZzzz…)
12:04:33 × coot quits (~coot@37.30.49.218.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
12:05:51 nineonin_ joins (~nineonine@216-19-190-182.dyn.novuscom.net)
12:06:09 × raichoo quits (~raichoo@213.240.178.58) (Quit: Lost terminal)
12:08:27 hackage acc 0.1.3 - Sequence optimized for monoidal construction and folding https://hackage.haskell.org/package/acc-0.1.3 (NikitaVolkov)
12:08:33 × henninb quits (~henninb@63-226-191-96.mpls.qwest.net) (Quit: leaving)
12:09:03 × nineonine quits (~nineonine@50.216.62.2) (Ping timeout: 260 seconds)
12:09:43 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
12:12:23 × taurux quits (~taurux@net-93-151-203-67.cust.vodafonedsl.it) (Ping timeout: 260 seconds)
12:13:58 taurux joins (~taurux@net-93-146-149-217.cust.vodafonedsl.it)
12:14:52 henninb joins (~henninb@63-226-191-96.mpls.qwest.net)
12:16:09 mirrorbird joins (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276)
12:16:47 × xff0x quits (~fox@2001:1a81:5300:fe00:a1a2:2812:1aa4:a833) (Ping timeout: 244 seconds)
12:17:00 × dyeplexer quits (~lol@unaffiliated/terpin) (Ping timeout: 256 seconds)
12:17:56 xff0x joins (~fox@2001:1a81:5300:fe00:1175:d8f5:8ada:f855)
12:18:55 dyeplexer joins (~lol@unaffiliated/terpin)
12:20:14 × Stanley00 quits (~stanley00@unaffiliated/stanley00) (Remote host closed the connection)
12:20:34 × henninb quits (~henninb@63-226-191-96.mpls.qwest.net) (Quit: leaving)
12:20:47 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 240 seconds)
12:21:30 henninb joins (~henninb@63-226-191-96.mpls.qwest.net)
12:21:35 × henninb quits (~henninb@63-226-191-96.mpls.qwest.net) (Client Quit)
12:21:49 luka joins (~luka@185.204.1.185)
12:22:12 luka is now known as Guest4175
12:22:59 × mirrorbird quits (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276) (Ping timeout: 244 seconds)
12:24:04 Kaivo joins (~Kaivo@104-200-86-99.mc.derytele.com)
12:24:12 × ralejs quits (~ralejs@2620:10d:c093:400::5:2842) (Read error: Connection reset by peer)
12:24:59 ralejs joins (~ralejs@2620:10d:c093:400::5:2842)
12:27:25 henninb joins (~henninb@63-226-191-96.mpls.qwest.net)
12:27:38 × henninb quits (~henninb@63-226-191-96.mpls.qwest.net) (Client Quit)
12:27:54 henninb joins (~henninb@63-226-191-96.mpls.qwest.net)
12:28:21 × henninb quits (~henninb@63-226-191-96.mpls.qwest.net) (Client Quit)
12:28:38 henninb joins (~henninb@63-226-191-96.mpls.qwest.net)
12:28:45 × henninb quits (~henninb@63-226-191-96.mpls.qwest.net) (Client Quit)
12:31:02 × stree_ quits (~stree@50-108-75-26.adr01.mskg.mi.frontiernet.net) (Quit: Caught exception)
12:31:20 stree joins (~stree@50-108-75-26.adr01.mskg.mi.frontiernet.net)
12:31:27 × chaosmasttter quits (~chaosmast@p200300c4a73b2e0100f3c5a701cd6e56.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
12:36:54 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
12:36:54 × ralejs quits (~ralejs@2620:10d:c093:400::5:2842) (Read error: Connection reset by peer)
12:36:54 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
12:36:54 jle` joins (~mstksg@unaffiliated/mstksg)
12:37:13 ralejs joins (~ralejs@2620:10d:c093:400::5:2842)
12:38:48 × John20 quits (~John@82.46.59.122) (Ping timeout: 260 seconds)
12:39:49 oisdk joins (~oisdk@2001:bb6:3329:d100:1dc8:afe3:52e4:27ba)
12:45:43 × Gurkenglas quits (~Gurkengla@unaffiliated/gurkenglas) (Ping timeout: 244 seconds)
12:47:12 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
12:48:10 chaosmasttter joins (~chaosmast@p200300c4a73b2e0100f3c5a701cd6e56.dip0.t-ipconnect.de)
12:50:32 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
12:50:46 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
12:50:46 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
12:50:46 GyroW joins (~GyroW@unaffiliated/gyrow)
12:51:56 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds)
12:54:19 machinedgod joins (~machinedg@d67-193-126-196.home3.cgocable.net)
12:56:34 × Rudd0 quits (~Rudd0@185.189.115.103) (Ping timeout: 244 seconds)
12:58:38 × machinedgod quits (~machinedg@d67-193-126-196.home3.cgocable.net) (Ping timeout: 244 seconds)
12:59:24 urodna joins (~urodna@unaffiliated/urodna)
13:00:16 John20 joins (~John@82.46.59.122)
13:00:23 lpy joins (~lpyfist@unaffiliated/elysian)
13:01:57 hackage haskell-lsp-types 0.23.0.0 - Haskell library for the Microsoft Language Server Protocol, data types https://hackage.haskell.org/package/haskell-lsp-types-0.23.0.0 (luke_)
13:02:57 hackage haskell-lsp 0.23.0.0 - Haskell library for the Microsoft Language Server Protocol https://hackage.haskell.org/package/haskell-lsp-0.23.0.0 (luke_)
13:04:35 p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515)
13:05:17 × p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Remote host closed the connection)
13:05:39 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:68ef:3717:d255:fea6)
13:06:49 pfurla joins (~pfurla@104.192.219.186)
13:08:29 × elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Quit: WeeChat 2.9)
13:12:06 × klardotsh quits (~klardotsh@c-71-231-242-112.hsd1.wa.comcast.net) (Ping timeout: 258 seconds)
13:17:28 × olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Ping timeout: 258 seconds)
13:17:55 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
13:20:42 Guest_18 joins (4f2cdbb5@host-79-44-219-181.retail.telecomitalia.it)
13:21:46 × Guest_18 quits (4f2cdbb5@host-79-44-219-181.retail.telecomitalia.it) (Remote host closed the connection)
13:22:40 × polyrain quits (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107) (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:25:13 × kupi quits (uid212005@gateway/web/irccloud.com/x-yncctbtvpcjbjnzz) (Quit: Connection closed for inactivity)
13:30:20 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
13:31:11 <gentauro> is there a way to find the code for `tuples` with `hoogle`? (tuple as in: `( 42, 'a')`
13:31:21 mirrorbird joins (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276)
13:32:37 Tops2 joins (~Tobias@dyndsl-095-033-017-021.ewe-ip-backbone.de)
13:35:19 parisienne___ joins (sid383587@gateway/web/irccloud.com/x-ocvqtewkhvwerdzi)
13:36:06 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:68ef:3717:d255:fea6) (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:36:58 <dminuoso> code for tuples?
13:37:14 <dminuoso> What exactly are you looking for?
13:38:58 Tops21 joins (~Tobias@dyndsl-095-033-017-021.ewe-ip-backbone.de)
13:39:25 × ericsagnes quits (~ericsagne@2405:6580:0:5100:b431:d8c5:c1de:6899) (Ping timeout: 240 seconds)
13:40:00 × parisienne___ quits (sid383587@gateway/web/irccloud.com/x-ocvqtewkhvwerdzi) (Client Quit)
13:40:04 mpereira joins (~mpereira@2a02:810d:f40:d96:1c35:7f2e:59ff:953)
13:41:04 bitmapper joins (uid464869@gateway/web/irccloud.com/x-umfptdbczzisdhag)
13:41:36 invaser joins (~Thunderbi@31.148.23.125)
13:42:02 × Tops2 quits (~Tobias@dyndsl-095-033-017-021.ewe-ip-backbone.de) (Ping timeout: 244 seconds)
13:42:27 frdg joins (60e94035@pool-96-233-64-53.bstnma.fios.verizon.net)
13:45:09 <frdg> `equal xs ys = subset xs ys && subset ys xs`. Is there a general way to apply this function in both directions instead of explicitly calling subset twice?
13:46:42 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
13:46:53 GyroW joins (~GyroW@d54C03E98.access.telenet.be)
13:46:53 × GyroW quits (~GyroW@d54C03E98.access.telenet.be) (Changing host)
13:46:53 GyroW joins (~GyroW@unaffiliated/gyrow)
13:47:52 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
13:47:57 <dminuoso> Nothing as concise.
13:48:45 × drbean quits (~drbean@TC210-63-209-192.static.apol.com.tw) (Ping timeout: 244 seconds)
13:49:33 <frdg> ok
13:49:43 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:bd24:9726:f60a:ba09)
13:51:26 <dminuoso> frdg: There's of course the option to define some `symmEq p x y = p x y && p y z`, which can be handy if you define a bunch of functions like equal.
13:51:47 ericsagnes joins (~ericsagne@2405:6580:0:5100:953c:5f38:35fd:b3fd)
13:51:57 <dminuoso> (Or well, call it symm rather than symmEq, but you get the idea)
13:52:16 <dminuoso> But if this is just a one-off, I'd just write it like you put it
13:52:36 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds)
13:54:29 <frdg> yes I went to write something like symm, but I see why its kind of just extra confusion.
13:55:17 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
13:56:18 <gentauro> dminuoso: just the place in GHC where `tuples` are handled :)
13:56:26 GyroW_ joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
13:56:26 × GyroW_ quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
13:56:26 GyroW_ joins (~GyroW@unaffiliated/gyrow)
13:56:53 <gentauro> like I wrote: `( 42, 'a')` but also `( 42, 'a', "b")`
13:57:07 <dminuoso> What do you mean by "handled" exactly?
13:57:08 × idhugo quits (~idhugo@users-1190.st.net.au.dk) (Ping timeout: 256 seconds)
13:57:14 <dminuoso> Do you want to know how tuples are defined in GHC?
13:57:23 × GyroW quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 265 seconds)
13:57:27 <dminuoso> https://hackage.haskell.org/package/ghc-prim-0.6.1/docs/src/GHC.Tuple.html#%28%2C%29
13:57:32 cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net)
13:57:49 <dminuoso> (Im not sure whether that code is actually used, or whether that's just for haddock assistence)
13:57:52 <[exa]> gentauro: there's some desugaring to (,) (,,) (,,,) ..., and the data is AFAIK defined normally using `data`
13:58:14 Falkeo joins (5631fd8b@ip-86-49-253-139.net.upcbroadband.cz)
13:58:19 <dminuoso> The import at the top of the module suggests that is the real definition
13:59:17 jiribenes joins (jbjiribene@gateway/shell/matrix.org/x-vhnsqdmfgjajakfv)
13:59:41 <[exa]> btw why is everyone using a b c d e f... for tuple variable names instead of a1 a2 a3 (which are noticeably better for determining how long the definition actually is) ?
14:00:18 <dminuoso> Half as many characters?
14:00:37 <dminuoso> Also, there's a common theme of enumerating letters
14:00:42 parisienne joins (sid383587@gateway/web/irccloud.com/x-tqyeuopclcyqmelh)
14:00:44 <dminuoso> type Lens s t a b = ...
14:00:59 <dminuoso> That also pervades much of mathematics
14:01:47 <[exa]> I still kinda hope that no one is going to use say 14-tuple, so won't need to remember that it should end with `n`
14:02:37 <[exa]> but seriously for mechanical code like this I find the usage of a b c d ... followed by a1 b1 c1 ... well counterintuitive. :]
14:02:45 <dminuoso> Im quite confident large tuples are used amongst postgresql-simple users.
14:03:12 <dminuoso> query conn qry (a, b, c, d, e) ...
14:04:05 <[exa]> jiribenes: o/
14:04:14 strugglingming joins (sid10571@gateway/web/irccloud.com/x-pwoyzccowxbiqivf)
14:04:37 × alp quits (~alp@88.126.45.36) (Ping timeout: 258 seconds)
14:04:49 <[exa]> hm yes, relations, forgot about them again.
14:05:04 <gentauro> 15:57 < dminuoso> Do you want to know how tuples are defined in GHC?
14:05:04 <gentauro> yes
14:05:10 <gentauro> 15:57 < dminuoso> https://hackage.haskell.org/package/ghc-prim-0.6.1/docs/src/GHC.Tuple.html#%28%2C%29
14:05:16 <gentauro> I didn't expect this …
14:05:53 <[exa]> straightforward right? :D
14:06:47 <dminuoso> Nobody expects the spanish inquisition.
14:07:12 Sheilong joins (uid293653@gateway/web/irccloud.com/x-wunoznsilndrshkm)
14:07:39 <gentauro> what would it take to convert `GHC.Tuple` to `GHC.TupleWithLabel` => `GHC.AnonymousRecord`?
14:07:50 <gentauro> s/convert/derive/
14:07:57 <dolio> I think they decided long ago that it was easier to just make GHC handle the illegal declarations than to hack them in.
14:08:41 spew joins (uid195861@gateway/web/irccloud.com/x-zoqmilcrntqznxpj)
14:09:01 <dminuoso> And then have their users tell customers to just go for Agda if they wanted custom mixfix, while using it themselves!
14:09:51 Sgeo joins (~Sgeo@ool-18b982ad.dyn.optonline.net)
14:10:05 <dolio> Well, it still needs to be special cased.
14:10:27 solonarv joins (~solonarv@astrasbourg-653-1-252-112.w92-161.abo.wanadoo.fr)
14:10:28 <dolio> It's probably just less special cases.
14:11:42 flatmap joins (~flatmap@p200300dd371bf60068aa0495bfcb4a49.dip0.t-ipconnect.de)
14:11:51 <noctux> "Manuel says: Including one more declaration gives a segmentation fault."
14:12:01 <noctux> good to know :P
14:12:30 <dminuoso> noctux: Amusingly it was never discovered why
14:12:36 <dminuoso> The bug could still be there.
14:13:23 <dminuoso> Rather than identifying memory corruption, it was deemed easier to comment them out and hope for the best. :p
14:14:16 × xerox_ quits (~xerox@unaffiliated/xerox) (Ping timeout: 272 seconds)
14:14:32 <Squarism> jackdk. Sorry, work happened. I want users of the library be able to write a their own type that we can call TheirType. It must only contain the allowed elements and nodes need to be of a certain type. I want to use TH to to generate the posted datastructure from TheirType. That will later be used to create a serializable index to parts of the datastructure. I need it to be serializable so I can send it over the wire.
14:14:40 <noctux> till the day of the 63 element tuple appears :p
14:16:07 <Squarism> jackdk, or the structure I posted is something I know I can construct a serializable index for.
14:16:30 <Squarism> as in paths to leafs in the datastructe.
14:16:50 jgt1 joins (~jgt@78.26.168.236)
14:20:21 <shapr> yay, #haskell 20th anniversary is in 30 weeks!
14:21:16 Stanley00 joins (~stanley00@unaffiliated/stanley00)
14:24:55 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 240 seconds)
14:26:12 × Stanley00 quits (~stanley00@unaffiliated/stanley00) (Ping timeout: 256 seconds)
14:26:28 Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas)
14:32:50 × parisienne quits (sid383587@gateway/web/irccloud.com/x-tqyeuopclcyqmelh) ()
14:36:31 <Cheery> I just got to examining how relax NG works and wow that thing is named badly.
14:36:31 × ralejs quits (~ralejs@2620:10d:c093:400::5:2842) (Read error: Connection reset by peer)
14:36:59 ralejs joins (~ralejs@2620:10d:c093:400::5:2842)
14:37:06 parisienne joins (sid383587@gateway/web/irccloud.com/x-wkbgoesgrpfdelps)
14:38:12 <Cheery> well maybe it signifies the problem in HTML5 and pals.
14:39:52 × GyroW_ quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
14:40:08 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
14:40:09 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
14:40:09 GyroW joins (~GyroW@unaffiliated/gyrow)
14:40:24 fog23 joins (c1b057e2@gateway/web/cgi-irc/kiwiirc.com/ip.193.176.87.226)
14:41:53 <fog23> i tried c# the other day, they dont even have sum types!?
14:42:22 <shapr> we got sum type
14:42:39 <dminuoso> Most languages dont have sum types...
14:42:39 <fog23> they were saying "dont use haskell - you wont be able to get a job" and i was like - but i can actually express programs!!
14:42:53 <dminuoso> Or very poor support for mimicing.
14:43:08 <dminuoso> Pythonistas get away by just using dictionaries everywhere.
14:43:17 <davve> stark contrast between C# and haskell
14:43:30 <fog23> yeah, i eventually managed to write maybe using somehting like "enums and generic classes" but it was a total mess
14:44:31 <fog23> and, it did not seem like it was even worth trying to do "generics" as they call it - basically polymorphic type restrictions
14:44:44 <fog23> where it would need eg a list of types at type level
14:44:47 <dolio> If you need to do .net stuff, it's probably worth looking at F#.
14:44:58 <fog23> i could hardely even *write* a list!!
14:45:28 <fog23> dolio: the closet thing to .net i ever thought of using was node
14:45:36 idhugo joins (~idhugo@563472ae.rev.stofanet.dk)
14:46:00 <[exa]> fog23: luckily for you, c# has auto-maybe on almost everything!
14:46:07 <Uniaika> [exa]: hahahaha
14:46:11 <Cheery> I'd love to bash C#, but it's bit of stale because it's too easy.
14:46:18 <fog23> they kept shouting at me for trying to use a "cons list" instead of their built in version
14:46:46 <fog23> [exa] i only wanted maybe to write list...
14:47:15 <fog23> List a = Maybe (a,List a)
14:47:24 <fog23> (they have pairs at least)
14:48:17 <fog23> it just left me totally exasperated. how can this be a more industrially applicable language than haskell!?
14:48:27 <dminuoso> 16:46:18 fog23 | they kept shouting at me for trying to use a "cons list" instead of their built in version
14:48:34 <dminuoso> You insist on not following a language idioms.
14:48:47 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
14:48:49 <dminuoso> There's little value in being thickheaded and trying to write C# as if it were Haskell
14:49:11 <fog23> everything i understand is built around get/set ! i worked for a full year just on the traverse class
14:49:25 × balbirs quits (~balbirs__@ozlabs.org) (Ping timeout: 264 seconds)
14:49:41 <fog23> the idea of not even being able to *express* a cons list made my skin crawl
14:49:49 × ralejs quits (~ralejs@2620:10d:c093:400::5:2842) (Read error: Connection reset by peer)
14:49:54 <dminuoso> And "industrially applicable" depends on factors such as "how well is the implementation", "how stable it is it", "how much tooling do you have", "how is library support for your problem domain", "how many developers can you easily get"
14:50:05 × phaul quits (~phaul@ruby/staff/phaul) (Ping timeout: 240 seconds)
14:50:18 ralejs joins (~ralejs@2620:10d:c093:400::5:2842)
14:50:25 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 240 seconds)
14:50:28 <dminuoso> And for what its worth, .net has linked lists.
14:50:32 <fog23> i was trying to justify why a cons list is so important
14:50:39 <dminuoso> They are doubly linked, but oh well
14:50:52 <fog23> i guess thats what industry would need to understand - i hadnt realised what a large difference there was
14:51:07 <fog23> and that the fundamental stunbling block would be something as simple as sum types
14:51:08 <dolio> They're probably mutable linked lists, so you have to be careful what you do with them.
14:51:17 <dminuoso> Im willing to argue that cons lists are not even so important in other languages.
14:51:24 jle` joins (~mstksg@cpe-23-240-75-236.socal.res.rr.com)
14:51:24 × jle` quits (~mstksg@cpe-23-240-75-236.socal.res.rr.com) (Changing host)
14:51:24 jle` joins (~mstksg@unaffiliated/mstksg)
14:51:34 <fog23> right, but why are they so useful to us
14:51:38 <fog23> that more to the point
14:51:50 <fog23> that would be "why should industry use haskell"
14:51:51 <dminuoso> We encode control flow in lists
14:52:00 <dminuoso> Other languages just do some imperative take with a for-loop.
14:52:01 <fog23> but why is that better
14:52:28 <dminuoso> Well, its only better because we've built an entire eco system around the idea.
14:52:29 <fog23> i began trying to talk about higher order functions
14:52:41 <dminuoso> Let's take C++ for instance
14:52:57 <fog23> and about the ubiquity of the church state duality - but i dont think they were ready
14:53:04 <dminuoso> Looping over things in C++ requires using iterators
14:53:09 <dminuoso> Or manual for loops
14:53:14 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds)
14:53:30 <fog23> i mean, what can we *do* with our "enhanced ecosystem"
14:54:01 <dminuoso> Does it matter? The relevant point is, trying to transport "the idea that florishes in Haskell" and "insisting it must be useful in another language because its useful in Haskell" is a very poor start.
14:54:10 × ryansmccoy quits (~ryansmcco@156.96.151.132) (Ping timeout: 272 seconds)
14:54:15 <fog23> i just take the "style" for granted, and not actually being able to understand how they can do anything at all without GADTs and tail recursion - i couldnt easily say why haskell was better
14:54:34 <dminuoso> Most of the time, its better to just accept the other languages paradigms, and write idiomatic (in their language) code instead.
14:54:46 <dminuoso> The code ends up less convoluted and more maintainable
14:54:48 <dminuoso> Strangely
14:54:53 <fog23> but what could that enable, and what would it lose?
14:54:57 <Cheery> I just recently figured out dhall is really short distance away from a markup language.
14:55:07 ryansmccoy joins (~ryansmcco@156.96.151.132)
14:55:39 <fog23> sure, i get how the "idiomatic" code is easier to read and write
14:55:45 mav1 joins (~mav@p5dd5a8a0.dip0.t-ipconnect.de)
14:55:55 × jle` quits (~mstksg@unaffiliated/mstksg) (Ping timeout: 240 seconds)
14:55:56 <fog23> but, everything i do is based on traversals
14:56:12 <dminuoso> Well, people coming over to Haskell have the same exact problem.
14:56:12 <fog23> i thought it was everything anyone *could* do
14:56:33 <dminuoso> Everything they do is ad-hoc imperative manipulation of state, and they cant figure out how to translate the *idea* into something declarative
14:56:55 <dminuoso> This is the same, just in reverse.
14:56:55 <fog23> right, but thats more like just restating the point about idioms
14:56:59 <fog23> yeah
14:57:20 phaul joins (~phaul@ruby/staff/phaul)
14:57:27 <fog23> i was trying to understand what we actually gain from the syntax built to facilitate lazy recursion
14:57:27 <Cheery> if you think about things such as html, how is it deconstructed or constructed?
14:57:35 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 2.9)
14:57:42 <Cheery> if you wanted to examine it from what it encodes usually.
14:57:50 <fog23> idk! its top down evaluation right?
14:58:08 hnOsmium0001 joins (uid453710@gateway/web/irccloud.com/x-lsiqjycknfirtsck)
14:58:09 <fog23> we have more of an AST right? like a "lambda tree" or something
14:58:52 <fog23> like *everything* is made by functional binding and dereferencing, with no top down evaluation at all
14:59:00 polyphem joins (~p0lyph3m@2a02:810d:640:776c:76d7:55f6:f85b:c889)
14:59:06 <fog23> i guess thats the main difference between imperative and functional programming...
14:59:33 <fog23> so i cant really see how you could speak of "producers/consumers" in HTML
14:59:47 <dminuoso> Well, formally that's the difference between call-by-value and call-by-name/need
15:00:01 × Guest4175 quits (~luka@185.204.1.185) ()
15:00:12 <fog23> to do with the top level let bindings?
15:00:31 <fog23> i guess we do alot with precedence
15:00:32 <dminuoso> Interestingly, in C++ the term "call-by-value" is grossly misunderstood, as people have introduced something called call-by-reference.
15:00:42 × Kaivo quits (~Kaivo@104-200-86-99.mc.derytele.com) (Ping timeout: 265 seconds)
15:00:43 <dminuoso> But that no longer is about evaluation semantics, but oh well.
15:00:47 ddellacosta joins (~dd@86.106.121.168)
15:01:07 <fog23> whats the upshot of these 3 different things?
15:01:32 <fog23> call by name/value/reference...
15:01:38 <dminuoso> Well, call-by-value just means to evaluate an argument before you enter the function
15:01:46 <dminuoso> call-by-need/name does not
15:01:47 <Cheery> fog23: producer outputs the html. For example template generators or website backends, etc...
15:01:50 <fog23> "enter a function" ?
15:01:50 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
15:01:51 <dolio> I think they say 'pass' instead of 'call'.
15:02:06 alp joins (~alp@2a01:e0a:58b:4920:79a7:73ea:36f8:a1c9)
15:02:09 <dminuoso> dolio: You'd lose on a google fight on this one.
15:02:12 <Cheery> fog23: consumer is what reads and interprets html.
15:02:13 <fog23> Cheery: why are you speaking about code generation though?
15:02:34 <dminuoso> But you might be right that that's more common. Still, the phrase "call by reference" is used far too foten
15:02:41 <Cheery> fog23: because if I want to describe a type, I'd like to describe it through how it's constructed and destroyed.
15:02:46 <fog23> i still have no idea what they mean...
15:02:54 Kaivo joins (~Kaivo@ec2-15-222-231-32.ca-central-1.compute.amazonaws.com)
15:03:19 <fog23> Cheery: right, we have recursive datatypes, but thats no like, HTML
15:03:20 conal joins (~conal@64.71.133.70)
15:03:26 × jespada quits (~jespada@90.254.246.48) (Ping timeout: 256 seconds)
15:04:07 <dolio> dminuoso: Well, if they did say 'pass', it could be excused, at least. :)
15:04:14 <dminuoso> dolio: https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_reference
15:04:17 <dminuoso> There's an article entry even! :)
15:04:29 xerox_ joins (~xerox@unaffiliated/xerox)
15:04:45 <fog23> hmm, so its to do with making copies?
15:04:51 <dolio> Well, you can't trust wikipedia.
15:04:51 <fog23> so haskell we copy everything right?
15:05:05 <fog23> thats just purity?
15:05:07 jespada joins (~jespada@90.254.246.48)
15:05:17 <fog23> i guess its since we hide the memory access
15:05:38 <fog23> though Mutable vectors and mutable variables in ST or IO kind of get round that.
15:05:44 AlterEgo- joins (~ladew@124-198-158-163.dynamic.caiway.nl)
15:06:08 <dminuoso> fog23: My point is just, evaluation wise, there's call-by-value, call-by-need/name, call-by-future, perhaps Im forgetting something more exotic here. What's called "call-by-reference" is about copying/referencing. But that's not about evaluation.
15:06:35 <fog23> seems basically like its "calling a method with an input variable, can change that variable, even if it is not returned as an output"
15:07:08 <fog23> no wonder they have so much bugs
15:07:10 <dminuoso> Well if we dig deep into C++, then reference have so much subtleties to them
15:07:19 <dminuoso> It's very very complicated.
15:07:31 <fog23> no i really dont care
15:07:54 <fog23> this brief foray into c# was not something i wnat to do again in a hurry
15:08:09 <fog23> it just left me completely dismayed at the state of reality
15:08:35 <fog23> what a sad state the world is in - with all of these primitive evaluation strategies
15:08:47 <fog23> but that industry would *enforce* them - ey gads
15:09:08 <fog23> "you should learn our idom - then we will pay you". seems like some kind of cooked nepotism
15:09:15 × albert_99 quits (~Albert@p200300e5ff0b5b425d211d042df94ce7.dip0.t-ipconnect.de) (Ping timeout: 272 seconds)
15:09:16 <fog23> crooked*
15:09:35 <fog23> idiom*
15:11:45 otulp joins (~otulp@31.45.116.219)
15:13:48 <fog23> oh, speaking of linked lists. can you have a doubly linked tree?
15:14:03 <dolio> Yes.
15:14:10 <fog23> if so there might be a way to have "upwards facing branches"
15:14:15 <fog23> does that sound possible?
15:14:33 <fog23> like, if you refer to the branches above as well as the branches below, because of the double link
15:15:02 <fog23> so then you could put a *different* upper part of the tree as an upwards branch
15:15:13 jiribenes_ joins (~Thunderbi@2a02:8308:101:f100:18b2:1950:2975:8c11)
15:16:23 <fog23> or something like a "highway" reference, to a lower portion of the tree - though thats not a "doubly linked" idea. more like double link -> upwards reference -> multiple upwards references -> referring to "elsewhere upwards" -> refereeing to "elsewhere downwards"
15:16:37 × conal quits (~conal@64.71.133.70) (Ping timeout: 256 seconds)
15:16:43 <fog23> or is that completely impossible
15:16:51 <fog23> what would be difficult about that?
15:16:54 × jiribenes_ quits (~Thunderbi@2a02:8308:101:f100:18b2:1950:2975:8c11) (Client Quit)
15:18:58 hackage prolude 0.0.0.1 - ITProTV's custom prelude https://hackage.haskell.org/package/prolude-0.0.0.1 (saramuse)
15:19:10 × xff0x quits (~fox@2001:1a81:5300:fe00:1175:d8f5:8ada:f855) (Ping timeout: 244 seconds)
15:19:30 zacts joins (~zacts@dragora/developer/zacts)
15:19:42 Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi)
15:20:28 xff0x joins (~fox@2001:1a81:5300:fe00:1175:d8f5:8ada:f855)
15:20:42 <fog23> dolio: how would you write a doubly linked tree?
15:21:28 conal joins (~conal@64.71.133.70)
15:21:30 × mav1 quits (~mav@p5dd5a8a0.dip0.t-ipconnect.de) (Quit: WeeChat 2.9)
15:22:11 <dolio> Just like a doubly linked list, except it's a tree. You have parent pointers in addition to child pointers.
15:23:00 × zacts quits (~zacts@dragora/developer/zacts) (Client Quit)
15:23:15 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
15:23:18 <fog23> pointers!?
15:23:40 <fog23> Tree = Free Nonempty
15:23:44 <fog23> thats pretty easy
15:23:45 <dolio> Doubly-linked stuff usually only works out well with pointers.
15:23:56 <fog23> rrg
15:24:01 <fog23> i dont understand
15:24:08 <fog23> where are the pointers in the regular tree?
15:24:11 zacts joins (~zacts@dragora/developer/zacts)
15:24:16 <fog23> the lower branches?
15:24:17 knupfer joins (~Thunderbi@87.123.206.236)
15:24:19 <dolio> Yes.
15:24:25 <fog23> why are you calling them pointers?
15:25:00 <fog23> DBLTree = Free (\a -> Nonempty a, Nonempty a)
15:25:01 <fog23> ?
15:25:08 <fog23> erm
15:25:18 <fog23> DBLTree = Free (\a -> (Nonempty a, Nonempty a) )
15:25:35 <fog23> thats like, branches below and branches above
15:25:46 <fog23> oh, i guess it would be just *a* branch above
15:26:01 <fog23> DBLTree = Free (\a -> (a, Nonempty a) )
15:26:33 <sm[m]> I use a doubly linked tree, using laziness to tie the knot
15:26:37 <fog23> (that `a' is going to be replaced by DBLTree a by Free)
15:26:55 <fog23> sm[m] can you paste that?
15:27:06 <sm[m]> (not a literal tree but a tree-shaped set of ADTs)
15:27:37 × kritzefitz quits (~kritzefit@fw-front.credativ.com) (Remote host closed the connection)
15:27:43 <fog23> but is that DBLTree written using Free correct?
15:28:54 <fog23> oh right, there is nothing intrinsicly built into the "data" syntax that allows the upper refference to be passed into the reference below
15:29:04 <fog23> might be a pretty cool functional language that could do that!
15:29:33 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
15:29:50 <fog23> i cnt get my head round how to do the several upwards pointing branches
15:29:51 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
15:29:51 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
15:29:51 GyroW joins (~GyroW@unaffiliated/gyrow)
15:29:58 × sethetter__ quits (sid17895@gateway/web/irccloud.com/x-igokhppslfuoizhb) (Quit: Updating details, brb)
15:30:12 sethetter joins (sid17895@gateway/web/irccloud.com/x-dfvcqfcbhnjlhxfv)
15:30:20 <sm[m]> fog23: https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Account.hs#L93 is one place
15:31:12 <fog23> i guess, the lower branches are like, by default "tree shaped" and there is no ambiguity - but just putting the extra list of beanches, where these are *supposed* to refer upwards - is not actually something thats built in using the GADT syntax
15:31:27 <fog23> so it kind of feels, incomplete
15:32:28 sethetter parts (sid17895@gateway/web/irccloud.com/x-dfvcqfcbhnjlhxfv) ()
15:33:28 <fog23> sm[m] ah, so there is nothing intrinsic about the record that makes it a parent until you use that knot tying function
15:33:38 <fog23> i guess thats what makes it "complete"
15:34:05 <fog23> but this feels so clumsy, like, that the GADT is only actually specified correctly based on the function that ties the knot
15:34:29 <fog23> while, if there is no knot tying, then the lower branches are exactly that, just by construction
15:35:37 <fog23> well, i guess that means Free (\a -> (Nonempty a,Nonempty a)) *is* a valid way to do the "upwards branches"
15:35:46 <fog23> and i just need to do the knot typing function for it
15:36:17 <fog23> so how does this work, you pass in Nothing... and then...
15:36:56 <fog23> that acts as the parent of the top node
15:37:15 <fog23> and then it recurses, and has a node above to pass in for all the lower branches, that seems easy enough
15:37:35 <fog23> i guess it becomes more difficult when there is this, having to tie various different upper nodes
15:37:52 <fog23> there would have to be some way of directing which upper nodes were supposed to be referenced
15:37:54 <sm[m]> fog23: good question.. this seems to accept a tree of Account, and recurses through tying the knot for each one to its parent
15:38:07 <sm[m]> https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Transaction.hs#L563 is a simpler example
15:38:51 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
15:39:25 × chaosmasttter quits (~chaosmast@p200300c4a73b2e0100f3c5a701cd6e56.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
15:39:58 <fog23> sm[m]: i dont see a recursive call to txnTieKnot, so im guessing its not a tree, or recursive datatype
15:40:08 jiribenes_ joins (~jiribenes@rosa.jiribenes.com)
15:40:09 × gambpang quits (~gambpang@unaffiliated/gambpang) (Quit: ZNC 1.6.3+deb1+xenial0 - http://znc.in)
15:40:09 × wraithm_ quits (~wraithm@unaffiliated/wraithm) (Quit: ZNC 1.6.3+deb1+xenial0 - http://znc.in)
15:40:24 <fog23> ah, right, so its to do with "descending" into the tree, by recursive calls
15:40:32 <sm[m]> right, txnTieKnot just ties the knot for the postings of a single transaction
15:40:36 <fog23> then you always have the current node to pass in for the upper reference
15:41:01 jiribenes is now known as Guest77330
15:41:01 × Guest77330 quits (jbjiribene@gateway/shell/matrix.org/x-vhnsqdmfgjajakfv) (Killed (egan.freenode.net (Nickname regained by services)))
15:41:01 jiribenes_ is now known as jiribenes
15:41:03 <fog23> so that typing many knots would be more difficult, since you cant just use the current position
15:41:08 Guest77330 joins (jbjiribene@gateway/shell/matrix.org/x-klbutzrslfjoiooq)
15:41:08 <fog23> typing*
15:41:08 <sm[m]> data types: https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Types.hs#L490, https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Types.hs#L332
15:41:14 gambpang joins (~gambpang@unaffiliated/gambpang)
15:41:48 invaser parts (~Thunderbi@31.148.23.125) ()
15:41:55 × gambpang quits (~gambpang@unaffiliated/gambpang) (Client Quit)
15:42:26 <fog23> ah, ok, so Account contains reference to [Account] as one of its records, but Transaction has no reference to Transaction at all, so its not a recursive datatype
15:42:40 × jiribenes quits (~jiribenes@rosa.jiribenes.com) (Client Quit)
15:42:41 gambpang joins (~gambpang@unaffiliated/gambpang)
15:42:56 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
15:43:05 <fog23> unless one of its records refers to Account
15:43:10 <fog23> Transation*
15:43:14 <fog23> which i guess it must...
15:43:37 × lpy quits (~lpyfist@unaffiliated/elysian) (Quit: lpy)
15:44:13 <fog23> ah yes, its Posting https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Types.hs#L285
15:44:18 <fog23> that has a maybe Transaction
15:44:21 <sm[m]> Transaction refers to Posting which refers back to Transaction, this one is a tree of two types.. yep
15:44:27 <fog23> ok, this all seems quite straitforwards
15:44:56 <fog23> but again, this is a natural recursive function
15:45:00 jiribenes joins (~jiribenes@rosa.jiribenes.com)
15:45:03 <sm[m]> that's haskell for you.. no big drama :)
15:45:11 wraithm joins (~wraithm@unaffiliated/wraithm)
15:45:20 <fog23> and the "order of visitation" intrinsic, means it always has the think needed to tie the knot
15:45:58 <fog23> but if im trying to tie the knot on several upwards pointing branches - then i dont have those values available while descending by recusing
15:46:19 <fog23> thing*
15:46:23 <sm[m]> you could pass them down as you build the tree ?
15:46:36 <fog23> you mean, pass them up?
15:46:44 <sm[m]> (but that wouldn't be called a tree, right ? dunno)
15:46:52 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
15:46:53 <fog23> well its a cyclic tree
15:47:11 <fog23> im not sure if there is need to distinguish which is the "natural" parent
15:47:22 <fog23> or if all of the upper nodes are...
15:47:48 <fog23> hmm, i guess only one of them actually has the branches below that contain the branch that is with the upwards knots
15:47:53 <fog23> argh, so complicated
15:47:59 <fog23> (no drama, yeah right)
15:48:30 <fog23> or should all the nodes that can be refered to from some upwards knots - have these lower branches
15:48:35 r-gt joins (63f22acf@gateway/web/cgi-irc/kiwiirc.com/ip.99.242.42.207)
15:48:38 <sm[m]> time for some prototyping !
15:48:44 <fog23> then you would have several different paths having to have the same branches
15:48:57 <fog23> sm[m] you cant understand the human words?
15:49:04 <fog23> i dont think i can manage the types just yet
15:49:09 <fog23> still total confusion
15:49:15 fraktor joins (~walt@129.93.191.18)
15:49:32 <sm[m]> I don't want to think to hard here (and have to go), sometimes a little tinkering helps the thinking
15:49:46 × GyroW quits (~GyroW@unaffiliated/gyrow) (Remote host closed the connection)
15:49:50 <fog23> the main question - if i can manage to phrase it is;
15:49:54 <fraktor> This might be a dumb question, but why isn't `map` defined as just `fmap` so that every monad can use `map`?
15:50:03 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
15:50:03 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
15:50:03 GyroW joins (~GyroW@unaffiliated/gyrow)
15:50:20 <fog23> do the nodes have the same branches below
15:50:24 <dolio> Because people in 1998 thought a map specialized to lists would be helpful.
15:50:25 albert_99 joins (~Albert@p200300e5ff0b5b425d211d042df94ce7.dip0.t-ipconnect.de)
15:50:34 <fog23> that would require copying right?
15:50:41 <fog23> thats also something GADTs dont do
15:50:48 × oisdk quits (~oisdk@2001:bb6:3329:d100:1dc8:afe3:52e4:27ba) (Quit: oisdk)
15:50:52 <fog23> and then i just melt in despair
15:50:58 <lortabac> dolio: to be honest I still think so
15:51:52 <fog23> how can i ensure the downwardly referenced branches that are "common" between two paths, are references to the same thing?
15:52:10 <fog23> i think i need imperative style reference by call value name or whatever it is
15:52:20 livvy joins (~livvy@gateway/tor-sasl/livvy)
15:52:38 <fraktor> dolio: I don't understand why that is. Was it an optimization thing?
15:52:55 <dolio> No. Teaching, I think.
15:53:07 <fog23> or nonlinear logic in GADT construction, or some other kind of unheard of language functionality
15:53:15 <fog23> maybe i should just give up
15:53:20 Usurp joins (~Usurp@217.146.82.202)
15:54:29 <dolio> There were multiple changes like that. (++) used to be mplus. List comperehensions were generalized to monads (which you can turn on in GHC again).
15:54:49 <fog23> fraktor: turns out some languages *only* have lists. so that these were considered kind of fundamental constructions, traditionally, during language design. we have list comprehensions, also, because this is actually ubiquitous in mathematics also, with set builder notation using "lists" as the kind of natural container
15:54:50 conal joins (~conal@64.71.133.70)
15:54:55 × albert_99 quits (~Albert@p200300e5ff0b5b425d211d042df94ce7.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
15:54:58 × raehik quits (~raehik@cpc96984-rdng25-2-0-cust109.15-3.cable.virginm.net) (Ping timeout: 272 seconds)
15:55:38 <fog23> something something partial ordering - ranging over integers etc
15:55:38 <dsal> lortabac: Why do you think map specialized to lists is a good idea?
15:55:50 <fog23> total ordering*
15:56:10 <fog23> its Enum right?
15:56:12 <fog23> > [1..3]
15:56:15 <lambdabot> [1,2,3]
15:56:45 <fog23> so thats the fundamental structure of a ring
15:56:52 <lortabac> dsal: because I don't want to use overloading when I don't need it
15:56:57 <fog23> or, a ring without multiplication, whatever that is
15:57:04 <fog23> a monoid i guess
15:57:12 <dsal> > fmap succ [1..4]
15:57:15 <lambdabot> [2,3,4,5]
15:57:27 <dsal> lortabac: if map were fmap, it'd just work.
15:57:35 <fog23> hmm, i guess you need a unit as well as an identity to get enum
15:57:45 <fog23> Enum = Monoid + Unit
15:57:48 motherfsck joins (~motherfsc@unaffiliated/motherfsck)
15:57:54 <fog23> and then thats naturally "list like"
15:58:22 <fog23> and since things like the integers are like that, we basically have lists everywhere we have monoids, which is everywhere we have things like (+)
15:58:31 <fog23> which is basically everywhere!
15:58:40 <fog23> so yeah, lists are kind of totally fundamental
15:58:48 <sm[m]> but error messages would be more confusing making the language harder for learners, right
15:58:50 <tdammers> geez, it's much simpler
15:59:13 <tdammers> lists are concrete enough that someone new to the language and FP in general can grasp the concept and understand `map`
15:59:28 <fog23> thats not why they are ubiquitous in maths though
15:59:33 <tdammers> just like natural numbers are concrete enough that someone new to basic algebra can grasp the concept of a binary operation such as addition
15:59:53 <fog23> and its because of *that*, which makes haskell good for learning
15:59:55 × sQVe quits (~sQVe@unaffiliated/sqve) (Ping timeout: 240 seconds)
16:00:01 <fog23> precisely because of []
16:00:31 Rudd0 joins (~Rudd0@185.189.115.103)
16:00:35 <tdammers> you can probably say that enough things are list-like to make lists a good concept to have
16:00:59 <fog23> thats why, similar to matlab, haskell is considered as a more naturally mathmatical syntax - so better for math/sci majors
16:01:04 <sm[m]> agreed!
16:01:16 <fog23> but then so are trees
16:01:16 <sm[m]> (tdammers)
16:01:22 <fog23> (obvs)
16:01:28 hackage boilerplate 0.0.1 - Generate Haskell boilerplate. https://hackage.haskell.org/package/boilerplate-0.0.1 (tseenshe)
16:01:49 <fog23> and so are graphs! but as far as i can tell no language yet supports their representation
16:01:56 <lortabac> :t fmap succ
16:01:58 tzh joins (~tzh@2601:448:c500:5300::143b)
16:01:58 <lambdabot> (Functor f, Enum b) => f b -> f b
16:02:01 <lortabac> :t map succ
16:02:04 <lambdabot> Enum b => [b] -> [b]
16:02:31 <fog23> and if we follow, turing tape -> basic (with goto) -> imperative (without goto) -> functional (without top down evaluation)
16:02:32 × itai33[m] quits (itai33matr@gateway/shell/matrix.org/x-kkpfrvjedmohzgix) (Quit: Idle for 30+ days)
16:02:34 × phaul quits (~phaul@ruby/staff/phaul) (Ping timeout: 244 seconds)
16:02:42 <fog23> where function referencing is naturally graph like
16:02:47 <fog23> erm, tree like
16:02:48 <lortabac> dsal: the second one has a simpler signature
16:03:00 <lortabac> and plays better with inference
16:03:19 <tdammers> problem with trees, graphs and sets is that you typically have to decide on a subset of those that you want to be able to represent
16:03:21 <dsal> lortabac: You could make that argument for everything you can do with functors, monads, monoids, traversables, foldables, etc...
16:03:24 <fog23> then it seems like list -> tree -> graph, is the natural evolution of the structure of programs
16:03:33 <fog23> so we need graphs to get graphical languages
16:03:41 <fog23> (which i guess is why im working on graphs)
16:03:48 <monochrom> dsal, I think I did make that argument with foldables :)
16:04:10 <dsal> monochrom: I may have missed it.
16:04:15 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
16:04:41 <fog23> well yeah, its possible to maintain the order of traversal during the algebraic construction of the graph
16:04:49 <lortabac> dsal: IMHO overloading is useful when you want generic operations over all Functors, all Foldables etc.
16:04:57 × GyroW quits (~GyroW@unaffiliated/gyrow) (Remote host closed the connection)
16:05:02 <fog23> thats what the seti/geti "structured" traversal was all about
16:05:03 <monochrom> If you show students "length :: [a] -> Int", it's very elementary and explainable with little background. If you show them "Foldable f => f a -> Int", there are like 2 or 3 new prerequisite concepts.
16:05:16 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
16:05:16 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
16:05:16 GyroW joins (~GyroW@unaffiliated/gyrow)
16:05:24 <lortabac> dsal: if you know you are working with lists, why making your signature more ambiguous?
16:05:35 <fog23> and then you show them cojoin for a graph
16:05:40 <fog23> pointer...
16:05:40 <monochrom> Well yeah, it's a long time ago, also I was not (and am not) very strongly convicted about it.
16:06:07 <c_wraith> lortabac: If you're writing code that works correctly with more types than list, why not make it more polymorphic so that callers know the implementation space is more restricted?
16:06:09 <monochrom> It is also true of Num, too.
16:06:22 <Cheery> adding dependency "pandoc" and almost bursting in laughter
16:06:24 <fog23> you get traverse_i, where `i' is a "structure directing index, which is a navigation to the pointer to take it to the "next" position
16:06:37 <fog23> so that a carried copy of the future reference can be placed at the bridge locations
16:06:39 <lortabac> c_wraith: I don't understand
16:06:45 <monochrom> Sometimes I first tell the white lie "(+) :: Integer -> Integer -> Integer" and then later when the students are ready I'll explain type classes.
16:07:33 <dsal> monochrom: I think that makes sense for the Foldable example as well. Things other than lists have length, but you can talk about just lists at first.
16:08:10 <fog23> and then you explain about matricies and functions not supporting quotients - so that we need rings not groups for the extension to monoid most general to represent "polynomial functions"
16:08:20 <Cheery> I'm also going to tell myself a white lie. I'm going to say that something like RelaxNG but on type level can be useful even if I didn't do it properly, and only to writeout stuff reliably.
16:08:34 <monochrom> But here is a downside I don't know how to solve.
16:08:53 <monochrom> Despite my white lies, error messages are going to leak the cold hard truth.
16:09:14 <c_wraith> lortabac: the more polymorphic a type is, the fewer possible implementations it has. Making something more polymorphic often (not always) makes it clearer what it does, because the type eliminates more possible things that it could be doing.
16:09:21 <monochrom> And 90% of the time it happens when one is not ready to explain or learn what the error message is saying.
16:09:31 <fog23> yeah, how could you ensure that if you made a functional version of call by variable, that it wouldnt break purity
16:09:50 <fog23> or is there a weaker version of purity where you could still make some guaranties
16:09:55 <lortabac> c_wraith: fair point, but in my experience this is more often the case with parametric polymorphism than with ad-hoc polymorphism
16:09:56 <monochrom> So this perpetuates people's bad habit of ignoring error messages.
16:10:11 <dolio> I pretty much always use fmap for mapping over lists, and I have essentially 0 problems.
16:10:14 <Cheery> monochrom: does your students have haskell-language-server on vscode?
16:10:29 <Chousuke> monochrom: sounds like you need some kind of learn_prelude that swaps out the generic stuff with your dirty lies :)
16:10:29 <monochrom> (Well, people see there is an error. People just disbelieve that the message content is informative.)
16:10:32 <fog23> i cant believe that C# has "inheretence" to mean extensible records
16:11:06 mav1 joins (~mav@i59F4E23A.versanet.de)
16:11:15 <fog23> dolio: 0 problems is a side effect of not enough fun
16:11:34 LKoen joins (~LKoen@81.255.219.130)
16:12:02 mananamenos joins (~mananamen@84.122.202.215.dyn.user.ono.com)
16:12:09 × conal quits (~conal@64.71.133.70) (Ping timeout: 256 seconds)
16:12:33 <fog23> and then you combine erlang with go and haskell and get pure structure-concurrent graphical functional languages
16:12:42 × jgt1 quits (~jgt@78.26.168.236) (Ping timeout: 272 seconds)
16:12:44 <c_wraith> monochrom: how terrible is the user experience of giving them an alternate Prelude to work with?
16:12:54 <monochrom> I haven't tried.
16:13:25 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
16:13:30 <fog23> c_wraith: about as terrible as most of the forms of pety-facism
16:13:50 <fog23> ie, context dependent!
16:14:00 albert_99 joins (~Albert@p200300e5ff0b5b425d211d042df94ce7.dip0.t-ipconnect.de)
16:14:01 × da39a3ee5e6b4b0d quits (~textual@n11211935170.netvigator.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:14:05 <lortabac> dolio: it's not about problems, but more about better error messages and for example better inference when using typed holes to get the type of an intermediate expression
16:15:15 <lortabac> replacing fmap with map has helped me more than once when I was stuck in dealing with complex data structures
16:15:26 <fog23> yeah, its not a bad idea to make a synonym using TypeApplications for your common types
16:15:26 <lortabac> of course YMMV
16:15:33 <fog23> such as the "has" function
16:15:33 <monochrom> Actually, empirically, I have been doing nothing to the dilemma, and the students survived just fine. :)
16:15:52 conal joins (~conal@172.255.125.158)
16:16:27 <fog23> otherwise the type applications are optional, and you end up with (fmap . fmap . fmap) and its sometimes impossible to read which types they apply to
16:16:54 <dsal> lortabac: But you're solving the problem for exactly one function on exactly one type. The problem exists both in other functions and other types.
16:16:54 <fog23> explicit type applications would solve that, but they are optional, so the better practive is that of map
16:17:31 <fog23> just make the synonym when you make the instance as a good style
16:17:33 <monochrom> But as usual, whereas a more general type restricts implementation space, it relaxes usage space, and some usages are potential mistakes (the same reason we have occurs check and ban infinite types).
16:17:41 <monochrom> @quote monochrom dialectic
16:17:41 <lambdabot> monochrom says: Programming is a dialectic class struggle between the author and the user. My freedom is your slavery. Your ignorance is my strength.
16:17:55 × urdh quits (~urdh@unaffiliated/urdh) (Ping timeout: 240 seconds)
16:18:05 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:18:24 <fog23> or, equivalently good practice, use type applications as a form of code commenting
16:18:37 <fog23> with the lesser number of synonyms
16:18:39 <dsal> lambdabot: that monochrom dude is clever
16:18:47 knupfer1 joins (~Thunderbi@200116b82cef8300c13273ee6919ca7e.dip.versatel-1u1.de)
16:18:47 × knupfer1 quits (~Thunderbi@200116b82cef8300c13273ee6919ca7e.dip.versatel-1u1.de) (Client Quit)
16:18:53 <fog23> aka, map depreciated following since @
16:18:54 <monochrom> :)
16:18:58 × knupfer quits (~Thunderbi@87.123.206.236) (Quit: knupfer)
16:19:36 <fog23> that Hegelian synergy
16:19:38 knupfer joins (~Thunderbi@200116b82cef830020ab55033e39ebbd.dip.versatel-1u1.de)
16:19:42 <dsal> I'm not good at type applications, but that seems like a good way to get you there.
16:19:53 × Falkeo quits (5631fd8b@ip-86-49-253-139.net.upcbroadband.cz) (Remote host closed the connection)
16:20:00 urdh joins (~urdh@unaffiliated/urdh)
16:20:07 <fog23> ah, yeah, then you get plenty of foralls
16:20:13 <dsal> :t fmap @([Int] -> [Int])
16:20:15 <lambdabot> error:
16:20:15 <lambdabot> Pattern syntax in expression context: fmap@(_)
16:20:15 <lambdabot> Did you mean to enable TypeApplications?
16:20:29 <fog23> % :t fmap @([Int] -> [Int])
16:20:30 <yahb> fog23: ; <interactive>:1:8: error:; * Expected kind `* -> *', but `[Int] -> [Int]' has kind `*'; * In the type `([Int] -> [Int])'; In the expression: fmap @([Int] -> [Int])
16:20:48 <fog23> % :t fmap @[] @Int
16:20:48 <yahb> fog23: (Int -> b) -> [Int] -> [b]
16:20:59 <fog23> % :t fmap @[] @Int @Int
16:21:00 <yahb> fog23: (Int -> Int) -> [Int] -> [Int]
16:21:05 <fog23> there you go
16:21:07 × topos quits (~topos@138.197.1.46) (Quit: ZNC 1.6.6+deb1ubuntu0.2 - http://znc.in)
16:21:17 <fog23> so map = fmap @[]
16:21:28 topos joins (uid467876@gateway/web/irccloud.com/x-twpqbqvekrcsozee)
16:21:38 <fog23> i dont think the @a @b are required to see what the fmap is acting on
16:22:07 Stanley00 joins (~stanley00@unaffiliated/stanley00)
16:22:17 <dsal> More importantly, you fix your error messages by, instead of replacing each function name to match what you think you're working with, just annotating it with what you think you're working with.
16:22:24 × mpereira quits (~mpereira@2a02:810d:f40:d96:1c35:7f2e:59ff:953) (Remote host closed the connection)
16:22:42 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds)
16:23:10 <dsal> % :t fmap @[]
16:23:10 <yahb> dsal: (a -> b) -> [a] -> [b]
16:23:22 <fog23> i guess its either, make synonyms everytime you write an instance. or, write type applications everywhere. or (the seemingly better way) make *some* synonyms, for the more common things, and use TypeApplications where otherwise your (fmap . fmap . fmap) would be unintelligable
16:23:28 <dsal> % :t fmap succ
16:23:28 <yahb> dsal: (Functor f, Enum b) => f b -> f b
16:23:30 <dsal> % :t fmap @[] succ
16:23:30 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:23:30 <yahb> dsal: Enum b => [b] -> [b]
16:23:41 snakemasterflex joins (~snakemast@213.100.206.23)
16:24:26 <fog23> dsal: right! so you can easily try several different versions, just depending on the type, instead of trying all different named synonyms
16:24:27 <c_wraith> lortabac: yeah... with ad-hoc polymorphism, it depends on how big the class is. Num is almost too big to help. Monoid or Functor are vastly more informative than any concrete instance. Foldable... is right on the edge.
16:24:53 <fog23> but then, this might not be the case for "has" where you would very rarely, *not* want the synonym named version
16:25:08 <fog23> like, everytime you write a Has instance, you should make a synonym
16:25:15 <fog23> (Has is basically coerce)
16:25:45 <fog23> you wouldnt want the whole of your code being a bunch of has casts, and a myriad of type applications
16:26:30 <fog23> but then you have to think of better synonym names than hasTypeATypeB
16:26:50 × Stanley00 quits (~stanley00@unaffiliated/stanley00) (Ping timeout: 258 seconds)
16:26:57 hackage servant-auth 0.4.0.0 - Authentication combinators for servant https://hackage.haskell.org/package/servant-auth-0.4.0.0 (domenkozar)
16:27:07 <fog23> (your only really writing has instances where there is a natural choice for a unique coercion)
16:27:17 <fog23> hmm
16:27:26 <ski> monochrom : "But here is a downside I don't know how to solve.","Despite my white lies, error messages are going to leak the cold hard truth." -- in Racket, they have language levels, to deal with that
16:27:31 <fog23> i remember having a "labled" or tagged has class aswell
16:27:46 <dsal> racket-style language levels would be really neat.
16:27:52 <fog23> so you could choose which of several has instance, by an extensible label
16:27:59 <dsal> I like the idea of map when I know nothing at all, but I really dislike map today.
16:28:05 <fog23> dont think you can use data families in instances though...
16:28:20 <fog23> or if you do it has to use an equality constraint or something
16:28:22 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 256 seconds)
16:28:27 <fog23> it was very complicated to say the least
16:29:13 <sm[m]> dsal: agreed on language levels!
16:29:13 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 260 seconds)
16:29:28 <sm[m]> as a start, we could at least define some
16:29:33 <dsal> I'm glad we've finally solved this problem. See you guys at the next meeting.
16:29:42 <fog23> bsically, i think i have to abandon haskell, because i cant express graphs
16:29:50 <fog23> because GADTs cant have copying
16:29:53 <fog23> or something
16:29:56 sm[m] assigns action time to dsal on the way out
16:30:01 <sm[m]> ITEM
16:30:18 <ski> there are a few graph libraries, i thought
16:30:24 <fog23> no
16:30:25 <fog23> like trees
16:30:34 <fog23> they can be expressed using GADTs
16:30:58 <fog23> graphs cant because several lower branches on different paths can refer to the same common lower branch
16:31:09 <fog23> and i dont think there is a way to express that "copying"
16:31:11 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
16:31:19 <ski> but no direct support for defining specialized kinds of graphs, akin to how `data' can be thought of as a way to define specialized kinds of trees
16:31:37 <fog23> also we need some way to say things like "this record is reserved for knot typing"
16:31:37 kritzefitz joins (~kritzefit@212.86.56.80)
16:31:41 <fog23> tying*
16:32:04 <ski> you could use some kind of references, to express that sharing (DAGs, i suppose you want ? or also allow cycles ?)
16:32:38 <fog23> and also maybe some kind of linear types, like "this lower tree portion is referred to exactly once"
16:33:23 <fog23> ski: what do you mean, i dont undertand how DAGs correponds to the sharing - and what are you asking about cycles?
16:33:23 <ski> (dunno what you mean by "this record is reserved for knot tying")
16:33:26 balbirs joins (~balbirs__@bilbo.ozlabs.org)
16:33:41 <ski> there are many different kinds of graphs, mathematically speaking
16:33:59 <fog23> if i dont care about sharing/copying, then i can have a doubly linked tree as Free (\a -> (a,Nonempty a))
16:34:16 <fog23> where the fst, the `a' - is "reserved for knot tying"
16:34:56 <ski> you can have directed vs. undirected graphs (or even have both directed and undirected edges). you can allow self-edges (loops) or not. you can allow multiple parallel edges or not. you can adorn vertices, ior edges, with some extra associated information
16:35:22 <fog23> without syntax to do that during the writing of the GADT, then this is not demanded of the user, and they must choose to write the knot typing function to actually construct the datatype properly
16:35:42 <fog23> you cant "pass the upper reference into the lower constructors" during the writing of the GADT
16:36:19 <ski> you can have graphs where the vertices come in several different kinds (which, say, determine which out-nodes they have, and possibly also determine in-nodes). and presumably also different kinds of edges
16:36:41 <fog23> thats quite comprehensive
16:37:03 <ski> (i still dunno what you mean by the "reserved for knot tying")
16:37:03 <fog23> but, we have *none* of the tools to express these as datatypes
16:37:38 <ski> yea, we have to do them, manually, as abstract data types .. it would be nice, if we could, somehow, express them more directly/explicitly
16:37:42 <fog23> we were using this example before
16:37:43 <fog23> https://github.com/simonmichael/hledger/blob/master/hledger-lib/Hledger/Data/Account.hs#L93
16:37:43 r-gt parts (63f22acf@gateway/web/cgi-irc/kiwiirc.com/ip.99.242.42.207) ()
16:37:56 <fog23> as a "knot tying function"
16:38:05 <fog23> this has to be done aswell as construction
16:38:17 sQVe joins (~sQVe@unaffiliated/sqve)
16:38:18 <ski> "pass the upper reference into the lower constructors" is for ?
16:38:28 <fog23> without those, there is no telling that the "parent" record, is actually a knot
16:38:48 <fog23> ski: thats basically what typing the knot is all about - in the context of double linkage
16:38:54 <ski> oh, you want parent links, in nodes
16:38:58 <monochrom> dsal: I wonder if you also find this other quote related :)
16:39:03 <monochrom> @quote monochrom Kripke
16:39:04 <lambdabot> monochrom says: There are truths, damn truths, and Kripke structures.
16:39:05 <fog23> but specifically, just for when the knot is tyed to the directly preceeding element
16:39:33 <fog23> ski: parent links, in nodes, is *one* of the forms of knot tying we dont support by construction
16:39:45 <fog23> we also dont have *several* knots, or knots extending far below
16:39:50 <fog23> or above
16:39:51 <monochrom> (So, Kripke structures formalize multiple worlds so you can have multiple different truths in different worlds.)
16:40:13 <dolio> Kripke structures are just degenerate sheaves.
16:40:21 <fog23> your a degenerate sheef
16:40:22 <dolio> Presheaves, even.
16:40:24 <ski> an alternative to parent links, is to use a zipper that reverses edges as you traverse them. but this doesn't work (at least directly), if you have cycles (other than the bidirectional edges)
16:40:41 <fog23> monochrom is the second variety
16:40:56 <ski> "we also dont have *several* knots, or knots extending far below or above" ?
16:41:02 <ski> by "knots", you mean cycles ?
16:41:13 <fog23> typing the knot establishes cycles
16:41:19 × conal quits (~conal@172.255.125.158) (Quit: Computer has gone to sleep.)
16:41:20 <fog23> a knot would be a cyclic reference, i think
16:41:23 <ski> (s/sheef/sheaf/)
16:41:59 <ski> monochrom : that's like, your truth, man
16:42:09 <fog23> pinciple bundle section of the module of spectral hyperkhaler distributions
16:42:45 <monochrom> But don't you like how it pairs up with "there are lies, damn lies, and statistics"? :)
16:43:13 <fog23> cuspidal solitonic top forms in the harmonic fibration of differential topologies
16:43:18 <ski> anyway, it's possible to use references to describe cycles. they can be compared for equality, so you can know when you're back again
16:44:19 <monochrom> Ooohhh, immutable references to help with explicating cycles.
16:44:19 <fog23> hodge arrows in the quiver monoid
16:44:27 <nshepperd> knot tying is generally a bad idea except as an optimization
16:45:27 <fog23> shepperd: oh contrare
16:45:58 <fog23> im away to run counterwidishins around the bliths stone, avast to you
16:46:00 × fog23 quits (c1b057e2@gateway/web/cgi-irc/kiwiirc.com/ip.193.176.87.226) (Quit: Connection closed)
16:46:13 <monochrom> Good riddance.
16:46:25 <nshepperd> the knot tying that hledger does seems very silly to me
16:46:32 conal joins (~conal@64.71.133.70)
16:46:40 <monochrom> What was all that about anyway?
16:46:52 × tbreslein quits (~tbreslein@2a02:8108:140:44f8::3cc4) (Remote host closed the connection)
16:47:17 <nshepperd> fog in his manic phase
16:47:28 <c_wraith> I'm not sure anyone's ever known what they're talking about
16:47:59 coot joins (~coot@37.30.49.218.nat.umts.dynamic.t-mobile.pl)
16:49:04 <sm[m]> nshepperd: it probably is, but it has been working great since beginner-me concocted it
16:49:38 × nineonin_ quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Remote host closed the connection)
16:52:32 <ski> monochrom : yes, like `simple-ivar'
16:53:33 juliusdeane joins (~user@130.64.35.16)
16:53:45 mrbentarikau joins (~caubert@82.131.52.222.cable.starman.ee)
16:54:09 × flatmap quits (~flatmap@p200300dd371bf60068aa0495bfcb4a49.dip0.t-ipconnect.de) (Quit: Textual IRC Client: www.textualapp.com)
16:55:07 howdoi joins (uid224@gateway/web/irccloud.com/x-bfkecngtkcukjezu)
16:55:21 <monochrom> ivar-simple
16:55:56 geekosaur joins (42d52102@66.213.33.2)
16:57:56 × reppertj quits (~textual@pool-96-246-209-59.nycmny.fios.verizon.net) (Quit: Textual IRC Client: www.textualapp.com)
16:58:37 × mrbentarikau quits (~caubert@82.131.52.222.cable.starman.ee) (Remote host closed the connection)
16:59:27 hackage hakyll-alectryon 0.1.0.0 - Hakyll extension for rendering Coq code using Alectryon https://hackage.haskell.org/package/hakyll-alectryon-0.1.0.0 (lyxia)
17:00:13 nineonine joins (~nineonine@216.81.48.202)
17:00:30 oisdk joins (~oisdk@2001:bb6:3329:d100:2471:1ee3:650d:c8f7)
17:00:36 × nineonine quits (~nineonine@216.81.48.202) (Read error: Connection reset by peer)
17:00:36 snakemasterflex joins (~snakemast@213.100.206.23)
17:00:47 nineonine joins (~nineonine@216.81.48.202)
17:00:49 zoom joins (44beb1c9@068-190-177-201.res.spectrum.com)
17:01:56 zoom84 joins (44beb1c9@068-190-177-201.res.spectrum.com)
17:01:56 Guest_83 joins (d4ba09dc@212-186-9-220.cable.dynamic.surfer.at)
17:02:14 int-e wonders whether to worry about the ivar-simple reference.
17:02:27 × Guest_83 quits (d4ba09dc@212-186-9-220.cable.dynamic.surfer.at) (Remote host closed the connection)
17:02:39 caubert joins (~caubert@82.131.52.222.cable.starman.ee)
17:03:11 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
17:03:17 <monochrom> It is mentioned for "immutable references to help with explicating cycles"
17:03:34 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
17:04:35 Guest_45 joins (590fec7f@x590fec7f.dyn.telefonica.de)
17:04:56 × sQVe quits (~sQVe@unaffiliated/sqve) (Quit: Bye!)
17:05:16 <int-e> Not sure that it does anything about cycles... oh well. It still compiles with ghc-8.10, I'll stop worrying :)
17:05:29 × zoom quits (44beb1c9@068-190-177-201.res.spectrum.com) (Ping timeout: 245 seconds)
17:06:07 × borne quits (~fritjof@200116b86471bb007fe01feb1760d29e.dip.versatel-1u1.de) (Ping timeout: 240 seconds)
17:07:19 <monochrom> It has Eq so we can observe aliasing in pure functions.
17:07:38 juliusdeane parts (~user@130.64.35.16) ("ERC (IRC client for Emacs 26.3)")
17:07:58 <zoom84> could really use some help understanding implementing functors for type constructors that take two params. I read through the learnyouhaskll example of the Either type and generally understand the notion of partially applying the typeclass via Functor (Either a) but I'm getting twisted in knots trying to understand how the class Functor translates
17:07:58 <zoom84> to the implementation of Functor (MyEither a)
17:08:21 <int-e> monochrom: Oh right. Heh... it's been so long.
17:08:38 <zoom84> I created my own type to experiment:
17:08:49 <zoom84> data MyEither a b = MyLeft a | MyRight b deriving(Show)
17:08:58 <zoom84> instance Functor (MyEither a) where
17:09:06 <zoom84> fmap f (MyRight b) = MyRight (f b)
17:09:11 <ski> monochrom : er, right
17:09:14 <zoom84> fmap f (MyLeft x) = MyLeft x
17:09:38 <ski> (it also has `read :: IVar a -> a')
17:09:39 <monochrom> That's correct. What's the error message?
17:10:05 × Guest18 quits (567e8866@gateway/web/cgi-irc/kiwiirc.com/ip.86.126.136.102) (Quit: Connection closed)
17:10:26 <zoom84> learnyouhaskell says the effective prototype would be would be : (b -> c) -> MyEither a b -> MyEither a c
17:10:47 <ski> zoom84 : "generally understand the notion of partially applying the typeclass via Functor (Either a)" -- the type class (`Functor') isn't partially applied, it's the `data' type, `Either', that is
17:11:23 <ski> yes, that's a correct type signature for `fmap' here
17:11:26 <zoom84> I get the "MyEither a b" part, but I don't understand how the "c" var is introduced, for both b->c and My Either a c
17:12:00 <monochrom> OK. Allow me to use the shorthand E to stand for "Either a".
17:12:14 <monochrom> You expect (b->c) -> E b -> E c, no?
17:12:23 <monochrom> Now expand E to Either a.
17:12:49 × pfurla quits (~pfurla@104.192.219.186) (Quit: gone to sleep. ZZZzzz…)
17:13:12 <monochrom> or s/Either/MyEither/g throughout
17:13:15 <zoom84> why is it (b -> c) instead of (a->b)
17:13:18 <ski> zoom84 : if you add the line `{-# LANGUAGE InstanceSigs #-}' to the top of your module, then you should be able to put the type signature `fmap :: (b -> c) -> MyEither a b -> MyEither a c' inside your `instance'
17:13:23 × ericsagnes quits (~ericsagne@2405:6580:0:5100:953c:5f38:35fd:b3fd) (Ping timeout: 272 seconds)
17:13:40 <zoom84> consdering fmap in the class is map :: (a -> b) -> f a -> f b
17:13:43 <monochrom> "a" is already used up in "MyEither a". Gotta think up other variable names.
17:13:54 <zoom84> ahh...
17:14:02 <ski> zoom84 : the names of type variables doesn't really matter (as long as you use them consistently, within one context)
17:14:05 <sim590> zoom84: it's the return type of your function that is applied to the right part of the MyEither type. Functor describes how to map a function onto elements in the type. The implementation of Functor for Either chooses to apply the map on the right side by convention. That's what you wrote with your example for MyEither. When f is applied on the `b` type, it becomes a ̀c`.
17:14:20 <ski> saying
17:14:24 <ski> class Functor f
17:14:24 <zoom84> @monochrome, let me process that and see if it makes sense then...
17:14:25 <lambdabot> Unknown command, try @list
17:14:26 <ski> where
17:14:32 <ski> fmap :: (a -> b) -> (f a -> f b)
17:14:37 <ski> is the same thing, as saying
17:14:39 <ski> class Functor f
17:14:40 <ski> where
17:14:41 × cosimone quits (~cosimone@93-47-228-249.ip115.fastwebnet.it) (Quit: Quit.)
17:14:45 <monochrom> For this reason I much prefer "(a -> b) -> Either x a -> Either x b" actually
17:14:47 <ski> fmap :: (b -> c) -> (f b -> f c)
17:15:06 <ski> iow, you can rename `a' and `b' to some other variable names here
17:15:10 × dbmikus quits (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) (Remote host closed the connection)
17:15:33 <int-e> monochrom: Oh I see. The Eq instance wasn't my idea. "this change was suggested by nwf" -- probably on IRC and I don't know who it was, which is why there's no proper credit for it in the changelog.
17:15:36 <ski> (but you can't rename the `f' in the signature here, without also renaming the `f' in the type class head `class Functor f')
17:16:33 cosimone joins (~cosimone@2001:b07:ae5:db26:b248:7aff:feea:34b6)
17:18:01 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Ping timeout: 246 seconds)
17:18:07 × Guest_45 quits (590fec7f@x590fec7f.dyn.telefonica.de) (Remote host closed the connection)
17:19:22 brandly joins (~brandly@c-73-68-15-46.hsd1.ma.comcast.net)
17:19:31 <zoom84> i've read countless times how the placeholder variable names like 'a' and 'b' have no significance in the names selected but I still manage to get tripped up when single-letter placeholders like that are used for when integrating different vars in a single case like functor
17:20:19 <zoom84> i carry over the original use of "a" and "b" when integrating into a different type signature which also uses it's own letters. it's a constant source of confusion for me
17:20:48 <zoom84> maybe I should just start using more descriptive variable names and dropping the letters, even though the convention is to use letters
17:21:18 <ski> after a while, you'll probably get more used to renaming tyvars, on a by-need basis ?
17:21:25 × cosimone quits (~cosimone@2001:b07:ae5:db26:b248:7aff:feea:34b6) (Ping timeout: 240 seconds)
17:21:26 <lordcirth_> zoom84, descriptive names don't hurt
17:21:37 × ggole quits (~ggole@2001:8003:8119:7200:18b6:6ff8:b669:283) (Ping timeout: 244 seconds)
17:21:49 <ski> if they can sensibly be descriptive
17:21:50 <hpc> the hard part is, for things that generic, what do you name them?
17:21:54 <monochrom> descriptive names take forever to conjure, or forever to understand
17:22:01 <ski> (and, i suspect, they can actually hurt, at times)
17:22:13 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
17:22:29 <hpc> even the famously verbose java has the convention of "T" for type variables
17:22:34 <ski> @type lookup
17:22:35 <lambdabot> Eq a => a -> [(a, b)] -> Maybe b
17:22:36 <ski> @type M.lookup
17:22:37 <lambdabot> Ord k => k -> M.Map k a -> Maybe a
17:22:42 <int-e> . o O ( Lens s t a b )
17:22:45 <monochrom> The greatest hypocrisy of people bragging about descriptive names is they go on to give you foo, bar, quux.
17:22:48 <ski> `k' here is reasonable, abbreviating "key"
17:23:00 <zoom84> back to my original question now
17:23:01 <monochrom> Proving that for generic things there is no such thing as descriptive names.
17:23:23 <ski> spelling out `key',`token',`stream',&c. all the time, might make some type signatures long enough, that they're harder to comprehend, though
17:23:27 <int-e> I'm really a fan of having the length (and hence "descriptiveness") of the name increase with its scope.
17:23:37 borne joins (~fritjof@200116b86471bb007fe01feb1760d29e.dip.versatel-1u1.de)
17:23:41 × Lowl3v3l quits (~Lowl3v3l@dslb-090-186-188-115.090.186.pools.vodafone-ip.de) (Remote host closed the connection)
17:23:44 <ski> yes, that's a good guideline
17:24:01 <zoom84> instance Functor (MyEither a) where
17:24:01 Lowl3v3l joins (~Lowl3v3l@dslb-090-186-188-115.090.186.pools.vodafone-ip.de)
17:24:06 <zoom84> fmap f (MyRight b) = MyRight (f b)
17:24:13 <zoom84> fmap f (MyLeft x) = MyLeft x
17:24:41 <zoom84> so for my fmap instances, the "a" in Either a b is not available. Only the "b" is available, correct?
17:25:11 <monochrom> Or you write "Either x" like I do, so a is available again.
17:25:12 <dsal> Correct.
17:25:18 <ski> zoom84 : which `Either a b' ?
17:25:27 <zoom84> good. how then does MyLeft x work then? Since MyLeft uses "a"
17:25:35 <ski> zoom84 : are you talking about the definition of the `data' type `Either' ?
17:25:40 ericsagnes joins (~ericsagne@2405:6580:0:5100:e0:d1d9:7c60:99ac)
17:25:45 <int-e> :t fmap :: (b -> c) -> Either a b -> Either a c
17:25:47 <lambdabot> (b -> c) -> Either a b -> Either a c
17:25:50 <dolio> I think "correct" might be the wrong answer.
17:26:05 <ski> zoom84 : the `b' in `MyRight b' has nothing to do with the `b' in `MyEither a b' or `MyEither x b'
17:26:06 <int-e> That's the only possible Functor instance for Either.
17:26:20 <zoom84> I created my own MyEither. It's the same as Either. I did it so I can experiment trying to learn this aspect. Either vs MyEither interchangeable
17:26:23 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
17:27:17 <ski> zoom84 : yea, in `data MyEither a b = MyLeft a | MyRight b deriving Show', `a' and `b' are local names. they are not available outside this definition of `MyEither'
17:27:22 mananamenos_ joins (~mananamen@vpn236-17.vpns.upv.es)
17:27:56 <ski> if you wanted to, you could define it as `data MyEither coffee tea = MyLeft coffee | MyRight tea deriving Show', and it would not affect other code at all
17:28:12 bitmagie joins (~Thunderbi@200116b806da5f00187a54deb389527f.dip.versatel-1u1.de)
17:28:16 <int-e> zoom84: note that you had to write `instance Functor (MyEither a) where`, with only the last type parameter left out; that's all Haskell can do.
17:28:51 <int-e> (You could use a different variable name for that `a` though.)
17:29:21 <ski> zoom84 : it's just a convention to start naming the parameters `a',`b',`c',..., unless there's some particular significance (rôle) one may want to hint, like `k' for "key", `t' for "token", `f' for "functor", &c.
17:29:29 <zoom84> yeah, convention still tripping me up
17:29:35 <int-e> . o O ( instance Functor (Either idontcarewhatthisisaslongasitsneitheranorb) where ... )
17:29:44 <dsal> Oh, is it the variable name that is confusing?
17:29:48 × mirrorbird quits (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276) (Ping timeout: 244 seconds)
17:30:06 <monochrom> I think it is the notion of dummy variables.
17:30:10 <zoom84> rewriting my sample now with totally different names
17:30:25 × bitmagie quits (~Thunderbi@200116b806da5f00187a54deb389527f.dip.versatel-1u1.de) (Client Quit)
17:30:27 × alp quits (~alp@2a01:e0a:58b:4920:79a7:73ea:36f8:a1c9) (Ping timeout: 240 seconds)
17:30:28 <zoom84> to make it obvious...i'll see if it clicks then
17:30:51 × mananamenos quits (~mananamen@84.122.202.215.dyn.user.ono.com) (Ping timeout: 258 seconds)
17:30:57 <ski> zoom84 : it's also quite common, if you have say type variables `a',`b',`c' in a type signature, to also name corresponding values, in the definition, `a',`b',`c'. but one could instead name these `x',`y',`z' (so that we get `x :: a',`y :: b',`z :: c', which looks less confusing than `a :: a',`b :: b',`c :: c')
17:31:10 Buntspecht joins (~user@unaffiliated/siracusa)
17:31:42 <ski> (or, if you have a list of values of type `a', it could commonly be called `as', so that you have `as :: [a]'. but you could instead call it `xs', so that you have `xs :: [a]')
17:31:46 <zoom84> data MyEither dog cat = MyLeft dog | MyRight cat deriving(Show)
17:31:53 <zoom84> instance Functor (MyEither doodad) where
17:31:58 <zoom84> fmap f (MyRight x) = MyRight (f x)
17:32:14 <zoom84> fmap f (MyLeft x) = MyLeft x
17:32:23 × mav1 quits (~mav@i59F4E23A.versanet.de) (Ping timeout: 258 seconds)
17:32:25 <ski> zoom84 : did you try my `InstanceSigs' suggestion from above ?
17:32:56 <ski> try adding the line
17:32:57 <ski> {-# LANGUAGE InstanceSigs #-}
17:33:04 <ski> at the top of your source file
17:33:14 <zoom84> if I do the following in ghci: fmap (*2) (MyLeft 10)
17:33:15 <monochrom> Koodos for writing code to test your understanding
17:33:24 geekosaur hopes there was some indentation there, also
17:33:39 <ski> then, just above the definition of `fmap' in your instance, you can write the type signature for `fmap' that you expect, for `MyEither'
17:33:42 is_null joins (~jpic@pdpc/supporter/professional/is-null)
17:34:03 <ski> zoom84 : try `fmap (* 2) (MyLeft 10) :: MyEither Integer Bool'
17:34:34 <zoom84> my original statement works
17:34:42 phaul joins (~phaul@ruby/staff/phaul)
17:34:52 <zoom84> i'm trying to understand what that fmap instance actually receives
17:34:54 <ski> hm, actually, say `fmap (* 2) (MyLeft 10) :: MyEither Integer Double'
17:35:02 <monochrom> ski, there is ExtendedDefaulting to default to MyEither Integer () :)
17:35:17 <ski> yea, i just recalled :)
17:35:29 fog joins (c1b057e2@gateway/web/cgi-irc/kiwiirc.com/ip.193.176.87.226)
17:36:05 <fog> its not my fault! its election season - all the lobbying efforts and competing partisan spending distorts the fabric of reality
17:36:50 ChanServ sets mode +o monochrom
17:36:55 monochrom sets mode +b *!*@gateway/web/cgi-irc/kiwiirc.com/ip.193.176.87.226
17:36:55 fog is kicked by monochrom (fog)
17:37:34 Guest_57 joins (590fec7f@x590fec7f.dyn.telefonica.de)
17:37:55 <zoom84> does this implicit type signature look about right: (a -> b) -> MyEither doodad foobar -> MyEither a b
17:38:05 <ski> no
17:38:17 <ski> try writing
17:38:22 <ski> fmap :: (a -> b) -> MyEither doodad foobar -> MyEither a b
17:38:28 hackage fused-effects-mwc-random 0.1.0.0 - High-quality random number generation as an effect. https://hackage.haskell.org/package/fused-effects-mwc-random-0.1.0.0 (patrick_thomson)
17:38:29 <ski> above your definition, and see how it complains
17:38:37 <zoom84> not writing the signaturte
17:38:47 <zoom84> trying to impute the equivalent
17:38:58 <ski> you can check your understanding, by writing the signature that you expect
17:39:12 × John20 quits (~John@82.46.59.122) (Ping timeout: 256 seconds)
17:39:26 <ski> where did `doodad' and `foobar' come from ?
17:39:32 <ski> where did `a' and `b' come from ?
17:39:55 × kritzefitz quits (~kritzefit@212.86.56.80) (Ping timeout: 240 seconds)
17:39:57 <zoom84> where i can specify that signature?
17:40:07 <ski> just above the definition of `fmap'
17:40:40 <zoom84> The type signature for ‘fmap’ lacks an accompanying binding (The type signature must be given where ‘fmap’ is declared) |795 | fmap :: (a -> b) -> MyEither doodad foobar -> MyEither a b
17:41:10 <zoom84> fmap is in a library source file. you're saying i should put it there?
17:41:34 geekosaur again points to indentation
17:42:08 × idhugo quits (~idhugo@563472ae.rev.stofanet.dk) (Ping timeout: 260 seconds)
17:42:18 <MarcelineVQ> This requires InstanceSigs
17:42:32 <ski> (as was already mentioned, twice or thrice :)
17:42:37 klardotsh joins (~klardotsh@c-71-231-242-112.hsd1.wa.comcast.net)
17:42:48 <ski> at top of your source file :
17:42:50 <ski> {-# LANGUAGE InstanceSigs #-}
17:42:53 <ski> later :
17:42:58 <ski> data MyEither dog cat = MyLeft dog
17:43:02 <ski> | MyRight cat
17:43:06 <ski> deriving Show
17:43:12 <ski>
17:43:15 <ski> instance Functor (MyEither doodad)
17:43:16 <zoom84> sorry ski, missed that. it's hard to follow multiple threads of help at once. i'll at it
17:43:23 <ski> where
17:43:28 <ski> fmap :: (a -> b) -> (MyEither doodad foobar -> MyEither a b)
17:43:32 <ski> fmap f (MyLeft x) = MyLeft x
17:43:36 <ski> fmap f (MyRight y) = MyRight (f y)
17:43:45 <ski> zoom84 : like that ^
17:44:21 <ski> zoom84 : "fmap is in a library source file. you're saying i should put it there?" -- yes, there is a general type signature of `fmap' in the type class declaration of `Functor', it looks like
17:44:25 <ski> class Functor f
17:44:27 <ski> where
17:44:33 <ski> fmap :: (a -> b) -> (f a -> f b)
17:45:22 <ski> however, when making an `instance' declaration, you can actually (if you enable the `InstanceSigs' language extension, as above) put the specific type signatures, for your instance, on the type class methods
17:45:35 × tessier quits (~treed@kernel-panic/copilotco) (Ping timeout: 260 seconds)
17:46:03 × ym555 quits (~ym@41.42.210.219) (Ping timeout: 260 seconds)
17:46:26 <ski> geekosaur : pretty sure they have relevant indentation in their source code :)
17:46:55 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 240 seconds)
17:46:58 <geekosaur> I'm not, because you get that error instead of "turn on InstanceSigs" if you didn't indent it.
17:47:31 <geekosaur> and you don't get other errors you might think you would, it'd just be a local redeclaration which is legal
17:47:52 <ski> ah, i missed that. perhaps they dedented, then, since from earlier discussion, it seemed the issue wasn't some error, but understanding the code in question
17:47:57 <geekosaur> until you go to use it and it complains it's declared twice in the same scope, one in Prelude
17:48:24 × vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving)
17:48:31 <ski> zoom84 : yes, make sure the definition (and type signature) of `fmap' is actually indented more than the `instance Functor ..' line
17:48:47 <zoom84> indent was ok. here's what I get:
17:49:03 <zoom84> instance Functor (MyEither doodad) where
17:49:09 <zoom84> fmap :: (a -> b) -> MyEither doodad foobar -> MyEither a b
17:49:29 <zoom84> fmap f (MyRight x) = MyRight (f x)
17:49:42 <zoom84> fmap f (MyLeft x) = MyLeft x
17:49:43 mirrorbird joins (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276)
17:49:50 <zoom84> • Couldn't match type ‘a’ with ‘doodad’ ‘a’ is a rigid type variable bound by the type signature for: fmap :: forall a b foobar. (a -> b) -> MyEither doodad foobar -> MyEither a b
17:50:09 <zoom84> that error is for the fmap f (MyLeft x) = MyLeft x line
17:50:10 <ski> zoom84 : is there actually some (more) spaces in front of those last three lines you showed, in your source code ?
17:50:24 <zoom84> spaces. don't know how to retain intent pasting into this web irc client
17:50:30 <ski> zoom84 : yes, you get that error because your type signature is wrong (as mentioned before)
17:50:44 <ski> it's ok, as long as they're there, in your code
17:50:55 × albert_99 quits (~Albert@p200300e5ff0b5b425d211d042df94ce7.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
17:51:04 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
17:51:06 <zoom84> missed the correction in the cross-talk. what's the correct sig
17:51:16 × Guest_57 quits (590fec7f@x590fec7f.dyn.telefonica.de) (Remote host closed the connection)
17:51:26 <ski> the point, i thought, was that you wanted to figure out the correct signature yourself ?
17:51:40 conal joins (~conal@64.71.133.70)
17:51:56 <zoom84> i do
17:52:04 <zoom84> why is the sig I wrote incorret
17:52:23 <zoom84> ie, what's the correct sig
17:52:29 nievlo joins (bd801243@189.128.18.67)
17:52:38 tessier joins (~treed@kernel-panic/copilotco)
17:52:48 × geekosaur quits (42d52102@66.213.33.2) (Remote host closed the connection)
17:52:57 <ski> if you look at `fmap :: (a -> b) -> MyEither doodad foobar -> MyEither a b', and compare it with the definition equation `fmap f (MyLeft x) = MyLeft x', you can see that the first parameter,`f', gets type `a -> b', and the second parameter, `MyLeft x', gets type `MyEither doodat foobar', and that the result `MyLeft x' is to have type `MyEither a b'
17:53:34 <ski> zoom84 : do you understand that part, matching up parameters and result, in a definition equation like `fmap f (MyLeft x) = MyLeft x', with the corresponding parameter types and result type, in the type signature ?
17:53:54 nievlo parts (bd801243@189.128.18.67) ()
17:55:30 bloodstalker joins (~bloodstal@46.166.187.154)
17:55:32 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
17:56:20 shatriff joins (~vitaliish@217.27.153.240)
17:57:16 <zoom84> still working on it...
17:57:29 <ski> zoom84 : a "yes" or "no" would be nice
17:57:31 <zoom84> understand what you wrote ski...making changes to understand
17:57:35 <ski> ok
17:58:05 × alx741_ quits (~alx741@186.178.110.22) (Ping timeout: 240 seconds)
17:58:20 <zoom84> zoom, I understand. in isolation it makes sense, ie for simpler functions. in this context I get confused
17:58:33 <ski> next step, it to actually check that the matching up of formal parameters (aka patterns) and result (expression), with the parameter and result types, actually makes sense
17:58:48 <ski> so, let's think about that
17:58:53 <ski> we know
17:58:55 <zoom84> give me a sec..
17:59:05 <ski> fmap :: (a -> b) -> MyEither doodad foobar -> MyEither a b
17:59:06 <zoom84> can only work on one thought experiemnt at a time
17:59:07 <ski> fmap f (MyLeft x) = MyLeft x
17:59:32 <ski> and, from matching up parameters and result with corresponding types in signature, we get
17:59:35 <ski> f :: a -> b
17:59:42 <ski> MyLeft x :: MyEither doodad foobar
17:59:48 <ski> MyLeft x :: MyEither a b
18:00:02 × Usurp quits (~Usurp@217.146.82.202) ()
18:00:22 × is_null quits (~jpic@pdpc/supporter/professional/is-null) (Ping timeout: 244 seconds)
18:00:45 × oisdk quits (~oisdk@2001:bb6:3329:d100:2471:1ee3:650d:c8f7) (Quit: oisdk)
18:00:54 <ski> (that's the same as i mentioned before, just spelled out a little more explicitly, using the `::' ("has type") notation)
18:01:08 ski waits for zoom84
18:01:42 × dyeplexer quits (~lol@unaffiliated/terpin) (Read error: Connection reset by peer)
18:02:01 <monochrom> I wonder if it's helpful again to do my trick. By going "instance Functor (MyEither doodad)", you saying: in "(a -> b) -> f a -> f b" you're setting "f" to "MyEither doodad". So do that consistently and see what you get.
18:02:26 mananamenos joins (~mananamen@84.122.202.215.dyn.user.ono.com)
18:04:34 cohn parts (~noone@unaffiliated/cohn) ()
18:06:03 × mananamenos_ quits (~mananamen@vpn236-17.vpns.upv.es) (Ping timeout: 260 seconds)
18:06:21 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
18:06:29 <zoom84> :r
18:07:00 <ski> Ok, one module loaded.
18:07:19 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
18:09:46 <zoom84> finally have a signature that correctly compiles...reading over to understand fully.
18:09:48 × bitmapper quits (uid464869@gateway/web/irccloud.com/x-umfptdbczzisdhag) (Quit: Connection closed for inactivity)
18:09:50 × mirrorbird quits (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276) (Quit: Leaving)
18:09:55 <ski> ok
18:10:28 cohn joins (~noone@unaffiliated/cohn)
18:10:55 × mananamenos quits (~mananamen@84.122.202.215.dyn.user.ono.com) (Ping timeout: 240 seconds)
18:11:28 mananamenos joins (~mananamen@84.122.202.215.dyn.user.ono.com)
18:11:51 vicfred joins (~vicfred@unaffiliated/vicfred)
18:13:21 × jiribenes quits (~jiribenes@rosa.jiribenes.com) (Read error: Connection reset by peer)
18:13:38 × zacts quits (~zacts@dragora/developer/zacts) (Quit: leaving)
18:15:49 jiribenes joins (~jiribenes@rosa.jiribenes.com)
18:18:39 bloodsta1ker joins (~bloodstal@46.166.187.154)
18:19:09 idhugo joins (~idhugo@563472ae.rev.stofanet.dk)
18:19:53 <ski> zoom84 : do you understand it better, now ?
18:20:15 <zoom84> yeah. there are multiple aspects that confused me. with the correct sig I'm working through them one at a time
18:21:17 <ski> zoom84 : would you like to see how one could, manually, check the definition, given the type signature (continuing the line i started to get into, above) ?
18:21:27 × bloodstalker quits (~bloodstal@46.166.187.154) (Ping timeout: 258 seconds)
18:21:52 <zoom84> sure
18:22:27 hackage wai-extra 3.1.1 - Provides some basic WAI handlers and middleware. https://hackage.haskell.org/package/wai-extra-3.1.1 (MichaelSnoyman)
18:22:29 <ski> continuing from the incorrect type signature above (so you can see why it doesn't work), or using your current, correct, type signature ?
18:22:32 chaosmasttter joins (~chaosmast@p200300c4a73b2e0100f3c5a701cd6e56.dip0.t-ipconnect.de)
18:22:43 <zoom84> let's use my correct sig. here's what I have:
18:22:43 <ski> (or both, if you want to)
18:22:50 <zoom84> fmap :: (a -> b) -> MyEither doodad a -> MyEither doodad b
18:22:54 <ski> ok
18:23:06 <ski> so, comparing that with
18:23:13 Stanley00 joins (~stanley00@unaffiliated/stanley00)
18:23:23 <ski> fmap f (MyLeft x) = MyLeft x
18:23:24 × bloodsta1ker quits (~bloodstal@46.166.187.154) (Ping timeout: 256 seconds)
18:23:35 bloodstalker joins (~bloodstal@46.166.187.178)
18:23:38 <ski> we can see that the formal parameters (the patterns) will get types
18:23:42 <ski> f :: a -> b
18:23:43 <frdg> is there a better way to turn a list into a set than using nub?
18:23:58 <ski> MyLeft x :: MyEither doodad a
18:24:10 <Cale> frdg: Data.Set.fromList
18:24:12 <ski> and that the result expression then ought to have the type
18:24:15 takuan joins (~takuan@178-116-218-225.access.telenet.be)
18:24:24 <ski> MyLeft x :: MyEither doodad b
18:24:47 albert_99 joins (~Albert@p200300e5ff0b5b425d211d042df94ce7.dip0.t-ipconnect.de)
18:24:48 <Cale> If you really want sets, might as well be using Data.Set -- it has more of the operations you probably want to perform on sets as well.
18:25:03 <frdg> Cale: I am trying to write that module myself.
18:25:24 <ski> zoom84 : so, the goal here is to take apart the formal parameters, the pattern, to get types for the variables in the pattern (here `f' and `x'), and then to check that the expected type for the result expression (sometimes called the "body" of the defining equation) is correct
18:25:35 inkbottle joins (~inkbottle@aaubervilliers-654-1-101-245.w86-212.abo.wanadoo.fr)
18:25:43 × zebrag quits (~inkbottle@aaubervilliers-654-1-80-159.w86-212.abo.wanadoo.fr) (Ping timeout: 260 seconds)
18:25:49 <frdg> and I was going to use sets as lists that have been made sets.
18:25:58 hackage lists-flines 0.1.1.0 - Additional data and structures to some 'String'-related lists. https://hackage.haskell.org/package/lists-flines-0.1.1.0 (OleksandrZhabenko)
18:25:59 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
18:26:07 <ski> @type S.toList . S.fromList
18:26:09 <lambdabot> Ord a => [a] -> [a]
18:26:13 <zoom84> ski, I kinda stumbled on that route by just closely reading the compiler error messages and matching the expected vs actual types
18:26:30 <Cale> map head . group . sort -- this might also be of interest
18:26:44 <zoom84> that let me cobble together the correct signature...from which I was able to finally connect the dots
18:26:54 <zoom84> in terms of understanding all the params
18:26:54 <frdg> ok thanks
18:27:10 <Cale> > sort "mississippi"
18:27:12 <lambdabot> "iiiimppssss"
18:27:20 <Cale> > group . sort $ "mississippi"
18:27:22 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
18:27:22 <lambdabot> ["iiii","m","pp","ssss"]
18:27:26 <Cale> > map head . group . sort $ "mississippi"
18:27:29 <lambdabot> "imps"
18:27:35 × Stanley00 quits (~stanley00@unaffiliated/stanley00) (Ping timeout: 260 seconds)
18:27:36 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
18:27:36 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
18:27:36 GyroW joins (~GyroW@unaffiliated/gyrow)
18:27:38 <frdg> I see.
18:27:44 <ski> zoom84 : ok. so we already know the type of `f'. but, given `MyLeft x :: MyEither doodad a', what will be the type of `x' ?
18:27:56 × brandly quits (~brandly@c-73-68-15-46.hsd1.ma.comcast.net) (Ping timeout: 256 seconds)
18:29:04 <zoom84> it will be 'b', correct?
18:29:08 <ski> no
18:29:25 <zoom84> it works as 'b' in my actual implementation
18:29:34 <zoom84> err
18:29:36 <zoom84> take that back
18:30:14 <ski> perhaps, if you ask in the interactor, it will have renamed some type variables. i'm talking specifically about the naming that we picked above, not about some other naming
18:30:15 <zoom84> MyLeft x works, which means it conforms to the return type sig of "MyEither doodad b"
18:30:26 roconnor joins (~roconnor@host-45-78-194-116.dyn.295.ca)
18:30:39 <ski> fmap f (MyLeft x) = MyLeft x
18:30:44 <zoom84> yep
18:30:55 <zoom84> so you're asking what's the type of x?
18:30:56 <ski> note that i'm talking, so far, only about the underlined pattern (formal parameter)
18:30:59 <ski> yes
18:31:19 <ski> we know
18:31:21 <ski> MyLeft x :: MyEither doodad a
18:31:23 <zoom84> well,(MyLeft x) is a destructuring
18:31:29 <ski> so, we should be able to figure out
18:31:31 <ski> x :: ???
18:31:45 <ski> yes, it's pattern-matching
18:31:55 <zoom84> and I'm passing a (MyLeft 10) in, as an example
18:32:06 <zoom84> such as fmap (*2) (MyLeft 10)
18:32:39 <zoom84> doodad is already bound by the partial application of My Either
18:32:44 <zoom84> so doesn't x have to be a?
18:32:55 × albert_99 quits (~Albert@p200300e5ff0b5b425d211d042df94ce7.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
18:32:57 <ski> no
18:32:59 albert_91 joins (~Albert@p200300e5ff0b5b4248a33bded2872db1.dip0.t-ipconnect.de)
18:33:14 <ski> consider again your `data' type definition
18:33:24 <ski> data MyEither dog cat = MyLeft dog
18:33:25 <ski> | MyRight cat
18:33:28 <ski> deriving Show
18:33:30 <zoom84> you mean dog then?
18:34:30 <ski> the `MyLeft dog' part here is a "template", it actually means that if (e.g.) `t' has type `dog', then `MyLeft t' will have type `MyEither dog cat'. and if `u' has type `cat', then `MyRight u' will (also) get type `MyEither dog cat'
18:34:57 <ski> in your case, `dog' is `doodad', and `cat' is `a', since we're considering `MyLeft x :: MyEither doodad a'
18:35:06 <ski> and, instead of `t', you have `x'
18:35:55 <zoom84> so it's dog, correct
18:35:58 <zoom84> ?
18:36:01 alp joins (~alp@2a01:e0a:58b:4920:84ce:b984:b792:c925)
18:36:05 <ski> if we rename `dog',`cat',`t',`u' to `doodad',`a',`x',`y', then the above becomes
18:36:46 <ski> the `MyLeft doodad' part here is a "template", it actually means that if (e.g.) `x' has type `doodad', then `MyLeft x' will have type `MyEither doodad a'. and if `y' has type `a', then `MyRight y' will (also) get type `MyEither doodad a'
18:37:18 <ski> in other words, if it helps, we're imagining now that we actually had written
18:37:33 <ski> data MyEither dogdad a = MyLeft doodad
18:37:39 <ski> | MyRight a
18:37:42 <ski> deriving Show
18:38:47 <zoom84> ok
18:38:48 <ski> so, in the current situation, with `fmap :: (a -> b) -> MyEither doodad a -> MyEither doodad b', and `MyLeft x :: MyEither doodad a' .. there is no `dog' (nor `cat'). so "so it's dog, correct ?" is wrong
18:39:10 <zoom84> so the question posed to me is still, what's the type of x, right?
18:39:12 <ski> you have to answer in terms of the available type variables, in the current situation, which are : `doodad',`a',`b'
18:39:16 <ski> yes
18:39:56 <zoom84> then i don't know. because I guess the entire vernacular of what's being referred to as a type confuses me
18:40:04 <zoom84> based on my reading of haskell, the only type here is MyEither
18:40:18 <zoom84> MyLeft and MyRight are constructors for that type
18:40:34 <zoom84> but irrespective of whether an instance is MyRight or MyLeft, the type is still MyEither
18:40:42 <ski> `MyEither' is a type, `MyEither doodad a' and `MyEither doodad b' are also types, as are `a -> b',`a',`b',`doodad' (all type variables are types)
18:40:45 <zoom84> unless my understanding of what we're calling a type is wrong
18:42:13 snakemasterflex joins (~snakemast@213.100.206.23)
18:42:21 <ski> saying `MyLeft x :: MyEither doodad a' means that the (pattern / formal parameter) `MyLeft x' has type `MyEither doodad a'
18:42:36 <ski> (so `MyEither doodad a' is a type. otherwise `MyLeft x' couldn't have it as type)
18:43:11 <ski> what you're doing, when pattern-matching (which is a generalization of destructuring), is that you're going "backwards"
18:43:18 <zoom84> you're saying MyEither doodad a is a type distinct from MyEither?
18:43:28 <ski> yes
18:43:39 <ski> `MyEither doodad a' is a "concrete" type
18:43:46 <ski> it makes sense to say e.g
18:43:55 <ski> MyLeft x :: MyEither doodad a
18:44:15 <zoom84> yeah, that's another point of confusion for me. the fact that a parameterized var can be considered concrete
18:44:19 <ski> "concrete" types are those types that are types of values
18:44:29 <dolio> That seems like a bad name for them.
18:44:35 <ski> "concrete" doesn't mean "specific"
18:44:50 <ski> yea, sometimes people trip up over this distinction
18:44:58 × Franciman quits (~francesco@host-212-171-42-250.retail.telecomitalia.it) (Ping timeout: 265 seconds)
18:45:02 <zoom84> ok, good. because this was another point of confusion to me that feed into this
18:45:15 <zoom84> so MyEither doodad a is concrete
18:45:25 <ski> `doodad' and `a' are type variables. that mean that we don't have any specific types in mind (like `Int' or `[Bool]', ..), when we write them
18:45:30 <zoom84> what does that make MyEither Int or MyEither String?
18:45:38 kritzefitz joins (~kritzefit@212.86.56.80)
18:45:59 devalot joins (~ident@mail.pmade.com)
18:46:25 <zoom84> is there a name for MyEither Int vs MyEither doodad...to help me grasp the nomenclature
18:46:49 <ski> so, what we mean when we say that `MyEither doodad a' is a concrete type is actually : if we'd replace `doodad' and `a' with specific (concete) types, then the result of that replacement on `MyEither doodad a' will be a concrete type
18:47:05 <zoom84> ok, understood on that point
18:47:14 <zoom84> so it's a pathway to a concrete type
18:47:20 <ski> e.g. since `Int' and `[Bool]' are specific (concrete) types, `MyEither Int [Bool]' is a concrete (specific) type
18:47:51 <ski> however, it gets long-winded to all the time say that "if we replace the type variables with specific types, then .." part all the time
18:48:25 × knupfer quits (~Thunderbi@200116b82cef830020ab55033e39ebbd.dip.versatel-1u1.de) (Ping timeout: 240 seconds)
18:48:27 <zoom84> ok, so what's an example of a non-concrete type in this specific context
18:48:43 <ski> it's like when saying that `x + 1' is a number. we really mean here : if `x' is replaced by a number, then `x + 1' will become (an expression for) a number
18:49:04 <ski> `MyEither' is not concrete
18:49:09 <ski> it doesn't make sense to say
18:49:14 <ski> blah :: MyEither
18:49:31 <ski> `MyEither' is "incomplete" on its own, it's a "template" that's missing it's parameters
18:49:32 <zoom84> ok, so MyEither is non-concrete because it doesn't establish which specific constructor would be referenced
18:49:59 <ski> you have to say `MyEither T U', for some specific types `T' and `U', to get a concrete type
18:50:01 <zoom84> but the constructors themselves are concrete because they have placeholders which lead to concrete types
18:51:01 <ski> you have to distinguish between two different "levels". "value level" where values (including functions) live, and interact. and "type level" where types (including non-concrete types) live
18:51:35 <ski> the data constructors `MyLeft' and `MyRight' live on the "value level". they are functions. we in fact have :
18:51:41 <ghoulguy> ski: are you using "concrete" as a stand-in for "has kind *"?
18:51:52 <ski> MyLeft :: dog -> MyEither dog cat
18:51:59 <ski> MyRight :: cat -> MyEither dog cat
18:52:05 <dolio> Yeah, I've never heard this terminology before.
18:52:08 oisdk joins (~oisdk@2001:bb6:3329:d100:189f:9172:61d6:2b9e)
18:52:16 <ski> ghoulguy : almost. i'm also using it to gloss over unboxed stuff, &c.
18:52:51 <ski> (which part of the terminology ?)
18:53:19 <zoom84> i think i get it SKI. the abstractness here is what throws me off. In my C world view, haskell's "data" created types are what I would implement as unions in C, which a hidden enum field describing which of the type constructors were used. it's probably not useful for me to relate this to C
18:53:27 <dolio> Using "concrete" in this way.
18:53:48 <zoom84> but I'll table that C comparison because it's not useful
18:54:16 <ski> zoom84 : in C, you can't really have "an array". it's always "an array of something". if you say you have an array, you really mean an array with elements of some particular type
18:54:53 <ski> zoom84 : saying `blah :: MyEither' is like trying to say `blah' is an array (rather than an array of something)
18:55:12 is_null joins (~jpic@pdpc/supporter/professional/is-null)
18:55:40 <hc> zoom84: actually that comparison if not bad... :)
18:55:42 <ski> "array" is a parameterized type, in C. (as is "pointer", it's always "pointer to something"). in Haskell, you can define your own parameterized types
18:56:27 hackage uniqueness-periods-vector-examples 0.8.0.0 - Usage examples for the uniqueness-periods-vector series of packages https://hackage.haskell.org/package/uniqueness-periods-vector-examples-0.8.0.0 (OleksandrZhabenko)
18:57:07 sep2 joins (49dc4892@c-73-220-72-146.hsd1.ca.comcast.net)
18:57:16 <zoom84> data MyEither dog cat = MyLeft dog | Myright catstruct { enum { DOG, CAT } type; union { int dog; int cat; }}
18:57:25 <dolio> I think "saturated" might be a better word.
18:57:27 hackage porpoise 0.1.0.0 - A minimalist HTTP server framework written on top of wai https://hackage.haskell.org/package/porpoise-0.1.0.0 (sgschlesinger)
18:57:40 Guest75545 joins (~Fare@178.162.204.214)
18:57:47 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
18:58:15 <zoom84> ok, so MyEither is a type. MyLeft is also considered a type, but a concrete one. is that recap correct?
18:58:17 <monochrom> I think this is trying to explain kinds without explaining kinds.
18:58:17 <hc> zoom84: sounds about right; but you'd need a parametrized macro to expand the doc and cat types
18:58:21 <sep2> What would be the best way to even get started with this one, a one-liner or do a function for each instance being empty? https://dpaste.org/ZQ2h
18:58:43 <dolio> monochrom: Well, yeah.
18:58:45 <ski> zoom84 : anyway, `MyEither dog cat' is comparable to "array of `N' `int's" in C (which could be written `int[N]'). in both cases we have supplied (two) parameters
18:58:53 <monochrom> But it is a really long story, I don't have a better suggestion.
18:58:59 × Jesin quits (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) (Quit: Leaving)
18:59:08 <ski> zoom84 : not quite. `MyLeft' and `MyRight' are not types. they're values (specifically they're `data' constructors)
18:59:19 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:bd24:9726:f60a:ba09) (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:59:50 <ski> MyLeft :: dog -> MyEither dog cat
18:59:51 <ski> MyRight :: cat -> MyEither dog cat
18:59:53 <zoom84> Ok. MyEither is a type. MyLeft and MyRight are value constructors, which create concrete types of MyEither. is that right?
18:59:54 <monochrom> Well, I have a prelim one I use in my class. I start with Maybe Int and [] Int and I say "now you can have a type class for the Maybe-ness without Int, the []-ness without Int".
19:00:02 <hc> zoom84: that's right
19:00:21 <zoom84> are they called value constructors or is the correct term, type constructors?
19:00:21 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
19:00:52 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:8115:8d3a:8e30:e79f)
19:00:55 <hc> This is a type constructor, because you get a type and not a value back
19:01:01 <ghoulguy> constructor is a class of names, the capital first letter gives away that it's a constructor here
19:01:39 <ski> zoom84 : `MyLeft' and `MyRight' are functions, like any other functions. you can apply them to an input (of the correct type, as always). the difference with ordinary functions are (a) you can pattern-match on them, "running them backwards"; (b) they don't actually do/compute anything, except storing their parameters so that you can later match and get them back
19:01:56 × idhugo quits (~idhugo@563472ae.rev.stofanet.dk) (Ping timeout: 256 seconds)
19:02:37 <zoom84> ok, understood. so what's the entity called that's created say "MyLeft 50"? I would consider it an instance of a type in other languges
19:02:37 <ski> dolio : i think the "concrete" terminology has floated around this channel, for many years
19:02:55 <ski> zoom84 : it's also a value. a value of type `MyEither Int Double' (e.g.)
19:02:55 × berberman_ quits (~berberman@2408:8207:256e:d930:584e:a9ff:fe9b:d3fe) (Ping timeout: 240 seconds)
19:02:58 <ghoulguy> 'MyLeft 50' is a value that has the type "MyEither Integer something"
19:03:03 conal joins (~conal@64.71.133.70)
19:03:03 × conal quits (~conal@64.71.133.70) (Client Quit)
19:03:06 <monochrom> sep2: I don't understand the question.
19:03:19 berberman joins (~berberman@2408:8207:2560:ee60:584e:a9ff:fe9b:d3fe)
19:03:26 conal joins (~conal@64.71.133.70)
19:03:31 <zoom84> ok, so using a type constructor yields something haskell terms a value?
19:03:46 <ski> zoom84 : in terms of Java terminology, yes, you could say it's an "instance" of the type `MyEither Int Double'. but Haskell doesn't use the term "instance" in this sense, uses it for something different instead
19:04:03 <ski> zoom84 : a type constructor is different from a data constructor
19:04:05 <frdg> how could I go about creating a type-class for Set? In the same way that fmap is defined for the Functor class, can I a define a predicate, isSet, that a individual Set (just a list to haskell) must hold for? Is what I am describing different from a type class?
19:04:24 <hc> zoom84: a type constructor yields a concrete type
19:04:24 <zoom84> ah, ok. i remember that ski.
19:04:31 conal_ joins (~conal@64.71.133.70)
19:05:01 <zoom84> so MyLeft and MyRight are called data constructors
19:05:03 <ski> zoom84 : `MyEither',`Int',`Bool',`Double',`IO',`(->)' are type constructors. `MyLeft',`MyRight',`False',`True' are data constructors
19:05:06 <ski> yes
19:05:07 <frdg> isSet :: [a] -> Bool
19:05:15 <sep2> @monochrom How do I go about accepting an empty finite state machine ? Q = {0}•s=0•F=∅• δ(0,a)=0foralla∈Σ.
19:05:16 <lambdabot> Unknown command, try @list
19:05:28 <sep2> That was badly formatted excuse me
19:05:29 <dolio> Either doesn't yield a concrete type after one application.
19:05:41 <ski> zoom84 : type constructors are types. but not necessarily vice versa. `MyEither Int [Bool]' is a type, but not a type constructor
19:05:51 <monochrom> Accept an empty machine? Accept an empty language?
19:06:35 <zoom84> your example is not a type constructor because it's fully applied, correct?
19:06:58 <ski> zoom84 : some type constructors are concrete (e.g. `Bool',`Int'), some aren't (e.g. `MyEither',`IO',`(->)',`Maybe'). you could also say that the latter are parameterized (/ are type functions), and the former are not parameterized (are not type functions)
19:07:03 Jesin joins (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net)
19:07:30 <monochrom> Are you OK with simply emptyFSM = ([0], 0, [], \s c -> 0) ?
19:07:32 <zoom84> for example, (MyEither a) is a type constructor but (MyEither a b) is a type (and a concrete one). is that right?
19:07:39 × chele quits (~chele@ip5b416ea2.dynamic.kabel-deutschland.de) (Remote host closed the connection)
19:07:51 <zoom84> the former being a constructor because it's not fully applied (ie, missing "b")
19:07:54 knupfer joins (~Thunderbi@200116b82cef83007c6d07fffe625a30.dip.versatel-1u1.de)
19:07:55 × knupfer quits (~Thunderbi@200116b82cef83007c6d07fffe625a30.dip.versatel-1u1.de) (Client Quit)
19:07:55 × conal quits (~conal@64.71.133.70) (Ping timeout: 240 seconds)
19:08:03 <ski> zoom84 : `MyEither' is parameterized, is a type function, since you can "apply" it to a type (not a value). e.g. applying it to `Int' gives `MyEither Int' .. which is also not concrete, is still a type function, still accepts a further parameter
19:08:07 knupfer joins (~Thunderbi@87.123.206.236)
19:08:18 × conal_ quits (~conal@64.71.133.70) (Client Quit)
19:08:29 alx741 joins (~alx741@186.178.110.22)
19:08:45 × alx741 quits (~alx741@186.178.110.22) (Client Quit)
19:09:01 <ski> zoom84 : applying `MyEither Int' to e.g. `[Bool]', you get `(MyEither Int) [Bool]', which we can write simpler just as `MyEither Int [Bool]', and this is a concrete type (no further parameters accepted), and so we can talk about values of this type `MyEither Int [Bool]'
19:09:05 Falkeo joins (5631fd8b@ip-86-49-253-139.net.upcbroadband.cz)
19:09:15 <ski> (it doesn't make sense to talk about values of a non-concrete type)
19:09:36 <zoom84> got it. to fully nail down the correct terminology, both (Either a) and (Either Int) are type constructors since they're not fully applied. the former uses a parameterized var but otherwise they're called the same thing?
19:10:16 <ski> zoom84 : "your example is not a type constructor because it's fully applied, correct?" -- no. `MyEither Int [Bool]' is fully applied. type constructor is a separate issue from being concrete (some type constructors are concrete, some aren't. some concrete types are type constructors, some aren't)
19:10:30 <ski> zoom84 : no
19:10:36 avdb joins (~avdb@ip-213-49-124-37.dsl.scarlet.be)
19:10:47 <zoom84> hmm...
19:10:53 <zoom84> if I have Either a b
19:10:53 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
19:10:58 <sep2> @monochrom that's what I had originally thought but I would get error: Data constructor not in scope: Undefined :: FSM Int
19:10:59 <lambdabot> Unknown command, try @list
19:11:04 conal joins (~conal@64.71.133.70)
19:11:14 <zoom84> and use (Either a) in a functor, I thought that (Either a) implicitly creates a type constructor by dint of not being fully applied
19:11:35 <monochrom> But I didn't wrote "Undefined" anywhere.
19:11:35 × knupfer quits (~Thunderbi@87.123.206.236) (Read error: Connection reset by peer)
19:11:42 knupfer joins (~Thunderbi@200116b82cef8300610dc462ddae2e63.dip.versatel-1u1.de)
19:11:54 <ski> a type constructor is a "single atomic name" for a type (not including type variables). like `MyEither',`Int',`Maybe',`IO',`(->)'. but not including compound/complicated types like `Maybe Int',`(->) Int Bool',`MyEither Int',`MyEither Int [Bool]'
19:11:56 <monochrom> WHO WROTE THAT?!
19:12:51 <zoom84> "Well well, what did we do here? You can see how we made Either a an instance instead of just Either. That's because Either a is a type constructor that takes one parameter, whereas Either takes two. "
19:12:59 <zoom84> http://learnyouahaskell.com/making-our-own-types-and-typeclasses#the-functor-typeclass
19:13:03 × AlterEgo- quits (~ladew@124-198-158-163.dynamic.caiway.nl) (Quit: Leaving)
19:13:06 <sep2> It was looking at the next line after this one, where it takes in 'a' from sigma which is undefined for now @monochrom
19:13:31 <monochrom> You need to paste full code. I am not telepathic.
19:13:48 <maerwald> not even a little bit?
19:13:48 <ski> just like a data constructor is a "single atomic name" for an alternative of a data type. like `MyLeft',`MyRight',`Nothing',`Just',`False',`True'. but not including compound/complicated value expressions like `MyLeft 10',`MyRight [False,True,False]',`Just 42'
19:13:55 <monochrom> I am dumb.
19:14:15 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 244 seconds)
19:14:18 <monochrom> I know that most of you are telepathic.
19:14:20 <zoom84> ski, so is the text I pasted from learnyouhaskell incorrect then?
19:14:28 hackage uniqueness-periods-vector-examples 0.8.0.1 - Usage examples for the uniqueness-periods-vector series of packages https://hackage.haskell.org/package/uniqueness-periods-vector-examples-0.8.0.1 (OleksandrZhabenko)
19:14:34 ChanServ sets mode +o dolio
19:14:34 dolio sets mode -o monochrom
19:14:41 dolio sets mode -o dolio
19:14:43 alx741 joins (~alx741@186.178.110.22)
19:15:13 <ski> zoom84 : there are two different schools of terminology. one calls parameterized types / types functions, "type constructors" (but then there's no good name for the "single atomic names of types", reserves the name "type" for what i've called "concrete type"
19:15:24 geekosaur joins (42d52102@66.213.33.2)
19:15:32 <sep2> https://dpaste.org/fFjT
19:16:06 <monochrom> OK, so use lowercase "undefined"?
19:16:09 <zoom84> ski, that's unfortunate
19:16:10 <ski> in the other school, `Functor' is not a type class, but a "constructor class" (since `f' in `Functor f' is not a "type", but a "type constructor")
19:16:13 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
19:16:16 shaman_king joins (b94186ae@185.65.134.174)
19:16:23 <shaman_king> i think haskell sucks ass.
19:16:28 <ski> however, i haven't seen people use the term "constructor class" in a long time
19:16:29 ChanServ sets mode +o monochrom
19:16:31 shaman_king parts (b94186ae@185.65.134.174) ()
19:16:43 monochrom sets mode -o monochrom
19:16:56 <ski> and i personally think the alternative terminology that i've been using is better
19:17:13 <dolio> Type functions definitely don't need another name.
19:17:22 <zoom84> btw, haven't thanked you yet for all the time you spent walking me through this. so before I continue, a huge thanks
19:17:28 <ski> (some people disagree about the "concrete" term. but otherwise, i think mostly people use "type constructor" and "type" in the sense i've been using them)
19:17:30 <dolio> With a distinct meaning from the value-level version to confuse things.
19:18:08 <zoom84> so what is the output of a data constructor called? Just data? ie, "MyLeft 50"
19:18:25 <ski> you could call it a value of a data type
19:18:25 <zoom84> z = MyLeft 50. is z just considered "data"?
19:19:00 <ski> usually people say "value" unless they have a more specific term in mind (like "integer","string","list (of ...)",&c.)
19:19:02 <zoom84> calling it a value is deeply unsatisfying :)
19:19:17 st8less joins (~st8less@2603:a060:11fd:0:101c:4882:6a23:1c57)
19:19:18 <ski> why ?
19:19:35 <ski> you could call `z' a datum (singular of "data"), if you want to
19:20:00 machinedgod joins (~machinedg@142.169.78.126)
19:20:02 <ski> (btw, note that also functions are values, in Haskell)
19:20:03 <zoom84> because of habit working with other languages. I realize it is indeed just a value, esp since it's immutable. but it's hard to not just call it a variable, or at least an instance of a type
19:20:24 Super_Feeling joins (~Super_Fee@103.92.43.209)
19:20:32 <ski> yea, using the "value" term tends to emphasize the immutability, which is a good thing :)
19:20:55 <ski> a "variable" is a syntactic thing
19:20:57 <monochrom> MyLeft 50 is not a variable in any sense, any culture.
19:21:10 × Super_Feeling quits (~Super_Fee@103.92.43.209) (Client Quit)
19:21:14 <ski> in your program source, `z' is a variable, but `MyList 50' is not a variable
19:21:19 Super_Feeling joins (~Super_Fee@103.92.43.209)
19:21:33 <ski> but the variable `z' refers (will refer) to the value `MyList 50'
19:21:36 <zoom84> mono, If in an OOP I have a class called MyLeft and a constructor which takes an int, the resulting instance would be stored in a variable, no?
19:21:39 <monochrom> I'm OK with "instance" as long as you also agree, consistently, to say that "50 is an instance of type Integer".
19:21:58 <monochrom> MyLeft is not an OOP constructor to begin with.
19:22:10 <zoom84> i guess more specifically the variable would be called a reference. or a ptr
19:22:15 <monochrom> OOP constructor means you can write arbitrary code.
19:22:21 <dolio> No, it's a variable.
19:22:28 <ski> (of course, `MyList 50' is, strictly speaking, also just text, in a source file. so when we say "the value `MyList 50'", we really mean "the value that the expression `MyList 50' describes")
19:22:29 <monochrom> MyLeft doesn't contain arbitrary code you can write.
19:22:34 × Super_Feeling quits (~Super_Fee@103.92.43.209) (Client Quit)
19:22:34 <dolio> Like an actual mathematical variable.
19:23:07 <ski> variables (in Haskell, as in math) are immutable
19:23:14 <zoom84> monochrom, by culture i thought you were including other languages. do you mean specific to haskell?
19:23:22 Super_Feeling joins (~Super_Fee@103.92.43.209)
19:23:32 <monochrom> By "any culture" I already include other languages.
19:23:51 <monochrom> In no language you take a literal and say "it's a variable".
19:24:00 <monochrom> 50 is a literal. MyLeft 50 is also a literal.
19:24:16 <zoom84> the literal is not a variable. the instance created by the constructor that was passed the literal is what I'm calling a variable
19:24:21 <monochrom> z is a variable but MyLeft 50 is not a variable.
19:24:39 <ski> zoom84 : if you don't name the value, then there is no variable
19:24:41 <zoom84> agreed
19:25:02 <ski> the variable is a name, that you use to refer to a value (the value described by some expression)
19:25:07 geekosaur wonders if zoom84 is reaching for "expression"
19:25:21 × Falkeo quits (5631fd8b@ip-86-49-253-139.net.upcbroadband.cz) (Remote host closed the connection)
19:25:23 <monochrom> In OOP even the objects and instances are not called variables.
19:25:51 <zoom84> let x = MyLeft(50)
19:25:58 <monochrom> And that includes both mutable objects and immutable objects.
19:26:30 × dhouthoo quits (~dhouthoo@ptr-eiv6509pb4ifhdr9lsd.18120a2.ip6.access.telenet.be) (Quit: WeeChat 2.8)
19:26:34 <monochrom> What is dissatisfying to me is a double standard in other cultures.
19:26:43 <ski> zoom84 : btw, it's quite normal (and important) to struggle a bit, as a beginner, with terminology. first to "align vocabulary", so that you can more easily communicate without misunderstandings. but perhaps even more to "align mental maps", to form and highlight the right concepts that we use, when thinking about and discussing things
19:27:10 <sep2> @monochrom apologies. What is it implying in the '\s' in \s c->0 part?
19:27:11 <lambdabot> Unknown command, try @list
19:27:43 <monochrom> To them, an object of a user-defined type "is an instance", but one of a built-in type like int "is not an instance". That's double standard. That's proving that in those cultures, user-defined types are second class, doesn't enjoy as much privilege as built-in types.
19:27:49 <ski> (it's not so simple as just to say "this term in Java is called this in Haskell". there are actual discrepancies between how we delineate concepts, and which concepts we elect to give importance, by naming them, talking about them)
19:28:00 <dolio> Oh man, I thought the @ might stop without the op. :P
19:28:30 × zoom84 quits (44beb1c9@068-190-177-201.res.spectrum.com) (Remote host closed the connection)
19:28:34 <monochrom> In Haskell, we will have none of that. All types, built-in or user-defined, have values. Oh, for user-defined types the value syntax looks a bit different? Big deal, they're still values.
19:29:03 zoom84 joins (44beb1c9@068-190-177-201.res.spectrum.com)
19:29:33 <ski> sep2 : note that it's not IRC custom/convention to adorn nicknames with sigils (like `@'). if you want to refer to someone, or address them specifically, simply mention their nickname
19:29:34 <zoom84> ski, agreed that terminology is important, esp for asking questions effectively. that's why I go out of my way to make sure I'm naming things correctly
19:29:41 wroathe_ joins (~wroathe@75-146-43-37-Minnesota.hfc.comcastbusiness.net)
19:29:47 <zoom84> ie, why I ask if i'm naming things correctly :)
19:30:13 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds)
19:30:27 <hpc> sep2: your client should tab-complete with the correct convention btw, like this
19:30:28 <ski> sep2 : in the latter case, it's good to mention their nicknames first in the message, followed by a comma or colon, and the bulk of the message. many IRC clients alert/hilight the user, if their nickname is mentioned first. not as many do that, if the nickname is not at the very start (e.g. if there a `@' in front of it)
19:30:53 <monochrom> sep2: That's a lambda.
19:30:59 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) ()
19:31:15 <ski> sep2 : also, `@', in association with nicknames, means something specific on IRC (namely that someone is a channel operator. but even if someone has a `@' in front of their nickname, in the channel nickname list, i'd suggest not spelling `@' out, when referring to them)
19:31:16 <monochrom> I wrote an anonymous function in situ.
19:31:34 <monochrom> It's for the state transition function.
19:31:43 wroathe_ is now known as wroathe
19:31:48 <ski> (sep2 : as you noticed, starting a message like "@<nickname> ..." also confuses lambdabot ..)
19:33:21 × alp quits (~alp@2a01:e0a:58b:4920:84ce:b984:b792:c925) (Ping timeout: 272 seconds)
19:33:24 <ski> zoom84 : yea, it's fine :) .. i tend to, sometimes, nitpick a bit on ambiguous or incorrect terminology, especially if i think there's a beginner involved. i've been told several times that that has helped them to get a better understanding of the relevant concepts that we're referring to, in Haskell
19:34:08 <sep2> ski: right on I didn't notice these things until you pointed it out
19:34:57 × avdb quits (~avdb@ip-213-49-124-37.dsl.scarlet.be) (Quit: WeeChat 2.9)
19:35:10 <ski> (if someone is already more familiar with the concepts, one can afford to use more sloppy terminology, when communicating, as long as people "get what you mean" (can fallback on more explicit, on a by-need basis). but, in my experience, this is not a good thing to do, when one's learning the concepts)
19:35:57 × ralejs quits (~ralejs@2620:10d:c093:400::5:2842) (Read error: Connection reset by peer)
19:35:57 ralejs_ joins (~ralejs@2620:10d:c093:400::5:2842)
19:35:58 hackage uniqueness-periods-vector-examples 0.8.0.2 - Usage examples for the uniqueness-periods-vector series of packages https://hackage.haskell.org/package/uniqueness-periods-vector-examples-0.8.0.2 (OleksandrZhabenko)
19:36:07 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
19:37:57 conal joins (~conal@64.71.133.70)
19:38:19 ashbreeze joins (~mark@72-161-254-200.dyn.centurytel.net)
19:38:47 blackfield joins (~blackfiel@unaffiliated/blackfield)
19:38:50 wroathe_ joins (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net)
19:39:58 × _ashbreeze_ quits (~mark@72-161-254-200.dyn.centurytel.net) (Ping timeout: 256 seconds)
19:40:27 <ski> zoom84 : "If in an OOP I have a class called MyLeft and a constructor which takes an int, the resulting instance would be stored in a variable, no?" -- not necessarily. e.g. `frob(new MyLeft<Integer,String>(50));'
19:40:48 × wroathe quits (~wroathe@75-146-43-37-Minnesota.hfc.comcastbusiness.net) (Ping timeout: 258 seconds)
19:40:55 × machinedgod quits (~machinedg@142.169.78.126) (Ping timeout: 240 seconds)
19:41:36 machinedgod joins (~machinedg@142.169.78.126)
19:43:04 <monochrom> I store my DVDs in a box. I don't call my DVDs "the box".
19:43:11 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
19:43:27 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
19:43:27 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
19:43:27 GyroW joins (~GyroW@unaffiliated/gyrow)
19:43:44 <int-e> . o O ( A DVD is a physical container for bits. )
19:44:09 bitmapper joins (uid464869@gateway/web/irccloud.com/x-tfzdjxpokcsicuwj)
19:44:15 wroathe_ is now known as wroathe
19:44:58 <monochrom> We sometimes forgive ourselves for saying "let's watch a DVD together for two hours!" but you never literally stare at the DVD itself.
19:45:23 <no-n> lol
19:45:32 ski . o O ( `foldDVD :: (a -> Bool -> a) -> (a -> DVD -> a)' )
19:46:30 <sep2> for taking in a letter, first example I see is Q={ε,a,T}, how do you represent the epsilon in Haskell? Theres a small diagram and looks like epsilon is start state, a end, t is trap state
19:46:40 <ski> int-e : fwiw, `IChan' has no `Eq' instance
19:46:57 hackage uniqueness-periods-vector-examples 0.8.0.3 - Usage examples for the uniqueness-periods-vector series of packages https://hackage.haskell.org/package/uniqueness-periods-vector-examples-0.8.0.3 (OleksandrZhabenko)
19:47:29 <tomsmeding> % :kind! FilePath
19:47:30 <yahb> tomsmeding: *; = FilePath
19:47:39 <tomsmeding> when did that stop giving me the full, normalised type?
19:47:46 <monochrom> You use Int for states, so make up some numbers 0, 1, 2 to stand for the states, instead of Greek names.
19:48:03 <tomsmeding> the ghc user's guide claims that it still does, but as can be seen, it doesn't :p
19:48:43 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
19:48:54 <monochrom> hrm, maybe it only works for type families
19:48:57 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
19:48:57 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
19:48:57 GyroW joins (~GyroW@unaffiliated/gyrow)
19:49:18 <int-e> ski: Would it be useful? I probably thought it wouldn't be because you keep hopping from one IChan value to the next all the time.
19:49:32 <tomsmeding> monochrom: it does seem to work for type families indeed
19:50:41 <monochrom> ha, yahb just replaces newline by semicolon
19:50:52 <tomsmeding> "works"
19:51:04 <ski> int-e : i guess i'd be more useful, with an `uncons :: IChan a -> Maybe (a,IChan a)'
19:51:28 hackage wai-feature-flags 0.1.0.1 - Feature flag support for WAI applications. https://hackage.haskell.org/package/wai-feature-flags-0.1.0.1 (JasperWoudenberg)
19:51:49 <Super_Feeling> can someone explain what this means: "y :: Int \n y = y + 1"
19:51:52 × oisdk quits (~oisdk@2001:bb6:3329:d100:189f:9172:61d6:2b9e) (Quit: oisdk)
19:51:55 helaoban joins (~carloholl@2603:3024:1704:300::8401)
19:52:01 <ski> (or `isEmpty :: IChan a -> Bool',`readHead :: IChan a -> a',`readTail :: IChan a -> IChan a', if you prefer)
19:52:07 <Super_Feeling> I know y is an Int, but the second line
19:52:10 <tomsmeding> Super_Feeling: it's a bottom!
19:52:11 Franciman joins (~francesco@host-212-171-42-250.retail.telecomitalia.it)
19:52:14 <ski> Super_Feeling : `y' is defined to be itself, plus one
19:52:28 <Super_Feeling> yeah but what is y then? a function, on which i can pass a value?
19:52:32 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
19:52:35 <Super_Feeling> and get the value + 1?
19:52:36 <tomsmeding> it's an integer
19:52:40 oisdk joins (~oisdk@2001:bb6:3329:d100:189f:9172:61d6:2b9e)
19:52:40 <ski> Super_Feeling : so, `y = y + 1 = (y + 1) + 1 = ((y + 1) + 1) + 1 = ...'
19:52:47 mirrorbird joins (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276)
19:52:48 <tomsmeding> but if you try to evaluate it, you'll infinite-loop
19:52:49 <Super_Feeling> so infinite recursion
19:53:00 <Super_Feeling> got it, this is mind boggling
19:53:01 <monochrom> Ah, the user guide wording includes "type synonyms" so this is not good
19:53:12 <ski> yes, there's no finite integer `y' satisfying the equation `y = y + 1'
19:53:22 <tomsmeding> monochrom: that was indeed my point, perhaps I should've saved you the search for the right paragraph :p
19:53:29 <Super_Feeling> wow, this is a lot like those recursive definitions in math
19:53:36 <tomsmeding> ski: that's suggestive of the wrong thing
19:53:49 <ski> hm ?
19:53:52 <tomsmeding> saying "y = y * 0" will also infinite-loop, though there's certainly a solution for that one
19:53:58 <dolio> There's no infinite integer, either. :)
19:54:14 <ski> tomsmeding : yes, it wasn't an "iff" condition :)
19:54:19 <tomsmeding> fair :p
19:54:26 <Super_Feeling> it basically evaluates forever. keeps on solving for y, but y contains another "y" in the definition
19:54:28 <Super_Feeling> am i right?
19:54:32 <monochrom> Yes.
19:54:33 <ski> yes
19:54:34 <tomsmeding> > let fibo = 0 : 1 : zipWith (+) fibo (tail fibo) in take 10 fibo
19:54:36 <lambdabot> [0,1,1,2,3,5,8,13,21,34]
19:54:51 <dolio> > let y :: Integer ; y = y + 1 in y
19:54:53 <monochrom> But don't hold up your hope for "y = y * 1" either.
19:54:54 <lambdabot> *Exception: <<loop>>
19:55:00 <ski> > let ones = 1 : ones in take 10 ones
19:55:05 <lambdabot> [1,1,1,1,1,1,1,1,1,1]
19:55:08 × machinedgod quits (~machinedg@142.169.78.126) (Ping timeout: 260 seconds)
19:55:14 <dolio> GHC figured out not to take forever.
19:55:32 <ski> Super_Feeling : sometimes, such "cyclic/circular/recursive" definitions can be useful. but for `Int', they aren't
19:55:43 <helaoban> hi haskell, not sure where the right place to report this is, but there is a broken link on https://hackage.haskell.com/package/<package-name>/dependencies, at the bottom of the dependcies page for packages with flag-mediated dependencies there is supposed to be a link to cabal docs that explains how to use these flags, but it's broken.
19:56:03 <ski> helaoban : maybe #haskell-infrastructure ?
19:56:11 <tomsmeding> monochrom: where would I report this documentation inconsistency about :kind! ?
19:56:43 <helaoban> eg for https://hackage.haskell.org/package/cassava-0.5.2.0/dependencies, the link is http://www.haskell.org/cabal/users-guide/installing-packages.html#controlling-flag-assignments when it looks like it should be https://cabal.readthedocs.io/en/latest/setup-commands.html#controlling-flag-assignments
19:56:49 <helaoban> ski: cool, i'll try there
19:57:08 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
19:58:10 <ski> > let y :: Natural; y = 0 * y in y
19:58:12 <lambdabot> 0
19:58:24 <Super_Feeling> ski got it. it's pretty mind boggling for me, since i am not used to such recursive definitions. thanks tho
19:59:13 <ski> Super_Feeling : note that an ordinary recursive(ly defined) function, is also a "circular definition". it's just that it happens to be done in a way that's productive
19:59:54 <tomsmeding> ski: doesn't work for me locally (loops), if Natural is from Numeric.Natural :p
20:00:07 <ski> > let factorial 0 = 1; factorial n = n * factorial (n-1) in factorial 5
20:00:14 <lambdabot> 120
20:00:20 <Super_Feeling> i'm not really familiar with circular definition
20:00:22 <ski> > let factorial 0 = 1; factorial n = n * factorial (n-1) in factorial 5 :: Expr
20:00:26 <lambdabot> 5 * ((5 - 1) * ((5 - 1 - 1) * ((5 - 1 - 1 - 1) * ((5 - 1 - 1 - 1 - 1) * 1))))
20:00:41 <int-e> ski: That uncons would be in IO, I guess?
20:00:43 <sep2> https://dpaste.org/Hn8V Would I be in the right area trying to translate this over? included the def I'm trying to follow
20:01:03 <monochrom> tomsmeding: Found it: https://gitlab.haskell.org/ghc/ghc/-/issues/13795
20:01:20 <tomsmeding> oh now you did my work again!
20:01:30 <ski> Super_Feeling : that definition of `factorial' is "cyclic/circular/recursive" (the definition is given as a "recurrence relation", to use some math terminology). the thing being defined (the "definiendum"), `factorial' is mentioned to the right of the `='s (what it's being defined as, the "definiens")
20:01:45 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:8115:8d3a:8e30:e79f) (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:02:01 <ski> int-e : for `MIChan', yes, but not for `IChan'
20:02:05 <monochrom> I just had a hunch that it already existed.
20:02:08 <int-e> ski: Because this particular IChan is coneptually an endless stream... there's no end
20:02:25 <ski> ah, right. so no `Maybe' then
20:02:26 <int-e> ski: Oh you mean for comparisons. Sorry, I'm slow.
20:02:55 <ski> (i read the implementation, but then forgot again that they can't end)
20:03:35 <int-e> ski: It's not the most useful channel in existence. I just wanted to use those IVars for *something*.
20:04:06 <int-e> (I guess you can put your own end-of-stream markers on the channel though.)
20:04:12 <ski> tomsmeding : hm, try `y = y * 0'
20:04:33 <tomsmeding> ah that does work
20:05:56 <ski> int-e : i should probably try to use `IVar' for keeping track of shared nodes in a graph, and see where the pain points are ..
20:06:19 machinedgod joins (~machinedg@142.169.78.196)
20:06:27 <ski> tomsmeding : i guess they probably changed the parameter to do induction/recursion on, at some point
20:07:12 ski was thinking, semi-recently, about which parameter is the "correct" one, to induct on, for some of the most basic arithmetic operations, ..
20:07:23 × livvy quits (~livvy@gateway/tor-sasl/livvy) (Ping timeout: 240 seconds)
20:07:46 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:507:9614:9e50:551c)
20:08:01 × L29Ah quits (~L29Ah@unaffiliated/l29ah) (Ping timeout: 258 seconds)
20:08:37 × jespada quits (~jespada@90.254.246.48) (Ping timeout: 264 seconds)
20:09:00 × geekosaur quits (42d52102@66.213.33.2) (Remote host closed the connection)
20:09:03 <tomsmeding> eh, define "correct"
20:09:33 <tomsmeding> I mean. you can even alternately recurse on both parameters to find the one that's zero fastest
20:09:38 <tomsmeding> s/\./,
20:10:04 <ski> yea, part of the exercise was to search for some reasonable meaning of "correct" :)
20:10:59 rprije joins (~rprije@203.214.95.251)
20:11:03 <tomsmeding> I think for commutative operations, the arguments ought to be equivalent for all senses that you consider relevant
20:11:12 <monochrom> Almost sounded like you have solved the "parallel or" problem. :) (Don't worry, it doesn't solve that problem.)
20:11:22 <ski> let's take addition. you can an accumulative definition `Z + n = n; S m + n = m + S n'. or you could have the "direct" version `Z + n = n; S m + n = S (m + n)'
20:11:28 jespada joins (~jespada@90.254.246.48)
20:11:34 <int-e> ski: Hmm, you don't need an IVar for that. You can achieve the same thing, more cheaply, with an IORef: data Node a = Node !(IORef a) a; instance Eq (Node a) where Node r1 _ == Node r2 _ = r1 == r2; newNode a = Node <$> newIORef a <*> pure a. Note also, that the allocated IORef is responsible for the identity of the node...
20:11:38 <tomsmeding> so if you think evaluation strategy is important, then you should recurse on both parameters at the same time :p
20:11:49 <ski> (and then you can flip the parameter orders, if you want. and yes, you could have variants where you induct on both parameters, in different ways)
20:11:55 × Super_Feeling quits (~Super_Fee@103.92.43.209) (Remote host closed the connection)
20:12:25 <int-e> ski: Or is the point that the IVar can resolve cycles, hmm.
20:12:27 × st8less quits (~st8less@2603:a060:11fd:0:101c:4882:6a23:1c57) (Ping timeout: 240 seconds)
20:12:35 <tomsmeding> and of course the proposal that meant to (re-)add a ghci command for expanding type synonyms got stranded due to inactivity :D https://github.com/ghc-proposals/ghc-proposals/pull/79
20:12:49 <monochrom> But I can see that "add Z n = n; add m Z = Z; add (S m) (S n) = S (S (add m n))" is very much nicer, like zip.
20:13:23 <int-e> ski: (which the IORef version can do as well, but it'll be more prone to undetected bugs that set a node value more than once)
20:13:38 <tomsmeding> monochrom: I very much like that one indeed :p
20:14:17 <int-e> ski: Anyway, it's certainly a use I've never ever considered before.
20:14:31 st8less joins (~st8less@inet-167-224-197-181.isp.ozarksgo.net)
20:14:39 <int-e> So thanks for that :)
20:15:09 <int-e> The lack of an Ord instance will hurt eventually, I suppose.
20:15:15 × knupfer quits (~Thunderbi@200116b82cef8300610dc462ddae2e63.dip.versatel-1u1.de) (Read error: Connection reset by peer)
20:15:19 knupfer1 joins (~Thunderbi@200116b82cef83003844d391b8848e28.dip.versatel-1u1.de)
20:15:35 × knupfer1 quits (~Thunderbi@200116b82cef83003844d391b8848e28.dip.versatel-1u1.de) (Client Quit)
20:15:36 <ski> int-e : yea, one could do that. but you'd need a way to generate an uninstantiated `IVar', and to instantiate it, after the fact (getting blocking read if it's not instantiated yet). and perhaps think about whether there'll be any problem with threads, due to using simple `IORef's
20:15:47 knupfer joins (~Thunderbi@200116b82cef8300f037b40504d258ce.dip.versatel-1u1.de)
20:15:53 × knupfer quits (~Thunderbi@200116b82cef8300f037b40504d258ce.dip.versatel-1u1.de) (Client Quit)
20:16:06 knupfer joins (~Thunderbi@200116b82cef8300b5c936f19440c318.dip.versatel-1u1.de)
20:16:07 <ski> @type newCyclicIORef
20:16:09 <lambdabot> (IORef a -> a) -> IO (IORef a)
20:16:18 × knupfer quits (~Thunderbi@200116b82cef8300b5c936f19440c318.dip.versatel-1u1.de) (Read error: Connection reset by peer)
20:16:26 knupfer joins (~Thunderbi@200116b82cef830070386856bf96007c.dip.versatel-1u1.de)
20:16:28 × knupfer quits (~Thunderbi@200116b82cef830070386856bf96007c.dip.versatel-1u1.de) (Client Quit)
20:16:40 <ski> what's a nice way to do that, but generating multiple `IORef's ?
20:16:48 <dolio> Most refs aren't orderable, because that's not stable under GC.
20:16:50 knupfer joins (~Thunderbi@200116b82cef83001cef98ca424016ba.dip.versatel-1u1.de)
20:16:51 × knupfer quits (~Thunderbi@200116b82cef83001cef98ca424016ba.dip.versatel-1u1.de) (Client Quit)
20:16:52 <ski> @type newCyclicIORefT
20:16:54 <lambdabot> Traversable f => f (f (IORef a) -> a) -> IO (f (IORef a))
20:16:58 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
20:17:04 alp joins (~alp@2a01:e0a:58b:4920:e03a:3413:fb91:53fc)
20:17:05 <ski> still requires all of them to be `IORef a' ..
20:17:08 GyroW joins (~GyroW@d54C03E98.access.telenet.be)
20:17:09 × GyroW quits (~GyroW@d54C03E98.access.telenet.be) (Changing host)
20:17:09 GyroW joins (~GyroW@unaffiliated/gyrow)
20:17:11 <dolio> So it's more expensive to be ordered.
20:17:33 knupfer joins (~Thunderbi@200116b82cef8300dd7c73b5b438b1fa.dip.versatel-1u1.de)
20:17:35 × knupfer quits (~Thunderbi@200116b82cef8300dd7c73b5b438b1fa.dip.versatel-1u1.de) (Client Quit)
20:17:46 L29Ah joins (~L29Ah@unaffiliated/l29ah)
20:18:10 <int-e> dolio: Sure, I know why :) But for the purpose of detecting sharing, having just Eq results in a scalability problem.
20:18:11 incognito9999_ joins (~incognito@hwsrv-648981.hostwindsdns.com)
20:18:43 <ski> monochrom : except it's not really that much like `zip', you get two `S's out, for one `S' in, in each parameter ?
20:18:49 knupfer joins (~Thunderbi@200116b82cef8300e49e64b009df27a7.dip.versatel-1u1.de)
20:19:02 <int-e> dolio: Which is not really the intended purpose of those references (Eq instance notwithstanding) so that's fine.
20:19:02 <dolio> That's why the well-ordering principle is false. :)
20:19:18 × knupfer quits (~Thunderbi@200116b82cef8300e49e64b009df27a7.dip.versatel-1u1.de) (Client Quit)
20:19:23 <ski> (and you still have the (lack of) parallel-or problem, that `add undefined (S n)' isn't equal to `S (add undefined n)')
20:19:34 knupfer joins (~Thunderbi@200116b82cef8300a895f9e57b9e84bd.dip.versatel-1u1.de)
20:19:45 × knupfer quits (~Thunderbi@200116b82cef8300a895f9e57b9e84bd.dip.versatel-1u1.de) (Client Quit)
20:19:52 knupfer joins (~Thunderbi@200116b82cef8300a895f9e57b9e84bd.dip.versatel-1u1.de)
20:20:14 knupfer1 joins (~Thunderbi@200116b82cef83009da320cc3b7d023e.dip.versatel-1u1.de)
20:20:21 × knupfer quits (~Thunderbi@200116b82cef8300a895f9e57b9e84bd.dip.versatel-1u1.de) (Client Quit)
20:20:22 knupfer1 is now known as knupfer
20:20:26 J_Arcane_ joins (sid119274@gateway/web/irccloud.com/x-okfghrpejlzoualp)
20:20:27 m-renaud_ joins (sid333785@gateway/web/irccloud.com/x-wdhdpnuntagzspud)
20:20:27 alanz_ joins (sid110616@gateway/web/irccloud.com/x-rotyfkerxdfrgsjt)
20:20:27 jlpeters_ joins (sid25606@gateway/web/irccloud.com/x-xkxchtjwumvvoplq)
20:20:28 drbrule_ joins (sid395654@gateway/web/irccloud.com/x-qzclcwgouytxdizk)
20:20:28 scav_ joins (sid309693@gateway/web/irccloud.com/x-bpvpcjgxpjzjedad)
20:20:29 × knupfer quits (~Thunderbi@200116b82cef83009da320cc3b7d023e.dip.versatel-1u1.de) (Client Quit)
20:20:30 banjiewen_ joins (sid115913@gateway/web/irccloud.com/x-dxltzkvalxmnuugq)
20:20:31 fiadliel_ joins (sid399568@gateway/web/irccloud.com/x-rcssxagrxaenrwkf)
20:20:38 albethere_ joins (sid457088@gateway/web/irccloud.com/x-fnvfojoflynertwf)
20:20:38 knupfer joins (~Thunderbi@200116b82cef8300c06758e924f2c41e.dip.versatel-1u1.de)
20:20:39 rusua_ joins (uid124537@gateway/web/irccloud.com/x-mpizelreyaaubxup)
20:20:42 JSharp_ joins (sid4580@wikia/JSharp)
20:20:43 bitonic_ joins (sid61915@gateway/web/irccloud.com/x-evaxaxrhylqawuas)
20:20:47 <tomsmeding> ski: but that one you can't solve in general: you got to inspect _an_ argument first :p
20:20:51 SrPx_ joins (sid108780@gateway/web/irccloud.com/x-czvvabmhqaigtsgp)
20:20:55 <ski> int-e : it was the `read :: IVar a -> a' together with `instance Eq (IVar a)' (and also, of course, the ability to fill it in, independently, some time after creation time), that made it catch my attention (years ago)
20:20:58 xarian_ joins (~xarian@104.236.81.162)
20:21:07 <ski> tomsmeding : except if you race threads :)
20:21:15 eruditass_ joins (uid248673@gateway/web/irccloud.com/x-ubxwbqgbcybasbta)
20:21:38 <tomsmeding> that went very quickly from total language land to ugly haskell land :p
20:21:44 <int-e> ski: I still think this particular IVar is cute. However, personally, I never found a convincing use for it. :)
20:21:58 Forkk_ joins (forkk@2600:3c00::f03c:91ff:fe84:de4d)
20:22:42 lucas8 joins (~luc@2001:41d0:8:109c::1)
20:22:45 megaTherion_ joins (~therion@unix.io)
20:23:12 mystfox joins (~myst@focks.pw)
20:23:19 atomi__ joins (~atomi@35.71.197.35.bc.googleusercontent.com)
20:23:43 <ski> tomsmeding : anyway, to continue, i think the "direct" version is suerior to the "accumulating" version (comparing just those two), since the former is incremental, while the latter is bulky. and, with dependent types, this manifests as if you have `m0 + n' in your type, and you learn that `m0 = S m', then it can rewrite `S m + n' to `S (m + n)', and so you get an outer `S' to "match" on, rather than an
20:23:49 <ski> opaque call to `+'
20:24:24 Stanley00 joins (~stanley00@unaffiliated/stanley00)
20:24:24 cheers- joins (user@unaffiliated/cheers)
20:24:29 <tomsmeding> yes making progress early by putting an S on the outside is nice
20:24:48 <ski> (obviously i'm not talking about a strict representation of naturals here, where accumulation can make more sense, since you don't get incrementality anyway)
20:25:25 <int-e> ski: Having a pure `read` is the essence of the whole package; everything else is designed to make that possible, including all limitations.
20:25:41 <ski> int-e : ah, i see :)
20:25:52 × SrPx quits (sid108780@gateway/web/irccloud.com/x-xulqbpplkjjfywzr) (Ping timeout: 244 seconds)
20:25:52 × jlpeters quits (sid25606@gateway/web/irccloud.com/x-oxflbpvsmgilmdyy) (Ping timeout: 244 seconds)
20:25:52 × alanz quits (sid110616@gateway/web/irccloud.com/x-bplzytauuzaqtdwm) (Ping timeout: 244 seconds)
20:25:52 × xarian quits (~xarian@104.236.81.162) (Ping timeout: 244 seconds)
20:25:52 × rawles quits (~r@unaffiliated/rawles) (Ping timeout: 244 seconds)
20:25:52 × eruditass quits (uid248673@gateway/web/irccloud.com/x-iuzbfjvdrultjkys) (Ping timeout: 244 seconds)
20:25:52 × m-renaud quits (sid333785@gateway/web/irccloud.com/x-tkucctivkfyvgvtj) (Ping timeout: 244 seconds)
20:25:52 × J_Arcane quits (sid119274@gateway/web/irccloud.com/x-woiwotxdlskjwxcj) (Ping timeout: 244 seconds)
20:25:52 × thecoffemaker quits (~thecoffem@unaffiliated/thecoffemaker) (Ping timeout: 244 seconds)
20:25:52 × noCheese quits (~nocheese@unaffiliated/nocheese) (Ping timeout: 244 seconds)
20:25:52 × drbrule quits (sid395654@gateway/web/irccloud.com/x-upjwrhbxkttxvnlr) (Ping timeout: 244 seconds)
20:25:52 × JSharp quits (sid4580@wikia/JSharp) (Ping timeout: 244 seconds)
20:25:52 × rusua quits (uid124537@gateway/web/irccloud.com/x-sysvorkqwbosrbwq) (Ping timeout: 244 seconds)
20:25:52 × fiadliel quits (sid399568@gateway/web/irccloud.com/x-hgzpvwimdwujzolw) (Ping timeout: 244 seconds)
20:25:52 × scav quits (sid309693@gateway/web/irccloud.com/x-dpbxtezevjogbqll) (Ping timeout: 244 seconds)
20:25:52 × nick_h quits (sid319833@gateway/web/irccloud.com/x-srdcrkvbqjanzjcu) (Ping timeout: 244 seconds)
20:25:52 × albethere quits (sid457088@gateway/web/irccloud.com/x-cltqfsvqlhbhhdqu) (Ping timeout: 244 seconds)
20:25:52 × siraben quits (sirabenmat@gateway/shell/matrix.org/x-pabygdewelkoamni) (Ping timeout: 244 seconds)
20:25:52 × banjiewen quits (sid115913@gateway/web/irccloud.com/x-mooiusydhgfmcvhk) (Ping timeout: 244 seconds)
20:25:52 × iinuwa1 quits (iinuwamatr@gateway/shell/matrix.org/x-kbcyykvavbzbuwyo) (Ping timeout: 244 seconds)
20:25:53 × jtojnar quits (jtojnarmat@gateway/shell/matrix.org/x-oypragrwlxqgnchv) (Ping timeout: 244 seconds)
20:25:53 × alexfmpe quits (alexfmpema@gateway/shell/matrix.org/x-svcqerpqtkauzjui) (Ping timeout: 244 seconds)
20:25:53 × raoulb quits (~weechat@stateless.vsos.ethz.ch) (Ping timeout: 244 seconds)
20:25:53 × DwarfMaster quits (~luc@2001:41d0:8:109c::1) (Ping timeout: 244 seconds)
20:25:53 × jokester quits (~mono@unaffiliated/jokester) (Ping timeout: 244 seconds)
20:25:53 × cheers quits (user@unaffiliated/cheers) (Ping timeout: 244 seconds)
20:25:53 × glowpelt quits (~myst@focks.pw) (Ping timeout: 244 seconds)
20:25:53 × Forkk quits (forkk@2600:3c00::f03c:91ff:fe84:de4d) (Ping timeout: 244 seconds)
20:25:53 × vqrs quits (~vqrs@learnprogramming/regular/vqrs) (Ping timeout: 244 seconds)
20:25:53 × verlet64_ quits (sid261276@gateway/web/irccloud.com/x-qmypxhhdelafasaj) (Ping timeout: 244 seconds)
20:25:53 × bitonic quits (sid61915@gateway/web/irccloud.com/x-gpvtxexabdepunck) (Ping timeout: 244 seconds)
20:25:53 × angerman quits (sid209936@gateway/web/irccloud.com/x-ueaytjplpxideopo) (Ping timeout: 244 seconds)
20:25:53 × unclechu quits (unclechuma@gateway/shell/matrix.org/x-bgindqyxdmllwdai) (Ping timeout: 244 seconds)
20:25:53 × GuillaumeChrel[m quits (guillaumec@gateway/shell/matrix.org/x-jdchaaocbuitwfmn) (Ping timeout: 244 seconds)
20:25:54 × Ericson2314 quits (ericson231@gateway/shell/matrix.org/x-vfqdqvnkedexzixl) (Ping timeout: 244 seconds)
20:25:54 × nihilazo quits (nihilazoma@gateway/shell/matrix.org/x-nhbxnzosodzhmhyx) (Ping timeout: 244 seconds)
20:25:54 × gcoakes[m] quits (gcoakesmat@gateway/shell/matrix.org/x-flwpwnktpkouxpwp) (Ping timeout: 244 seconds)
20:25:54 × Fernando-Basso[m quits (fernando-b@gateway/shell/matrix.org/x-qopgtqduxfsjtqbe) (Ping timeout: 244 seconds)
20:25:54 × crtschin_ quits (~crtschin@2604:a880:800:10::3126:f001) (Ping timeout: 244 seconds)
20:25:54 × shadowdao quits (~user@unaffiliated/shadowdaemon) (Ping timeout: 244 seconds)
20:25:54 × incognito9999 quits (~incognito@hwsrv-648981.hostwindsdns.com) (Ping timeout: 244 seconds)
20:25:54 × recon_-_ quits (~quassel@2602:febc:0:b6::6ca2) (Ping timeout: 244 seconds)
20:25:54 × Niamkik quits (~Niamkik@2a00:5884:8219::1) (Ping timeout: 244 seconds)
20:25:54 × joeyh quits (~joeyh@kitenet.net) (Ping timeout: 244 seconds)
20:25:54 × _flow_ quits (~none@salem.informatik.uni-erlangen.de) (Ping timeout: 244 seconds)
20:25:54 × atomi quits (~atomi@35.71.197.35.bc.googleusercontent.com) (Ping timeout: 244 seconds)
20:25:54 × megaTherion quits (~therion@coruscant.unix.io) (Ping timeout: 244 seconds)
20:25:54 SrPx_ is now known as SrPx
20:25:54 alanz_ is now known as alanz
20:25:54 <int-e> (limitations compared to other IVar implementations)
20:25:55 jlpeters_ is now known as jlpeters
20:25:55 J_Arcane_ is now known as J_Arcane
20:25:55 banjiewen_ is now known as banjiewen
20:25:55 eruditass_ is now known as eruditass
20:25:55 scav_ is now known as scav
20:25:56 drbrule_ is now known as drbrule
20:25:56 m-renaud_ is now known as m-renaud
20:25:56 fiadliel_ is now known as fiadliel
20:25:56 JSharp_ is now known as JSharp
20:25:59 albethere_ is now known as albethere
20:26:01 bitonic_ is now known as bitonic
20:26:21 thecoffemaker joins (~thecoffem@unaffiliated/thecoffemaker)
20:26:22 rawles joins (~r@unaffiliated/rawles)
20:26:25 crtschin joins (~crtschin@104.131.9.149)
20:26:28 raoulb joins (~weechat@stateless.vsos.ethz.ch)
20:26:35 vqrs joins (~vqrs@learnprogramming/regular/vqrs)
20:26:37 Niamkik joins (~Niamkik@80.67.190.201)
20:26:50 ski . o O ( the joy of Matrix and IRCCloud netsplits ? )
20:26:52 alexfmpe joins (alexfmpema@gateway/shell/matrix.org/x-armmrcevlxedikov)
20:27:11 gcoakes[m] joins (gcoakesmat@gateway/shell/matrix.org/x-klflsytbyxwgnxns)
20:27:25 × GyroW quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 240 seconds)
20:27:27 knupfer1 joins (~Thunderbi@87.123.206.236)
20:27:27 × knupfer1 quits (~Thunderbi@87.123.206.236) (Client Quit)
20:27:28 joeyh_ joins (joeyh@kitenet.net)
20:27:28 nick_h_ joins (sid319833@gateway/web/irccloud.com/session)
20:27:28 verlet64__ joins (sid261276@gateway/web/irccloud.com/session)
20:27:28 angerman_ joins (sid209936@gateway/web/irccloud.com/session)
20:27:28 noCheese` joins (~nocheese@gw2.aibor.de)
20:27:28 recon_- joins (~quassel@2602:febc:0:b6::6ca2)
20:27:28 jokester_ joins (~mono@2001:19f0:5:1e1d:5400:1ff:fe45:5877)
20:27:28 noCheese` is now known as noCheese
20:27:28 nick_h_ is now known as nick_h
20:27:28 verlet64__ is now known as verlet64_
20:27:28 _flow_ joins (~none@salem.informatik.uni-erlangen.de)
20:27:28 × nick_h quits (sid319833@gateway/web/irccloud.com/session) (Changing host)
20:27:28 nick_h joins (sid319833@gateway/web/irccloud.com/x-omwgtsberokhnnup)
20:27:28 × verlet64_ quits (sid261276@gateway/web/irccloud.com/session) (Changing host)
20:27:28 verlet64_ joins (sid261276@gateway/web/irccloud.com/x-xjfovybibszlojpl)
20:27:28 × angerman_ quits (sid209936@gateway/web/irccloud.com/session) (Changing host)
20:27:28 angerman_ joins (sid209936@gateway/web/irccloud.com/x-oahfetnahbdvwgfo)
20:27:33 × noCheese quits (~nocheese@gw2.aibor.de) (Changing host)
20:27:33 noCheese joins (~nocheese@unaffiliated/nocheese)
20:27:45 int-e nods
20:27:54 cosimone joins (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774)
20:27:55 × cosimone quits (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774) (Remote host closed the connection)
20:27:58 GyroW joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
20:27:59 × GyroW quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
20:27:59 GyroW joins (~GyroW@unaffiliated/gyrow)
20:28:02 <ski> so, then the question is whether to induct on `m' or on `n' in `m + n'. i think, from a certain standpoint, it makes more sense to induct on `m'
20:28:12 unclechu joins (unclechuma@gateway/shell/matrix.org/x-cpldnwvuqpqtgahy)
20:28:12 Fernando-Basso[m joins (fernando-b@gateway/shell/matrix.org/x-uztapoiqhwkucfsg)
20:28:19 nihilazo joins (nihilazoma@gateway/shell/matrix.org/x-bfhysqnthnkkkyqj)
20:28:22 cosimone joins (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774)
20:28:25 × Stanley00 quits (~stanley00@unaffiliated/stanley00) (Ping timeout: 240 seconds)
20:28:51 <ski> when listing naturals in order, we tend to list them with `Z' at the leftmost, then, going rightwards, `S Z',`S (S Z)',&c.
20:29:01 siraben joins (sirabenmat@gateway/shell/matrix.org/x-zlvwcpsxsnpcahft)
20:29:02 jtojnar joins (jtojnarmat@gateway/shell/matrix.org/x-gjvcckkmfrtqleyn)
20:29:02 iinuwa1 joins (iinuwamatr@gateway/shell/matrix.org/x-vozqawbtzhuizygn)
20:29:13 <ski> (if you prefer writing right-to-left, then flip the order)
20:29:25 GuillaumeChrel[m joins (guillaumec@gateway/shell/matrix.org/x-kyytvilbqkccelxo)
20:30:02 <ski> now consider finite prefices of the natural numbers. a type `Fin n', having the natural numbers (strictly) less than `n' as inhabitants
20:30:08 Ericson2314 joins (ericson231@gateway/shell/matrix.org/x-tddshmiwufwouryw)
20:32:31 <ski> it's natural to want to define two inclusions. if `i : Fin m', then `injl i : Fin (m + n)'. and if `j : Fin n', then `injr j : Fin (m + n)'
20:32:36 Amras joins (~Amras@unaffiliated/amras0000)
20:33:11 snakemasterflex joins (~snakemast@213.100.206.23)
20:33:25 × knupfer quits (~Thunderbi@200116b82cef8300c06758e924f2c41e.dip.versatel-1u1.de) (Ping timeout: 240 seconds)
20:34:02 <tomsmeding> which is fortunately nicely symmetric
20:34:03 × machinedgod quits (~machinedg@142.169.78.196) (Ping timeout: 260 seconds)
20:34:29 <ski> let's say we picked the version of `+' that does recursion on the left operand. then we'd have `injl Z = Z; injl (S i) = S (injl i)'
20:35:29 raehik joins (~raehik@cpc96984-rdng25-2-0-cust109.15-3.cable.virginm.net)
20:35:48 <ski> but we realize now that for `injr', we need to induct on `m' as well. so let's define `injr j : Fin (m + n)' in terms of `m + j : Fin (m + n)', where `Z + j = j; S m + j = S (m + j)'
20:35:59 <sep2> Did I translate transition over correctly? https://dpaste.org/u84O
20:36:06 <sep2> For letter
20:36:32 <ski> we really need to induct on `m' here, not `j', since we need to rewrite the `m + n' in the type to something of the form `S (...)' to be able to use the data constructors of `Fin'
20:37:03 <ski> sep2 : what's the final state ?
20:37:08 × Franciman quits (~francesco@host-212-171-42-250.retail.telecomitalia.it) (Quit: Leaving)
20:38:04 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 265 seconds)
20:38:07 <ski> (if we have some kind of subtyping, we could allow `i : Fin (m + n)' if `i : Fin m', eliding the explicit `injl' call which just "copies" the constructors anyway)
20:38:37 <tomsmeding> there is no single definition of + which makes both injl and injr natural, right
20:38:52 <sep2> :ski final state should be {a}
20:39:10 Franciman joins (~francesco@host-212-171-42-250.retail.telecomitalia.it)
20:39:11 <sep2> • Q={ε,a,T} •. s=ε • F = {a}
20:39:13 <tomsmeding> so for choosing a definition of +, you'd have to look for a different motivation :p
20:39:45 <ski> so, the effect of this is that, if we list the elements of say `Fin (3 + 5)', from least element, to greatest, we start with the elements corresponding to `Fin 3', being (using syntactic sugar) `0',`1',`2', and then comes the elements corresponding to `Fin 5', that is `3 + 0',`3 + 1',`3 + 2',`3 + 3',`3 + 4'
20:40:13 <ski> sep2 : you have listed zero states (empty list), for your list of final states
20:40:32 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
20:41:02 <ski> tomsmeding : i think it's reasonable, for `Either a b', if we're listing the elements of it, to list the elements coming from `a' to the left of the elements coming from `b' (since `a' occurs to the left of `b' in the type)
20:41:48 <ski> and combining that with wanting to start from the least element, counting upwards as we're going to the right, forces this particular version of `+' (inducting on left operand)
20:41:48 <tomsmeding> kind of?
20:41:56 <ski> yea
20:42:18 <tomsmeding> I find the motivation kind of far-fetched, but sure :p
20:42:25 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 240 seconds)
20:42:42 <tomsmeding> it does invoke the kind of asymmetry you were looking for :p
20:42:56 <ski> the premiss is somewhat weak, i agree. but it's the rationale that i've been able to find, so far, for preferring one over the other
20:43:09 <tomsmeding> though maybe I'm understating the importance of Fin in dependent-typed programming
20:43:19 <tomsmeding> s/understating/underestimating/
20:44:20 <sep2> ski: with [1] ? [0] would indicate how many states but not which state?
20:44:31 <ski> btw, note that `Fin m + Fin n = Fin (m + n)' expresses both injections (in the left-to-right direction), but also expresses a "try to subtract `m', either discovering that the input was less than `m', or else getting a difference that's less than `n'"
20:44:37 × Franciman quits (~francesco@host-212-171-42-250.retail.telecomitalia.it) (Ping timeout: 264 seconds)
20:45:17 <ski> sep2 : `0' is the way you're writing/encoding the starting state ⌜ε⌝, in Haskell
20:45:46 <sep2> https://dpaste.org/5G3N
20:45:50 justanotheruser joins (~justanoth@unaffiliated/justanotheruser)
20:46:22 <sep2> hold on
20:47:11 <ski> (similarly, `Fin m * Fin n = Fin (m * n)' expresses converting between a "coordinate pair in a rectangle" and a "running index in a rectangle". in one case, it's `(i,j) |-> i * n + j', in the other it's `k |-> (k / n,k % n)')
20:48:10 <ski> (and then, `(Fin m -> Fin n) = Fun (n ^ m)' is about converting between a number, and its digits, in a positional number system of base `n', having at most `m' digits)
20:49:08 <tomsmeding> neat
20:49:18 <ski> sep2 : `M = (states,starts,finals,transitions)' is an explanation of the rôles the different components in your quadruple, describing a finite state machine, play
20:49:38 <tomsmeding> rôles
20:49:47 <ski> one interesting thing about this is that, in this setting "division by zero" is not a problem :)
20:49:56 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
20:50:02 shadowdao joins (~user@unaffiliated/shadowdaemon)
20:50:18 <tomsmeding> certainly so :p
20:50:39 <sep2> ski: so when I used [1] for final state it was saying 0,1 are final states?
20:50:50 <ski> i still haven't convinced myself whether to induct on left or right, for multiplication (although i'm heavily leaning towards left)
20:51:11 <ski> (but that's the version i assumed, when i wrote `i * n + j', rather than `i + m * j')
20:51:14 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
20:51:24 GyroW joins (~GyroW@d54c03e98.access.telenet.be)
20:51:24 × GyroW quits (~GyroW@d54c03e98.access.telenet.be) (Changing host)
20:51:24 GyroW joins (~GyroW@unaffiliated/gyrow)
20:52:01 <tomsmeding> (or `n * i + j')
20:53:14 pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net)
20:53:27 Franciman joins (~francesco@host-212-171-42-250.pool212171.interbusiness.it)
20:53:49 × caubert quits (~caubert@82.131.52.222.cable.starman.ee) (Remote host closed the connection)
20:54:23 <ski> (then one can go on to have equalities/isomorphisms like `Sym (Fin n) = Fin (n !)', where `Sym A' is set of permutations (or (`Set') automorphisms, if you prefer) on `A'. it forms a group, the symmetric group, hence `Sym'. or `Sub (Fin n) (Fin k) = Fin (C n k)', where `C' is binomial coefficient, and `Sub A B' is set of `B'-sized subsets of `A' ..)
20:54:33 snakemasterflex joins (~snakemast@213.100.206.23)
20:54:38 caubert joins (~caubert@82.131.52.222.cable.starman.ee)
20:55:25 hexfive joins (~hexfive@50.35.90.193)
20:55:30 <ski> tomsmeding : yes, but if `+' is doing induction on left parameter, then `n * i + j' will have to traverse `n * i' (which could be quite large), rather than just `j' (which is less than `n')
20:55:50 × mananamenos quits (~mananamen@84.122.202.215.dyn.user.ono.com) (Ping timeout: 256 seconds)
20:56:13 <tomsmeding> I know, just noting that i*n+j and i+m*j are not the only options :p
20:56:14 <ski> (hm, at least if we interpret `n * i + j' as `(n * i) + j' .. rather than as a ternary (mixfix) operation)
20:56:20 <tomsmeding> lol
20:56:25 <ski> yea, good point
20:56:26 <tomsmeding> let's not go there
20:57:01 <ski> sep2 : if you only specify `1' as final state, then that's the only final state that you've specified ..
20:57:04 <ski> (a truism, i know)
20:57:14 × hexfive quits (~hexfive@50.35.90.193) (Client Quit)
20:57:20 tomsmeding . o O ( :D )
20:58:22 <ski> unless you interpret `M = (states,start,finals,transitions)' to mean that `finals' does not contain all the final states .. but that seems a bit weird to me. would you have any particular reason for such an interpretation (and how to know what the remaining final states are, then) ?
20:58:42 justan0theruser joins (~justanoth@unaffiliated/justanotheruser)
20:59:29 × borne quits (~fritjof@200116b86471bb007fe01feb1760d29e.dip.versatel-1u1.de) (Ping timeout: 272 seconds)
21:00:01 × Guest75545 quits (~Fare@178.162.204.214) ()
21:00:27 × justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 260 seconds)
21:00:30 <ski> tomsmeding : anyway .. i'm only partly thinking about this as an exercise in counting, combinatorics (and dependent types in general). the other reason is to experiment with a notation for defining equalities (isomorphisms) between types, directly, rather than via two functions, which are then shown to be inverses of each other ..
21:00:37 × Aquazi quits (uid312403@gateway/web/irccloud.com/x-truwgtvpybdfvjec) (Quit: Connection closed for inactivity)
21:00:52 <dolio> Why is division by zero not a problem?
21:01:01 <ski> (.. and doing that has led me to want to incorporate some ideas from logic programming into the mix)
21:01:10 <tomsmeding> dolio: in that k / n, k : Fin n
21:01:22 <tomsmeding> um
21:01:22 <tomsmeding> no
21:01:39 <tomsmeding> right, k : Fin (m * n)
21:01:48 <tomsmeding> and if n = 0, then Fin (m * n) = Fin 0 = <empty>
21:02:26 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
21:02:34 <zoom84> probably a stupid question but why is the mapping func of a functor b->a instead of a->a? Is it just to provide the flexibility of returning an output whose type is different from input?
21:02:50 <Cheery> how about including (Maybe a) right in your algebra and making it closed over Nothing?
21:03:32 × Franciman quits (~francesco@host-212-171-42-250.pool212171.interbusiness.it) (Quit: Leaving)
21:03:54 <sep2> ski: [1] gives me 1 and empty list rather than 1?
21:04:13 <ski> dolio : given `k : Fin (m * n)' we want to define `k / n : Fin m' and `k % n : Fin n'. we attempt to subtract `n' from `k', repeatedly, until we know `k < n'. but we have an upper bound on the number of subtractions (that's `m'), so we can't get stuck in an infinite loop. also, if `n' is zero, then `k' with `k < n' is impossible (and then `m * n = m * 0 = 0', so `k < m * n' was also impossible, to begin with)
21:04:33 × caubert quits (~caubert@82.131.52.222.cable.starman.ee) (Remote host closed the connection)
21:05:51 <ski> zoom84 : yes. it's "just" that
21:05:58 <ski> (that's not a small thing, btw)
21:06:08 conal joins (~conal@64.71.133.70)
21:06:17 <zoom84> is there a built-in version that uses a->a instead? or would I have to write my own?
21:06:22 Franciman joins (~francesco@host-212-171-42-250.pool212171.interbusiness.it)
21:06:28 <ski> (also, the mathematical concept of "functor", that Haskell's `Functor' is modelled after / inspired by, requires that flexibility)
21:06:47 <tomsmeding> zoom84: b->a can also be used as a->a :p
21:07:11 <tomsmeding> > fmap (+1) [1..5]
21:07:13 <lambdabot> [2,3,4,5,6]
21:07:29 <ski> zoom84 : <https://hackage.haskell.org/package/mono-traversable-1.0.15.1/docs/Data-MonoTraversable.html#t:MonoFunctor>
21:07:42 <dolio> Oh, I see. Dividing an element of the finite set by a factor of the index.
21:07:47 × cosimone quits (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774) (Remote host closed the connection)
21:07:55 × ericsagnes quits (~ericsagne@2405:6580:0:5100:e0:d1d9:7c60:99ac) (Ping timeout: 240 seconds)
21:08:07 cosimone joins (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774)
21:08:13 <zoom84> tomsmeding, Understood. But an a->a version would permit more flexibility, such as for constructors that take two values of the same type
21:08:26 <ski> sep2 : what do you mean by "[1] gives me 1 and empty list rather than 1?" ? i don't understand the question
21:08:39 <zoom84> thanks for the link @ski
21:08:40 × coot quits (~coot@37.30.49.218.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
21:08:48 <tomsmeding> zoom84: if you have a type that can _only_ support an a->a operation, then indeed the link by ski
21:08:59 <ski> zoom84 : if you define `data Pair a = MkPair a a', then you can easily make an `instance Functor Pair where ...'
21:09:17 <tomsmeding> yes that :p
21:10:03 <ski> `MonoFunctor' is when your data type forces a particular "element type"
21:10:26 <tomsmeding> or, I guess, for stuff like Set?
21:10:28 <sep2> ski: my final state is [1], and you let me know that there's two final states in that
21:10:35 <tomsmeding> though MonoFunctor is not really the right restriction there
21:10:42 <ski> `Functor' is when your data type is parametric, allows the user of it to specify which "element type" they want to use (and so then it's useful to be able to switch from one "element type" to another)
21:10:58 × cosimone quits (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774) (Remote host closed the connection)
21:11:18 cosimone joins (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774)
21:11:22 <ski> <sep2> • Q={ε,a,T} •. s=ε • F = {a}
21:11:38 <ski> sep2 : could you explain what is ⌜a⌝ here ?
21:13:27 <dsal> fmap for `->` is just `.` isn't it?
21:13:38 <ski> yes
21:14:08 <tomsmeding> which belongs in the list of niceties together with ($) = id
21:14:11 <ski> fmap :: (a -> b) -> ((rho ->) a -> (rho ->) b)
21:15:25 Guest89 joins (ae15459e@gateway/web/cgi-irc/kiwiirc.com/ip.174.21.69.158)
21:15:38 <ski> it used to be the case, in lambdabot, that `(.)' was defined as `(.) = fmap' (with the general type, yes). also with `flip fs a = fmap ($ a) fs'
21:15:50 × Guest89 quits (ae15459e@gateway/web/cgi-irc/kiwiirc.com/ip.174.21.69.158) (Client Quit)
21:16:00 <ski> @type let flip fs a = fmap ($ a) fs in flip
21:16:01 <lambdabot> Functor f => f (a -> b) -> a -> f b
21:16:37 <ski> so you could say `flip [(2 +),(2 *),(2 ^)] 3', e.g.
21:16:42 × shafox quits (~shafox@106.51.234.111) (Remote host closed the connection)
21:17:09 <ski> > [(2 +),(2 *),(2 ^)] `sequence` 3 -- another way to get the same thing
21:17:12 <lambdabot> [5,6,8]
21:18:19 <ski> zoom84 : did you try making such an instance for `Pair', perhaps ?
21:18:30 <sep2> ski: I had the thought that I just fill in the numbers for a espilon, a, T so I used 0,1,2
21:18:42 bbear joins (~dkremer@2a01:e34:ec2b:d430:cc93:67b2:c4ea:7463)
21:18:50 <ski> sep2 : is ⌜a⌝ a state ?, is ⌜T⌝ a state ?
21:18:52 <dolio> ski: That seems kind of like the 'division' equivalent of the type theoretic 'axiom of choice'.
21:19:10 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 246 seconds)
21:19:20 <ski> dolio : hm, which ?
21:19:36 <tomsmeding> ski: that's an... interesting definition of 'flip'
21:19:53 <ski> > sequence ["ab","012"] -- you mean this ?
21:19:55 <lambdabot> ["a0","a1","a2","b0","b1","b2"]
21:20:09 <ski> tomsmeding : actually, i recall seeing it in a math paper :)
21:20:26 ericsagnes joins (~ericsagne@2405:6580:0:5100:a920:8792:1be2:949f)
21:20:27 <dolio> ski: By that I mean, what is sometimes called 'the axiom of choice' is just rearranging a choice that has already been made. :)
21:20:50 <ski> dolio : yes. i'm just not seeing the relation to what was discussed above
21:20:55 <monochrom> Ha, I like that, dolio. :)
21:20:58 <tomsmeding> Like sure, the function is nice, but why call it 'flip' :p
21:20:58 <dolio> And this 'divide by zero' is obligated to provide the other factor of 0 as a premise.
21:21:03 jesusabdullah joins (~jesusabdu@178.162.204.214)
21:21:38 <zoom84> :r
21:22:03 <ski> (Bishop expresses it as it lying in the meaning of the existential quantifier that a choice already has been made. but then, the operation that the AoC gives you needn't be extensional wrt the equivalence relation you've specified your sets (setoids) with)
21:22:43 <dolio> Right. In something like HoTT you can write a proper notion of the axiom of choice.
21:23:17 <monochrom> "If I have a whole bunch of non-empty sets" --- sounds like for each set there, I have already chosen an element. "then their cartesian product is non-empty" --- use the aforementioned chosen elements to form the desired sequence. What can possibly go wrong? :)
21:23:42 ski . o O ( "Intensional vs Extensional Choice" by roconnor in 2005-06-04 at <http://r6.ca/blog/20050604T143800Z.html> )
21:23:47 <dolio> Without having to decode it into the setoid interpretation explicitly.
21:24:12 jwynn6 joins (~jwynn6@050-088-122-078.res.spectrum.com)
21:24:16 mav1 joins (~mav@p5dee344b.dip0.t-ipconnect.de)
21:24:21 <sep2> ski: from what I can tell they're all states start, end and trap
21:25:24 <ski> dolio : well, i think it can be blind in `m'. it's just that, if `n' is zero, then there is no `k : Fin (m * 0)', and so we can't even get to the point of evaluating `k / n'
21:25:39 × cosimone quits (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774) (Remote host closed the connection)
21:25:40 × Franciman quits (~francesco@host-212-171-42-250.pool212171.interbusiness.it) (Remote host closed the connection)
21:25:58 Franciman joins (~francesco@host-212-171-42-250.retail.telecomitalia.it)
21:26:00 cosimone joins (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774)
21:26:44 <dolio> But you can't call the function on `Fin i` without exhibiting a factorization of `i`.
21:27:25 <ski> sep2 : i don't know the particular flavor of FSMs that you're dealing with. but `M = (states,start,finals,transitions)' only seems to mention start state and final states as being "special", from the point of view of this general FSM description. in other words, no "trap" states. in particular FSMs that you construct, you could have some other state(s ?) that you call "trap" states, though
21:28:24 <ski> dolio : yea. i remember when i discovered that, years ago, i called it `skolem' (since i associated it with skolemization, not with axiom-of-choice, not sure i'd seen that formulation of it then)
21:29:03 dcabrejas joins (bcd609cc@188.214.9.204)
21:29:20 <dolio> Well, I don't exactly mean it's the axiom of choice, but it's giving it the 'hard part' in a similar way.
21:30:02 <ski> sep2 : so, for your particular FSM that you're trying to encode (which one is that, at the moment, `emptyFSM' or some other ?), you can have ⌜T⌝ be a "trap" state. but you never answered me whether ⌜a⌝ was also a state, or not
21:31:35 <ski> dolio : i think it's likely that the reason why it's provable in type theory is related to the fact that mathematicians have regarded it as being obviously true
21:31:48 wroathe_ joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
21:32:12 × wroathe quits (~wroathe@c-73-24-27-54.hsd1.mn.comcast.net) (Ping timeout: 244 seconds)
21:32:19 <ski> (it all has to do with the interpretation one gives to "there exists". and also, from what i understand, whether one allows defining quotient sets/types)
21:32:26 <dolio> Well, the problem with mathematicians is that they don't actually make the choice beforehand.
21:32:39 <ski> yea, so it's a conflation of two different senses
21:32:54 <ski> (that's how it looks to me, at least)
21:33:15 × mirrorbird quits (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276) (Quit: Leaving)
21:33:16 <sep2> ski: I see a would be one of the sigmas correct
21:33:28 hackage hsinspect 0.0.14 - Inspect Haskell source files. https://hackage.haskell.org/package/hsinspect-0.0.14 (tseenshe)
21:33:36 <ski> sep2 : i dunno what "the sigmas" are, in your context, so i can't answer
21:34:02 mirrorbird joins (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276)
21:35:17 <ski> sep2 : hm, looking at your paste, perhaps `sigma' refers to your set of allowed symbols/tokens, that your FSM is meant to recognize some subset of finite words, built from such symbols, from ?
21:35:53 <monochrom> ski: Nice link to roconnor's post, thanks.
21:36:02 <dolio> I think the real problem with classical mathematics is that it extrapolates too much from finite things to infinite things.
21:36:06 <ski> dolio : "But you can't call the function on `Fin i` without exhibiting a factorization of `i`." -- yea, good point
21:36:50 <dolio> Like, excluded middle is kind of reasonable in a completely finite setting.
21:37:14 <monochrom> Also, sep2's alphabet Σ is simply {'0', '1'} or {'a', 'b'}, I forgot which, but it's a fixed hardcoded alphabet.
21:38:23 <dolio> (Still not really reasonable probably, but more reasonable.)
21:38:40 <frdg> is it possible to write `subset` with only a Foldable instance? https://dpaste.org/Vuo3
21:39:25 × Buntspecht quits (~user@unaffiliated/siracusa) (Ping timeout: 240 seconds)
21:39:30 × wroathe_ quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds)
21:39:45 <ski> frdg> :t member
21:39:59 Buntspecht joins (~user@unaffiliated/siracusa)
21:40:13 <frdg> member :: (Foldable t, Eq a) => a -> t a -> Bool
21:40:31 <monochrom> @type \xs ys -> all (\x -> elem x ys) xs
21:40:33 <lambdabot> (Foldable t1, Foldable t2, Eq a) => t1 a -> t2 a -> Bool
21:40:37 <ski> try `flip member s2' instead of `member s2'
21:41:09 <frdg> ski: I was close :)
21:41:20 <monochrom> Also it means that the two sets don't have to have the same container type.
21:41:21 <ski> foldr ((&&) . (`member` s2)) True s1 -- would also be possible
21:42:32 × st8less quits (~st8less@inet-167-224-197-181.isp.ozarksgo.net) (Ping timeout: 244 seconds)
21:43:53 <ski> @let member x s = foldr ((||) . (== x)) False s
21:43:55 <lambdabot> Defined.
21:43:58 <ski> @type member
21:43:59 <lambdabot> (Foldable t, Eq a) => a -> t a -> Bool
21:44:12 <ski> @type \s0 s1 -> foldr ((&&) . (`member` s1)) True s0
21:44:14 <lambdabot> (Foldable t1, Foldable t2, Eq a) => t1 a -> t2 a -> Bool
21:44:29 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
21:45:07 × NinjaTrappeur quits (~ninja@unaffiliated/ninjatrappeur) (Ping timeout: 240 seconds)
21:45:22 <ski> dolio : well, there's also "subfinite" and other such fuzzy things
21:45:29 × dcabrejas quits (bcd609cc@188.214.9.204) (Ping timeout: 245 seconds)
21:45:36 ski . o O ( Kripke semantics )
21:45:41 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
21:45:45 <monochrom> What is subfinite?
21:45:51 <ski> a subset of a finite set
21:46:01 <ski> (which needn't be finite itself, constructively)
21:46:14 <monochrom> Yikes.
21:46:23 <ski> (that it, one can't prove it's not finite. but one can't always prove it's finite, either)
21:46:23 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
21:46:27 NinjaTrappeur joins (~ninja@unaffiliated/ninjatrappeur)
21:46:46 <monochrom> Constructive math is too hard. :)
21:46:58 <zoom84> ski, here's what I came up with for your suggestion that MkPair a a would work. Compiles and runs. Lemme know if I missed anything:
21:47:17 <zoom84> data Pair a = MkSingle a | MkPair a a deriving(Show, Eq)
21:47:21 <zoom84> instance Functor (Pair) where
21:47:26 <zoom84> fmap :: (a -> b) -> Pair a -> Pair b
21:47:27 <ski> consider `{() | Goldbach}'. claiming this is finite amounts to having a bijection with a prefix of the natural numbers. which means that we could then decide Goldbach's conjecture from such a hypothetical proof of finiteness
21:47:31 <zoom84> fmap f (MkPair x y) = MkPair (f x) (f y)
21:47:35 <zoom84> fmap f (MkSingle x) = MkSingle (f x)
21:48:00 <dolio> ski: Subfinite is a notion from constructive mathematics, though.
21:48:05 <ski> zoom84 : that's fine. although in my version, i had no `MkSingle', just `MkPair'
21:48:09 <ski> dolio : yes
21:48:39 <monochrom> I still like the fact that constructive math/logic points out where I am using non-constructive choices. But I still insist on using those non-constructive choices.
21:48:48 <ski> one can model stages of knowledge about some mathematical object or structure, with Kripke semantics
21:48:50 <dolio> Also I mean, subfinite is a concept that arises once infinite things exist.
21:49:04 <zoom84> understood ski, thanks. i wanted to include a single var constructor as well because I wanted to see fmap work for both cases in a single type
21:49:14 × sep2 quits (49dc4892@c-73-220-72-146.hsd1.ca.comcast.net) (Ping timeout: 245 seconds)
21:49:16 <monochrom> Also, I recognize that natural deduction for constructive logic is so nicely symmetric.
21:49:24 <zoom84> which can't be done for (a->b), at least with the standard functor
21:49:47 <monochrom> (However! Classical logic also also nicely symmetric in the lattice sense.)
21:50:11 <ski> so, we can have one stage ("possible world") in which neither `A' nor `not A' is known. and then have two alternative possible future stages, one in which `A' is known, and another in which `not A' is known. and the interpretation of `not Phi' is that it holds at a stage, if for no future stages (no accessible worlds) we have that `Phi' holds
21:50:11 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
21:50:20 <dolio> Ah, but so is linear logic, which is properly constructive still.
21:50:27 <ski> so, at the initial stage, we can neither claim `A' nor `not A'
21:51:21 <dolio> There's kind of a sense in which linear logic takes constructiveness more seriously than intuitionism.
21:51:25 <ski> another thing one can model here is "discovering new elements of domains". we could know that `a' and `b' are elements (generators, say) of a presentation of a group. in a later stage, we may learn `c' is also a generator
21:51:47 <ski> and at different stages, we can also learn relations between "words" involving these generators
21:52:00 <monochrom> Ah, increasing stages of knowledge. I didn't think of that analogy when I learned this.
21:52:05 <dolio> Because the linear dual of something is like a positive disproof rather than 'assuming this leads to a contradiction.'
21:52:32 <ski> so, this is about being able to reason with partial knowledge, what holds for a group presentation where `a' and `b' are generators, but we haven't decided yet if there's to be any more ? (and possibly also not decided yet whether `a = b')
21:52:39 <monochrom> (A true formalist, I just learned and obeyed the rules of making a Kripke multiverse without asking why. :) )
21:52:50 <ski> zoom84 : ah, ok
21:53:26 <monochrom> (I did have my intuition, but it's only based on "I tried many examples and they all work out, this looks solid". :) )
21:53:30 <ski> dolio : "Also I mean, subfinite is a concept that arises once infinite things exist." -- yea, i suppose so
21:54:06 <ski> monochrom : "Also, I recognize that natural deduction for constructive logic is so nicely symmetric." -- but sequent calculus for classical logic is also very nicely symmetric (even a bit more so, i'd say) :)
21:54:16 <monochrom> Yeah!
21:54:38 <monochrom> But somehow I like the lattice story more than the sequent calculus story for classical logic.
21:54:44 <ski> monochrom : .. but the problem then is that cut-elimination (normalization of proofs, removing lemmata, going to canonical/direct proofs) is non-deterministic, for the classical case
21:55:00 <monochrom> Every powerset lattice is a boolean lattice \∩/
21:55:14 <ski> (but then, classical linear logic somehow manages to be computational, not have such non-determinism ..)
21:55:38 × Franciman quits (~francesco@host-212-171-42-250.retail.telecomitalia.it) (Quit: Leaving)
21:55:38 <ski> (ah, dolio already mentioned linear logic :)
21:55:41 × fendor quits (~fendor@77.119.129.78.wireless.dyn.drei.com) (Remote host closed the connection)
21:56:10 <dolio> There's also some work on non-linear 'logic' that has this kind of duality.
21:56:37 <dolio> You get essentially all the same connectives, but they're distinct in a different way.
21:56:50 <dolio> And the difference is evaluation order.
21:57:13 <ski> monochrom : it's interesting that for finitely presented groups, we have the "word problem", that it's not decidable whether two presented elements are equal. this proposition is "affirmative", in the sense that if they are equal, then a search of the space will eventually find the proof using the relations/laws of the presentation
21:57:23 GyroW_ joins (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be)
21:57:23 × GyroW_ quits (~GyroW@ptr-48ujrfd1ztq5fjywfw3.18120a2.ip6.access.telenet.be) (Changing host)
21:57:23 GyroW_ joins (~GyroW@unaffiliated/gyrow)
21:57:38 × GyroW quits (~GyroW@unaffiliated/gyrow) (Ping timeout: 260 seconds)
21:58:04 <ski> monochrom : otoh, for real numbers, defined in terms of Cauchy sequences, it's the other way around. if they're not equal (they're apart), we'll eventually learn so, by taking fine enough approximations. but if they're equal, then inspecting the approximations won't terminate
21:58:07 <dolio> So like, + is call-by-value, and \par is call-by-name.
21:59:21 <ski> dolio : i think Mike Shulman has been trying to make use of linear logic (or actually affine, iirc), to do interesting math, to more nicely explain things (like splitting of notions) in constructive math
21:59:40 <dolio> Yeah, that's one of the things I'm drawing from.
22:00:15 <dolio> I'm not sure it's even strictly affine in the paper.
22:00:25 <ski> (it may have been you who've mentioned some links to that here. i forgot whom)
22:00:46 <ski> (hm, last time, it may have been carter, i think ?)
22:00:57 <carter> eh?
22:01:14 × mirrorbird quits (~psutcliff@2a00:801:2d5:9d73:ff00:6553:d451:a276) (Quit: Leaving)
22:01:23 <ski> carter : you mentioned some paper by Mike Shulman, not too long ago, in here, yes ?
22:01:26 <dolio> Like, it suggests certain additional axioms that are based on the specific translation into intuitionistic logic.
22:01:27 <carter> yes
22:01:31 polyrain joins (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107)
22:01:43 <carter> but the linearity / affinity isn't the important part :)
22:01:47 <dolio> Like A×A -> !A.
22:02:04 <dolio> Once you have two, you have as many as you want.
22:02:31 <int-e> Oh I should really take advantage of the new-ish atomic readMVar in ivar-simple; that way an IVar would only have one MVar instead of two.
22:02:37 <carter> yeah, evaluation order + dualitiies is nice
22:02:44 <ski> monochrom : one way to understand this constructivistic kerfuffle about "subfinite" and so on, is to think of it as being about "stages of knowledge"
22:03:25 <dolio> That's definitely the Brouwerian angle, I think.
22:03:52 <ski> (but in an epistemic modal logic, one has an explicit connective for "known" (often "by some particular agent"). but in a constructive setting, it's so to speak "built in")
22:03:54 <carter> dolio: which semantics for par are you drawing from?
22:04:03 <carter> i think choice/& is also cbn
22:04:10 <dolio> carter: I was thinking of Compiling with Classical Connectives.
22:04:26 <dolio> Yeah, & is also call-by-name.
22:04:31 <dolio> And × is by-value.
22:04:33 <ski> monochrom : but yes, the Kripke semantics for intuitionistic logic is, iiuc, related to the one for epistemic modal logic
22:04:40 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Ping timeout: 246 seconds)
22:05:04 <carter> do whats their semantics for par? (i'd actually wanted to read that paper when i found it a few months ago, but it fell off my queue)
22:05:06 <int-e> ("new-ish"... refers to ghc 7.10 here, I think.)
22:05:10 <ski> (there's a "modal translation" from the former logic to the latter. at least in the propositional case, dunno about how it works with the quantifiers)
22:06:05 <dolio> ski: You should definitely look at that paper, by the way. It's got arbitrary (co)data types with constructors whose types are sequents, and can have arbitrarily many value and continuation fields.
22:06:13 <ski> dolio : oh .. that's a bit strange (the "i can't distinguish between two and infinity" one)
22:06:17 <dolio> I think I've pointed you to it, but I don't know if you've seen it.
22:06:26 × oisdk quits (~oisdk@2001:bb6:3329:d100:189f:9172:61d6:2b9e) (Quit: oisdk)
22:07:01 <ski> carter : hm, did you look into the paper by Wadler about relating session types to linear logic ?
22:07:12 <carter> session types are trash :)
22:07:30 oisdk joins (~oisdk@2001:bb6:3329:d100:e56d:4357:c75:2f61)
22:07:35 <dolio> carter: A par continuation is two continuations, and a par value is a lambda term that binds two continuations, I think.
22:07:49 <carter> ok, that sounds correct
22:07:54 <carter> its forkIO by another name !
22:08:08 <ski> i think the "cbn" vs. "cbv" distinction you mentioned above is more or less the same as the "negative" vs. "positive" one, that's cropping up in some cases (focusing, uniform proof)
22:08:08 pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net)
22:08:31 <carter> or "cbpv"
22:08:33 <dolio> Yes, but another cool thing this paper does is incorporate call-by-need and call-by-coneed.
22:08:40 <carter> ... whats that even mean
22:08:48 <carter> *coneed
22:08:57 <ski> dolio : hm, i haven't seen this one before. ty for the suggestion
22:09:26 machinedgod joins (~machinedg@142.169.78.240)
22:09:53 <dolio> -by-need saves work when you do a let that gets used multiple times. -by-coneed saves work when you do a shift where the continuation gets used multiple times, or something.
22:10:19 ski . o O ( "Compiling with Classical Connectives" by Paul Downen,Zena M. Ariola in 2020-08-28 at <https://arxiv.org/abs/1907.13227> )
22:10:37 <fraktor> Hey, I've been trying to find definitive sources on this (admittedly controversial) topic: what's the plan for the new record syntax?
22:11:41 <ski> carter : well, that session types paper does evoke such analogies as `forkIO'
22:12:18 <ski> dolio, hm, interesting
22:12:19 × albethere quits (sid457088@gateway/web/irccloud.com/x-fnvfojoflynertwf) (Ping timeout: 272 seconds)
22:12:25 <carter> ski: explicitly?
22:12:25 <carter> i gave a talk where i dervied it
22:12:57 × alanz quits (sid110616@gateway/web/irccloud.com/x-rotyfkerxdfrgsjt) (Ping timeout: 272 seconds)
22:13:45 <ski> carter : i don't recall if it's mentioned explicitly. but i did a presentation of the paper (first part was a refreshed of linear logic), which ended by a translation table having terms like "spawn" and "join" for the `par' case
22:13:53 <dolio> ski: It's probably not all novel, but it was the first time I've seen almost everything in the paper (because I slacked on learning CBPV), so it just seemed like one cool idea after another when I read it. :)
22:14:03 <ski> (s/refreshed/refresher/)
22:14:31 alanz joins (sid110616@gateway/web/irccloud.com/x-hhuchzrtvkxyanvu)
22:14:51 × dmj` quits (sid72307@gateway/web/irccloud.com/x-adxoyhgdabwnfahc) (Ping timeout: 272 seconds)
22:15:19 <koz_> :t maybe empty pure
22:15:21 <lambdabot> Alternative f => Maybe a -> f a
22:15:29 × liszt_ quits (sid336875@gateway/web/irccloud.com/x-yllqqkokdlggifua) (Ping timeout: 272 seconds)
22:15:47 albethere joins (sid457088@gateway/web/irccloud.com/x-uubpnvrpjsbjfkmg)
22:15:50 <ski> koz_ : i sometimes wish that was in a "standard library"
22:15:52 liszt_ joins (sid336875@gateway/web/irccloud.com/x-uuxepiucxpvvjuow)
22:15:59 <koz_> ski: Yeah, you and me both.
22:16:04 <koz_> It's probbo in extra or something.
22:16:07 × conjunctive quits (sid433686@gateway/web/irccloud.com/x-ddwejxzgxrdkpmwd) (Ping timeout: 272 seconds)
22:16:07 × elvishjerricco quits (sid237756@NixOS/user/ElvishJerricco) (Ping timeout: 272 seconds)
22:16:07 × tchar quits (sid301738@gateway/web/irccloud.com/x-squtmljpvmzfdfsk) (Ping timeout: 272 seconds)
22:16:07 × adius quits (sid321344@gateway/web/irccloud.com/x-hdzjqmobobrptkzk) (Ping timeout: 272 seconds)
22:16:28 hackage tini 0.1.0.1 - Tiny INI file and configuration library with a minimal dependency footprint. https://hackage.haskell.org/package/tini-0.1.0.1 (AntonEkblad)
22:16:29 tchar joins (sid301738@gateway/web/irccloud.com/x-rgpmjtqqbhrmcohe)
22:16:45 × SrPx quits (sid108780@gateway/web/irccloud.com/x-czvvabmhqaigtsgp) (Ping timeout: 272 seconds)
22:16:57 <carter> ski: oh, it def does that, the issue i have with session types is that a lotta expositions kinda treat par as not being symmetric in the two args
22:16:59 dmj` joins (sid72307@gateway/web/irccloud.com/x-khxpyzsgwpyndoap)
22:17:19 SrPx joins (sid108780@gateway/web/irccloud.com/x-lqrnqgbzvbfaqfbf)
22:17:35 × albethere quits (sid457088@gateway/web/irccloud.com/x-uubpnvrpjsbjfkmg) (Max SendQ exceeded)
22:17:52 albethere joins (sid457088@gateway/web/irccloud.com/x-lwglmvolkygoqkcg)
22:18:10 adius joins (sid321344@gateway/web/irccloud.com/x-fevubjfnjnczxgiy)
22:18:18 conjunctive joins (sid433686@gateway/web/irccloud.com/x-svszloomofjzwqrv)
22:18:23 falafel joins (~falafel@2605:e000:1527:d491:99fe:5613:f0a7:56f0)
22:18:33 <dolio> carter: I guess in more detail, the idea with by-need is that there can be non-trivial work to reduce a term to an actionable value when you 'let' something, and you want to delay doing that work until you need it, but only do it once. Similarly, when you capture a continuation, there might be non-trivial work to reduce it to an actionable co-value, and you similarly only want to do it once, but only if you actually jump to it.
22:19:17 × buggymcbugfix quits (sid432603@gateway/web/irccloud.com/x-fjvfxmicxyzmpfmg) (Ping timeout: 272 seconds)
22:19:27 elvishjerricco joins (sid237756@NixOS/user/ElvishJerricco)
22:19:55 × m-renaud quits (sid333785@gateway/web/irccloud.com/x-wdhdpnuntagzspud) (Ping timeout: 272 seconds)
22:19:55 × ^[_ quits (sid43445@gateway/web/irccloud.com/x-eiyktghegavpjkto) (Ping timeout: 272 seconds)
22:20:01 × __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving)
22:20:06 ski . o O ( `(getAlt .) . foldMap . (Alt .) :: (Foldable t,Alternative f) => (a -> f b) -> (t a -> f b)' )
22:20:11 × Tops21 quits (~Tobias@dyndsl-095-033-017-021.ewe-ip-backbone.de) (Read error: Connection reset by peer)
22:20:26 buggymcbugfix joins (sid432603@gateway/web/irccloud.com/x-hmfcqscsbxxfrwjh)
22:20:56 <ski> carter : yea, it's a bit annoying, perhaps, but it seems it's what you get, for the intended application domain of session types ? (at least to a first approximation ?)
22:21:49 <ski> (note that i haven't really looked much at session types, apart from that paper relating them to linear logic .. so i might be missing some relevant stuff)
22:22:03 ^[_ joins (sid43445@gateway/web/irccloud.com/x-jnodviuydqdnbssz)
22:22:20 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:507:9614:9e50:551c) (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:22:30 m-renaud joins (sid333785@gateway/web/irccloud.com/x-hxgmjbgqyiqvuvvr)
22:23:14 moet joins (~moet@mobile-166-170-41-37.mycingular.net)
22:23:43 × noan quits (~noan@2604:a880:400:d0::12fc:5001) (Ping timeout: 272 seconds)
22:24:06 × DavidEichmann quits (~david@43.240.198.146.dyn.plus.net) (Ping timeout: 258 seconds)
22:24:07 <moet> is it better to have a "search & extract" function like `(a -> Bool) -> [a] -> Maybe ([a], a)` or like `(a -> Bool) -> [a] -> ([a], Maybe a)` ?
22:24:20 Sgeo_ joins (~Sgeo@ool-18b982ad.dyn.optonline.net)
22:24:43 <koz_> moet: I guess this finds (possibly) the first satisfying item, and the rest?
22:24:43 <moet> i tend to prefer the former `Maybe ([a], a)` because it communicates that there's no need to update the list in it's containing data structure because no result was found
22:24:49 noan joins (~noan@2604:a880:400:d0::12fc:5001)
22:24:50 <koz_> What happens if there's more than one?
22:24:59 × no-n quits (sid257727@gateway/web/irccloud.com/x-rjqspinjxdvineod) (Ping timeout: 272 seconds)
22:24:59 × AndreasK quits (sid320732@gateway/web/irccloud.com/x-degmzwhevcbnxqim) (Ping timeout: 272 seconds)
22:25:24 <ski> moet : assuming i understand the context correctly, i'd go for the former, probably
22:25:34 snakemasterflex joins (~snakemast@213.100.206.23)
22:25:37 × carter quits (sid14827@gateway/web/irccloud.com/x-qxwtkltudlralpiz) (Ping timeout: 272 seconds)
22:25:58 <ski> it seems less common to want to remove an element, if present, and separately get a notification whether an element was removed
22:25:58 <moet> koz_: yes, it finds the first and returns the list with that item removed .. eg `searchExtract (=='l') "hello" == Just ("helo", 'l')`
22:26:05 <koz_> Ah.
22:26:06 <moet> koz_: if there's more than one, they're left in the list
22:26:07 <dolio> carter: I'm not sure what a great example is. The one that comes to mind is: when you capture a continuation that does some lets to build (by-need) closures after it's called, those closures should not be built for each invocation of the continuation.
22:26:28 carter joins (sid14827@gateway/web/irccloud.com/x-sizpssbboxwjlzfn)
22:26:30 × xff0x quits (~fox@2001:1a81:5300:fe00:1175:d8f5:8ada:f855) (Quit: xff0x)
22:26:30 <ski> usually, i think, one'd want to explicitly tell how to continue with the list, if the item was not present
22:26:30 <dolio> Only once, if possible, and shared.
22:26:59 no-n joins (sid257727@gateway/web/irccloud.com/x-njvyzrpfdtdezqbh)
22:27:01 AndreasK joins (sid320732@gateway/web/irccloud.com/x-hkkwdrhutkwmrhne)
22:27:11 <ski> dolio : maybe some `shift'&`reset' example ?
22:27:33 × Sgeo quits (~Sgeo@ool-18b982ad.dyn.optonline.net) (Ping timeout: 258 seconds)
22:27:55 <moet> ski: so if i'm understanding you correctly, you agree with what i said above about preferring `Maybe ([a], a)` because it's less ambiguous in meaning than `([a], Maybe a)`?
22:27:56 × machinedgod quits (~machinedg@142.169.78.240) (Ping timeout: 258 seconds)
22:28:17 <dolio> Maybe. I have trouble of thinking of good 'doing computation to determine the continuation' examples because that's basically something you can't do in most type theory.
22:28:22 <ski> (there's some paper on normalization-by-evaluation, which has a `reflect' operation that uses `shift' on sum types, to evaluate both branches, iirc .. hmm)
22:29:25 × ghuntley quits (sid16877@gateway/web/irccloud.com/x-jwzkcgtobgufetir) (Ping timeout: 272 seconds)
22:29:25 × pent quits (sid313808@gateway/web/irccloud.com/x-mbwahawoqthelmme) (Ping timeout: 272 seconds)
22:29:33 <carter> ski: i specfically think that the session types approach to linar logica was the biggest barrier to people understanding linear logic and relating it to functional programming
22:29:35 ghuntley joins (sid16877@gateway/web/irccloud.com/x-hazckpioupzucowz)
22:29:40 <ski> moet : yes, the latter would allow/encourage continuing using the list (whether an element was removed or not), and perhaps later checking the removal status of the other part. if that was a common pattern one'd want to support, i'd probably go with the latter alternative (or maybe support both)
22:29:52 × snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 246 seconds)
22:30:03 × JSharp quits (sid4580@wikia/JSharp) (Ping timeout: 272 seconds)
22:30:24 <ski> moet : but if it's not a likely situation (to reasonably be in), i'd go with the former, to reduce risk of bugs due to not being forced to upfront check the status
22:30:25 × cosimone quits (~user@2001:b07:ae5:db26:f68c:50ff:fe0b:b774) (Ping timeout: 240 seconds)
22:30:31 pent joins (sid313808@gateway/web/irccloud.com/x-lsufgbovmcuefoiy)
22:30:53 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
22:31:57 × cemerick quits (sid54985@gateway/web/irccloud.com/x-ongnogrqassjmkgm) (Ping timeout: 272 seconds)
22:32:22 JSharp joins (sid4580@wikia/JSharp)
22:32:29 cemerick joins (sid54985@gateway/web/irccloud.com/x-ticsgvtoxvknnlzm)
22:32:30 <ski> carter : oh, that might be so. i haven't heard of many people trying to understand linear logic (or even functional programming), coming from a session types perspective. i learned linear logic long before i heard of session types
22:32:57 <carter> How’d you manage that?
22:33:13 <ski> dolio : hm, elaborate on "doing computation to determine the continuation" ?
22:33:22 × polyrain quits (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107) (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:33:54 <carter> dolio: this is the co-need bit? the paper kinda talks about it
22:34:08 <carter> "control effectful cbv but more efficient for weird programs"
22:34:12 polyrain joins (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107)
22:34:12 <ski> carter : i dunno. i'm not sure how long session types have been a thing (i heard of them, less than ten years ago, i think). but i was reading lots of papers on various logics and type systems, and encountered linear logic that way
22:34:21 <carter> cool
22:34:48 <carter> by volume, most linear lgoic stuff in the last 20 years seems to either be in small boring fragments, or session types
22:34:51 <carter> until the past 2-5 years
22:34:59 <ski> carter : let's enable more weird programs, heh ;)
22:36:15 × moet quits (~moet@mobile-166-170-41-37.mycingular.net) (Quit: leaving)
22:37:13 <dolio> carter: Yeah.
22:37:31 <carter> dolio: wrt co-need or wrt linear logic?
22:37:41 <carter> https://ix.cs.uoregon.edu/~pdownen/presentations/beyond-polarity.pdf maybe this presentation by the author has stuff
22:37:43 <carter> skimming atm
22:38:02 <ski> a tail-recursive function (definition) is one that passes the same continuation (for output) to the recursive calls. how would a "head-recursive function (definition)", being one that passes the same value (for input) to the recursive calls, work ?
22:38:18 <carter> ski: ???
22:38:22 × chaosmasttter quits (~chaosmast@p200300c4a73b2e0100f3c5a701cd6e56.dip0.t-ipconnect.de) (Quit: WeeChat 2.9)
22:38:22 <dolio> ski, carter: I think another example is: if the continuation starts by doing case analysis on a sum type that is closed over by the continuation, you should just reduce that out of the continuation the first time you go through it, and memoize the result.
22:38:25 <carter> co deta?
22:38:35 <ski> ah, i suppose this is related to "message-dispatching syntax" (aka "copattern syntax") (i was thinking that before, but didn't mention)
22:38:46 <dolio> carter: co-need.
22:39:10 atk is now known as nil
22:39:18 <ski> dolio : what's the dual situation to that ?
22:39:21 <carter> i dont like the up/down shift notations in this
22:39:23 × nil quits (~Arch-TK@ircpuzzles/staff/Arch-TK) (Disconnected by services)
22:39:26 <carter> in these papers
22:39:27 <carter> hard to read
22:40:03 <dolio> ski: The first time you evaluate a lazy let function call, you should remember the value it produces.
22:40:06 atk joins (~Arch-TK@ircpuzzles/staff/Arch-TK)
22:40:38 argent0 joins (~argent0@168.227.97.5)
22:40:44 × jwynn6 quits (~jwynn6@050-088-122-078.res.spectrum.com) (Ping timeout: 256 seconds)
22:41:12 <ski> carter : if you consider `shunt [] ys = ys; shunt (x:xs) ys = shunt xs (x:ys)' (for `reverse xs = shunt xs []'), then it inspects information in its input value (putting stuff into the accumulator), and continues looping with the same continuation (only actually used in the base casr)
22:41:28 <carter> whats this about?
22:42:00 <ski> carter : for a "head-recursive" definition, you'd pass the same input parameter `v' to the recursive call as you got in the current call. but instead, you'd extract information, by inspecting your continuation (which would change across recursive calls)
22:42:11 <argent0> Hi, what does `do ...; let foo bar = cat <$> dog <*> aniamal` means?
22:42:11 <carter> are you just talking about coinductive
22:42:27 <argent0> I ask about the `foo bar` part?
22:42:50 <ski> i was wondering if one could relate this to what dolio mentioned about "doing computation to determine the continuation"
22:43:00 <monochrom> <$> is fmap, from the Functor class. <*> is from the Applicative class.
22:43:04 nbloomf joins (~nbloomf@2600:1700:83e0:1f40:71a4:5e3f:3433:7ae1)
22:43:18 <ski> dolio : "a lazy let function call" ?
22:43:33 <monochrom> This is obviously very abstract and unnecessarily general. But this is how much information is possible from the question.
22:43:45 <argent0> monochrom: yes but how does the `foo bar` part matches
22:43:55 × mav1 quits (~mav@p5dee344b.dip0.t-ipconnect.de) (Quit: WeeChat 2.9)
22:44:02 <monochrom> foo is a function name, bar is an argument name.
22:44:23 <monochrom> This is defining the function "foo".
22:44:24 × dminuoso quits (~dminuoso@unaffiliated/dminuoso) (Quit: ZNC 1.6.6+deb1ubuntu0.1 - http://znc.in)
22:44:33 <argent0> monochrom: ok, thanks
22:44:48 <ski> argent0 : if `cat :: I (Dog -> Animal -> Farm)', and `dog :: I Dog',`animal :: I Animal', then `cat <$> dog <*> animal :: I Farm', where `I' is some idiom (an instance of `Applicative')
22:44:49 argent0 :-P
22:45:04 × LKoen quits (~LKoen@81.255.219.130) (Quit: “It’s only logical. First you learn to talk, then you learn to think. Too bad it’s not the other way round.”)
22:45:21 <argent0> ski: thanks I get it now
22:45:58 <ski> (er, sorry. that should be just `cat :: Dog -> Animal -> Farm'. if you had used `cat <*> dog <*> aniamal', then it would have been as i said above)
22:45:59 Andre4 joins (~Andrea@p5de77723.dip0.t-ipconnect.de)
22:47:19 <ski> carter : "are you just talking about coinductive" -- more or less. thinking about how to relate it to the other topic here. have you seen "message-dispatching syntax" (perhaps read the "copatterns" paper) ?
22:47:35 <carter> copatterns are fun
22:47:51 <ski> indeed
22:47:54 <carter> ski: did you see my thing about how to fake copatterns in haskell on reddit a few years ago
22:48:04 <ski> hm, i don't recall so ?
22:48:15 <ski> @where ErikPoll
22:48:15 <lambdabot> "Subtyping and Inheritance for Inductive Types" in 1997 at <http://www.cs.ru.nl/E.Poll/papers/durham97.pdf>,"Subtyping and Inheritance for Categorical Datatypes" in 1997 at <http://www.cs.ru.nl/E.
22:48:15 <lambdabot> Poll/papers/kyoto97.pdf>,"A Coalgebraic Semantics of Subtyping" in 2000 at <http://www.cs.ru.nl/E.Poll/papers/cmcs00.pdf>,later version of that in 2001 at <http://www.cs.ru.nl/E.Poll/papers/ita01.
22:48:15 <lambdabot> pdf>
22:48:55 <dolio> ski: `let y = f x` is naming (y) a computation that matches up closed-over variables in a par redex that might do non-trivial amounts of work before reducing to a value. So call-by-need says that when you want its value, you should do the work and remember the value.
22:49:00 <carter> https://www.reddit.com/r/haskell/comments/4aju8f/simple_example_of_emulating_copattern_matching_in/ ski
22:49:27 <ski> the first two of these papers, are where i first saw the idea (which i called "message-dispatching syntax", since it seemed to obviously correspond to definitions of how objects respond to messages (by giving method implementations), in OO)
22:49:49 <dolio> Instead of re-doing the redex every time (call-by-name).
22:50:15 <carter> dolio: aka its saying "continuations are cbn normally in cbv languages"
22:51:54 <dolio> Something like that.
22:52:00 <Andre4> is the St Monad ( Data.STRef, DataArrayST) impure, is this monoad magic, like IO ?
22:52:06 <ski> carter : ah, cool :) .. you're emulating a record as a function taking a tag (in this case a `GADT' tag)
22:52:44 <dolio> carter: Like, they just grab the stack, and run back through it verbatim every time. They don't optimize it on the first time through.
22:52:51 × danvet_ quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 272 seconds)
22:53:12 <carter> dolio: ohhh, it makes more sense when explained that way
22:53:18 <carter> call CC is terrible for exposition
22:53:21 <carter> CPS makes more sense to me
22:53:22 <carter> :)
22:53:37 <carter> dolio: would this allow a faster logicT mmonad? :)
22:53:55 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:71a4:5e3f:3433:7ae1) (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:54:27 hackage ivar-simple 0.3.3 - Write once concurrency primitives. https://hackage.haskell.org/package/ivar-simple-0.3.3 (BertramFelgenhauer)
22:55:02 <dolio> Hah. I don't know. I barely understand this paper.
22:55:20 <ski> carter : reminds me of a trick to represent `data Expr where Let :: [Decl] -> Expr -> Expr; data Decl where Def :: Ident -> [Ident] -> Expr -> Decl' as `data Tag = E | D; data AST :: Tag -> * where Let :: [AST D] -> ADT E -> AST E; Def :: Ident -> [Ident] -> AST E -> AST D'
22:55:23 <int-e> ski: ^^new release
22:55:23 <carter> Yeah. It found it a bit hard to read
22:55:59 <int-e> (it's even simpler now; writeIVar is just a putMVar, the way it was originally intended)
22:56:02 dminuoso joins (~dminuoso@unaffiliated/dminuoso)
22:56:02 <carter> int-e: I cooked up a fun idea for an Mvar variant when helping viktor debug some fun perf issues
22:56:10 <ski> carter : the point is that if one wants to do explicit fixpoints, we can encode a type-level tuple/record as a type function from `Tag'
22:56:35 <carter> https://gitlab.haskell.org/ghc/ghc/-/issues/18798
22:57:01 <carter> ski: I’m middle of eating. So not 100% atm
22:57:02 mav1 joins (~mav@p5dee344b.dip0.t-ipconnect.de)
22:58:11 <ski> dolio : hm, not seeing how it relates to `par'
22:58:28 <dolio> function calls are par.
22:59:15 <ski> Andre4 : neither `ST' nor `IO' are impure. but both are "magic", in the sense that they have direct support by the implementation. (they aren't defined totally in Haskell source code)
22:59:27 <dolio> I'd have to think a while how to actually write that 'let' thing. :)
22:59:35 <ski> (similarly to how `Integer',`Int',`Double',`(->)' are also "magic", or "primitive", in the same sense)
22:59:51 tv- joins (~tv@unaffiliated/tv-)
23:01:02 × alx741 quits (~alx741@186.178.110.22) (Quit: alx741)
23:02:07 × albert_91 quits (~Albert@p200300e5ff0b5b4248a33bded2872db1.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
23:02:11 <carter> dolio: more you can encode functions in par
23:02:11 <Andre4> aki: in the source code from Stref some foreign statements are included
23:02:57 × falafel quits (~falafel@2605:e000:1527:d491:99fe:5613:f0a7:56f0) (Remote host closed the connection)
23:03:23 falafel joins (~falafel@2605:e000:1527:d491:99fe:5613:f0a7:56f0)
23:04:30 <Andre4> ski: does stref, or arrayst work together with laty evaluation ?
23:04:42 × Amras quits (~Amras@unaffiliated/amras0000) (Ping timeout: 260 seconds)
23:04:45 <Andre4> lazy evaluation
23:05:12 Axman6 joins (~Axman6@pdpc/supporter/student/Axman6)
23:05:20 × mav1 quits (~mav@p5dee344b.dip0.t-ipconnect.de) (Quit: WeeChat 2.9)
23:06:11 <dolio> ski: Something like this, maybe: <shift k. <f|¬x:k> | let y. ...>
23:06:26 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
23:06:27 <ski> int-e : nice :D
23:07:30 × oisdk quits (~oisdk@2001:bb6:3329:d100:e56d:4357:c75:2f61) (Quit: oisdk)
23:08:04 <dolio> How to reduce that is ambiguous, though, and I left out all the polarity shifting that makes it deterministic. :)
23:08:13 × m0rphism quits (~m0rphism@HSI-KBW-046-005-177-122.hsi8.kabel-badenwuerttemberg.de) (Ping timeout: 260 seconds)
23:08:16 × entkme^ quits (entkme@ip98-184-89-2.mc.at.cox.net) ()
23:08:16 <ski> dolio : hm, yes. but for some reason, i thought you were thinking about constructing a `par', behind the scenes, in some way there
23:08:52 alx741 joins (~alx741@186.178.110.22)
23:09:31 tsrt^ joins (tsrt@ip98-184-89-2.mc.at.cox.net)
23:09:37 × Andre4 quits (~Andrea@p5de77723.dip0.t-ipconnect.de) (Quit: Leaving)
23:09:38 <dolio> I guess you should imagine that f is actually a lambda term.
23:09:44 <dolio> To be analogous to a case statement.
23:10:16 <ski> Andre4 : yes, they don't force the values stored inside the mutable cells. however, `Control.Monad.ST' is strict in the state (the collection of `STRef's and `STArray's) that it carries around. if you want laziness there, try `Control.Monad.ST.Lazy' (i'd link you to some fun examples by monochrom here, but alas, the paste service they were on is no more ..)
23:10:30 <dolio> Then it's a β redex.
23:10:54 × polyrain quits (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107) (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:11:16 <ski> dolio : how should i parse `<.. | ..>' ? creating a `par' ?
23:11:25 × thc202 quits (~thc202@unaffiliated/thc202) (Ping timeout: 240 seconds)
23:11:54 <dolio> No, <...|...> is cut.
23:12:15 <dolio> cut a term with a coterm.
23:12:23 <ski> ah, i was just thinking it could be that
23:12:54 <dolio> Anyhow, `shift` can capture a β redex for a sum in a continuation, dually to this.
23:13:11 × dminuoso quits (~dminuoso@unaffiliated/dminuoso) (Quit: ZNC 1.7.5 - https://znc.in)
23:13:19 <ski> (still pondering how to parse it, though)
23:13:36 massma joins (~user@dyn-160-39-62-152.dyn.columbia.edu)
23:14:14 <dolio> Haha. <(shift k. <f|¬x:k>) | (let y. ...)>
23:14:28 <ski> what's the type of either side of the jump `<shift k. <f|¬x:k> | let y. ...>' ?
23:14:41 <ski> (yes, i took that bracketting for granted)
23:14:48 <dolio> 'let' is supposed to capture the term it's cut with in the variable (y). 'shift' captures the continuation it's cut with in `k`.
23:14:57 <ski> how does it correspond to `let y = f x in ...' ?
23:15:06 <ski> (is it the same `...' in both ?)
23:16:35 <ski> hm, ok, so `let y. ...' is a continuation, then
23:16:42 <dolio> Yeah.
23:16:48 dminuoso joins (~dminuoso@unaffiliated/dminuoso)
23:17:01 <ski> (and that `...' is another jump)
23:17:09 <dolio> It's a continuation that captures the term it's cut with and runs a computation in an extended environment.
23:17:18 <ski> yes
23:17:25 × raehik quits (~raehik@cpc96984-rdng25-2-0-cust109.15-3.cable.virginm.net) (Ping timeout: 240 seconds)
23:17:47 <dolio> To make a value version of the let might require another shift or something.
23:18:12 × GyroW_ quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
23:18:22 GyroW joins (~GyroW@d54c03e98.access.telenet.be)
23:18:23 × GyroW quits (~GyroW@d54c03e98.access.telenet.be) (Changing host)
23:18:23 GyroW joins (~GyroW@unaffiliated/gyrow)
23:18:28 polyrain joins (~polyrain@2001:8003:e501:6901:a41a:145a:3fce:c107)
23:21:32 <int-e> carter: looks risky... I'd think that marking the MVar as dirty is as much about the list of waiters (which, if you block on an MVar, contains an item in the youngest generation) as it is about the value.
23:21:52 <ski> Γ , y : B ⊢{ ⋯y⋯ } Δ
23:21:55 <ski> ──────────────────────
23:21:58 <ski> Γ | let y. ⋯y⋯ : B ⊢ Δ
23:22:03 <ski> something like that
23:22:16 × tv- quits (~tv@unaffiliated/tv-) (Quit: WeeChat 2.8)
23:22:17 <dolio> Yeah, I think so.
23:22:37 tv- joins (~tv@unaffiliated/tv-)
23:22:59 <carter> ohh
23:23:03 <carter> int-e: comment on that plz :)
23:23:13 <ski> and ⌜¬x:k⌝ is a "calling context" of a called function, yes ?
23:23:27 × notzmv quits (~user@unaffiliated/zmv) (Read error: Connection reset by peer)
23:23:50 <dolio> Yeah. A function continuation is an argument pushed on the return continuation.
23:23:57 <ski> right
23:24:20 <ski> (oh, that's why you used ⌜:⌝, since you're thinking of the continuation as a stack you're pushing things on)
23:24:53 × pacak quits (~pacak@bb116-14-220-91.singnet.com.sg) (Remote host closed the connection)
23:24:56 <int-e> carter: you sure know how to put the "labor" into elaborate :P
23:25:09 <ski> (at first i was wondering why ⌜¬x⌝ had type ⌜k⌝ ..)
23:25:09 notzmv joins (~user@177.45.26.174)
23:25:13 pacak joins (~pacak@bb116-14-220-91.singnet.com.sg)
23:25:23 <dolio> Oh, sorry.
23:25:25 notzmv is now known as Guest43030
23:26:05 × dminuoso quits (~dminuoso@unaffiliated/dminuoso) (Quit: ZNC 1.7.5 - https://znc.in)
23:26:13 <dolio> I should say, that's what a function continuation value is. Or a co-value.
23:26:21 dminuoso joins (~dminuoso@unaffiliated/dminuoso)
23:26:47 Guest43030 is now known as zmv
23:26:51 × zmv quits (~user@177.45.26.174) (Changing host)
23:26:51 zmv joins (~user@unaffiliated/zmv)
23:26:58 <dolio> You could also put a 'let' in there to do more stuff.
23:26:58 zmv is now known as notzmv
23:30:30 <argent0> :q
23:30:46 <ski> Γ ⊢ x : A | Δ
23:30:51 <ski> ────────────────
23:30:55 <ski> Γ , ¬x : ¬ A ⊢ Δ Γ | k : B ⊢ Δ
23:30:59 <ski> ────────────────────────────────
23:31:02 <ski> Γ | ¬x::k : A → B ⊢ Δ
23:31:25 × Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Ping timeout: 240 seconds)
23:31:54 × pacak quits (~pacak@bb116-14-220-91.singnet.com.sg) (Remote host closed the connection)
23:32:04 <dolio> Yeah.
23:32:17 pacak joins (~pacak@bb116-14-220-91.singnet.com.sg)
23:32:36 <ski> Γ ⊢ f : A → B ⊢ Δ Γ | ¬x::k : A → B ⊢ Δ
23:32:41 <ski> ─────────────────────────────────────────
23:32:44 <ski> Γ ⊢{ ⟨f|¬x:k⟩ } Δ
23:34:15 <dolio> Yeah, with one of the ⊢ replaced with a |.
23:34:36 <ski> er, yes
23:34:48 conal joins (~conal@64.71.133.70)
23:34:55 <ski> should have been ⌜Γ ⊢ f : A → B | Δ⌝
23:35:01 <dolio> Right.
23:35:45 <dolio> And for a genuine β redex we'ere imagining f = λ[¬x::k] <...>
23:37:13 <dolio> So it's a value cut with a covalue.
23:37:18 <ski> Γ ⊢{ ⟨f|¬x:k⟩ } Δ
23:37:22 <ski> ───────────────────────────────────
23:37:26 <ski> Γ ⊢ ξ k. ⟨f|¬x:k⟩ : B | Δ ∸ (k : B)
23:37:31 <ski> and then cut with the other one
23:38:07 <ski> (i should have included ⌜k : B⌝ in ⌜Δ⌝, for the ⌜¬x::k⌝ derivation, above)
23:38:15 <dolio> Oh, you never put k in the context.
23:38:18 <dolio> Yeah.
23:38:25 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
23:39:28 <ski> hm, so we have a "critical pair"
23:39:44 <ski> each one side wanting to override the other one
23:40:23 <dolio> Yeah, so you need an evaluation strategy to decide what happens.
23:40:35 <ski> mm
23:40:47 <ski> i'm not seeing where by-need ties into this, atm, though
23:44:18 <ski> <dolio> ski, carter: I think another example is: if the continuation starts by doing case analysis on a sum type that is closed over by the continuation, you should just reduce that out of the continuation the first time you go through it, and memoize the result.
23:44:22 <ski> <dolio> ski: The first time you evaluate a lazy let function call, you should remember the value it produces.
23:44:31 <ski> <dolio> ski: `let y = f x` is naming (y) a computation that matches up closed-over variables in a par redex that might do non-trivial amounts of work before reducing to a value. So call-by-need says that when you want its value, you should do the work and remember the value.
23:44:42 <ski> (backtracking back to these now)
23:45:14 <dolio> Suppose `let` wins, B is by-name, and y occurs multiple times. Then the beta reduction happens twice, because we duplicate the whole term (I think).
23:45:37 <ski> "a sum type that is closed over by the continuation", would that be ⌜y⌝, above ?
23:46:45 <dolio> No, that would be the dual case.
23:47:09 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
23:47:25 × inkbottle quits (~inkbottle@aaubervilliers-654-1-101-245.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!)
23:47:25 × falafel quits (~falafel@2605:e000:1527:d491:99fe:5613:f0a7:56f0) (Ping timeout: 240 seconds)
23:47:32 <ski> Γ ⊢ ξ k. ⟨f|¬x::k⟩ : B | Δ ∸ (k : B) Γ | let y. ⋯y⋯ : B ⊢ Δ
23:47:35 <ski> ─────────────────────────────────────────────────────────────
23:47:39 <ski> Γ ⊢{ ⟨ξ k. ⟨f|¬x::k⟩|let y. ⋯y⋯⟩ } Δ
23:47:44 <ski> (spelling the final cut out, for easy reference)
23:47:45 inkbottle joins (~inkbottle@aaubervilliers-654-1-101-245.w86-212.abo.wanadoo.fr)
23:48:38 × vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving)
23:48:44 <dolio> <λ[¬x::k] ... | ¬x::k> is a par redex, <inl x | case{inl x -> ... | inr y -> ...}> is a + redex.
23:48:48 albert_91 joins (~Albert@p200300e5ff0b5b4248a33bded2872db1.dip0.t-ipconnect.de)
23:48:51 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
23:49:23 <int-e> carter: Fine there you go
23:50:20 <ski> hm, yes. in the latter, the continuation is a pair of two continuations
23:50:38 <ski> (thinking about the former)
23:50:59 × justache quits (~justache@unaffiliated/justache) (Ping timeout: 260 seconds)
23:50:59 <dolio> Yeah, but it's a pair of continuataions that does arbitrary computation in each case.
23:51:12 <ski> as opposed to ?
23:51:21 <dolio> Whereas par has continuations that are well-founded trees.
23:51:44 <dolio> At least, those are teh values.
23:51:48 <ski> how do you mean ?
23:51:55 <dolio> That 'case' is a continuation value for +.
23:52:01 <ski> yes
23:53:39 × albert_91 quits (~Albert@p200300e5ff0b5b4248a33bded2872db1.dip0.t-ipconnect.de) (Ping timeout: 272 seconds)
23:53:46 <dolio> Well, it's not quite true once you get into all the polarity shifting. But if you work in the system without any shifts, then par is only applicable to hereditarily by-name codata types, and those have continuation values that are well-founded trees, just like data types have term values that are well-founded trees.
23:53:59 thir joins (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de)
23:54:21 <ski> hm, ok
23:54:56 <dolio> Codata covalues are the tree of all the projections, data values are the tree of all the constructors.
23:55:27 machinedgod joins (~machinedg@24.105.81.50)
23:55:58 <dolio> And you're only allowed to substitute (co)values for variables.
23:56:07 conal joins (~conal@64.71.133.70)
23:58:25 × thir quits (~thir@p200300f27f0fc60038c1b16891cbfa03.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
23:59:36 <ski> (loking at the typing rules in the paper now .. i think i was thinking of another right rule for `par')

All times are in UTC on 2020-10-05.