Newest at the top
2025-10-14 18:21:00 +0200 | <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 18:19:44 +0200 | <lambdabot> | instance Monoid a => Monoid (rho -> a)' |
2025-10-14 18:19:44 +0200 | <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 18:19:44 +0200 | <ski> | @where monoids |
2025-10-14 18:19:41 +0200 | <lambdabot> | ["The","dog","fox","the","lazy","over","brown","jumps","quick"] |
2025-10-14 18:19:39 +0200 | <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 18:18:38 +0200 | <EvanR> | because a monoid is just a category with one object? |
2025-10-14 18:17:54 +0200 | <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 18:17:50 +0200 | divya | (divya@140.238.251.170) divya |
2025-10-14 18:16:10 +0200 | <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 18:15:38 +0200 | Googulator | (~Googulato@2a01-036d-0106-03fa-dc7a-fb6e-71bb-aaf0.pool6.digikabel.hu) (Quit: Client closed) |
2025-10-14 18:15:38 +0200 | Googulator26 | (~Googulato@2a01-036d-0106-03fa-dc7a-fb6e-71bb-aaf0.pool6.digikabel.hu) |
2025-10-14 18:15:23 +0200 | tomboy64 | (~tomboy64@user/tomboy64) tomboy64 |
2025-10-14 18:14:58 +0200 | <Tri> | thank you for your help, I will get back to read your comments later |
2025-10-14 18:14:37 +0200 | <ski> | using `<>' with `All' seems rather clunky here, unfortunately .. |
2025-10-14 18:14:18 +0200 | <ski> | groupBy (\x y -> and [f x y | f <- [isIssuerOverlapping,isAssetOverlapping,isConditionOverlapping,isDateRangeOverlapping,isTargetColumnOverlapping]]) |
2025-10-14 18:13:40 +0200 | <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 18:12:51 +0200 | tomboy64 | (~tomboy64@user/tomboy64) (Ping timeout: 250 seconds) |
2025-10-14 18:10:47 +0200 | Googulator18 | Googulator |
2025-10-14 18:10:30 +0200 | gustrb | (~gustrb@191.243.134.87) (Ping timeout: 252 seconds) |
2025-10-14 18:09:57 +0200 | <lambdabot> | [a -> b -> c] -> [(a, b)] -> [c] |
2025-10-14 18:09:56 +0200 | <EvanR> | :t zipWith uncurry |
2025-10-14 18:09:42 +0200 | <Tri> | I've got to get back to my job a bit, thank you everyone, I will get back later |
2025-10-14 18:08:58 +0200 | Zemy_ | (~Zemy@2600:100c:b0a0:3fd9:1cfb:70ff:feac:dc0e) (Ping timeout: 246 seconds) |
2025-10-14 18:08:34 +0200 | <lambdabot> | and = foldr (&&) True |
2025-10-14 18:08:34 +0200 | <EvanR> | @src and |
2025-10-14 18:08:25 +0200 | <EvanR> | there's so many ways to skin this one |
2025-10-14 18:07:49 +0200 | <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 18:07:11 +0200 | <ski> | oh, and `isAssetOverlapping' |
2025-10-14 18:06:53 +0200 | <ski> | ditto for `isConditionOverlapping' |
2025-10-14 18:06:24 +0200 | <ski> | Tri : instead of using `case'-`of' in `isDateRangeOverlapping', you can use `all' |
2025-10-14 18:05:54 +0200 | <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 18:05:09 +0200 | Zemy | (~Zemy@syn-067-078-059-246.biz.spectrum.com) |
2025-10-14 18:04:40 +0200 | Zemy | (~Zemy@12.218.191.128) (Read error: Connection reset by peer) |
2025-10-14 18:04:39 +0200 | Zemy_ | (~Zemy@2600:100c:b0a0:3fd9:1cfb:70ff:feac:dc0e) |
2025-10-14 18:03:38 +0200 | mari-estel | (~mari-este@user/mari-estel) mari-estel |
2025-10-14 18:03:20 +0200 | <ski> | Tri : define your own custom display function, rather than using `Show' instance to portray in a custom format |
2025-10-14 18:00:19 +0200 | <Tri> | ok I will look into them. Thank you |
2025-10-14 18:00:14 +0200 | <geekosaur> | and yes, if it's just a list of conditions you don't need either |
2025-10-14 17:59:47 +0200 | <[exa]> | saying "we have a list of conditions" and meaning an actual list counts. :) |
2025-10-14 17:59:43 +0200 | <geekosaur> | Alternative only requires Applicative, not Monad |
2025-10-14 17:59:19 +0200 | <[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 17:59:18 +0200 | <Tri> | let me look into that, I wonder if it works if my data doesn't have a monad structure |
2025-10-14 17:58:10 +0200 | <geekosaur> | Alternative? |
2025-10-14 17:57:32 +0200 | <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 17:56:25 +0200 | divya | (divya@140.238.251.170) (Ping timeout: 265 seconds) |
2025-10-14 17:54:23 +0200 | <[exa]> | Tri: I like to do e.g. this: isOverlapping a b = and [something a == something b, condition2, condition3, ...] |
2025-10-14 17:54:22 +0200 | <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 17:53:02 +0200 | <Tri> | int-e, all good, thank you for checking |
2025-10-14 17:52:39 +0200 | <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 |