2021/12/26

2021-12-26 00:00:45 +0100 <otherwise> :) certainly is a little awkward getting the hang of this type of notation at first. So this little triumph is motivating.
2021-12-26 00:01:19 +0100Feuermagier(~Feuermagi@user/feuermagier)
2021-12-26 00:02:19 +0100 <lechner> Hi, Hackage has no documentation for aeson-schema. Can I find it anywhere else? Thanks!
2021-12-26 00:03:37 +0100aaron(~user@93.48.228.52)
2021-12-26 00:04:19 +0100juri_(~juri@178.63.35.222) (Ping timeout: 268 seconds)
2021-12-26 00:04:32 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-26 00:04:50 +0100KvL(~KvL@45.248.78.202)
2021-12-26 00:04:50 +0100KvL(~KvL@45.248.78.202) (Client Quit)
2021-12-26 00:05:29 +0100KvL(~KvL@45.248.78.202)
2021-12-26 00:05:35 +0100 <aaron> hi, does anyone know what happened to the learnyouahaskell.com site?
2021-12-26 00:06:46 +0100vysn(~vysn@user/vysn)
2021-12-26 00:08:12 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 276 seconds)
2021-12-26 00:08:22 +0100ProfSimm(~ProfSimm@87.227.196.109) (Remote host closed the connection)
2021-12-26 00:08:39 +0100 <aaron> I would like to purchase the book, but noticed that the only edition is from 2011
2021-12-26 00:09:23 +0100 <aaron> so I was hoping to visit the website to see if there have been substantial changes online compared to the printed edition
2021-12-26 00:09:54 +0100acidjnk(~acidjnk@p200300d0c7271e268c494fdd7858bb85.dip0.t-ipconnect.de)
2021-12-26 00:10:45 +0100 <BrokenClutch> lechner: I think that the whole lib is outdated, but i'm not sure
2021-12-26 00:11:06 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2021-12-26 00:12:15 +0100 <BrokenClutch> lechner: I was wrong, but I can't find the documentation too
2021-12-26 00:12:28 +0100 <otherwise> aaron: Are you wanting to buy the book to support the author or because you prefer to have physical copy?
2021-12-26 00:13:43 +0100 <aaron> well, I surely would like to support the author, but to be honest my main reason is having a printed copy from which to study
2021-12-26 00:14:15 +0100 <BrokenClutch> lechner: I think I've found it, https://hackage.haskell.org/package/aeson-schema-0.2.0.0/docs/Data-Aeson-Schema.html
2021-12-26 00:14:41 +0100 <lechner> BrokenClutch: i think that one is outdated
2021-12-26 00:14:52 +0100 <geekosaur> very
2021-12-26 00:14:57 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 240 seconds)
2021-12-26 00:15:00 +0100 <BrokenClutch> lechner: But it's the only one I think
2021-12-26 00:15:14 +0100 <BrokenClutch> 0.4
2021-12-26 00:15:20 +0100 <geekosaur> I note the latest version has a build conflict on template-haskell according to its build log
2021-12-26 00:15:30 +0100 <BrokenClutch> https://hackage.haskell.org/package/aeson-schema-0.4.0.0/docs/Data-Aeson-Schema.html
2021-12-26 00:15:39 +0100 <lechner> thanks!
2021-12-26 00:15:40 +0100 <BrokenClutch> that one is the newest
2021-12-26 00:15:43 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
2021-12-26 00:15:50 +0100 <BrokenClutch> but isn't the newest version
2021-12-26 00:16:23 +0100 <otherwise> in my opinion (I'm a beginner going through learn you a haskell right now, by the way), learn you a haskell is not to be used as "the one and only resource for learning haskell"
2021-12-26 00:16:26 +0100 <BrokenClutch> but it has the same little number, dunno, me dumb
2021-12-26 00:16:45 +0100Lycurgus(~juan@98.4.112.204)
2021-12-26 00:17:26 +0100 <otherwise> point being, the printed version would be very useful even if it is not as updated as the website (I don't have the answer to whether it is), and regardless of whether using the printed or online version, you will probably be supplementing with other resources.
2021-12-26 00:17:55 +0100 <BrokenClutch> lenchner: https://hackage.haskell.org/package/aeson-schema-0.4.1.2/docs/Data-Aeson-Schema.html, Now I've verified, that's the most att one
2021-12-26 00:17:55 +0100 <Lycurgus> aaron, apparently the author decided that your buying the last available print editions is what e wants
2021-12-26 00:18:04 +0100 <Lycurgus> e still owns the domain
2021-12-26 00:18:33 +0100 <Lycurgus> the title in question has to some extent jaded the intended audience
2021-12-26 00:18:51 +0100 <aaron> ok, thank you very much for your answers
2021-12-26 00:18:55 +0100 <lechner> how long has it been down?
2021-12-26 00:19:58 +0100Lycurgushas no idea
2021-12-26 00:20:37 +0100Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
2021-12-26 00:20:46 +0100 <Lycurgus> i sense a has moved on from haskell situation
2021-12-26 00:21:25 +0100 <aaron> I just noticed this evening
2021-12-26 00:21:48 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-12-26 00:21:51 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 276 seconds)
2021-12-26 00:21:55 +0100 <lechner> maybe unattended updates broke the site?
2021-12-26 00:22:35 +0100 <Lycurgus> don't think so
2021-12-26 00:22:36 +0100 <geekosaur> it's a domain failure
2021-12-26 00:22:42 +0100 <Lycurgus> the domain's not routing
2021-12-26 00:22:43 +0100 <aaron> I was worried that I might purchase the book and then the site gets update with the second edition, ahah
2021-12-26 00:22:45 +0100 <geekosaur> nxdomain = domain gone
2021-12-26 00:22:51 +0100 <acode> It was up yesterday, I was reading it
2021-12-26 00:23:01 +0100 <aaron> ok, awesome news
2021-12-26 00:23:06 +0100 <Lycurgus> ah, a fact!
2021-12-26 00:23:07 +0100 <hpc> use archive.org
2021-12-26 00:23:19 +0100 <geekosaur> hm, so did they just let the domain expire?
2021-12-26 00:23:55 +0100 <geekosaur> or is this a DNS configuration issue that might get fixed sometime next week (or next year if the folks responsible take the entire holiday period off)
2021-12-26 00:23:59 +0100 <hpc> it expires in august of next year
2021-12-26 00:24:02 +0100 <Lycurgus> i.e. as distinct from an after-the
2021-12-26 00:24:09 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2021-12-26 00:24:25 +0100 <Lycurgus> with the new fact
2021-12-26 00:24:44 +0100 <hpc> it's a temporary error, hopefully
2021-12-26 00:24:53 +0100 <hpc> in my dig it's not nxdomain, it's servfail
2021-12-26 00:24:55 +0100 <Lycurgus> the surmise is he just let the name expiry or such lapse and will restore presently
2021-12-26 00:24:59 +0100Bartol(~Bartol@user/Bartol) (Ping timeout: 256 seconds)
2021-12-26 00:25:01 +0100 <Lycurgus> 30% confidence
2021-12-26 00:25:24 +0100 <geekosaur> nxdomain is what chrome gave me here
2021-12-26 00:25:30 +0100 <Lycurgus> 70% moved on from hs
2021-12-26 00:25:34 +0100 <hpc> chrome doesn't know how to error correctly
2021-12-26 00:25:36 +0100 <BrokenClutch> probably a conspiracy, the schemers are behind this!
2021-12-26 00:25:50 +0100 <acode> In the meantime I checked archive.org as suggested above and there seems to be a full copy of the website there
2021-12-26 00:25:54 +0100 <int-e> the domain hasn't expired, but the listed nameservers don't know about it
2021-12-26 00:25:59 +0100 <geekosaur> interestingly dig also gives servfail
2021-12-26 00:26:20 +0100 <lechner> DNS does not resolve via Google's public DNS. it could be an error implementing DNSSEC
2021-12-26 00:26:26 +0100 <Lycurgus> right that's how I knew he still owned it and yeah that means it can't be name expiry
2021-12-26 00:26:48 +0100 <aaron> awesome, trying to use archive.org as suggested by hpc
2021-12-26 00:26:56 +0100 <aaron> in the meanwhile
2021-12-26 00:27:43 +0100 <Lycurgus> updates to it are utterly a non issue, should think that was clear by no
2021-12-26 00:27:45 +0100 <Lycurgus> w
2021-12-26 00:27:47 +0100 <BrokenClutch> I still think it's a conspiracy, a l33t hack3r 4tt4ck
2021-12-26 00:28:35 +0100 <Lycurgus> so we now have
2021-12-26 00:29:10 +0100 <Lycurgus> 20% hosting ignored and might come back soon
2021-12-26 00:29:26 +0100 <Lycurgus> 80% hs fatigue
2021-12-26 00:29:58 +0100 <int-e> So... the hosting provider says... "You have requested a site that is currently offline. This generally happens when a site is temporarily disabled for some reason, but has not been permanently removed."
2021-12-26 00:30:01 +0100 <geekosaur> servfail is unlikely to be hs fatigue, more likely to be dns misconfiguration
2021-12-26 00:30:30 +0100__monty__(~toonn@user/toonn) (Quit: leaving)
2021-12-26 00:30:36 +0100 <int-e> (That's after putting 208.94.116.26 learnyouahaskell.com into my /etc/hosts)
2021-12-26 00:30:47 +0100 <Lycurgus> it coming back quickly would support dns misconfig
2021-12-26 00:31:25 +0100 <int-e> so it seems deliberate, no clue what's going on
2021-12-26 00:31:55 +0100 <geekosaur> servfail seems an odd way to do that though
2021-12-26 00:32:10 +0100 <lechner> yeah, a link to amazon would be better
2021-12-26 00:32:59 +0100 <geekosaur> a link to that "offline" page would be better. or a straight up failure to resolve as opposed to a servfail
2021-12-26 00:33:22 +0100 <lechner> maybe the author is busy with a major public holiday
2021-12-26 00:33:32 +0100LycurgusAWS hosting would be a salient fact but defocusing this stream
2021-12-26 00:33:39 +0100Lycurgus(~juan@98.4.112.204) (Quit: Exeunt)
2021-12-26 00:33:48 +0100 <int-e> "deliberate" -- on part of the hosting provider (nearlyfreespeech.net), not the site author...
2021-12-26 00:36:11 +0100 <int-e> geekosaur: and yeah, it is weird to just drop the DNS entry like that
2021-12-26 00:36:38 +0100 <geekosaur> dropping the entry would not be that weird. servfail-ing it is
2021-12-26 00:37:17 +0100 <geekosaur> nxdomain vs. servfail
2021-12-26 00:37:23 +0100 <otherwise> uhh, i just refreshed my learn you a haskell page (which was working yesterday) and now it cant be reached... only archive.org as you all say
2021-12-26 00:39:52 +0100 <otherwise> aaron, also try your online collection of e-books from your local library. Mine has access to "Get Programming In Haskell" by Will Kurt, which is probably a better resource anyway, albeit less whimsical...
2021-12-26 00:40:19 +0100 <BrokenClutch> wait, is pastebin not working too?
2021-12-26 00:40:42 +0100 <lechner> alien invasion!
2021-12-26 00:40:54 +0100 <geekosaur> which pastebin?
2021-12-26 00:41:05 +0100 <geekosaur> paste.tomsmeding.com works here
2021-12-26 00:41:24 +0100 <int-e> FWIW: https://int-e.eu/~bf3/tmp/lyah-offline.png ...of course if this is a case of server maintenance gone wrong then this may be a fluke too.
2021-12-26 00:41:37 +0100 <BrokenClutch> pastebin.com
2021-12-26 00:42:08 +0100 <acode> pastebin.com is working for me
2021-12-26 00:42:17 +0100 <geekosaur> consider that a request to not use it :)
2021-12-26 00:42:39 +0100 <BrokenClutch> wait, my ISP blocked pastebin. WHY?
2021-12-26 00:42:54 +0100geekosaurhas abrowser add-on to force the raw site because ye gods, but that also disables e.g. line numbers
2021-12-26 00:43:30 +0100 <BrokenClutch> geekosaur: What's the problem with pastebin.com ?
2021-12-26 00:43:51 +0100 <geekosaur> pastebins are often blocked by content-based blockers because they're often used for sharing stolen passwords and the like
2021-12-26 00:44:07 +0100 <geekosaur> it's ugly, it's full of ads, its haskell markup is eye-bleeding
2021-12-26 00:44:34 +0100 <BrokenClutch> But, but, I wanted to use it :(
2021-12-26 00:44:46 +0100 <hpc> use the link in the topic instead
2021-12-26 00:45:03 +0100 <lechner> for GP, dpaste.org is nice
2021-12-26 00:46:05 +0100 <lechner> never mind: "dpaste is going to be terminated as of January 1, 2022."
2021-12-26 00:47:01 +0100Jing(~hedgehog@2604:a840:3::1061) (Remote host closed the connection)
2021-12-26 00:47:39 +0100Jing(~hedgehog@2604:a840:3::1061)
2021-12-26 00:48:02 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 240 seconds)
2021-12-26 00:51:29 +0100 <sm> I don't know why anyone would use pastebin . com except for the mnemonic url
2021-12-26 00:53:10 +0100 <sm> guess I answered my own question
2021-12-26 00:53:34 +0100 <aaron> otherwise thanks very much for your advice on "Get Programming In Haskell"
2021-12-26 00:54:02 +0100Erutuon(~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
2021-12-26 00:54:06 +0100 <aaron> am looking in to it (amazon preview)
2021-12-26 00:55:57 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net)
2021-12-26 00:57:21 +0100Pickchea(~private@user/pickchea) (Ping timeout: 268 seconds)
2021-12-26 00:57:21 +0100 <lechner> there are many options. fwiw, i like this one: http://dev.stephendiehl.com/hask/
2021-12-26 00:58:20 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net)
2021-12-26 00:58:48 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net) (Client Quit)
2021-12-26 00:58:48 +0100 <geekosaur> bpa.st is still around
2021-12-26 00:59:24 +0100 <geekosaur> new url but still around (bpaste.net redirects to it)
2021-12-26 01:00:16 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
2021-12-26 01:00:17 +0100Megant(megant@user/megant) (Ping timeout: 240 seconds)
2021-12-26 01:01:56 +0100 <lechner> aaron: the LYAH book is also available on archive.org (for free) https://archive.org/search.php?query=learn%20you%20a%20haskell
2021-12-26 01:01:58 +0100 <aaron> lechner thank you, I had stumbled on stephendiehl's site but will certainly take your advice on that page
2021-12-26 01:02:22 +0100Megant(megant@user/megant)
2021-12-26 01:03:47 +0100 <aaron> lechner: awesome, thank you for the link, I was having difficulty using archive.org
2021-12-26 01:04:43 +0100 <lechner> aaron: there are two search boxes. this is for the open-access public library
2021-12-26 01:05:53 +0100juri_(~juri@178.63.35.222)
2021-12-26 01:06:00 +0100tito(tito@tilde.team) (Quit: WeeChat 3.3)
2021-12-26 01:07:15 +0100 <aaron> I must say, I am busy checking out the book otherwise pointed out (Get Programming In Haskell) and it seems quite nice
2021-12-26 01:08:02 +0100 <aaron> I find it strange that I didn't notice it while searching for good books to start with
2021-12-26 01:09:41 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 268 seconds)
2021-12-26 01:10:32 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:8415:925f:506a:a363) (Remote host closed the connection)
2021-12-26 01:10:40 +0100acode(~acode@151.65.31.181) (Quit: Client closed)
2021-12-26 01:10:57 +0100vysn(~vysn@user/vysn) (Ping timeout: 240 seconds)
2021-12-26 01:13:52 +0100 <lechner> good price, too. two for one for $18, from the author!
2021-12-26 01:14:32 +0100 <otherwise> I found this pdf for learn you a haskell:
2021-12-26 01:14:33 +0100 <otherwise> http://barbra-coco.dyndns.org/yuri/functinal_programming/Learn%20You%20a%20Haskell%20for%20Great%2…
2021-12-26 01:15:29 +0100 <otherwise> it seems the most up to date (other versions I found online had "Higher Order Functions" as chapter 5, whereas the original website had that as chapter 6 (as in the link I just provided"
2021-12-26 01:16:01 +0100 <aaron> awesome, thank you!
2021-12-26 01:17:14 +0100 <otherwise> :) glad you found interest in "get programming in haskell"
2021-12-26 01:17:23 +0100Guest85(~Guest85@2a00:23c7:908b:e100:5eea:1dff:fe7c:1ffd)
2021-12-26 01:18:57 +0100shailangsa(~shailangs@host109-159-108-207.range109-159.btcentralplus.com) (Ping timeout: 240 seconds)
2021-12-26 01:20:47 +0100 <otherwise> since we are on the topic, author of LYAH explicitly states they recommend "Real World Haskell" for a more in depth look at learning Haskell. I haven't cracked that book open, but I figure if I like LYAH, and the author recommends it, it must be pretty good. Not to overwhelm you with resources.
2021-12-26 01:20:53 +0100timCF(~timCF@m91-129-100-224.cust.tele2.ee)
2021-12-26 01:21:53 +0100Techcable(~Techcable@168.235.93.147)
2021-12-26 01:22:31 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:8415:925f:506a:a363)
2021-12-26 01:22:47 +0100 <hpc> alternatively, to overwhelm you with resources, https://www.haskell.org/documentation/ :D
2021-12-26 01:25:30 +0100 <aaron> awesome, checking it out, it has all the titles you mentioned... neat
2021-12-26 01:25:51 +0100 <otherwise> hpc HAHA also: https://www.haskell.org/onlinereport/haskell2010/
2021-12-26 01:26:45 +0100 <geekosaur> some of us still like https://www.haskell.org/tutorial/
2021-12-26 01:27:11 +0100 <aaron> I was a bit worried about "Real World Haskell" being a bit old... 2008
2021-12-26 01:28:31 +0100 <otherwise> aww, yeah get programming in haskell is 2018
2021-12-26 01:28:35 +0100 <geekosaur> it's old and was dated pretty much on publication because the exception system was overhauled at that point.l but the online version has been updated
2021-12-26 01:29:35 +0100benin(~benin@183.82.27.57) (Ping timeout: 256 seconds)
2021-12-26 01:29:53 +0100 <BrokenClutch> https://paste.tomsmeding.com/yvZmn4UT .Is this good haskell?
2021-12-26 01:30:02 +0100unyu(~pyon@user/pyon) (Ping timeout: 268 seconds)
2021-12-26 01:31:02 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net)
2021-12-26 01:31:36 +0100 <lyxia> licking buttons sounds a bit unhygienic :)
2021-12-26 01:31:41 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net) (Client Quit)
2021-12-26 01:32:37 +0100 <aaron> hpc seems cool, but not what I'm looking for for now (supplement to Haskell Report...)
2021-12-26 01:33:53 +0100 <lyxia> BrokenClutch: it doesn't look too bad but I'm not sure the writer monad really pulls its weight, as opposed to simply using pairs.
2021-12-26 01:34:33 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net)
2021-12-26 01:34:36 +0100benin(~benin@183.82.27.57)
2021-12-26 01:34:37 +0100 <BrokenClutch> lyxia: I'm testing stuff, but you're right, it's a bit heavy
2021-12-26 01:35:27 +0100 <hpc> aaron: ah, if you're just looking for big reference materials the ghc manual is probably your ideal next read
2021-12-26 01:35:30 +0100 <BrokenClutch> lyxia: Licking buttons is a form of building immunity to diseases
2021-12-26 01:35:34 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net) (Client Quit)
2021-12-26 01:36:11 +0100 <lyxia> Ok but don't push it.
2021-12-26 01:37:08 +0100 <BrokenClutch> lyxia: The button? Ok, I'm going to stop with the "jokes"
2021-12-26 01:37:11 +0100 <int-e> @src tell
2021-12-26 01:37:11 +0100 <lambdabot> Source not found. Are you on drugs?
2021-12-26 01:37:23 +0100 <otherwise> > "tongue" /= "finger"
2021-12-26 01:37:25 +0100 <lambdabot> True
2021-12-26 01:37:57 +0100KvL(~KvL@45.248.78.202) (Ping timeout: 240 seconds)
2021-12-26 01:38:11 +0100 <aaron> hpc: actually I'm trying to start understanding the language and become comfortable enough to approach small projects
2021-12-26 01:38:44 +0100aplainzetakind(~johndoe@captainludd.powered.by.lunarbnc.net)
2021-12-26 01:40:44 +0100 <int-e> :t not <$> ?hw <* tell ["Licked"]
2021-12-26 01:40:45 +0100 <lambdabot> (?hw::f Bool, MonadWriter [[Char]] f) => f Bool
2021-12-26 01:41:38 +0100 <int-e> (well, the `not` would be for the `Pressed` case, but whatever)
2021-12-26 01:42:50 +0100KvL(~KvL@124.188.202.131)
2021-12-26 01:42:52 +0100 <int-e> BrokenClutch: ^^But I would definitely use `tell`
2021-12-26 01:43:15 +0100Guest85(~Guest85@2a00:23c7:908b:e100:5eea:1dff:fe7c:1ffd) (Quit: Client closed)
2021-12-26 01:44:45 +0100falafel(~falafel@cpe-76-168-195-162.socal.res.rr.com)
2021-12-26 01:45:15 +0100 <BrokenClutch> int-e: tell is actually pretty readable, thanks
2021-12-26 01:47:40 +0100 <BrokenClutch> I tried with "censor" too
2021-12-26 01:49:09 +0100falafel(~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 268 seconds)
2021-12-26 01:51:10 +0100 <sm> @where books
2021-12-26 01:51:10 +0100 <lambdabot> https://www.extrema.is/articles/haskell-books, see also @where LYAH, RWH, YAHT, SOE, HR, PIH, TFwH, wikibook, PCPH, HPFFP, HTAC, TwT, FoP, PFAD, WYAH, non-haskell-books
2021-12-26 01:51:48 +0100 <int-e> BrokenClutch: I guess `censor` works, but the intended use of this is different... say: `censor (filter (/= Licked)) act` to get the actions of `act` without the icky licks (assuming you derive Eq for that type)
2021-12-26 01:53:23 +0100KvL(~KvL@124.188.202.131) (Ping timeout: 256 seconds)
2021-12-26 01:53:44 +0100drewr(~drew@user/drewr)
2021-12-26 01:54:28 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 01:54:43 +0100 <BrokenClutch> int-e: I see, thanks
2021-12-26 01:55:15 +0100 <otherwise> sm Cool! :)
2021-12-26 01:55:17 +0100KvL(~KvL@37.120.213.100)
2021-12-26 01:55:42 +0100 <otherwise> @ where RWH
2021-12-26 01:55:51 +0100 <otherwise> :(
2021-12-26 01:55:56 +0100 <otherwise> @where RWH
2021-12-26 01:55:56 +0100 <lambdabot> http://www.realworldhaskell.org/blog/ http://book.realworldhaskell.org/read/
2021-12-26 01:57:06 +0100SummerSonw(~The_viole@203.77.49.232)
2021-12-26 01:57:54 +0100 <aaron> ok, I think I've made up my mind to start off :)
2021-12-26 01:58:35 +0100 <aaron> I'll go with "Get Programming In Haskell" by Will Kurt
2021-12-26 01:58:41 +0100 <aaron> thanks otherwise
2021-12-26 01:59:03 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
2021-12-26 01:59:18 +0100johnw(~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Quit: ZNC - http://znc.in)
2021-12-26 01:59:19 +0100shailangsa(~shailangs@host109-159-108-207.range109-159.btcentralplus.com)
2021-12-26 01:59:21 +0100 <otherwise> know of any interactive online books for haskell? with some built in compiler similar to https://eloquentjavascript.net/03_functions.html ?
2021-12-26 01:59:30 +0100 <aaron> I found a leaked version... and got to skim through the pages and has many points of interest (for my experience with the language)
2021-12-26 02:00:37 +0100 <int-e> BrokenClutch: oh and did you know that you can do pattern matching in the left-hand sides of function definitions? press (Button hw) = Button $ ... hw ...
2021-12-26 02:01:09 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 02:01:34 +0100 <aaron> I'm guessing the author is quite talented at what he does given that I found little information linking him to haskell as his main subject matter
2021-12-26 02:03:03 +0100drewr(~drew@user/drewr) (Quit: ERC (IRC client for Emacs 27.2))
2021-12-26 02:03:53 +0100 <aaron> otherwise thanks once again! And thanks to everyone else for the kind support
2021-12-26 02:04:04 +0100drewr(~drew@user/drewr)
2021-12-26 02:04:18 +0100 <aaron> good night, will certanily pass by some other time :)
2021-12-26 02:04:41 +0100 <geekosaur> otherwise, the tech for haskell exists but afaik nobody has hooked it together that way yet
2021-12-26 02:04:51 +0100unyu(~pyon@user/pyon)
2021-12-26 02:05:08 +0100 <aaron> exit
2021-12-26 02:05:09 +0100Pickchea(~private@user/pickchea)
2021-12-26 02:05:16 +0100 <otherwise> aaron Cool! seems like a good choice. hmm, interesting point about Will Kurt being semingly new
2021-12-26 02:05:26 +0100 <otherwise> to haskell
2021-12-26 02:05:38 +0100 <otherwise> best of luck! :
2021-12-26 02:05:40 +0100 <otherwise> :)
2021-12-26 02:05:50 +0100 <aaron> thank you!
2021-12-26 02:06:08 +0100aaron(~user@93.48.228.52) (Quit: ERC 5.4.1 (IRC client for GNU Emacs 27.2))
2021-12-26 02:06:57 +0100coolnickname(uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
2021-12-26 02:07:38 +0100bitmapper(uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-26 02:10:23 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
2021-12-26 02:13:12 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-12-26 02:14:57 +0100drewr(~drew@user/drewr) (Ping timeout: 240 seconds)
2021-12-26 02:16:11 +0100acidjnk(~acidjnk@p200300d0c7271e268c494fdd7858bb85.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
2021-12-26 02:17:26 +0100Everything(~Everythin@37.115.210.35) (Quit: leaving)
2021-12-26 02:17:27 +0100drewr(~drew@user/drewr)
2021-12-26 02:17:37 +0100KvL(~KvL@37.120.213.100) (Ping timeout: 240 seconds)
2021-12-26 02:20:00 +0100KvL(~KvL@185.9.18.165)
2021-12-26 02:20:36 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 268 seconds)
2021-12-26 02:21:58 +0100drewr(~drew@user/drewr) (Ping timeout: 260 seconds)
2021-12-26 02:22:02 +0100drewr`(~drew@2605:a601:a3a9:5000:fd81:b1e0:1738:6be1)
2021-12-26 02:22:32 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-12-26 02:22:39 +0100 <otherwise> geekosaur interesting... haskell.org seems to have implemented this basic idea in their home page tutorial, but it very limited in scope, compared to a fully fleshed out textbook. Actually, what haskell.org did is a little more interesting (albeit more linear)
2021-12-26 02:23:24 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
2021-12-26 02:23:25 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 02:23:55 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: closed)
2021-12-26 02:24:07 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 02:24:17 +0100 <otherwise> I'm imagining a sort of "choose your adventure" style interactive textbook, that is in the form of the haskell.org homepage tutorial... perhaps with Role Playing Game elements...
2021-12-26 02:25:22 +0100 <otherwise> sort of like https://simulator.dev/ but different... I'm just riffing here
2021-12-26 02:26:48 +0100drewr`(~drew@2605:a601:a3a9:5000:fd81:b1e0:1738:6be1) (Client Quit)
2021-12-26 02:27:56 +0100drewr(~drew@user/drewr)
2021-12-26 02:28:01 +0100 <dsal> Might be fun for learning targeted concepts.
2021-12-26 02:28:44 +0100 <dsal> I've been truing to use this plated zipper thing and so far it's like, not made my job easier. Either because it's not actually better for what I'm doing or I don't know how to do it properly. It'd be nice to have some confidence that at least I'm going in the right direction. :)
2021-12-26 02:29:22 +0100 <Rembane> Plated zipper sounds very fancy. What problem are you trying to solve?
2021-12-26 02:31:55 +0100 <dsal> Day 18 of this year's AoC
2021-12-26 02:32:36 +0100 <dsal> I built a data structure that's like `data Pair a = Lit a | Pair (Pair a) (Pair a)` -- something like that.
2021-12-26 02:33:31 +0100 <Rembane> That one melted my brain, so this is gonna be fun. :)
2021-12-26 02:33:33 +0100CiaoSen(~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
2021-12-26 02:33:35 +0100 <dsal> I solved it by doing a `number = flip evalState 0 . traverse (\x -> (,x) <$> (id <+= 1))` and then doing some stuff with indexes and junk.
2021-12-26 02:34:00 +0100 <dsal> It's fine… but I'm trying to see if I can do better with a zipper. My mental model of what a zipper would do for me and what it actually does don't quite match.
2021-12-26 02:34:36 +0100 <Rembane> I don't know much of the problem nor of zippers, so I'm gonna go socratic here. What's your mental model?
2021-12-26 02:34:51 +0100Tuplanolla(~Tuplanoll@91-159-69-236.elisa-laajakaista.fi) (Quit: Leaving.)
2021-12-26 02:34:52 +0100 <Rembane> ...and what does the zipper do?
2021-12-26 02:35:30 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2021-12-26 02:35:53 +0100 <dsal> I was hoping the zipper would give me a way to walk through the values in a "flat" sort of way, like traverse does.
2021-12-26 02:36:14 +0100 <EvanR> zippers are good for coming back
2021-12-26 02:36:26 +0100 <dsal> The zipper lets me maneuver about the structure and from any position replace part of the structure, but I still have to do extra work to go back whence I came.
2021-12-26 02:36:37 +0100 <EvanR> so only if you can undo in the adventure
2021-12-26 02:37:38 +0100 <EvanR> dsal, I did that one without a zipper and without numbering anything
2021-12-26 02:38:01 +0100 <EvanR> but ymmv
2021-12-26 02:38:10 +0100 <dsal> Neat. How did you go about it?
2021-12-26 02:38:27 +0100 <dsal> Renumbering was pretty easy. The zipper makes the modification kind of easy, but not all of the modifications.
2021-12-26 02:38:27 +0100 <EvanR> which part
2021-12-26 02:38:37 +0100 <dsal> expand, in particular.
2021-12-26 02:38:43 +0100 <dsal> er, explode
2021-12-26 02:38:52 +0100lavaman(~lavaman@98.38.249.169)
2021-12-26 02:39:42 +0100 <dsal> I used State on both explode and split. Seems a bit unnecessary.
2021-12-26 02:39:48 +0100harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67) (Quit: Leaving)
2021-12-26 02:39:57 +0100dcoutts_(~duncan@71.78.6.51.dyn.plus.net) (Ping timeout: 240 seconds)
2021-12-26 02:40:26 +0100 <EvanR> the main data type Snail represents their trees as described in the puzzle
2021-12-26 02:41:10 +0100 <EvanR> to explode, I used a second data type called Exploding which wraps a Snail with one of 5 kinds of additional "state" data
2021-12-26 02:41:27 +0100 <EvanR> to describe what's going on in the process of trying to explode it
2021-12-26 02:41:57 +0100 <dsal> Ah, neat. My `a` might allow for such a thing.
2021-12-26 02:41:59 +0100 <EvanR> that data is used for wrapping an exploding snail again
2021-12-26 02:42:26 +0100 <dsal> That's kind of how I used it. I guess my Exploding is just a tuple, though.
2021-12-26 02:42:51 +0100 <otherwise> > it
2021-12-26 02:42:52 +0100 <lambdabot> error:
2021-12-26 02:42:52 +0100 <lambdabot> • Variable not in scope: it
2021-12-26 02:42:52 +0100 <lambdabot> • Perhaps you meant one of these:
2021-12-26 02:42:55 +0100 <EvanR> yeah you can implement sum types as a tuple where one of the components is a tag heh
2021-12-26 02:42:57 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-26 02:43:23 +0100 <EvanR> since there's always 1 Snail in any case, I could have factored it that way
2021-12-26 02:43:30 +0100 <dsal> I mean, my Exploding equivalent is the ((leftIndex, x), (rightIndex, y))
2021-12-26 02:43:33 +0100 <EvanR> paired the 5 case type with a snail
2021-12-26 02:43:33 +0100 <geekosaur> % it
2021-12-26 02:43:34 +0100 <yahb> geekosaur: True
2021-12-26 02:43:39 +0100 <dsal> it's true!
2021-12-26 02:43:52 +0100 <geekosaur> otherwise, lambdabot is not ghci and does not have an "it" binding. yahb is.
2021-12-26 02:44:17 +0100 <EvanR> my 5 cases are ExplodingLeft, ExplodingRight, ExplodingBoth, Exploded, and NotExploding
2021-12-26 02:44:36 +0100 <dsal> Doesn't sound like you used SafeHaskell
2021-12-26 02:45:47 +0100 <otherwise> What is it? in ghci I typed (while having :set +t active) and it returns True it :: Bool. but :def it or :doc it. gives nothing...
2021-12-26 02:45:56 +0100 <EvanR> the naturally recursive process of exploding all the child nodes can be curtailed by look at this data, and only exploding the chosen child
2021-12-26 02:46:16 +0100 <otherwise> oops: ...I typed 'a':[] == ['a']
2021-12-26 02:46:21 +0100 <dsal> otherwise: it is what it is
2021-12-26 02:46:33 +0100 <geekosaur> https://downloads.haskell.org/ghc/latest/docs/html/users_guide/ghci.html#the-it-variable
2021-12-26 02:46:37 +0100 <dsal> (the last thing you evaluate in ghci gets bound to `it`)
2021-12-26 02:47:17 +0100 <geekosaur> also note that :doc is incompletley implemented at present so doesn't show a lot of what it could potentially show
2021-12-26 02:47:24 +0100 <otherwise> oh, its like 'ans' in MATLAB, or even a graphing calculator for that matter.
2021-12-26 02:49:07 +0100Matheo_bis(~matheo@user/matheo-bis/x-4309430)
2021-12-26 02:51:26 +0100 <dsal> Man, I should really learn this guard syntax instead of just trying wacky things and being surprised when they work.
2021-12-26 02:52:03 +0100Matheo_bis(~matheo@user/matheo-bis/x-4309430) (Client Quit)
2021-12-26 02:52:45 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 250 seconds)
2021-12-26 02:52:53 +0100KvL(~KvL@185.9.18.165) (Ping timeout: 256 seconds)
2021-12-26 02:54:49 +0100KvL(~KvL@124.188.202.131)
2021-12-26 02:58:17 +0100drewr(~drew@user/drewr) (Ping timeout: 240 seconds)
2021-12-26 02:58:53 +0100azimut(~azimut@gateway/tor-sasl/azimut)
2021-12-26 03:01:23 +0100KvL(~KvL@124.188.202.131) (Ping timeout: 256 seconds)
2021-12-26 03:02:49 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
2021-12-26 03:02:49 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 03:03:16 +0100KvL(~KvL@195.216.219.57)
2021-12-26 03:03:19 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: closed)
2021-12-26 03:03:26 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 03:06:28 +0100 <BrokenClutch> int-e: I was changing the record all the time, that's why I didn't use pattern matching
2021-12-26 03:07:13 +0100 <BrokenClutch> Probably will write some more code, the doc is a little bit difficult to understand (sometimes)
2021-12-26 03:13:56 +0100 <EvanR> you can pattern match on a record using fields, it is more tolerant of changing the record type
2021-12-26 03:15:38 +0100drewr(~drew@user/drewr)
2021-12-26 03:20:39 +0100neceve(~quassel@2.26.93.228) (Ping timeout: 256 seconds)
2021-12-26 03:21:20 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
2021-12-26 03:22:02 +0100rekahsoft(~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com)
2021-12-26 03:23:28 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
2021-12-26 03:23:53 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
2021-12-26 03:26:36 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 268 seconds)
2021-12-26 03:27:43 +0100 <dsal> BrokenClutch: why is there a return () at the end?
2021-12-26 03:27:50 +0100 <dsal> :t print
2021-12-26 03:27:51 +0100 <lambdabot> Show a => a -> IO ()
2021-12-26 03:28:30 +0100 <dsal> (return doesn't go what most people expect and should probably generally be avoided)
2021-12-26 03:29:34 +0100 <dsal> I don't think I've ever used Writer. I must have a couple times. It doesn't seem very useful in general.
2021-12-26 03:30:03 +0100burakcank(~burakcank@has.arrived.and.is.ready-to.party) (Quit: fBNC - https://bnc4free.com)
2021-12-26 03:30:17 +0100drewr(~drew@user/drewr) (Ping timeout: 240 seconds)
2021-12-26 03:30:34 +0100burakcank(~burakcank@has.arrived.and.is.ready-to.party)
2021-12-26 03:31:54 +0100drewr(~drew@user/drewr)
2021-12-26 03:34:26 +0100lavaman(~lavaman@98.38.249.169)
2021-12-26 03:34:37 +0100neurocyte0132889(~neurocyte@user/neurocyte) (Ping timeout: 240 seconds)
2021-12-26 03:38:17 +0100zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2021-12-26 03:38:36 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
2021-12-26 03:40:20 +0100drewr(~drew@user/drewr) (Quit: ERC (IRC client for Emacs 27.2))
2021-12-26 03:40:54 +0100drewr(~drew@user/drewr)
2021-12-26 03:42:00 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2021-12-26 03:42:57 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 240 seconds)
2021-12-26 03:43:27 +0100 <BrokenClutch> dsal: I was testing stuff. The return () is for sanity
2021-12-26 03:48:18 +0100 <dsal> I don't think it helps with sanity. It's a very confusing function. :)
2021-12-26 03:48:23 +0100Pickchea(~private@user/pickchea) (Quit: Leaving)
2021-12-26 03:48:41 +0100 <dsal> > return 1 :: [Int]
2021-12-26 03:48:42 +0100 <lambdabot> [1]
2021-12-26 03:49:44 +0100 <dsal> do { return 3; return 5 } :: [Int]
2021-12-26 03:49:49 +0100 <dsal> > do { return 3; return 5 } :: [Int]
2021-12-26 03:49:51 +0100 <lambdabot> [5]
2021-12-26 03:49:57 +0100xff0x(~xff0x@2001:1a81:534f:cd00:2537:409e:e003:9b4d) (Ping timeout: 240 seconds)
2021-12-26 03:51:58 +0100xff0x(~xff0x@2001:1a81:538d:1a00:8897:3a22:97f4:9e71)
2021-12-26 03:55:35 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
2021-12-26 03:56:05 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 03:56:43 +0100 <BrokenClutch> dsal: I will stop using, it's really strange
2021-12-26 03:58:35 +0100 <xsperry> it is strange if you expect it to act the same way as return statement in imperative languages. alternative is pure, which has exactly the same behavior (and slightly different constraints)
2021-12-26 03:59:12 +0100 <dsal> `pure` is less confusing, but functions always return the last evaluated value, so trying to be explicit about it doesn't help much and might just make things worse.
2021-12-26 03:59:49 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 240 seconds)
2021-12-26 04:00:13 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-12-26 04:00:20 +0100 <dsal> > :t \x y -> return (x + y)
2021-12-26 04:00:21 +0100 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
2021-12-26 04:00:28 +0100 <dsal> > :t (\x y -> return (x + y))
2021-12-26 04:00:29 +0100 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
2021-12-26 04:00:34 +0100 <dsal> :t (\x y -> return (x + y))
2021-12-26 04:00:35 +0100 <dsal> ha
2021-12-26 04:00:35 +0100 <lambdabot> (Monad m, Num a) => a -> a -> m a
2021-12-26 04:02:37 +0100SummerSonw(~The_viole@203.77.49.232) (Ping timeout: 240 seconds)
2021-12-26 04:02:39 +0100 <xsperry> I usually use return in do and pure when working with applicatives, just out of habit. but even if you prefer to use pure everywhere, knowing how return works and what it does is essential for reading other people's code
2021-12-26 04:04:20 +0100conann(~bc8147f2@cerf.good1.com)
2021-12-26 04:04:34 +0100 <dsal> When I see "return" I automatically translate it to "pure." If that fails me someday, someone's being clever.
2021-12-26 04:09:53 +0100dyeplexer(~dyeplexer@user/dyeplexer)
2021-12-26 04:11:52 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
2021-12-26 04:12:25 +0100wh16(~smaris@user/wh16)
2021-12-26 04:15:03 +0100td_(~td@muedsl-82-207-238-172.citykom.de) (Ping timeout: 256 seconds)
2021-12-26 04:16:32 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 268 seconds)
2021-12-26 04:16:52 +0100td_(~td@94.134.91.143)
2021-12-26 04:17:09 +0100Sgeo_(~Sgeo@user/sgeo)
2021-12-26 04:17:14 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2021-12-26 04:17:29 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-12-26 04:17:42 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 04:19:17 +0100Sgeo(~Sgeo@user/sgeo) (Ping timeout: 240 seconds)
2021-12-26 04:19:34 +0100cheater(~Username@user/cheater) (Ping timeout: 260 seconds)
2021-12-26 04:21:55 +0100 <EvanR> dsal, Writer is great, but doesn't really fit intuition of "printf"
2021-12-26 04:22:07 +0100 <EvanR> can't really use it like that
2021-12-26 04:23:12 +0100 <EvanR> if what you want is nicely monoidal, it's good
2021-12-26 04:23:23 +0100 <EvanR> and lazy
2021-12-26 04:24:17 +0100deadmarshal(~deadmarsh@95.38.228.37)
2021-12-26 04:24:39 +0100 <dsal> I'm just not sure when I'd need it other than yeah, logging maybe. State does the thing. Or Tardis.
2021-12-26 04:28:39 +0100deadmarshal(~deadmarsh@95.38.228.37) (Ping timeout: 256 seconds)
2021-12-26 04:30:29 +0100shapr`(~user@pool-100-36-247-68.washdc.fios.verizon.net)
2021-12-26 04:31:47 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 04:31:49 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
2021-12-26 04:34:08 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
2021-12-26 04:34:25 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
2021-12-26 04:34:38 +0100finn_elija(~finn_elij@user/finn-elija/x-0085643)
2021-12-26 04:34:38 +0100FinnElija(~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
2021-12-26 04:34:38 +0100finn_elijaFinnElija
2021-12-26 04:38:08 +0100wh16(~smaris@user/wh16) (Ping timeout: 268 seconds)
2021-12-26 04:40:11 +0100raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
2021-12-26 04:47:33 +0100yaroot(~yaroot@60.149.13.160.dy.iij4u.or.jp) (Remote host closed the connection)
2021-12-26 04:49:16 +0100yaroot(~yaroot@2409:12:ac0:2300:680e:dbff:fe1e:4953)
2021-12-26 04:50:25 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
2021-12-26 04:50:26 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 04:50:58 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: closed)
2021-12-26 04:51:03 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 04:58:37 +0100drewr(~drew@user/drewr) (Ping timeout: 240 seconds)
2021-12-26 05:00:45 +0100yauhsien_(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 05:00:46 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Read error: Connection reset by peer)
2021-12-26 05:05:37 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-26 05:05:39 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-26 05:05:39 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-26 05:05:39 +0100wroathe(~wroathe@user/wroathe)
2021-12-26 05:08:36 +0100wh16(~smaris@user/wh16)
2021-12-26 05:11:25 +0100notzmv(~zmv@user/notzmv) (Ping timeout: 268 seconds)
2021-12-26 05:15:11 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
2021-12-26 05:17:56 +0100cheater(~Username@user/cheater)
2021-12-26 05:18:22 +0100machinedgod(~machinedg@24.105.81.50) (Ping timeout: 260 seconds)
2021-12-26 05:19:24 +0100shapr`shapr
2021-12-26 05:20:03 +0100sprout(~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 268 seconds)
2021-12-26 05:20:23 +0100drewr(~drew@user/drewr)
2021-12-26 05:24:29 +0100sprout(~quassel@2a02:a467:ccd6:1:21ba:a382:6b6:54c4)
2021-12-26 05:28:09 +0100mbuf(~Shakthi@110.225.250.18)
2021-12-26 05:33:54 +0100Erutuon(~Erutuon@user/erutuon)
2021-12-26 05:40:50 +0100yauhsien_(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Remote host closed the connection)
2021-12-26 05:42:24 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 05:42:45 +0100ym(~ym@pool-96-253-29-94.prvdri.fios.verizon.net)
2021-12-26 05:46:18 +0100deadmarshal(~deadmarsh@95.38.228.37)
2021-12-26 05:46:57 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-12-26 05:51:39 +0100 <otherwise> Why should I bother making type declarations if Haskell infers them for me? type declarations are difficult for me to understand how to use, especially when (Num a, Ord b) => and other constraints get involved...
2021-12-26 05:52:08 +0100wh16(~smaris@user/wh16) (Quit: segfault)
2021-12-26 05:52:46 +0100 <nshepperd2> using them will help you learn how to use them
2021-12-26 05:54:47 +0100 <EvanR> if you don't write them, can't read them, then you'll really be screwed once the compiler starts telling you about your problems
2021-12-26 05:55:13 +0100 <EvanR> in many cases putting a missing type signature will improve the error message
2021-12-26 05:55:30 +0100falafel(~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
2021-12-26 05:55:47 +0100 <EvanR> also type signatures are a big step toward documentation
2021-12-26 05:56:15 +0100 <EvanR> and sanity check of your own thought process
2021-12-26 05:58:54 +0100rekahsoft(~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com) (Ping timeout: 268 seconds)
2021-12-26 05:59:49 +0100Midjak(~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: This computer has gone to sleep)
2021-12-26 06:02:01 +0100 <EvanR> don't worry, even if you put all top-level type signatures, you'll be heavily relying on type inference anyway for everything else
2021-12-26 06:12:01 +0100alfonsox(~quassel@103.92.42.192)
2021-12-26 06:12:02 +0100 <otherwise> okay, i'm curious what you mean about "... step toward documentation"
2021-12-26 06:13:14 +0100 <otherwise> I've been wondering how to write my own documentation notes, so I can type :doc myCustomFunction and gchi will spit back the "documentation notes" I have written for just that occasion. This is a thing in MATLAB, called "help comments"
2021-12-26 06:13:56 +0100 <otherwise> Is that they sort of thing you are referring to EvanR ?
2021-12-26 06:14:21 +0100 <EvanR> no
2021-12-26 06:14:35 +0100 <EvanR> but haskell does that have that sort of thing
2021-12-26 06:14:39 +0100 <EvanR> haddock
2021-12-26 06:15:17 +0100 <EvanR> For many generic functions the type is enough to understand what it does
2021-12-26 06:17:31 +0100 <EvanR> e.g. (a -> b -> c) -> (a,b) -> c
2021-12-26 06:17:37 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
2021-12-26 06:17:51 +0100 <otherwise> hmm, it's like the most abstract definition of the function to follow. I was unaware of haddock, thanks for sharring that :)
2021-12-26 06:18:47 +0100 <otherwise> that says something: first parameter is (a -> b -> c) second parameter is a pair (a,b) and the function returns c
2021-12-26 06:19:09 +0100 <EvanR> in many languages if a function isn't documented, you often have to go delving into its source code to figure out what it does
2021-12-26 06:19:37 +0100 <otherwise> the first part is most confusing, it is like a single parameter that has two inputs and a single output?
2021-12-26 06:19:37 +0100falafel(~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds)
2021-12-26 06:20:19 +0100 <EvanR> (a -> b -> c) -> (a,b) -> c can be thought of as the type of a 2 arg function
2021-12-26 06:20:38 +0100 <EvanR> the first arg is also a 2 arg function, second arg is a pair
2021-12-26 06:21:18 +0100 <EvanR> when you see multiple arrows in a row, mentally insert the extra parentheses until you've internalized it xD
2021-12-26 06:21:22 +0100 <EvanR> a -> (b -> c)
2021-12-26 06:21:26 +0100 <EvanR> same as
2021-12-26 06:21:28 +0100KvL(~KvL@195.216.219.57) ()
2021-12-26 06:21:28 +0100 <EvanR> a -> b -> c
2021-12-26 06:22:17 +0100 <EvanR> because it's curried like that, you don't have to have both arguments right now
2021-12-26 06:22:19 +0100 <otherwise> okay, seems easy enough, just need more exposure to writing such functions to get a better handle on it (practice)
2021-12-26 06:22:34 +0100slowButPresent(~slowButPr@user/slowbutpresent) (Quit: leaving)
2021-12-26 06:31:56 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 06:34:42 +0100 <maralorn> can `try (TextIO.hgetChunk handle) :: IO (Either IOException Text)` return a Rght _|_ ? (using non-lazy Text)
2021-12-26 06:35:35 +0100 <maralorn> I meant: Could it return a Right containing a bottom.
2021-12-26 06:36:39 +0100 <c_wraith> you'd have to read the source of hgetchunk to know
2021-12-26 06:37:48 +0100 <maralorn> c_wraith: Let=s assume that code only throws IOExceptions and no other bottoms.
2021-12-26 06:40:10 +0100 <c_wraith> you could probably manage to assemble a handle that smuggles a bottom out
2021-12-26 06:41:21 +0100 <dsal> otherwise: the type definitions are important for a few reasons. For one, it does make it a lot easier to understand what you're trying to accomplish and the compiler can direct you towards small mistakes closer to where you're making them. You can also get stuff like type holes to help with that.
2021-12-26 06:42:21 +0100 <c_wraith> types are documentation that actually tells the truth.
2021-12-26 06:43:50 +0100 <dsal> Yeah, EvanR's uncurry example is a pretty good example. It's pretty clear what that does.
2021-12-26 06:44:06 +0100BrokenClutch(~pioneer@2804:d41:c2a7:d800:e627:b00b:2c62:134) ()
2021-12-26 06:46:21 +0100KvL(~KvL@user/KvL)
2021-12-26 06:48:51 +0100deadmarshal(~deadmarsh@95.38.228.37) (Ping timeout: 268 seconds)
2021-12-26 06:51:13 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Remote host closed the connection)
2021-12-26 06:52:03 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 06:57:07 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
2021-12-26 07:01:20 +0100 <otherwise> uhh... I guess I don't understand type a->b->c
2021-12-26 07:01:37 +0100 <otherwise> what is an example of a program that I can write with that type?
2021-12-26 07:01:46 +0100 <otherwise> I was trying to re implement add
2021-12-26 07:02:03 +0100 <otherwise> add :: a->b->c
2021-12-26 07:02:17 +0100 <otherwise> add a b = a+b
2021-12-26 07:02:25 +0100 <otherwise> but that doesnt work...
2021-12-26 07:02:38 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 07:02:40 +0100 <otherwise> i'm a noob
2021-12-26 07:02:49 +0100 <EvanR> you can't write anything with that type in isolation
2021-12-26 07:03:09 +0100 <EvanR> it only makes sense as part of the whole type (a -> b -> c) -> (a,b) -> c
2021-12-26 07:03:33 +0100 <otherwise> oh
2021-12-26 07:03:36 +0100 <EvanR> in which case, if someone happened to have a function of type Int -> Char -> Bool on them, they could pass it in
2021-12-26 07:03:49 +0100 <EvanR> by picking a=Int, b=Char, c=Bool
2021-12-26 07:06:28 +0100KvL(~KvL@user/KvL) (Quit: KvL)
2021-12-26 07:07:17 +0100 <EvanR> you can make sense of a polymorphic type (contains type variables) by mentally prepending foralls to it. The thing has to work for any choice of a, b, and c
2021-12-26 07:07:36 +0100 <EvanR> you can do it for (a -> b -> c) -> (a,b) -> c, but not a -> b -> c
2021-12-26 07:07:56 +0100 <EvanR> you can do it for a -> a
2021-12-26 07:07:58 +0100 <EvanR> but not a -> b
2021-12-26 07:08:09 +0100 <EvanR> try it yourself to see why
2021-12-26 07:08:22 +0100KvL(~KvL@user/KvL)
2021-12-26 07:09:02 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-26 07:09:07 +0100 <otherwise> okay
2021-12-26 07:12:06 +0100 <dsal> otherwise: you can read `a -> b -> c` as taking any value of any type `a` and any value of any type `b` and returns a value of type `c`. Might be hard to do that in isolation.
2021-12-26 07:12:46 +0100 <EvanR> because the "user" is picking a b and c
2021-12-26 07:13:07 +0100 <EvanR> you can't know ahead of time what they are
2021-12-26 07:13:22 +0100 <dsal> Yeah, the caller. If you write that function and I say a ~ String and b ~ Int and I want you to give me c ~ Bool -- how would you implement that?
2021-12-26 07:14:04 +0100 <EvanR> if you knew they, you'd say e.g. False, but you don't
2021-12-26 07:14:07 +0100 <EvanR> knew that*
2021-12-26 07:14:10 +0100 <dsal> But as stated, that's not what's said here. Given a function `(a -> b -> c)` and a tuple `(a, b)` (the same `a` and the same `b`) we can get a `c`. There aren't that manyw ays to do that.
2021-12-26 07:14:32 +0100 <dsal> > uncurry (+) (1,2)
2021-12-26 07:14:34 +0100 <lambdabot> 3
2021-12-26 07:14:54 +0100 <dsal> > uncurry (<>) ('h','i')
2021-12-26 07:14:55 +0100 <lambdabot> error:
2021-12-26 07:14:55 +0100 <lambdabot> • No instance for (Semigroup Char) arising from a use of ‘<>’
2021-12-26 07:14:55 +0100 <lambdabot> • In the first argument of ‘uncurry’, namely ‘(<>)’
2021-12-26 07:15:02 +0100 <dsal> no char semigroups. boo
2021-12-26 07:15:07 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-26 07:15:07 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-26 07:15:07 +0100wroathe(~wroathe@user/wroathe)
2021-12-26 07:15:09 +0100 <dsal> > uncurry (<>) ("h","i")
2021-12-26 07:15:11 +0100 <lambdabot> "hi"
2021-12-26 07:19:37 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-26 07:21:48 +0100deadmarshal(~deadmarsh@95.38.228.37)
2021-12-26 07:23:20 +0100vysn(~vysn@user/vysn)
2021-12-26 07:24:50 +0100 <EvanR> In a -> b you can't construct any b without knowing what b is, and none were given. In a -> a you don't have to know what a is.
2021-12-26 07:25:09 +0100 <EvanR> One is given
2021-12-26 07:26:57 +0100 <otherwise> its all so abstract. I'm just trying to come up with a function that does something to try to write. I have in front of me an example for implementing flip, and I got that, but inventing my own function so I understand how to apply this is harder than understanding how to apply this...
2021-12-26 07:27:39 +0100 <EvanR> yeah, use concrete examples first
2021-12-26 07:27:45 +0100 <dsal> It's not more abstract than it needs to be.
2021-12-26 07:27:49 +0100 <otherwise> Like, in english, what is a simple question that I could try to write a function that would answer the question?
2021-12-26 07:28:04 +0100 <EvanR> you did flip
2021-12-26 07:28:16 +0100 <EvanR> what about, what is the reversed version of a list
2021-12-26 07:28:18 +0100 <otherwise> that necessitates using (a -> b -> c ) -> a -> b -> c
2021-12-26 07:28:33 +0100 <EvanR> (a -> b -> c) -> (a,b) -> c ?
2021-12-26 07:28:37 +0100 <EvanR> (uncurry)
2021-12-26 07:28:54 +0100 <dsal> :t ($)
2021-12-26 07:28:55 +0100 <lambdabot> (a -> b) -> a -> b
2021-12-26 07:29:14 +0100 <dsal> It's kind of that, but with more application.
2021-12-26 07:29:17 +0100 <EvanR> otherwise, it comes up when you would rather a function take a tuple
2021-12-26 07:29:44 +0100 <EvanR> it's curried, but you want to pass it a tuple
2021-12-26 07:29:49 +0100 <EvanR> for some reason
2021-12-26 07:29:56 +0100 <dsal> Which happens when a function returns two things (as a tuple) and you want to pass those two things to another function.
2021-12-26 07:30:16 +0100 <EvanR> I can try to concretize why this would happen
2021-12-26 07:30:44 +0100 <dsal> > divMod 11 3
2021-12-26 07:30:46 +0100 <lambdabot> (3,2)
2021-12-26 07:30:52 +0100 <dsal> > uncurry (+) $ divMod 11 3
2021-12-26 07:30:53 +0100 <lambdabot> 5
2021-12-26 07:30:57 +0100 <EvanR> write a function to tell me if the quotient is bigger than the remainder
2021-12-26 07:30:59 +0100 <EvanR> using divMod
2021-12-26 07:31:07 +0100dagi64893(~dagit@2001:558:6025:38:6476:a063:d05a:44da)
2021-12-26 07:31:24 +0100dagit(~dagit@2001:558:6025:38:6476:a063:d05a:44da) (Read error: Connection reset by peer)
2021-12-26 07:31:50 +0100 <EvanR> that $ is so gratuitous right there!
2021-12-26 07:32:05 +0100 <dsal> It's the bling operator.
2021-12-26 07:32:34 +0100dagi64893dagit
2021-12-26 07:32:50 +0100 <EvanR> > uncurry (>) (divMod 11 3)
2021-12-26 07:32:51 +0100 <otherwise> oh okay, I'll see if I can do that EvanR
2021-12-26 07:32:52 +0100 <lambdabot> True
2021-12-26 07:32:56 +0100 <EvanR> > uncurry (>) (divMod 2 3)
2021-12-26 07:32:57 +0100 <lambdabot> False
2021-12-26 07:33:01 +0100 <EvanR> well, too late xd
2021-12-26 07:33:12 +0100 <dsal> See if you can do a similar thing, but with quotRem instead.
2021-12-26 07:33:12 +0100 <EvanR> still worth doing the exercise
2021-12-26 07:33:57 +0100notzmv(~zmv@user/notzmv)
2021-12-26 07:34:26 +0100 <otherwise> honestly, it's probably going to take me multiple hours, so don't wait on me. But I'll get it eventually!
2021-12-26 07:35:15 +0100 <dsal> The main point is to write down what you expect the function to do. :) You start doing that before you write the function and it gets easier.
2021-12-26 07:35:35 +0100 <dsal> Things like flip are super abstract because they work with just about everything.
2021-12-26 07:35:44 +0100 <EvanR> write a top level type signature, even if that's all you did you learned something
2021-12-26 07:36:47 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-26 07:37:22 +0100 <otherwise> wait, I'm using function :: (a -> b -> c) -> (a,b) -> c. right?
2021-12-26 07:37:29 +0100 <dsal> That's uncurry
2021-12-26 07:37:49 +0100 <dsal> Here's where it gets cool. So you know you need a function that does that. Is there a function that does that?
2021-12-26 07:37:50 +0100 <dsal> @hoogle (a -> b -> c) -> (a,b) -> c
2021-12-26 07:37:52 +0100 <lambdabot> Prelude uncurry :: (a -> b -> c) -> (a, b) -> c
2021-12-26 07:37:52 +0100 <lambdabot> Data.Tuple uncurry :: (a -> b -> c) -> (a, b) -> c
2021-12-26 07:37:52 +0100 <lambdabot> Test.Hspec.Discover uncurry :: () => (a -> b -> c) -> (a, b) -> c
2021-12-26 07:38:17 +0100 <dsal> @hoogle (a -> b -> c) -> b -> a -> c
2021-12-26 07:38:18 +0100 <lambdabot> Prelude flip :: (a -> b -> c) -> b -> a -> c
2021-12-26 07:38:18 +0100 <lambdabot> Data.Function flip :: (a -> b -> c) -> b -> a -> c
2021-12-26 07:38:18 +0100 <lambdabot> GHC.Base flip :: (a -> b -> c) -> b -> a -> c
2021-12-26 07:38:30 +0100jonathanx(~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
2021-12-26 07:38:37 +0100 <int-e> :t uncurry (flip (,))
2021-12-26 07:38:38 +0100 <lambdabot> (b, a) -> (a, b)
2021-12-26 07:38:48 +0100 <int-e> :t snd &&& fst
2021-12-26 07:38:49 +0100 <lambdabot> (a, c) -> (c, a)
2021-12-26 07:38:56 +0100 <EvanR> otherwise, have you looked at functions like map, filter, foldl yet
2021-12-26 07:39:09 +0100 <dsal> I feel like I want &&& a lot, but I'm somehow opposed to it.
2021-12-26 07:39:14 +0100 <EvanR> uncurry comes after those
2021-12-26 07:39:15 +0100 <int-e> (just a tangent; I forgot about the former way to make \(a,b) -> (b,a) point-free)
2021-12-26 07:40:31 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection)
2021-12-26 07:41:50 +0100 <otherwise> That is actually the next paragraph in LYAH, so maybe I should do that section before I spend too long trying to getting confused by (a-> b-> c)-> (a,b) ->c
2021-12-26 07:42:42 +0100 <EvanR> please do
2021-12-26 07:44:37 +0100drewr(~drew@user/drewr) (Ping timeout: 240 seconds)
2021-12-26 07:44:40 +0100 <int-e> dsal: I used it a few times in AoC... there's a map (length &&& head) . group . sort, and a minimum &&& maximum, and a maximum &&& length. So... yeah that's not a lot of uses.
2021-12-26 07:44:53 +0100 <int-e> compared to something like `.` which I use all the time.
2021-12-26 07:45:18 +0100Lycurgus(~juan@98.4.112.204)
2021-12-26 07:45:53 +0100drewr(~drew@user/drewr)
2021-12-26 07:45:53 +0100Jing(~hedgehog@2604:a840:3::1061) (Remote host closed the connection)
2021-12-26 07:46:09 +0100 <dsal> Yeah, I'm kind of aware of it, but end up making lambdas just because "arrows" sounds scary to me.
2021-12-26 07:46:11 +0100 <int-e> (arguably the group thing should be a Data.Map.fromListWith (+) . map (flip (,) 1) instead.
2021-12-26 07:46:29 +0100Jing(~hedgehog@125.105.141.97)
2021-12-26 07:46:30 +0100 <dsal> I use TupleSections
2021-12-26 07:46:49 +0100 <int-e> they're too new :P
2021-12-26 07:47:10 +0100 <int-e> I know they exist but I usually don't think of them when I code.
2021-12-26 07:47:16 +0100 <dsal> > M.fromListWith (+) . fmap (,1) $ "haskell"
2021-12-26 07:47:17 +0100 <lambdabot> fromList [('a',1),('e',1),('h',1),('k',1),('l',2),('s',1)]
2021-12-26 07:47:24 +0100 <dsal> That's me and the arrows. :)
2021-12-26 07:47:58 +0100 <dsal> TupleSections likes to tell me to introduce it because it's like any other partial as far as I care.
2021-12-26 07:48:34 +0100 <EvanR> tupling stuff when it's not required by some API... it always feels like "I'm doing this to cut a corner" and then it ends up not paying off xD
2021-12-26 07:49:02 +0100 <dsal> Frequency analysis was pretty helpful in… one of htose.
2021-12-26 07:49:17 +0100 <dsal> Day 8
2021-12-26 07:50:17 +0100 <int-e> Day 3
2021-12-26 07:50:41 +0100 <int-e> (though with only 2 values...)
2021-12-26 07:51:27 +0100 <int-e> Ah, day 08 indeed, but that one was easy enough to brute force as well.
2021-12-26 07:51:45 +0100 <dsal> It helped just a bit.
2021-12-26 07:53:50 +0100 <dsal> part1 = liftA2 (*) γ ε <$> getInput
2021-12-26 07:53:50 +0100 <dsal> part2 = liftA2 (*) o₂ co₂ <$> getInput
2021-12-26 07:53:59 +0100 <dsal> heh. I don't even remember this one at all.
2021-12-26 07:54:18 +0100 <EvanR> fancy
2021-12-26 07:55:10 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 07:56:25 +0100 <EvanR> in a 3rd iteration of the o2 co2 day, I expressed it as splitting an IntSet at some power of two and picking a winning partition using whatever decider was passed in
2021-12-26 07:57:36 +0100 <int-e> I didn't even use `partition` that day, boo
2021-12-26 07:58:39 +0100 <EvanR> the partitions are way too simple for partition xD
2021-12-26 07:58:41 +0100 <dsal> I just used foldr
2021-12-26 07:59:21 +0100 <EvanR> I liked the imagery of having a block of numbers and fissioning it at some point xD
2021-12-26 07:59:46 +0100 <EvanR> seems more evocative
2021-12-26 08:00:53 +0100 <int-e> I used o2 i xs | z <- [xs | xs <- xs, xs !! i == 0], o <- [xs | xs <- xs, xs !! i == 1] = o2 (i+1) (if length z > length o then z else o) (plus a base case)
2021-12-26 08:01:01 +0100 <int-e> and then I shamelessly copied that for co2
2021-12-26 08:02:22 +0100 <EvanR> for days puzzle I was this close to implementing Word139 before I came to my senses
2021-12-26 08:02:31 +0100 <EvanR> for today's puzzle
2021-12-26 08:03:21 +0100 <EvanR> it turned out much more elegant
2021-12-26 08:04:36 +0100 <dsal> I have a bitset that works with Integer.
2021-12-26 08:04:46 +0100 <dsal> (or anything else that has a Bits instance)
2021-12-26 08:06:31 +0100Akiva(~Akiva@user/Akiva)
2021-12-26 08:09:42 +0100 <EvanR> yeah I was thinking it would need more performance
2021-12-26 08:09:53 +0100Lycurgus(~juan@98.4.112.204) (Quit: Exeunt)
2021-12-26 08:12:49 +0100 <dsal> My bitset thing is super nice when you have a set of lowercase letters.
2021-12-26 08:13:04 +0100 <dsal> Oh, I used it on day 8 as well.
2021-12-26 08:25:25 +0100xkuru(~xkuru@user/xkuru) (Read error: Connection reset by peer)
2021-12-26 08:26:15 +0100ym(~ym@pool-96-253-29-94.prvdri.fios.verizon.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-12-26 08:27:28 +0100kadir(~kadir@88.251.52.166)
2021-12-26 08:33:36 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
2021-12-26 08:33:36 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 08:37:33 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
2021-12-26 08:37:33 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 08:39:20 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: closed)
2021-12-26 08:39:32 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 08:43:39 +0100takuan(~takuan@178-116-218-225.access.telenet.be)
2021-12-26 08:43:49 +0100falafel(~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
2021-12-26 08:45:38 +0100lavaman(~lavaman@98.38.249.169)
2021-12-26 08:46:30 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Remote host closed the connection)
2021-12-26 08:47:16 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 08:48:30 +0100notzmv(~zmv@user/notzmv) (Ping timeout: 268 seconds)
2021-12-26 08:48:35 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
2021-12-26 08:48:40 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 08:49:02 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: closed)
2021-12-26 08:49:14 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 08:52:09 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
2021-12-26 09:03:09 +0100Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
2021-12-26 09:05:57 +0100conann(~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Session timeout))
2021-12-26 09:06:37 +0100drewr(~drew@user/drewr) (Ping timeout: 240 seconds)
2021-12-26 09:06:55 +0100falafel_(~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
2021-12-26 09:09:38 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 09:09:57 +0100falafel(~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds)
2021-12-26 09:33:08 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 09:40:41 +0100zaquest(~notzaques@5.130.79.72) (Remote host closed the connection)
2021-12-26 09:41:53 +0100zaquest(~notzaques@5.130.79.72)
2021-12-26 09:42:13 +0100mario(~mario@31.147.205.13)
2021-12-26 09:48:57 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-26 09:49:17 +0100conann(~bc8147f2@cerf.good1.com)
2021-12-26 09:49:36 +0100alfonsox(~quassel@103.92.42.192) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2021-12-26 09:50:49 +0100max22-(~maxime@2a01cb0883359800aecdaff2e9d1f24d.ipv6.abo.wanadoo.fr)
2021-12-26 09:52:39 +0100mario(~mario@31.147.205.13) (Quit: Leaving)
2021-12-26 10:00:07 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-26 10:04:11 +0100acidjnk(~acidjnk@p200300d0c7271e2604f35b95c1d32a12.dip0.t-ipconnect.de)
2021-12-26 10:04:31 +0100mbuf(~Shakthi@110.225.250.18) (Quit: Leaving)
2021-12-26 10:04:45 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
2021-12-26 10:05:33 +0100szkl(uid110435@id-110435.uxbridge.irccloud.com)
2021-12-26 10:07:25 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-12-26 10:07:42 +0100SummerSonw(~The_viole@203.77.49.232)
2021-12-26 10:08:01 +0100coolnickname(uid531864@user/coolnickname)
2021-12-26 10:17:42 +0100geekosaur(~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
2021-12-26 10:17:42 +0100allbery_b(~geekosaur@xmonad/geekosaur)
2021-12-26 10:17:45 +0100allbery_bgeekosaur
2021-12-26 10:32:00 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 10:33:36 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-26 10:36:19 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Client Quit)
2021-12-26 10:36:25 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
2021-12-26 10:37:28 +0100Tuplanolla(~Tuplanoll@91-159-69-236.elisa-laajakaista.fi)
2021-12-26 10:45:56 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-26 10:48:19 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Client Quit)
2021-12-26 10:55:00 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
2021-12-26 10:55:01 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 10:55:03 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-26 10:55:28 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: closed)
2021-12-26 10:55:39 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 10:55:45 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-26 10:56:53 +0100Sgeo_(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-12-26 10:58:50 +0100notzmv(~zmv@user/notzmv)
2021-12-26 11:00:40 +0100Goodbye_Vincent(cyvahl@freakshells.net)
2021-12-26 11:03:17 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 11:03:41 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-26 11:03:48 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 11:05:15 +0100SummerSonw(~The_viole@203.77.49.232) (Ping timeout: 250 seconds)
2021-12-26 11:05:44 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Read error: Connection reset by peer)
2021-12-26 11:05:57 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-26 11:06:15 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Remote host closed the connection)
2021-12-26 11:06:25 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-26 11:08:34 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2021-12-26 11:13:22 +0100 <Hecate> looks like this year's Haskell Santa is Ukrainian!
2021-12-26 11:13:43 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-26 11:20:56 +0100kupi(uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-26 11:23:11 +0100Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2021-12-26 11:24:07 +0100SummerSonw(~The_viole@203.77.49.232)
2021-12-26 11:24:19 +0100Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 250 seconds)
2021-12-26 11:26:02 +0100Lord_of_Life_Lord_of_Life
2021-12-26 11:28:06 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-26 11:28:10 +0100 <otherwise> everyone: is haskell your first programming language?
2021-12-26 11:28:22 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:8415:925f:506a:a363) (Remote host closed the connection)
2021-12-26 11:28:34 +0100 <janus> otherwise: what does 'first' mean?
2021-12-26 11:29:07 +0100 <otherwise> learned it before you learned your second programming language
2021-12-26 11:29:32 +0100zer0bitz(~zer0bitz@196.244.192.59)
2021-12-26 11:30:35 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 11:31:29 +0100 <Hecate> hahaha
2021-12-26 11:31:35 +0100 <Hecate> otherwise: I would recommend against this
2021-12-26 11:32:20 +0100 <Hecate> Haskell has a strong stance regarding some things that doesn't make any sense if you don't know whence they come
2021-12-26 11:32:51 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net)
2021-12-26 11:32:57 +0100Erutuon(~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
2021-12-26 11:33:03 +0100 <Rembane> otherwise: Haskell is my fifth programming language perhaps?
2021-12-26 11:33:27 +0100 <Rembane> Hecate: Do you have something particular (that Haskell stances against) in mind?
2021-12-26 11:34:11 +0100gehmehgeh(~user@user/gehmehgeh)
2021-12-26 11:34:18 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-26 11:34:23 +0100 <Hecate> Rembane: sure, impure computations
2021-12-26 11:35:03 +0100 <Hecate> I don't think it properly percolates in the mind of the learner until they've experienced an impure language that fucks them over
2021-12-26 11:35:12 +0100 <Rembane> Hecate: That's true. They are a strange beast in Haskell. I've gotten used to so many peculiar things that I don't find them strange anymore.
2021-12-26 11:35:27 +0100 <Hecate> :)
2021-12-26 11:35:46 +0100 <Rembane> Hecate: I come to think of another one, I regularly miss laziness in Elixir.
2021-12-26 11:36:34 +0100 <Hecate> Rembane: lazy computation pipelines or just having everything wrapped in a lambda ?
2021-12-26 11:36:38 +0100 <Hecate> ;-D
2021-12-26 11:37:07 +0100 <Hecate> (I had to do this in React, wrapping stuff in lambdas to delay evaluation)
2021-12-26 11:38:03 +0100 <geekosaur> I have a lot of programming languages under my belt
2021-12-26 11:38:11 +0100Akiva(~Akiva@user/Akiva) (Ping timeout: 256 seconds)
2021-12-26 11:38:29 +0100 <Rembane> Hecate: Lazy computation pipelines, start with an infinite list and end up with something reasonable in the end, usually by doing take or takeWhile as the last function in the pipeline.
2021-12-26 11:39:34 +0100 <Rembane> I do think though that it's easier to learn Haskell as the first language than the n:th language. I have absolutely nothing to back this up with other than Haskell is very different to most of the imperitave programming languages.
2021-12-26 11:40:56 +0100 <otherwise> geekosaur was haskell your first, or did you pick it up after some other languages?
2021-12-26 11:41:03 +0100acode(~acode@151.65.31.181)
2021-12-26 11:41:16 +0100econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2021-12-26 11:41:25 +0100 <geekosaur> whne I started programming, Haskell didn't even exist :)
2021-12-26 11:41:26 +0100 <Hecate> Rembane: but don't we have Streams in Elixir?
2021-12-26 11:41:33 +0100 <Hecate> geekosaur: hahahah
2021-12-26 11:42:36 +0100 <Rembane> Hecate: We do have streams. They are amazing and makes the language so much better! :)
2021-12-26 11:42:58 +0100 <Rembane> geekosaur: What was your first programming language? :)
2021-12-26 11:43:20 +0100 <geekosaur> MS-BASIC, shortly followed by Z80 and 6502 assembly language
2021-12-26 11:44:39 +0100 <Rembane> Nice!
2021-12-26 11:44:42 +0100 <geekosaur> then I discovered C in 1981
2021-12-26 11:45:16 +0100 <geekosaur> if you wonder how C got to be so pervasive, consider that for years it was pretty much the only option for many people
2021-12-26 11:45:43 +0100 <geekosaur> other languages existed but cost a lot of money for either the hardware they ran on or for the (commercial) compilers
2021-12-26 11:49:43 +0100 <Logio_> haskell was certainly easier to teach to people as their first language, rather than their nth
2021-12-26 11:49:47 +0100Logio_Logio
2021-12-26 11:52:57 +0100bollu(uid233390@id-233390.helmsley.irccloud.com)
2021-12-26 11:53:20 +0100 <janus> geekosaur: did you ever work in Plankalkül?
2021-12-26 11:53:57 +0100 <geekosaur> nope
2021-12-26 11:54:23 +0100 <geekosaur> I'm old but not quite *that* old :)
2021-12-26 11:54:50 +0100 <Rembane> Logio: What were the most common things to unlearn among the n:thers?
2021-12-26 11:54:59 +0100 <janus> my dad is from 1948, i saw FreePascal on his Win7 desktop yesterday :O
2021-12-26 11:55:51 +0100 <Rembane> I've ever only seen Pascal in modern times, have never worked in it. It still fascinates me though.
2021-12-26 11:56:23 +0100 <janus> if i understand correctly the best thing about Pascal is how it had length-prefixed strings by default?
2021-12-26 11:56:43 +0100 <geekosaur> ohm it had more than that. it had actual types
2021-12-26 11:56:47 +0100 <Rembane> It had, and 1-indexed arrays and strings.
2021-12-26 11:56:49 +0100 <Rembane> And ranges!
2021-12-26 11:57:34 +0100 <geekosaur> I was at a computer workshop between junior and senior year of high scholl, where a few lucky kids got to work with Terac IVs running Pascal. I was so pissed that I wasn't one of them
2021-12-26 11:58:01 +0100 <janus> what is even a range? i imagine they weren't like the ranges recently added to c++
2021-12-26 11:58:22 +0100 <geekosaur> var foo : 1..10;
2021-12-26 11:58:39 +0100 <geekosaur> runtime checked
2021-12-26 11:58:52 +0100 <acode> You guys are making me feel old because I had Pascal in high school now
2021-12-26 11:59:02 +0100 <janus> it's a datatype that wraps two integers and then a syntax shorthand for it?
2021-12-26 12:00:59 +0100 <geekosaur> yes. more or less like Ix in Haskell
2021-12-26 12:01:03 +0100alx741(~alx741@157.100.93.160)
2021-12-26 12:01:51 +0100acode(~acode@151.65.31.181) (Quit: Client closed)
2021-12-26 12:03:43 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 12:04:17 +0100benin(~benin@183.82.27.57) (Quit: The Lounge - https://thelounge.chat)
2021-12-26 12:04:34 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
2021-12-26 12:04:35 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 12:05:04 +0100qrpnxz(abc4f95c31@user/qrpnxz) (Disconnected: closed)
2021-12-26 12:05:14 +0100qrpnxz(abc4f95c31@user/qrpnxz)
2021-12-26 12:06:47 +0100zer0bitz_(~zer0bitz@196.244.192.56)
2021-12-26 12:09:17 +0100zer0bitz(~zer0bitz@196.244.192.59) (Ping timeout: 240 seconds)
2021-12-26 12:10:43 +0100zer0bitz(~zer0bitz@2001:2003:f444:a000:448c:d273:19c0:41c1)
2021-12-26 12:14:17 +0100zer0bitz_(~zer0bitz@196.244.192.56) (Ping timeout: 240 seconds)
2021-12-26 12:18:03 +0100 <Logio> Rembane: not having mutable variables and loops seemed to cause most problems for the people with more experience
2021-12-26 12:20:24 +0100 <Rembane> Logio: I can totally see why and sympatize with that.
2021-12-26 12:22:22 +0100conann(~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Ping timeout))
2021-12-26 12:22:29 +0100xsperry(~xs@user/xsperry) (Ping timeout: 268 seconds)
2021-12-26 12:23:57 +0100 <Logio> yeah, not having any of your algorithm knowledge directly applicable can be really frustrating
2021-12-26 12:25:11 +0100 <Rembane> All the algorithms have a tendency to be: "Update the array at index i..."
2021-12-26 12:26:52 +0100zer0bitz_(~zer0bitz@196.244.192.59)
2021-12-26 12:28:46 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
2021-12-26 12:30:29 +0100zer0bitz(~zer0bitz@2001:2003:f444:a000:448c:d273:19c0:41c1) (Ping timeout: 268 seconds)
2021-12-26 12:32:55 +0100zer0bitz_(~zer0bitz@196.244.192.59) (Read error: Connection reset by peer)
2021-12-26 12:32:57 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
2021-12-26 12:34:43 +0100 <janus> Numerous burrito tutorials (of varying quality) are to be found on the Internet. Some describe a burrito as the image of a crêpe under the action of the new-world functor. https://emorehouse.wescreates.wesleyan.edu/silliness/burrito_monads.pdf
2021-12-26 12:37:25 +0100zer0bitz(~zer0bitz@196.244.192.57)
2021-12-26 12:37:37 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-26 12:44:04 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Ping timeout: 268 seconds)
2021-12-26 12:48:57 +0100neceve(~quassel@2.26.93.228)
2021-12-26 12:49:38 +0100ozzymcduff(~ozzymcduf@77.49.18.242.dsl.dyn.forthnet.gr)
2021-12-26 12:54:21 +0100 <otherwise> I'm gonna stick with my open face plain bagels for now...
2021-12-26 12:58:16 +0100max22-(~maxime@2a01cb0883359800aecdaff2e9d1f24d.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
2021-12-26 12:58:29 +0100max22-(~maxime@2a01cb088335980027b3e3f3a18fa9f4.ipv6.abo.wanadoo.fr)
2021-12-26 13:10:12 +0100xsperry(~xs@user/xsperry)
2021-12-26 13:12:15 +0100SummerSonw(~The_viole@203.77.49.232) (Ping timeout: 256 seconds)
2021-12-26 13:15:17 +0100wallymathieu(uid533252@id-533252.uxbridge.irccloud.com)
2021-12-26 13:15:41 +0100acidjnk(~acidjnk@p200300d0c7271e2604f35b95c1d32a12.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
2021-12-26 13:17:37 +0100mvk(~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds)
2021-12-26 13:19:12 +0100slowtype-(~slowtyper@79.103.178.210.dsl.dyn.forthnet.gr) (Ping timeout: 268 seconds)
2021-12-26 13:21:37 +0100falafel_(~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds)
2021-12-26 13:21:59 +0100Midjak(~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
2021-12-26 13:22:08 +0100machinedgod(~machinedg@24.105.81.50)
2021-12-26 13:23:21 +0100pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2021-12-26 13:30:15 +0100ozzymcduff(~ozzymcduf@77.49.18.242.dsl.dyn.forthnet.gr) (Ping timeout: 256 seconds)
2021-12-26 13:30:55 +0100stiell(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2021-12-26 13:33:12 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-26 13:34:14 +0100sprout(~quassel@2a02:a467:ccd6:1:21ba:a382:6b6:54c4) (Ping timeout: 252 seconds)
2021-12-26 13:35:39 +0100sprout(~quassel@2a02:a467:ccd6:1:b165:3b1b:f1f6:f4de)
2021-12-26 13:37:12 +0100 <otherwise> https://paste.tomsmeding.com/EEI1icbM
2021-12-26 13:37:17 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 240 seconds)
2021-12-26 13:37:25 +0100stiell(~stiell@gateway/tor-sasl/stiell)
2021-12-26 13:39:24 +0100jpds(~jpds@gateway/tor-sasl/jpds) (Ping timeout: 276 seconds)
2021-12-26 13:39:56 +0100 <geekosaur> you seem to be missing a 'let' in the list comp version
2021-12-26 13:41:05 +0100waleee(~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
2021-12-26 13:42:18 +0100jpds(~jpds@gateway/tor-sasl/jpds)
2021-12-26 13:42:37 +0100 <geekosaur> the first one seems confused. "long" wants a list but is passed a number
2021-12-26 13:43:02 +0100 <otherwise> https://paste.tomsmeding.com/WnCO0OEp
2021-12-26 13:43:02 +0100 <geekosaur> and you can't use filter to limit a list, you probably want takeWhile
2021-12-26 13:43:19 +0100 <geekosaur> filter will just keep going looking for the predicate
2021-12-26 13:43:29 +0100 <otherwise> oh I switch from takeWhile to filter, I'll try takeWhile again
2021-12-26 13:44:11 +0100 <geekosaur> you have the same problem with that one, you are giving it a number but <- expects a list
2021-12-26 13:44:52 +0100 <geekosaur> basically this all looks very confused as to lists vs. items
2021-12-26 13:46:04 +0100 <geekosaur> you can't limit a list this way, you would need to associate an index with each element of the list and watch for the index to exceed your limit
2021-12-26 13:46:43 +0100lavaman(~lavaman@98.38.249.169)
2021-12-26 13:47:06 +0100 <geekosaur> in particular, once you get past the current type error you will discover that the rest of the list is already infinite so length will diverge
2021-12-26 13:47:16 +0100 <geekosaur> (== never return a value)
2021-12-26 13:48:59 +0100 <geekosaur> (well. it's not really "already infinite" because it is possible to stop if you do it right. but invoking length on it will *make* it infinite.)
2021-12-26 13:49:54 +0100 <geekosaur> it'll keep generating values as long as length consumes them, and length will consume until it sees end of list, so it just goes on forever
2021-12-26 13:50:35 +0100 <geekosaur> so you are thinking about this wrong
2021-12-26 13:50:51 +0100syrkis(~syrkis@82.192.167.70)
2021-12-26 13:50:57 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
2021-12-26 13:56:51 +0100dcoutts_(~duncan@71.78.6.51.dyn.plus.net)
2021-12-26 13:57:30 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-12-26 13:57:49 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-12-26 13:59:43 +0100jakalx(~jakalx@base.jakalx.net) ()
2021-12-26 14:02:12 +0100bollu(uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-26 14:05:04 +0100slowButPresent(~slowButPr@user/slowbutpresent)
2021-12-26 14:06:39 +0100 <geekosaur> otherwise, you might want to try putting type signatures on your functions. this will help you clarify where things go wrong, and possibly why (in particular, if your thought about a type at one point is different from the compiler's)
2021-12-26 14:06:45 +0100falafel_(~falafel@cpe-76-168-195-162.socal.res.rr.com)
2021-12-26 14:07:09 +0100 <geekosaur> also, I'd go back to the first version instead of the list comprehension
2021-12-26 14:09:20 +0100CiaoSen(~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
2021-12-26 14:14:15 +0100 <otherwise> https://paste.tomsmeding.com/XcmhAEUr
2021-12-26 14:14:33 +0100 <otherwise> oh I didnt see your reponses after 4:44
2021-12-26 14:16:58 +0100 <otherwise> good point about length not being sensical to apply to an infinite list
2021-12-26 14:21:07 +0100Rum(~bourbon@user/rum)
2021-12-26 14:23:38 +0100bollu(uid233390@id-233390.helmsley.irccloud.com)
2021-12-26 14:25:08 +0100 <geekosaur> put a type signature on `long`. but really the first one should tell you: why does it make sense to say `10 > list`?
2021-12-26 14:25:45 +0100 <geekosaur> this is why I suggest you put type signatures on everything: you evidently have the wrong idea about what one of your types is
2021-12-26 14:27:28 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-26 14:27:28 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-26 14:27:28 +0100wroathe(~wroathe@user/wroathe)
2021-12-26 14:27:39 +0100 <geekosaur> actually, you have worse than that. "But I'm trying to make length of the returned list be 10"
2021-12-26 14:28:02 +0100 <geekosaur> you're doing this at the wrong level: takeWhile can only see elements, not the length of the whole list
2021-12-26 14:28:15 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 14:28:56 +0100 <geekosaur> andyou cannot use length here because it has the same problem as the list comprehension version: it'll try to force an infinite list
2021-12-26 14:30:48 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
2021-12-26 14:31:54 +0100 <otherwise> I think long has to be Bool, considering takeWhile :: (a -> Bool) -> [a] -> [a]
2021-12-26 14:31:57 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-26 14:32:13 +0100jakalx(~jakalx@base.jakalx.net)
2021-12-26 14:32:25 +0100 <geekosaur> but you are successfully comparing it to an Integer
2021-12-26 14:32:45 +0100 <geekosaur> just changing the type does not turn an element of the list into the list
2021-12-26 14:33:17 +0100SummerSonw(~The_viole@203.77.49.232)
2021-12-26 14:34:00 +0100 <geekosaur> basically you are thinking about this wrong
2021-12-26 14:34:04 +0100 <int-e> don't forget about take and drop
2021-12-26 14:34:17 +0100 <geekosaur> I actually hinted at a way to do this earlier, although it's not the best way to do it
2021-12-26 14:34:20 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 14:34:28 +0100 <geekosaur> int-e, this started out as not wanting to use take or drop
2021-12-26 14:34:36 +0100 <int-e> ...but why
2021-12-26 14:34:49 +0100 <otherwise> just to include that in the function
2021-12-26 14:34:57 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
2021-12-26 14:35:09 +0100 <geekosaur> so just use take or drop inside the function
2021-12-26 14:35:29 +0100 <int-e> I mean, you're interested in what happens with the first 11 elements of (the spine of) the list.
2021-12-26 14:36:33 +0100 <int-e> you're not interested in the elements which basically makes the functions that take a predicate (like takeWhile) a no-go unless you annotate the elements first, and that's a bit silly
2021-12-26 14:36:57 +0100 <geekosaur> that was what I hinted at earlier
2021-12-26 14:37:23 +0100 <otherwise> I was going to generalize it n elements. I think I just need to keep working through examples in textbooks and I'll come back to this after a little more exposure/experience with types
2021-12-26 14:37:26 +0100 <geekosaur> but I'm going through this because otherwise seems fairly confused about what's what
2021-12-26 14:37:27 +0100 <otherwise> :)
2021-12-26 14:37:35 +0100 <int-e> yeah sorry I'm too lazy to read history
2021-12-26 14:37:59 +0100 <int-e> it's easier to reevaluate the situation "on demand"
2021-12-26 14:38:03 +0100 <geekosaur> so I'm trying to guide them through working out what's wrong and why it won't work
2021-12-26 14:40:05 +0100 <otherwise> geekosaur: thank you, i'll slowly digest what you've explained to me.
2021-12-26 14:40:26 +0100 <int-e> I also don't understand why "I want to generalize this to n" is a reason to discard `take` or `drop`.
2021-12-26 14:41:29 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 14:41:45 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 14:43:05 +0100 <geekosaur> it's not just types; you're thinking about the whole problem wrong, somehow
2021-12-26 14:43:20 +0100 <otherwise> int-e: as for why. i found it confusing why the way LYAH would use: let listOfFuns = map (*) [0..]) was by (listOfFuns !! 4) 5
2021-12-26 14:43:28 +0100 <geekosaur> which is what has led you to the wrong types
2021-12-26 14:44:21 +0100 <int-e> > let listOfFuns = map (*) [0..]) in (listOfFuns !! 4) 5 == 20
2021-12-26 14:44:22 +0100 <lambdabot> <hint>:1:31: error: parse error on input ‘)’
2021-12-26 14:44:31 +0100 <int-e> > let listOfFuns = map (*) [0..] in (listOfFuns !! 4) 5 == 20
2021-12-26 14:44:33 +0100 <lambdabot> True
2021-12-26 14:45:37 +0100 <otherwise> so I wanted to test my understanding by rewriting listOfFuns so that 4 was applied to each element of the list, and a list of n elements was returned.
2021-12-26 14:45:43 +0100 <int-e> Anyway, obviously I'm missing context. (Since that example has nothing obvious to do with testing for long lists.)
2021-12-26 14:45:56 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 14:46:42 +0100coot(~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
2021-12-26 14:46:46 +0100 <otherwise> which is good because now I know how confused I am about types, so I now know what to focus on.
2021-12-26 14:48:29 +0100 <geekosaur> again, this is worse than a confusion about types. "so that 4 was applied to each element of the list" has what exactly to do with selecting the 4th element (numbering from 0) of a list?
2021-12-26 14:48:57 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 14:49:01 +0100 <geekosaur> you are somehow confusing a list with its elements
2021-12-26 14:50:33 +0100alx741(~alx741@157.100.93.160) (Quit: alx741)
2021-12-26 14:52:20 +0100alx741(~alx741@157.100.93.160)
2021-12-26 14:52:40 +0100 <otherwise> I meant that 5 is applied to the 4th element, so that it becomes (4*) 5
2021-12-26 14:53:30 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 14:53:46 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 14:54:15 +0100 <int-e> "4th" counting from 0.
2021-12-26 14:54:21 +0100 <otherwise> yes
2021-12-26 14:54:53 +0100 <int-e> anyway, yes, that's how it evaluates to 20 in the end
2021-12-26 14:56:04 +0100neurocyte0132889(~neurocyte@IP-045010062145.dynamic.medianet-world.de)
2021-12-26 14:56:04 +0100neurocyte0132889(~neurocyte@IP-045010062145.dynamic.medianet-world.de) (Changing host)
2021-12-26 14:56:04 +0100neurocyte0132889(~neurocyte@user/neurocyte)
2021-12-26 14:56:10 +0100 <geekosaur> also don't confuse 4th element with (4*)
2021-12-26 14:56:28 +0100 <geekosaur> might be instructive to replace (*) with something more complicated
2021-12-26 14:56:59 +0100 <geekosaur> or just change [0..] to something like [20,30..]
2021-12-26 14:57:37 +0100 <otherwise> now i'm just trying to replace !! with take
2021-12-26 14:58:03 +0100 <geekosaur> just swap the parameters
2021-12-26 14:58:22 +0100 <geekosaur> list !! 4, vs. take 4 list (but note the fencepost error)
2021-12-26 15:01:05 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 15:01:13 +0100 <otherwise> > let listOfFuns = map (*) [0..] in take 4 (listOfFuns 3)
2021-12-26 15:01:14 +0100 <lambdabot> error:
2021-12-26 15:01:14 +0100 <lambdabot> • Couldn't match expected type ‘t0 -> [a]’
2021-12-26 15:01:15 +0100 <lambdabot> with actual type ‘[a0 -> a0]’
2021-12-26 15:01:18 +0100 <otherwise> :(
2021-12-26 15:02:01 +0100 <geekosaur> I am curious as to what made you think that would work
2021-12-26 15:02:16 +0100 <geekosaur> given (listOfFuns !! 4) 5
2021-12-26 15:02:20 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 15:02:21 +0100synthmeat(~synthmeat@user/synthmeat) (Quit: WeeChat 3.0)
2021-12-26 15:02:59 +0100 <otherwise> > take 4 [1..]
2021-12-26 15:03:00 +0100 <lambdabot> [1,2,3,4]
2021-12-26 15:03:24 +0100 <otherwise> replace [1..] with the list in question, listOfFuns
2021-12-26 15:03:27 +0100 <geekosaur> > take 4 (map (*) [0..])
2021-12-26 15:03:28 +0100 <lambdabot> [<Integer -> Integer>,<Integer -> Integer>,<Integer -> Integer>,<Integer -> ...
2021-12-26 15:03:42 +0100 <int-e> > take 4 [0..]
2021-12-26 15:03:44 +0100 <lambdabot> [0,1,2,3]
2021-12-26 15:07:07 +0100 <otherwise> this is exactly why I started to write a function to perform this, cause I couldnt make it work in prelude
2021-12-26 15:08:10 +0100ProfSimm(~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
2021-12-26 15:08:17 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-26 15:09:00 +0100 <geekosaur> `take 4 (listOfFuns 3)` is almost right. But not quite
2021-12-26 15:09:09 +0100kayprish(~kayprish@188.120.102.122)
2021-12-26 15:09:10 +0100 <otherwise> "Couldn't match expected type ‘(Int -> [a0] -> [a0]) -> t0 -> t1 -> t' " is the error message, which I am not sure how to translate into an english sentence
2021-12-26 15:09:50 +0100 <geekosaur> `(take 4 listOfFuns) 3` is closer, but still not quite right
2021-12-26 15:10:15 +0100 <geekosaur> Try figuring out why moving the parentheses helps, then see if that helps you figure out what else is wrong
2021-12-26 15:10:17 +0100falafel_(~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 240 seconds)
2021-12-26 15:10:51 +0100 <otherwise> hmm
2021-12-26 15:11:35 +0100 <geekosaur> (both are the same error, in fact, and the same error I pointed up earlier)
2021-12-26 15:15:09 +0100sprout(~quassel@2a02:a467:ccd6:1:b165:3b1b:f1f6:f4de) (Ping timeout: 268 seconds)
2021-12-26 15:16:02 +0100sprout(~quassel@2a02:a467:ccd6:1:b165:3b1b:f1f6:f4de)
2021-12-26 15:16:21 +0100KvL(~KvL@user/KvL) (Ping timeout: 256 seconds)
2021-12-26 15:16:27 +0100 <geekosaur> let's start with: what is the type of listOfFuns? (its name should tell you)
2021-12-26 15:17:00 +0100Rum(~bourbon@user/rum) (Quit: WeeChat 3.4)
2021-12-26 15:17:46 +0100 <otherwise> listOfFuns :: (Num a, Enum a) => [a -> a]
2021-12-26 15:18:00 +0100 <otherwise> I was just reading :doc Enum
2021-12-26 15:18:28 +0100ProfSimm(~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
2021-12-26 15:18:33 +0100 <geekosaur> So, what do you think the type of `listOfFuns 3` should be, and why?
2021-12-26 15:18:47 +0100ProfSimm(~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
2021-12-26 15:19:13 +0100 <otherwise> oh god
2021-12-26 15:20:09 +0100 <otherwise> a -> a
2021-12-26 15:20:16 +0100 <geekosaur> if you ask ghci it'll be gobbledygook. I want to hear what *you* think it should be
2021-12-26 15:20:23 +0100 <otherwise> but it just gives an error so...
2021-12-26 15:20:32 +0100Bartol(~Bartol@user/Bartol)
2021-12-26 15:20:34 +0100 <geekosaur> ok, why do you think that?
2021-12-26 15:20:44 +0100Bartol(~Bartol@user/Bartol) (Client Quit)
2021-12-26 15:20:56 +0100 <otherwise> I think it is something like: function -> Int -> [a]
2021-12-26 15:21:19 +0100Midjak(~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Ping timeout: 268 seconds)
2021-12-26 15:21:43 +0100 <otherwise> where listOfFuns is a function that takes an input, a, then returns a list [a]
2021-12-26 15:21:58 +0100 <geekosaur> but it is not a function, it is a list of functions
2021-12-26 15:21:58 +0100 <otherwise> (Int is a)
2021-12-26 15:22:07 +0100 <otherwise> right...
2021-12-26 15:22:11 +0100 <geekosaur> not a function of lists
2021-12-26 15:22:33 +0100 <otherwise> so [a] -> a -> [a]
2021-12-26 15:22:40 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 15:23:01 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 15:23:01 +0100ProfSimm(~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Ping timeout: 256 seconds)
2021-12-26 15:23:38 +0100 <geekosaur> :t let listOfFuns = map (*) [0..] in listOfFuns 3
2021-12-26 15:23:39 +0100 <lambdabot> error:
2021-12-26 15:23:39 +0100 <lambdabot> • Couldn't match expected type ‘t0 -> t’
2021-12-26 15:23:39 +0100 <lambdabot> with actual type ‘[a0 -> a0]’
2021-12-26 15:23:59 +0100 <geekosaur> again, it is not a function, it is a list of functions
2021-12-26 15:24:25 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-26 15:24:38 +0100 <otherwise> okay, so [a->a] -> a -> [a]
2021-12-26 15:25:14 +0100 <geekosaur> you keep doing that… now it's a function on a list of functions. where does that function come from?
2021-12-26 15:25:28 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 15:25:54 +0100 <otherwise> I don't know what a0 means
2021-12-26 15:26:32 +0100 <geekosaur> you don't really care
2021-12-26 15:27:08 +0100 <geekosaur> it's not relevant. the compiler is using that because it has no idea either, because this function has cropped up out of nowhere and it has no idea what to do with it
2021-12-26 15:28:40 +0100 <otherwise> Okay, so the goal is to evaluate listOfNums with the function take, and understanding the type of listOfNums and take is the path to salvation
2021-12-26 15:29:04 +0100 <geekosaur> that's part of it. as I said earlier
2021-12-26 15:29:27 +0100 <geekosaur> this is why moving the parentheses is part of the answer: it applies take to the list instead of to nonsense
2021-12-26 15:29:34 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 15:29:45 +0100 <geekosaur> but afterward you still try to apply a list to a number and it's still nonsense
2021-12-26 15:29:56 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 15:29:57 +0100 <geekosaur> becuase lists aren't functions
2021-12-26 15:30:16 +0100 <geekosaur> > [0] 0
2021-12-26 15:30:18 +0100 <lambdabot> error:
2021-12-26 15:30:18 +0100 <lambdabot> • Couldn't match expected type ‘t0 -> t’ with actual type ‘[a0]’
2021-12-26 15:30:18 +0100 <lambdabot> • The function ‘[0]’ is applied to one argument,
2021-12-26 15:30:40 +0100 <geekosaur> % [0] 0
2021-12-26 15:30:40 +0100 <yahb> geekosaur: ; <interactive>:7:1: error:; * Could not deduce (IsList (t0 -> t1)); (maybe you haven't applied a function to enough arguments?); from the context: (IsList (t -> t1), Num (Item (t -> t1)), Num t); bound by the inferred type for `it':; forall {t} {t1}. (IsList (t -> t1), Num (Item (t -> t1)), Num t) => t1; at <interactive>:7:1-5; The type variable
2021-12-26 15:30:47 +0100 <geekosaur> ugh
2021-12-26 15:31:10 +0100 <geekosaur> % :set -NoOverloadedLists
2021-12-26 15:31:10 +0100 <yahb> geekosaur: Some flags have not been recognized: -NoOverloadedLists
2021-12-26 15:31:26 +0100 <geekosaur> % :set -XNoOverloadedLists
2021-12-26 15:31:26 +0100 <yahb> geekosaur:
2021-12-26 15:31:31 +0100 <geekosaur> % [0] 0
2021-12-26 15:31:31 +0100 <yahb> geekosaur: ; <interactive>:10:1: error:; * Couldn't match expected type: t0 -> t; with actual type: [a0]; * The function `[0]' is applied to one value argument, but its type `[a0]' has none; In the expression: [0] 0; In an equation for `it': it = [0] 0; * Relevant bindings include it :: t (bound at <interactive>:10:1)
2021-12-26 15:32:16 +0100 <geekosaur> "The function `[0]' is applied to one value argument, but its type `[a0]' has none"
2021-12-26 15:32:31 +0100 <geekosaur> which is GHC-ese for "a list is not a function"
2021-12-26 15:33:37 +0100 <geekosaur> so what are you actually trying to do with `listOfFuns 3` (or `(take 4 listOfFuns) 3`)?
2021-12-26 15:33:49 +0100 <geekosaur> what do you think it should do, as opposed to what it actually does?
2021-12-26 15:34:47 +0100 <otherwise> I'm just trying to understand how to use map (*) [1,2,3,4]
2021-12-26 15:34:49 +0100 <geekosaur> do not consult ghci for this
2021-12-26 15:35:37 +0100 <otherwise> so I figure if I can do (!!) to it, I should be able to do some other function to it, but I'm not yet able to get anything other than (!!) to work
2021-12-26 15:35:46 +0100 <geekosaur> but you must understand this to understand how to use it
2021-12-26 15:36:17 +0100kayprish(~kayprish@188.120.102.122) (Read error: Connection reset by peer)
2021-12-26 15:36:29 +0100 <otherwise> maybe head is an easier one to do before take?
2021-12-26 15:36:47 +0100 <geekosaur> it will be because you will no longer have a list
2021-12-26 15:37:11 +0100 <geekosaur> but then you do not understand what `map (*) [0..]` does
2021-12-26 15:37:26 +0100 <geekosaur> you understand what `(*0)` does
2021-12-26 15:37:44 +0100 <otherwise> yes, it is partially applying * to 0
2021-12-26 15:37:52 +0100 <geekosaur> sigh
2021-12-26 15:37:58 +0100 <geekosaur> that was not the point
2021-12-26 15:38:09 +0100 <geekosaur> you are removing the list and have only its first element
2021-12-26 15:38:31 +0100 <geekosaur> at some point you will have to learn to work with the list
2021-12-26 15:39:22 +0100 <otherwise> yes, although I dont know how to make a function act on listOfNums
2021-12-26 15:39:47 +0100 <geekosaur> most list functions will work on it
2021-12-26 15:39:47 +0100 <otherwise> for example, It is not clear why listOfNums 3
2021-12-26 15:39:54 +0100 <otherwise> is not valid
2021-12-26 15:39:57 +0100 <geekosaur> it will not work as a function itself
2021-12-26 15:40:32 +0100 <int-e> A list of functions isn't itself a function.
2021-12-26 15:40:34 +0100 <geekosaur> because `listOfNums 3` says "`listOfNums 3` is a function. Apply that function to the value 3"
2021-12-26 15:40:36 +0100 <otherwise> I guess I dont know how to pass into the list to activate the function
2021-12-26 15:41:02 +0100 <geekosaur> but `listOfFuns` is not a function, it is a list of functions
2021-12-26 15:41:07 +0100 <int-e> Well, you need a way to operate on the list elements.
2021-12-26 15:41:11 +0100 <geekosaur> "the" function?
2021-12-26 15:41:23 +0100 <int-e> (Which are functions, so you can apply those to other things.)
2021-12-26 15:41:41 +0100 <otherwise> the, as in each element of the list is a function
2021-12-26 15:41:52 +0100 <geekosaur> but that is not "the" function
2021-12-26 15:42:04 +0100 <otherwise> i guess * is the function
2021-12-26 15:42:06 +0100 <geekosaur> it is "zero or more functions". so which if any do you want to use?
2021-12-26 15:42:20 +0100 <geekosaur> but it is not simply (*)
2021-12-26 15:42:39 +0100 <geekosaur> it is [(*0), (*1), (*2), ...]
2021-12-26 15:42:45 +0100 <geekosaur> which one if any do you want?
2021-12-26 15:42:56 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-26 15:43:19 +0100 <int-e> (technically they're (0*), (1*) etc.)
2021-12-26 15:43:20 +0100 <otherwise> okay, so I was able to do h = head listOfFuns
2021-12-26 15:43:29 +0100 <otherwise> then h 3
2021-12-26 15:43:32 +0100 <otherwise> which is 0
2021-12-26 15:43:35 +0100 <geekosaur> (this is why I brought up (*0) earlier; if you use head you get only the first of them)
2021-12-26 15:44:05 +0100 <otherwise> then t = listOfFuns works
2021-12-26 15:44:12 +0100 <otherwise> but t 3 does not work
2021-12-26 15:44:25 +0100 <geekosaur> right, because you are applying a list to a number
2021-12-26 15:44:29 +0100 <int-e> because that's still a list, not a function
2021-12-26 15:44:30 +0100 <otherwise> oops
2021-12-26 15:44:36 +0100 <otherwise> I meant t = take 3 listOfFuns
2021-12-26 15:44:43 +0100 <geekosaur> which is still a list
2021-12-26 15:44:57 +0100 <int-e> same reason: that's still a list, not a function
2021-12-26 15:44:59 +0100 <geekosaur> you just know the list is no more than 3 elements instead of possibly infinite
2021-12-26 15:45:10 +0100 <otherwise> so i need to pattern match?
2021-12-26 15:45:35 +0100 <otherwise> and recursion?
2021-12-26 15:45:39 +0100 <geekosaur> so, your possibilities become: (a) ignore it; (b) pick one element/function to use; (c) use all of them ("folding")
2021-12-26 15:46:05 +0100 <geekosaur> (a) is trivial. (b) is what (!!) does. (c) you use foldl' or foldr
2021-12-26 15:46:06 +0100 <int-e> otherwise: you have seen the right highe-order function to use already
2021-12-26 15:46:11 +0100n3rdy1(~n3rdy1@2601:281:c780:a510:84eb:b2e:7b61:4002)
2021-12-26 15:46:23 +0100 <int-e> (if you want to apply all those functions to a fixed value)
2021-12-26 15:46:34 +0100 <int-e> (which I *think* is your intent)
2021-12-26 15:46:44 +0100 <geekosaur> (monochrom moment: since you started with 0, you already know the answer to the fold :)
2021-12-26 15:46:51 +0100 <otherwise> i just want take to work
2021-12-26 15:47:10 +0100 <geekosaur> take itself is not a problem. you just seem to be confused about what it gave you
2021-12-26 15:47:11 +0100 <int-e> > product [0..-1] --monochrom follow-up
2021-12-26 15:47:12 +0100 <lambdabot> error:
2021-12-26 15:47:12 +0100 <lambdabot> • Variable not in scope: (..-) :: t0 -> t1 -> a
2021-12-26 15:47:12 +0100 <lambdabot> • Perhaps you meant ‘...’ (imported from Control.Lens)
2021-12-26 15:47:19 +0100 <int-e> > product [0.. -1]
2021-12-26 15:47:20 +0100 <lambdabot> 1
2021-12-26 15:47:24 +0100 <int-e> meh. that gets me way too often
2021-12-26 15:47:29 +0100 <geekosaur> heh
2021-12-26 15:47:58 +0100 <int-e> :t map
2021-12-26 15:47:59 +0100 <lambdabot> (a -> b) -> [a] -> [b]
2021-12-26 15:49:38 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-26 15:49:41 +0100 <otherwise> > map (3*) [1,3..9]
2021-12-26 15:49:43 +0100 <lambdabot> [3,9,15,21,27]
2021-12-26 15:49:46 +0100 <otherwise> I get that
2021-12-26 15:50:13 +0100 <otherwise> I dont get partial application, then being able to use the list of functions after it is created
2021-12-26 15:50:40 +0100 <otherwise> It seems to be an impenetrable list!
2021-12-26 15:50:55 +0100 <int-e> `map` gets you "inside"
2021-12-26 15:51:11 +0100 <otherwise> ...
2021-12-26 15:51:24 +0100 <otherwise> map into to the maped partial list!?
2021-12-26 15:51:36 +0100 <int-e> it's not a partial list
2021-12-26 15:51:41 +0100 <int-e> it's a list of partial applications
2021-12-26 15:52:47 +0100 <int-e> So... maybe an exercise: Write a function f such that f (3*) and f (4*) evaluate to 3*4 and 4*5.
2021-12-26 15:53:16 +0100 <int-e> uhm
2021-12-26 15:53:21 +0100 <int-e> 3*4 and 4*4.
2021-12-26 15:53:36 +0100 <int-e> Sorry, I didn't mean to vary the second argument there.
2021-12-26 15:53:52 +0100fef(~thedawn@user/thedawn)
2021-12-26 15:54:08 +0100 <otherwise> I get it
2021-12-26 15:54:37 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 268 seconds)
2021-12-26 15:54:37 +0100 <geekosaur> I think the confusion is somewhere else
2021-12-26 15:54:47 +0100 <geekosaur> What do you believe `take 4` does to a list?
2021-12-26 15:55:07 +0100 <int-e> :t take 4
2021-12-26 15:55:08 +0100 <lambdabot> [a] -> [a]
2021-12-26 15:55:48 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
2021-12-26 15:56:12 +0100 <geekosaur> compare to
2021-12-26 15:56:17 +0100 <geekosaur> :t (!! 4)
2021-12-26 15:56:18 +0100 <lambdabot> [a] -> a
2021-12-26 15:56:40 +0100 <otherwise> I think it does (head list): head(tail list): head(tail (tail list)): head (tail (tail ( tail list) ) )
2021-12-26 15:57:10 +0100 <geekosaur> You keep talking as if after `take 4` the list contains one function, but in fact it contains four
2021-12-26 15:57:15 +0100 <otherwise> except I think that last term is in brackets
2021-12-26 15:57:25 +0100 <geekosaur> So to get a function, you must either choose one or fold over all of them
2021-12-26 16:01:55 +0100albet70(~xxx@2400:8902::f03c:92ff:fe60:98d8)
2021-12-26 16:03:07 +0100 <geekosaur> In particular, you cannot get the original (*) back, because you mapped it over a list of numbers, so you have a list [ (0*), (1*), (2*) ... ]
2021-12-26 16:03:23 +0100 <geekosaur> so now you must do something with that derived list
2021-12-26 16:05:57 +0100 <otherwise> https://paste.tomsmeding.com/JbXPMeaN
2021-12-26 16:06:12 +0100 <otherwise> although it is an infinite list...
2021-12-26 16:07:04 +0100 <geekosaur> then you did `take 4`, so now you have [ (0*), (1*), (2*), (3*) ]. so now you have to pick one, or fold over all of them
2021-12-26 16:07:33 +0100 <geekosaur> you can't simply apply it to 3 and expect something sane to happen, because it has no idea which if any of the functions you intended
2021-12-26 16:08:09 +0100 <otherwise> sounds like fold is a prerequisite
2021-12-26 16:08:13 +0100 <geekosaur> not only infinite but also overengineered
2021-12-26 16:08:28 +0100 <geekosaur> no, you could pick one of them instead of folding over all of them
2021-12-26 16:08:40 +0100 <geekosaur> it's not clear to me which you intend
2021-12-26 16:10:07 +0100 <otherwise> I was intending over all of them that I take
2021-12-26 16:10:33 +0100 <otherwise> I know to take a specific one I can just use !!
2021-12-26 16:10:36 +0100 <geekosaur> ok, so you want a fold
2021-12-26 16:10:52 +0100 <geekosaur> > foldr f z [a,b,c,d]
2021-12-26 16:10:53 +0100 <lambdabot> f a (f b (f c (f d z)))
2021-12-26 16:11:17 +0100 <geekosaur> or a map, if you want the result for each element instead of for all elements combined
2021-12-26 16:11:26 +0100 <geekosaur> > map f [a,b,c,d]
2021-12-26 16:11:28 +0100 <lambdabot> error:
2021-12-26 16:11:28 +0100 <lambdabot> • Ambiguous type variable ‘b0’ arising from a use of ‘show_M880334822319...
2021-12-26 16:11:28 +0100 <lambdabot> prevents the constraint ‘(Show b0)’ from being solved.
2021-12-26 16:11:33 +0100 <geekosaur> ble
2021-12-26 16:11:41 +0100 <geekosaur> > map f [a,b,c,d] :: Expr
2021-12-26 16:11:43 +0100 <lambdabot> error:
2021-12-26 16:11:43 +0100 <lambdabot> • Couldn't match expected type ‘Expr’ with actual type ‘[b0]’
2021-12-26 16:11:43 +0100 <lambdabot> • In the expression: map f [a, b, c, ....] :: Expr
2021-12-26 16:11:53 +0100 <geekosaur> > map f [a,b,c,d :: Expr]
2021-12-26 16:11:54 +0100 <lambdabot> error:
2021-12-26 16:11:54 +0100 <lambdabot> • Ambiguous type variable ‘b0’ arising from a use of ‘show_M203210898510...
2021-12-26 16:11:54 +0100 <lambdabot> prevents the constraint ‘(Show b0)’ from being solved.
2021-12-26 16:11:58 +0100 <g> :t f
2021-12-26 16:11:59 +0100 <lambdabot> FromExpr a => a
2021-12-26 16:12:01 +0100 <geekosaur> wow, this is annoying
2021-12-26 16:12:03 +0100 <otherwise> okay, i have not yet used fold, so I'm reading up on LYAH
2021-12-26 16:12:32 +0100 <geekosaur> > map f [a,b,c,d :: Expr] :: [Expr]
2021-12-26 16:12:34 +0100 <lambdabot> [f a,f b,f c,f d]
2021-12-26 16:12:41 +0100 <geekosaur> there we go
2021-12-26 16:15:55 +0100 <geekosaur> note that a fold will give you one result, whereas map will give you four
2021-12-26 16:16:01 +0100 <geekosaur> (in a list)
2021-12-26 16:16:18 +0100 <otherwise> oh, so I guess I want map...
2021-12-26 16:18:17 +0100CiaoSen(~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
2021-12-26 16:18:48 +0100 <otherwise> I need to take a break, this is too much failure in a row
2021-12-26 16:19:33 +0100 <geekosaur> I'm going to be leaving to go shopping shortly so someone else will probably have to pick it up from here
2021-12-26 16:19:35 +0100 <otherwise> I'll come back to this problem after I get some positive feedback from the compile for a while.
2021-12-26 16:19:46 +0100 <otherwise> Thanks for the help geekosaur! :)
2021-12-26 16:32:07 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-26 16:32:07 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-26 16:32:07 +0100wroathe(~wroathe@user/wroathe)
2021-12-26 16:32:12 +0100bollu(uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2021-12-26 16:32:25 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
2021-12-26 16:33:29 +0100Rum(~bourbon@user/rum)
2021-12-26 16:36:37 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
2021-12-26 16:49:17 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 256 seconds)
2021-12-26 16:50:42 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net)
2021-12-26 16:52:51 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
2021-12-26 16:53:18 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 16:53:36 +0100_ht(~quassel@82-169-194-8.biz.kpn.net)
2021-12-26 16:53:40 +0100Everything(~Everythin@37.115.210.35)
2021-12-26 16:55:13 +0100shapr(~user@pool-100-36-247-68.washdc.fios.verizon.net)
2021-12-26 16:55:25 +0100 <phaazon> hey, anyone used to pandoc?
2021-12-26 16:55:29 +0100 <mjrosenb> Does anyone have emacs+hls set up? I think I've gotten it working, but it doesn't *do* anything
2021-12-26 16:55:57 +0100 <phaazon> I’m trying to use the WriterOption that allows to set a syntax highlighter, and when going from Markdown to HTML5, I get classes annotated everywhere in block codes, but no actual highlight (it looks like I have to provide a CSS?)
2021-12-26 16:56:01 +0100 <phaazon> anyone has an idea?
2021-12-26 16:57:45 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 250 seconds)
2021-12-26 16:58:00 +0100goepsilongo(~goepsilon@2806:263:c404:8000:ec3a:2574:2f9:e2db)
2021-12-26 17:04:58 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 17:09:42 +0100 <lyxia> phaazon: you can try this to get some basic style out of pandoc/skylighting http://fixpt.de/blog/2017-12-03-hakyll-highlighting-themes.html or you can make your own or you can grab some themes from the web.
2021-12-26 17:11:46 +0100otherwise(~otherwise@2601:602:880:90f0:144d:55a8:1e87:818) (Remote host closed the connection)
2021-12-26 17:13:16 +0100Rum(~bourbon@user/rum) (Quit: WeeChat 3.4)
2021-12-26 17:17:49 +0100dcoutts_(~duncan@71.78.6.51.dyn.plus.net) (Ping timeout: 240 seconds)
2021-12-26 17:20:52 +0100 <phaazon> lyxia: ah so you do have to write a CSS file
2021-12-26 17:20:54 +0100 <phaazon> interesting, thanks
2021-12-26 17:21:04 +0100ProfSimm(~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
2021-12-26 17:26:40 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
2021-12-26 17:27:41 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-26 17:30:49 +0100zer0bitz_(~zer0bitz@185.112.82.230)
2021-12-26 17:33:50 +0100zer0bitz(~zer0bitz@196.244.192.57) (Ping timeout: 260 seconds)
2021-12-26 17:39:09 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
2021-12-26 17:45:01 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-12-26 17:45:23 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-26 17:45:36 +0100__monty__(~toonn@user/toonn)
2021-12-26 17:48:06 +0100Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-12-26 17:48:16 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2021-12-26 17:54:37 +0100stef204(~stef204@user/stef204)
2021-12-26 17:55:03 +0100nckxmasnckx
2021-12-26 17:57:11 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-26 17:58:13 +0100stef204(~stef204@user/stef204) (Client Quit)
2021-12-26 17:59:20 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 17:59:33 +0100neceve(~quassel@2.26.93.228) (Ping timeout: 256 seconds)
2021-12-26 17:59:37 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-26 18:05:14 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-26 18:05:14 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-26 18:05:14 +0100wroathe(~wroathe@user/wroathe)
2021-12-26 18:08:20 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Remote host closed the connection)
2021-12-26 18:08:56 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 18:09:07 +0100rekahsoft(~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com)
2021-12-26 18:09:28 +0100stef204(~stef204@user/stef204)
2021-12-26 18:09:30 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 18:10:19 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 256 seconds)
2021-12-26 18:13:19 +0100neceve(~quassel@2.26.93.228)
2021-12-26 18:14:13 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-12-26 18:14:50 +0100 <mjrosenb> hrm, it looks like lsp thinks it is capable of doing things, but it does (almost) nothing.
2021-12-26 18:16:04 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 18:20:31 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 250 seconds)
2021-12-26 18:21:48 +0100syrkis(~syrkis@82.192.167.70) (Quit: Client closed)
2021-12-26 18:21:51 +0100 <mjrosenb> also, it looks like there isn't any zip/unzip variant for maps.
2021-12-26 18:22:41 +0100 <mjrosenb> I guess unzip m = (map fst m, map snd m) isn't going to be as performant as it could be, but better than going to a list?
2021-12-26 18:25:35 +0100python476(~user@88.160.31.174)
2021-12-26 18:25:56 +0100falafel_(~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
2021-12-26 18:27:20 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-26 18:28:57 +0100stef204(~stef204@user/stef204) (Quit: WeeChat 3.4)
2021-12-26 18:31:07 +0100pavonia(~user@user/siracusa) (Quit: Bye!)
2021-12-26 18:35:46 +0100 <EvanR> mjrosenb, there's unionWith, unionWithKey, differenceWith, differenceWithKey, intersectionWith, intersectionWithKey
2021-12-26 18:35:47 +0100ym(~ym@pool-96-253-29-94.prvdri.fios.verizon.net)
2021-12-26 18:36:27 +0100ProfSimm(~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
2021-12-26 18:36:31 +0100 <EvanR> unzip seems like a bunch of maps / mapWithKey
2021-12-26 18:36:47 +0100ProfSimm(~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
2021-12-26 18:39:07 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 18:40:55 +0100ProfSimm(~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
2021-12-26 18:41:02 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-26 18:42:01 +0100econo(uid147250@user/econo)
2021-12-26 18:43:17 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 240 seconds)
2021-12-26 18:49:13 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Remote host closed the connection)
2021-12-26 18:54:19 +0100whaletechno(~whaletech@user/whaletechno)
2021-12-26 18:54:45 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 250 seconds)
2021-12-26 18:55:00 +0100Morrow(~quassel@bzq-110-168-31-106.red.bezeqint.net)
2021-12-26 18:55:41 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 18:58:17 +0100zer0bitz_(~zer0bitz@185.112.82.230) (Ping timeout: 240 seconds)
2021-12-26 18:58:34 +0100zer0bitz(~zer0bitz@196.244.192.56)
2021-12-26 18:58:44 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 18:59:57 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
2021-12-26 19:00:14 +0100vysn(~vysn@user/vysn) (Ping timeout: 268 seconds)
2021-12-26 19:01:58 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 19:02:15 +0100johnw(~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
2021-12-26 19:02:50 +0100 <iphy> I have an AST and a traversal module (https://github.com/iphydf/hs-cimple/blob/generalised-traverse/src/Language/Cimple/TraverseAst.hs#L…) which traverses the AST forwards. is there an elegant way to support both forward and reverse traversal here?
2021-12-26 19:04:01 +0100 <sshine> what's reverse traversal?
2021-12-26 19:06:24 +0100 <iphy> e.g. in a function I have statements. forward traversal is traversing the statements in order, reverse is traversing the statements in reverse order
2021-12-26 19:07:15 +0100 <sshine> ohhh, so sort of a left-to-right/right-to-left or pre-/post-order
2021-12-26 19:07:33 +0100 <iphy> this traversal looks at every AST node once. if I number the nodes 1..n then the reverse traversal should be giving me numbers n..1
2021-12-26 19:07:59 +0100 <EvanR> you can use a newtype wrapper to change the Traversable instance to one that goes backwards
2021-12-26 19:08:41 +0100 <sshine> I was also thinking of something like Down.
2021-12-26 19:09:05 +0100 <iphy> I'm (mostly) not using Traversable here, because my traversal is a bit more complicated with multiple types
2021-12-26 19:09:11 +0100 <sshine> right.
2021-12-26 19:09:17 +0100 <sshine> TraverseAst in your case.
2021-12-26 19:09:28 +0100 <iphy> Accessor <$> recurse name <*> recurse params <*> recurse errors
2021-12-26 19:09:35 +0100 <iphy> for example ^
2021-12-26 19:09:42 +0100 <EvanR> (a type that contains other traversable types can be made traversable)
2021-12-26 19:10:04 +0100 <iphy> <*> should be reversed
2021-12-26 19:10:20 +0100 <iphy> instead of name, params, errors, I want to traverse errors, params, name
2021-12-26 19:10:29 +0100 <EvanR> yeah, so either way you want a second implementation of the traversal
2021-12-26 19:10:48 +0100 <iphy> so a copy of the TraverseAst module?
2021-12-26 19:11:12 +0100 <sshine> iphy, so... the least elegant way is to define an instance TraverseAst ... (SomeWrapper (Node ...) where ...
2021-12-26 19:11:27 +0100 <EvanR> yeah. Of course there are generic ways to traverse any generic both ways
2021-12-26 19:13:06 +0100 <sshine> iphy, with a copy of your current mapFileAst instance definition, but where you explicitly do { lastThingY <- recurse lastThingX; firstThingY <- recurse firstThingX; pure (AstThing firstThingY lastThingY) }
2021-12-26 19:13:17 +0100 <iphy> :\
2021-12-26 19:13:24 +0100 <sshine> iphy, (I'm just thinking loud, I'm sure you're trying to avoid this exact thing.)
2021-12-26 19:13:28 +0100 <iphy> yeah
2021-12-26 19:14:01 +0100Guest|70(~Guest|70@c-24-6-12-87.hsd1.ca.comcast.net)
2021-12-26 19:14:18 +0100BrokenClutch(~pioneer@2804:d41:c2a7:d800:e627:b00b:2c62:134)
2021-12-26 19:14:37 +0100 <iphy> also, it would need to be named differently I think, because that only goes 1 level deep, no?
2021-12-26 19:14:43 +0100 <iphy> as soon as you recurse, it's forward again
2021-12-26 19:15:32 +0100 <iphy> https://github.com/iphydf/hs-cimple/blob/generalised-traverse/src/Language/Cimple/AST.hs#L18
2021-12-26 19:15:38 +0100lavaman(~lavaman@98.38.249.169)
2021-12-26 19:15:47 +0100 <iphy> all the "Node attr lexeme" in there would have to be SomeWrapper'd
2021-12-26 19:16:00 +0100 <sshine> ah, yes, you'd need to wrap sub-ast elements in SomeWrapper to continue that way.
2021-12-26 19:16:01 +0100 <iphy> an alternative is to pass a Direction flag around and decide based on that
2021-12-26 19:16:13 +0100 <iphy> sshine: ah right
2021-12-26 19:16:22 +0100 <iphy> recurse (SomeWrapper lastThingX) etc.
2021-12-26 19:16:58 +0100 <EvanR> when you start to put wrappers on all nodes and subnodes, you might want to step back and factor your original structure
2021-12-26 19:17:02 +0100 <iphy> (define recurse as SomeWrapper . mapFileAst
2021-12-26 19:17:03 +0100 <iphy> )
2021-12-26 19:17:43 +0100 <sshine> so if your AST has that style, I forgot what it's called... like barbies: https://hackage.haskell.org/package/barbies ... and what EvanR suggests ... then you're halfway sold on recursion-schemes, I guess. it's a trade-off: manually working with your AST becomes bothersome, but writing generic traversal becomes easier.
2021-12-26 19:17:58 +0100coot(~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Quit: coot)
2021-12-26 19:18:11 +0100 <EvanR> like instead of data AST = A X | B Y AST | C Z AST Z, ADTF a = A X | B Y a | C Z a Z, something like this
2021-12-26 19:18:32 +0100 <EvanR> a bunch of these functors lets you do things in the betweens
2021-12-26 19:19:32 +0100 <sshine> is this HKD?
2021-12-26 19:19:53 +0100 <EvanR> not familiar with this jargon
2021-12-26 19:20:25 +0100 <iphy> ADTF?
2021-12-26 19:20:56 +0100 <geekosaur> HKD = higher kinded data
2021-12-26 19:21:24 +0100 <EvanR> functorized ADT, or whatever node type
2021-12-26 19:21:42 +0100 <sshine> yeah, but it could also be another typeclass, not necessarily Functor.
2021-12-26 19:21:52 +0100 <sshine> but I guess Functor is overwhelmingly useful here.
2021-12-26 19:22:08 +0100 <EvanR> Functor, among other things
2021-12-26 19:24:26 +0100xff0x(~xff0x@2001:1a81:538d:1a00:8897:3a22:97f4:9e71) (Ping timeout: 260 seconds)
2021-12-26 19:25:10 +0100xff0x(~xff0x@2001:1a81:538d:1a00:466f:9b53:869c:77ef)
2021-12-26 19:26:06 +0100 <iphy> barbies is kind of interesting
2021-12-26 19:28:22 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-12-26 19:30:05 +0100falafel_(~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 252 seconds)
2021-12-26 19:31:00 +0100Sgeo(~Sgeo@user/sgeo)
2021-12-26 19:33:23 +0100dyeplexer(~dyeplexer@user/dyeplexer) (Remote host closed the connection)
2021-12-26 19:33:40 +0100 <sshine> probably not the shortest path to reverse ast traversal
2021-12-26 19:33:57 +0100td_(~td@94.134.91.143) (Ping timeout: 240 seconds)
2021-12-26 19:35:40 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 19:35:53 +0100Jing(~hedgehog@125.105.141.97) (Ping timeout: 256 seconds)
2021-12-26 19:36:03 +0100td_(~td@94.134.91.110)
2021-12-26 19:40:40 +0100 <mjrosenb> EvanR: well, zip is a bunch of mapWithKey; unzip is just a pair of maps :-)
2021-12-26 19:40:47 +0100DNH(~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b)
2021-12-26 19:41:26 +0100 <EvanR> wouldn't zipping two maps be at least intersectionWithKey
2021-12-26 19:41:54 +0100 <EvanR> ah the Node type is parameterized by the lexeme... it could be more general probably
2021-12-26 19:42:59 +0100 <EvanR> a leaves everywhere, or f wrappers everywhere leads to things
2021-12-26 19:44:18 +0100 <EvanR> er, intersectionWith
2021-12-26 19:49:36 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
2021-12-26 19:51:09 +0100wroathe(~wroathe@user/wroathe)
2021-12-26 19:51:23 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-26 19:53:53 +0100justsomeguy(~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
2021-12-26 19:53:53 +0100urdh(~urdh@user/urdh) (Ping timeout: 256 seconds)
2021-12-26 19:53:57 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
2021-12-26 19:55:43 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 256 seconds)
2021-12-26 20:00:08 +0100ymqwym
2021-12-26 20:04:58 +0100 <BrokenClutch> How you guys do callback systems?
2021-12-26 20:04:59 +0100max22-(~maxime@2a01cb088335980027b3e3f3a18fa9f4.ipv6.abo.wanadoo.fr) (Ping timeout: 268 seconds)
2021-12-26 20:06:09 +0100 <EvanR> I'm not sure what you're actually asking, but fun fact, an IO Whatever value is basically a callback (with no arguments)
2021-12-26 20:06:29 +0100 <EvanR> Foo -> IO Bar is a callback with one arg
2021-12-26 20:06:43 +0100 <geekosaur> also, lazy evaluation means any function parameter is essentially a callback
2021-12-26 20:06:49 +0100 <iphy> sshine: shortest path isn't really important
2021-12-26 20:06:57 +0100 <iphy> I want to write less code and do more stuff
2021-12-26 20:07:14 +0100 <iphy> if it takes a refactoring of Node to become a HKD, that's ok
2021-12-26 20:09:28 +0100nitrix(~nitrix@user/nitrix)
2021-12-26 20:09:37 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-26 20:10:00 +0100nitrix(~nitrix@user/nitrix) ()
2021-12-26 20:11:17 +0100 <BrokenClutch> thanks, I'm one month in and I still can't get haskell well
2021-12-26 20:11:21 +0100 <monochrom> We guys generalize callback systems to "that's just another higher-order function" and we just write/use higher-order functions as appropriate.
2021-12-26 20:11:37 +0100urdh(~urdh@user/urdh)
2021-12-26 20:12:01 +0100 <monochrom> https://www.slideshare.net/ScottWlaschin/fp-patterns-buildstufflt slide 13
2021-12-26 20:12:13 +0100 <monochrom> We just write/use functions.
2021-12-26 20:13:24 +0100 <BrokenClutch> but only the guys do that?
2021-12-26 20:13:58 +0100 <EvanR> before going over so many cool things
2021-12-26 20:14:02 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
2021-12-26 20:14:09 +0100 <EvanR> BrokenClutch, what the hell is a callback system?
2021-12-26 20:14:11 +0100 <monochrom> You asked "you guys" so the answer in kind is "we guys".
2021-12-26 20:14:31 +0100 <EvanR> (in this case)
2021-12-26 20:15:08 +0100cheater(~Username@user/cheater) (Quit: Killed (BlackJac (Requested by panasync)))
2021-12-26 20:15:59 +0100 <BrokenClutch> I just kept forwarding the joke, sorry
2021-12-26 20:16:13 +0100burakcank(~burakcank@has.arrived.and.is.ready-to.party) (Ping timeout: 240 seconds)
2021-12-26 20:17:17 +0100Erutuon(~Erutuon@user/erutuon)
2021-12-26 20:17:55 +0100cosimone(~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Ping timeout: 268 seconds)
2021-12-26 20:18:23 +0100yauhsien(~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
2021-12-26 20:19:03 +0100lavaman(~lavaman@98.38.249.169) (Ping timeout: 250 seconds)
2021-12-26 20:20:00 +0100xkuru(~xkuru@user/xkuru)
2021-12-26 20:21:05 +0100 <EvanR> to give some system a thing to be used at a time of its choosing, yeah that could be a lazy value, a function, an IO action... all of which kind of just work... because they are all presented as the same thing in haskell
2021-12-26 20:22:19 +0100cheater(~Username@user/cheater)
2021-12-26 20:22:55 +0100deadmarshal(~deadmarsh@95.38.228.37) (Ping timeout: 256 seconds)
2021-12-26 20:23:47 +0100 <iphy> sshine: barbie makes things quite ugly
2021-12-26 20:23:59 +0100 <BrokenClutch> EvanR: got it. Thanks.
2021-12-26 20:24:20 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-26 20:24:39 +0100qwym(~ym@pool-96-253-29-94.prvdri.fios.verizon.net) (Quit: Textual IRC Client: www.textualapp.com)
2021-12-26 20:25:08 +0100 <EvanR> iphy, an example factoring is to take your Attr node out of that type and make that one kind of wrapper that goes at any level
2021-12-26 20:25:19 +0100 <EvanR> which takes 1 parameter out
2021-12-26 20:25:27 +0100 <iphy> yeah
2021-12-26 20:25:36 +0100 <iphy> that's the plan
2021-12-26 20:26:46 +0100 <iphy> | PreprocDefineMacro lexeme [Node attr lexeme] (Node attr lexeme)
2021-12-26 20:26:49 +0100 <iphy> does this become:
2021-12-26 20:26:58 +0100 <iphy> | PreprocDefineMacro lexeme [f (Node attr lexeme)] (f (Node attr lexeme))
2021-12-26 20:27:11 +0100burakcank(~burakcank@has.arrived.and.is.ready-to.party)
2021-12-26 20:27:16 +0100 <iphy> or does "f" go outside the list? or does it go both outside and inside the list?
2021-12-26 20:27:40 +0100 <iphy> (I'll get rid of attr later)
2021-12-26 20:27:59 +0100 <iphy> (also pretend I wrote "Node f attr lexeme")
2021-12-26 20:28:12 +0100 <EvanR> I'm thinking data Node lexeme a = ... PrepprocDefineMacro lexeme [a] a
2021-12-26 20:28:45 +0100 <EvanR> but I could be trippin
2021-12-26 20:28:56 +0100 <iphy> then what's the type of PrepprocDefineMacro lexeme [] (PrepprocDefineMacro lexeme [] Break)?
2021-12-26 20:29:20 +0100 <iphy> I mean, if it's "a", then the recursiveness of the datatype goes away, no?
2021-12-26 20:29:24 +0100 <EvanR> you mean, a Node with bare Nodes in it?
2021-12-26 20:29:29 +0100 <iphy> oh I see
2021-12-26 20:29:37 +0100 <EvanR> you'd need to make a newtype for that
2021-12-26 20:29:45 +0100 <EvanR> to do recursion
2021-12-26 20:30:07 +0100 <EvanR> which is why I've been renaming things to WhateverF
2021-12-26 20:30:15 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 20:32:15 +0100 <iphy> https://hackage.haskell.org/package/hypertypes#hkd-for-nested-structures
2021-12-26 20:32:53 +0100 <iphy> EvanR: interesting
2021-12-26 20:32:54 +0100 <EvanR> oh wow did not know recursion schemes did that
2021-12-26 20:33:32 +0100max22-(~maxime@2a01cb088335980093d703d768803864.ipv6.abo.wanadoo.fr)
2021-12-26 20:34:02 +0100 <EvanR> hypertypes, damn
2021-12-26 20:37:00 +0100kadir(~kadir@88.251.52.166) (goodnight)
2021-12-26 20:38:10 +0100falafel_(~falafel@cpe-76-168-195-162.socal.res.rr.com)
2021-12-26 20:39:34 +0100xff0x(~xff0x@2001:1a81:538d:1a00:466f:9b53:869c:77ef) (Ping timeout: 260 seconds)
2021-12-26 20:40:23 +0100xff0x(~xff0x@2001:1a81:538d:1a00:d7e1:e1de:38a1:c28f)
2021-12-26 20:42:06 +0100DNH(~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-12-26 20:42:21 +0100dcoutts_(~duncan@71.78.6.51.dyn.plus.net)
2021-12-26 20:45:06 +0100aeka`(~aeka@pool-100-4-208-71.albyny.fios.verizon.net)
2021-12-26 20:45:36 +0100 <iphy> https://www.irccloud.com/pastebin/oCyEMH6C/
2021-12-26 20:46:07 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 20:46:17 +0100 <iphy> I did this now, but I can't see how to use it without constructing huge types
2021-12-26 20:46:33 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 20:47:37 +0100aeka(~aeka@2606:6080:1001:d:c59c:6e9a:3115:6f2f) (Ping timeout: 240 seconds)
2021-12-26 20:50:37 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Ping timeout: 240 seconds)
2021-12-26 20:50:37 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 268 seconds)
2021-12-26 20:50:59 +0100goepsilongo(~goepsilon@2806:263:c404:8000:ec3a:2574:2f9:e2db) (Quit: Textual IRC Client: www.textualapp.com)
2021-12-26 20:51:50 +0100aeka`(~aeka@pool-100-4-208-71.albyny.fios.verizon.net) (Read error: Connection reset by peer)
2021-12-26 20:52:23 +0100 <EvanR> well at least you get map and fold for free
2021-12-26 20:52:36 +0100 <EvanR> and maybe other things in recursion schemes
2021-12-26 20:53:22 +0100 <EvanR> I vaguely recall being able to do traversals and handle particular node types without much code
2021-12-26 20:54:13 +0100fef(~thedawn@user/thedawn) (Quit: Leaving)
2021-12-26 20:55:12 +0100 <EvanR> the hypertypes page claims recursion-schemes can't deal with a mutually recursive version of this with e.g. 2 types, but I'm not sure if that's the library of the whole idea can't do it
2021-12-26 20:55:24 +0100 <EvanR> or*
2021-12-26 20:56:17 +0100cosimone(~user@93-47-231-248.ip115.fastwebnet.it)
2021-12-26 20:56:28 +0100 <iphy> EvanR: "at least", but how do I write a parser?
2021-12-26 20:57:20 +0100 <iphy> data ExprF a = Add a a | Sub a a | Int Int
2021-12-26 20:57:56 +0100 <iphy> Add (Sub (Int 3) (Int 2)) (Int 1)
2021-12-26 20:59:45 +0100DNH(~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b)
2021-12-26 20:59:55 +0100aeka(~aeka@user/hiruji)
2021-12-26 21:00:03 +0100 <EvanR> what's the goal type for the parser, just Expr, or some attributes stuffs around each node
2021-12-26 21:00:30 +0100 <iphy> the parser doesn't add attributes, that's for later passes to add
2021-12-26 21:00:51 +0100 <iphy> right now the parser never produces the Attr node
2021-12-26 21:01:20 +0100 <EvanR> well the bare Expr is probably = Fix ExprF
2021-12-26 21:01:48 +0100 <EvanR> then Int 5 :: Expr
2021-12-26 21:04:39 +0100 <EvanR> erm
2021-12-26 21:05:17 +0100juhp(~juhp@128.106.188.82) (Ping timeout: 240 seconds)
2021-12-26 21:05:37 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-26 21:05:41 +0100 <EvanR> Fix (Add e1 e2) :: Expr, something like that
2021-12-26 21:06:37 +0100aeka(~aeka@user/hiruji) (Ping timeout: 240 seconds)
2021-12-26 21:07:19 +0100aeka(~aeka@user/hiruji)
2021-12-26 21:07:24 +0100juhp(~juhp@128.106.188.82)
2021-12-26 21:08:48 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
2021-12-26 21:08:49 +0100 <EvanR> newtype Fix f = Fix { unFix :: f (Fix f) }
2021-12-26 21:09:39 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-26 21:10:00 +0100 <EvanR> type Expr = Fix ExprF
2021-12-26 21:10:13 +0100 <EvanR> Fix (Int 9) :: Expr
2021-12-26 21:10:17 +0100Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
2021-12-26 21:10:25 +0100 <iphy> so what would these look like? https://github.com/iphydf/hs-cimple/blob/generalised-traverse/src/Language/Cimple/Parser.y#L306
2021-12-26 21:10:39 +0100 <EvanR> Fix (Add that that) :: Expr
2021-12-26 21:10:58 +0100 <iphy> but Fix is of type Fix f, not Expr?
2021-12-26 21:11:36 +0100 <EvanR> which are equal, type synonyms
2021-12-26 21:11:40 +0100Pickchea(~private@user/pickchea)
2021-12-26 21:11:40 +0100 <geekosaur> above said Expr was itself Fix something
2021-12-26 21:11:53 +0100 <iphy> ah right, Expr
2021-12-26 21:12:21 +0100mvk(~mvk@2607:fea8:5cdd:f000::917a)
2021-12-26 21:12:41 +0100 <iphy> ok, so in the parser, what used to be "Add (Sub a b)" is now "Fix (Add (Fix (Sub a b)))"?
2021-12-26 21:13:05 +0100 <EvanR> if a parser really produces that... yeah
2021-12-26 21:13:30 +0100 <EvanR> basically a Fix newtype wrapper on any concrete construction
2021-12-26 21:14:08 +0100 <EvanR> Fix is used in libraries, but if you have other stuff going on with the `a' you could use your own newtype
2021-12-26 21:15:18 +0100 <iphy> ok, looks like pattern matching is going to be a pain
2021-12-26 21:15:36 +0100 <EvanR> which is why you want generic operations
2021-12-26 21:16:15 +0100 <iphy> with HKD, I can use a type family to erase Identity from the type and make pattern matching nice
2021-12-26 21:16:21 +0100 <EvanR> or if it's just singling out 1 kind of node, it's just putting a Fix there too
2021-12-26 21:16:57 +0100 <iphy> https://github.com/TokTok/hs-tokstyle/blob/master/src/Tokstyle/Linter/LoggerCalls.hs#L23
2021-12-26 21:17:17 +0100 <iphy> Fix (FunctionCall (Fix (LiteralExpr _ (L _ _ "LOGGER_ASSERT"))) (_:_:Fix (LiteralExpr String) _:_)
2021-12-26 21:17:42 +0100 <EvanR> yeah
2021-12-26 21:17:59 +0100DNH(~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-12-26 21:18:00 +0100 <EvanR> and if you have additional wrappers in there, those are there
2021-12-26 21:19:37 +0100 <EvanR> something something lens?
2021-12-26 21:20:39 +0100 <EvanR> FunctionCall prism
2021-12-26 21:22:59 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-12-26 21:22:59 +0100wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-12-26 21:22:59 +0100wroathe(~wroathe@user/wroathe)
2021-12-26 21:26:31 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk)
2021-12-26 21:27:25 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 240 seconds)
2021-12-26 21:32:03 +0100burnsidesLlama(~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
2021-12-26 21:37:08 +0100_ht(~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-12-26 21:42:06 +0100falafel_(~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 260 seconds)
2021-12-26 21:42:16 +0100pavonia(~user@user/siracusa)
2021-12-26 21:48:50 +0100amk(~amk@109.255.169.126) (Read error: Connection reset by peer)
2021-12-26 21:49:26 +0100amk(~amk@109.255.169.126)
2021-12-26 21:51:41 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
2021-12-26 21:52:46 +0100[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2021-12-26 21:55:57 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
2021-12-26 21:57:33 +0100cheater(~Username@user/cheater) (Ping timeout: 256 seconds)
2021-12-26 21:57:42 +0100stilgart(~Christoph@chezlefab.net) (Remote host closed the connection)
2021-12-26 21:57:45 +0100enikar(~enikar@user/enikar) (Quit: WeeChat 3.0)
2021-12-26 21:58:44 +0100enikar(~enikar@user/enikar)
2021-12-26 22:02:50 +0100zincy(~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
2021-12-26 22:03:58 +0100eggplantade(~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
2021-12-26 22:04:01 +0100cheater(~Username@user/cheater)
2021-12-26 22:06:13 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-12-26 22:10:53 +0100zmt00(~zmt00@user/zmt00) (Quit: Gone.)
2021-12-26 22:11:36 +0100raghavgururajan(ea769b8000@user/raghavgururajan)
2021-12-26 22:12:09 +0100DNH(~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b)
2021-12-26 22:12:21 +0100coot(~coot@89-64-85-93.dynamic.chello.pl)
2021-12-26 22:13:32 +0100enikar(~enikar@user/enikar) (Quit: WeeChat 3.3)
2021-12-26 22:15:17 +0100acidjnk(~acidjnk@p200300d0c7271e72b97741cdfe77e27f.dip0.t-ipconnect.de)
2021-12-26 22:21:33 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-26 22:23:37 +0100Pickchea(~private@user/pickchea) (Ping timeout: 256 seconds)
2021-12-26 22:25:32 +0100zer0bitz(~zer0bitz@196.244.192.56) (Ping timeout: 240 seconds)
2021-12-26 22:27:22 +0100Akiva(~Akiva@user/Akiva)
2021-12-26 22:30:14 +0100DNH(~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-12-26 22:40:02 +0100merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
2021-12-26 22:42:37 +0100zmt00(~zmt00@user/zmt00)
2021-12-26 22:42:41 +0100bitdex(~bitdex@gateway/tor-sasl/bitdex)
2021-12-26 22:51:22 +0100coot(~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
2021-12-26 22:54:07 +0100takuan(~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2021-12-26 23:04:08 +0100 <zero> can someone quickly explain `some` and `many` from Control.Applicative?
2021-12-26 23:04:23 +0100 <EvanR> :t some
2021-12-26 23:04:24 +0100 <lambdabot> Alternative f => f a -> f [a]
2021-12-26 23:04:27 +0100 <EvanR> :t many
2021-12-26 23:04:28 +0100 <lambdabot> Alternative f => f a -> f [a]
2021-12-26 23:06:28 +0100 <EvanR> :t (<|>)
2021-12-26 23:06:29 +0100 <lambdabot> Alternative f => f a -> f a -> f a
2021-12-26 23:06:57 +0100 <geekosaur> they're meant for parsers and not very meaningful outside of that context
2021-12-26 23:07:11 +0100 <geekosaur> "some" is roughly a regexp +, "many" a regexp "*"
2021-12-26 23:08:49 +0100 <geekosaur> Applicative and Alternative are good for context free parsers, hence their inclusion
2021-12-26 23:09:41 +0100 <zero> :t some (Just 7)
2021-12-26 23:09:42 +0100 <lambdabot> Num a => Maybe [a]
2021-12-26 23:09:51 +0100 <zero> > some (Just 7)
2021-12-26 23:09:53 +0100 <lambdabot> *Exception: <<loop>>
2021-12-26 23:09:56 +0100 <zero> ?
2021-12-26 23:10:24 +0100 <geekosaur> as I said, it's not very useful if not used in a parser
2021-12-26 23:10:30 +0100 <EvanR> > Just 7 <|> Just 9
2021-12-26 23:10:32 +0100 <lambdabot> Just 7
2021-12-26 23:10:35 +0100 <geekosaur> the instances for Maybe, lists, etc. are kinda sad
2021-12-26 23:10:35 +0100 <EvanR> > Nothing <|> Just 9
2021-12-26 23:10:37 +0100 <lambdabot> Just 9
2021-12-26 23:10:54 +0100 <zero> geekosaur: ok
2021-12-26 23:11:23 +0100 <geekosaur> well, maybe the one for lists since a list has the option of being a stream of tokens
2021-12-26 23:11:33 +0100 <geekosaur> Maybe is pretty useless for this though
2021-12-26 23:12:10 +0100 <geekosaur> basically it's only useful when the concept of "one or more" (some) or "zero or more" (many) applies, whereas Maybe is "zero or one"
2021-12-26 23:13:55 +0100 <geekosaur> so "some" and "many" can't rationally do anything for Maybe, so they bottom out
2021-12-26 23:16:43 +0100deadmarshal(~deadmarsh@95.38.116.71)
2021-12-26 23:16:43 +0100Pickchea(~private@user/pickchea)
2021-12-26 23:17:21 +0100DNH(~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b)
2021-12-26 23:18:13 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
2021-12-26 23:18:47 +0100 <EvanR> <|> for List seems to just do ++
2021-12-26 23:20:57 +0100deadmarshal(~deadmarsh@95.38.116.71) (Ping timeout: 240 seconds)
2021-12-26 23:22:12 +0100wroathe(~wroathe@user/wroathe)
2021-12-26 23:24:46 +0100dcoutts_(~duncan@71.78.6.51.dyn.plus.net) (Ping timeout: 260 seconds)
2021-12-26 23:24:47 +0100xff0x(~xff0x@2001:1a81:538d:1a00:d7e1:e1de:38a1:c28f) (Ping timeout: 268 seconds)
2021-12-26 23:25:33 +0100xff0x(~xff0x@2001:1a81:538d:1a00:2c7a:ecf1:d00f:a986)
2021-12-26 23:31:54 +0100vysn(~vysn@user/vysn)
2021-12-26 23:33:17 +0100 <dsal> Also <> -- many options if you like variety
2021-12-26 23:33:37 +0100 <EvanR> "haskell has too many operators"
2021-12-26 23:34:35 +0100 <Taneb> We've got less than the other language family where "monad" is a term of the art (APL/J etc where a monad is a verb with one argument)
2021-12-26 23:34:55 +0100 <dsal> I was refactoring and had <-=<< and was like... That should do somehing...
2021-12-26 23:35:16 +0100Feuermagier(~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds)
2021-12-26 23:35:27 +0100web-50(~web-50@185.202.32.108)
2021-12-26 23:36:54 +0100 <web-50> Is it a good practice to learn Abstract algebra and category theory with haskell? because I have heard definition of certain functions in haskell are not the same as what we theoretically learn in our courses.
2021-12-26 23:37:27 +0100 <dsal> Learning lots of different things lots of different ways is the only good practice.
2021-12-26 23:37:33 +0100 <dsal> Most mechanisms will lie to you.
2021-12-26 23:38:02 +0100 <sshine> web-50, that's a pretty open-ended question. you can learn abstract algebra if you like abstract algebra, and you'll find some concepts from there in Haskell, and you can go nuts with that, or you can code Haskell without doing much other than Functor, Monoid and Monad. :-P
2021-12-26 23:38:07 +0100tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Read error: Connection reset by peer)
2021-12-26 23:38:50 +0100tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
2021-12-26 23:38:55 +0100 <EvanR> even then, you may never see any Monad other than IO
2021-12-26 23:39:16 +0100 <sshine> EvanR, you'd avoid lists, too? ;)
2021-12-26 23:39:23 +0100 <sshine> EvanR, and even Maybe? ;)
2021-12-26 23:39:44 +0100 <EvanR> rarely used list monad as such
2021-12-26 23:39:47 +0100 <web-50> what about theorem provers like lean? isn't it better to start with that?
2021-12-26 23:40:06 +0100 <sshine> web-50, that depends on your assumptions.
2021-12-26 23:40:07 +0100 <EvanR> haskell can't prove theorems so that won't help much
2021-12-26 23:40:27 +0100 <EvanR> at best you'll be frustrated at how illogical it is
2021-12-26 23:40:53 +0100xff0x(~xff0x@2001:1a81:538d:1a00:2c7a:ecf1:d00f:a986) (Ping timeout: 252 seconds)
2021-12-26 23:41:01 +0100 <EvanR> haskell is for general purpose programming
2021-12-26 23:41:36 +0100 <web-50> can you recommend some valuable repos which uses haskell effectively to show its value compared to other languages?
2021-12-26 23:41:46 +0100xff0x(~xff0x@2001:1a81:538d:1a00:d6e3:ac9b:2d1c:a9e)
2021-12-26 23:42:18 +0100 <dsal> That's not really how it works.
2021-12-26 23:42:49 +0100 <sshine> web-50, I think some of the more popular haskell projects outside of the Haskell bubble are: Pandoc, ShellCheck, git-annex
2021-12-26 23:42:52 +0100 <dsal> I have software that I've written in Haskell where Haskell made it *much* easier than implementations that exist in other languages, but I'm not sure how easy it is to see that from just looking at repos.
2021-12-26 23:43:02 +0100 <hpc> simulavr is haskell too
2021-12-26 23:44:07 +0100 <sshine> web-50, if you are more into theorem proving, you could also look into Agda2.
2021-12-26 23:44:37 +0100 <web-50> yea, agda also quite cool
2021-12-26 23:44:50 +0100 <dsal> I'm not completely convinced I could write software in Agda.
2021-12-26 23:45:01 +0100 <monochrom> There is a book "The Haskell Road to Logic, Math and Programming". But I haven't taken a look.
2021-12-26 23:45:16 +0100 <EvanR> agda is actually pretty good
2021-12-26 23:45:18 +0100 <sshine> dsal, I'm convinced that I could write Agda code that generated Haskell code as part of its proving.
2021-12-26 23:45:55 +0100 <sshine> dsal, now maybe there's a core of your Haskell codebase that you'd like proven invariants about, rather than property tests.
2021-12-26 23:46:19 +0100tromp(~textual@dhcp-077-249-230-040.chello.nl)
2021-12-26 23:46:25 +0100geekosaurprograms in Haskell without knowing any of that advanced math…
2021-12-26 23:46:32 +0100sshinetoo
2021-12-26 23:46:36 +0100hpctoo
2021-12-26 23:46:58 +0100sshinetook part in an Agda workshop earlier this year, and it mostly consisted of placing 'refl' in the right places. :-D
2021-12-26 23:47:25 +0100 <EvanR> sorry I can't help but math (but it's not strictly necessary for haskell)
2021-12-26 23:48:09 +0100 <geekosaur> I've picked up a little bit *from* Haskell, but that's mostly from sitting around in here when the mathy types start talking
2021-12-26 23:48:12 +0100wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2021-12-26 23:48:26 +0100 <geekosaur> otherwise I know a little number theory
2021-12-26 23:48:33 +0100 <web-50> what I'm thinking is lean is also programming language and we can do alot with it because it's based on c++. google also has a training for haskell but I can't see much serious usage to fulfill my CV specially in favor of my theoretical knowledge to make something very cool as open-source
2021-12-26 23:49:01 +0100 <EvanR> lean is implemented in C++?
2021-12-26 23:49:14 +0100 <web-50> yes
2021-12-26 23:49:20 +0100 <EvanR> how does that help
2021-12-26 23:49:28 +0100 <monochrom> I don't think it matters.
2021-12-26 23:50:01 +0100 <monochrom> I know a statically typed, type-inferred programming language implemented in Lisp.
2021-12-26 23:50:03 +0100 <geekosaur> there's a C++ bot written in Haskell; that doesn't matter either
2021-12-26 23:50:52 +0100 <monochrom> And said programming language was in fact basically the opposite of Lisp on all fronts.
2021-12-26 23:51:13 +0100 <monochrom> Said programming language was just an old version of SML today.
2021-12-26 23:51:18 +0100 <geekosaur> for that matter there's a Haskell written in C (Hugs)
2021-12-26 23:52:07 +0100 <geekosaur> you can write anything in anything (turing equivalent) if you put your mind to it; that doesn't prove much
2021-12-26 23:52:58 +0100Midjak(~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
2021-12-26 23:53:13 +0100xkuru(~xkuru@user/xkuru) (Read error: Connection reset by peer)
2021-12-26 23:53:18 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-12-26 23:53:20 +0100Nolrai2(~Nolrai2@73.240.1.39)
2021-12-26 23:54:24 +0100otherwise(~otherwise@c-73-221-44-172.hsd1.wa.comcast.net)
2021-12-26 23:57:49 +0100coolnickname(uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
2021-12-26 23:57:54 +0100fizbin(~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 260 seconds)
2021-12-26 23:59:26 +0100gehmehgeh(~user@user/gehmehgeh) (Quit: Leaving)
2021-12-26 23:59:33 +0100 <sshine> web-50, it sounds like you want to give Lean a go.