Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-03-20 19:47:18 <tempate> Alright, fantastic
2021-03-20 19:47:35 tomsmeding . o O ( Hmm, definienda -- "things that must be defined" if I remember my Latin correctly; I'd just use 'patterns', I think )
2021-03-20 19:47:52 LogicUpgrade joins (57e3c46d@87.227.196.109)
2021-03-20 19:47:55 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 3.0.1)
2021-03-20 19:48:09 <tempate> For consistency this is my third and final version: https://paste.tomsmeding.com/prQ6OOAe
2021-03-20 19:48:15 <tempate> I'm going to move to another problem now
2021-03-20 19:48:22 <tempate> Thank you both very much for your help
2021-03-20 19:48:24 <ski> `a:as' and `b:bs' are patterns there. `zip (a:as) (b:bs)' is the definiendum ("what is to be defined"). `(a,b) : zip as bs' is the definiens ("what it's defined to be/mean")
2021-03-20 19:49:06 <ski> (this is an indirect definition, since we're defining `zip', by way of defining what is the result of applying it, to every possible input)
2021-03-20 19:49:24 bitmagie joins (~Thunderbi@200116b806855300b098de2ef1518cac.dip.versatel-1u1.de)
2021-03-20 19:49:49 ski just likes some such latin terms :p
2021-03-20 19:50:08 × mikoto-chan quits (~anass@gateway/tor-sasl/mikoto-chan) (Ping timeout: 268 seconds)
2021-03-20 19:50:20 × marinelli quits (~marinelli@gateway/tor-sasl/marinelli) (Quit: marinelli)
2021-03-20 19:50:24 vicfred joins (~vicfred@unaffiliated/vicfred)
2021-03-20 19:50:29 <ski> tempate : you know that you're able to write
2021-03-20 19:50:35 <ski> let numbers :: [Int]
2021-03-20 19:50:40 <ski> numbers = ...
2021-03-20 19:50:42 <ski> yes ?
2021-03-20 19:50:52 <tempate> I do, but is that any better?
2021-03-20 19:51:17 <tomsmeding> ski: I see :)
2021-03-20 19:51:18 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-03-20 19:51:24 <ski> (not saying you should necessarily do that here. just pointing out the possibility. sometimes people don't realize you can put signatures inside `let' and `where')
2021-03-20 19:52:12 × bitmagie quits (~Thunderbi@200116b806855300b098de2ef1518cac.dip.versatel-1u1.de) (Client Quit)
2021-03-20 19:52:22 <ski> tempate : better, in the end, is up for you to decide. it's your code, it should be readable to you
2021-03-20 19:52:46 <ski> (being aware of common problems, pitfalls, issues, tricks, conventions, help, of course)
2021-03-20 19:52:47 <tempate> ski: alright, I appreciate the advice as, as you can probably tell, I'm learning by doing. I usually like to learn programming languages by running head-first against the wall, so every piece of advice, or comment, you're willing to give me is more than welcome.
2021-03-20 19:52:58 ski nods
2021-03-20 19:53:22 malumore joins (~malumore@151.62.117.235)
2021-03-20 19:54:01 <ski> in my experience, newbies (or talking to newbies) often benefit from being a bit extra strict with terminology, distinctions, relevant concepts, and possible related confusions
2021-03-20 19:55:37 <ski> (i've seen multiple people say this, or had them thank me, when i've attempted to elucidate such matters. when one's more comfortable with the stuff, and talking to others who are, one can afford to be a bit more sloppy)
2021-03-20 19:55:44 × elliott__ quits (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
2021-03-20 19:58:15 <tempate> I agree
2021-03-20 19:59:51 × average quits (uid473595@gateway/web/irccloud.com/x-hdmdexfvuhnmptgq) (Quit: Connection closed for inactivity)
2021-03-20 20:00:14 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-03-20 20:02:58 molehillish joins (~molehilli@2600:8800:8d06:1800:c1f2:e355:53f0:4ab8)
2021-03-20 20:03:31 ajc joins (~ajc@69.231.232.79)
2021-03-20 20:05:29 chenshen joins (~chenshen@2620:10d:c090:400::5:d9c5)
2021-03-20 20:07:32 × molehillish quits (~molehilli@2600:8800:8d06:1800:c1f2:e355:53f0:4ab8) (Ping timeout: 244 seconds)
2021-03-20 20:07:57 shapr hops quietly
2021-03-20 20:08:14 <shapr> six weeks until #haskell turns 20
2021-03-20 20:09:43 ski boings quietly
2021-03-20 20:09:49 <shapr> hi ski!
2021-03-20 20:10:34 <ski> hm, first of May, was it, roughly ?
2021-03-20 20:10:47 <ski> hejs :)
2021-03-20 20:12:36 × frozenErebus quits (~frozenEre@94.129.70.18) (Ping timeout: 246 seconds)
2021-03-20 20:14:53 hackage recursion-schemes 5.2.2.1 - Representing common recursion patterns as higher-order functions https://hackage.haskell.org/package/recursion-schemes-5.2.2.1 (luc_tielen)
2021-03-20 20:14:58 × lawid quits (~quassel@dslb-090-186-099-083.090.186.pools.vodafone-ip.de) (Quit: lawid)
2021-03-20 20:15:31 <ski> i don't remember if i came here in the late spring, or in the autumn
2021-03-20 20:16:50 × danvet quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 264 seconds)
2021-03-20 20:18:16 lawid joins (~quassel@dslb-090-186-099-083.090.186.pools.vodafone-ip.de)
2021-03-20 20:19:30 × geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed)
2021-03-20 20:23:16 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 3.1)
2021-03-20 20:24:09 <shapr> ski: I think you were one of the first few
2021-03-20 20:24:43 m1dnight1 joins (~m1dnight@188.ip-51-91-158.eu)
2021-03-20 20:25:34 × zebrag quits (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr) (Quit: Konversation terminated!)
2021-03-20 20:25:53 zebrag joins (~inkbottle@aaubervilliers-654-1-109-157.w86-212.abo.wanadoo.fr)
2021-03-20 20:27:24 <ski> yea, iirc we were around a dozen to a score, back then
2021-03-20 20:27:49 × dcoutts__ quits (~duncan@85.186.125.91.dyn.plus.net) (Remote host closed the connection)
2021-03-20 20:27:52 <ski> i guess i found the description on hawiki at the right time :)
2021-03-20 20:28:11 dcoutts__ joins (~duncan@85.186.125.91.dyn.plus.net)
2021-03-20 20:29:38 × soulseeker_ quits (~soulseeke@90.214.167.201) (Ping timeout: 260 seconds)
2021-03-20 20:32:07 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-03-20 20:33:06 × ezrakilty quits (~ezrakilty@97-113-58-224.tukw.qwest.net) (Remote host closed the connection)
2021-03-20 20:34:54 <tempate> I got this one sooner than I expected
2021-03-20 20:34:55 <tempate> https://paste.tomsmeding.com/gSqLJcqA
2021-03-20 20:35:58 heatsink joins (~heatsink@2600:1700:bef1:5e10:6075:d116:7f4b:9342)
2021-03-20 20:37:38 <tempate> Is camel case more idiomatic in haskell than snail case?
2021-03-20 20:37:48 <ski> yes
2021-03-20 20:38:19 <ski> i think, occasionaly, the latter may be used, or even both at the same time
2021-03-20 20:38:30 <tempate> Actually, I think this is more readable: https://paste.tomsmeding.com/tc4tAf3e
2021-03-20 20:39:11 <ski> instead of `(a,b) = ...' and `b_ = tail b', you could say `(a,_:b_) = ...'
2021-03-20 20:39:52 <ski> or, i guess, in this case, possibly (a,'-':b_) = ...
2021-03-20 20:40:44 <ski> and instead of `head char' you can say `char', with `char:_' replacing the pattern `char'
2021-03-20 20:40:45 <tempate> oh, right
2021-03-20 20:40:50 × heatsink quits (~heatsink@2600:1700:bef1:5e10:6075:d116:7f4b:9342) (Ping timeout: 264 seconds)
2021-03-20 20:41:40 <ski> in `policy1', `(c:cs)' could be `c:cs'
2021-03-20 20:42:01 aarvar joins (~foewfoiew@2601:602:a080:fa0:99f2:16e7:abb7:2d80)
2021-03-20 20:42:05 ski would probably personally align the parameters of the recursive call
2021-03-20 20:42:09 <tempate> ski: yeah, I thought about that but I thought `head char` was more readable
2021-03-20 20:42:26 <ski> (but then i may like things lining up, quite a bit)
2021-03-20 20:42:40 <tempate> does (a, '-', b) = bounds make sense?
2021-03-20 20:42:53 heatsink joins (~heatsink@2600:1700:bef1:5e10:6075:d116:7f4b:9342)
2021-03-20 20:43:02 <ski> `head',`tail',`fromJust' will give worse error messages, not including a location
2021-03-20 20:43:17 <ski> no, the second `,' should be a `:', as i said
2021-03-20 20:44:07 <tempate> I thought that was if I was using a break
2021-03-20 20:44:26 <ski> oh, sorry. i missed the `bounds' part
2021-03-20 20:44:37 <ski> you'd still need the `break', yes
2021-03-20 20:44:50 <tempate> oh, ok
2021-03-20 20:45:43 <tempate> ski: do you like the str_index part (despite the camel case?
2021-03-20 20:45:47 <tempate> +)
2021-03-20 20:47:19 <ski> map f (map g xs) = (map f . map g) xs = map (f . g) xs -- one pass instead of two
2021-03-20 20:48:25 frozenErebus joins (~frozenEre@94.129.70.18)
2021-03-20 20:48:26 <ski> oh, only saw the updated now
2021-03-20 20:48:30 <tempate> I knew there had to be a way to do that
2021-03-20 20:49:01 jamm_ joins (~jamm@unaffiliated/jamm)
2021-03-20 20:49:38 <tempate> To be completely honest I'm still sort of confused as to how the `.` works
2021-03-20 20:49:41 <ski> if you don't like the brackets piling up at the end, you could possibly say something like
2021-03-20 20:50:06 <ski> (show . sum . map (fromEnum . policy1)) passwords
2021-03-20 20:50:17 <ski> @src (.)
2021-03-20 20:50:17 <lambdabot> (f . g) x = f (g x)

All times are in UTC.