Home liberachat/#haskell: Logs Calendar

Logs on 2021-12-26 (liberachat/#haskell)

00:00:16 sprout joins (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
00:00:17 × Megant quits (megant@user/megant) (Ping timeout: 240 seconds)
00:01:56 <lechner> aaron: the LYAH book is also available on archive.org (for free) https://archive.org/search.php?query=learn%20you%20a%20haskell
00:01:58 <aaron> lechner thank you, I had stumbled on stephendiehl's site but will certainly take your advice on that page
00:02:22 Megant joins (megant@user/megant)
00:03:47 <aaron> lechner: awesome, thank you for the link, I was having difficulty using archive.org
00:04:43 <lechner> aaron: there are two search boxes. this is for the open-access public library
00:05:53 juri_ joins (~juri@178.63.35.222)
00:06:00 × tito quits (tito@tilde.team) (Quit: WeeChat 3.3)
00:07:15 <aaron> I must say, I am busy checking out the book otherwise pointed out (Get Programming In Haskell) and it seems quite nice
00:08:02 <aaron> I find it strange that I didn't notice it while searching for good books to start with
00:09:41 × sprout quits (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 268 seconds)
00:10:32 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8415:925f:506a:a363) (Remote host closed the connection)
00:10:40 × acode quits (~acode@151.65.31.181) (Quit: Client closed)
00:10:57 × vysn quits (~vysn@user/vysn) (Ping timeout: 240 seconds)
00:13:52 <lechner> good price, too. two for one for $18, from the author!
00:14:32 <otherwise> I found this pdf for learn you a haskell:
00:14:33 <otherwise> http://barbra-coco.dyndns.org/yuri/functinal_programming/Learn%20You%20a%20Haskell%20for%20Great%20Good.pdf
00:15:29 <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"
00:16:01 <aaron> awesome, thank you!
00:17:14 <otherwise> :) glad you found interest in "get programming in haskell"
00:17:23 Guest85 joins (~Guest85@2a00:23c7:908b:e100:5eea:1dff:fe7c:1ffd)
00:18:57 × shailangsa quits (~shailangs@host109-159-108-207.range109-159.btcentralplus.com) (Ping timeout: 240 seconds)
00:20:47 <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.
00:20:53 timCF joins (~timCF@m91-129-100-224.cust.tele2.ee)
00:21:53 Techcable joins (~Techcable@168.235.93.147)
00:22:31 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:8415:925f:506a:a363)
00:22:47 <hpc> alternatively, to overwhelm you with resources, https://www.haskell.org/documentation/ :D
00:25:30 <aaron> awesome, checking it out, it has all the titles you mentioned... neat
00:25:51 <otherwise> hpc HAHA also: https://www.haskell.org/onlinereport/haskell2010/
00:26:45 <geekosaur> some of us still like https://www.haskell.org/tutorial/
00:27:11 <aaron> I was a bit worried about "Real World Haskell" being a bit old... 2008
00:28:31 <otherwise> aww, yeah get programming in haskell is 2018
00:28:35 <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
00:29:35 × benin quits (~benin@183.82.27.57) (Ping timeout: 256 seconds)
00:29:53 <BrokenClutch> https://paste.tomsmeding.com/yvZmn4UT .Is this good haskell?
00:30:02 × unyu quits (~pyon@user/pyon) (Ping timeout: 268 seconds)
00:31:02 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
00:31:36 <lyxia> licking buttons sounds a bit unhygienic :)
00:31:41 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Client Quit)
00:32:37 <aaron> hpc seems cool, but not what I'm looking for for now (supplement to Haskell Report...)
00:33:53 <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.
00:34:33 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
00:34:36 benin joins (~benin@183.82.27.57)
00:34:37 <BrokenClutch> lyxia: I'm testing stuff, but you're right, it's a bit heavy
00:35:27 <hpc> aaron: ah, if you're just looking for big reference materials the ghc manual is probably your ideal next read
00:35:30 <BrokenClutch> lyxia: Licking buttons is a form of building immunity to diseases
00:35:34 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Client Quit)
00:36:11 <lyxia> Ok but don't push it.
00:37:08 <BrokenClutch> lyxia: The button? Ok, I'm going to stop with the "jokes"
00:37:11 <int-e> @src tell
00:37:11 <lambdabot> Source not found. Are you on drugs?
00:37:23 <otherwise> > "tongue" /= "finger"
00:37:25 <lambdabot> True
00:37:57 × KvL quits (~KvL@45.248.78.202) (Ping timeout: 240 seconds)
00:38:11 <aaron> hpc: actually I'm trying to start understanding the language and become comfortable enough to approach small projects
00:38:44 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
00:40:44 <int-e> :t not <$> ?hw <* tell ["Licked"]
00:40:45 <lambdabot> (?hw::f Bool, MonadWriter [[Char]] f) => f Bool
00:41:38 <int-e> (well, the `not` would be for the `Pressed` case, but whatever)
00:42:50 KvL joins (~KvL@124.188.202.131)
00:42:52 <int-e> BrokenClutch: ^^But I would definitely use `tell`
00:43:15 × Guest85 quits (~Guest85@2a00:23c7:908b:e100:5eea:1dff:fe7c:1ffd) (Quit: Client closed)
00:44:45 falafel joins (~falafel@cpe-76-168-195-162.socal.res.rr.com)
00:45:15 <BrokenClutch> int-e: tell is actually pretty readable, thanks
00:47:40 <BrokenClutch> I tried with "censor" too
00:49:09 × falafel quits (~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 268 seconds)
00:51:10 <sm> @where books
00:51:10 <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
00:51:48 <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)
00:53:23 × KvL quits (~KvL@124.188.202.131) (Ping timeout: 256 seconds)
00:53:44 drewr joins (~drew@user/drewr)
00:54:28 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
00:54:43 <BrokenClutch> int-e: I see, thanks
00:55:15 <otherwise> sm Cool! :)
00:55:17 KvL joins (~KvL@37.120.213.100)
00:55:42 <otherwise> @ where RWH
00:55:51 <otherwise> :(
00:55:56 <otherwise> @where RWH
00:55:56 <lambdabot> http://www.realworldhaskell.org/blog/ http://book.realworldhaskell.org/read/
00:57:06 SummerSonw joins (~The_viole@203.77.49.232)
00:57:54 <aaron> ok, I think I've made up my mind to start off :)
00:58:35 <aaron> I'll go with "Get Programming In Haskell" by Will Kurt
00:58:41 <aaron> thanks otherwise
00:59:03 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
00:59:18 × johnw quits (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Quit: ZNC - http://znc.in)
00:59:19 shailangsa joins (~shailangs@host109-159-108-207.range109-159.btcentralplus.com)
00:59:21 <otherwise> know of any interactive online books for haskell? with some built in compiler similar to https://eloquentjavascript.net/03_functions.html ?
00:59:30 <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)
01:00:37 <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 ...
01:01:09 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
01:01:34 <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
01:03:03 × drewr quits (~drew@user/drewr) (Quit: ERC (IRC client for Emacs 27.2))
01:03:53 <aaron> otherwise thanks once again! And thanks to everyone else for the kind support
01:04:04 drewr joins (~drew@user/drewr)
01:04:18 <aaron> good night, will certanily pass by some other time :)
01:04:41 <geekosaur> otherwise, the tech for haskell exists but afaik nobody has hooked it together that way yet
01:04:51 unyu joins (~pyon@user/pyon)
01:05:08 <aaron> exit
01:05:09 Pickchea joins (~private@user/pickchea)
01:05:16 <otherwise> aaron Cool! seems like a good choice. hmm, interesting point about Will Kurt being semingly new
01:05:26 <otherwise> to haskell
01:05:38 <otherwise> best of luck! :
01:05:40 <otherwise> :)
01:05:50 <aaron> thank you!
01:06:08 × aaron quits (~user@93.48.228.52) (Quit: ERC 5.4.1 (IRC client for GNU Emacs 27.2))
01:06:57 × coolnickname quits (uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
01:07:38 × bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
01:10:23 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
01:13:12 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
01:14:57 × drewr quits (~drew@user/drewr) (Ping timeout: 240 seconds)
01:16:11 × acidjnk quits (~acidjnk@p200300d0c7271e268c494fdd7858bb85.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
01:17:26 × Everything quits (~Everythin@37.115.210.35) (Quit: leaving)
01:17:27 drewr joins (~drew@user/drewr)
01:17:37 × KvL quits (~KvL@37.120.213.100) (Ping timeout: 240 seconds)
01:20:00 KvL joins (~KvL@185.9.18.165)
01:20:36 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 268 seconds)
01:21:58 × drewr quits (~drew@user/drewr) (Ping timeout: 260 seconds)
01:22:02 drewr` joins (~drew@2605:a601:a3a9:5000:fd81:b1e0:1738:6be1)
01:22:32 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
01:22:39 <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)
01:23:24 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
01:23:25 qrpnxz joins (abc4f95c31@user/qrpnxz)
01:23:55 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
01:24:07 qrpnxz joins (abc4f95c31@user/qrpnxz)
01:24:17 <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...
01:25:22 <otherwise> sort of like https://simulator.dev/ but different... I'm just riffing here
01:26:48 × drewr` quits (~drew@2605:a601:a3a9:5000:fd81:b1e0:1738:6be1) (Client Quit)
01:27:56 drewr joins (~drew@user/drewr)
01:28:01 <dsal> Might be fun for learning targeted concepts.
01:28:44 <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. :)
01:29:22 <Rembane> Plated zipper sounds very fancy. What problem are you trying to solve?
01:31:55 <dsal> Day 18 of this year's AoC
01:32:36 <dsal> I built a data structure that's like `data Pair a = Lit a | Pair (Pair a) (Pair a)` -- something like that.
01:33:31 <Rembane> That one melted my brain, so this is gonna be fun. :)
01:33:33 × CiaoSen quits (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
01:33:35 <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.
01:34:00 <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.
01:34:36 <Rembane> I don't know much of the problem nor of zippers, so I'm gonna go socratic here. What's your mental model?
01:34:51 × Tuplanolla quits (~Tuplanoll@91-159-69-236.elisa-laajakaista.fi) (Quit: Leaving.)
01:34:52 <Rembane> ...and what does the zipper do?
01:35:30 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
01:35:53 <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.
01:36:14 <EvanR> zippers are good for coming back
01:36:26 <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.
01:36:37 <EvanR> so only if you can undo in the adventure
01:37:38 <EvanR> dsal, I did that one without a zipper and without numbering anything
01:38:01 <EvanR> but ymmv
01:38:10 <dsal> Neat. How did you go about it?
01:38:27 <dsal> Renumbering was pretty easy. The zipper makes the modification kind of easy, but not all of the modifications.
01:38:27 <EvanR> which part
01:38:37 <dsal> expand, in particular.
01:38:43 <dsal> er, explode
01:38:52 lavaman joins (~lavaman@98.38.249.169)
01:39:42 <dsal> I used State on both explode and split. Seems a bit unnecessary.
01:39:48 × harveypwca quits (~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67) (Quit: Leaving)
01:39:57 × dcoutts_ quits (~duncan@71.78.6.51.dyn.plus.net) (Ping timeout: 240 seconds)
01:40:26 <EvanR> the main data type Snail represents their trees as described in the puzzle
01:41:10 <EvanR> to explode, I used a second data type called Exploding which wraps a Snail with one of 5 kinds of additional "state" data
01:41:27 <EvanR> to describe what's going on in the process of trying to explode it
01:41:57 <dsal> Ah, neat. My `a` might allow for such a thing.
01:41:59 <EvanR> that data is used for wrapping an exploding snail again
01:42:26 <dsal> That's kind of how I used it. I guess my Exploding is just a tuple, though.
01:42:51 <otherwise> > it
01:42:52 <lambdabot> error:
01:42:52 <lambdabot> • Variable not in scope: it
01:42:52 <lambdabot> • Perhaps you meant one of these:
01:42:55 <EvanR> yeah you can implement sum types as a tuple where one of the components is a tag heh
01:42:57 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
01:43:23 <EvanR> since there's always 1 Snail in any case, I could have factored it that way
01:43:30 <dsal> I mean, my Exploding equivalent is the ((leftIndex, x), (rightIndex, y))
01:43:33 <EvanR> paired the 5 case type with a snail
01:43:33 <geekosaur> % it
01:43:34 <yahb> geekosaur: True
01:43:39 <dsal> it's true!
01:43:52 <geekosaur> otherwise, lambdabot is not ghci and does not have an "it" binding. yahb is.
01:44:17 <EvanR> my 5 cases are ExplodingLeft, ExplodingRight, ExplodingBoth, Exploded, and NotExploding
01:44:36 <dsal> Doesn't sound like you used SafeHaskell
01:45:47 <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...
01:45:56 <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
01:46:16 <otherwise> oops: ...I typed 'a':[] == ['a']
01:46:21 <dsal> otherwise: it is what it is
01:46:33 <geekosaur> https://downloads.haskell.org/ghc/latest/docs/html/users_guide/ghci.html#the-it-variable
01:46:37 <dsal> (the last thing you evaluate in ghci gets bound to `it`)
01:47:17 <geekosaur> also note that :doc is incompletley implemented at present so doesn't show a lot of what it could potentially show
01:47:24 <otherwise> oh, its like 'ans' in MATLAB, or even a graphing calculator for that matter.
01:49:07 Matheo_bis joins (~matheo@user/matheo-bis/x-4309430)
01:51:26 <dsal> Man, I should really learn this guard syntax instead of just trying wacky things and being surprised when they work.
01:52:03 × Matheo_bis quits (~matheo@user/matheo-bis/x-4309430) (Client Quit)
01:52:45 × waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 250 seconds)
01:52:53 × KvL quits (~KvL@185.9.18.165) (Ping timeout: 256 seconds)
01:54:49 KvL joins (~KvL@124.188.202.131)
01:58:17 × drewr quits (~drew@user/drewr) (Ping timeout: 240 seconds)
01:58:53 azimut joins (~azimut@gateway/tor-sasl/azimut)
02:01:23 × KvL quits (~KvL@124.188.202.131) (Ping timeout: 256 seconds)
02:02:49 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
02:02:49 qrpnxz joins (abc4f95c31@user/qrpnxz)
02:03:16 KvL joins (~KvL@195.216.219.57)
02:03:19 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
02:03:26 qrpnxz joins (abc4f95c31@user/qrpnxz)
02:06:28 <BrokenClutch> int-e: I was changing the record all the time, that's why I didn't use pattern matching
02:07:13 <BrokenClutch> Probably will write some more code, the doc is a little bit difficult to understand (sometimes)
02:13:56 <EvanR> you can pattern match on a record using fields, it is more tolerant of changing the record type
02:15:38 drewr joins (~drew@user/drewr)
02:20:39 × neceve quits (~quassel@2.26.93.228) (Ping timeout: 256 seconds)
02:21:20 sprout joins (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
02:22:02 rekahsoft joins (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com)
02:23:28 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Remote host closed the connection)
02:23:53 cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20)
02:26:36 × sprout quits (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 268 seconds)
02:27:43 <dsal> BrokenClutch: why is there a return () at the end?
02:27:50 <dsal> :t print
02:27:51 <lambdabot> Show a => a -> IO ()
02:28:30 <dsal> (return doesn't go what most people expect and should probably generally be avoided)
02:29:34 <dsal> I don't think I've ever used Writer. I must have a couple times. It doesn't seem very useful in general.
02:30:03 × burakcank quits (~burakcank@has.arrived.and.is.ready-to.party) (Quit: fBNC - https://bnc4free.com)
02:30:17 × drewr quits (~drew@user/drewr) (Ping timeout: 240 seconds)
02:30:34 burakcank joins (~burakcank@has.arrived.and.is.ready-to.party)
02:31:54 drewr joins (~drew@user/drewr)
02:34:26 lavaman joins (~lavaman@98.38.249.169)
02:34:37 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 240 seconds)
02:38:17 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
02:38:36 sprout joins (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
02:40:20 × drewr quits (~drew@user/drewr) (Quit: ERC (IRC client for Emacs 27.2))
02:40:54 drewr joins (~drew@user/drewr)
02:42:00 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
02:42:57 × sprout quits (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 240 seconds)
02:43:27 <BrokenClutch> dsal: I was testing stuff. The return () is for sanity
02:48:18 <dsal> I don't think it helps with sanity. It's a very confusing function. :)
02:48:23 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
02:48:41 <dsal> > return 1 :: [Int]
02:48:42 <lambdabot> [1]
02:49:44 <dsal> do { return 3; return 5 } :: [Int]
02:49:49 <dsal> > do { return 3; return 5 } :: [Int]
02:49:51 <lambdabot> [5]
02:49:57 × xff0x quits (~xff0x@2001:1a81:534f:cd00:2537:409e:e003:9b4d) (Ping timeout: 240 seconds)
02:51:58 xff0x joins (~xff0x@2001:1a81:538d:1a00:8897:3a22:97f4:9e71)
02:55:35 sprout joins (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
02:56:05 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
02:56:43 <BrokenClutch> dsal: I will stop using, it's really strange
02:58:35 <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)
02:59:12 <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.
02:59:49 × sprout quits (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 240 seconds)
03:00:13 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
03:00:20 <dsal> > :t \x y -> return (x + y)
03:00:21 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
03:00:28 <dsal> > :t (\x y -> return (x + y))
03:00:29 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
03:00:34 <dsal> :t (\x y -> return (x + y))
03:00:35 <dsal> ha
03:00:35 <lambdabot> (Monad m, Num a) => a -> a -> m a
03:02:37 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 240 seconds)
03:02:39 <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
03:04:20 conann joins (~bc8147f2@cerf.good1.com)
03:04:34 <dsal> When I see "return" I automatically translate it to "pure." If that fails me someday, someone's being clever.
03:09:53 dyeplexer joins (~dyeplexer@user/dyeplexer)
03:11:52 sprout joins (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
03:12:25 wh16 joins (~smaris@user/wh16)
03:15:03 × td_ quits (~td@muedsl-82-207-238-172.citykom.de) (Ping timeout: 256 seconds)
03:16:32 × sprout quits (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 268 seconds)
03:16:52 td_ joins (~td@94.134.91.143)
03:17:09 Sgeo_ joins (~Sgeo@user/sgeo)
03:17:14 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
03:17:29 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
03:17:42 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
03:19:17 × Sgeo quits (~Sgeo@user/sgeo) (Ping timeout: 240 seconds)
03:19:34 × cheater quits (~Username@user/cheater) (Ping timeout: 260 seconds)
03:21:55 <EvanR> dsal, Writer is great, but doesn't really fit intuition of "printf"
03:22:07 <EvanR> can't really use it like that
03:23:12 <EvanR> if what you want is nicely monoidal, it's good
03:23:23 <EvanR> and lazy
03:24:17 deadmarshal joins (~deadmarsh@95.38.228.37)
03:24:39 <dsal> I'm just not sure when I'd need it other than yeah, logging maybe. State does the thing. Or Tardis.
03:28:39 × deadmarshal quits (~deadmarsh@95.38.228.37) (Ping timeout: 256 seconds)
03:30:29 shapr` joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
03:31:47 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
03:31:49 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
03:34:08 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4)
03:34:25 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
03:34:38 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
03:34:38 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija)))
03:34:38 finn_elija is now known as FinnElija
03:38:08 × wh16 quits (~smaris@user/wh16) (Ping timeout: 268 seconds)
03:40:11 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
03:47:33 × yaroot quits (~yaroot@60.149.13.160.dy.iij4u.or.jp) (Remote host closed the connection)
03:49:16 yaroot joins (~yaroot@2409:12:ac0:2300:680e:dbff:fe1e:4953)
03:50:25 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
03:50:26 qrpnxz joins (abc4f95c31@user/qrpnxz)
03:50:58 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
03:51:03 qrpnxz joins (abc4f95c31@user/qrpnxz)
03:58:37 × drewr quits (~drew@user/drewr) (Ping timeout: 240 seconds)
04:00:45 yauhsien_ joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
04:00:46 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Read error: Connection reset by peer)
04:05:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
04:05:39 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
04:05:39 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
04:05:39 wroathe joins (~wroathe@user/wroathe)
04:08:36 wh16 joins (~smaris@user/wh16)
04:11:25 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds)
04:15:11 sprout joins (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234)
04:17:56 cheater joins (~Username@user/cheater)
04:18:22 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 260 seconds)
04:19:24 shapr` is now known as shapr
04:20:03 × sprout quits (~quassel@2a02:a467:ccd6:1:5c9e:b916:30fd:4234) (Ping timeout: 268 seconds)
04:20:23 drewr joins (~drew@user/drewr)
04:24:29 sprout joins (~quassel@2a02:a467:ccd6:1:21ba:a382:6b6:54c4)
04:28:09 mbuf joins (~Shakthi@110.225.250.18)
04:33:54 Erutuon joins (~Erutuon@user/erutuon)
04:40:50 × yauhsien_ quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Remote host closed the connection)
04:42:24 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
04:42:45 ym joins (~ym@pool-96-253-29-94.prvdri.fios.verizon.net)
04:46:18 deadmarshal joins (~deadmarsh@95.38.228.37)
04:46:57 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
04:51:39 <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...
04:52:08 × wh16 quits (~smaris@user/wh16) (Quit: segfault)
04:52:46 <nshepperd2> using them will help you learn how to use them
04:54:47 <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
04:55:13 <EvanR> in many cases putting a missing type signature will improve the error message
04:55:30 falafel joins (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
04:55:47 <EvanR> also type signatures are a big step toward documentation
04:56:15 <EvanR> and sanity check of your own thought process
04:58:54 × rekahsoft quits (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com) (Ping timeout: 268 seconds)
04:59:49 × Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: This computer has gone to sleep)
05:02:01 <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
05:12:01 alfonsox joins (~quassel@103.92.42.192)
05:12:02 <otherwise> okay, i'm curious what you mean about "... step toward documentation"
05:13:14 <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"
05:13:56 <otherwise> Is that they sort of thing you are referring to EvanR ?
05:14:21 <EvanR> no
05:14:35 <EvanR> but haskell does that have that sort of thing
05:14:39 <EvanR> haddock
05:15:17 <EvanR> For many generic functions the type is enough to understand what it does
05:17:31 <EvanR> e.g. (a -> b -> c) -> (a,b) -> c
05:17:37 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
05:17:51 <otherwise> hmm, it's like the most abstract definition of the function to follow. I was unaware of haddock, thanks for sharring that :)
05:18:47 <otherwise> that says something: first parameter is (a -> b -> c) second parameter is a pair (a,b) and the function returns c
05:19:09 <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
05:19:37 <otherwise> the first part is most confusing, it is like a single parameter that has two inputs and a single output?
05:19:37 × falafel quits (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds)
05:20:19 <EvanR> (a -> b -> c) -> (a,b) -> c can be thought of as the type of a 2 arg function
05:20:38 <EvanR> the first arg is also a 2 arg function, second arg is a pair
05:21:18 <EvanR> when you see multiple arrows in a row, mentally insert the extra parentheses until you've internalized it xD
05:21:22 <EvanR> a -> (b -> c)
05:21:26 <EvanR> same as
05:21:28 KvL parts (~KvL@195.216.219.57) ()
05:21:28 <EvanR> a -> b -> c
05:22:17 <EvanR> because it's curried like that, you don't have to have both arguments right now
05:22:19 <otherwise> okay, seems easy enough, just need more exposure to writing such functions to get a better handle on it (practice)
05:22:34 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
05:31:56 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
05:34:42 <maralorn> can `try (TextIO.hgetChunk handle) :: IO (Either IOException Text)` return a Rght _|_ ? (using non-lazy Text)
05:35:35 <maralorn> I meant: Could it return a Right containing a bottom.
05:36:39 <c_wraith> you'd have to read the source of hgetchunk to know
05:37:48 <maralorn> c_wraith: Let=s assume that code only throws IOExceptions and no other bottoms.
05:40:10 <c_wraith> you could probably manage to assemble a handle that smuggles a bottom out
05:41:21 <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.
05:42:21 <c_wraith> types are documentation that actually tells the truth.
05:43:50 <dsal> Yeah, EvanR's uncurry example is a pretty good example. It's pretty clear what that does.
05:44:06 BrokenClutch parts (~pioneer@2804:d41:c2a7:d800:e627:b00b:2c62:134) ()
05:46:21 KvL joins (~KvL@user/KvL)
05:48:51 × deadmarshal quits (~deadmarsh@95.38.228.37) (Ping timeout: 268 seconds)
05:51:13 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Remote host closed the connection)
05:52:03 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
05:57:07 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
06:01:20 <otherwise> uhh... I guess I don't understand type a->b->c
06:01:37 <otherwise> what is an example of a program that I can write with that type?
06:01:46 <otherwise> I was trying to re implement add
06:02:03 <otherwise> add :: a->b->c
06:02:17 <otherwise> add a b = a+b
06:02:25 <otherwise> but that doesnt work...
06:02:38 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
06:02:40 <otherwise> i'm a noob
06:02:49 <EvanR> you can't write anything with that type in isolation
06:03:09 <EvanR> it only makes sense as part of the whole type (a -> b -> c) -> (a,b) -> c
06:03:33 <otherwise> oh
06:03:36 <EvanR> in which case, if someone happened to have a function of type Int -> Char -> Bool on them, they could pass it in
06:03:49 <EvanR> by picking a=Int, b=Char, c=Bool
06:06:28 × KvL quits (~KvL@user/KvL) (Quit: KvL)
06:07:17 <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
06:07:36 <EvanR> you can do it for (a -> b -> c) -> (a,b) -> c, but not a -> b -> c
06:07:56 <EvanR> you can do it for a -> a
06:07:58 <EvanR> but not a -> b
06:08:09 <EvanR> try it yourself to see why
06:08:22 KvL joins (~KvL@user/KvL)
06:09:02 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
06:09:07 <otherwise> okay
06:12:06 <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.
06:12:46 <EvanR> because the "user" is picking a b and c
06:13:07 <EvanR> you can't know ahead of time what they are
06:13:22 <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?
06:14:04 <EvanR> if you knew they, you'd say e.g. False, but you don't
06:14:07 <EvanR> knew that*
06:14:10 <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.
06:14:32 <dsal> > uncurry (+) (1,2)
06:14:34 <lambdabot> 3
06:14:54 <dsal> > uncurry (<>) ('h','i')
06:14:55 <lambdabot> error:
06:14:55 <lambdabot> • No instance for (Semigroup Char) arising from a use of ‘<>’
06:14:55 <lambdabot> • In the first argument of ‘uncurry’, namely ‘(<>)’
06:15:02 <dsal> no char semigroups. boo
06:15:07 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
06:15:07 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
06:15:07 wroathe joins (~wroathe@user/wroathe)
06:15:09 <dsal> > uncurry (<>) ("h","i")
06:15:11 <lambdabot> "hi"
06:19:37 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
06:21:48 deadmarshal joins (~deadmarsh@95.38.228.37)
06:23:20 vysn joins (~vysn@user/vysn)
06:24:50 <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.
06:25:09 <EvanR> One is given
06:26:57 <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...
06:27:39 <EvanR> yeah, use concrete examples first
06:27:45 <dsal> It's not more abstract than it needs to be.
06:27:49 <otherwise> Like, in english, what is a simple question that I could try to write a function that would answer the question?
06:28:04 <EvanR> you did flip
06:28:16 <EvanR> what about, what is the reversed version of a list
06:28:18 <otherwise> that necessitates using (a -> b -> c ) -> a -> b -> c
06:28:33 <EvanR> (a -> b -> c) -> (a,b) -> c ?
06:28:37 <EvanR> (uncurry)
06:28:54 <dsal> :t ($)
06:28:55 <lambdabot> (a -> b) -> a -> b
06:29:14 <dsal> It's kind of that, but with more application.
06:29:17 <EvanR> otherwise, it comes up when you would rather a function take a tuple
06:29:44 <EvanR> it's curried, but you want to pass it a tuple
06:29:49 <EvanR> for some reason
06:29:56 <dsal> Which happens when a function returns two things (as a tuple) and you want to pass those two things to another function.
06:30:16 <EvanR> I can try to concretize why this would happen
06:30:44 <dsal> > divMod 11 3
06:30:46 <lambdabot> (3,2)
06:30:52 <dsal> > uncurry (+) $ divMod 11 3
06:30:53 <lambdabot> 5
06:30:57 <EvanR> write a function to tell me if the quotient is bigger than the remainder
06:30:59 <EvanR> using divMod
06:31:07 dagi64893 joins (~dagit@2001:558:6025:38:6476:a063:d05a:44da)
06:31:24 × dagit quits (~dagit@2001:558:6025:38:6476:a063:d05a:44da) (Read error: Connection reset by peer)
06:31:50 <EvanR> that $ is so gratuitous right there!
06:32:05 <dsal> It's the bling operator.
06:32:34 dagi64893 is now known as dagit
06:32:50 <EvanR> > uncurry (>) (divMod 11 3)
06:32:51 <otherwise> oh okay, I'll see if I can do that EvanR
06:32:52 <lambdabot> True
06:32:56 <EvanR> > uncurry (>) (divMod 2 3)
06:32:57 <lambdabot> False
06:33:01 <EvanR> well, too late xd
06:33:12 <dsal> See if you can do a similar thing, but with quotRem instead.
06:33:12 <EvanR> still worth doing the exercise
06:33:57 notzmv joins (~zmv@user/notzmv)
06:34:26 <otherwise> honestly, it's probably going to take me multiple hours, so don't wait on me. But I'll get it eventually!
06:35:15 <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.
06:35:35 <dsal> Things like flip are super abstract because they work with just about everything.
06:35:44 <EvanR> write a top level type signature, even if that's all you did you learned something
06:36:47 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
06:37:22 <otherwise> wait, I'm using function :: (a -> b -> c) -> (a,b) -> c. right?
06:37:29 <dsal> That's uncurry
06:37:49 <dsal> Here's where it gets cool. So you know you need a function that does that. Is there a function that does that?
06:37:50 <dsal> @hoogle (a -> b -> c) -> (a,b) -> c
06:37:52 <lambdabot> Prelude uncurry :: (a -> b -> c) -> (a, b) -> c
06:37:52 <lambdabot> Data.Tuple uncurry :: (a -> b -> c) -> (a, b) -> c
06:37:52 <lambdabot> Test.Hspec.Discover uncurry :: () => (a -> b -> c) -> (a, b) -> c
06:38:17 <dsal> @hoogle (a -> b -> c) -> b -> a -> c
06:38:18 <lambdabot> Prelude flip :: (a -> b -> c) -> b -> a -> c
06:38:18 <lambdabot> Data.Function flip :: (a -> b -> c) -> b -> a -> c
06:38:18 <lambdabot> GHC.Base flip :: (a -> b -> c) -> b -> a -> c
06:38:30 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
06:38:37 <int-e> :t uncurry (flip (,))
06:38:38 <lambdabot> (b, a) -> (a, b)
06:38:48 <int-e> :t snd &&& fst
06:38:49 <lambdabot> (a, c) -> (c, a)
06:38:56 <EvanR> otherwise, have you looked at functions like map, filter, foldl yet
06:39:09 <dsal> I feel like I want &&& a lot, but I'm somehow opposed to it.
06:39:14 <EvanR> uncurry comes after those
06:39:15 <int-e> (just a tangent; I forgot about the former way to make \(a,b) -> (b,a) point-free)
06:40:31 × Morrow quits (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection)
06:41:50 <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
06:42:42 <EvanR> please do
06:44:37 × drewr quits (~drew@user/drewr) (Ping timeout: 240 seconds)
06:44:40 <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.
06:44:53 <int-e> compared to something like `.` which I use all the time.
06:45:18 Lycurgus joins (~juan@98.4.112.204)
06:45:53 drewr joins (~drew@user/drewr)
06:45:53 × Jing quits (~hedgehog@2604:a840:3::1061) (Remote host closed the connection)
06:46:09 <dsal> Yeah, I'm kind of aware of it, but end up making lambdas just because "arrows" sounds scary to me.
06:46:11 <int-e> (arguably the group thing should be a Data.Map.fromListWith (+) . map (flip (,) 1) instead.
06:46:29 Jing joins (~hedgehog@125.105.141.97)
06:46:30 <dsal> I use TupleSections
06:46:49 <int-e> they're too new :P
06:47:10 <int-e> I know they exist but I usually don't think of them when I code.
06:47:16 <dsal> > M.fromListWith (+) . fmap (,1) $ "haskell"
06:47:17 <lambdabot> fromList [('a',1),('e',1),('h',1),('k',1),('l',2),('s',1)]
06:47:24 <dsal> That's me and the arrows. :)
06:47:58 <dsal> TupleSections likes to tell me to introduce it because it's like any other partial as far as I care.
06:48:34 <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
06:49:02 <dsal> Frequency analysis was pretty helpful in… one of htose.
06:49:17 <dsal> Day 8
06:50:17 <int-e> Day 3
06:50:41 <int-e> (though with only 2 values...)
06:51:27 <int-e> Ah, day 08 indeed, but that one was easy enough to brute force as well.
06:51:45 <dsal> It helped just a bit.
06:53:50 <dsal> part1 = liftA2 (*) γ ε <$> getInput
06:53:50 <dsal> part2 = liftA2 (*) o₂ co₂ <$> getInput
06:53:59 <dsal> heh. I don't even remember this one at all.
06:54:18 <EvanR> fancy
06:55:10 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
06:56:25 <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
06:57:36 <int-e> I didn't even use `partition` that day, boo
06:58:39 <EvanR> the partitions are way too simple for partition xD
06:58:41 <dsal> I just used foldr
06:59:21 <EvanR> I liked the imagery of having a block of numbers and fissioning it at some point xD
06:59:46 <EvanR> seems more evocative
07:00:53 <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)
07:01:01 <int-e> and then I shamelessly copied that for co2
07:02:22 <EvanR> for days puzzle I was this close to implementing Word139 before I came to my senses
07:02:31 <EvanR> for today's puzzle
07:03:21 <EvanR> it turned out much more elegant
07:04:36 <dsal> I have a bitset that works with Integer.
07:04:46 <dsal> (or anything else that has a Bits instance)
07:06:31 Akiva joins (~Akiva@user/Akiva)
07:09:42 <EvanR> yeah I was thinking it would need more performance
07:09:53 × Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt)
07:12:49 <dsal> My bitset thing is super nice when you have a set of lowercase letters.
07:13:04 <dsal> Oh, I used it on day 8 as well.
07:25:25 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
07:26:15 × ym quits (~ym@pool-96-253-29-94.prvdri.fios.verizon.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:27:28 kadir joins (~kadir@88.251.52.166)
07:33:36 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
07:33:36 qrpnxz joins (abc4f95c31@user/qrpnxz)
07:37:33 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
07:37:33 qrpnxz joins (abc4f95c31@user/qrpnxz)
07:39:20 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
07:39:32 qrpnxz joins (abc4f95c31@user/qrpnxz)
07:43:39 takuan joins (~takuan@178-116-218-225.access.telenet.be)
07:43:49 falafel joins (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
07:45:38 lavaman joins (~lavaman@98.38.249.169)
07:46:30 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Remote host closed the connection)
07:47:16 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
07:48:30 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds)
07:48:35 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
07:48:40 qrpnxz joins (abc4f95c31@user/qrpnxz)
07:49:02 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
07:49:14 qrpnxz joins (abc4f95c31@user/qrpnxz)
07:52:09 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
08:03:09 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
08:05:57 × conann quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Session timeout))
08:06:37 × drewr quits (~drew@user/drewr) (Ping timeout: 240 seconds)
08:06:55 falafel_ joins (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
08:09:38 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
08:09:57 × falafel quits (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds)
08:33:08 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
08:40:41 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
08:41:53 zaquest joins (~notzaques@5.130.79.72)
08:42:13 mario joins (~mario@31.147.205.13)
08:48:57 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
08:49:17 conann joins (~bc8147f2@cerf.good1.com)
08:49:36 × alfonsox quits (~quassel@103.92.42.192) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
08:50:49 max22- joins (~maxime@2a01cb0883359800aecdaff2e9d1f24d.ipv6.abo.wanadoo.fr)
08:52:39 × mario quits (~mario@31.147.205.13) (Quit: Leaving)
09:00:07 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
09:04:11 acidjnk joins (~acidjnk@p200300d0c7271e2604f35b95c1d32a12.dip0.t-ipconnect.de)
09:04:31 × mbuf quits (~Shakthi@110.225.250.18) (Quit: Leaving)
09:04:45 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
09:05:33 szkl joins (uid110435@id-110435.uxbridge.irccloud.com)
09:07:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
09:07:42 SummerSonw joins (~The_viole@203.77.49.232)
09:08:01 coolnickname joins (uid531864@user/coolnickname)
09:17:42 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
09:17:42 allbery_b joins (~geekosaur@xmonad/geekosaur)
09:17:45 allbery_b is now known as geekosaur
09:32:00 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
09:33:36 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
09:36:19 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Client Quit)
09:36:25 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
09:37:28 Tuplanolla joins (~Tuplanoll@91-159-69-236.elisa-laajakaista.fi)
09:45:56 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
09:48:19 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Client Quit)
09:55:00 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
09:55:01 qrpnxz joins (abc4f95c31@user/qrpnxz)
09:55:03 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
09:55:28 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
09:55:39 qrpnxz joins (abc4f95c31@user/qrpnxz)
09:55:45 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
09:56:53 × Sgeo_ quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
09:58:50 notzmv joins (~zmv@user/notzmv)
10:00:40 Goodbye_Vincent joins (cyvahl@freakshells.net)
10:03:17 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
10:03:41 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
10:03:48 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
10:05:15 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 250 seconds)
10:05:44 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Read error: Connection reset by peer)
10:05:57 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
10:06:15 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Remote host closed the connection)
10:06:25 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
10:08:34 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
10:13:22 <Hecate> looks like this year's Haskell Santa is Ukrainian!
10:13:43 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
10:20:56 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
10:23:11 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
10:24:07 SummerSonw joins (~The_viole@203.77.49.232)
10:24:19 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 250 seconds)
10:26:02 Lord_of_Life_ is now known as Lord_of_Life
10:28:06 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
10:28:10 <otherwise> everyone: is haskell your first programming language?
10:28:22 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:8415:925f:506a:a363) (Remote host closed the connection)
10:28:34 <janus> otherwise: what does 'first' mean?
10:29:07 <otherwise> learned it before you learned your second programming language
10:29:32 zer0bitz joins (~zer0bitz@196.244.192.59)
10:30:35 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
10:31:29 <Hecate> hahaha
10:31:35 <Hecate> otherwise: I would recommend against this
10:32:20 <Hecate> Haskell has a strong stance regarding some things that doesn't make any sense if you don't know whence they come
10:32:51 Morrow joins (~quassel@bzq-110-168-31-106.red.bezeqint.net)
10:32:57 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
10:33:03 <Rembane> otherwise: Haskell is my fifth programming language perhaps?
10:33:27 <Rembane> Hecate: Do you have something particular (that Haskell stances against) in mind?
10:34:11 gehmehgeh joins (~user@user/gehmehgeh)
10:34:18 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
10:34:23 <Hecate> Rembane: sure, impure computations
10:35:03 <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
10:35:12 <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.
10:35:27 <Hecate> :)
10:35:46 <Rembane> Hecate: I come to think of another one, I regularly miss laziness in Elixir.
10:36:34 <Hecate> Rembane: lazy computation pipelines or just having everything wrapped in a lambda ?
10:36:38 <Hecate> ;-D
10:37:07 <Hecate> (I had to do this in React, wrapping stuff in lambdas to delay evaluation)
10:38:03 <geekosaur> I have a lot of programming languages under my belt
10:38:11 × Akiva quits (~Akiva@user/Akiva) (Ping timeout: 256 seconds)
10:38:29 <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.
10:39:34 <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.
10:40:56 <otherwise> geekosaur was haskell your first, or did you pick it up after some other languages?
10:41:03 acode joins (~acode@151.65.31.181)
10:41:16 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
10:41:25 <geekosaur> whne I started programming, Haskell didn't even exist :)
10:41:26 <Hecate> Rembane: but don't we have Streams in Elixir?
10:41:33 <Hecate> geekosaur: hahahah
10:42:36 <Rembane> Hecate: We do have streams. They are amazing and makes the language so much better! :)
10:42:58 <Rembane> geekosaur: What was your first programming language? :)
10:43:20 <geekosaur> MS-BASIC, shortly followed by Z80 and 6502 assembly language
10:44:39 <Rembane> Nice!
10:44:42 <geekosaur> then I discovered C in 1981
10:45:16 <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
10:45:43 <geekosaur> other languages existed but cost a lot of money for either the hardware they ran on or for the (commercial) compilers
10:49:43 <Logio_> haskell was certainly easier to teach to people as their first language, rather than their nth
10:49:47 Logio_ is now known as Logio
10:52:57 bollu joins (uid233390@id-233390.helmsley.irccloud.com)
10:53:20 <janus> geekosaur: did you ever work in Plankalkül?
10:53:57 <geekosaur> nope
10:54:23 <geekosaur> I'm old but not quite *that* old :)
10:54:50 <Rembane> Logio: What were the most common things to unlearn among the n:thers?
10:54:59 <janus> my dad is from 1948, i saw FreePascal on his Win7 desktop yesterday :O
10:55:51 <Rembane> I've ever only seen Pascal in modern times, have never worked in it. It still fascinates me though.
10:56:23 <janus> if i understand correctly the best thing about Pascal is how it had length-prefixed strings by default?
10:56:43 <geekosaur> ohm it had more than that. it had actual types
10:56:47 <Rembane> It had, and 1-indexed arrays and strings.
10:56:49 <Rembane> And ranges!
10:57:34 <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
10:58:01 <janus> what is even a range? i imagine they weren't like the ranges recently added to c++
10:58:22 <geekosaur> var foo : 1..10;
10:58:39 <geekosaur> runtime checked
10:58:52 <acode> You guys are making me feel old because I had Pascal in high school now
10:59:02 <janus> it's a datatype that wraps two integers and then a syntax shorthand for it?
11:00:59 <geekosaur> yes. more or less like Ix in Haskell
11:01:03 alx741 joins (~alx741@157.100.93.160)
11:01:51 × acode quits (~acode@151.65.31.181) (Quit: Client closed)
11:03:43 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:04:17 × benin quits (~benin@183.82.27.57) (Quit: The Lounge - https://thelounge.chat)
11:04:34 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: Replaced by new connection)
11:04:35 qrpnxz joins (abc4f95c31@user/qrpnxz)
11:05:04 qrpnxz parts (abc4f95c31@user/qrpnxz) (Disconnected: closed)
11:05:14 qrpnxz joins (abc4f95c31@user/qrpnxz)
11:06:47 zer0bitz_ joins (~zer0bitz@196.244.192.56)
11:09:17 × zer0bitz quits (~zer0bitz@196.244.192.59) (Ping timeout: 240 seconds)
11:10:43 zer0bitz joins (~zer0bitz@2001:2003:f444:a000:448c:d273:19c0:41c1)
11:14:17 × zer0bitz_ quits (~zer0bitz@196.244.192.56) (Ping timeout: 240 seconds)
11:18:03 <Logio> Rembane: not having mutable variables and loops seemed to cause most problems for the people with more experience
11:20:24 <Rembane> Logio: I can totally see why and sympatize with that.
11:22:22 × conann quits (~bc8147f2@cerf.good1.com) (Quit: CGI:IRC (Ping timeout))
11:22:29 × xsperry quits (~xs@user/xsperry) (Ping timeout: 268 seconds)
11:23:57 <Logio> yeah, not having any of your algorithm knowledge directly applicable can be really frustrating
11:25:11 <Rembane> All the algorithms have a tendency to be: "Update the array at index i..."
11:26:52 zer0bitz_ joins (~zer0bitz@196.244.192.59)
11:28:46 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
11:30:29 × zer0bitz quits (~zer0bitz@2001:2003:f444:a000:448c:d273:19c0:41c1) (Ping timeout: 268 seconds)
11:32:55 × zer0bitz_ quits (~zer0bitz@196.244.192.59) (Read error: Connection reset by peer)
11:32:57 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
11:34:43 <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
11:37:25 zer0bitz joins (~zer0bitz@196.244.192.57)
11:37:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
11:44:04 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Ping timeout: 268 seconds)
11:48:57 neceve joins (~quassel@2.26.93.228)
11:49:38 ozzymcduff joins (~ozzymcduf@77.49.18.242.dsl.dyn.forthnet.gr)
11:54:21 <otherwise> I'm gonna stick with my open face plain bagels for now...
11:58:16 × max22- quits (~maxime@2a01cb0883359800aecdaff2e9d1f24d.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
11:58:29 max22- joins (~maxime@2a01cb088335980027b3e3f3a18fa9f4.ipv6.abo.wanadoo.fr)
12:10:12 xsperry joins (~xs@user/xsperry)
12:12:15 × SummerSonw quits (~The_viole@203.77.49.232) (Ping timeout: 256 seconds)
12:15:17 wallymathieu joins (uid533252@id-533252.uxbridge.irccloud.com)
12:15:41 × acidjnk quits (~acidjnk@p200300d0c7271e2604f35b95c1d32a12.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
12:17:37 × mvk quits (~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds)
12:19:12 × slowtype- quits (~slowtyper@79.103.178.210.dsl.dyn.forthnet.gr) (Ping timeout: 268 seconds)
12:21:37 × falafel_ quits (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 240 seconds)
12:21:59 Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
12:22:08 machinedgod joins (~machinedg@24.105.81.50)
12:23:21 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
12:30:15 × ozzymcduff quits (~ozzymcduf@77.49.18.242.dsl.dyn.forthnet.gr) (Ping timeout: 256 seconds)
12:30:55 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
12:33:12 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
12:34:14 × sprout quits (~quassel@2a02:a467:ccd6:1:21ba:a382:6b6:54c4) (Ping timeout: 252 seconds)
12:35:39 sprout joins (~quassel@2a02:a467:ccd6:1:b165:3b1b:f1f6:f4de)
12:37:12 <otherwise> https://paste.tomsmeding.com/EEI1icbM
12:37:17 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 240 seconds)
12:37:25 stiell joins (~stiell@gateway/tor-sasl/stiell)
12:39:24 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 276 seconds)
12:39:56 <geekosaur> you seem to be missing a 'let' in the list comp version
12:41:05 waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4)
12:42:18 jpds joins (~jpds@gateway/tor-sasl/jpds)
12:42:37 <geekosaur> the first one seems confused. "long" wants a list but is passed a number
12:43:02 <otherwise> https://paste.tomsmeding.com/WnCO0OEp
12:43:02 <geekosaur> and you can't use filter to limit a list, you probably want takeWhile
12:43:19 <geekosaur> filter will just keep going looking for the predicate
12:43:29 <otherwise> oh I switch from takeWhile to filter, I'll try takeWhile again
12:44:11 <geekosaur> you have the same problem with that one, you are giving it a number but <- expects a list
12:44:52 <geekosaur> basically this all looks very confused as to lists vs. items
12:46:04 <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
12:46:43 lavaman joins (~lavaman@98.38.249.169)
12:47:06 <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
12:47:16 <geekosaur> (== never return a value)
12:48:59 <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.)
12:49:54 <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
12:50:35 <geekosaur> so you are thinking about this wrong
12:50:51 syrkis joins (~syrkis@82.192.167.70)
12:50:57 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
12:56:51 dcoutts_ joins (~duncan@71.78.6.51.dyn.plus.net)
12:57:30 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
12:57:49 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
12:59:43 jakalx parts (~jakalx@base.jakalx.net) ()
13:02:12 × bollu quits (uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
13:05:04 slowButPresent joins (~slowButPr@user/slowbutpresent)
13:06:39 <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)
13:06:45 falafel_ joins (~falafel@cpe-76-168-195-162.socal.res.rr.com)
13:07:09 <geekosaur> also, I'd go back to the first version instead of the list comprehension
13:09:20 CiaoSen joins (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
13:14:15 <otherwise> https://paste.tomsmeding.com/XcmhAEUr
13:14:33 <otherwise> oh I didnt see your reponses after 4:44
13:16:58 <otherwise> good point about length not being sensical to apply to an infinite list
13:21:07 Rum joins (~bourbon@user/rum)
13:23:38 bollu joins (uid233390@id-233390.helmsley.irccloud.com)
13:25:08 <geekosaur> put a type signature on `long`. but really the first one should tell you: why does it make sense to say `10 > list`?
13:25:45 <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
13:27:28 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
13:27:28 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
13:27:28 wroathe joins (~wroathe@user/wroathe)
13:27:39 <geekosaur> actually, you have worse than that. "But I'm trying to make length of the returned list be 10"
13:28:02 <geekosaur> you're doing this at the wrong level: takeWhile can only see elements, not the length of the whole list
13:28:15 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
13:28:56 <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
13:30:48 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
13:31:54 <otherwise> I think long has to be Bool, considering takeWhile :: (a -> Bool) -> [a] -> [a]
13:31:57 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
13:32:13 jakalx joins (~jakalx@base.jakalx.net)
13:32:25 <geekosaur> but you are successfully comparing it to an Integer
13:32:45 <geekosaur> just changing the type does not turn an element of the list into the list
13:33:17 SummerSonw joins (~The_viole@203.77.49.232)
13:34:00 <geekosaur> basically you are thinking about this wrong
13:34:04 <int-e> don't forget about take and drop
13:34:17 <geekosaur> I actually hinted at a way to do this earlier, although it's not the best way to do it
13:34:20 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
13:34:28 <geekosaur> int-e, this started out as not wanting to use take or drop
13:34:36 <int-e> ...but why
13:34:49 <otherwise> just to include that in the function
13:34:57 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
13:35:09 <geekosaur> so just use take or drop inside the function
13:35:29 <int-e> I mean, you're interested in what happens with the first 11 elements of (the spine of) the list.
13:36:33 <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
13:36:57 <geekosaur> that was what I hinted at earlier
13:37:23 <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
13:37:26 <geekosaur> but I'm going through this because otherwise seems fairly confused about what's what
13:37:27 <otherwise> :)
13:37:35 <int-e> yeah sorry I'm too lazy to read history
13:37:59 <int-e> it's easier to reevaluate the situation "on demand"
13:38:03 <geekosaur> so I'm trying to guide them through working out what's wrong and why it won't work
13:40:05 <otherwise> geekosaur: thank you, i'll slowly digest what you've explained to me.
13:40:26 <int-e> I also don't understand why "I want to generalize this to n" is a reason to discard `take` or `drop`.
13:41:29 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
13:41:45 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
13:43:05 <geekosaur> it's not just types; you're thinking about the whole problem wrong, somehow
13:43:20 <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
13:43:28 <geekosaur> which is what has led you to the wrong types
13:44:21 <int-e> > let listOfFuns = map (*) [0..]) in (listOfFuns !! 4) 5 == 20
13:44:22 <lambdabot> <hint>:1:31: error: parse error on input ‘)’
13:44:31 <int-e> > let listOfFuns = map (*) [0..] in (listOfFuns !! 4) 5 == 20
13:44:33 <lambdabot> True
13:45:37 <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.
13:45:43 <int-e> Anyway, obviously I'm missing context. (Since that example has nothing obvious to do with testing for long lists.)
13:45:56 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
13:46:42 coot joins (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827)
13:46:46 <otherwise> which is good because now I know how confused I am about types, so I now know what to focus on.
13:48:29 <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?
13:48:57 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
13:49:01 <geekosaur> you are somehow confusing a list with its elements
13:50:33 × alx741 quits (~alx741@157.100.93.160) (Quit: alx741)
13:52:20 alx741 joins (~alx741@157.100.93.160)
13:52:40 <otherwise> I meant that 5 is applied to the 4th element, so that it becomes (4*) 5
13:53:30 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
13:53:46 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
13:54:15 <int-e> "4th" counting from 0.
13:54:21 <otherwise> yes
13:54:53 <int-e> anyway, yes, that's how it evaluates to 20 in the end
13:56:04 neurocyte0132889 joins (~neurocyte@IP-045010062145.dynamic.medianet-world.de)
13:56:04 × neurocyte0132889 quits (~neurocyte@IP-045010062145.dynamic.medianet-world.de) (Changing host)
13:56:04 neurocyte0132889 joins (~neurocyte@user/neurocyte)
13:56:10 <geekosaur> also don't confuse 4th element with (4*)
13:56:28 <geekosaur> might be instructive to replace (*) with something more complicated
13:56:59 <geekosaur> or just change [0..] to something like [20,30..]
13:57:37 <otherwise> now i'm just trying to replace !! with take
13:58:03 <geekosaur> just swap the parameters
13:58:22 <geekosaur> list !! 4, vs. take 4 list (but note the fencepost error)
14:01:05 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
14:01:13 <otherwise> > let listOfFuns = map (*) [0..] in take 4 (listOfFuns 3)
14:01:14 <lambdabot> error:
14:01:14 <lambdabot> • Couldn't match expected type ‘t0 -> [a]’
14:01:15 <lambdabot> with actual type ‘[a0 -> a0]’
14:01:18 <otherwise> :(
14:02:01 <geekosaur> I am curious as to what made you think that would work
14:02:16 <geekosaur> given (listOfFuns !! 4) 5
14:02:20 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
14:02:21 × synthmeat quits (~synthmeat@user/synthmeat) (Quit: WeeChat 3.0)
14:02:59 <otherwise> > take 4 [1..]
14:03:00 <lambdabot> [1,2,3,4]
14:03:24 <otherwise> replace [1..] with the list in question, listOfFuns
14:03:27 <geekosaur> > take 4 (map (*) [0..])
14:03:28 <lambdabot> [<Integer -> Integer>,<Integer -> Integer>,<Integer -> Integer>,<Integer -> ...
14:03:42 <int-e> > take 4 [0..]
14:03:44 <lambdabot> [0,1,2,3]
14:07:07 <otherwise> this is exactly why I started to write a function to perform this, cause I couldnt make it work in prelude
14:08:10 ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
14:08:17 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
14:09:00 <geekosaur> `take 4 (listOfFuns 3)` is almost right. But not quite
14:09:09 kayprish joins (~kayprish@188.120.102.122)
14:09:10 <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
14:09:50 <geekosaur> `(take 4 listOfFuns) 3` is closer, but still not quite right
14:10:15 <geekosaur> Try figuring out why moving the parentheses helps, then see if that helps you figure out what else is wrong
14:10:17 × falafel_ quits (~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 240 seconds)
14:10:51 <otherwise> hmm
14:11:35 <geekosaur> (both are the same error, in fact, and the same error I pointed up earlier)
14:15:09 × sprout quits (~quassel@2a02:a467:ccd6:1:b165:3b1b:f1f6:f4de) (Ping timeout: 268 seconds)
14:16:02 sprout joins (~quassel@2a02:a467:ccd6:1:b165:3b1b:f1f6:f4de)
14:16:21 × KvL quits (~KvL@user/KvL) (Ping timeout: 256 seconds)
14:16:27 <geekosaur> let's start with: what is the type of listOfFuns? (its name should tell you)
14:17:00 × Rum quits (~bourbon@user/rum) (Quit: WeeChat 3.4)
14:17:46 <otherwise> listOfFuns :: (Num a, Enum a) => [a -> a]
14:18:00 <otherwise> I was just reading :doc Enum
14:18:28 × ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
14:18:33 <geekosaur> So, what do you think the type of `listOfFuns 3` should be, and why?
14:18:47 ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
14:19:13 <otherwise> oh god
14:20:09 <otherwise> a -> a
14:20:16 <geekosaur> if you ask ghci it'll be gobbledygook. I want to hear what *you* think it should be
14:20:23 <otherwise> but it just gives an error so...
14:20:32 Bartol joins (~Bartol@user/Bartol)
14:20:34 <geekosaur> ok, why do you think that?
14:20:44 × Bartol quits (~Bartol@user/Bartol) (Client Quit)
14:20:56 <otherwise> I think it is something like: function -> Int -> [a]
14:21:19 × Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Ping timeout: 268 seconds)
14:21:43 <otherwise> where listOfFuns is a function that takes an input, a, then returns a list [a]
14:21:58 <geekosaur> but it is not a function, it is a list of functions
14:21:58 <otherwise> (Int is a)
14:22:07 <otherwise> right...
14:22:11 <geekosaur> not a function of lists
14:22:33 <otherwise> so [a] -> a -> [a]
14:22:40 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
14:23:01 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
14:23:01 × ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Ping timeout: 256 seconds)
14:23:38 <geekosaur> :t let listOfFuns = map (*) [0..] in listOfFuns 3
14:23:39 <lambdabot> error:
14:23:39 <lambdabot> • Couldn't match expected type ‘t0 -> t’
14:23:39 <lambdabot> with actual type ‘[a0 -> a0]’
14:23:59 <geekosaur> again, it is not a function, it is a list of functions
14:24:25 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
14:24:38 <otherwise> okay, so [a->a] -> a -> [a]
14:25:14 <geekosaur> you keep doing that… now it's a function on a list of functions. where does that function come from?
14:25:28 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
14:25:54 <otherwise> I don't know what a0 means
14:26:32 <geekosaur> you don't really care
14:27:08 <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
14:28:40 <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
14:29:04 <geekosaur> that's part of it. as I said earlier
14:29:27 <geekosaur> this is why moving the parentheses is part of the answer: it applies take to the list instead of to nonsense
14:29:34 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
14:29:45 <geekosaur> but afterward you still try to apply a list to a number and it's still nonsense
14:29:56 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
14:29:57 <geekosaur> becuase lists aren't functions
14:30:16 <geekosaur> > [0] 0
14:30:18 <lambdabot> error:
14:30:18 <lambdabot> • Couldn't match expected type ‘t0 -> t’ with actual type ‘[a0]’
14:30:18 <lambdabot> • The function ‘[0]’ is applied to one argument,
14:30:40 <geekosaur> % [0] 0
14:30:40 <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
14:30:47 <geekosaur> ugh
14:31:10 <geekosaur> % :set -NoOverloadedLists
14:31:10 <yahb> geekosaur: Some flags have not been recognized: -NoOverloadedLists
14:31:26 <geekosaur> % :set -XNoOverloadedLists
14:31:26 <yahb> geekosaur:
14:31:31 <geekosaur> % [0] 0
14:31:31 <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)
14:32:16 <geekosaur> "The function `[0]' is applied to one value argument, but its type `[a0]' has none"
14:32:31 <geekosaur> which is GHC-ese for "a list is not a function"
14:33:37 <geekosaur> so what are you actually trying to do with `listOfFuns 3` (or `(take 4 listOfFuns) 3`)?
14:33:49 <geekosaur> what do you think it should do, as opposed to what it actually does?
14:34:47 <otherwise> I'm just trying to understand how to use map (*) [1,2,3,4]
14:34:49 <geekosaur> do not consult ghci for this
14:35:37 <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
14:35:46 <geekosaur> but you must understand this to understand how to use it
14:36:17 × kayprish quits (~kayprish@188.120.102.122) (Read error: Connection reset by peer)
14:36:29 <otherwise> maybe head is an easier one to do before take?
14:36:47 <geekosaur> it will be because you will no longer have a list
14:37:11 <geekosaur> but then you do not understand what `map (*) [0..]` does
14:37:26 <geekosaur> you understand what `(*0)` does
14:37:44 <otherwise> yes, it is partially applying * to 0
14:37:52 <geekosaur> sigh
14:37:58 <geekosaur> that was not the point
14:38:09 <geekosaur> you are removing the list and have only its first element
14:38:31 <geekosaur> at some point you will have to learn to work with the list
14:39:22 <otherwise> yes, although I dont know how to make a function act on listOfNums
14:39:47 <geekosaur> most list functions will work on it
14:39:47 <otherwise> for example, It is not clear why listOfNums 3
14:39:54 <otherwise> is not valid
14:39:57 <geekosaur> it will not work as a function itself
14:40:32 <int-e> A list of functions isn't itself a function.
14:40:34 <geekosaur> because `listOfNums 3` says "`listOfNums 3` is a function. Apply that function to the value 3"
14:40:36 <otherwise> I guess I dont know how to pass into the list to activate the function
14:41:02 <geekosaur> but `listOfFuns` is not a function, it is a list of functions
14:41:07 <int-e> Well, you need a way to operate on the list elements.
14:41:11 <geekosaur> "the" function?
14:41:23 <int-e> (Which are functions, so you can apply those to other things.)
14:41:41 <otherwise> the, as in each element of the list is a function
14:41:52 <geekosaur> but that is not "the" function
14:42:04 <otherwise> i guess * is the function
14:42:06 <geekosaur> it is "zero or more functions". so which if any do you want to use?
14:42:20 <geekosaur> but it is not simply (*)
14:42:39 <geekosaur> it is [(*0), (*1), (*2), ...]
14:42:45 <geekosaur> which one if any do you want?
14:42:56 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
14:43:19 <int-e> (technically they're (0*), (1*) etc.)
14:43:20 <otherwise> okay, so I was able to do h = head listOfFuns
14:43:29 <otherwise> then h 3
14:43:32 <otherwise> which is 0
14:43:35 <geekosaur> (this is why I brought up (*0) earlier; if you use head you get only the first of them)
14:44:05 <otherwise> then t = listOfFuns works
14:44:12 <otherwise> but t 3 does not work
14:44:25 <geekosaur> right, because you are applying a list to a number
14:44:29 <int-e> because that's still a list, not a function
14:44:30 <otherwise> oops
14:44:36 <otherwise> I meant t = take 3 listOfFuns
14:44:43 <geekosaur> which is still a list
14:44:57 <int-e> same reason: that's still a list, not a function
14:44:59 <geekosaur> you just know the list is no more than 3 elements instead of possibly infinite
14:45:10 <otherwise> so i need to pattern match?
14:45:35 <otherwise> and recursion?
14:45:39 <geekosaur> so, your possibilities become: (a) ignore it; (b) pick one element/function to use; (c) use all of them ("folding")
14:46:05 <geekosaur> (a) is trivial. (b) is what (!!) does. (c) you use foldl' or foldr
14:46:06 <int-e> otherwise: you have seen the right highe-order function to use already
14:46:11 n3rdy1 joins (~n3rdy1@2601:281:c780:a510:84eb:b2e:7b61:4002)
14:46:23 <int-e> (if you want to apply all those functions to a fixed value)
14:46:34 <int-e> (which I *think* is your intent)
14:46:44 <geekosaur> (monochrom moment: since you started with 0, you already know the answer to the fold :)
14:46:51 <otherwise> i just want take to work
14:47:10 <geekosaur> take itself is not a problem. you just seem to be confused about what it gave you
14:47:11 <int-e> > product [0..-1] --monochrom follow-up
14:47:12 <lambdabot> error:
14:47:12 <lambdabot> • Variable not in scope: (..-) :: t0 -> t1 -> a
14:47:12 <lambdabot> • Perhaps you meant ‘...’ (imported from Control.Lens)
14:47:19 <int-e> > product [0.. -1]
14:47:20 <lambdabot> 1
14:47:24 <int-e> meh. that gets me way too often
14:47:29 <geekosaur> heh
14:47:58 <int-e> :t map
14:47:59 <lambdabot> (a -> b) -> [a] -> [b]
14:49:38 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
14:49:41 <otherwise> > map (3*) [1,3..9]
14:49:43 <lambdabot> [3,9,15,21,27]
14:49:46 <otherwise> I get that
14:50:13 <otherwise> I dont get partial application, then being able to use the list of functions after it is created
14:50:40 <otherwise> It seems to be an impenetrable list!
14:50:55 <int-e> `map` gets you "inside"
14:51:11 <otherwise> ...
14:51:24 <otherwise> map into to the maped partial list!?
14:51:36 <int-e> it's not a partial list
14:51:41 <int-e> it's a list of partial applications
14:52:47 <int-e> So... maybe an exercise: Write a function f such that f (3*) and f (4*) evaluate to 3*4 and 4*5.
14:53:16 <int-e> uhm
14:53:21 <int-e> 3*4 and 4*4.
14:53:36 <int-e> Sorry, I didn't mean to vary the second argument there.
14:53:52 fef joins (~thedawn@user/thedawn)
14:54:08 <otherwise> I get it
14:54:37 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 268 seconds)
14:54:37 <geekosaur> I think the confusion is somewhere else
14:54:47 <geekosaur> What do you believe `take 4` does to a list?
14:55:07 <int-e> :t take 4
14:55:08 <lambdabot> [a] -> [a]
14:55:48 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
14:56:12 <geekosaur> compare to
14:56:17 <geekosaur> :t (!! 4)
14:56:18 <lambdabot> [a] -> a
14:56:40 <otherwise> I think it does (head list): head(tail list): head(tail (tail list)): head (tail (tail ( tail list) ) )
14:57:10 <geekosaur> You keep talking as if after `take 4` the list contains one function, but in fact it contains four
14:57:15 <otherwise> except I think that last term is in brackets
14:57:25 <geekosaur> So to get a function, you must either choose one or fold over all of them
15:01:55 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
15:03:07 <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*) ... ]
15:03:23 <geekosaur> so now you must do something with that derived list
15:05:57 <otherwise> https://paste.tomsmeding.com/JbXPMeaN
15:06:12 <otherwise> although it is an infinite list...
15:07:04 <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
15:07:33 <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
15:08:09 <otherwise> sounds like fold is a prerequisite
15:08:13 <geekosaur> not only infinite but also overengineered
15:08:28 <geekosaur> no, you could pick one of them instead of folding over all of them
15:08:40 <geekosaur> it's not clear to me which you intend
15:10:07 <otherwise> I was intending over all of them that I take
15:10:33 <otherwise> I know to take a specific one I can just use !!
15:10:36 <geekosaur> ok, so you want a fold
15:10:52 <geekosaur> > foldr f z [a,b,c,d]
15:10:53 <lambdabot> f a (f b (f c (f d z)))
15:11:17 <geekosaur> or a map, if you want the result for each element instead of for all elements combined
15:11:26 <geekosaur> > map f [a,b,c,d]
15:11:28 <lambdabot> error:
15:11:28 <lambdabot> • Ambiguous type variable ‘b0’ arising from a use of ‘show_M880334822319...
15:11:28 <lambdabot> prevents the constraint ‘(Show b0)’ from being solved.
15:11:33 <geekosaur> ble
15:11:41 <geekosaur> > map f [a,b,c,d] :: Expr
15:11:43 <lambdabot> error:
15:11:43 <lambdabot> • Couldn't match expected type ‘Expr’ with actual type ‘[b0]’
15:11:43 <lambdabot> • In the expression: map f [a, b, c, ....] :: Expr
15:11:53 <geekosaur> > map f [a,b,c,d :: Expr]
15:11:54 <lambdabot> error:
15:11:54 <lambdabot> • Ambiguous type variable ‘b0’ arising from a use of ‘show_M203210898510...
15:11:54 <lambdabot> prevents the constraint ‘(Show b0)’ from being solved.
15:11:58 <g> :t f
15:11:59 <lambdabot> FromExpr a => a
15:12:01 <geekosaur> wow, this is annoying
15:12:03 <otherwise> okay, i have not yet used fold, so I'm reading up on LYAH
15:12:32 <geekosaur> > map f [a,b,c,d :: Expr] :: [Expr]
15:12:34 <lambdabot> [f a,f b,f c,f d]
15:12:41 <geekosaur> there we go
15:15:55 <geekosaur> note that a fold will give you one result, whereas map will give you four
15:16:01 <geekosaur> (in a list)
15:16:18 <otherwise> oh, so I guess I want map...
15:18:17 × CiaoSen quits (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
15:18:48 <otherwise> I need to take a break, this is too much failure in a row
15:19:33 <geekosaur> I'm going to be leaving to go shopping shortly so someone else will probably have to pick it up from here
15:19:35 <otherwise> I'll come back to this problem after I get some positive feedback from the compile for a while.
15:19:46 <otherwise> Thanks for the help geekosaur! :)
15:32:07 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
15:32:07 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
15:32:07 wroathe joins (~wroathe@user/wroathe)
15:32:12 × bollu quits (uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
15:32:25 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
15:33:29 Rum joins (~bourbon@user/rum)
15:36:37 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
15:49:17 × Morrow quits (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 256 seconds)
15:50:42 Morrow joins (~quassel@bzq-110-168-31-106.red.bezeqint.net)
15:52:51 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection)
15:53:18 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
15:53:36 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
15:53:40 Everything joins (~Everythin@37.115.210.35)
15:55:13 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
15:55:25 <phaazon> hey, anyone used to pandoc?
15:55:29 <mjrosenb> Does anyone have emacs+hls set up? I think I've gotten it working, but it doesn't *do* anything
15:55:57 <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?)
15:56:01 <phaazon> anyone has an idea?
15:57:45 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 250 seconds)
15:58:00 goepsilongo joins (~goepsilon@2806:263:c404:8000:ec3a:2574:2f9:e2db)
16:04:58 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
16:09:42 <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.
16:11:46 × otherwise quits (~otherwise@2601:602:880:90f0:144d:55a8:1e87:818) (Remote host closed the connection)
16:13:16 × Rum quits (~bourbon@user/rum) (Quit: WeeChat 3.4)
16:17:49 × dcoutts_ quits (~duncan@71.78.6.51.dyn.plus.net) (Ping timeout: 240 seconds)
16:20:52 <phaazon> lyxia: ah so you do have to write a CSS file
16:20:54 <phaazon> interesting, thanks
16:21:04 ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
16:26:40 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
16:27:41 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
16:30:49 zer0bitz_ joins (~zer0bitz@185.112.82.230)
16:33:50 × zer0bitz quits (~zer0bitz@196.244.192.57) (Ping timeout: 260 seconds)
16:39:09 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
16:45:01 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
16:45:23 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
16:45:36 __monty__ joins (~toonn@user/toonn)
16:48:06 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
16:48:16 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
16:54:37 stef204 joins (~stef204@user/stef204)
16:55:03 nckxmas is now known as nckx
16:57:11 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
16:58:13 × stef204 quits (~stef204@user/stef204) (Client Quit)
16:59:20 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
16:59:33 × neceve quits (~quassel@2.26.93.228) (Ping timeout: 256 seconds)
16:59:37 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
17:05:14 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
17:05:14 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
17:05:14 wroathe joins (~wroathe@user/wroathe)
17:08:20 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Remote host closed the connection)
17:08:56 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
17:09:07 rekahsoft joins (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com)
17:09:28 stef204 joins (~stef204@user/stef204)
17:09:30 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
17:10:19 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
17:13:19 neceve joins (~quassel@2.26.93.228)
17:14:13 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
17:14:50 <mjrosenb> hrm, it looks like lsp thinks it is capable of doing things, but it does (almost) nothing.
17:16:04 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
17:20:31 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 250 seconds)
17:21:48 × syrkis quits (~syrkis@82.192.167.70) (Quit: Client closed)
17:21:51 <mjrosenb> also, it looks like there isn't any zip/unzip variant for maps.
17:22:41 <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?
17:25:35 python476 joins (~user@88.160.31.174)
17:25:56 falafel_ joins (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com)
17:27:20 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
17:28:57 × stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.4)
17:31:07 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
17:35:46 <EvanR> mjrosenb, there's unionWith, unionWithKey, differenceWith, differenceWithKey, intersectionWith, intersectionWithKey
17:35:47 ym joins (~ym@pool-96-253-29-94.prvdri.fios.verizon.net)
17:36:27 × ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
17:36:31 <EvanR> unzip seems like a bunch of maps / mapWithKey
17:36:47 ProfSimm joins (~ProfSimm@176-12-60-137.pon.spectrumnet.bg)
17:39:07 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
17:40:55 × ProfSimm quits (~ProfSimm@176-12-60-137.pon.spectrumnet.bg) (Remote host closed the connection)
17:41:02 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:42:01 econo joins (uid147250@user/econo)
17:43:17 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 240 seconds)
17:49:13 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Remote host closed the connection)
17:54:19 whaletechno joins (~whaletech@user/whaletechno)
17:54:45 × Morrow quits (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 250 seconds)
17:55:00 Morrow joins (~quassel@bzq-110-168-31-106.red.bezeqint.net)
17:55:41 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
17:58:17 × zer0bitz_ quits (~zer0bitz@185.112.82.230) (Ping timeout: 240 seconds)
17:58:34 zer0bitz joins (~zer0bitz@196.244.192.56)
17:58:44 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
17:59:57 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
18:00:14 × vysn quits (~vysn@user/vysn) (Ping timeout: 268 seconds)
18:01:58 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
18:02:15 johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
18:02:50 <iphy> I have an AST and a traversal module (https://github.com/iphydf/hs-cimple/blob/generalised-traverse/src/Language/Cimple/TraverseAst.hs#L113) which traverses the AST forwards. is there an elegant way to support both forward and reverse traversal here?
18:04:01 <sshine> what's reverse traversal?
18:06:24 <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
18:07:15 <sshine> ohhh, so sort of a left-to-right/right-to-left or pre-/post-order
18:07:33 <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
18:07:59 <EvanR> you can use a newtype wrapper to change the Traversable instance to one that goes backwards
18:08:41 <sshine> I was also thinking of something like Down.
18:09:05 <iphy> I'm (mostly) not using Traversable here, because my traversal is a bit more complicated with multiple types
18:09:11 <sshine> right.
18:09:17 <sshine> TraverseAst in your case.
18:09:28 <iphy> Accessor <$> recurse name <*> recurse params <*> recurse errors
18:09:35 <iphy> for example ^
18:09:42 <EvanR> (a type that contains other traversable types can be made traversable)
18:10:04 <iphy> <*> should be reversed
18:10:20 <iphy> instead of name, params, errors, I want to traverse errors, params, name
18:10:29 <EvanR> yeah, so either way you want a second implementation of the traversal
18:10:48 <iphy> so a copy of the TraverseAst module?
18:11:12 <sshine> iphy, so... the least elegant way is to define an instance TraverseAst ... (SomeWrapper (Node ...) where ...
18:11:27 <EvanR> yeah. Of course there are generic ways to traverse any generic both ways
18:13:06 <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) }
18:13:17 <iphy> :\
18:13:24 <sshine> iphy, (I'm just thinking loud, I'm sure you're trying to avoid this exact thing.)
18:13:28 <iphy> yeah
18:14:01 Guest|70 joins (~Guest|70@c-24-6-12-87.hsd1.ca.comcast.net)
18:14:18 BrokenClutch joins (~pioneer@2804:d41:c2a7:d800:e627:b00b:2c62:134)
18:14:37 <iphy> also, it would need to be named differently I think, because that only goes 1 level deep, no?
18:14:43 <iphy> as soon as you recurse, it's forward again
18:15:32 <iphy> https://github.com/iphydf/hs-cimple/blob/generalised-traverse/src/Language/Cimple/AST.hs#L18
18:15:38 lavaman joins (~lavaman@98.38.249.169)
18:15:47 <iphy> all the "Node attr lexeme" in there would have to be SomeWrapper'd
18:16:00 <sshine> ah, yes, you'd need to wrap sub-ast elements in SomeWrapper to continue that way.
18:16:01 <iphy> an alternative is to pass a Direction flag around and decide based on that
18:16:13 <iphy> sshine: ah right
18:16:22 <iphy> recurse (SomeWrapper lastThingX) etc.
18:16:58 <EvanR> when you start to put wrappers on all nodes and subnodes, you might want to step back and factor your original structure
18:17:02 <iphy> (define recurse as SomeWrapper . mapFileAst
18:17:03 <iphy> )
18:17:43 <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.
18:17:58 × coot quits (~coot@2a02:a310:e03f:8500:5cc8:47c:8ec0:b827) (Quit: coot)
18:18:11 <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
18:18:32 <EvanR> a bunch of these functors lets you do things in the betweens
18:19:32 <sshine> is this HKD?
18:19:53 <EvanR> not familiar with this jargon
18:20:25 <iphy> ADTF?
18:20:56 <geekosaur> HKD = higher kinded data
18:21:24 <EvanR> functorized ADT, or whatever node type
18:21:42 <sshine> yeah, but it could also be another typeclass, not necessarily Functor.
18:21:52 <sshine> but I guess Functor is overwhelmingly useful here.
18:22:08 <EvanR> Functor, among other things
18:24:26 × xff0x quits (~xff0x@2001:1a81:538d:1a00:8897:3a22:97f4:9e71) (Ping timeout: 260 seconds)
18:25:10 xff0x joins (~xff0x@2001:1a81:538d:1a00:466f:9b53:869c:77ef)
18:26:06 <iphy> barbies is kind of interesting
18:28:22 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
18:30:05 × falafel_ quits (~falafel@2603-8000-d800-688c-502d-7280-71cc-20e7.res6.spectrum.com) (Ping timeout: 252 seconds)
18:31:00 Sgeo joins (~Sgeo@user/sgeo)
18:33:23 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
18:33:40 <sshine> probably not the shortest path to reverse ast traversal
18:33:57 × td_ quits (~td@94.134.91.143) (Ping timeout: 240 seconds)
18:35:40 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
18:35:53 × Jing quits (~hedgehog@125.105.141.97) (Ping timeout: 256 seconds)
18:36:03 td_ joins (~td@94.134.91.110)
18:40:40 <mjrosenb> EvanR: well, zip is a bunch of mapWithKey; unzip is just a pair of maps :-)
18:40:47 DNH joins (~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b)
18:41:26 <EvanR> wouldn't zipping two maps be at least intersectionWithKey
18:41:54 <EvanR> ah the Node type is parameterized by the lexeme... it could be more general probably
18:42:59 <EvanR> a leaves everywhere, or f wrappers everywhere leads to things
18:44:18 <EvanR> er, intersectionWith
18:49:36 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
18:51:09 wroathe joins (~wroathe@user/wroathe)
18:51:23 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
18:53:53 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
18:53:53 × urdh quits (~urdh@user/urdh) (Ping timeout: 256 seconds)
18:53:57 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
18:55:43 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 256 seconds)
19:00:08 ym is now known as qwym
19:04:58 <BrokenClutch> How you guys do callback systems?
19:04:59 × max22- quits (~maxime@2a01cb088335980027b3e3f3a18fa9f4.ipv6.abo.wanadoo.fr) (Ping timeout: 268 seconds)
19:06:09 <EvanR> I'm not sure what you're actually asking, but fun fact, an IO Whatever value is basically a callback (with no arguments)
19:06:29 <EvanR> Foo -> IO Bar is a callback with one arg
19:06:43 <geekosaur> also, lazy evaluation means any function parameter is essentially a callback
19:06:49 <iphy> sshine: shortest path isn't really important
19:06:57 <iphy> I want to write less code and do more stuff
19:07:14 <iphy> if it takes a refactoring of Node to become a HKD, that's ok
19:09:28 nitrix joins (~nitrix@user/nitrix)
19:09:37 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
19:10:00 nitrix parts (~nitrix@user/nitrix) ()
19:11:17 <BrokenClutch> thanks, I'm one month in and I still can't get haskell well
19:11:21 <monochrom> We guys generalize callback systems to "that's just another higher-order function" and we just write/use higher-order functions as appropriate.
19:11:37 urdh joins (~urdh@user/urdh)
19:12:01 <monochrom> https://www.slideshare.net/ScottWlaschin/fp-patterns-buildstufflt slide 13
19:12:13 <monochrom> We just write/use functions.
19:13:24 <BrokenClutch> but only the guys do that?
19:13:58 <EvanR> before going over so many cool things
19:14:02 yauhsien joins (~yauhsien@61-231-42-148.dynamic-ip.hinet.net)
19:14:09 <EvanR> BrokenClutch, what the hell is a callback system?
19:14:11 <monochrom> You asked "you guys" so the answer in kind is "we guys".
19:14:31 <EvanR> (in this case)
19:15:08 × cheater quits (~Username@user/cheater) (Quit: Killed (BlackJac (Requested by panasync)))
19:15:59 <BrokenClutch> I just kept forwarding the joke, sorry
19:16:13 × burakcank quits (~burakcank@has.arrived.and.is.ready-to.party) (Ping timeout: 240 seconds)
19:17:17 Erutuon joins (~Erutuon@user/erutuon)
19:17:55 × cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Ping timeout: 268 seconds)
19:18:23 × yauhsien quits (~yauhsien@61-231-42-148.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
19:19:03 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 250 seconds)
19:20:00 xkuru joins (~xkuru@user/xkuru)
19:21:05 <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
19:22:19 cheater joins (~Username@user/cheater)
19:22:55 × deadmarshal quits (~deadmarsh@95.38.228.37) (Ping timeout: 256 seconds)
19:23:47 <iphy> sshine: barbie makes things quite ugly
19:23:59 <BrokenClutch> EvanR: got it. Thanks.
19:24:20 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:24:39 × qwym quits (~ym@pool-96-253-29-94.prvdri.fios.verizon.net) (Quit: Textual IRC Client: www.textualapp.com)
19:25:08 <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
19:25:19 <EvanR> which takes 1 parameter out
19:25:27 <iphy> yeah
19:25:36 <iphy> that's the plan
19:26:46 <iphy> | PreprocDefineMacro lexeme [Node attr lexeme] (Node attr lexeme)
19:26:49 <iphy> does this become:
19:26:58 <iphy> | PreprocDefineMacro lexeme [f (Node attr lexeme)] (f (Node attr lexeme))
19:27:11 burakcank joins (~burakcank@has.arrived.and.is.ready-to.party)
19:27:16 <iphy> or does "f" go outside the list? or does it go both outside and inside the list?
19:27:40 <iphy> (I'll get rid of attr later)
19:27:59 <iphy> (also pretend I wrote "Node f attr lexeme")
19:28:12 <EvanR> I'm thinking data Node lexeme a = ... PrepprocDefineMacro lexeme [a] a
19:28:45 <EvanR> but I could be trippin
19:28:56 <iphy> then what's the type of PrepprocDefineMacro lexeme [] (PrepprocDefineMacro lexeme [] Break)?
19:29:20 <iphy> I mean, if it's "a", then the recursiveness of the datatype goes away, no?
19:29:24 <EvanR> you mean, a Node with bare Nodes in it?
19:29:29 <iphy> oh I see
19:29:37 <EvanR> you'd need to make a newtype for that
19:29:45 <EvanR> to do recursion
19:30:07 <EvanR> which is why I've been renaming things to WhateverF
19:30:15 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
19:32:15 <iphy> https://hackage.haskell.org/package/hypertypes#hkd-for-nested-structures
19:32:53 <iphy> EvanR: interesting
19:32:54 <EvanR> oh wow did not know recursion schemes did that
19:33:32 max22- joins (~maxime@2a01cb088335980093d703d768803864.ipv6.abo.wanadoo.fr)
19:34:02 <EvanR> hypertypes, damn
19:37:00 kadir parts (~kadir@88.251.52.166) (goodnight)
19:38:10 falafel_ joins (~falafel@cpe-76-168-195-162.socal.res.rr.com)
19:39:34 × xff0x quits (~xff0x@2001:1a81:538d:1a00:466f:9b53:869c:77ef) (Ping timeout: 260 seconds)
19:40:23 xff0x joins (~xff0x@2001:1a81:538d:1a00:d7e1:e1de:38a1:c28f)
19:42:06 × DNH quits (~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b) (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:42:21 dcoutts_ joins (~duncan@71.78.6.51.dyn.plus.net)
19:45:06 aeka` joins (~aeka@pool-100-4-208-71.albyny.fios.verizon.net)
19:45:36 <iphy> https://www.irccloud.com/pastebin/oCyEMH6C/
19:46:07 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
19:46:17 <iphy> I did this now, but I can't see how to use it without constructing huge types
19:46:33 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
19:47:37 × aeka quits (~aeka@2606:6080:1001:d:c59c:6e9a:3115:6f2f) (Ping timeout: 240 seconds)
19:50:37 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Ping timeout: 240 seconds)
19:50:37 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 268 seconds)
19:50:59 × goepsilongo quits (~goepsilon@2806:263:c404:8000:ec3a:2574:2f9:e2db) (Quit: Textual IRC Client: www.textualapp.com)
19:51:50 × aeka` quits (~aeka@pool-100-4-208-71.albyny.fios.verizon.net) (Read error: Connection reset by peer)
19:52:23 <EvanR> well at least you get map and fold for free
19:52:36 <EvanR> and maybe other things in recursion schemes
19:53:22 <EvanR> I vaguely recall being able to do traversals and handle particular node types without much code
19:54:13 × fef quits (~thedawn@user/thedawn) (Quit: Leaving)
19:55:12 <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
19:55:24 <EvanR> or*
19:56:17 cosimone joins (~user@93-47-231-248.ip115.fastwebnet.it)
19:56:28 <iphy> EvanR: "at least", but how do I write a parser?
19:57:20 <iphy> data ExprF a = Add a a | Sub a a | Int Int
19:57:56 <iphy> Add (Sub (Int 3) (Int 2)) (Int 1)
19:59:45 DNH joins (~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b)
19:59:55 aeka joins (~aeka@user/hiruji)
20:00:03 <EvanR> what's the goal type for the parser, just Expr, or some attributes stuffs around each node
20:00:30 <iphy> the parser doesn't add attributes, that's for later passes to add
20:00:51 <iphy> right now the parser never produces the Attr node
20:01:20 <EvanR> well the bare Expr is probably = Fix ExprF
20:01:48 <EvanR> then Int 5 :: Expr
20:04:39 <EvanR> erm
20:05:17 × juhp quits (~juhp@128.106.188.82) (Ping timeout: 240 seconds)
20:05:37 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
20:05:41 <EvanR> Fix (Add e1 e2) :: Expr, something like that
20:06:37 × aeka quits (~aeka@user/hiruji) (Ping timeout: 240 seconds)
20:07:19 aeka joins (~aeka@user/hiruji)
20:07:24 juhp joins (~juhp@128.106.188.82)
20:08:48 zincy joins (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807)
20:08:49 <EvanR> newtype Fix f = Fix { unFix :: f (Fix f) }
20:09:39 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:10:00 <EvanR> type Expr = Fix ExprF
20:10:13 <EvanR> Fix (Int 9) :: Expr
20:10:17 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
20:10:25 <iphy> so what would these look like? https://github.com/iphydf/hs-cimple/blob/generalised-traverse/src/Language/Cimple/Parser.y#L306
20:10:39 <EvanR> Fix (Add that that) :: Expr
20:10:58 <iphy> but Fix is of type Fix f, not Expr?
20:11:36 <EvanR> which are equal, type synonyms
20:11:40 Pickchea joins (~private@user/pickchea)
20:11:40 <geekosaur> above said Expr was itself Fix something
20:11:53 <iphy> ah right, Expr
20:12:21 mvk joins (~mvk@2607:fea8:5cdd:f000::917a)
20:12:41 <iphy> ok, so in the parser, what used to be "Add (Sub a b)" is now "Fix (Add (Fix (Sub a b)))"?
20:13:05 <EvanR> if a parser really produces that... yeah
20:13:30 <EvanR> basically a Fix newtype wrapper on any concrete construction
20:14:08 <EvanR> Fix is used in libraries, but if you have other stuff going on with the `a' you could use your own newtype
20:15:18 <iphy> ok, looks like pattern matching is going to be a pain
20:15:36 <EvanR> which is why you want generic operations
20:16:15 <iphy> with HKD, I can use a type family to erase Identity from the type and make pattern matching nice
20:16:21 <EvanR> or if it's just singling out 1 kind of node, it's just putting a Fix there too
20:16:57 <iphy> https://github.com/TokTok/hs-tokstyle/blob/master/src/Tokstyle/Linter/LoggerCalls.hs#L23
20:17:17 <iphy> Fix (FunctionCall (Fix (LiteralExpr _ (L _ _ "LOGGER_ASSERT"))) (_:_:Fix (LiteralExpr String) _:_)
20:17:42 <EvanR> yeah
20:17:59 × DNH quits (~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b) (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:18:00 <EvanR> and if you have additional wrappers in there, those are there
20:19:37 <EvanR> something something lens?
20:20:39 <EvanR> FunctionCall prism
20:22:59 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
20:22:59 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
20:22:59 wroathe joins (~wroathe@user/wroathe)
20:26:31 burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk)
20:27:25 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds)
20:32:03 × burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
20:37:08 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
20:42:06 × falafel_ quits (~falafel@cpe-76-168-195-162.socal.res.rr.com) (Ping timeout: 260 seconds)
20:42:16 pavonia joins (~user@user/siracusa)
20:48:50 × amk quits (~amk@109.255.169.126) (Read error: Connection reset by peer)
20:49:26 amk joins (~amk@109.255.169.126)
20:51:41 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
20:52:46 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
20:55:57 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Ping timeout: 240 seconds)
20:57:33 × cheater quits (~Username@user/cheater) (Ping timeout: 256 seconds)
20:57:42 × stilgart quits (~Christoph@chezlefab.net) (Remote host closed the connection)
20:57:45 × enikar quits (~enikar@user/enikar) (Quit: WeeChat 3.0)
20:58:44 enikar joins (~enikar@user/enikar)
21:02:50 × zincy quits (~zincy@2a00:23c8:970c:4801:bdb9:8c5f:3085:2807) (Remote host closed the connection)
21:03:58 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81)
21:04:01 cheater joins (~Username@user/cheater)
21:06:13 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
21:10:53 × zmt00 quits (~zmt00@user/zmt00) (Quit: Gone.)
21:11:36 raghavgururajan joins (ea769b8000@user/raghavgururajan)
21:12:09 DNH joins (~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b)
21:12:21 coot joins (~coot@89-64-85-93.dynamic.chello.pl)
21:13:32 × enikar quits (~enikar@user/enikar) (Quit: WeeChat 3.3)
21:15:17 acidjnk joins (~acidjnk@p200300d0c7271e72b97741cdfe77e27f.dip0.t-ipconnect.de)
21:21:33 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
21:23:37 × Pickchea quits (~private@user/pickchea) (Ping timeout: 256 seconds)
21:25:32 × zer0bitz quits (~zer0bitz@196.244.192.56) (Ping timeout: 240 seconds)
21:27:22 Akiva joins (~Akiva@user/Akiva)
21:30:14 × DNH quits (~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b) (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:40:02 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
21:42:37 zmt00 joins (~zmt00@user/zmt00)
21:42:41 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
21:51:22 × coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot)
21:54:07 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
22:04:08 <zero> can someone quickly explain `some` and `many` from Control.Applicative?
22:04:23 <EvanR> :t some
22:04:24 <lambdabot> Alternative f => f a -> f [a]
22:04:27 <EvanR> :t many
22:04:28 <lambdabot> Alternative f => f a -> f [a]
22:06:28 <EvanR> :t (<|>)
22:06:29 <lambdabot> Alternative f => f a -> f a -> f a
22:06:57 <geekosaur> they're meant for parsers and not very meaningful outside of that context
22:07:11 <geekosaur> "some" is roughly a regexp +, "many" a regexp "*"
22:08:49 <geekosaur> Applicative and Alternative are good for context free parsers, hence their inclusion
22:09:41 <zero> :t some (Just 7)
22:09:42 <lambdabot> Num a => Maybe [a]
22:09:51 <zero> > some (Just 7)
22:09:53 <lambdabot> *Exception: <<loop>>
22:09:56 <zero> ?
22:10:24 <geekosaur> as I said, it's not very useful if not used in a parser
22:10:30 <EvanR> > Just 7 <|> Just 9
22:10:32 <lambdabot> Just 7
22:10:35 <geekosaur> the instances for Maybe, lists, etc. are kinda sad
22:10:35 <EvanR> > Nothing <|> Just 9
22:10:37 <lambdabot> Just 9
22:10:54 <zero> geekosaur: ok
22:11:23 <geekosaur> well, maybe the one for lists since a list has the option of being a stream of tokens
22:11:33 <geekosaur> Maybe is pretty useless for this though
22:12:10 <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"
22:13:55 <geekosaur> so "some" and "many" can't rationally do anything for Maybe, so they bottom out
22:16:43 deadmarshal joins (~deadmarsh@95.38.116.71)
22:16:43 Pickchea joins (~private@user/pickchea)
22:17:21 DNH joins (~DNH@2a02:8108:1100:16d8:6043:aa58:f99b:e1b)
22:18:13 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:18:47 <EvanR> <|> for List seems to just do ++
22:20:57 × deadmarshal quits (~deadmarsh@95.38.116.71) (Ping timeout: 240 seconds)
22:22:12 wroathe joins (~wroathe@user/wroathe)
22:24:46 × dcoutts_ quits (~duncan@71.78.6.51.dyn.plus.net) (Ping timeout: 260 seconds)
22:24:47 × xff0x quits (~xff0x@2001:1a81:538d:1a00:d7e1:e1de:38a1:c28f) (Ping timeout: 268 seconds)
22:25:33 xff0x joins (~xff0x@2001:1a81:538d:1a00:2c7a:ecf1:d00f:a986)
22:31:54 vysn joins (~vysn@user/vysn)
22:33:17 <dsal> Also <> -- many options if you like variety
22:33:37 <EvanR> "haskell has too many operators"
22:34:35 <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)
22:34:55 <dsal> I was refactoring and had <-=<< and was like... That should do somehing...
22:35:16 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 268 seconds)
22:35:27 web-50 joins (~web-50@185.202.32.108)
22:36:54 <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.
22:37:27 <dsal> Learning lots of different things lots of different ways is the only good practice.
22:37:33 <dsal> Most mechanisms will lie to you.
22:38:02 <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
22:38:07 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Read error: Connection reset by peer)
22:38:50 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
22:38:55 <EvanR> even then, you may never see any Monad other than IO
22:39:16 <sshine> EvanR, you'd avoid lists, too? ;)
22:39:23 <sshine> EvanR, and even Maybe? ;)
22:39:44 <EvanR> rarely used list monad as such
22:39:47 <web-50> what about theorem provers like lean? isn't it better to start with that?
22:40:06 <sshine> web-50, that depends on your assumptions.
22:40:07 <EvanR> haskell can't prove theorems so that won't help much
22:40:27 <EvanR> at best you'll be frustrated at how illogical it is
22:40:53 × xff0x quits (~xff0x@2001:1a81:538d:1a00:2c7a:ecf1:d00f:a986) (Ping timeout: 252 seconds)
22:41:01 <EvanR> haskell is for general purpose programming
22:41:36 <web-50> can you recommend some valuable repos which uses haskell effectively to show its value compared to other languages?
22:41:46 xff0x joins (~xff0x@2001:1a81:538d:1a00:d6e3:ac9b:2d1c:a9e)
22:42:18 <dsal> That's not really how it works.
22:42:49 <sshine> web-50, I think some of the more popular haskell projects outside of the Haskell bubble are: Pandoc, ShellCheck, git-annex
22:42:52 <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.
22:43:02 <hpc> simulavr is haskell too
22:44:07 <sshine> web-50, if you are more into theorem proving, you could also look into Agda2.
22:44:37 <web-50> yea, agda also quite cool
22:44:50 <dsal> I'm not completely convinced I could write software in Agda.
22:45:01 <monochrom> There is a book "The Haskell Road to Logic, Math and Programming". But I haven't taken a look.
22:45:16 <EvanR> agda is actually pretty good
22:45:18 <sshine> dsal, I'm convinced that I could write Agda code that generated Haskell code as part of its proving.
22:45:55 <sshine> dsal, now maybe there's a core of your Haskell codebase that you'd like proven invariants about, rather than property tests.
22:46:19 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
22:46:25 geekosaur programs in Haskell without knowing any of that advanced math…
22:46:32 sshine too
22:46:36 hpc too
22:46:58 sshine took part in an Agda workshop earlier this year, and it mostly consisted of placing 'refl' in the right places. :-D
22:47:25 <EvanR> sorry I can't help but math (but it's not strictly necessary for haskell)
22:48:09 <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
22:48:12 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
22:48:26 <geekosaur> otherwise I know a little number theory
22:48:33 <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
22:49:01 <EvanR> lean is implemented in C++?
22:49:14 <web-50> yes
22:49:20 <EvanR> how does that help
22:49:28 <monochrom> I don't think it matters.
22:50:01 <monochrom> I know a statically typed, type-inferred programming language implemented in Lisp.
22:50:03 <geekosaur> there's a C++ bot written in Haskell; that doesn't matter either
22:50:52 <monochrom> And said programming language was in fact basically the opposite of Lisp on all fronts.
22:51:13 <monochrom> Said programming language was just an old version of SML today.
22:51:18 <geekosaur> for that matter there's a Haskell written in C (Hugs)
22:52:07 <geekosaur> you can write anything in anything (turing equivalent) if you put your mind to it; that doesn't prove much
22:52:58 Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
22:53:13 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
22:53:18 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
22:53:20 Nolrai2 joins (~Nolrai2@73.240.1.39)
22:54:24 otherwise joins (~otherwise@c-73-221-44-172.hsd1.wa.comcast.net)
22:57:49 × coolnickname quits (uid531864@user/coolnickname) (Quit: Connection closed for inactivity)
22:57:54 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 260 seconds)
22:59:26 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:59:33 <sshine> web-50, it sounds like you want to give Lean a go.
23:00:23 <web-50> yea, they have very good community too
23:04:56 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
23:04:56 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
23:04:56 wroathe joins (~wroathe@user/wroathe)
23:06:40 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
23:09:27 <Nolrai2> Lean is very cool.
23:09:35 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
23:09:46 <Nolrai2> Is getting hmatrix to work on windows hard?
23:10:37 <Nolrai2> The "matrix" libray is 1-indexed which is just painful to use.
23:15:42 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
23:16:24 lavaman joins (~lavaman@98.38.249.169)
23:20:37 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
23:27:37 × mvk quits (~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds)
23:28:06 × jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 276 seconds)
23:29:40 jpds joins (~jpds@gateway/tor-sasl/jpds)
23:30:30 AlexNoo_ joins (~AlexNoo@178.34.163.120)
23:32:49 × Alex_test quits (~al_test@178.34.160.99) (Ping timeout: 256 seconds)
23:33:37 × AlexZenon quits (~alzenon@178.34.160.99) (Ping timeout: 240 seconds)
23:33:57 × AlexNoo quits (~AlexNoo@178.34.160.99) (Ping timeout: 240 seconds)
23:34:41 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b417:46a:3118:ab81) (Remote host closed the connection)
23:36:44 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
23:36:49 zero is now known as zzz
23:37:21 AlexNoo_ is now known as AlexNoo
23:38:26 × timCF quits (~timCF@m91-129-100-224.cust.tele2.ee) (Quit: leaving)
23:38:35 Alex_test joins (~al_test@178.34.163.120)
23:39:06 AlexZenon joins (~alzenon@178.34.163.120)
23:41:32 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
23:42:17 × python476 quits (~user@88.160.31.174) (Ping timeout: 250 seconds)
23:49:18 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
23:49:18 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
23:49:18 wroathe joins (~wroathe@user/wroathe)
23:51:49 aallen joins (~aallen@072-182-074-253.res.spectrum.com)
23:52:42 × Guest|70 quits (~Guest|70@c-24-6-12-87.hsd1.ca.comcast.net) (Quit: Ping timeout (120 seconds))

All times are in UTC on 2021-12-26.