Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 547 548 549 550 551 552 553 554 555 556 557 .. 5022
502,152 events total
2020-10-09 22:54:22 <Guest18> I included only the relevant parts, i have more
2020-10-09 22:54:32 xff0x joins (~fox@2001:1a81:520e:b00:31b6:6e9a:3cee:6489)
2020-10-09 22:55:09 × cr3 quits (~cr3@192-222-143-195.qc.cable.ebox.net) (Quit: leaving)
2020-10-09 22:55:26 <dsal> I'd just use a guard instead of that case.
2020-10-09 22:55:35 <Guest18> deleteOn seems to me like it could use a little refactoring
2020-10-09 22:56:08 <Guest18> so would i, but in this case, i only compare once
2020-10-09 22:56:42 mdunnio joins (~mdunnio@208.59.170.5)
2020-10-09 22:56:56 <dsal> Sure, it's clear enough.
2020-10-09 22:57:22 <Guest18> any other suggestions? how would you do it?
2020-10-09 22:58:17 <dsal> I tend not to use let like you're doing in deleteOn. where is a bit nicer there, I think.
2020-10-09 22:58:23 <dsal> Also, have you considered making your BST Foldable?
2020-10-09 22:58:47 <dsal> `foldr1 min (flatten right)` is basically `minimum right`
2020-10-09 22:58:49 <Guest18> Yes, I did, but I do not posses the knowledge to know how to do it
2020-10-09 22:59:13 <Guest18> I know what the typeclass is, i don't know how to make it an instance of Foldable though
2020-10-09 22:59:37 <monochrom> Foldable is going to be a distraction at this stage.
2020-10-09 22:59:44 <Guest18> yeah, actually where would be nicer, thank you
2020-10-09 22:59:59 × xff0x quits (~fox@2001:1a81:520e:b00:31b6:6e9a:3cee:6489) (Ping timeout: 272 seconds)
2020-10-09 23:00:37 <dsal> Well, I guess in any case, `foldr1 min` is `minimum` -- both are partial.
2020-10-09 23:01:59 <monochrom> "deleteBST nextSuccesor left" sounds like simply "left".
2020-10-09 23:02:01 × mdunnio quits (~mdunnio@208.59.170.5) (Ping timeout: 264 seconds)
2020-10-09 23:02:30 <monochrom> "foldr1 min (flatten right)" sounds like "head (flatten right)"
2020-10-09 23:03:49 × rayer quits (path@gateway/shell/xshellz/x-wnmzeedxnwlaimsy) (Ping timeout: 264 seconds)
2020-10-09 23:03:49 <monochrom> in the context of binary search trees, that is
2020-10-09 23:03:56 <Guest18> i understand the latter, but the former seems weird
2020-10-09 23:03:58 × ulidtko|k quits (~ulidtko@193.111.48.79) (Ping timeout: 260 seconds)
2020-10-09 23:04:34 <Guest18> if i said simply left, how would i delete the extra node left there? I would have duplicates in the tree
2020-10-09 23:04:38 <monochrom> The successor is from the right subtree only, so there is no need to modify the left subtree?
2020-10-09 23:04:52 rayer joins (path@gateway/shell/xshellz/x-xigijdelvsqhpmpl)
2020-10-09 23:04:58 <Guest18> Oh
2020-10-09 23:05:08 <Guest18> Yeah, that makes sense
2020-10-09 23:06:35 <Guest18> Yeah, since flatten traverses the tree in order, the resulting list is sorted, so the minimum is the head, i didn't think of that
2020-10-09 23:06:38 <dsal> Oh, `deleteOn` is slightly misleading. I didn't actually read it. heh. If you're not using `x` it'd be clearer to not name it.
2020-10-09 23:07:31 <monochrom> Nice. In that case get rid of the parameter altogether.
2020-10-09 23:07:38 <Guest18> actually, it is never used, so why bother taking as a parameter
2020-10-09 23:07:40 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-10-09 23:08:04 xff0x joins (~fox@2001:1a81:5216:ad00:31b6:6e9a:3cee:6489)
2020-10-09 23:10:21 <Guest18> https://dpaste.com/3PXJGRMV8 -- new version
2020-10-09 23:10:30 aaaaaa joins (~ArthurStr@host-91-90-11-13.soborka.net)
2020-10-09 23:10:31 <Guest18> I am actually quite happy with this
2020-10-09 23:12:08 <Guest18> It feels good to actually make something useful with a new language you just started learning
2020-10-09 23:13:10 <Guest18> any ideas for projects that i can do with haskell?
2020-10-09 23:13:37 × GyroW_ quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
2020-10-09 23:13:47 GyroW joins (~GyroW@d54C03E98.access.telenet.be)
2020-10-09 23:13:48 × GyroW quits (~GyroW@d54C03E98.access.telenet.be) (Changing host)
2020-10-09 23:13:48 GyroW joins (~GyroW@unaffiliated/gyrow)
2020-10-09 23:14:53 <Guest18> I was thinking of making a small shell with haskell, like a restricted version of bash - only the basic commands
2020-10-09 23:21:15 <Guest18> I reckon you don't dig the idea?
2020-10-09 23:21:30 × TJChem quits (~timotayj@188.214.15.156) (Quit: Lost terminal)
2020-10-09 23:21:59 <Clint> i think it's a great idea
2020-10-09 23:24:32 × raehik quits (~raehik@cpc96984-rdng25-2-0-cust109.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
2020-10-09 23:25:19 × zhenchaoli quits (~user@2601:641:8000:4f00:58ae:cf75:1df1:eeff) (Ping timeout: 272 seconds)
2020-10-09 23:26:57 hackage web-plugins 0.3.0 - dynamic plugin system for web applications https://hackage.haskell.org/package/web-plugins-0.3.0 (JeremyShaw)
2020-10-09 23:27:17 × Forkk_ quits (forkk@2600:3c00::f03c:91ff:fe84:de4d) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
2020-10-09 23:27:27 <Guest18> Awesome! I will get around to it soon. I still have more to learn about IO, and it does seem pretty scary
2020-10-09 23:27:44 zaquest joins (~notzaques@5.128.210.178)
2020-10-09 23:27:46 × nineonine quits (~nineonine@216.81.48.202) (Remote host closed the connection)
2020-10-09 23:28:58 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-09 23:29:11 Forkk joins (forkk@2600:3c00::f03c:91ff:fe84:de4d)
2020-10-09 23:29:42 × Ariakenom__ quits (~Ariakenom@h-155-4-221-50.NA.cust.bahnhof.se) (Read error: Connection reset by peer)
2020-10-09 23:30:08 × jdgr quits (601c428b@gateway/web/cgi-irc/kiwiirc.com/ip.96.28.66.139) (Ping timeout: 256 seconds)
2020-10-09 23:30:45 × DavidEichmann quits (~david@43.240.198.146.dyn.plus.net) (Ping timeout: 240 seconds)
2020-10-09 23:30:59 × son0p quits (~son0p@181.136.122.143) (Remote host closed the connection)
2020-10-09 23:32:26 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-10-09 23:32:57 hackage citeproc 0.1 - Generates citations and bibliography from CSL styles. https://hackage.haskell.org/package/citeproc-0.1 (JohnMacFarlane)
2020-10-09 23:33:05 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
2020-10-09 23:34:02 × m0rphism quits (~m0rphism@HSI-KBW-046-005-177-122.hsi8.kabel-badenwuerttemberg.de) (Ping timeout: 260 seconds)
2020-10-09 23:34:03 mdunnio joins (~mdunnio@208.59.170.5)
2020-10-09 23:35:13 <ski> Guest18 : `deleteOn' could be called `merge' ?
2020-10-09 23:37:08 <ski> redundant brackets in `flatten'
2020-10-09 23:38:33 <ski> i might define a `splitMin' operation, that both gives the minimum, and the remaining tree
2020-10-09 23:39:02 <Guest18> ski: I mean, I don't really see how it merges stuff any more than the other functions, and I wanted to emphasize that it has a connection with deleteBST, same way I did with `depth` and `depthGo` earlier. It seemed appropiate, because it deletes the root on that subtree
2020-10-09 23:39:22 × mdunnio quits (~mdunnio@208.59.170.5) (Ping timeout: 272 seconds)
2020-10-09 23:39:33 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-09 23:39:59 nineonine joins (~nineonine@216-19-190-182.dyn.novuscom.net)
2020-10-09 23:40:06 <Guest18> how would i implement splitMin?
2020-10-09 23:42:07 × djellemah quits (~djellemah@2601:5c2:100:96c:e008:b638:39fe:6a54) (Ping timeout: 240 seconds)
2020-10-09 23:43:04 <dsal> Guest18: one way to emphasize that connection is to stick it in a where clause where it's used. :)
2020-10-09 23:43:22 <ski> the minimum element is always in the left-most leaf
2020-10-09 23:43:48 aaaaaa parts (~ArthurStr@host-91-90-11-13.soborka.net) ()
2020-10-09 23:44:11 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds)
2020-10-09 23:44:17 <ski> Guest18 : your `deleteOn' takes two trees (and an element that's always ignored), and combines them into a single tree
2020-10-09 23:44:34 × nineonine quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Ping timeout: 258 seconds)
2020-10-09 23:44:36 <Guest18> dsal: but it was too big for a where clause, wasn't it?
2020-10-09 23:44:43 <ski> (ah, sorry, in your last paste version, you didn't pass it the element)
2020-10-09 23:45:07 × xff0x quits (~fox@2001:1a81:5216:ad00:31b6:6e9a:3cee:6489) (Ping timeout: 240 seconds)
2020-10-09 23:45:12 × pera quits (~pera@unaffiliated/pera) (Quit: leaving)
2020-10-09 23:45:18 <bliminse> Guest18: unrelated to current query, but before on project suggestion, I liked what you said but you may wanna try a more specific one first to learn IO and other bits
2020-10-09 23:45:36 <dsal> Guest18: too big? It's never too big! :)
2020-10-09 23:45:40 <bliminse> you could try something like parsing git log results and constructing a tree
2020-10-09 23:45:54 <ski> if you wanted `deleteOn' to be an implementation detail of `deleteBST', you could define `deleteOn' inside a `where' attached to `deleteBST'
2020-10-09 23:46:13 × danvet_ quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 272 seconds)
2020-10-09 23:46:14 <bliminse> i.e., if you have any git repo run git log --pretty="tformat:%h{%aI{%an{%d{%s" | column -t -s '{' and save that to file
2020-10-09 23:46:17 jedws joins (~jedws@121.209.161.98)
2020-10-09 23:46:24 <ski> but merging two `BST's sounds like it could be an independently interesting operation
2020-10-09 23:46:45 <ski> (ah, i see dsal was talking about the same thing)
2020-10-09 23:47:05 Lycurgus joins (~niemand@98.4.96.130)
2020-10-09 23:47:07 <bliminse> then you can pick up skills on reading/parsing, building a tree, optionally doing some folding on the tree to gather stats (e.g., number of commits per year/month), then write stats to a file
2020-10-09 23:47:09 <Guest18> bliminse: this is good stuff, what else do you got?
2020-10-09 23:47:31 <bliminse> so you pick up read, parse, folds/unfolds, writing, and who knows what else xD
2020-10-09 23:48:08 <Guest18> ski: I didn't know `where` can fit function definitions longer than a line

All times are in UTC.