Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,677 events total
2025-10-14 15:28:29 × Square3 quits (~Square@user/square) (Ping timeout: 256 seconds)
2025-10-14 15:29:03 × Square quits (~Square4@user/square) (Ping timeout: 256 seconds)
2025-10-14 15:30:21 × inline quits (~inlinE@ip-178-202-059-161.um47.pools.vodafone-ip.de) (Ping timeout: 252 seconds)
2025-10-14 15:30:57 × OWS quits (~Shark8@c-174-56-102-109.hsd1.nm.comcast.net) (Ping timeout: 260 seconds)
2025-10-14 15:31:14 Inline joins (~inlinE@ip-178-202-059-161.um47.pools.vodafone-ip.de)
2025-10-14 15:31:55 × Shark8 quits (~Shark8@c-174-56-102-109.hsd1.nm.comcast.net) (Remote host closed the connection)
2025-10-14 15:32:19 Shark8 joins (~Shark8@c-174-56-102-109.hsd1.nm.comcast.net)
2025-10-14 15:35:57 gustrb joins (~gustrb@191.243.134.87)
2025-10-14 15:40:29 <int-e> ...why are you asking for a code review on code that doesn't even compile.
2025-10-14 15:41:41 <[exa]> Tri: you might want to join all the isWhateverOverlapping into a single function
2025-10-14 15:42:20 int-e is going to mention that half of those predicates aren't transitive and leave it at that.
2025-10-14 15:43:33 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
2025-10-14 15:47:14 <Tri> int-e, oh it didn't? I'm sorry let me double check, it compiles on my local, I've been running it. I've copied it across different forums to ask for suggestions, so I may have added/dropped something.
2025-10-14 15:50:13 <Tri> int-e, I just copy-pasted code from that link and recompile, it was fine. Perhaps you missed some package? Here is my cabal https://paste.tomsmeding.com/CLDOLEXr
2025-10-14 15:51:13 <Tri> int-e, I didn't give you this, sorry https://paste.tomsmeding.com/Zj0uN9k7
2025-10-14 15:52:37 <int-e> Oh, my bad. I thought startData and endDate would have the same type.
2025-10-14 15:52:39 <Tri> [exa], I think haskell has some concept to compose them, but I don't know what. I would like to string them together from small functions, not combine them into a big function, because I still want to use these small functions separately
2025-10-14 15:53:02 <Tri> int-e, all good, thank you for checking
2025-10-14 15:54:22 <Tri> maybe next time I will just make a repo for this for reviewer's convenience, the main.hs has the core logic so I only quickly pasted it into tomsmeding and ask for review
2025-10-14 15:54:23 <[exa]> Tri: I like to do e.g. this: isOverlapping a b = and [something a == something b, condition2, condition3, ...]
2025-10-14 15:56:25 × divya quits (divya@140.238.251.170) (Ping timeout: 265 seconds)
2025-10-14 15:57:32 <Tri> [exa], that's pretty neat. Thank you. Does Haskell have something that's even more expressive? I at least I could re-code my function, so that they can be compose like overlappingA >>> overlappingB >>> overlappingC >>> overlappingD, and just short-circuit on the first fail function. This looks a lot like bind in monad to me
2025-10-14 15:58:10 <geekosaur> Alternative?
2025-10-14 15:59:18 <Tri> let me look into that, I wonder if it works if my data doesn't have a monad structure
2025-10-14 15:59:19 <[exa]> Tri: like, you can put literal && in between the conditions, I used a list because it formats nicely if you have many conditions
2025-10-14 15:59:43 <geekosaur> Alternative only requires Applicative, not Monad
2025-10-14 15:59:47 <[exa]> saying "we have a list of conditions" and meaning an actual list counts. :)
2025-10-14 16:00:14 <geekosaur> and yes, if it's just a list of conditions you don't need either
2025-10-14 16:00:19 <Tri> ok I will look into them. Thank you
2025-10-14 16:03:20 <ski> Tri : define your own custom display function, rather than using `Show' instance to portray in a custom format
2025-10-14 16:03:38 mari-estel joins (~mari-este@user/mari-estel)
2025-10-14 16:04:39 Zemy_ joins (~Zemy@2600:100c:b0a0:3fd9:1cfb:70ff:feac:dc0e)
2025-10-14 16:04:40 × Zemy quits (~Zemy@12.218.191.128) (Read error: Connection reset by peer)
2025-10-14 16:05:09 Zemy joins (~Zemy@syn-067-078-059-246.biz.spectrum.com)
2025-10-14 16:05:54 <Tri> [exa], my code is already using &&. I just find passing in the 2 parameters on every function check very clunky. I found this is pretty idiomatic https://paste.tomsmeding.com/98dJNMNB
2025-10-14 16:06:24 <ski> Tri : instead of using `case'-`of' in `isDateRangeOverlapping', you can use `all'
2025-10-14 16:06:53 <ski> ditto for `isConditionOverlapping'
2025-10-14 16:07:11 <ski> oh, and `isAssetOverlapping'
2025-10-14 16:07:49 <Tri> geekosaur, if I use Alternative, I need to modify my functions signature to return an Applicative structure, which is fine, but then it's bending the business logic, which I don't like. I want to keep the intent clear: return a Bool meaning it's either overlapping or not
2025-10-14 16:08:25 <EvanR> there's so many ways to skin this one
2025-10-14 16:08:34 <EvanR> @src and
2025-10-14 16:08:34 <lambdabot> and = foldr (&&) True
2025-10-14 16:08:58 × Zemy_ quits (~Zemy@2600:100c:b0a0:3fd9:1cfb:70ff:feac:dc0e) (Ping timeout: 246 seconds)
2025-10-14 16:09:42 <Tri> I've got to get back to my job a bit, thank you everyone, I will get back later
2025-10-14 16:09:56 <EvanR> :t zipWith uncurry
2025-10-14 16:09:57 <lambdabot> [a -> b -> c] -> [(a, b)] -> [c]
2025-10-14 16:10:30 × gustrb quits (~gustrb@191.243.134.87) (Ping timeout: 252 seconds)
2025-10-14 16:10:47 Googulator18 is now known as Googulator
2025-10-14 16:12:51 × tomboy64 quits (~tomboy64@user/tomboy64) (Ping timeout: 250 seconds)
2025-10-14 16:13:40 <EvanR> and I'm not sure there's a meaningful difference between anding by chaining && or and on an explicit list (chaining commas)
2025-10-14 16:14:18 <ski> groupBy (\x y -> and [f x y | f <- [isIssuerOverlapping,isAssetOverlapping,isConditionOverlapping,isDateRangeOverlapping,isTargetColumnOverlapping]])
2025-10-14 16:14:37 <ski> using `<>' with `All' seems rather clunky here, unfortunately ..
2025-10-14 16:14:58 <Tri> thank you for your help, I will get back to read your comments later
2025-10-14 16:15:23 tomboy64 joins (~tomboy64@user/tomboy64)
2025-10-14 16:15:38 Googulator26 joins (~Googulato@2a01-036d-0106-03fa-dc7a-fb6e-71bb-aaf0.pool6.digikabel.hu)
2025-10-14 16:15:38 × Googulator quits (~Googulato@2a01-036d-0106-03fa-dc7a-fb6e-71bb-aaf0.pool6.digikabel.hu) (Quit: Client closed)
2025-10-14 16:16:10 <ski> Tri : `Show' and `Read' are intended to work together with instances for other types. for this reason, it is confusing to have them handle non-Haskell syntax, hence why i suggested making a separate function for your custom (non-Haskell syntax) formatting
2025-10-14 16:17:50 divya joins (divya@140.238.251.170)
2025-10-14 16:17:54 <ski> Tri : "Does Haskell have something that's even more expressive? I at least I could re-code my function, so that they can be compose like overlappingA >>> overlappingB >>> overlappingC >>> overlappingD, and just short-circuit on the first fail function. This looks a lot like bind in monad to me" -- in the case where you'd use `<>' (rather than `&&'), this works fine
2025-10-14 16:18:38 <EvanR> because a monoid is just a category with one object?
2025-10-14 16:19:39 <ski> > sortBy (comparing length <> compare) (words "The quick brown fox jumps over the lazy dog") -- sort primarily by length, and only secondarily lexicographically
2025-10-14 16:19:41 <lambdabot> ["The","dog","fox","the","lazy","over","brown","jumps","quick"]
2025-10-14 16:19:44 <ski> @where monoids
2025-10-14 16:19:44 <lambdabot> comment on "Monoids? In my programming language?" by Cale in 2008 (or 2009 ?) at <http://www.reddit.com/r/programming/comments/7cf4r/monoids_in_my_programming_language/c06adnx> about a use of `
2025-10-14 16:19:44 <lambdabot> instance Monoid a => Monoid (rho -> a)'
2025-10-14 16:21:00 <ski> EvanR : because for a lot of algebraic structures (including monoids), if `A' is an algebra, then `A^R' / `R -> A' is also an algebra, for any set `R', with operations defined pointwise/coordinatewise
2025-10-14 16:22:45 raym joins (~ray@user/raym)
2025-10-14 16:22:55 <ski> ah, i see you did the above (list comprehension), with `condList'
2025-10-14 16:23:10 gustrb joins (~gustrb@191.243.134.87)
2025-10-14 16:25:29 × trickard_ quits (~trickard@cpe-54-98-47-163.wireline.com.au) (Read error: Connection reset by peer)
2025-10-14 16:25:42 trickard_ joins (~trickard@cpe-54-98-47-163.wireline.com.au)
2025-10-14 16:25:50 <geekosaur> can I suggest that side comments about advanced topics go to #haskell-in-depth so they don't confuse the original asker?
2025-10-14 16:26:26 <geekosaur> we do have this tendency for simple questions to get diverted into advanced algebra or CT
2025-10-14 16:27:31 <ski> (that's called a "power object", btw, in CT. it's an `R'-fold indexed categorical product, with all factors being `A'. a "copower object" (or "multiple/scaled object" ?) is the dual case, for categorical coproducts (sums))
2025-10-14 16:27:57 <ski> sure
2025-10-14 16:30:37 Googulator3 joins (~Googulato@2a01-036d-0106-03fa-dc7a-fb6e-71bb-aaf0.pool6.digikabel.hu)
2025-10-14 16:30:39 × Googulator26 quits (~Googulato@2a01-036d-0106-03fa-dc7a-fb6e-71bb-aaf0.pool6.digikabel.hu) (Quit: Client closed)
2025-10-14 16:30:40 <Tri> geekosaur, I appreciate that... I was thinking the same thing. It just escalated from very quickly. Ski, not that I meant you are bad, it's just I'm not there yet, I really appreciate your help
2025-10-14 16:32:06 <ski> yeah, the CT comments weren't intended as being things you were suggested to understand, but were asides to EvanR
2025-10-14 16:32:08 <geekosaur> that happens in here a lot, and our rep has taken a bit of a hit because of it
2025-10-14 16:32:26 <geekosaur> so yeh, I'm now trying to divert the side chatter
2025-10-14 16:32:47 × merijn quits (~merijn@77.242.116.146) (Ping timeout: 260 seconds)
2025-10-14 16:33:08 <EvanR> I saw >>> and <>
2025-10-14 16:33:20 <EvanR> I guess Tri was making that up
2025-10-14 16:33:34 <Tri> geekosaur, that's my impression too. I have been here multiple time, and every time, it didn't take more than 3-4 sentences before things took off into some concept way over my head, I just didn't know how to address it properly before
2025-10-14 16:33:34 <ski> i always enjoyed the mix of abstract and concrete, theoretical and practical, conversations on this channel
2025-10-14 16:34:01 <geekosaur> iyeh, but they confuse the hell out of beginners
2025-10-14 16:34:01 <ski> (and i've seen many other people expressing similar things, over the years)
2025-10-14 16:34:03 <Tri> EvanR, yes EvanR, I use >>> just as a placeholder for some operation that can string these functions together
2025-10-14 16:34:12 <EvanR> :t (>>>)
2025-10-14 16:34:13 <lambdabot> forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
2025-10-14 16:34:16 × Zemy quits (~Zemy@syn-067-078-059-246.biz.spectrum.com) (Read error: Connection reset by peer)
2025-10-14 16:34:21 Zemy_ joins (~Zemy@2600:100c:b0a0:3fd9:5cfe:ffff:fe64:fccc)
2025-10-14 16:34:25 <EvanR> you accidentally went categorical!
2025-10-14 16:34:31 × trickard_ quits (~trickard@cpe-54-98-47-163.wireline.com.au) (Ping timeout: 246 seconds)
2025-10-14 16:34:40 <Tri> I was trying to ask if there was any such function that can string many Override -> Override -> Bool together to return a final Bool
2025-10-14 16:34:41 <EvanR> it does infact string functions together
2025-10-14 16:34:45 <ski> it's definitely one of the reasons that made me stick around, when i started chatting here, some twentyfour years ago
2025-10-14 16:34:51 Zemy joins (~Zemy@syn-067-078-059-246.biz.spectrum.com)
2025-10-14 16:36:06 <EvanR> an advanced degree is not required to learn haskell it's just a side effect

All times are in UTC.