Logs on 2022-12-15 (liberachat/#haskell)
| 00:06:41 | <davean> | dimsuz: It can't be a traversal because you're introducing new elements, unless you combine the traversal with a mconcat |
| 00:06:55 | <davean> | which gives you back the folding. |
| 00:07:12 | <davean> | and the traversal generally doesn't give you the index |
| 00:08:09 | <EvanR> | I'd write a recursive function |
| 00:08:47 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 00:13:08 | × | freeside quits (~mengwong@pd907d273.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 00:13:38 | <dsal> | Yeah, that's kind of a corecursion you're describing. |
| 00:14:07 | <dsal> | (at least that's how I'd think of it) |
| 00:20:14 | × | acidjnk quits (~acidjnk@p200300d6e7137a66c0eb5a8137ed3b6d.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 00:21:47 | <jackdk> | dimsuz: I'd probably keep it simple here, and write `concatMapWithIndex :: (Int -> a -> [b]) -> [a] -> [b]`. Or if you want to use existing functions only, zip the list with `[0..]` to get a list of (index,`a`) tuples and then `concatMap` |
| 00:23:02 | <jackdk> | could probably do it with `ifoldr :: FoldableWithIndex i f => (i -> a -> b -> b) -> b -> f a -> b` too (from package `indexed-traversable`) |
| 00:23:10 | <EvanR> | it's supposed to insert [x,y,z] at "original index" 1,3,4 |
| 00:23:21 | <EvanR> | so the subject list keeps getting pushed back 1 |
| 00:23:25 | × | Tuplanolla quits (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.) |
| 00:23:35 | → | elevenkb joins (~elevenkb@105.224.37.128) |
| 00:23:45 | <EvanR> | z ends up at 6 |
| 00:24:48 | <jackdk> | if your indices are updating as you add elements, I would write this with direct recursion |
| 00:25:01 | → | acidjnk joins (~acidjnk@p200300d6e7137a66c0eb5a8137ed3b6d.dip0.t-ipconnect.de) |
| 00:25:06 | × | money_ quits (~money@user/polo) (Quit: late) |
| 00:25:07 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 268 seconds) |
| 00:25:25 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) |
| 00:27:18 | <davean> | yah, its at the orgional indexes which is why fold makes it so easy |
| 00:30:08 | <dimsuz> | thank you all! yeah, indices are not updating as I add elements. The concrete example is I write a gui app to display diffs, each diff is a [LineWidget] and at certain line numbers I need to insert "comments", so it would be [LineWidget, CommentWidget, LineWdiget], and function returns [Widget] |
| 00:30:50 | → | gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
| 00:32:41 | → | money__ joins (~money@user/polo) |
| 00:32:42 | <jackdk> | then I'd probably just `concatMap` or `ifoldr`, possibly building an intermediate `[(Maybe CommentWidget, LineWidget)]` before flattening into `[Widget]` |
| 00:34:41 | <dimsuz> | oh, right, using `Maybe` here also occured in my head: consulting an index on weather to insert a comment here would produce a Maybe + flatten |
| 00:39:44 | × | m1dnight quits (~christoph@78-22-0-121.access.telenet.be) (Ping timeout: 260 seconds) |
| 00:41:25 | → | razetime joins (~quassel@49.207.203.213) |
| 00:41:30 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::6126) |
| 00:41:43 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::6126) (Client Quit) |
| 00:42:21 | × | dimsuz quits (~dimsuz@10-91-52-95.baltnet.ru) (Quit: Client closed) |
| 00:42:25 | × | zeenk quits (~zeenk@2a02:2f04:a30d:4300::7fe) (Quit: Konversation terminated!) |
| 00:43:17 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Quit: ZNC - https://znc.in) |
| 00:44:30 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 00:45:12 | → | freeside joins (~mengwong@pd907d273.dip0.t-ipconnect.de) |
| 00:46:35 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 00:52:16 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 00:54:05 | × | Maeda quits (~Maeda@91-161-10-149.subs.proxad.net) (Ping timeout: 260 seconds) |
| 00:58:40 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 256 seconds) |
| 00:59:37 | × | money__ quits (~money@user/polo) (Ping timeout: 256 seconds) |
| 00:59:53 | × | elevenkb quits (~elevenkb@105.224.37.128) (Quit: Client closed) |
| 01:00:14 | → | elevenkb joins (~elevenkb@105.224.37.128) |
| 01:00:39 | × | elevenkb quits (~elevenkb@105.224.37.128) (Client Quit) |
| 01:02:40 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 01:06:28 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 01:07:09 | × | Igloo quits (~ian@matrix.chaos.earth.li) (Ping timeout: 260 seconds) |
| 01:08:58 | → | Igloo joins (~ian@matrix.chaos.earth.li) |
| 01:10:28 | → | ryanbooker joins (uid4340@id-4340.hampstead.irccloud.com) |
| 01:10:34 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:11:05 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 01:16:41 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:17:56 | × | acidjnk quits (~acidjnk@p200300d6e7137a66c0eb5a8137ed3b6d.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 01:19:35 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 01:19:59 | → | acidjnk joins (~acidjnk@p200300d6e7137a66c0eb5a8137ed3b6d.dip0.t-ipconnect.de) |
| 01:21:32 | × | xff0x_ quits (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 272 seconds) |
| 01:24:10 | → | ddellacosta joins (~ddellacos@143.244.47.88) |
| 01:26:51 | × | ddb quits (~ddb@tilde.club) (Ping timeout: 252 seconds) |
| 01:27:57 | → | ddb joins (~ddb@tilde.club) |
| 01:43:04 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 272 seconds) |
| 01:44:06 | × | acidjnk quits (~acidjnk@p200300d6e7137a66c0eb5a8137ed3b6d.dip0.t-ipconnect.de) (Read error: Connection reset by peer) |
| 01:51:08 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 260 seconds) |
| 01:52:38 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 01:52:38 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 01:52:38 | → | wroathe joins (~wroathe@user/wroathe) |
| 01:55:53 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 01:57:02 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 02:07:30 | → | xff0x_ joins (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
| 02:07:59 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 02:16:00 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 272 seconds) |
| 02:22:28 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 02:25:22 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
| 02:29:55 | × | haskl quits (~haskl@user/haskl) (Quit: Uh oh... ZNC disconnected.) |
| 02:30:10 | → | haskl joins (~haskl@user/haskl) |
| 02:32:02 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 02:40:04 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 272 seconds) |
| 02:41:10 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 02:46:39 | → | TonyStone joins (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) |
| 02:47:02 | × | kilolympus quits (~kilolympu@213.144.144.24) (Ping timeout: 272 seconds) |
| 02:49:14 | × | malte quits (~malte@mal.tc) (Ping timeout: 252 seconds) |
| 02:52:42 | → | bilegeek joins (~bilegeek@2600:1008:b02f:413b:9869:adf4:4498:f6c8) |
| 02:53:04 | → | emanuel joins (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) |
| 02:53:26 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 02:53:29 | <emanuel> | hello. finally had to use monad transformers. yeah took me a while. Noticed React copied the whole thing btw, but poorly. |
| 02:54:08 | × | emanuel quits (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) (Client Quit) |
| 02:54:38 | → | unit73e joins (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) |
| 02:55:44 | × | Erutuon_ quits (~Erutuon@user/erutuon) (Quit: WeeChat 2.8) |
| 02:56:47 | → | money_ joins (~money@user/polo) |
| 02:57:31 | <unit73e> | I was trying to map with "StateT a Get" and at the same time on each step "get and put" but I don't think there's an easy way to do that. I ended up just using "count N" with "get + put + getWord8" and make a ByteString. |
| 02:58:05 | → | instantaphex joins (~jb@c-73-171-252-84.hsd1.fl.comcast.net) |
| 03:02:24 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 03:02:24 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 03:02:24 | → | wroathe joins (~wroathe@user/wroathe) |
| 03:02:29 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving) |
| 03:04:54 | → | money__ joins (~money@user/polo) |
| 03:07:41 | × | money_ quits (~money@user/polo) (Ping timeout: 256 seconds) |
| 03:09:31 | × | johnw quits (~johnw@2600:1700:cf00:db0:10fb:30b:5c13:20f5) (Quit: ZNC - http://znc.in) |
| 03:15:19 | → | money_ joins (~money@user/polo) |
| 03:15:19 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 268 seconds) |
| 03:16:11 | × | money__ quits (~money@user/polo) (Ping timeout: 256 seconds) |
| 03:16:42 | → | kilolympus joins (~kilolympu@213.144.144.24) |
| 03:17:45 | → | Guest23 joins (~Guest23@27.57.46.219) |
| 03:22:10 | → | malte joins (~malte@mal.tc) |
| 03:22:58 | × | money_ quits (~money@user/polo) (Remote host closed the connection) |
| 03:23:46 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 272 seconds) |
| 03:24:34 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 03:25:34 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 03:25:34 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:25:34 | finn_elija | is now known as FinnElija |
| 03:29:08 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 03:29:08 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 03:29:08 | → | wroathe joins (~wroathe@user/wroathe) |
| 03:36:54 | × | td_ quits (~td@83.135.9.16) (Ping timeout: 268 seconds) |
| 03:37:48 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 03:38:28 | → | td_ joins (~td@83.135.9.20) |
| 03:42:05 | <EvanR> | unit73e, whenever you want to use the base monad within a StateT you can use lift |
| 03:42:08 | <EvanR> | :t lift |
| 03:42:09 | <lambdabot> | (MonadTrans t, Monad m) => m a -> t m a |
| 03:45:02 | <unit73e> | EvanR, the idea was to first "readBytes N", then for each byte "get + put + changeByte", but instead I ended up reading each byte with "get + put + readByte" and use "count N" to get what I want |
| 03:45:06 | <unit73e> | probably not very efficient |
| 03:45:08 | <unit73e> | but it does work |
| 03:45:20 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds) |
| 03:45:43 | <unit73e> | hopefully the Get monad is efficient when I do that |
| 03:46:12 | <unit73e> | but yes doing what I want with m and then lift would be the way to go, thanks |
| 03:46:43 | → | bottombear joins (~a@2605:6400:20:d66:5555:5555:5555:5555) |
| 03:47:11 | ← | bottombear parts (~a@2605:6400:20:d66:5555:5555:5555:5555) () |
| 03:47:27 | <unit73e> | I think I could workaround with just a simple bytestring and then lift, but eh... whatever |
| 03:48:38 | × | ddellacosta quits (~ddellacos@143.244.47.88) (Ping timeout: 252 seconds) |
| 03:49:40 | <unit73e> | on another topic, can't monad be explained as just being scope or context of what you're doing, instead of that box nonsense? |
| 03:50:00 | <unit73e> | because that's basically what it is, you're working on the scope of the monad |
| 03:50:22 | <EvanR> | box nonsense does sound like nonsense |
| 03:51:00 | <unit73e> | yeah I see a lot of people trying to explain Maybe as a box and you can only access indirectly |
| 03:51:01 | <EvanR> | dunno if just scope or just context is automatically better though |
| 03:51:22 | <unit73e> | in the end you do have to just read what the functions of Monad to |
| 03:51:27 | <unit73e> | do* |
| 03:51:39 | <EvanR> | well explaining the implementation of Maybe as a box or boxed value actually sounds somewhat sane |
| 03:51:50 | <unit73e> | except only really works for Maybe lol |
| 03:51:55 | <EvanR> | yeah |
| 03:52:04 | <EvanR> | not really monads |
| 03:54:18 | <EvanR> | by doing Functor first a lot of conceptual mixups would be avoided early |
| 03:55:17 | <EvanR> | that's enough of hurdle that no one does it xD. But if they do, then you can do Applicative and clear up even more confusion |
| 03:56:06 | <unit73e> | that's true, Applicative is simpler to understand than do blocks imo, because do looks like magic and Applicative is more explicit |
| 03:56:12 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 03:56:57 | <unit73e> | to me manuals have to much text and should start straight with monads, because even hello world has IO (), but that's just me |
| 03:57:03 | <unit73e> | at least give a general understanding |
| 03:57:08 | × | Guest75 quits (Guest75@2a01:7e01::f03c:92ff:fe5d:7b18) (Ping timeout: 260 seconds) |
| 03:57:15 | <EvanR> | you don't even need to understand monads to use IO or explain it |
| 03:58:05 | <unit73e> | I guess but when you want to do something more complicated it gets tricky. maybe I'll make my own crappy manual one day and everything will say it's another crap manual :p |
| 03:58:15 | <unit73e> | everyone* |
| 03:58:16 | <EvanR> | print "hello world" doesn't even use monad support (or applicative) |
| 03:59:10 | <EvanR> | call it Yet Another Monad Tutorial... no that's been done |
| 03:59:41 | <unit73e> | heh loads of them |
| 04:01:41 | × | Guest23 quits (~Guest23@27.57.46.219) (Ping timeout: 265 seconds) |
| 04:06:36 | × | mncheck quits (~mncheck@193.224.205.254) (Ping timeout: 252 seconds) |
| 04:06:53 | <EvanR> | for IO, you can just say it's an abstract type for I/O actions. do notation translates to >>= whose type is IO a -> (a -> IO b) -> IO b |
| 04:07:01 | × | JordiGH quits (~jordi@user/jordigh) (Ping timeout: 252 seconds) |
| 04:07:12 | <EvanR> | so you can link together the likes of getLine and putStrLn |
| 04:07:35 | <EvanR> | which already exist. This is how most languages work, seems familiar |
| 04:08:20 | <EvanR> | fitting the Monad interface is a happy accident |
| 04:12:20 | → | fizbin joins (~fizbin@user/fizbin) |
| 04:12:32 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 272 seconds) |
| 04:16:39 | → | iqubic joins (~avi@2601:601:1100:edd0:9ce:db2c:6ec0:6fd1) |
| 04:21:16 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 252 seconds) |
| 04:23:09 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 268 seconds) |
| 04:27:30 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 252 seconds) |
| 04:27:50 | × | bilegeek quits (~bilegeek@2600:1008:b02f:413b:9869:adf4:4498:f6c8) (Quit: Leaving) |
| 04:32:45 | → | JordiGH joins (~jordi@user/jordigh) |
| 04:34:03 | → | mbuf joins (~Shakthi@49.204.116.170) |
| 04:36:31 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 04:36:39 | <monochrom> | Except that people love that picture tutorial in which Functor is also box nonsense. |
| 04:40:05 | × | JordiGH quits (~jordi@user/jordigh) (Ping timeout: 252 seconds) |
| 04:40:32 | → | fizbin joins (~fizbin@user/fizbin) |
| 04:40:50 | × | freeside quits (~mengwong@pd907d273.dip0.t-ipconnect.de) (Ping timeout: 265 seconds) |
| 04:43:52 | × | Vajb quits (~Vajb@2001:999:250:c9:8588:6e93:7809:7816) (Read error: Connection reset by peer) |
| 04:44:40 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
| 04:46:42 | → | money_ joins (~money@user/polo) |
| 04:48:21 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 04:48:39 | → | Vajb joins (~Vajb@2001:999:250:c9:8588:6e93:7809:7816) |
| 04:50:56 | × | money_ quits (~money@user/polo) (Client Quit) |
| 04:51:46 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Remote host closed the connection) |
| 04:51:51 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 04:51:56 | <jackdk> | I remember in chemistry class, we were explicitly taught several models of the atom, each less wrong than the last. I don't see what's wrong with doing the same for e.g., Functor, if the learner cannot reach the concept in a single step. |
| 04:52:20 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 04:52:31 | <jackdk> | Allowing people to sit on incomplete or incorrect metaphors, or calling it "Mappable" and stopping people from following the thread further seem like bad things though. |
| 04:53:06 | <Lycurgus> | a problem compounded by the variety of actual senses in use historical and current |
| 04:53:16 | × | Techcable quits (~Techcable@user/Techcable) (Ping timeout: 256 seconds) |
| 04:53:31 | <Lycurgus> | less problematic if confined to hs |
| 04:53:45 | <Lycurgus> | explicitly |
| 04:54:32 | <int-e> | https://en.wikipedia.org/wiki/Lie-to-children |
| 04:54:42 | <Lycurgus> | carnap's e.g. has little relation to hs's |
| 04:55:58 | <int-e> | jackdk: You're not wrong. But since the given name is relevant to Haskell, you shouldn't withhold it. I think it's perfectly fine to say that in an alternative universe the class could be called "Mappable", indicating types that support a "map"-like function. |
| 04:56:11 | → | Guest23 joins (~Guest23@27.57.46.219) |
| 04:56:19 | → | Techcable joins (~Techcable@user/Techcable) |
| 04:56:25 | <int-e> | The same thing goes for calling Monad that and not a warm and fuzzy thing. |
| 04:57:08 | <int-e> | (And I know it was a joke, but "warm and fuzzy thing" is actually worse because it explains nothing about what the concept is about.) |
| 04:57:23 | <int-e> | I guess it could be a re-heated moldy burrito though. |
| 04:57:44 | <jackdk> | I had to read Burritos for the Hungry Mathematician before I understood how they worked. |
| 04:58:08 | <Lycurgus> | my biggest pet peeve on ugly false concepts right now: the supernatural |
| 04:58:31 | <int-e> | Monads are notoriously difficult to explain because there's so little they abstract from, and the abstraction in itself isn't actually useful... each monad comes with associated operations that do the real work. |
| 04:58:44 | <int-e> | The instances are more important than the abstraction. |
| 04:59:27 | <Lycurgus> | the original sin of choosing a fraught philosophical term |
| 04:59:31 | <int-e> | "You could have invented monads" really isn't a lie. |
| 04:59:46 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 252 seconds) |
| 05:01:25 | <Lycurgus> | had the hs ppl responsible been artful dodgers, they woulda let that term be attached from the outside to refer to it |
| 05:01:28 | → | money_ joins (~money@user/polo) |
| 05:03:39 | × | whatsupdoc quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 05:05:46 | <Lycurgus> | shoulda called it a brooks; 'a brooks is called in some other programming langs a "monad"' and is defined by these simple properties, easy peasey |
| 05:08:35 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 05:12:17 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt: personae.ai-integration.biz) |
| 05:14:00 | × | money_ quits (~money@user/polo) (Quit: late) |
| 05:15:54 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 252 seconds) |
| 05:17:07 | → | whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com) |
| 05:20:13 | → | money_ joins (~money@user/polo) |
| 05:22:56 | × | Adran quits (~adran@botters/adran) (Quit: Este é o fim.) |
| 05:23:11 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 05:26:56 | → | Adran joins (~adran@botters/adran) |
| 05:34:01 | × | zmt00 quits (~zmt00@user/zmt00) (Read error: Connection reset by peer) |
| 05:36:11 | × | razetime quits (~quassel@49.207.203.213) (Read error: Connection reset by peer) |
| 05:36:32 | → | razetime joins (~quassel@49.207.203.213) |
| 05:37:10 | × | Guest23 quits (~Guest23@27.57.46.219) (Ping timeout: 252 seconds) |
| 05:37:40 | × | money_ quits (~money@user/polo) (Read error: Connection reset by peer) |
| 05:37:50 | → | money__ joins (~money@user/polo) |
| 05:39:09 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 05:42:21 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 05:43:19 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 268 seconds) |
| 05:45:57 | → | Guest23 joins (~Guest23@27.57.46.219) |
| 05:46:59 | × | money__ quits (~money@user/polo) (Quit: late) |
| 05:50:04 | → | zmt00 joins (~zmt00@user/zmt00) |
| 05:52:34 | × | instantaphex quits (~jb@c-73-171-252-84.hsd1.fl.comcast.net) (Ping timeout: 268 seconds) |
| 05:54:14 | → | money_ joins (~money@user/polo) |
| 05:59:51 | × | unit73e quits (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) (Ping timeout: 260 seconds) |
| 06:00:04 | → | money__ joins (~money@user/polo) |
| 06:02:47 | × | money_ quits (~money@user/polo) (Ping timeout: 256 seconds) |
| 06:04:49 | × | Adran quits (~adran@botters/adran) (Quit: Este é o fim.) |
| 06:08:27 | × | money__ quits (~money@user/polo) (Ping timeout: 256 seconds) |
| 06:09:06 | <Jade[m]> | ```hs |
| 06:09:06 | <Jade[m]> | foo g apply = uncurry apply . swap . fmap g |
| 06:09:06 | <Jade[m]> | ``` |
| 06:09:06 | <Jade[m]> | how can you make this pointfree? |
| 06:09:31 | → | Adran joins (~adran@botters/adran) |
| 06:09:54 | → | bgs joins (~bgs@212-85-160-171.dynamic.telemach.net) |
| 06:10:13 | × | ryanbooker quits (uid4340@id-4340.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 06:10:20 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 272 seconds) |
| 06:11:01 | <Jade[m]> | * ```hs |
| 06:11:01 | <Jade[m]> | foo g apply = uncurry apply . fmap g . swap |
| 06:11:01 | <Jade[m]> | ``` |
| 06:11:01 | <Jade[m]> | how can you make this pointfree? |
| 06:12:13 | → | amano joins (~amano@45.8.223.209) |
| 06:12:42 | <int-e> | @pl foo g apply = uncurry apply . fmap g . swap |
| 06:12:42 | <lambdabot> | foo = flip ((.) . uncurry) . (. swap) . fmap |
| 06:13:45 | <amano> | Has anyone used beam or any other SQL library? |
| 06:16:45 | → | kenran joins (~user@user/kenran) |
| 06:17:16 | <Jade[m]> | lambdabot: beautiful |
| 06:17:21 | <Jade[m]> | (no) |
| 06:17:50 | × | kenran quits (~user@user/kenran) (Remote host closed the connection) |
| 06:20:36 | <int-e> | Secretly the point of @pl is to convince people that point-free code isn't worth it :P |
| 06:24:06 | <Jade[m]> | haha |
| 06:24:17 | <Jade[m]> | I use it to find idioms more or less |
| 06:24:37 | <Jade[m]> | but as soon as something like . (. f) pops up im out of there |
| 06:29:59 | <jackdk> | @botsnack |
| 06:29:59 | <lambdabot> | :) |
| 06:30:55 | <int-e> | Jade[m]: yeah, you can recognize most point-free code by its abundance of dots |
| 06:31:26 | ← | amano parts (~amano@45.8.223.209) () |
| 06:35:02 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 272 seconds) |
| 06:37:06 | → | trev joins (~trev@user/trev) |
| 06:38:19 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 06:38:53 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 06:39:13 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 06:41:26 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 06:43:32 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 246 seconds) |
| 06:50:42 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 06:51:44 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 06:54:34 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 06:54:50 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 06:54:55 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 06:57:25 | <EvanR> | but wait, you can compress a bunch of dots into .: or .:: sometimes |
| 06:57:40 | <EvanR> | @pl is holding out on us |
| 06:57:52 | → | money_ joins (~money@user/polo) |
| 06:58:07 | → | michalz joins (~michalz@185.246.204.93) |
| 07:06:12 | → | thyriaen joins (~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) |
| 07:08:15 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 07:08:47 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 07:10:31 | → | bgs joins (~bgs@212-85-160-171.dynamic.telemach.net) |
| 07:11:49 | → | johnw joins (~johnw@2600:1700:cf00:db0:b0f5:26ad:fa0:865f) |
| 07:18:33 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 07:20:51 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 07:21:11 | × | money_ quits (~money@user/polo) (Quit: late) |
| 07:29:46 | × | thegeekinside quits (~thegeekin@189.217.82.244) (Read error: Connection reset by peer) |
| 07:31:34 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 252 seconds) |
| 07:40:56 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 07:51:35 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 07:55:28 | → | tabaqui joins (~root@88.231.62.215) |
| 07:55:37 | × | kilolympus quits (~kilolympu@213.144.144.24) (Read error: Connection reset by peer) |
| 07:56:54 | × | hsw quits (~hsw@112-104-142-182.adsl.dynamic.seed.net.tw) (Quit: Leaving) |
| 07:57:07 | → | hsw joins (~hsw@2001-b030-2303-0104-0172-0025-0012-0123.hinet-ip6.hinet.net) |
| 07:57:14 | × | dtman34 quits (~dtman34@76.156.89.180) (Ping timeout: 260 seconds) |
| 07:59:21 | → | kilolympus joins (~kilolympu@213.144.144.24) |
| 07:59:41 | → | dtman34 joins (~dtman34@2601:447:d000:93c9:f2ce:ff11:8e35:42b2) |
| 08:00:03 | × | dsrt^ quits (~dsrt@76.145.185.103) (Remote host closed the connection) |
| 08:03:20 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 08:04:10 | <dminuoso> | mniip: Perhaps unpopular, but if you have optics or lens, you can use `preview traverse` |
| 08:04:33 | <dminuoso> | Ah hold on, strike that thought. |
| 08:11:18 | × | Guest23 quits (~Guest23@27.57.46.219) (Ping timeout: 272 seconds) |
| 08:11:57 | → | use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:39df:b639:fbf4:175b) |
| 08:12:21 | → | chexum_ joins (~quassel@gateway/tor-sasl/chexum) |
| 08:12:47 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 08:13:00 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 08:13:38 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
| 08:15:04 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 08:16:03 | → | freeside joins (~mengwong@nat-veranstaltungen.uni-saarland.de) |
| 08:19:44 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:5ea7:443c:a1ac:4e5c) |
| 08:22:28 | → | money_ joins (~money@user/polo) |
| 08:22:33 | money | is now known as Guest9248 |
| 08:22:33 | money_ | is now known as money |
| 08:29:29 | × | money quits (~money@user/polo) (Quit: late) |
| 08:30:25 | → | money joins (~money@user/polo) |
| 08:32:13 | → | gmg joins (~user@user/gehmehgeh) |
| 08:33:43 | → | mncheck joins (~mncheck@193.224.205.254) |
| 08:42:36 | → | m1dnight joins (~christoph@78-22-0-121.access.telenet.be) |
| 08:46:01 | → | zeenk joins (~zeenk@2a02:2f04:a30d:4300::7fe) |
| 08:50:46 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 08:50:48 | → | Maeda joins (~Maeda@91-161-10-149.subs.proxad.net) |
| 08:51:20 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 08:51:21 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 08:52:01 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 08:54:29 | × | money quits (~money@user/polo) (Ping timeout: 256 seconds) |
| 08:54:42 | → | avicenzi joins (~avicenzi@2a00:ca8:a1f:b004::c32) |
| 08:58:06 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 08:59:54 | → | fserucas joins (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) |
| 09:00:03 | × | sektor[m] quits (~sektor@2001:470:69fc:105::2:3f60) (Quit: You have been kicked for being idle) |
| 09:00:08 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 09:05:16 | × | tomokojun quits (~tomokojun@75.164.24.44) (Quit: じゃあね〜。) |
| 09:08:25 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 09:13:29 | → | merijn joins (~merijn@195.114.232.74) |
| 09:17:19 | × | mbuf quits (~Shakthi@49.204.116.170) (Read error: Connection reset by peer) |
| 09:17:29 | → | mbuf joins (~Shakthi@49.204.116.170) |
| 09:17:50 | → | vpan joins (~0@212.117.1.172) |
| 09:19:17 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 09:19:41 | → | chele joins (~chele@user/chele) |
| 09:22:08 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) (Remote host closed the connection) |
| 09:27:05 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 09:27:18 | → | zer0bitz joins (~zer0bitz@196.244.192.57) |
| 09:27:48 | × | Xeroine quits (~Xeroine@user/xeroine) (Ping timeout: 252 seconds) |
| 09:30:32 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 09:30:45 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 09:31:34 | → | Xeroine joins (~Xeroine@user/xeroine) |
| 09:31:56 | Guest9248 | is now known as money |
| 09:33:23 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 09:36:17 | × | perrierjouet quits (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 3.7.1) |
| 09:37:56 | → | perrierjouet joins (~perrier-j@modemcable048.127-56-74.mc.videotron.ca) |
| 09:41:09 | <probie> | Do people have strong opinions about the generic-sop style of generics? |
| 09:47:16 | × | ft quits (~ft@p4fc2a257.dip0.t-ipconnect.de) (Quit: leaving) |
| 09:48:15 | × | ph88 quits (~ph88@2a02:8109:9e00:71d0:1467:6d51:6255:a37) (Quit: Leaving) |
| 09:49:37 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 09:50:28 | <dminuoso> | I do. |
| 09:50:41 | × | kilolympus quits (~kilolympu@213.144.144.24) (Read error: Connection reset by peer) |
| 09:50:48 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 09:51:30 | <dminuoso> | Generic code drives up compilation times and can produce very inefficient code. And the way of writing it is very uncomfortable and harsh to debug. |
| 09:51:40 | <dminuoso> | So by subsumption, I dislike generic-sop |
| 09:52:08 | <dminuoso> | Lens, aeson, mechanically derived pretty printing, TH is just far more potent for it. |
| 09:52:30 | <dminuoso> | And ontop, having a Generic instance essentially exposes the entire internals of your data type as public API |
| 09:52:38 | <dminuoso> | You cannot hide it |
| 09:54:20 | → | kilolympus joins (~kilolympu@213.144.144.24) |
| 09:57:22 | × | freeside quits (~mengwong@nat-veranstaltungen.uni-saarland.de) (Ping timeout: 252 seconds) |
| 09:57:34 | → | feliix42_ joins (~felix@gibbs.uberspace.de) |
| 09:57:45 | → | Ram-Z_ joins (Ram-Z@2a01:7e01::f03c:91ff:fe57:d2df) |
| 09:57:59 | × | feliix42 quits (~felix@gibbs.uberspace.de) (Ping timeout: 255 seconds) |
| 09:58:27 | × | Ram-Z quits (Ram-Z@2a01:7e01::f03c:91ff:fe57:d2df) (Ping timeout: 255 seconds) |
| 09:58:36 | <lortabac> | I think the idea of structural polymorphism is better than metaprogramming for many tasks |
| 09:59:25 | <lortabac> | however the way it is implemented in GHC leads to the problems you mentioned |
| 10:00:11 | <lortabac> | IMHO it's a feature that should be built into the language, instead of relying on other mechanisms such as type classes |
| 10:02:35 | <dminuoso> | You mean like lisp? |
| 10:02:51 | × | L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 248 seconds) |
| 10:04:08 | → | `2jt joins (~jtomas@84.red-88-17-186.dynamicip.rima-tde.net) |
| 10:04:33 | <lortabac> | AFAIK Common Lisp has full metaprogramming power, it's more like TH, isn't it? |
| 10:04:52 | <probie> | It's more than TH since you can define reader macros |
| 10:05:08 | <dminuoso> | It's also less than TH because there's no clear boundary. You can quote and unquote anywhere |
| 10:05:24 | <dminuoso> | GHC TH is this strange at-parse-time only thing with stage restrictions |
| 10:06:00 | <dminuoso> | In Lisp it really feels like part of the language. TH is clearly a compiler feature |
| 10:06:06 | <lortabac> | I was thinking of something similar to GHC's Generic but built-in |
| 10:06:20 | → | freeside joins (~mengwong@nat-veranstaltungen.uni-saarland.de) |
| 10:06:27 | <dminuoso> | Well Im just saying, in case of lisp it *is* builtin because all structure there is is lists. |
| 10:06:40 | <dminuoso> | TH focuses on some the AST representation rather |
| 10:07:12 | × | xff0x_ quits (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 272 seconds) |
| 10:07:31 | <dminuoso> | How would that differ from TH though, lortabac? |
| 10:08:45 | <lortabac> | it has nothing to do with TH, it's more like dependently-typed functions that can pattern-match on terms of type Type |
| 10:09:19 | <dminuoso> | Mmm |
| 10:09:37 | <lortabac> | and have some special syntax to access the metadata (field names etc.) |
| 10:10:26 | <probie> | The problem with TH is that it doesn't work in all environments |
| 10:12:16 | × | mbuf quits (~Shakthi@49.204.116.170) (Ping timeout: 272 seconds) |
| 10:12:21 | → | alphabeta joins (~kilolympu@213.144.144.24) |
| 10:12:41 | × | kilolympus quits (~kilolympu@213.144.144.24) (Ping timeout: 256 seconds) |
| 10:13:16 | → | MajorBiscuit joins (~MajorBisc@145.94.137.174) |
| 10:13:23 | × | ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
| 10:13:40 | → | mbuf joins (~Shakthi@49.204.116.170) |
| 10:14:15 | <albet70> | there is a corner case in case … of, I hope there is a more elegant way https://paste.tomsmeding.com/D1Pedbmi |
| 10:14:43 | × | alphabeta quits (~kilolympu@213.144.144.24) (Read error: Connection reset by peer) |
| 10:15:16 | <albet70> | if there is an action is called in every case but the last, how to make it more simple? |
| 10:15:23 | × | paulpaul1076 quits (~textual@95-29-5-111.broadband.corbina.ru) (Quit: Textual IRC Client: www.textualapp.com) |
| 10:15:33 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 10:18:18 | → | alphabeta joins (~kilolympu@213.144.144.24) |
| 10:20:02 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 10:20:58 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds) |
| 10:22:37 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) |
| 10:22:48 | Lord_of_Life_ | is now known as Lord_of_Life |
| 10:25:32 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 10:26:50 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) (Ping timeout: 252 seconds) |
| 10:29:02 | × | freeside quits (~mengwong@nat-veranstaltungen.uni-saarland.de) (Ping timeout: 252 seconds) |
| 10:29:48 | × | alphabeta quits (~kilolympu@213.144.144.24) (Ping timeout: 265 seconds) |
| 10:32:16 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 10:33:20 | → | kilolympus joins (~kilolympu@213.144.144.24) |
| 10:34:50 | × | kilolympus quits (~kilolympu@213.144.144.24) (Read error: Connection reset by peer) |
| 10:38:20 | → | kilolympus joins (~kilolympu@213.144.144.24) |
| 10:38:36 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 10:41:29 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 10:42:17 | → | freeside joins (~mengwong@eduroam-134-96-204-30.uni-saarland.de) |
| 10:42:59 | → | fizbin joins (~fizbin@user/fizbin) |
| 10:51:26 | → | dextaa8 joins (~DV@user/dextaa) |
| 10:51:28 | → | CiaoSen joins (~Jura@p200300c95730b6002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 10:53:06 | × | dextaa quits (~DV@user/dextaa) (Ping timeout: 256 seconds) |
| 10:53:06 | dextaa8 | is now known as dextaa |
| 11:00:03 | <mauke> | :t join (maybe . join) |
| 11:00:04 | <lambdabot> | (a1 -> a1 -> a2) -> Maybe a1 -> a1 -> a2 |
| 11:00:46 | × | MajorBiscuit quits (~MajorBisc@145.94.137.174) (Quit: WeeChat 3.6) |
| 11:00:57 | → | MajorBiscuit joins (~MajorBisc@145.94.137.174) |
| 11:02:45 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 11:04:07 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 11:04:48 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 11:09:59 | × | freeside quits (~mengwong@eduroam-134-96-204-30.uni-saarland.de) (Ping timeout: 255 seconds) |
| 11:11:41 | → | xff0x_ joins (~xff0x@ai071162.d.east.v6connect.net) |
| 11:12:30 | × | use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:39df:b639:fbf4:175b) (Remote host closed the connection) |
| 11:12:39 | → | crazazy joins (~user@2001:67c:2564:a307:4423:5622:90d3:16c3) |
| 11:12:49 | → | use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:39df:b639:fbf4:175b) |
| 11:13:07 | <dminuoso> | albet70: Not that I know of. |
| 11:13:58 | × | kilolympus quits (~kilolympu@213.144.144.24) (Read error: Connection reset by peer) |
| 11:17:26 | <[exa]> | albet70: depending on the types around you might put the >>z out of the case and make `doSomethingElse` prevent the >> from acting (such as with Left) |
| 11:17:41 | <[exa]> | but that's kludgey already |
| 11:18:30 | → | freeside joins (~mengwong@eduroam-134-96-204-30.uni-saarland.de) |
| 11:18:35 | <dminuoso> | To some degree this reminds me of `switch` in flatparse |
| 11:18:44 | <dminuoso> | Which lets you write: |
| 11:19:41 | <dminuoso> | $(switch [| case _ of "foo" -> pure True; "bar" -> pure False |]) |
| 11:19:51 | <dminuoso> | Which implicitly generates a default case |
| 11:20:21 | <dminuoso> | (You can also write it yourself, but if not a sensible `_ -> empty` branch will be generated) |
| 11:46:11 | × | `2jt quits (~jtomas@84.red-88-17-186.dynamicip.rima-tde.net) (Ping timeout: 256 seconds) |
| 11:50:26 | × | freeside quits (~mengwong@eduroam-134-96-204-30.uni-saarland.de) (Ping timeout: 252 seconds) |
| 11:55:26 | → | `2jt joins (~jtomas@84.red-88-17-186.dynamicip.rima-tde.net) |
| 11:58:24 | → | JordiGH joins (~jordi@user/jordigh) |
| 12:00:14 | × | use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:39df:b639:fbf4:175b) (Ping timeout: 246 seconds) |
| 12:01:47 | → | use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:39df:b639:fbf4:175b) |
| 12:09:04 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 12:09:31 | × | `2jt quits (~jtomas@84.red-88-17-186.dynamicip.rima-tde.net) (Quit: Leaving) |
| 12:13:37 | → | freeside joins (~mengwong@nat-veranstaltungen.uni-saarland.de) |
| 12:17:51 | × | CiaoSen quits (~Jura@p200300c95730b6002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 12:19:05 | → | shriekingnoise joins (~shrieking@186.137.167.202) |
| 12:21:49 | × | ellensol quits (~ln@pc-ellar188.it.uu.se) (Quit: leaving) |
| 12:23:22 | × | freeside quits (~mengwong@nat-veranstaltungen.uni-saarland.de) (Ping timeout: 272 seconds) |
| 12:23:57 | × | jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 12:24:54 | → | jpds2 joins (~jpds@gateway/tor-sasl/jpds) |
| 12:29:09 | × | Kaiepi quits (~Kaiepi@108.175.84.104) (Quit: Leaving) |
| 12:30:39 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 12:35:32 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 12:40:05 | → | mmhat joins (~mmh@p200300f1c71eb3c8ee086bfffe095315.dip0.t-ipconnect.de) |
| 12:42:30 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 252 seconds) |
| 12:44:50 | × | mmhat quits (~mmh@p200300f1c71eb3c8ee086bfffe095315.dip0.t-ipconnect.de) (Client Quit) |
| 12:46:27 | → | Guest23 joins (~Guest23@27.57.46.219) |
| 12:56:17 | → | Kaiepi joins (~Kaiepi@108.175.84.104) |
| 13:08:26 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 13:09:47 | × | Digit quits (~user@user/digit) (Ping timeout: 268 seconds) |
| 13:10:43 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 13:12:52 | → | bgs joins (~bgs@212-85-160-171.dynamic.telemach.net) |
| 13:16:14 | × | Guest23 quits (~Guest23@27.57.46.219) (Ping timeout: 252 seconds) |
| 13:17:23 | → | unit73e joins (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) |
| 13:21:42 | → | freeside joins (~mengwong@nat-veranstaltungen.uni-saarland.de) |
| 13:22:14 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 13:23:32 | → | haritz joins (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) |
| 13:23:33 | × | haritz quits (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host) |
| 13:23:33 | → | haritz joins (~hrtz@user/haritz) |
| 13:28:09 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 13:29:52 | × | freeside quits (~mengwong@nat-veranstaltungen.uni-saarland.de) (Ping timeout: 272 seconds) |
| 13:36:10 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
| 13:37:47 | → | Hercules1 joins (~Hercules@ti0018a400-7782.bb.online.no) |
| 13:38:46 | × | Hercules1 quits (~Hercules@ti0018a400-7782.bb.online.no) (Quit: Leaving) |
| 13:45:42 | → | freeside joins (~mengwong@nat-veranstaltungen.uni-saarland.de) |
| 13:50:29 | × | freeside quits (~mengwong@nat-veranstaltungen.uni-saarland.de) (Ping timeout: 268 seconds) |
| 13:55:42 | × | jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 13:57:39 | → | jpds2 joins (~jpds@gateway/tor-sasl/jpds) |
| 13:58:41 | × | byorgey quits (~byorgey@155.138.238.211) (Quit: leaving) |
| 13:59:45 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 13:59:52 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 14:00:39 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 14:01:29 | → | ystael joins (~ystael@user/ystael) |
| 14:03:24 | → | freeside joins (~mengwong@nat-veranstaltungen.uni-saarland.de) |
| 14:08:12 | → | thegeekinside joins (~thegeekin@189.217.82.244) |
| 14:08:47 | × | x22x22x quits (~x88x88x@2001:19f0:5:39a8:5400:3ff:feb6:73cb) (Ping timeout: 252 seconds) |
| 14:09:46 | × | freeside quits (~mengwong@nat-veranstaltungen.uni-saarland.de) (Ping timeout: 252 seconds) |
| 14:12:16 | → | Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
| 14:12:42 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 252 seconds) |
| 14:14:52 | → | eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
| 14:17:05 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 14:24:04 | → | freeside joins (~mengwong@nat-veranstaltungen.uni-saarland.de) |
| 14:30:18 | × | son0p quits (~ff@2604:3d08:5b7f:5540::4026) (Ping timeout: 252 seconds) |
| 14:31:33 | × | eggplantade quits (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 14:37:00 | × | razetime quits (~quassel@49.207.203.213) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 14:37:42 | → | Digit joins (~user@user/digit) |
| 14:45:10 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 14:45:10 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 14:45:10 | → | wroathe joins (~wroathe@user/wroathe) |
| 14:46:38 | × | Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
| 14:47:58 | → | Xeroine joins (~Xeroine@user/xeroine) |
| 14:52:31 | → | CiaoSen joins (~Jura@p200300c95730b6002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 14:52:53 | → | chele_ joins (~chele@user/chele) |
| 14:55:43 | × | chele quits (~chele@user/chele) (Ping timeout: 260 seconds) |
| 14:55:46 | → | festive_kurbus joins (~festive_k@user/kurbus) |
| 14:56:04 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds) |
| 14:56:23 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 14:57:11 | × | crazazy quits (~user@2001:67c:2564:a307:4423:5622:90d3:16c3) (Ping timeout: 252 seconds) |
| 15:00:08 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) |
| 15:05:25 | → | FragByte_ joins (~christian@user/fragbyte) |
| 15:06:29 | × | polux quits (~polux@51-15-169-172.rev.poneytelecom.eu) (Quit: The Lounge - https://thelounge.github.io) |
| 15:07:01 | × | FragByte quits (~christian@user/fragbyte) (Ping timeout: 252 seconds) |
| 15:07:01 | FragByte_ | is now known as FragByte |
| 15:08:16 | → | polux joins (~polux@51-15-169-172.rev.poneytelecom.eu) |
| 15:09:41 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 15:10:23 | × | festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed) |
| 15:11:33 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) (Remote host closed the connection) |
| 15:12:00 | × | polux quits (~polux@51-15-169-172.rev.poneytelecom.eu) (Client Quit) |
| 15:12:22 | → | polux joins (~polux@51-15-169-172.rev.poneytelecom.eu) |
| 15:15:00 | × | MajorBiscuit quits (~MajorBisc@145.94.137.174) (Ping timeout: 272 seconds) |
| 15:17:58 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:5ea7:443c:a1ac:4e5c) (Quit: WeeChat 2.8) |
| 15:24:21 | → | n0den1te joins (~n0den1te@223.178.87.40) |
| 15:29:14 | → | festive_kurbus joins (~festive_k@user/kurbus) |
| 15:30:36 | → | bontaq joins (~user@ool-45779fe5.dyn.optonline.net) |
| 15:32:05 | ← | n0den1te parts (~n0den1te@223.178.87.40) () |
| 15:35:44 | → | byorgey joins (~byorgey@155.138.238.211) |
| 15:38:06 | × | festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed) |
| 15:39:14 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 15:41:42 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) |
| 15:47:13 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 15:47:44 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 15:50:28 | × | merijn quits (~merijn@195.114.232.74) (Quit: Reconnecting) |
| 15:50:41 | → | merijn joins (~merijn@195.114.232.74) |
| 15:50:45 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 15:54:00 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 16:00:05 | × | zarel[m] quits (~zarelitma@2001:470:69fc:105::1:fcfb) (Quit: You have been kicked for being idle) |
| 16:05:02 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 16:07:49 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) (Remote host closed the connection) |
| 16:10:58 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 16:14:41 | × | Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
| 16:15:00 | → | Xeroine joins (~Xeroine@user/xeroine) |
| 16:19:00 | → | paulpaul1076 joins (~textual@95-29-5-111.broadband.corbina.ru) |
| 16:21:26 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Write error: Connection reset by peer) |
| 16:21:26 | × | chexum_ quits (~quassel@gateway/tor-sasl/chexum) (Read error: Connection reset by peer) |
| 16:21:26 | × | jpds2 quits (~jpds@gateway/tor-sasl/jpds) (Read error: Connection reset by peer) |
| 16:21:46 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 16:22:03 | → | jpds2 joins (~jpds@gateway/tor-sasl/jpds) |
| 16:22:51 | → | festive_kurbus joins (~festive_k@user/kurbus) |
| 16:23:41 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 16:31:54 | × | Digit quits (~user@user/digit) (Remote host closed the connection) |
| 16:34:03 | → | Digit joins (~user@user/digit) |
| 16:34:48 | × | merijn quits (~merijn@195.114.232.74) (Ping timeout: 272 seconds) |
| 16:40:06 | × | Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
| 16:40:55 | → | Xeroine joins (~Xeroine@user/xeroine) |
| 16:41:31 | → | son0p joins (~ff@2604:3d08:5b7f:5540::d832) |
| 16:42:08 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 16:49:27 | × | ec quits (~ec@gateway/tor-sasl/ec) (Write error: Connection reset by peer) |
| 16:50:29 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 16:56:26 | <mira> | hmm, unsafeCoerce can coerce between data Foo a b = Foo a b and a tuple (a,b) -- is there a way I could convince coerce to do that too? |
| 16:57:32 | <dminuoso> | Not with an incompatible representation. |
| 16:57:48 | <dminuoso> | You can use `newtype Foo a b = Foo (a, b)`, then you get to coerce |
| 16:58:17 | <mira> | yeah, that's what I'm doing rn, with a pattern synonym to get to write pattern matches on Foo in a nicer way, but that's a bit of a hassle |
| 16:58:28 | <geekosaur> | aren't they the same rep, though? but `coerce` only works through newtypes, it cares not about actual representations |
| 16:59:17 | <mira> | yeah, my understanding is that the representation is the same, coerce just doesn't know that because Coercible instances are only generated for newtypes |
| 16:59:28 | <geekosaur> | (`(a,b)` is `(,) a b` internally, with a single constructor `Foo` is exactly the same rep) |
| 17:00:22 | <dminuoso> | geekosaur: I guess in this particular case it might hold |
| 17:01:05 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 17:01:09 | <dminuoso> | But this doesnt work in general, consider something like `data Foo = Foo {-# UNPACK #-} Word8 {-# UNPACK #-} Word8`, wouldnt the representation especially in 9.4 depend on optimizations? |
| 17:01:30 | <geekosaur> | yes, in that case |
| 17:01:32 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 17:02:31 | <geekosaur> | although using a hypothetical Coercible instance might suppress the optimization, I don't know |
| 17:03:13 | <dminuoso> | Given that the coerce could happen across modules or even packages, that would invalidate the optimization entirely |
| 17:03:22 | <dminuoso> | Or demand that it unconditionally be used |
| 17:04:25 | <geekosaur> | true |
| 17:04:30 | → | Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
| 17:04:48 | <geekosaur> | I was wondering about the opposite, ghc unpacking a tuple as an optimization |
| 17:05:03 | <geekosaur> | but as you said, it'd have to know about other uses |
| 17:05:33 | <geekosaur> | suppose it could only do that if it knew it couldnt escape the module |
| 17:07:10 | × | festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed) |
| 17:08:19 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) |
| 17:09:04 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 252 seconds) |
| 17:10:28 | <monochrom> | Inlining can help customizing for use sites. |
| 17:11:06 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 17:11:36 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::6126) |
| 17:11:39 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::6126) (Client Quit) |
| 17:12:21 | × | thegeekinside quits (~thegeekin@189.217.82.244) (Read error: Connection reset by peer) |
| 17:12:32 | → | thegeekinside joins (~thegeekin@189.217.82.244) |
| 17:12:41 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:f49d:401d:a888:f078) (Ping timeout: 255 seconds) |
| 17:12:46 | <dminuoso> | That said, even the original paper explicitly defines representational equality to deal with newtypes, and subtly implies that runtime equality is only guaranteed by newtypes |
| 17:13:40 | <dminuoso> | I suppose role inference would become incredibly messy, if something *more* than from haskell itself would enter this equation |
| 17:15:18 | × | freeside quits (~mengwong@nat-veranstaltungen.uni-saarland.de) (Ping timeout: 252 seconds) |
| 17:15:29 | <dminuoso> | you would have to display role inference to be sound and optimal in the presence of some adhoc introduction of GHC information |
| 17:15:48 | <dminuoso> | and that it always terminates |
| 17:15:59 | <dminuoso> | (which is the three theorems the original coercible paper proves) |
| 17:19:48 | × | chele_ quits (~chele@user/chele) (Remote host closed the connection) |
| 17:27:02 | → | festive_kurbus joins (~festive_k@user/kurbus) |
| 17:30:44 | × | mtmm quits (~mtmm@89-166-7-216.bb.dnainternet.fi) (Quit: leaving) |
| 17:31:48 | <dminuoso> | geekosaur: The original paper https://www.microsoft.com/en-us/research/uploads/prod/2018/05/coercible-JFP.pdf actually touches it in 8.5 see maybe2option |
| 17:31:58 | <dminuoso> | So it is at least briefly discussed |
| 17:32:42 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 17:32:59 | <dminuoso> | But certainly some problems come to mind, like given `data MaybeS a = None | Zero | One a` and `data Another a = A | B | C a` |
| 17:33:08 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 17:33:19 | <dminuoso> | Would they be coercible too? There's certainly something that *can* be done at runtime |
| 17:33:51 | <dminuoso> | And other things like reordering the constructors could drastically alter the meaning, especailly in a world where you have an expectancy of role `representational` |
| 17:34:03 | → | acidjnk joins (~acidjnk@p200300d6e7137a00f9d7394677563a85.dip0.t-ipconnect.de) |
| 17:34:21 | <dminuoso> | And regarding the previous sentence, Im not sure this is a sensible coercion to do. |
| 17:35:20 | <dminuoso> | THough to some degree newtype coercion presents that same problem alreayd, say if you had (Int, Int) to (IntWrapped, AnotherIntWrapped) or (AnotherIntWrapped, IntWrapped) |
| 17:35:27 | <dminuoso> | Either can happen with no restriction |
| 17:35:31 | → | econo joins (uid147250@user/econo) |
| 17:36:23 | × | festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed) |
| 17:36:37 | → | festive_kurbus joins (~festive_k@user/kurbus) |
| 17:37:24 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 17:39:35 | × | fserucas quits (~fserucas@2001:818:e376:a400:fb92:70c1:dd88:c7d7) (Quit: Leaving) |
| 17:40:25 | × | thegeekinside quits (~thegeekin@189.217.82.244) (Read error: Connection reset by peer) |
| 17:41:01 | → | thegeekinside joins (~thegeekin@189.217.82.244) |
| 17:43:57 | × | festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed) |
| 17:47:08 | → | festive_kurbus joins (~festive_k@user/kurbus) |
| 17:48:50 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 17:51:22 | → | coot joins (~coot@213.134.171.3) |
| 17:54:17 | × | mbuf quits (~Shakthi@49.204.116.170) (Quit: Leaving) |
| 17:55:51 | → | jwalker joins (~jwalker@89.23.145.133) |
| 17:56:33 | × | jwalker quits (~jwalker@89.23.145.133) (Remote host closed the connection) |
| 17:57:25 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 17:58:04 | → | Topsi joins (~Topsi@dyndsl-095-033-225-198.ewe-ip-backbone.de) |
| 17:59:11 | <monochrom> | MaybeS and Another are identical in practice. But we also like to not encourage abuse, even if compilers won't make them different out of the blue. |
| 17:59:46 | <monochrom> | The newtype condition is pretty robust though because the Haskell Report has a guarantee already. |
| 18:00:05 | ← | L29Ah parts (~L29Ah@wikipedia/L29Ah) () |
| 18:00:56 | <monochrom> | More deeply what the Haskell Report says is a formal way to state a social expectation and intent that also supports Coercible. |
| 18:01:52 | <monochrom> | So, coercing between MaybeS and Another is socially unacceptable, but coercing between newtype equivalents is socially acceptable. |
| 18:02:13 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 18:02:30 | <monochrom> | Sorry but lately I like to play the "it's a social construct" card! >:) Must have been bad influence from the philosophies behind intuitionistic logic... |
| 18:02:40 | × | coot quits (~coot@213.134.171.3) (Quit: coot) |
| 18:03:39 | <monochrom> | Now I go back to debating with myself how much to decouple type inference from unification... |
| 18:05:17 | × | unit73e quits (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) (Ping timeout: 256 seconds) |
| 18:06:05 | <monochrom> | Here is one aspect of it. The unification algorithm lives in a monad that has state (table of substitutions, counter for the next fresh variable) and error (occurs check, mismatch, but not var-not-found, unification itself doesn't have var-not-found). |
| 18:06:26 | × | vpan quits (~0@212.117.1.172) (Quit: Leaving.) |
| 18:06:50 | <monochrom> | The type inference algorithm has to live in that plus reader (environment for vars' types) and one more error (var-not-found). |
| 18:08:30 | <monochrom> | I am thinking whether I should just use one single common big monad for both, or define the latter to be an additional layer over the former. |
| 18:08:31 | → | bitmapper joins (uid464869@id-464869.lymington.irccloud.com) |
| 18:08:49 | <AndreasK> | I wonder why maximumBy doesn't take a function returning an `a` instead of Ord. Would allow for a more efficient implementation. |
| 18:09:11 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 18:10:26 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 272 seconds) |
| 18:10:56 | <Rembane> | AndreasK: You can use some nice Monoid/Semigroup newtype instead. |
| 18:11:22 | <monochrom> | It can be argued both ways. |
| 18:11:55 | <monochrom> | Half of the time a comparator is more efficient, the other half a binary max is more efficient. |
| 18:12:07 | <Rembane> | Both versions are needed imo |
| 18:12:10 | <AndreasK> | Rembane: I'm not sure I follow how a newtype would help there. Maybe you are thinking of maximum? |
| 18:12:44 | <monochrom> | If I were to decide, I side with the comparator version. "a -> a -> Ordering" is more self-documenting than "a -> a -> a". |
| 18:13:11 | <Rembane> | AndreasK: This one! https://hackage.haskell.org/package/base-4.17.0.0/docs/Data-Semigroup.html#t:Max |
| 18:13:42 | <monochrom> | If you already have a binary max, then what Rembane said about using a plain fold. |
| 18:14:28 | <AndreasK> | Rembane: If you have a Ord instance already (as `Max` requires) I would just use maximum. |
| 18:15:30 | <AndreasK> | monochrom: I guess that's a reasonable stance. I'm just looking at the code generated by maximumBy and am annoyed by the extra branches from casing on the Ord result |
| 18:15:43 | <Rembane> | AndreasK: You can use foldMap to get something with Max, but yeah... |
| 18:16:31 | <monochrom> | "foldl1' yourmax" is very short, so no one thought of giving it a name and registering it in a library. |
| 18:17:12 | <monochrom> | Whereas comparator-based maximumBy is much longer and actually warrants librarying and reuse. |
| 18:18:56 | <monochrom> | But you should aim higher. |
| 18:20:01 | <monochrom> | You should demand veryGeneralMaximumBy :: Foldable t => Either (a -> a -> a) (a -> a -> Ordering) -> t a -> a >:) |
| 18:21:05 | <EvanR> | I thought you were going to say the more efficient implementation would be to max pairs, then max pairs of results of that, and so on |
| 18:21:37 | <AndreasK> | I've head that being called a tree fold |
| 18:21:56 | <AndreasK> | *heard |
| 18:22:26 | → | eggplantade joins (~Eggplanta@104-55-37-220.lightspeed.sntcca.sbcglobal.net) |
| 18:23:16 | <monochrom> | In terms of branching, here is the thing: A lot of data types compute binary max by branching, too. foldl1' yourmax does not avoid that branching. |
| 18:23:30 | <monochrom> | (for those data types) |
| 18:23:47 | <monochrom> | or rather, s/your/their/ |
| 18:24:09 | → | doyougnu joins (~doyougnu@cpe-74-69-132-225.stny.res.rr.com) |
| 18:25:38 | <monochrom> | To a large extent the only counterexample I have seen is if you take Word8 as a bit vector/set and you repurpose "max" to mean least upper bound i.e. union i.e. bitwise-or. |
| 18:26:16 | <AndreasK> | For int you could compile max to a cmove, but we sadly don't currently. |
| 18:26:35 | <monochrom> | How does cmove work? |
| 18:27:17 | <AndreasK> | Conditional move at the assembly level, you emit the compare instruction and based on the result the following conditional move gets executed or not |
| 18:27:31 | <AndreasK> | It's generally better than branching |
| 18:27:32 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 18:27:35 | <monochrom> | Ah yeah that, I think I've heard of it before. |
| 18:27:48 | → | unit73e joins (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) |
| 18:28:16 | × | aeroplane quits (~user@user/aeroplane) (Ping timeout: 252 seconds) |
| 18:28:18 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 18:28:18 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 18:28:18 | → | wroathe joins (~wroathe@user/wroathe) |
| 18:28:49 | <monochrom> | Yeah the ALU does an internal "branching" that doesn't ruin the execution pipeline etc. |
| 18:29:34 | <monochrom> | and "compare instruction" is just subtraction. |
| 18:35:46 | → | tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
| 18:36:24 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 272 seconds) |
| 18:40:22 | <mauke> | hahahaha |
| 18:40:34 | <mauke> | I just did AoC day 12 part 2 |
| 18:40:50 | × | festive_kurbus quits (~festive_k@user/kurbus) (Quit: Client closed) |
| 18:41:23 | <mauke> | my code changes compared to part 1 are rather modest |
| 18:41:36 | <mauke> | before: main = interact ((++ "\n") . show . process . arrayFromLines . lines) |
| 18:41:39 | <mauke> | after: main = interact ((++ "\n") . show . process . arrayFromLines . lines . map (\case 'a' -> 'S'; c -> c)) |
| 18:43:09 | <mauke> | the problem asks you to find the shortest path through a maze from a start symbol S to an end symbol E |
| 18:43:23 | <int-e> | yeah it was a rather weak twist |
| 18:43:53 | <mauke> | part 2 generalizes it to finding the shortest path from any starting symbol (and all the 'a's are also start symbols) |
| 18:44:14 | <mauke> | only my algorithm was already fully general, finding the shortest path between any start symbol and any end symbol :-D |
| 18:44:21 | <int-e> | I think I had to change more than just == 'S' to `elem` "Sa" but I forgot why. |
| 18:45:04 | <mauke> | did you do any fancy path finding or just brute-force search? |
| 18:45:23 | <int-e> | standard bfs |
| 18:45:30 | <mauke> | same |
| 18:46:10 | <mauke> | I hadn't done it before, so I wrote it up in imperative pseudocode using sets |
| 18:46:27 | <mauke> | then translated it to a bunch of folds, threading the state sets through |
| 18:46:31 | <mauke> | worked on the first try :-) |
| 18:52:11 | × | CiaoSen quits (~Jura@p200300c95730b6002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 18:52:27 | <monochrom> | Perhaps they are fishing for a solution to the open problem: Is there a single-pair algorithm that's big-O-faster than single-source algorithms? |
| 18:58:41 | → | ksqsf joins (~user@134.209.106.31) |
| 18:59:05 | ← | ksqsf parts (~user@134.209.106.31) () |
| 19:09:12 | → | ksqsf joins (~user@134.209.106.31) |
| 19:09:26 | ← | ksqsf parts (~user@134.209.106.31) (ERC 5.4.1 (IRC client for GNU Emacs 29.0.60)) |
| 19:10:56 | → | ksqsf joins (~user@134.209.106.31) |
| 19:12:37 | → | coot joins (~coot@213.134.171.3) |
| 19:13:09 | ← | ksqsf parts (~user@134.209.106.31) (ERC 5.4.1 (IRC client for GNU Emacs 29.0.60)) |
| 19:19:34 | → | ft joins (~ft@p4fc2a257.dip0.t-ipconnect.de) |
| 19:21:56 | → | akegalj joins (~akegalj@141-136-165-175.dsl.iskon.hr) |
| 19:26:03 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 19:29:40 | × | Xeroine quits (~Xeroine@user/xeroine) (Quit: ZNC 1.8.2+deb2+b1 - https://znc.in) |
| 19:30:08 | → | ksqsf joins (~user@134.209.106.31) |
| 19:30:29 | → | Xeroine joins (~Xeroine@user/xeroine) |
| 19:31:49 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 19:35:14 | × | acidjnk quits (~acidjnk@p200300d6e7137a00f9d7394677563a85.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 19:35:18 | × | doyougnu quits (~doyougnu@cpe-74-69-132-225.stny.res.rr.com) (Ping timeout: 272 seconds) |
| 19:37:12 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 272 seconds) |
| 19:39:11 | × | akegalj quits (~akegalj@141-136-165-175.dsl.iskon.hr) (Quit: leaving) |
| 19:39:35 | → | voidzero joins (~voidzero@user/voidzero) |
| 19:48:53 | → | fizbin joins (~fizbin@user/fizbin) |
| 19:50:17 | → | Guest75 joins (Guest75@2a01:7e01::f03c:92ff:fe5d:7b18) |
| 19:58:06 | → | VY2 joins (~user@217.107.126.130) |
| 20:02:49 | → | gmg joins (~user@user/gehmehgeh) |
| 20:04:07 | → | NoOne joins (~NoOne@181.95.93.87) |
| 20:08:50 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:7798:b400:fd36:b817) |
| 20:08:58 | <EvanR> | monochrom, ALU does internal branching, this is veering dangerously close to old lisp "everything is made of if statements at some level" |
| 20:10:29 | <darkling> | lifp? |
| 20:10:41 | → | acidjnk joins (~acidjnk@p200300d6e7137a0005c6f28ba6b2016c.dip0.t-ipconnect.de) |
| 20:11:09 | <EvanR> | most zachtronics games allow solutions which exploit something like, do everything all at once, then merge the answers just in time |
| 20:11:30 | <monochrom> | Haha everything is made of nand gates at some level, which are even better than if-statements >:) |
| 20:12:23 | <monochrom> | OK OK, half of everything. The other half is made of capacitors. |
| 20:12:43 | <EvanR> | it's a basic law of physics that the hamiltonian flow can't branch xD |
| 20:12:58 | <EvanR> | computation is impossible |
| 20:13:28 | <monochrom> | Wait a second, can't branch? Or can't resist to branch and find the least-action path? |
| 20:13:57 | <EvanR> | your orbit through phase space only goes straight and can't fork |
| 20:14:35 | <geekosaur> | the question becomes, is what appears to be a branch to us not? |
| 20:14:55 | <EvanR> | the quantum version is unitary flow |
| 20:15:01 | <monochrom> | Or must fork tremendously and find the optimum then erase all evidence of forking and show you only the "deterministic" optimum. |
| 20:15:34 | <monochrom> | I mean I am speaking this even in classical mechanics via the principle of least action. |
| 20:16:05 | <monochrom> | I mean you brought up hamilton so let's go langragian too! |
| 20:16:35 | <EvanR> | yeah beginning with classical uncertain blob in phase space, the bits of your blob will never merge or split or cross paths |
| 20:16:57 | → | CiaoSen joins (~Jura@p200300c95730b6002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 20:17:45 | <monochrom> | I think even in mathematics I can justify (or at least rationalize) defining R->R functions in terms of uncountably many if-statements. |
| 20:18:11 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 20:21:01 | <EvanR> | I think what I'm saying is, if you build a machine that adds 1 volt to an input, it's [insert analogy to "every is a set in math"] to say it works by say, if 1V then 2V else if 2V then 3V else if ..., when there's a more suitable language for the behavior |
| 20:21:47 | <monochrom> | That much I agree. |
| 20:21:52 | <EvanR> | like avoiding a turing tarpit |
| 20:23:10 | <EvanR> | and if we're not standing on infinite if statements, maybe we don't have to use them in everyday code. All praise catamorphisms and such |
| 20:24:33 | <monochrom> | "more suitable language" does not imply "no other truth". Example: Haskell is really a more suitable language for my programs, but it does not imply that the truth is not that it gets translated to a ton of nand gates and capacitors. |
| 20:26:21 | <EvanR> | I love how haskell kind of relegated the actual if statement to "use this mostly when you really just want to say if something then this else that" |
| 20:26:35 | <EvanR> | at least that's how it felt coming from every other language |
| 20:26:56 | <EvanR> | it's for literal if statements and not for implementing the entire universe |
| 20:27:07 | <monochrom> | Going back to where it started, ALU having cmove is a fairly recent addition. Older ALUs were much simpler. |
| 20:27:10 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 20:27:48 | → | waleee joins (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) |
| 20:28:04 | <geekosaur> | there are a few other languages where if is an expression instead of a statement |
| 20:28:18 | <EvanR> | cmove is great, but there's probably an even more efficient way to max two integers with silicon |
| 20:28:33 | <EvanR> | because... you're not limited to if statements xD |
| 20:28:36 | <monochrom> | Although, CPUs have had concurrency primitives for longer than cmove, and that one is way more complex, even "if" is dwarved. |
| 20:29:24 | <EvanR> | maybe, the max of a word is the bitwise max of bits, each of which is an OR |
| 20:29:40 | <monochrom> | That's the union I mentioned. |
| 20:29:58 | <EvanR> | not branching right |
| 20:30:27 | <monochrom> | But it won't give max 2 4 = 4. |
| 20:30:33 | <voidzero> | anyone here who has read Haskell Programming From First Principles? |
| 20:30:41 | <EvanR> | doh you're right |
| 20:31:21 | <voidzero> | I'm working my way through it, and while I get most concepts, I want to know if I'm too stupid for Haskell if I can't get the solution to some of the exercises |
| 20:31:33 | × | avicenzi quits (~avicenzi@2a00:ca8:a1f:b004::c32) (Ping timeout: 265 seconds) |
| 20:33:16 | <monochrom> | Not stupid. Some exercises are harder than the others. |
| 20:33:35 | <geekosaur> | there is very little "too stupid". there is a lot of having to unlearn concepts from other languages |
| 20:33:39 | → | pavonia joins (~user@user/siracusa) |
| 20:34:05 | <monochrom> | More positively, it is OK to consult people and get help. |
| 20:35:38 | <monochrom> | In general, true of any learning: The whole point of why "learning" exists in the first place is because you can't be expected to reinvent everything on your own. |
| 20:35:53 | <voidzero> | well, maybe, I'm not a programmer much although I can cook a mean zsh script. But, for example, "using takeWhile and dropWhile, write a function that takes a string and returns a list of strings, using spaces to separate the elements of the string into words." So, for example, "hello there #haskell" should become ["hello", "there", "#haskell"]. I didn't know what to do, in the end chatGPT tutored |
| 20:35:55 | <voidzero> | me, but am i supposed to know this? the recursing stuff is a bit hard to get a hold of. |
| 20:36:09 | × | waleee quits (~waleee@h-176-10-137-138.NA.cust.bahnhof.se) (Ping timeout: 260 seconds) |
| 20:36:36 | <monochrom> | Wait chatGPT understands recursion better than my students?! XD |
| 20:36:45 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 20:36:48 | <monochrom> | I need to tell my students and ruin their day. |
| 20:37:37 | <monochrom> | Next office hour: <Student> Hi professor how do you use recursion for Assignment 1? <Professor> You know, chatGPT solved the assignment XD |
| 20:38:02 | <voidzero> | haha yeah well at least chatGPT won't get annoyed if I keep replying "eli5" |
| 20:38:29 | <voidzero> | plus, i've never had any normal schooling, kind of a weird history, so i'm already happy with what i am getting |
| 20:38:34 | <voidzero> | but this -- myLines [] = [] ; myLines ('\n':xs) = myLines xs ; myLines xs = takeWhile (/='\n') xs : myLines (dropWhile (/='\n') xs) |
| 20:38:48 | <voidzero> | I'd never have figured that out on my own |
| 20:38:54 | <voidzero> | not now at least |
| 20:38:55 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:7798:b400:fd36:b817) (Quit: WeeChat 2.8) |
| 20:39:50 | <monochrom> | Here is a possibility. If that spoiler enlightens you so that you can solve other problems on your own, then the learning objective is achieved. |
| 20:41:01 | <voidzero> | fair enough. It probably will help me solve similar tasks or at the very least I can fall back on this. Maybe I'll just have to learn concrete patterns first and the intuition will come much later. |
| 20:41:06 | <voidzero> | kind of like driving lessons |
| 20:41:12 | <monochrom> | There are a ton of techniques I didn't and couldn't think up on my own. The important thing is after I saw my profs did those tricks I can do it in the future and also teach my students. |
| 20:41:17 | <voidzero> | my first 15 lessons I looked at the mirror, not in the mirror |
| 20:41:26 | → | bilegeek joins (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) |
| 20:41:55 | <voidzero> | righto. Thanks for that bit of reassurance. : ) |
| 20:41:58 | <monochrom> | And by induction, I bet my profs didn't invent those tricks themselves either, they too saw it from their profs... |
| 20:43:16 | <monochrom> | Here is my course notes teaching how to think up recursive algorithms: http://www.cs.utoronto.ca/~trebla/CSCC24-2022-Summer/01-haskell-basic.html#syn |
| 20:44:11 | → | guest1010 joins (~guest1010@2001:1c06:2715:c200:9a50:5735:4659:120b) |
| 20:46:10 | <voidzero> | oh that's something to chew on, thanks! |
| 20:48:08 | <voidzero> | what does WTP stand for? |
| 20:48:29 | → | gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
| 20:49:09 | × | NoOne quits (~NoOne@181.95.93.87) (Quit: Client closed) |
| 20:51:14 | <guest1010> | Hello, I'm having some difficulty understanding this concept in Haskell. Why does the type of this function, "g :: (a -> b -> c) -> (f a -> f b -> f c)" only allow you to pattern match on the parameters (a -> b -> c), f a, and f b (e.g. g fn fa fb = ...) and not allow you to pattern match on specific values in the the function parameter (a -> b -> |
| 20:51:14 | <guest1010> | c) ? I believe I understand the concepts of currying and associativity; but this seems like some funk combination of both and I cant wrap my head around it. |
| 20:51:49 | × | zeenk quits (~zeenk@2a02:2f04:a30d:4300::7fe) (Quit: Konversation terminated!) |
| 20:52:06 | × | waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Quit: WeeChat 3.7.1) |
| 20:53:18 | <unit73e> | guest1010, I didn't get a clear picture. so the first argument is a function that takes a and returns b -> c, but notice that it's (a -> b -> c) so you have to give the entire thing. |
| 20:53:22 | <unit73e> | that part is clear, right? |
| 20:53:43 | × | gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1) |
| 20:53:58 | → | gnalzo joins (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) |
| 20:54:26 | <unit73e> | and then that returns (f a -> f b -> f c), so basically you're applying f to all arguments of the first.. argument.. for lack of a better term |
| 20:54:31 | <unit73e> | what were you expecting to happen? |
| 20:54:37 | → | waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) |
| 20:54:55 | <guest1010> | Yeah so hypothetically, I can pass a lambda function like this (\x y -> x + y) as a valid argument (assuming the constraint that a, b, c are Nums) |
| 20:55:17 | × | Topsi quits (~Topsi@dyndsl-095-033-225-198.ewe-ip-backbone.de) (Ping timeout: 256 seconds) |
| 20:56:26 | → | Topsi joins (~Topsi@dyndsl-095-033-225-198.ewe-ip-backbone.de) |
| 20:57:09 | <guest1010> | My question is more so, how does pattern matching on that function type allow you to extract the function parameter, the first kind, and the second kind. Shouldnt pattern matching allow us to extract the values out of (a -> b -> c) then as well? |
| 20:57:34 | <guest1010> | If we can pattern match fa and fb out of (f a -> f b -> f c), why cant we do that to (a -> b -> c)? |
| 20:57:52 | <geekosaur> | what values? |
| 20:58:10 | <geekosaur> | what values are in (\x y -> x + y)? |
| 20:58:33 | <geekosaur> | you can only give it values, there are none to take out |
| 20:58:37 | <guest1010> | I would counter that by asking what values are in (f a -> f b -> f c) |
| 20:58:56 | <unit73e> | ok now it's a bit more clear |
| 20:59:06 | <guest1010> | but nevertheless we can pattern match to extract those values right? |
| 20:59:54 | <geekosaur> | actually no. we can work on an application of it, but by itself it's just a function like (a -> b -> c) is |
| 20:59:58 | <guest1010> | Take the function G :: (a -> b -> c) -> (f a -> f b -> f c). You can define a definition for G to be G fn = ... |
| 21:00:05 | × | phma quits (~phma@host-67-44-208-17.hnremote.net) (Read error: Connection reset by peer) |
| 21:00:06 | <geekosaur> | do not confuse a function with an application of a function |
| 21:00:59 | → | phma joins (phma@2001:5b0:211f:2488:eec1:974f:5902:6cf5) |
| 21:01:19 | <geekosaur> | also, you may be missing the piece where there is a constraint `Functor f`, which means that the type provides a specific way to do that. if the type does not provide that way, it can't be done |
| 21:02:12 | <guest1010> | "we can work on an application of it, but by itself it's just a function like (a -> b -> c) is" fine but then why can't I define an application of (a -> b -> c) too ? |
| 21:02:51 | <unit73e> | you can pattern the entire thing and call it |
| 21:02:58 | <unit73e> | pattern match |
| 21:03:07 | <geekosaur> | but, do you have something to pass it? |
| 21:03:09 | <mauke> | voidzero: it's math jargon. "want to prove", apparently |
| 21:03:20 | <voidzero> | ah i see, thanks |
| 21:03:26 | <geekosaur> | if all you know is (a -> b -> c), you don't know what to supply for a and b |
| 21:03:43 | <guest1010> | So we can define G to be {: G fn = ...., G fn fa = ...., G fn fa fb = ...., :} but why cant I define G a b c fa fb |
| 21:04:56 | <geekosaur> | oh dear, that sounds somewhat confused. you would in that case be supplying two values and a result, and asking the compiler to figure out what function produced it |
| 21:05:01 | <mauke> | guest1010: that's because of currying |
| 21:06:00 | <mauke> | when you have a type like A -> (B -> C -> D), that means you have a function (taking an argument of type A) and returning another function |
| 21:06:34 | <mauke> | you might implement this as f a = \b c -> ... (where a :: A, b :: B, c :: C) |
| 21:07:16 | <mauke> | guest1010: similarly, in your original example of "g :: (a -> b -> c) -> (f a -> f b -> f c)", you could write "g f = \fa fb -> ..." |
| 21:07:34 | <mauke> | (assuming you're familiar with lambda notation for anonymous functions) |
| 21:08:16 | <mauke> | however, because Haskell does automatic currying, when you define a function like "f a b c = ...", it actually means "f = \a -> \b -> \c -> ..." |
| 21:08:54 | → | money_ joins (~money@216-131-83-77.nyc.as62651.net) |
| 21:08:55 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 21:09:11 | <mauke> | similarly, "g f = \fa fb -> ..." can also be written as "g f = \fa -> \fb -> ..." or "g = \f -> \fa -> \fb -> ..." or "g f fa fb = ..." |
| 21:09:23 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 21:09:59 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 21:10:13 | <mauke> | it's not that you can pattern match on the parameters of an argument that is another function, it is that (due to currying) you can effectively pattern match on the parameters of your return value |
| 21:10:17 | <guest1010> | right im following... so then couldnt (a -> b -> c) -> (f a -> f b -> f c) be rewritten as a -> (b -> (c -> (f a -> (f b -> f c)) |
| 21:10:18 | <mauke> | (assuming you're returning a function) |
| 21:10:31 | <mauke> | not quite |
| 21:11:08 | <mauke> | (a -> b -> c) -> (f a -> f b -> f c) can be fully parenthesized as (f a -> (f b -> f c)) -> (f a -> (f b -> fc)) |
| 21:11:24 | <mauke> | er |
| 21:11:34 | <mauke> | (a -> b -> c) -> (f a -> f b -> f c) can be fully parenthesized as (a -> (b -> c)) -> (f a -> (f b -> fc)) |
| 21:11:51 | <mauke> | but you can't dissolve parentheses beyond (a -> b -> c) -> f a -> f b -> f c |
| 21:12:07 | <guest1010> | right!! why! |
| 21:12:25 | <mauke> | the syntactic answer is that -> is right associative |
| 21:12:40 | <mauke> | A -> B -> C simply means A -> (B -> C) |
| 21:13:25 | <mauke> | so if you have a function that takes a function as an argument, such as (A -> B) -> C, you can't write that type without parentheses |
| 21:13:26 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 255 seconds) |
| 21:13:28 | × | oldsk00l quits (~znc@ec2-3-10-59-201.eu-west-2.compute.amazonaws.com) (Ping timeout: 272 seconds) |
| 21:13:42 | <guest1010> | I follow that bit.. I've been refreshing myself on associativity of operators; and (->) is a right associative operator |
| 21:14:58 | <guest1010> | but then why does the return type of (f a -> f b -> f c) allow you to not use parentheses |
| 21:15:07 | → | ballast joins (~ballast@cpe-104-32-238-223.socal.res.rr.com) |
| 21:15:26 | <ballast> | hoogle fails me, is there a function `duplicates :: Ord a => [a] -> Set a` ? |
| 21:15:46 | <mauke> | guest1010: still because -> is right associative |
| 21:15:56 | <ballast> | i would accept `duplicates :: Ord a => [a] -> [a]` too although i'd prefer something not n^2 |
| 21:16:10 | <Rembane> | :t nub -- ballast |
| 21:16:11 | <lambdabot> | Eq a => [a] -> [a] |
| 21:16:29 | <Rembane> | ballast: Or wait, is it the opposite to nub you're searching for? |
| 21:16:32 | <ballast> | sorry, i want the opposite of nub |
| 21:16:39 | <Rembane> | Ha! :D |
| 21:17:09 | <ballast> | although i could probably just do `as \\ nub as` |
| 21:17:30 | <Rembane> | Yeah |
| 21:17:48 | <mauke> | (A -> B) -> C is the type of a function that takes another function as an argument (and returns a value of type C); A -> (B -> C) is the type of a function that returns another function (and takes a value of type A as argument) |
| 21:18:01 | <ballast> | B) lol |
| 21:18:17 | <Rembane> | ballast: Make do with that until things become horribly inefficient, then you can use sort and group and map and when that becomes too slow you can use Set instead. :) |
| 21:18:23 | <mauke> | the latter case is much more common in Haskell (because of currying), so -> was made right associative to let you write simply A -> B -> C |
| 21:19:33 | <mauke> | this extends to multiple chained arrows: A -> (B -> C -> D) means the same thing as A -> (B -> (C -> D)) or, going in the other direction, A -> B -> C -> D |
| 21:19:50 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 21:20:14 | <ballast> | Rembane: yeah i was originally thinking i'd use Set but tbh i doubt n will be much greater than 100 |
| 21:21:51 | <Rembane> | ballast: Then I doubt the chosen solution will matter at all. :) |
| 21:22:02 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 21:22:18 | <ballast> | last thing i want to do is union a bunch of Sets containing 3 elements each |
| 21:22:31 | <ballast> | although probably not the worst thing in the world to do |
| 21:23:50 | × | money_ quits (~money@216-131-83-77.nyc.as62651.net) (Quit: late) |
| 21:27:06 | → | money_ joins (~money@216-131-83-77.nyc.as62651.net) |
| 21:29:20 | × | money_ quits (~money@216-131-83-77.nyc.as62651.net) (Read error: Connection reset by peer) |
| 21:29:42 | → | money_ joins (~money@216-131-83-77.nyc.as62651.net) |
| 21:29:58 | → | crazazy joins (~user@130.89.173.127) |
| 21:32:47 | × | guest1010 quits (~guest1010@2001:1c06:2715:c200:9a50:5735:4659:120b) (Quit: Client closed) |
| 21:33:54 | × | thyriaen quits (~thyriaen@2a01:aea0:dd4:4bae:6245:cbff:fe9f:48b1) (Ping timeout: 265 seconds) |
| 21:34:58 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 21:36:26 | × | biberu quits (~biberu@user/biberu) (Read error: Connection reset by peer) |
| 21:38:12 | × | bgs quits (~bgs@212-85-160-171.dynamic.telemach.net) (Remote host closed the connection) |
| 21:38:20 | × | tcard quits (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Remote host closed the connection) |
| 21:38:33 | → | tcard joins (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) |
| 21:43:01 | × | trev quits (~trev@user/trev) (Remote host closed the connection) |
| 21:43:49 | → | biberu joins (~biberu@user/biberu) |
| 21:50:22 | × | money_ quits (~money@216-131-83-77.nyc.as62651.net) (Quit: late) |
| 21:51:07 | × | danza quits (~francesco@4.red-79-153-154.dynamicip.rima-tde.net) (Ping timeout: 248 seconds) |
| 21:54:31 | <monochrom> | voidzero: WTP = Want To Prove |
| 21:54:34 | × | tcard quits (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) (Remote host closed the connection) |
| 21:55:48 | → | tcard joins (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) |
| 21:56:37 | × | bilegeek quits (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) (Remote host closed the connection) |
| 21:57:10 | → | bilegeek joins (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) |
| 21:59:48 | → | bilegeek_ joins (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) |
| 22:00:04 | × | CiaoSen quits (~Jura@p200300c95730b6002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 22:00:29 | × | gnalzo quits (~gnalzo@2a01:e0a:498:fd50:fcc6:bb5d:489a:ce8c) (Quit: WeeChat 3.7.1) |
| 22:00:43 | × | motherfsck quits (~motherfsc@user/motherfsck) (Ping timeout: 260 seconds) |
| 22:02:30 | × | bilegeek quits (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) (Ping timeout: 255 seconds) |
| 22:03:53 | → | money_ joins (~money@216-131-83-77.nyc.as62651.net) |
| 22:10:32 | <ncf> | is there any conceivable reason why `let (x, y) = head foo` would get compiled by GHC to something ever so slightly faster than `let (x, y):_ = foo` ? |
| 22:11:01 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
| 22:11:06 | × | VY2 quits (~user@217.107.126.130) (Ping timeout: 272 seconds) |
| 22:11:44 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 272 seconds) |
| 22:11:48 | jackhill_ | is now known as jackhill |
| 22:12:32 | <geekosaur> | you're getting into stuff that requires scrutinizing Core and possibly assembly, including the potential for cache or alignment issues that get tricky |
| 22:12:56 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 22:13:02 | → | danza joins (~francesco@4.red-79-153-154.dynamicip.rima-tde.net) |
| 22:13:52 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 22:14:25 | <ncf> | okay, that's beyond the range of things i choose to care about :) |
| 22:15:02 | → | motherfsck joins (~motherfsc@user/motherfsck) |
| 22:18:10 | × | ballast quits (~ballast@cpe-104-32-238-223.socal.res.rr.com) (Quit: Client closed) |
| 22:18:20 | → | ballast joins (~ballast@cpe-104-32-238-223.socal.res.rr.com) |
| 22:18:31 | × | michalz quits (~michalz@185.246.204.93) (Remote host closed the connection) |
| 22:24:04 | × | fizbin quits (~fizbin@user/fizbin) (Ping timeout: 260 seconds) |
| 22:25:39 | → | crazazy` joins (~user@130.89.171.62) |
| 22:27:34 | × | crazazy quits (~user@130.89.173.127) (Ping timeout: 272 seconds) |
| 22:28:50 | × | danza quits (~francesco@4.red-79-153-154.dynamicip.rima-tde.net) (Ping timeout: 272 seconds) |
| 22:33:39 | × | tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 22:35:12 | × | coot quits (~coot@213.134.171.3) (Quit: coot) |
| 22:35:26 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 22:35:38 | → | fizbin joins (~fizbin@user/fizbin) |
| 22:37:39 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 22:42:38 | × | bilegeek_ quits (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) (Remote host closed the connection) |
| 22:43:03 | → | bilegeek_ joins (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) |
| 22:43:44 | × | ballast quits (~ballast@cpe-104-32-238-223.socal.res.rr.com) (Quit: Client closed) |
| 22:48:14 | × | Xeroine quits (~Xeroine@user/xeroine) (Ping timeout: 252 seconds) |
| 22:49:05 | × | gabriel_sevecek quits (~gabriel@188-167-229-200.dynamic.chello.sk) (Ping timeout: 252 seconds) |
| 22:50:19 | × | money_ quits (~money@216-131-83-77.nyc.as62651.net) (Ping timeout: 256 seconds) |
| 22:51:23 | → | Xeroine joins (~Xeroine@user/xeroine) |
| 22:55:00 | <sclv> | oh btw let me ask, my friends are doing some digging into code bootcamps and people's experiences -- if they feel they have been worthwhile, or have been cheated by them, etc. did anyone go to a bootcamp, or have friends who did and would be willing to share anything about it? |
| 23:00:08 | × | bilegeek_ quits (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) (Remote host closed the connection) |
| 23:00:37 | → | bilegeek_ joins (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) |
| 23:09:08 | × | bilegeek_ quits (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) (Remote host closed the connection) |
| 23:09:22 | × | unit73e quits (~emanuel@2001:818:e8dd:7c00:656:e5ff:fe72:9d36) (Ping timeout: 252 seconds) |
| 23:09:32 | → | bilegeek_ joins (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) |
| 23:11:14 | × | bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 246 seconds) |
| 23:14:35 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 23:17:01 | → | gabriel_sevecek joins (~gabriel@188-167-229-200.dynamic.chello.sk) |
| 23:18:51 | → | crazazy`` joins (~user@130.89.173.127) |
| 23:20:54 | × | crazazy` quits (~user@130.89.171.62) (Ping timeout: 268 seconds) |
| 23:22:05 | × | ksqsf quits (~user@134.209.106.31) (Remote host closed the connection) |
| 23:24:00 | × | shapr quits (~user@68.54.166.125) (Remote host closed the connection) |
| 23:27:35 | → | ubert1 joins (~Thunderbi@p200300ecdf264e7202f1c0a81cd86a27.dip0.t-ipconnect.de) |
| 23:27:54 | × | ubert quits (~Thunderbi@p200300ecdf264e1ec8d72b0a2c29e966.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
| 23:27:54 | ubert1 | is now known as ubert |
| 23:28:55 | × | crazazy`` quits (~user@130.89.173.127) (Ping timeout: 268 seconds) |
| 23:30:20 | × | bilegeek_ quits (~bilegeek@2600:1008:b015:7e38:b69d:8e53:dae7:9c4c) (Ping timeout: 260 seconds) |
| 23:34:24 | × | Topsi quits (~Topsi@dyndsl-095-033-225-198.ewe-ip-backbone.de) (Read error: Connection reset by peer) |
| 23:35:12 | × | use-value quits (~Thunderbi@2a00:23c6:8a03:2f01:39df:b639:fbf4:175b) (Remote host closed the connection) |
| 23:35:31 | → | use-value joins (~Thunderbi@2a00:23c6:8a03:2f01:75c2:a71f:beaa:29bf) |
| 23:35:57 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 23:44:05 | × | xff0x_ quits (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 252 seconds) |
| 23:44:26 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 23:45:47 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 23:45:47 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 23:45:47 | → | wroathe joins (~wroathe@user/wroathe) |
| 23:49:47 | × | Guest75 quits (Guest75@2a01:7e01::f03c:92ff:fe5d:7b18) (Quit: Client closed) |
| 23:50:34 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds) |
| 23:51:25 | → | ksqsf joins (~user@134.209.106.31) |
| 23:53:15 | ← | ksqsf parts (~user@134.209.106.31) () |
| 23:53:25 | → | ksqsf joins (~user@134.209.106.31) |
| 23:59:37 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
All times are in UTC on 2022-12-15.