2024-03-27 00:01:09 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2024-03-27 00:05:58 +0100 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 268 seconds) |
2024-03-27 00:06:44 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 00:09:44 +0100 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) (Quit: ZNC 1.7.5 - https://znc.in) |
2024-03-27 00:13:01 +0100 | shapr` | (~user@c-24-218-186-89.hsd1.ma.comcast.net) |
2024-03-27 00:14:04 +0100 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) |
2024-03-27 00:14:06 +0100 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2024-03-27 00:14:55 +0100 | shapr | (~user@c-24-218-186-89.hsd1.ma.comcast.net) (Ping timeout: 260 seconds) |
2024-03-27 00:16:10 +0100 | acidjnk_new | (~acidjnk@p200300d6e708d544d1e6663fb0659050.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2024-03-27 00:17:27 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 00:33:13 +0100 | tri | (~tri@2607:fb90:b11c:c26:dd1e:45f1:66e:dece) (Remote host closed the connection) |
2024-03-27 00:40:37 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2024-03-27 00:41:38 +0100 | noumenon | (~noumenon@113.51-175-156.customer.lyse.net) (Quit: Leaving) |
2024-03-27 00:45:03 +0100 | libertyprime | (~libertypr@118-92-68-68.dsl.dyn.ihug.co.nz) |
2024-03-27 00:45:07 +0100 | Luj | (~Luj@2a01:e0a:5f9:9681:304f:b65d:c4ab:ff14) (Quit: Ping timeout (120 seconds)) |
2024-03-27 00:45:27 +0100 | Luj | (~Luj@2a01:e0a:5f9:9681:114f:c45b:717e:86b) |
2024-03-27 00:54:03 +0100 | Tisoxin | (~Ikosit@user/ikosit) (Quit: The Lounge - https://thelounge.chat) |
2024-03-27 00:54:37 +0100 | Tisoxin | (~Ikosit@user/ikosit) |
2024-03-27 00:57:40 +0100 | mmhat | (~mmh@p200300f1c706a2b6ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 4.2.1) |
2024-03-27 01:01:26 +0100 | sadie_ | (~sadie@c-76-155-235-153.hsd1.co.comcast.net) |
2024-03-27 01:03:37 +0100 | nek0 | (~nek0@2a01:4f8:222:2b41::12) (Quit: Ping timeout (120 seconds)) |
2024-03-27 01:03:53 +0100 | infinity0 | Guest4671 |
2024-03-27 01:03:53 +0100 | Guest4671 | (~infinity0@pwned.gg) (Killed (tungsten.libera.chat (Nickname regained by services))) |
2024-03-27 01:03:54 +0100 | nek0 | (~nek0@2a01:4f8:222:2b41::12) |
2024-03-27 01:04:02 +0100 | infinity0 | (~infinity0@pwned.gg) |
2024-03-27 01:05:23 +0100 | micro | (~micro@user/micro) (Ping timeout: 264 seconds) |
2024-03-27 01:05:26 +0100 | stiell_ | (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 260 seconds) |
2024-03-27 01:05:59 +0100 | stiell_ | (~stiell@gateway/tor-sasl/stiell) |
2024-03-27 01:07:00 +0100 | micro | (~micro@user/micro) |
2024-03-27 01:12:34 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 268 seconds) |
2024-03-27 01:16:08 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
2024-03-27 01:20:34 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 01:32:36 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2024-03-27 01:35:17 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2024-03-27 01:44:37 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 272 seconds) |
2024-03-27 01:45:39 +0100 | oo_miguel | (~Thunderbi@78-11-181-16.static.ip.netia.com.pl) (Ping timeout: 252 seconds) |
2024-03-27 01:53:09 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 256 seconds) |
2024-03-27 01:55:10 +0100 | Square | (~Square4@user/square) |
2024-03-27 02:01:05 +0100 | tessier | (~treed@ec2-184-72-149-67.compute-1.amazonaws.com) (Ping timeout: 256 seconds) |
2024-03-27 02:02:48 +0100 | tessier | (~treed@ip72-220-57-194.sd.sd.cox.net) |
2024-03-27 02:15:19 +0100 | rosco | (~rosco@183.171.110.111) |
2024-03-27 02:18:33 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 268 seconds) |
2024-03-27 02:26:34 +0100 | tessier | (~treed@ip72-220-57-194.sd.sd.cox.net) (Ping timeout: 268 seconds) |
2024-03-27 02:28:12 +0100 | tessier | (~treed@ec2-184-72-149-67.compute-1.amazonaws.com) |
2024-03-27 02:29:33 +0100 | billchenchina | (~billchenc@2a0d:2580:ff0c:1:e3c9:c52b:a429:5bfe) (Ping timeout: 255 seconds) |
2024-03-27 02:32:44 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 268 seconds) |
2024-03-27 02:34:42 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) |
2024-03-27 02:37:37 +0100 | infinity0 | (~infinity0@pwned.gg) (Remote host closed the connection) |
2024-03-27 02:39:44 +0100 | infinity0 | (~infinity0@pwned.gg) |
2024-03-27 02:40:08 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Ping timeout: 268 seconds) |
2024-03-27 02:43:30 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2024-03-27 02:43:58 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2024-03-27 02:46:05 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2024-03-27 02:50:42 +0100 | ystael | (~ystael@user/ystael) (Ping timeout: 255 seconds) |
2024-03-27 02:52:47 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 264 seconds) |
2024-03-27 02:57:00 +0100 | mima | (~mmh@aftr-62-216-211-42.dynamic.mnet-online.de) (Ping timeout: 255 seconds) |
2024-03-27 03:03:19 +0100 | pointlessslippe1 | (~pointless@212.82.82.3) (Ping timeout: 255 seconds) |
2024-03-27 03:05:46 +0100 | pointlessslippe1 | (~pointless@212.82.82.3) |
2024-03-27 03:07:12 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-03-27 03:08:08 +0100 | tremon | (~tremon@83.80.159.219) (Quit: getting boxed in) |
2024-03-27 03:15:31 +0100 | xff0x | (~xff0x@2405:6580:b080:900:f97d:d4c:a5b1:7ce0) (Ping timeout: 260 seconds) |
2024-03-27 03:21:23 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) |
2024-03-27 03:22:12 +0100 | otto_s | (~user@p4ff27cae.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
2024-03-27 03:23:40 +0100 | otto_s | (~user@p5de2fa1e.dip0.t-ipconnect.de) |
2024-03-27 03:33:10 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 03:33:46 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 03:36:06 +0100 | <c_wraith> | Aww, I can't do nested lack of pattern matches against empty data decls |
2024-03-27 03:36:43 +0100 | <c_wraith> | Well, I can. But GHC complains that I've missed cases |
2024-03-27 03:37:59 +0100 | <c_wraith> | I guess I can see why. The code difference results in different runtime diagnostics. Was it an incomplete pattern match or a bottom? Depends on which code you wrote. |
2024-03-27 03:38:36 +0100 | benkard | (~mulk@p5b2dc97e.dip0.t-ipconnect.de) |
2024-03-27 03:39:45 +0100 | mulk | (~mulk@p5b2dc4f3.dip0.t-ipconnect.de) (Ping timeout: 255 seconds) |
2024-03-27 03:39:45 +0100 | benkard | mulk |
2024-03-27 03:40:06 +0100 | <probie> | If it treated them the same, then most of the machinery for deepseq wouldn't work |
2024-03-27 03:40:49 +0100 | <c_wraith> | I really was more concerned with the warning than the specific way it fails at runtime |
2024-03-27 03:41:49 +0100 | <c_wraith> | (case x of Nothing -> y) gives a warning about incomplete pattern matches, that is silenced by (case x of Nothing -> y ; Just z -> case z of) |
2024-03-27 03:43:12 +0100 | triceraptor | (~prodmezha@123.63.203.210) |
2024-03-27 03:43:12 +0100 | <c_wraith> | emptiness can't be written in a nested match. I guess because there's absolutely no syntax to distinguish it from forgetting about the case. |
2024-03-27 03:46:49 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 03:47:41 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 03:58:43 +0100 | <EvanR> | case x of {}? |
2024-03-27 04:00:17 +0100 | igemnace | (~ian@user/igemnace) |
2024-03-27 04:02:37 +0100 | xff0x | (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) |
2024-03-27 04:06:34 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 04:07:08 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 04:10:28 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 04:11:03 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 04:11:56 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Remote host closed the connection) |
2024-03-27 04:13:16 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) |
2024-03-27 04:21:48 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2024-03-27 04:23:48 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 04:24:28 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 04:28:16 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 246 seconds) |
2024-03-27 04:35:34 +0100 | shapr` | (~user@c-24-218-186-89.hsd1.ma.comcast.net) (Ping timeout: 255 seconds) |
2024-03-27 04:38:06 +0100 | gentauro | (~gentauro@user/gentauro) (Read error: Connection reset by peer) |
2024-03-27 04:40:11 +0100 | td_ | (~td@i5387093F.versanet.de) (Ping timeout: 264 seconds) |
2024-03-27 04:40:27 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2024-03-27 04:41:42 +0100 | td_ | (~td@i53870933.versanet.de) |
2024-03-27 04:44:00 +0100 | gentauro | (~gentauro@user/gentauro) |
2024-03-27 04:54:52 +0100 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) (Quit: ZNC 1.7.5 - https://znc.in) |
2024-03-27 04:55:16 +0100 | gabiruh | (~gabiruh@vps19177.publiccloud.com.br) |
2024-03-27 05:01:27 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 260 seconds) |
2024-03-27 05:04:07 +0100 | turlando_ | (~turlando@user/turlando) (Ping timeout: 256 seconds) |
2024-03-27 05:05:04 +0100 | turlando | (~turlando@user/turlando) |
2024-03-27 05:16:51 +0100 | libertyprime | (~libertypr@118-92-68-68.dsl.dyn.ihug.co.nz) (Quit: leaving) |
2024-03-27 05:28:06 +0100 | <ski> | case x of Nothing -> y ; Just ‾ -> ‾ -- absurd pattern (and expression) |
2024-03-27 05:30:31 +0100 | <EvanR> | ‾u‾ |
2024-03-27 05:36:28 +0100 | <ski> | (`‾' being the neutral element of disjunctive / or- patterns, just like `_' (wildcard / "don't care") being neutral element of conjunctive / and-pattern (`@', if we allow both sides to be arbitrary patterns (e.g. useful with view patterns or pattern synonyms))) |
2024-03-27 05:38:51 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
2024-03-27 05:43:19 +0100 | <Axman6> | so the conversation earlier, with e@(Left _) >>= _ = e/unsafeCoerce e, it would be nice if you could safely use coerce e, because the extra information available through the Left pattern means it's guaranteed to be a no-op right? |
2024-03-27 05:44:14 +0100 | <Axman6> | it feels like what's possible with GADTs and pattern matching, so why doesn't it work with normal data? |
2024-03-27 05:46:12 +0100 | <ski> | yes .. that's why i was suggesting assigning the type `forall b. Either a b' to `e', there |
2024-03-27 05:49:34 +0100 | <ski> | (if only the patterns we've discarded mentions a type parameter in the component types of the data constructors of the discarded patterns, then we can generalize the current pattern over that type parameter. however, one could wonder how this would look like, in say an extension to System F -- also, from an abstract semantical standpoint, are there models of the original system which are not valid models of |
2024-03-27 05:49:40 +0100 | <ski> | an extended system along these lines ?) |
2024-03-27 05:55:52 +0100 | <dmj`> | p |
2024-03-27 05:56:19 +0100 | dmj` | (sid72307@id-72307.hampstead.irccloud.com) () |
2024-03-27 06:01:07 +0100 | aforemny_ | (~aforemny@2001:9e8:6ce5:9000:b2bf:8cbe:296e:6191) |
2024-03-27 06:02:22 +0100 | aforemny | (~aforemny@i59F516FD.versanet.de) (Ping timeout: 256 seconds) |
2024-03-27 06:20:10 +0100 | michalz | (~michalz@185.246.207.217) |
2024-03-27 06:31:05 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2024-03-27 06:35:02 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 06:35:28 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 06:37:21 +0100 | <jackdk> | q |
2024-03-27 06:39:03 +0100 | <Axman6> | p :- q |
2024-03-27 06:41:02 +0100 | harveypwca | (~harveypwc@2601:246:c200:2740:15b6:f225:14ff:9821) |
2024-03-27 06:46:18 +0100 | michalz | (~michalz@185.246.207.217) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-03-27 06:49:06 +0100 | michalz | (~michalz@185.246.207.218) |
2024-03-27 06:51:04 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 06:51:31 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 07:03:25 +0100 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) |
2024-03-27 07:10:51 +0100 | Square | (~Square4@user/square) (Ping timeout: 268 seconds) |
2024-03-27 07:16:04 +0100 | destituion | (~destituio@2a02:2121:655:c95b:3078:92e:b911:97ff) (Ping timeout: 260 seconds) |
2024-03-27 07:16:24 +0100 | destituion | (~destituio@85.221.111.174) |
2024-03-27 07:21:40 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 07:23:36 +0100 | sadie_ | (~sadie@c-76-155-235-153.hsd1.co.comcast.net) (Quit: Leaving) |
2024-03-27 07:31:11 +0100 | son0p | (~ff@152.203.80.45) (Ping timeout: 264 seconds) |
2024-03-27 07:32:22 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 07:40:25 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) |
2024-03-27 07:44:34 +0100 | tri | (~tri@ool-18bc2e74.dyn.optonline.net) (Remote host closed the connection) |
2024-03-27 07:50:59 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 07:55:31 +0100 | [Leary] | (~Leary]@user/Leary/x-0910699) (Ping timeout: 260 seconds) |
2024-03-27 07:57:56 +0100 | acidjnk_new | (~acidjnk@p200300d6e706f453dde8176755f9f4a3.dip0.t-ipconnect.de) |
2024-03-27 08:03:58 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 08:07:44 +0100 | mzg | (mzg@37.221.213.54) |
2024-03-27 08:16:12 +0100 | CiaoSen | (~Jura@2a05:5800:2e6:d500:e6b9:7aff:fe80:3d03) |
2024-03-27 08:16:51 +0100 | [Leary] | (~Leary]@user/Leary/x-0910699) |
2024-03-27 08:21:28 +0100 | Maxdamantus | (~Maxdamant@user/maxdamantus) (Ping timeout: 268 seconds) |
2024-03-27 08:22:44 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) (Quit: marinelli) |
2024-03-27 08:22:45 +0100 | Maxdamantus | (~Maxdamant@user/maxdamantus) |
2024-03-27 08:32:17 +0100 | mima | (~mmh@aftr-62-216-211-133.dynamic.mnet-online.de) |
2024-03-27 08:45:49 +0100 | trev | (~trev@user/trev) (Ping timeout: 268 seconds) |
2024-03-27 08:49:37 +0100 | danza | (~francesco@151.57.49.84) |
2024-03-27 08:55:42 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 08:57:37 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2024-03-27 09:03:59 +0100 | tzh | (~tzh@c-73-164-206-160.hsd1.or.comcast.net) (Quit: zzz) |
2024-03-27 09:06:07 +0100 | <cheater> | how do i remove something from lambdabot that i've put in it using @let ? |
2024-03-27 09:06:13 +0100 | <cheater> | we should have a command like @delet |
2024-03-27 09:09:17 +0100 | <c_wraith> | the only tool to do that is @undefine, which resets L.hs to Pristine.hs |
2024-03-27 09:10:45 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-03-27 09:14:26 +0100 | ski | used to use `@define' for that |
2024-03-27 09:16:45 +0100 | zetef | (~quassel@5.2.182.99) |
2024-03-27 09:17:01 +0100 | <cheater> | we need @delet even if just for the meme of it |
2024-03-27 09:17:35 +0100 | <danza> | too bad that, with an immutable language, it would never spread |
2024-03-27 09:17:49 +0100 | <cheater> | i was just typing: come to think of it... this would be an interesting feature for Haskell |
2024-03-27 09:17:57 +0100 | <cheater> | it's clearly a pure, immutable feature |
2024-03-27 09:18:59 +0100 | <cheater> | the semantics are obvious. delet x in f takes over all the let's from the outside context except x, and runs f in that new context |
2024-03-27 09:19:36 +0100 | <danza> | ^^; |
2024-03-27 09:19:54 +0100 | <cheater> | the proper pronunciation is left as an exercise to the reader |
2024-03-27 09:19:58 +0100 | <c_wraith> | I'm not sure the semantics are obvious. |
2024-03-27 09:20:17 +0100 | <c_wraith> | What if you use it to define a higher-order function and the function passed in closes over the unbound valu? |
2024-03-27 09:20:19 +0100 | <c_wraith> | *value |
2024-03-27 09:20:52 +0100 | gmg | (~user@user/gehmehgeh) |
2024-03-27 09:21:03 +0100 | <danza> | don't feed the joke ... it is still to early in the day ... |
2024-03-27 09:21:04 +0100 | <c_wraith> | I suppose that's just lexical vs dynamic scoping? Well, ok. You could just say "use lexical scoping like everything else" |
2024-03-27 09:21:07 +0100 | <cheater> | is the HOF being defined inside the delet and being passed outside, or is it being defined outside the delet and being passed inside? |
2024-03-27 09:21:23 +0100 | <danza> | *too |
2024-03-27 09:21:51 +0100 | zetef | (~quassel@5.2.182.99) (Remote host closed the connection) |
2024-03-27 09:24:12 +0100 | gmg | (~user@user/gehmehgeh) (Remote host closed the connection) |
2024-03-27 09:25:00 +0100 | gmg | (~user@user/gehmehgeh) |
2024-03-27 09:25:13 +0100 | <cheater> | c_wraith: |
2024-03-27 09:25:16 +0100 | zetef | (~quassel@5.2.182.99) |
2024-03-27 09:26:41 +0100 | oo_miguel | (~Thunderbi@78-11-181-16.static.ip.netia.com.pl) |
2024-03-27 09:28:11 +0100 | triceraptor | (~prodmezha@123.63.203.210) (Ping timeout: 264 seconds) |
2024-03-27 09:29:24 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 09:29:53 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 09:30:35 +0100 | <danza> | cheater: |
2024-03-27 09:32:43 +0100 | <cheater> | well either way it's obvious that in the first case the HOF cannot be passed outside the delet just like it can't be passed outside a let. in the second case, it should work just like with shadowing, eg let one = 1, add1 x = x + one in let one = 2 in add1 10 -- should still result in 11 |
2024-03-27 09:33:55 +0100 | rosco | (~rosco@183.171.110.111) (Ping timeout: 268 seconds) |
2024-03-27 09:36:09 +0100 | <danza> | .O_O. |
2024-03-27 09:36:25 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
2024-03-27 09:40:00 +0100 | mmhat | (~mmh@p200300f1c706a2b6ee086bfffe095315.dip0.t-ipconnect.de) |
2024-03-27 09:40:49 +0100 | emmanuelux | (~emmanuelu@user/emmanuelux) (Quit: au revoir) |
2024-03-27 09:41:55 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) |
2024-03-27 09:47:36 +0100 | <ski> | cheater : the HOF would take a callback as input, and also use `delet'/`forget' in its body, innside of which it'd refer to the callback |
2024-03-27 09:48:33 +0100 | <cheater> | ski: that's the second case. same as shadowing. |
2024-03-27 09:48:55 +0100 | <cheater> | idk about a forget keyword, never used it |
2024-03-27 09:49:07 +0100 | <cheater> | you'd think it would be the opposite to a learn keyword |
2024-03-27 09:49:14 +0100 | <cheater> | but i haven't used that either |
2024-03-27 09:49:29 +0100 | son0p | (~ff@167.0.169.98) |
2024-03-27 09:50:59 +0100 | <ski> | second vs. first case ? |
2024-03-27 09:52:06 +0100 | <cheater> | yes. |
2024-03-27 09:52:29 +0100 | <ski> | case of what ? |
2024-03-27 09:52:33 +0100 | <cheater> | read the conversation between me and c_wraith from 30 minutes ago. |
2024-03-27 09:52:38 +0100 | <cheater> | it's still on the screen |
2024-03-27 09:53:08 +0100 | <cheater> | (it's easier and less messy than pasting it all again in here) |
2024-03-27 09:53:31 +0100 | dhil | (~dhil@2001:8e0:2014:3100:348d:fdf8:7e1e:8e9) |
2024-03-27 09:53:45 +0100 | <ski> | first time i see you mentioning "case" is twenty minutes ago, but it's still not clear to mean what those cases are |
2024-03-27 09:53:45 +0100 | igemnace | (~ian@user/igemnace) (Read error: Connection reset by peer) |
2024-03-27 09:53:52 +0100 | <cheater> | hold up |
2024-03-27 09:55:08 +0100 | <ski> | (btw, in a categorical formulation of predicate logic, existential quantification (`right') is left adjunction of `forget'/`delet', while universal quantification (`forall') is right adjunction of `forget'/`delete') |
2024-03-27 09:56:15 +0100 | zetef | (~quassel@5.2.182.99) (Remote host closed the connection) |
2024-03-27 09:57:01 +0100 | <cheater> | https://i.imgur.com/4FoVLuW.png |
2024-03-27 09:57:34 +0100 | <cheater> | ski: |
2024-03-27 09:58:05 +0100 | <danza> | oh i see the hanging : probably come from your client |
2024-03-27 09:58:15 +0100 | jinsun | Guest3181 |
2024-03-27 09:58:15 +0100 | jinsun_ | (~jinsun@user/jinsun) |
2024-03-27 09:58:16 +0100 | Guest3181 | (~jinsun@user/jinsun) (Killed (tungsten.libera.chat (Nickname regained by services))) |
2024-03-27 09:58:16 +0100 | jinsun_ | jinsun |
2024-03-27 09:58:40 +0100 | <cheater> | i typed s and pressed tab and it typed the rest including the colon character and space, yes |
2024-03-27 09:59:14 +0100 | <cheater> | ski: ok, so you're saying there's a good reason to have delet |
2024-03-27 09:59:43 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 10:00:18 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 10:04:24 +0100 | <ski> | well .. afaiui, the intent was neither of those two situations, but rather something like `let x = ...; myHof callback = ..x..(forget x in ..callback..).. in myHof (..x..)' |
2024-03-27 10:04:47 +0100 | danza | (~francesco@151.57.49.84) (Ping timeout: 260 seconds) |
2024-03-27 10:05:22 +0100 | <cheater> | i don't understand the structure of the code with your ellipses. could you pastebin it without ellipses please? |
2024-03-27 10:05:30 +0100 | <cheater> | use a simple function that adds integers or something |
2024-03-27 10:05:48 +0100 | <Inst> | how would I implement forB_ :: (Traversable t, Applicative f) => (a -> Maybe (f b) ) -> t a -> f () |
2024-03-27 10:06:22 +0100 | <Inst> | actually, would only need foldable |
2024-03-27 10:06:23 +0100 | <ski> | but, yes, the callback `..x..' would still refer to the definition of `x', even when that `..x..' gets substituted for `x' in the body of `myHof' (namely inside the `forget x in ') .. iow, you'd need to either do some renaming, or else push/distribute the `forget x in ' inwards enough, so that it no longer surrounds the `callback' identifier |
2024-03-27 10:06:53 +0100 | <Inst> | well, easier to do it on lists |
2024-03-27 10:07:11 +0100 | <Inst> | forB_ f [] = pure () |
2024-03-27 10:07:49 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 10:07:51 +0100 | <Inst> | forB_ f (x:xs) = case f x of Nothing -> pure (); Just a -> a >> forB_ f xs |
2024-03-27 10:08:33 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 10:08:44 +0100 | <ski> | cheater : "ok, so you're saying there's a good reason to have delet" -- well, yea, at least from the theoretical standpoint. perhaps not as much from a practical one. but it's a common experience with adjunctions that if you take some uninteresting/trivial construction (here `forget x in ') - often even one that you wouldn't even think to consider - then it may have a quite more interesting adjunction (left |
2024-03-27 10:08:51 +0100 | <ski> | or right, or both) |
2024-03-27 10:09:20 +0100 | <cheater> | i don't really know what an adjunction is |
2024-03-27 10:09:31 +0100 | <Inst> | forB_ :: (Foldable t, Applicative f) => (a -> Maybe (f b) ) -> t a -> f () |
2024-03-27 10:09:56 +0100 | <cheater> | without explaining that and pretty much all of category theory, can you give a motivating example as to why delet is related to existential quantification and let is related to forall? |
2024-03-27 10:09:56 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Remote host closed the connection) |
2024-03-27 10:10:20 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-27 10:10:59 +0100 | igemnace | (~ian@user/igemnace) |
2024-03-27 10:11:06 +0100 | <Inst> | forB_ f = foldr (\a k -> case f a of Nothing -> pure (); Just b -> b >> k) (pure ()) |
2024-03-27 10:11:29 +0100 | <Inst> | wondering if this is possible to do as a traversable? |
2024-03-27 10:11:36 +0100 | <Inst> | forB ? |
2024-03-27 10:17:44 +0100 | <ski> | @type \f -> getAp . foldMap (maybe empty Ap . f) |
2024-03-27 10:17:45 +0100 | <lambdabot> | (Foldable t, Monoid a1, Alternative f) => (a2 -> Maybe (f a1)) -> t a2 -> f a1 |
2024-03-27 10:17:49 +0100 | <ski> | @type (getAp .) . foldMap . (maybe empty Ap .) |
2024-03-27 10:17:50 +0100 | <lambdabot> | (Foldable t, Monoid a1, Alternative f) => (a2 -> Maybe (f a1)) -> t a2 -> f a1 |
2024-03-27 10:18:33 +0100 | <ski> | @type \f -> getAp . foldMap (maybe empty (Ap . (() <$)) . f) |
2024-03-27 10:18:35 +0100 | <lambdabot> | (Foldable t, Alternative f) => (a -> Maybe (f b)) -> t a -> f () |
2024-03-27 10:20:18 +0100 | <ski> | cheater : "why delet is related to existential quantification and let is related to forall?" -- no. `delet'/`forget' being adjunction to both (right of existential, and left of universal. `exist x --| forget x --| forall x') |
2024-03-27 10:20:55 +0100 | <ski> | Inst : does that work/help ? |
2024-03-27 10:21:00 +0100 | <cheater> | oh duh right yes sorry i get tiny details wrong sometimes |
2024-03-27 10:21:10 +0100 | <ski> | no worry |
2024-03-27 10:21:11 +0100 | <Inst> | whoa, thanks |
2024-03-27 10:21:20 +0100 | <cheater> | so, for that, can you give some sort of motivating example? |
2024-03-27 10:21:55 +0100 | <Inst> | :t maybe |
2024-03-27 10:21:56 +0100 | <lambdabot> | b -> (a -> b) -> Maybe a -> b |
2024-03-27 10:22:12 +0100 | <ski> | two things being adjunctions of each other (left and right adjunctions to each other) is kinda like two things being inverses of each other .. except these are "approximate" inverses (in the sense of approximating from "above", or from "below") |
2024-03-27 10:22:41 +0100 | <Inst> | traverseB_ is more powerful on the foldable level, though |
2024-03-27 10:23:01 +0100 | <Inst> | since not all applicatives have an alternative instance |
2024-03-27 10:23:42 +0100 | <ski> | if you take some statement/proposition `..x..', that depends on a variable `x' (and perhaps also other variables), then `exists x. ..x..' (as well as `forall x. ..x..') is a statement that no longer depends on the variable `x' (it does not has `x' as a free variable, `x' is locally bound) (but it still depends on the rest of the variables, if any) |
2024-03-27 10:24:36 +0100 | <ski> | `forget x' does the opposite, it takes some statement `...' that does *not* depend on a variable `x', and makes a new statement `forget x in ...', that "pretends" to depend on the variable `x' |
2024-03-27 10:24:59 +0100 | Guest52 | (~Guest52@185.57.29.142) (Quit: Client closed) |
2024-03-27 10:25:15 +0100 | <cheater> | i think delet x should be a compiler error in a place where there is no x defined |
2024-03-27 10:25:51 +0100 | <ski> | (in this adjunction situation, we're talking about statements/propositions, iow expressions having some kind of truth-value, so not general expressions. otherwise `forall' and `exists' wouldn't make sense here) |
2024-03-27 10:26:05 +0100 | <Inst> | btw is foldr even designed correctly? |
2024-03-27 10:26:10 +0100 | <Inst> | I had some convos with JSers about it |
2024-03-27 10:26:17 +0100 | <ski> | yes, you can't use `forget x in ...', unless you have defined `x' somewhere in the scope surrounding this statement |
2024-03-27 10:26:33 +0100 | <Inst> | foldr should be foldr :: b -> (a -> b -> b) -> t a -> b |
2024-03-27 10:26:41 +0100 | <Inst> | or at least such a variant should exist |
2024-03-27 10:27:11 +0100 | <ski> | (all free variables in some expression or statement that you use, must be bound (defined, or at least bound as a parameter or something) in the context surrounding the expression/statement) |
2024-03-27 10:27:23 +0100 | <ski> | Inst : whyfore ? |
2024-03-27 10:28:02 +0100 | <Inst> | the entire point of for is that you can write |
2024-03-27 10:28:15 +0100 | <Inst> | for_ struct $ \u -> ... code |
2024-03-27 10:29:00 +0100 | <Inst> | foldr is irritating because I have to either lambda the function or declare the function in a let or where clause |
2024-03-27 10:29:39 +0100 | <cheater> | you can always use pointless style. |
2024-03-27 10:29:48 +0100 | <ski> | ah, sorry, Inst |
2024-03-27 10:30:04 +0100 | <ski> | @type \f -> getAp . foldMap (maybe (pure mempty) Ap . f) |
2024-03-27 10:30:05 +0100 | <lambdabot> | (Foldable t, Applicative f, Monoid a1) => (a2 -> Maybe (f a1)) -> t a2 -> f a1 |
2024-03-27 10:30:18 +0100 | <ski> | @type (getAp .) . foldMap . (maybe (pure mempty) Ap .) |
2024-03-27 10:30:19 +0100 | <lambdabot> | (Foldable t, Applicative f, Monoid a1) => (a2 -> Maybe (f a1)) -> t a2 -> f a1 |
2024-03-27 10:30:32 +0100 | <Inst> | foldFor :: b -> ( a -> b -> b) -> t a -> b or even foldFor :: b -> t a -> ( a -> b -> b) -> b is better |
2024-03-27 10:30:35 +0100 | <ski> | @type \f -> getAp . foldMap (maybe (pure mempty) (Ap . (() <$)) . f) |
2024-03-27 10:30:36 +0100 | <lambdabot> | (Foldable t, Applicative f) => (a -> Maybe (f b)) -> t a -> f () |
2024-03-27 10:30:39 +0100 | <Inst> | I mean I prefer HOF zoo, and I hate foldr |
2024-03-27 10:30:49 +0100 | <ski> | Inst : sorry, didn't think about the `Alternative' |
2024-03-27 10:31:36 +0100 | <Inst> | the idea of all these weird things is say, you have a newbie, you're trying to do Monkey Haskell to minimize on-ramp, and you just tell them "anything you need for for, you just do with foldr, next question?" |
2024-03-27 10:31:51 +0100 | <Inst> | in this case, foldr isn't the right tool |
2024-03-27 10:32:34 +0100 | <ski> | Inst : i see, you want to put the lambda last, like `Foldable t => t a -> r -> (a -> r -> r) -> r' ? |
2024-03-27 10:32:38 +0100 | <Inst> | ya |
2024-03-27 10:32:42 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection) |
2024-03-27 10:33:07 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) |
2024-03-27 10:33:48 +0100 | <ski> | or do you have a situation where you'd use, or prefer, `Foldable t => r -> (a -> r -> r) -> t a -> r' ? |
2024-03-27 10:33:54 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) |
2024-03-27 10:34:17 +0100 | <ski> | (presumably where the `t a' input is implicitly passed, e.g. if you're in a composition pipeline) |
2024-03-27 10:34:33 +0100 | <Inst> | bleh, you don't need to help me that much |
2024-03-27 10:34:50 +0100 | <Inst> | I hate foldr, just fantasizing about the scenario wherein I have a Chinese Serokell, emphasis on the Chinese |
2024-03-27 10:35:04 +0100 | <ski> | heh, i'm just curious about why you first put the callback before the collection |
2024-03-27 10:35:12 +0100 | <Inst> | enslaving cheap labor in the Harbin office and making the folks working in the Hangzhou office tearing their hair out at the spaghetti code Harbin is putting out |
2024-03-27 10:35:47 +0100 | <Inst> | (Harbin is economically depressed, has a decent comp sci uni in the neighborhood, and it's freaking freezing half the time since it's on the Russian border) |
2024-03-27 10:36:17 +0100 | <Inst> | (Hangzhou is wealthy and has a good standard of living, so it doesn't make sense to use abusive labor practices there, just dangle the poor folks working in Harbin with the prospect of a transfer out to Hangzhou) |
2024-03-27 10:36:39 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) (Remote host closed the connection) |
2024-03-27 10:37:06 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) |
2024-03-27 10:38:07 +0100 | <ski> | anyway, note no `Alternative' in these versions |
2024-03-27 10:40:36 +0100 | danse-nr3 | (~danse@151.57.49.84) |
2024-03-27 10:45:36 +0100 | danse-nr3 | (~danse@151.57.49.84) (Remote host closed the connection) |
2024-03-27 10:47:53 +0100 | <ski> | re argument ordering for `foldr' and `foldl' .. in SML, you have |
2024-03-27 10:48:19 +0100 | <ski> | val foldr : ('a * 'b -> 'b) -> 'b -> 'a list -> 'b |
2024-03-27 10:48:22 +0100 | <ski> | val foldl : ('a * 'b -> 'b) -> 'b -> 'a list -> 'b |
2024-03-27 10:48:51 +0100 | mikko | (~mikko@user/mikko) (Ping timeout: 268 seconds) |
2024-03-27 10:49:08 +0100 | <ski> | (both having the same type. also note that the callback is uncurried/tupled, probably because infix operators, turned into functions with `op', are tupled) |
2024-03-27 10:50:02 +0100 | <ski> | this means that you can just swap out `foldr' for `foldl', or vice versa .. but obviously you'll then process the elements in opposite order |
2024-03-27 10:50:19 +0100 | <ski> | - foldl (op ::) [] [2,3,5,7]; |
2024-03-27 10:50:31 +0100 | <ski> | val it = [7,5,3,2] : int list |
2024-03-27 10:50:37 +0100 | <ski> | - foldr (op ::) [] [2,3,5,7]; |
2024-03-27 10:50:39 +0100 | danse-nr3 | (~danse@151.57.49.84) |
2024-03-27 10:50:42 +0100 | <ski> | val it = [2,3,5,7] : int list |
2024-03-27 10:51:13 +0100 | <ski> | in Haskell |
2024-03-27 10:51:23 +0100 | <ski> | > foldr (:) [] [2,3,5,7] |
2024-03-27 10:51:24 +0100 | <lambdabot> | [2,3,5,7] |
2024-03-27 10:51:30 +0100 | <ski> | > foldl (flip (:)) [] [2,3,5,7] |
2024-03-27 10:51:32 +0100 | <lambdabot> | [7,5,3,2] |
2024-03-27 10:51:35 +0100 | <ski> | because |
2024-03-27 10:51:52 +0100 | <ski> | foldr :: (a -> b -> b) -> b -> [a] -> b |
2024-03-27 10:52:02 +0100 | <ski> | foldl :: (b -> a -> b) -> b -> [a] -> b |
2024-03-27 10:52:13 +0100 | <ski> | otoh, in OCaml, you have |
2024-03-27 10:52:43 +0100 | <ski> | val fold_right : ('a -> 'b -> 'b) -> ('a list -> 'b -> 'b) |
2024-03-27 10:53:03 +0100 | kuribas | (~user@ip-188-118-57-242.reverse.destiny.be) |
2024-03-27 10:53:13 +0100 | <ski> | val fold_left : ('b -> 'a -> 'b) -> ('b -> 'a list -> 'b) |
2024-03-27 10:53:24 +0100 | <ski> | (curried callbacks, this time) |
2024-03-27 10:53:56 +0100 | <ski> | also note that one takes the list last, the other next to last. this is to line up with the callback, so that you can do |
2024-03-27 10:54:34 +0100 | <enikar> | I wonder why they are parentheses around ('a list -> 'b -> 'b) in ocaml ? |
2024-03-27 10:54:49 +0100 | <ski> | # fold_right o fold_right;; |
2024-03-27 10:55:03 +0100 | <ski> | - : ('a -> 'b -> 'b) -> ('a list list -> 'b -> 'b) = <fun> |
2024-03-27 10:55:08 +0100 | <ski> | # fold_left o fold_left ;; |
2024-03-27 10:55:20 +0100 | <ski> | - : ('b -> 'a -> 'b) -> ('b -> 'a list list -> 'b) = <fun> |
2024-03-27 10:55:29 +0100 | <ski> | enikar : i added them in, for emphasis |
2024-03-27 10:55:46 +0100 | <ski> | while, in Haskell, you have to go |
2024-03-27 10:55:53 +0100 | <ski> | @type foldl . foldl |
2024-03-27 10:55:54 +0100 | <lambdabot> | (Foldable t1, Foldable t2) => (b -> a -> b) -> b -> t1 (t2 a) -> b |
2024-03-27 10:55:56 +0100 | <ski> | but |
2024-03-27 10:56:07 +0100 | <ski> | @type foldr . flip . foldr |
2024-03-27 10:56:08 +0100 | <lambdabot> | (Foldable t1, Foldable t2) => (a -> b -> b) -> b -> t1 (t2 a) -> b |
2024-03-27 10:56:12 +0100 | <ski> | or at least |
2024-03-27 10:56:15 +0100 | <ski> | @type foldr . flip . foldr . flip |
2024-03-27 10:56:16 +0100 | <ski> | or |
2024-03-27 10:56:16 +0100 | <lambdabot> | (Foldable t1, Foldable t2) => (b -> a -> b) -> b -> t1 (t2 a) -> b |
2024-03-27 10:56:21 +0100 | <ski> | @type flip . foldr . flip . foldr |
2024-03-27 10:56:22 +0100 | <lambdabot> | (Foldable t1, Foldable t2) => (a -> c -> c) -> t1 (t2 a) -> c -> c |
2024-03-27 10:56:33 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 268 seconds) |
2024-03-27 10:56:55 +0100 | aku_ | (~aku@65.108.245.241) (Remote host closed the connection) |
2024-03-27 10:57:22 +0100 | <ski> | when writing type signatures, i often add in such redundant brackets, to emphasize patterns like that |
2024-03-27 10:57:33 +0100 | <ski> | map :: ( a -> b ) |
2024-03-27 10:57:38 +0100 | <enikar> | ski: ok, I understood |
2024-03-27 10:57:40 +0100 | <ski> | -> ([a] -> [b]) |
2024-03-27 10:57:59 +0100 | aku | (~aku@65.108.245.241) |
2024-03-27 10:58:22 +0100 | <ski> | (making it more obvious when it can be a good idea to partially apply the function, often composing it with itself) |
2024-03-27 10:58:27 +0100 | <ski> | @type mapM . mapM |
2024-03-27 10:58:28 +0100 | <lambdabot> | (Monad m, Traversable t1, Traversable t2) => (a -> m b) -> t1 (t2 a) -> m (t1 (t2 b)) |
2024-03-27 10:58:33 +0100 | <ski> | @type zipWith . zipWith |
2024-03-27 10:58:34 +0100 | <lambdabot> | (a -> b -> c) -> [[a]] -> [[b]] -> [[c]] |
2024-03-27 10:58:36 +0100 | <ski> | &c. |
2024-03-27 11:03:47 +0100 | Lycurgus | (~georg@user/Lycurgus) (Quit: leaving) |
2024-03-27 11:06:25 +0100 | xff0x | (~xff0x@125x103x176x34.ap125.ftth.ucom.ne.jp) (Ping timeout: 268 seconds) |
2024-03-27 11:25:55 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 256 seconds) |
2024-03-27 11:26:02 +0100 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) |
2024-03-27 11:27:24 +0100 | Lord_of_Life_ | Lord_of_Life |
2024-03-27 11:31:39 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Read error: Connection reset by peer) |
2024-03-27 11:35:24 +0100 | ft | (~ft@p508db238.dip0.t-ipconnect.de) (Quit: leaving) |
2024-03-27 11:41:42 +0100 | <Inst> | i'm probably going too far in this direction, i.e, it's really easy and trivial to abuse Turing-Church to turn Haskell into Python |
2024-03-27 11:42:12 +0100 | <Inst> | Church-Turing |
2024-03-27 11:42:24 +0100 | AlexZenon | (~alzenon@178.34.163.255) (Ping timeout: 252 seconds) |
2024-03-27 11:42:58 +0100 | AlexNoo | (~AlexNoo@178.34.163.255) (Ping timeout: 246 seconds) |
2024-03-27 11:43:06 +0100 | <Inst> | And in that direction. Julia just has better speed and a more pragmatic philosophy, what's the use of going in that direction if Julia will just have you beat in terms of ergonomics? |
2024-03-27 11:43:13 +0100 | <Inst> | as well as speed |
2024-03-27 11:48:51 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-03-27 11:53:19 +0100 | <ski> | how's C-T thesis involved ? |
2024-03-27 11:57:14 +0100 | <Inst> | in the sense that you can make Haskell fake being an imperative language quite well |
2024-03-27 11:57:15 +0100 | <kuribas> | I'd love to see better data science in haskell. |
2024-03-27 11:57:31 +0100 | <kuribas> | There are a lot of interesting libraries, but it is very fragmented. |
2024-03-27 11:57:47 +0100 | <Inst> | all you really need to dumb down haskell would be temporary bindings, do notation, and foldr abuse |
2024-03-27 11:58:09 +0100 | <kuribas> | Boring haskell is already a very nice language. |
2024-03-27 11:58:39 +0100 | <kuribas> | No need for monad stacks, just "Env -> IO a" is good enough for must stuff. |
2024-03-27 11:59:02 +0100 | <ski> | C-T thesis states that every (computable) function is algorithmic (iow can be coded as a finite program, or equivalently, be encoded as a single natural number) |
2024-03-27 11:59:23 +0100 | <ski> | but i guess maybe you had something else in mind, with "Church-Turing" ? |
2024-03-27 12:00:04 +0100 | ezzieyguywuf | (~Unknown@user/ezzieyguywuf) (Ping timeout: 268 seconds) |
2024-03-27 12:00:46 +0100 | <Inst> | I mean in the sense that imperative programming and functional programming, at the lowest levels, are equivalent, and it's not that hard to turn Haskell into an imperative language |
2024-03-27 12:01:26 +0100 | <Inst> | it's probably a parlor game at this point |
2024-03-27 12:01:44 +0100 | mikko | (~mikko@user/mikko) |
2024-03-27 12:03:08 +0100 | xff0x | (~xff0x@2405:6580:b080:900:294d:27b0:2606:85c) |
2024-03-27 12:03:24 +0100 | <ski> | oh, so just the equivalence between Church's and Turing's approaches to formalisms for computation |
2024-03-27 12:05:36 +0100 | zetef | (~quassel@5.2.182.99) |
2024-03-27 12:06:50 +0100 | ezzieyguywuf | (~Unknown@user/ezzieyguywuf) |
2024-03-27 12:08:05 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 268 seconds) |
2024-03-27 12:10:52 +0100 | CiaoSen | (~Jura@2a05:5800:2e6:d500:e6b9:7aff:fe80:3d03) (Ping timeout: 268 seconds) |
2024-03-27 12:10:59 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 272 seconds) |
2024-03-27 12:14:23 +0100 | destituion | (~destituio@85.221.111.174) (Ping timeout: 264 seconds) |
2024-03-27 12:14:38 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-03-27 12:14:44 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 12:18:40 +0100 | vpark45 | (~vincent@114.205.107.110) |
2024-03-27 12:23:27 +0100 | destituion | (~destituio@2a02:2121:655:c95b:ba41:7897:d01f:5f0f) |
2024-03-27 12:23:42 +0100 | vpark45 | (~vincent@114.205.107.110) (Quit: leaving) |
2024-03-27 12:24:20 +0100 | __monty__ | (~toonn@user/toonn) |
2024-03-27 12:27:57 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
2024-03-27 12:29:03 +0100 | mima | (~mmh@aftr-62-216-211-133.dynamic.mnet-online.de) (Quit: leaving) |
2024-03-27 12:32:17 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) (Remote host closed the connection) |
2024-03-27 12:32:19 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection) |
2024-03-27 12:32:39 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) |
2024-03-27 12:32:44 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) |
2024-03-27 12:39:26 +0100 | sam113101 | (~sam@24.157.253.231) (Remote host closed the connection) |
2024-03-27 12:39:50 +0100 | sam113101 | (~sam@24.157.253.231) |
2024-03-27 12:40:40 +0100 | cayley5 | (~cayley5@user/phileasfogg) (Quit: Ping timeout (120 seconds)) |
2024-03-27 12:40:59 +0100 | cayley5 | (~cayley5@user/phileasfogg) |
2024-03-27 12:41:01 +0100 | michalz | (~michalz@185.246.207.218) (Read error: Connection reset by peer) |
2024-03-27 12:41:02 +0100 | mei | (~mei@user/mei) (Remote host closed the connection) |
2024-03-27 12:41:18 +0100 | michalz | (~michalz@185.246.207.205) |
2024-03-27 12:41:23 +0100 | m1dnight | (~christoph@82.146.125.185) (Ping timeout: 268 seconds) |
2024-03-27 12:41:25 +0100 | henrytill | (e0180937c3@2a03:6000:1812:100::e8c) (Ping timeout: 256 seconds) |
2024-03-27 12:41:41 +0100 | nschoe | (~nschoe@82-65-202-30.subs.proxad.net) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-03-27 12:41:59 +0100 | nschoe | (~nschoe@2a01:e0a:8e:a190:8ccb:4735:e31a:8adf) |
2024-03-27 12:41:59 +0100 | conjunctive | (sid433686@id-433686.helmsley.irccloud.com) (Ping timeout: 256 seconds) |
2024-03-27 12:43:23 +0100 | mei | (~mei@user/mei) |
2024-03-27 12:44:22 +0100 | conjunctive | (sid433686@id-433686.helmsley.irccloud.com) |
2024-03-27 12:45:27 +0100 | henrytill | (e0180937c3@2a03:6000:1812:100::e8c) |
2024-03-27 12:46:48 +0100 | gmg | (~user@user/gehmehgeh) (Remote host closed the connection) |
2024-03-27 12:47:38 +0100 | gmg | (~user@user/gehmehgeh) |
2024-03-27 12:49:55 +0100 | danse-nr3 | (~danse@151.57.49.84) (Read error: Connection reset by peer) |
2024-03-27 12:50:49 +0100 | danse-nr3 | (~danse@151.43.82.11) |
2024-03-27 12:53:25 +0100 | fedorafan | (~fedorafan@user/fedorafan) (Ping timeout: 272 seconds) |
2024-03-27 12:56:19 +0100 | <cheater> | what fold will take xs = [x1, x2, ... xn] and give me x1 `f` (x2 `f` ... (xn-1 `f` xn) ... ) ? |
2024-03-27 12:56:59 +0100 | <tomsmeding> | :t foldr1 |
2024-03-27 12:57:00 +0100 | <lambdabot> | Foldable t => (a -> a -> a) -> t a -> a |
2024-03-27 12:57:18 +0100 | <cheater> | no |
2024-03-27 12:57:21 +0100 | <cheater> | doesn't look like it |
2024-03-27 12:57:36 +0100 | <int-e> | > foldr1 f [x,y,z] |
2024-03-27 12:57:37 +0100 | <lambdabot> | f x (f y z) |
2024-03-27 12:57:47 +0100 | <cheater> | hmm oh wait |
2024-03-27 12:57:54 +0100 | <cheater> | you're right ty |
2024-03-27 12:58:01 +0100 | yin | (~yin@user/zero) |
2024-03-27 12:58:55 +0100 | danse-nr3 | (~danse@151.43.82.11) (Ping timeout: 246 seconds) |
2024-03-27 13:03:48 +0100 | ezzieyguywuf | (~Unknown@user/ezzieyguywuf) (Ping timeout: 252 seconds) |
2024-03-27 13:04:24 +0100 | m1dnight | (~christoph@82.146.125.185) |
2024-03-27 13:05:21 +0100 | ezzieyguywuf | (~Unknown@user/ezzieyguywuf) |
2024-03-27 13:10:29 +0100 | fr33domlover | (~fr33domlo@towards.vision) (Quit: The Lounge - https://thelounge.chat) |
2024-03-27 13:14:04 +0100 | fedorafan | (~fedorafan@user/fedorafan) |
2024-03-27 13:14:39 +0100 | fr33domlover | (~fr33domlo@towards.vision) |
2024-03-27 13:19:17 +0100 | <cheater> | had to write a total wrapper around it |
2024-03-27 13:19:22 +0100 | <cheater> | but it's fine |
2024-03-27 13:19:41 +0100 | CiaoSen | (~Jura@2a05:5800:2e6:d500:e6b9:7aff:fe80:3d03) |
2024-03-27 13:24:51 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 13:27:54 +0100 | danse-nr3 | (~danse@151.57.43.153) |
2024-03-27 13:32:45 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Quit: ChaiTRex) |
2024-03-27 13:39:30 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 13:40:35 +0100 | omegatron | (~some@user/omegatron) |
2024-03-27 13:46:37 +0100 | actioninja | (~actioninj@user/actioninja) |
2024-03-27 13:50:28 +0100 | akegalj | (~akegalj@141-136-184-96.dsl.iskon.hr) |
2024-03-27 14:03:49 +0100 | trev | (~trev@user/trev) (Quit: trev) |
2024-03-27 14:07:24 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 14:08:38 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) (Remote host closed the connection) |
2024-03-27 14:08:58 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) |
2024-03-27 14:16:53 +0100 | mzg | (mzg@37.221.213.54) (Quit: Lost terminal) |
2024-03-27 14:17:01 +0100 | <haskellbridge> | <eldritchcookie> do internal libraries get compiled even if my main library doesn't depend on the internal libraries and i don't specifically request for it? |
2024-03-27 14:17:16 +0100 | trev | (~trev@user/trev) |
2024-03-27 14:20:42 +0100 | mzg | (mzg@abusers.hu) |
2024-03-27 14:22:31 +0100 | mmhat | (~mmh@p200300f1c706a2b6ee086bfffe095315.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
2024-03-27 14:24:43 +0100 | yin | (~yin@user/zero) (Quit: leaving) |
2024-03-27 14:25:22 +0100 | yin | (~yin@user/zero) |
2024-03-27 14:31:54 +0100 | zetef | (~quassel@5.2.182.99) (Remote host closed the connection) |
2024-03-27 14:34:37 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) |
2024-03-27 14:39:12 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) (Ping timeout: 256 seconds) |
2024-03-27 14:41:24 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2024-03-27 14:49:35 +0100 | triceraptor | (~prodmezha@123.63.203.210) |
2024-03-27 14:49:51 +0100 | Lycurgus | (~georg@li1192-118.members.linode.com) |
2024-03-27 14:49:52 +0100 | Lycurgus | (~georg@li1192-118.members.linode.com) (Changing host) |
2024-03-27 14:49:52 +0100 | Lycurgus | (~georg@user/Lycurgus) |
2024-03-27 14:50:32 +0100 | triceraptor | (~prodmezha@123.63.203.210) (Remote host closed the connection) |
2024-03-27 14:50:48 +0100 | hallucinagen | (~prodmezha@123.63.203.210) |
2024-03-27 14:51:15 +0100 | ystael | (~ystael@user/ystael) |
2024-03-27 14:51:49 +0100 | trev | (~trev@user/trev) (Quit: trev) |
2024-03-27 15:03:32 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) |
2024-03-27 15:08:09 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) (Ping timeout: 268 seconds) |
2024-03-27 15:15:28 +0100 | <mesaoptimizer> | Sandy Maguire has two books focused on Haskell: _Thinking in Types_ and _Algebra-Driven Design_. Does the latter supersede the former? Do you need to read the former to read the latter? |
2024-03-27 15:20:08 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) |
2024-03-27 15:23:10 +0100 | califax | (~califax@user/califx) (Ping timeout: 260 seconds) |
2024-03-27 15:23:29 +0100 | trev | (~trev@user/trev) |
2024-03-27 15:24:02 +0100 | Lycurgus | (~georg@user/Lycurgus) (Quit: leaving) |
2024-03-27 15:38:37 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-03-27 15:46:38 +0100 | <c_wraith> | They're pretty independent |
2024-03-27 15:47:24 +0100 | trev | (~trev@user/trev) (Quit: trev) |
2024-03-27 15:47:42 +0100 | trev | (~trev@user/trev) |
2024-03-27 15:47:46 +0100 | <c_wraith> | Not completely, because Algebra-Driven design does talk a lot about precise domain types. But they have different focuses and goals. |
2024-03-27 15:48:15 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 15:49:15 +0100 | trev | (~trev@user/trev) (Client Quit) |
2024-03-27 15:50:01 +0100 | trev | (~trev@user/trev) |
2024-03-27 15:52:52 +0100 | adanwan_ | (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection) |
2024-03-27 15:53:13 +0100 | adanwan | (~adanwan@gateway/tor-sasl/adanwan) |
2024-03-27 15:54:37 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
2024-03-27 15:55:11 +0100 | califax | (~califax@user/califx) |
2024-03-27 15:55:26 +0100 | michalz | (~michalz@185.246.207.205) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-03-27 15:58:26 +0100 | michalz | (~michalz@185.246.207.205) |
2024-03-27 16:13:31 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) (Ping timeout: 268 seconds) |
2024-03-27 16:22:46 +0100 | danse-nr3 | (~danse@151.57.43.153) (Ping timeout: 268 seconds) |
2024-03-27 16:26:57 +0100 | shapr | (~user@c-24-218-186-89.hsd1.ma.comcast.net) |
2024-03-27 16:31:00 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-03-27 16:42:35 +0100 | hallucinagen | (~prodmezha@123.63.203.210) (Ping timeout: 264 seconds) |
2024-03-27 16:43:58 +0100 | danse-nr3 | (~danse@151.57.43.153) |
2024-03-27 16:45:10 +0100 | <mesaoptimizer> | sweet, thank you |
2024-03-27 16:49:54 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Ping timeout: 268 seconds) |
2024-03-27 16:50:40 +0100 | ars23 | (~ars23@79.114.26.206) |
2024-03-27 16:50:59 +0100 | ars23 | (~ars23@79.114.26.206) (Changing host) |
2024-03-27 16:50:59 +0100 | ars23 | (~ars23@user/ars23) |
2024-03-27 16:51:08 +0100 | CiaoSen | (~Jura@2a05:5800:2e6:d500:e6b9:7aff:fe80:3d03) (Ping timeout: 268 seconds) |
2024-03-27 16:52:56 +0100 | ars23 | (~ars23@user/ars23) (Client Quit) |
2024-03-27 16:56:19 +0100 | lovasko | (~lovasko@178.197.161.134) |
2024-03-27 16:56:49 +0100 | lovasko | (~lovasko@178.197.161.134) (Client Quit) |
2024-03-27 16:57:39 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) |
2024-03-27 16:57:48 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:55ab:e185:7f81:54a4) (Client Quit) |
2024-03-27 16:59:20 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 17:01:18 +0100 | hallucinagen | (~prodmezha@123.63.203.210) |
2024-03-27 17:03:29 +0100 | ars23 | (~ars23@79.114.26.206) |
2024-03-27 17:03:40 +0100 | ars23 | (~ars23@79.114.26.206) (Changing host) |
2024-03-27 17:03:40 +0100 | ars23 | (~ars23@user/ars23) |
2024-03-27 17:04:23 +0100 | ania123 | (~ania123@94-43-231-47.dsl.utg.ge) |
2024-03-27 17:12:23 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 17:14:33 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 256 seconds) |
2024-03-27 17:19:38 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 17:21:47 +0100 | <c_wraith> | On a scale of "why?" to "what's wrong with you?", how bad is it to execute cabal clean from inside a program being run with cabal run? |
2024-03-27 17:23:16 +0100 | <danse-nr3> | no i mean it is good you are helping cabal devs with such interesting corner cases |
2024-03-27 17:23:36 +0100 | tzh | (~tzh@c-73-164-206-160.hsd1.or.comcast.net) |
2024-03-27 17:26:10 +0100 | <c_wraith> | I'm pretty sure it can't even work on windows |
2024-03-27 17:26:28 +0100 | <c_wraith> | since windows locks the file associated with running executables. |
2024-03-27 17:26:46 +0100 | <c_wraith> | On linux it might accidentally work. |
2024-03-27 17:26:51 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 255 seconds) |
2024-03-27 17:27:38 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 17:29:22 +0100 | danse-nr3 | (~danse@151.57.43.153) (Ping timeout: 268 seconds) |
2024-03-27 17:29:52 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 17:29:55 +0100 | danse-nr3 | (~danse@151.57.89.156) |
2024-03-27 17:31:26 +0100 | rvalue- | (~rvalue@user/rvalue) |
2024-03-27 17:32:45 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 252 seconds) |
2024-03-27 17:33:08 +0100 | harveypwca | (~harveypwc@2601:246:c200:2740:15b6:f225:14ff:9821) (Quit: Leaving) |
2024-03-27 17:35:24 +0100 | rvalue- | rvalue |
2024-03-27 17:37:17 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Quit: WeeChat 4.1.2) |
2024-03-27 17:37:59 +0100 | lovasko | (~lovasko@213.208.157.36) |
2024-03-27 17:38:52 +0100 | danse-nr3 | (~danse@151.57.89.156) (Quit: Leaving) |
2024-03-27 17:39:16 +0100 | danse-nr3 | (~danse-nr3@151.57.89.156) |
2024-03-27 17:39:54 +0100 | <lovasko> | How would I go about writing a Storable instance for a type that contains a MutableByteArray#? Given a pinned array, I can write the poke function simply by getting the Addr# of the byte array and wrapping it with the Ptr constructor. But how do I implement the peek function? |
2024-03-27 17:40:28 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 268 seconds) |
2024-03-27 17:43:55 +0100 | <c_wraith> | Does the C side contain an arbitrary pointer that you want to make into a MutableByteArray? |
2024-03-27 17:44:02 +0100 | <c_wraith> | Because... yeah, that's not going to work. |
2024-03-27 17:44:26 +0100 | econo_ | (uid147250@id-147250.tinside.irccloud.com) |
2024-03-27 17:44:54 +0100 | <cheater> | i have a bunch of values, each of which has a different type - v1 :: T1, v2 :: T2, v3 :: T3, and so on. and i have a value z which has a type that is a type level list of '[T0]. I have a function called + which can take a value that's of type '[Tm...Tn] and a value that's of type Tk and produce a value of type '[Tm...Tn, Tk]. I am currently adding all these values by doing z + v1 + v2 + ... . how can i write a fold that works with that sort of setup? |
2024-03-27 17:45:13 +0100 | ph88 | (~ph88@ip5b403f30.dynamic.kabel-deutschland.de) |
2024-03-27 17:46:28 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 17:46:30 +0100 | <c_wraith> | cheater: seems difficult unless you involve existential wrapping. In which case it seems difficult to work with the result. |
2024-03-27 17:47:06 +0100 | <cheater> | idk what that means |
2024-03-27 17:47:12 +0100 | <cheater> | hmm |
2024-03-27 17:47:29 +0100 | <lovasko> | c_wraith : it is in the context of a recvmsg syscall, where I have an already created MutableByteArray# and I want the syscall to write into it |
2024-03-27 17:48:32 +0100 | ph88 | (~ph88@ip5b403f30.dynamic.kabel-deutschland.de) (Remote host closed the connection) |
2024-03-27 17:48:36 +0100 | <c_wraith> | lovasko: ah, then it's possible, but Storable isn't the interface to do it. It doesn't let you depend on additional information like you'd need to. |
2024-03-27 17:49:05 +0100 | <lovasko> | wouldn't an FFI call require a Storable instance for anything it is passing in-between the boundaries? |
2024-03-27 17:49:31 +0100 | Square | (~Square4@user/square) |
2024-03-27 17:49:53 +0100 | <c_wraith> | Yes, but you could do the marshalling to/from Ptr with your own code, and only require the FFI do work with it. |
2024-03-27 17:49:59 +0100 | rvalue- | (~rvalue@user/rvalue) |
2024-03-27 17:50:32 +0100 | <lovasko> | so I would prepare the structure with the Ptr of the existing MBA# |
2024-03-27 17:50:42 +0100 | ph88 | (~ph88@ip5b403f30.dynamic.kabel-deutschland.de) |
2024-03-27 17:50:48 +0100 | <lovasko> | through mutableByteArrayContents# |
2024-03-27 17:50:59 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 264 seconds) |
2024-03-27 17:51:06 +0100 | <c_wraith> | Depends on exactly the workflow you want. |
2024-03-27 17:51:13 +0100 | igemnace | (~ian@user/igemnace) (Read error: Connection reset by peer) |
2024-03-27 17:51:23 +0100 | <c_wraith> | But the main thing is that you'd have to do more work yourself, and leave less to the FFI |
2024-03-27 17:52:22 +0100 | <lovasko> | so my "mapping structure", in this case an IOVector (equivalent of struct iovec) would contain a "Ptr Word8" or something like that instead of the MBA# instance |
2024-03-27 17:52:22 +0100 | mei | (~mei@user/mei) (Remote host closed the connection) |
2024-03-27 17:52:54 +0100 | <lovasko> | and I should pass that to FFI, because it is Storable, but then, because it points to the same memory, I can start using the MBA# as if it contains the data |
2024-03-27 17:53:47 +0100 | rvalue- | rvalue |
2024-03-27 17:54:19 +0100 | <c_wraith> | when doing this sort of thing, also remember to keep track of what heap data was allocated on. You don't want memory leaking because you're trying to free stuff on the wrong heap. |
2024-03-27 17:54:46 +0100 | mei | (~mei@user/mei) |
2024-03-27 17:55:18 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) (Ping timeout: 260 seconds) |
2024-03-27 17:55:23 +0100 | <lovasko> | could you point me more directly to the heap issue? I expect that the MBA# is located on its own heap, and then the pointer is created through some form of "alloca" call |
2024-03-27 17:57:19 +0100 | <c_wraith> | More precisely, it's allocated on the GHC heap. If you always do allocating on the GHC heap, great. But if you ever end up allocating something on the C heap, you need to free it from the C heap. |
2024-03-27 17:57:53 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) |
2024-03-27 17:58:02 +0100 | rvalue- | (~rvalue@user/rvalue) |
2024-03-27 17:58:27 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 260 seconds) |
2024-03-27 18:01:52 +0100 | rvalue- | rvalue |
2024-03-27 18:05:08 +0100 | hallucinagen | (~prodmezha@123.63.203.210) (Quit: Leaving) |
2024-03-27 18:06:41 +0100 | tv | (~tv@user/tv) (Ping timeout: 245 seconds) |
2024-03-27 18:08:36 +0100 | ubert | (~Thunderbi@2a02:8109:ab8a:5a00:8aa0:2a1c:7c77:360a) (Quit: ubert) |
2024-03-27 18:08:55 +0100 | igemnace | (~ian@user/igemnace) |
2024-03-27 18:09:51 +0100 | a51 | (a51@gateway/vpn/protonvpn/a51) |
2024-03-27 18:11:42 +0100 | danse-nr3 | (~danse-nr3@151.57.89.156) (Ping timeout: 256 seconds) |
2024-03-27 18:12:41 +0100 | kuribas | (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 27.1)) |
2024-03-27 18:13:02 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) (Ping timeout: 260 seconds) |
2024-03-27 18:14:43 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) |
2024-03-27 18:18:46 +0100 | igemnace | (~ian@user/igemnace) (Quit: WeeChat 4.2.1) |
2024-03-27 18:20:17 +0100 | lovasko | (~lovasko@213.208.157.36) (Quit: Client closed) |
2024-03-27 18:21:28 +0100 | tv | (~tv@user/tv) |
2024-03-27 18:21:47 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 268 seconds) |
2024-03-27 18:29:35 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 18:36:54 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) (Remote host closed the connection) |
2024-03-27 18:37:16 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) |
2024-03-27 18:37:19 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 272 seconds) |
2024-03-27 18:38:23 +0100 | ars23 | (~ars23@user/ars23) (Ping timeout: 264 seconds) |
2024-03-27 18:38:59 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 18:40:00 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 18:43:47 +0100 | dcoutts_ | (~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) (Ping timeout: 264 seconds) |
2024-03-27 18:44:59 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 264 seconds) |
2024-03-27 18:47:13 +0100 | ars23 | (~ars23@79.114.26.206) |
2024-03-27 18:47:36 +0100 | ars23 | Guest1680 |
2024-03-27 18:48:19 +0100 | danse-nr3 | (~danse-nr3@151.57.89.156) |
2024-03-27 18:52:50 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 18:57:59 +0100 | <cheater> | doing things on the cheap usually ends up costing more in the long run |
2024-03-27 19:02:29 +0100 | sawilagar | (~sawilagar@user/sawilagar) |
2024-03-27 19:03:09 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 19:03:43 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 268 seconds) |
2024-03-27 19:03:44 +0100 | sawilagar | (~sawilagar@user/sawilagar) (Client Quit) |
2024-03-27 19:07:18 +0100 | sawilagar | (~sawilagar@user/sawilagar) |
2024-03-27 19:15:05 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2024-03-27 19:24:37 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2024-03-27 19:26:04 +0100 | dcoutts_ | (~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) |
2024-03-27 19:33:26 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 19:33:39 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 260 seconds) |
2024-03-27 19:34:48 +0100 | ania123 | (~ania123@94-43-231-47.dsl.utg.ge) (Quit: Client closed) |
2024-03-27 19:37:58 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) (Quit: marinelli) |
2024-03-27 19:38:42 +0100 | danse-nr3 | (~danse-nr3@151.57.89.156) (Ping timeout: 255 seconds) |
2024-03-27 19:40:21 +0100 | rvalue | (~rvalue@user/rvalue) (Ping timeout: 252 seconds) |
2024-03-27 19:40:54 +0100 | Square2 | (~Square@user/square) |
2024-03-27 19:45:15 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 19:51:15 +0100 | y04nn | (~username@2a03:1b20:8:f011::e10d) |
2024-03-27 20:05:22 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) (Remote host closed the connection) |
2024-03-27 20:05:36 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) |
2024-03-27 20:06:19 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) (Remote host closed the connection) |
2024-03-27 20:06:32 +0100 | a51 | (a51@gateway/vpn/protonvpn/a51) (Ping timeout: 260 seconds) |
2024-03-27 20:08:08 +0100 | a51 | (~a51@modemcable048.127-56-74.mc.videotron.ca) |
2024-03-27 20:10:30 +0100 | ft | (~ft@p508db238.dip0.t-ipconnect.de) |
2024-03-27 20:12:52 +0100 | r5c4571lh01987 | (rscastilho@179.221.142.47) |
2024-03-27 20:13:15 +0100 | infinity0 | (~infinity0@pwned.gg) (Killed (zirconium.libera.chat (Nickname regained by services))) |
2024-03-27 20:16:53 +0100 | infinity0 | (~infinity0@pwned.gg) |
2024-03-27 20:20:04 +0100 | r5c4571lh01987 | (rscastilho@179.221.142.47) (Remote host closed the connection) |
2024-03-27 20:20:48 +0100 | wryishly | (~wryish@2605:4c40:119:efa3:0:727d:19eb:1) (Quit: %blank%) |
2024-03-27 20:21:00 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
2024-03-27 20:21:04 +0100 | wryish | (~wryish@2605:4c40:119:efa3:0:727d:19eb:1) |
2024-03-27 20:21:41 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2024-03-27 20:23:51 +0100 | a51 | (~a51@modemcable048.127-56-74.mc.videotron.ca) (Quit: WeeChat 4.2.1) |
2024-03-27 20:30:40 +0100 | Square | (~Square4@user/square) (Ping timeout: 268 seconds) |
2024-03-27 20:33:09 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) |
2024-03-27 20:36:25 +0100 | dhil | (~dhil@2001:8e0:2014:3100:348d:fdf8:7e1e:8e9) (Quit: Leaving) |
2024-03-27 20:36:41 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
2024-03-27 20:37:17 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) (Ping timeout: 240 seconds) |
2024-03-27 20:37:34 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 20:39:53 +0100 | omegatron | (~some@user/omegatron) (Quit: Power is a curious thing. It can be contained, hidden, locked away, and yet it always breaks free.) |
2024-03-27 20:41:54 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
2024-03-27 20:42:21 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2024-03-27 20:43:53 +0100 | <energizer> | what terms describe a function where the return type is the same as the argument type? |
2024-03-27 20:45:52 +0100 | <geekosaur> | endofunction |
2024-03-27 20:46:43 +0100 | <ncf> | or endomorphism |
2024-03-27 20:46:53 +0100 | dcoutts_ | (~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) (Ping timeout: 252 seconds) |
2024-03-27 20:49:53 +0100 | <tomsmeding> | % :i Endo |
2024-03-27 20:49:53 +0100 | <yahb2> | <interactive>:1:1: error: Not in scope: ‘Endo’ |
2024-03-27 20:49:55 +0100 | <tomsmeding> | % :i Data.Monoid.Endo |
2024-03-27 20:49:55 +0100 | <yahb2> | type base-4.16.4.0:Data.Semigroup.Internal.Endo :: * -> * ; newtype base-4.16.4.0:Data.Semigroup.Internal.Endo a ; = base-4.16.4.0:Data.Semigroup.Internal.Endo {base-4.16.4.0:Data.Semigroup.Inter... |
2024-03-27 20:50:03 +0100 | <tomsmeding> | % :m +Data.Monoid |
2024-03-27 20:50:03 +0100 | <yahb2> | <no output> |
2024-03-27 20:50:05 +0100 | <tomsmeding> | % :i Data.Monoid.Endo |
2024-03-27 20:50:05 +0100 | <yahb2> | type Endo :: * -> * ; newtype Endo a = Endo {appEndo :: a -> a} ; -- Defined in ‘base-4.16.4.0:Data.Semigroup.Internal’ ; instance Monoid (Endo a) ; -- Defined in ‘base-4.16.4.0:Data.Semigroup... |
2024-03-27 20:54:04 +0100 | sord937 | (~sord937@gateway/tor-sasl/sord937) (Quit: sord937) |
2024-03-27 20:57:26 +0100 | isovector | (~isovector@172.103.235.56) |
2024-03-27 20:57:44 +0100 | johnw | (~johnw@69.62.242.138) (Quit: ZNC - http://znc.in) |
2024-03-27 20:58:13 +0100 | johnw | (~johnw@69.62.242.138) |
2024-03-27 20:58:42 +0100 | <isovector> | @pointful ((runIdentity) .) <$> matchRuleM (\a b -> (Identity .) <$> matchChild a b) g d1 |
2024-03-27 20:58:42 +0100 | <lambdabot> | ((\ g x -> runIdentity (g x)) <$> matchRuleM (\ a b -> (\ g x -> (Identity) (g x)) <$> matchChild a b) g d1) |
2024-03-27 21:01:31 +0100 | mmhat | (~mmh@p200300f1c706a2a6ee086bfffe095315.dip0.t-ipconnect.de) |
2024-03-27 21:01:52 +0100 | AlexNoo | (~AlexNoo@94.233.240.255) |
2024-03-27 21:05:40 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) |
2024-03-27 21:06:53 +0100 | AlexZenon | (~alzenon@94.233.240.255) |
2024-03-27 21:08:56 +0100 | mmhat | (~mmh@p200300f1c706a2a6ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 4.2.1) |
2024-03-27 21:10:00 +0100 | tri | (~tri@ool-18bbef1a.static.optonline.net) (Ping timeout: 252 seconds) |
2024-03-27 21:13:53 +0100 | mei | (~mei@user/mei) (Remote host closed the connection) |
2024-03-27 21:14:08 +0100 | <tomsmeding> | that did not do much |
2024-03-27 21:14:11 +0100 | tri | (~tri@4133220a.cst.lightpath.net) |
2024-03-27 21:14:56 +0100 | tomsmeding | wonders why runIdentity, which had redundant parens in the source, is normal in the output while Identity got new redundant parens |
2024-03-27 21:15:26 +0100 | <tri> | hello, im trying to wrap my head around monad transformer. Im using Reader, and return a Maybe. So I don't know if I should use ReaderT with Maybe as the outer monad, or MaybeT with Reader as the outer monad. Could anyone help me please |
2024-03-27 21:16:18 +0100 | mei | (~mei@user/mei) |
2024-03-27 21:16:43 +0100 | <dolio> | For those two it doesn't make any difference. |
2024-03-27 21:17:44 +0100 | <tri> | it's more straight forward when I have an Async operation that returns an optional value (a Maybe monad). This case i would have a MaybeT, and Async monad as the outer. I can think of it as 2 layers that i need to peel. But I can't think about reader |
2024-03-27 21:19:12 +0100 | isovector | (~isovector@172.103.235.56) (Quit: Client closed) |
2024-03-27 21:19:45 +0100 | <tri> | dolio: is it because for Async and Maybe both focus on the output, so the order is important. That is, an asynchronous operation returning an optional value would correspond to a MaybeT with outer Async monad |
2024-03-27 21:20:03 +0100 | <tri> | dolio: but Reader is about input, and Maybe is output, so it doesn't matter as you said? |
2024-03-27 21:20:08 +0100 | <dolio> | @unmtl MaybeT (Reader R) A |
2024-03-27 21:20:08 +0100 | <lambdabot> | R -> Maybe A |
2024-03-27 21:20:15 +0100 | <dolio> | @unmtl ReaderT R Maybe A |
2024-03-27 21:20:15 +0100 | <lambdabot> | R -> Maybe A |
2024-03-27 21:21:09 +0100 | <tri> | dolio: could you confirm my intuition please? |
2024-03-27 21:22:12 +0100 | <c_wraith> | No, it's about Reader specifically. |
2024-03-27 21:22:57 +0100 | <c_wraith> | It tends to commute with most transformers, because it doesn't do anything |
2024-03-27 21:22:59 +0100 | <tri> | like if the 2 monads are both about output, like Maybe and Either, then the order is important. As in Async and Maybe, in that I first make a network call, only after that i will have an optional result. So therefore a MaybeT with outer Async monad |
2024-03-27 21:23:15 +0100 | <tri> | i mean maybe and Async, not either |
2024-03-27 21:24:04 +0100 | <tri> | hmm ok thank you both, i will just use it like that without really understand for now |
2024-03-27 21:24:22 +0100 | <dolio> | It's because ReaderT R M adds `R ->` outside M, and MaybeT M adds Maybe inside M, so they end up as exactly the same thing. |
2024-03-27 21:24:47 +0100 | <tri> | dolio: ah ok thank you |
2024-03-27 21:25:02 +0100 | ncf | wonders if there's anything clever to be said about this |
2024-03-27 21:25:29 +0100 | <ncf> | postcomposition commutes with precomposition, i guess |
2024-03-27 21:25:40 +0100 | ystael | (~ystael@user/ystael) (Quit: Lost terminal) |
2024-03-27 21:25:48 +0100 | <tri> | dolio: the same also applies for, say State and Either right? |
2024-03-27 21:25:56 +0100 | <ncf> | no! |
2024-03-27 21:26:03 +0100 | <dolio> | No, those end up different. |
2024-03-27 21:26:23 +0100 | <tri> | oh i thought state puts the state outside, like `S ->` |
2024-03-27 21:26:24 +0100 | <dolio> | StateT actually puts things both inside and outside. |
2024-03-27 21:26:42 +0100 | <dolio> | S -> M (S, A) |
2024-03-27 21:27:17 +0100 | <tri> | '=( |
2024-03-27 21:27:48 +0100 | ystael | (~ystael@user/ystael) |
2024-03-27 21:28:27 +0100 | <tomsmeding> | there is an alternative version of a state monad transformer that does 'S -> (S, M A)' |
2024-03-27 21:28:40 +0100 | <tomsmeding> | it's _different_ from the usual StateT, but in some cases it is what you want (usually not) |
2024-03-27 21:29:01 +0100 | <c_wraith> | That seems really restrictive - the state modifications can't depend on M actions. |
2024-03-27 21:29:01 +0100 | <tomsmeding> | that one does put stuff on the outside only :) |
2024-03-27 21:29:35 +0100 | <tomsmeding> | if M = Either e, then it essentially means "there is still sensible state to return even if an error occurred" |
2024-03-27 21:29:46 +0100 | <tomsmeding> | which could be true, in principle |
2024-03-27 21:29:52 +0100 | dcoutts_ | (~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) |
2024-03-27 21:30:27 +0100 | <ncf> | tomsmeding: wait how does join work |
2024-03-27 21:31:08 +0100 | <tomsmeding> | @djinn (s -> (s, s -> (s, a))) -> s -> (s, a) |
2024-03-27 21:31:08 +0100 | <lambdabot> | f a b = |
2024-03-27 21:31:08 +0100 | <lambdabot> | case a b of |
2024-03-27 21:31:08 +0100 | <lambdabot> | (c, d) -> d c |
2024-03-27 21:31:28 +0100 | <tomsmeding> | just pass on the state? |
2024-03-27 21:31:44 +0100 | <ncf> | oh |
2024-03-27 21:31:58 +0100 | <tomsmeding> | I don't think the m changes things |
2024-03-27 21:32:52 +0100 | <ncf> | RWMRWM → RWRMWM → RMWM → RMMW → RMW |
2024-03-27 21:32:56 +0100 | <ncf> | you don't get RWM at the end |
2024-03-27 21:33:20 +0100 | <ncf> | by R i mean (s →) and by W i mean (s, ) |
2024-03-27 21:33:37 +0100 | <tomsmeding> | oh |
2024-03-27 21:33:43 +0100 | <tomsmeding> | hm |
2024-03-27 21:34:13 +0100 | <energizer> | https://stackoverflow.com/a/3275233 says the way to divide two ints into a float is (fromIntegral a) / (fromIntegral b) but |
2024-03-27 21:34:16 +0100 | <energizer> | :t (fromIntegral 1) / (fromIntegral 2) |
2024-03-27 21:34:17 +0100 | <lambdabot> | Fractional a => a |
2024-03-27 21:34:23 +0100 | <energizer> | which isnt a float afaict |
2024-03-27 21:34:36 +0100 | <tomsmeding> | Float is an instance of Fractional |
2024-03-27 21:34:44 +0100 | <tomsmeding> | Double also is, as is Rational! |
2024-03-27 21:34:55 +0100 | <tomsmeding> | > fromIntegral 1 / fromIntegral 2 :: Double |
2024-03-27 21:34:56 +0100 | <lambdabot> | 0.5 |
2024-03-27 21:34:59 +0100 | <tomsmeding> | > fromIntegral 1 / fromIntegral 2 :: Rational |
2024-03-27 21:35:00 +0100 | <lambdabot> | 1 % 2 |
2024-03-27 21:35:13 +0100 | <energizer> | how do i find out what type fromIntegral 1 / fromIntegral 2 has, or does it not have one? |
2024-03-27 21:35:22 +0100 | <tomsmeding> | it has one: Fractional a => a |
2024-03-27 21:35:24 +0100 | <tomsmeding> | ;) |
2024-03-27 21:35:27 +0100 | <tomsmeding> | :t (+) |
2024-03-27 21:35:28 +0100 | <lambdabot> | Num a => a -> a -> a |
2024-03-27 21:35:56 +0100 | <tomsmeding> | (+) also has a type: for any type 'a' that implements the Num type class (very roughly: "is a numeric-ish type"), it takes two of those and returns another one |
2024-03-27 21:36:06 +0100 | <tomsmeding> | :t fromIntegral |
2024-03-27 21:36:07 +0100 | <lambdabot> | (Integral a, Num b) => a -> b |
2024-03-27 21:36:07 +0100 | <energizer> | but it doesnt have a concrete type until the context requires it to have one? |
2024-03-27 21:36:10 +0100 | <tomsmeding> | yes |
2024-03-27 21:36:31 +0100 | <tomsmeding> | that's precisely right |
2024-03-27 21:36:37 +0100 | <energizer> | what is the haskell word for 'concrete type' |
2024-03-27 21:36:39 +0100 | <tomsmeding> | the technical word for "concrete" here is "monomorphic" |
2024-03-27 21:36:43 +0100 | <tomsmeding> | i.e. "not polymorphic" |
2024-03-27 21:37:30 +0100 | <EvanR> | unpolymorphic |
2024-03-27 21:37:34 +0100 | <tomsmeding> | fromIntegral is a polymorphic function, and the expression "fromIntegral 1 / fromIntegral 2" does not narrow things down enough yet, so the whole thing is still polymorphic |
2024-03-27 21:37:56 +0100 | <tomsmeding> | :t (/) |
2024-03-27 21:37:57 +0100 | <lambdabot> | Fractional a => a -> a -> a |
2024-03-27 21:38:36 +0100 | <tomsmeding> | the reason why you don't get a Num constraint in the type of that thing (as you may expect from the type of 'fromIntegral') is that Num is a superclass of Fractional: every type that implements Fractional also implements Num |
2024-03-27 21:39:20 +0100 | <ncf> | so the WriterT join goes MWMW → MMWW by strength → MW, the ReaderT join goes RMRM → RRMM by costrength → RM |
2024-03-27 21:39:34 +0100 | <ncf> | and the StateT join goes RMWRMW → RMMW by counit → RMW |
2024-03-27 21:41:39 +0100 | <ncf> | there's something almost geometric about this. falling to the left, falling to the right, falling through the middle |
2024-03-27 21:42:29 +0100 | <tomsmeding> | I'm doing something wrong |
2024-03-27 21:42:31 +0100 | <tomsmeding> | @djinn Monad m => (s -> (s, m a)) -> (a -> s -> (s, m b)) -> s -> (s, m b) |
2024-03-27 21:42:31 +0100 | <lambdabot> | f a b c = |
2024-03-27 21:42:31 +0100 | <lambdabot> | case a c of |
2024-03-27 21:42:31 +0100 | <lambdabot> | (d, e) -> (d, |
2024-03-27 21:42:31 +0100 | <lambdabot> | e >>= (\ f -> |
2024-03-27 21:42:31 +0100 | <lambdabot> | case b f d of |
2024-03-27 21:42:32 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-03-27 21:42:33 +0100 | <lambdabot> | (_, g) -> g)) |
2024-03-27 21:42:39 +0100 | <tomsmeding> | @djinn Monad m => (s -> (s, m (s -> (s, m a)))) -> s -> (s, m a) |
2024-03-27 21:42:39 +0100 | <lambdabot> | -- f cannot be realized. |
2024-03-27 21:42:52 +0100 | <tomsmeding> | and yet join == (>>= id)? |
2024-03-27 21:43:16 +0100 | <tomsmeding> | oh |
2024-03-27 21:43:23 +0100 | <tomsmeding> | because the """bind""" is ignoring some outputs |
2024-03-27 21:43:38 +0100 | <ncf> | ha |
2024-03-27 21:43:40 +0100 | <tomsmeding> | okay maybe I was mistaken :) |
2024-03-27 21:43:54 +0100 | <ncf> | we need a linear djinn :^) |
2024-03-27 21:44:09 +0100 | <c_wraith> | djinn tries to be linear. It just doesn't report when it fails |
2024-03-27 21:44:30 +0100 | <dolio> | djinn also doesn't do polymorphism. |
2024-03-27 21:45:26 +0100 | <tomsmeding> | to keep it decidable, presumably |
2024-03-27 21:45:36 +0100 | dmj` | (sid72307@id-72307.hampstead.irccloud.com) |
2024-03-27 21:45:41 +0100 | <ncf> | in a sense it does rank-1 polymorphism i guess |
2024-03-27 21:45:47 +0100 | <dolio> | So, your Monad constraint isn't going to give it license to do instantiate the parameters however it wants. |
2024-03-27 21:45:57 +0100 | <ncf> | oh |
2024-03-27 21:45:58 +0100 | <tomsmeding> | no, but it does give it license to use >>=, apparently |
2024-03-27 21:46:33 +0100 | <tomsmeding> | and there is nothing else (well, apart from 'return') that it _could_ derive from the constraint anyway |
2024-03-27 21:46:34 +0100 | <dolio> | Yes, but only if the input is exactly `m a` or something. |
2024-03-27 21:46:37 +0100 | <tomsmeding> | so it seems to be doing it fine? |
2024-03-27 21:46:41 +0100 | <tomsmeding> | oh |
2024-03-27 21:46:48 +0100 | <tomsmeding> | I see |
2024-03-27 21:47:00 +0100 | <dolio> | So, it can't use bind with `m (s -> (s, m a))` in your second example. |
2024-03-27 21:47:16 +0100 | <tomsmeding> | that's unfortunate |
2024-03-27 21:48:22 +0100 | <tomsmeding> | right, there is a bind and it has the same dumb behaviour as >>= |
2024-03-27 21:48:24 +0100 | <tomsmeding> | of course |
2024-03-27 21:48:32 +0100 | <tomsmeding> | interesting, thanks dolio :) |
2024-03-27 21:48:54 +0100 | <dolio> | I still think your proposed transformer is pretty suspicious. |
2024-03-27 21:49:00 +0100 | <tomsmeding> | yes certainly |
2024-03-27 21:49:02 +0100 | <dolio> | It's throwing state out in places. |
2024-03-27 21:49:08 +0100 | <tomsmeding> | hence my multiple scare quotes around "bind" |
2024-03-27 21:49:19 +0100 | <tomsmeding> | I stand corrected that this is a (sensible) monad transformer |
2024-03-27 21:49:27 +0100 | <ncf> | yeah that's certainly not gonna pass the monad laws |
2024-03-27 21:49:46 +0100 | <dolio> | So it's not clear to me that it's going to actually satisfy various rules. Likely not the state rules. |
2024-03-27 21:49:49 +0100 | <tomsmeding> | (to me defense, it was someone else (a mathematician) who said something to the effect) |
2024-03-27 21:50:11 +0100 | <tomsmeding> | no it's certainly not going to work, or otherwise the laws are too weak :p |
2024-03-27 21:50:19 +0100 | geekosaur | misses exference, btb |
2024-03-27 21:50:44 +0100 | siw5ohs0 | (~aiw5ohs0@user/aiw5ohs0) |
2024-03-27 21:51:34 +0100 | siw5ohs0 | (~aiw5ohs0@user/aiw5ohs0) (Leaving) |
2024-03-27 21:52:17 +0100 | <tri> | hi guys, in a ReaderT SomeEnv (Maybe Text), how can i return a Nothing value to indicate there is no Text? |
2024-03-27 21:52:33 +0100 | <Rembane> | pure Nothing |
2024-03-27 21:52:36 +0100 | <tri> | it works if the last expression is return "Something" |
2024-03-27 21:52:44 +0100 | <ncf> | join (return ma) = (\s. (s, (snd . ($ s)) <$> ma)) ≠ ma |
2024-03-27 21:53:17 +0100 | <ncf> | tri: empty? |
2024-03-27 21:53:31 +0100 | <ncf> | Rembane: that would work with ReaderT SomeEnv m (Maybe Text) |
2024-03-27 21:53:38 +0100 | tri_ | (~tri@ool-18bbef1a.static.optonline.net) |
2024-03-27 21:53:41 +0100 | <ncf> | tri: or lift Nothing |
2024-03-27 21:55:16 +0100 | <tri> | ah lift |
2024-03-27 21:55:23 +0100 | <Rembane> | ncf: Oh, a classic off by m error |
2024-03-27 21:55:36 +0100 | <ncf> | :p |
2024-03-27 21:55:43 +0100 | <tri> | thanks everyone |
2024-03-27 21:56:05 +0100 | <tri> | im working in F# so it's a bit hard to go back and forth between F# and Haskell |
2024-03-27 21:56:12 +0100 | <EvanR> | you can instantiate the type Monad m => whatever(m) however you want, but it doesn't mean the resulting type has any inhabitants |
2024-03-27 21:56:16 +0100 | Square2 | (~Square@user/square) (Remote host closed the connection) |
2024-03-27 21:58:12 +0100 | tri_ | (~tri@ool-18bbef1a.static.optonline.net) (Ping timeout: 255 seconds) |
2024-03-27 21:58:16 +0100 | sp1ff | (~user@c-24-21-45-157.hsd1.wa.comcast.net) (Remote host closed the connection) |
2024-03-27 21:58:25 +0100 | <EvanR> | (Odd n, PerfectNumber n) => The n |
2024-03-27 21:58:37 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-03-27 21:59:05 +0100 | <tomsmeding> | is it possible to write something on the ... (or some other place) to make this typecheck? foo :: forall f. (..., Coercible a b) => f a -> f b; foo = coerce |
2024-03-27 21:59:34 +0100 | <tomsmeding> | notable is that 'f' is _not_ a Functor, but it could be some constrained functor (it admits only unboxable type parameters) |
2024-03-27 22:00:13 +0100 | <tomsmeding> | Coercible1? |
2024-03-27 22:00:56 +0100 | <tomsmeding> | (the ghc error here is that it cannot know the roles of f; question is: can I require f to have certain roles here? I think I can't) |
2024-03-27 22:01:53 +0100 | rvalue | (~rvalue@user/rvalue) (Quit: ZNC - https://znc.in) |
2024-03-27 22:06:18 +0100 | trev | (~trev@user/trev) (Ping timeout: 255 seconds) |
2024-03-27 22:08:28 +0100 | <tri> | inside a do notation of the monad ReaderT Environment (Maybe Text), I'd like to use a function of type Reader Environment (Maybe ()). How can i use it please? |
2024-03-27 22:09:06 +0100 | <EvanR> | :t lift |
2024-03-27 22:09:07 +0100 | motherfsck | (~motherfsc@user/motherfsck) (Quit: quit) |
2024-03-27 22:09:07 +0100 | <lambdabot> | (MonadTrans t, Monad m) => m a -> t m a |
2024-03-27 22:09:21 +0100 | <dolio> | Yeah, I don't think there's role abstraction. |
2024-03-27 22:09:43 +0100 | <EvanR> | hmm... doesn't exactly fit |
2024-03-27 22:09:45 +0100 | <tomsmeding> | tri: are you sure there's no typo in that? 'Maybe Text' is not suitable as the second argument of a ReaderT |
2024-03-27 22:09:53 +0100 | <dolio> | What you're asking for was how I thought things should be structured instead of roles way back. |
2024-03-27 22:10:00 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-27 22:10:13 +0100 | <tomsmeding> | dolio: I see :) |
2024-03-27 22:10:27 +0100 | <tomsmeding> | I don't _need_ it, was just nice, so it's ok |
2024-03-27 22:10:50 +0100 | <tri> | tomsmeding: actually i arbitrarily used Text to make it concrete, because i thought only the part ReaderT Environment Maybe is important |
2024-03-27 22:10:58 +0100 | Guest1680 | (~ars23@79.114.26.206) (Quit: Leaving) |
2024-03-27 22:11:22 +0100 | <ncf> | did you mean ReaderT Environment Maybe Text |
2024-03-27 22:12:17 +0100 | <tri> | ncf: actually im inside the do notation of ReaderT Environment Maybe (), and im trying to use the function type Reader Environment () |
2024-03-27 22:12:57 +0100 | <tri> | is it even possible? |
2024-03-27 22:13:14 +0100 | <ncf> | Reader e is just ReaderT e Identity, so you might need something like hoistReaderT |
2024-03-27 22:13:29 +0100 | <ncf> | er that's not a thing |
2024-03-27 22:13:48 +0100 | <ncf> | what am i looking for |
2024-03-27 22:13:59 +0100 | <ncf> | ah, mapReaderT |
2024-03-27 22:14:05 +0100 | <tomsmeding> | tri: 'ReaderT Environment Maybe Text' is not the same as 'ReaderT Environment (Maybe Text)' ;) |
2024-03-27 22:14:37 +0100 | <tri> | tomsmeding: yea sorry, i was just trying to emphasize Text belongs to Maybe monad for clarity (but it backed fire) |
2024-03-27 22:15:15 +0100 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Remote host closed the connection) |
2024-03-27 22:15:32 +0100 | <tomsmeding> | :t Control.Monad.Trans.Reader.mapReaderT |
2024-03-27 22:15:33 +0100 | <lambdabot> | (m a -> n b) -> ReaderT r m a -> ReaderT r n b |
2024-03-27 22:15:49 +0100 | <tomsmeding> | where the function is \(Identity x) -> return x |
2024-03-27 22:17:29 +0100 | <tomsmeding> | @djinn Monad m => (r -> a) -> (r -> m a) |
2024-03-27 22:17:29 +0100 | <lambdabot> | f a b = return (a b) |
2024-03-27 22:17:42 +0100 | <tomsmeding> | er |
2024-03-27 22:18:08 +0100 | <tomsmeding> | @djinn Monad m => (Environment -> Maybe ()) -> (Environment -> Maybe ()) |
2024-03-27 22:18:08 +0100 | <lambdabot> | Error: Undefined type Environment |
2024-03-27 22:18:12 +0100 | <tomsmeding> | lol |
2024-03-27 22:18:24 +0100 | <ncf> | generalize from mmorph might be useful https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html#v:generalize |
2024-03-27 22:18:38 +0100 | <tomsmeding> | unwrapping newtypes, this is id |
2024-03-27 22:18:38 +0100 | <ncf> | (and then you can actually use hoist instead of mapReaderT) |
2024-03-27 22:24:39 +0100 | <tri> | ncf: yea i was thinking about hoist |
2024-03-27 22:25:07 +0100 | <tri> | i don't know how to word this correctly, i mean i don't even know what question i should ask follow up |
2024-03-27 22:25:25 +0100 | <tri> | but i know hoist would add the outer monad around reader, in this case Maybe |
2024-03-27 22:25:52 +0100 | <tri> | then you introduce mapReaderT, and that's completely new to me |
2024-03-27 22:26:03 +0100 | <ncf> | hoist = mapReaderT |
2024-03-27 22:26:03 +0100 | <tri> | so is mapReaderT same as hoist? |
2024-03-27 22:26:08 +0100 | <tri> | ah |
2024-03-27 22:27:33 +0100 | <ncf> | (hoist is part of a typeclass that has a ReaderT instance) |
2024-03-27 22:29:35 +0100 | harveypwca | (~harveypwc@2601:246:c200:2740:15b6:f225:14ff:9821) |
2024-03-27 22:30:23 +0100 | <tri> | thank you |
2024-03-27 22:30:55 +0100 | <tri> | everytime i come here and ask something, i'd be immediately lost after the first or second answer |
2024-03-27 22:31:07 +0100 | <tri> | you guys are something else |
2024-03-27 22:31:16 +0100 | <tri> | in a good way |
2024-03-27 22:31:37 +0100 | <tri> | but really appreciate the enthusiasm |
2024-03-27 22:33:40 +0100 | tri_ | (~tri@ool-18bbef1a.static.optonline.net) |
2024-03-27 22:36:09 +0100 | Square | (~Square4@user/square) |
2024-03-27 22:39:39 +0100 | tri_ | (~tri@ool-18bbef1a.static.optonline.net) (Ping timeout: 252 seconds) |
2024-03-27 22:40:58 +0100 | sawilagar | (~sawilagar@user/sawilagar) (Ping timeout: 255 seconds) |
2024-03-27 22:47:51 +0100 | akegalj | (~akegalj@141-136-184-96.dsl.iskon.hr) (Remote host closed the connection) |
2024-03-27 22:48:28 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2024-03-27 23:03:20 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-27 23:22:06 +0100 | <[Leary]> | tomsmeding: Consider `type Representational f = (forall a b. Coercible a b => Coercible (f a) (f b)) :: Constraint` |
2024-03-27 23:23:47 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-27 23:30:19 +0100 | gmg | (~user@user/gehmehgeh) (Remote host closed the connection) |
2024-03-27 23:31:40 +0100 | gmg | (~user@user/gehmehgeh) |
2024-03-27 23:35:20 +0100 | <[Leary]> | cheater: You can write e.g. `hfoldr :: (forall x xs. c x => f x -> r xs -> r (x:xs)) -> r '[] -> (forall xs. HList c f xs -> r xs)`, but I'm not sure it will fit your use case. |
2024-03-27 23:35:55 +0100 | <cheater> | interesting, thank you |
2024-03-27 23:36:38 +0100 | <shapr> | @quote |
2024-03-27 23:36:39 +0100 | <lambdabot> | desrt says: man... there's this whole dark side to haskell that dr. kahl didn't teach us in 3e03 |
2024-03-27 23:36:50 +0100 | Square2 | (~Square@user/square) |
2024-03-27 23:37:25 +0100 | <geekosaur> | ob https://www.tweag.io/blog/2021-01-07-haskell-dark-arts-part-i/ |
2024-03-27 23:39:32 +0100 | <terrorjack> | a kitten dies each time someone uses the trick in the above post |
2024-03-27 23:41:25 +0100 | <geekosaur> | of course. don't dark arts always involve blood sacrifice? |
2024-03-27 23:42:27 +0100 | Square | (~Square4@user/square) (Ping timeout: 268 seconds) |
2024-03-27 23:44:23 +0100 | <EvanR> | like when star wars episode 1 through 3 sacrificed the entire franchise |
2024-03-27 23:45:00 +0100 | <EvanR> | the character might as well have been using importHidden |
2024-03-27 23:47:22 +0100 | infinity0 | (~infinity0@pwned.gg) (Remote host closed the connection) |
2024-03-27 23:49:58 +0100 | infinity0 | (~infinity0@pwned.gg) |
2024-03-27 23:51:02 +0100 | michalz | (~michalz@185.246.207.205) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-03-27 23:51:14 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2024-03-27 23:53:47 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-27 23:53:55 +0100 | acidjnk_new | (~acidjnk@p200300d6e706f453dde8176755f9f4a3.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2024-03-27 23:57:14 +0100 | <cheater> | https://new.reddit.com/r/rust/comments/1bp9zr8/im_a_non_technical_founder_of_a_startup_and_a/ |
2024-03-27 23:59:09 +0100 | infinity0 | (~infinity0@pwned.gg) (Remote host closed the connection) |
2024-03-27 23:59:29 +0100 | infinity0 | (~infinity0@pwned.gg) |