2024-03-23 00:10:45 +0100 | tv | (~tv@user/tv) (Read error: Connection reset by peer) |
2024-03-23 00:17:54 +0100 | vnogueira_ | (~vnogueira@user/vnogueira) (Quit: ZNC 1.8.2 - https://znc.in) |
2024-03-23 00:20:59 +0100 | vnogueira | (~vnogueira@user/vnogueira) |
2024-03-23 00:21:13 +0100 | notzmv | (~daniel@user/notzmv) |
2024-03-23 00:21:51 +0100 | ph88 | (~ph88@2a02:8109:9e26:c800:e5ad:5837:1dbd:508c) (Remote host closed the connection) |
2024-03-23 00:25:20 +0100 | tv | (~tv@user/tv) |
2024-03-23 00:36:06 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2024-03-23 00:40:29 +0100 | acidjnk | (~acidjnk@p200300d6e70d3f76ac4c8c7b0af5042c.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
2024-03-23 00:47:40 +0100 | shapr | (~user@c-24-218-186-89.hsd1.ma.comcast.net) (Quit: whewww) |
2024-03-23 00:52:55 +0100 | Lycurgus | (~georg@user/Lycurgus) (Quit: leaving) |
2024-03-23 00:56:48 +0100 | Guest52 | (~Guest52@185.57.29.142) (Quit: Client closed) |
2024-03-23 00:56:53 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
2024-03-23 00:57:10 +0100 | tremon | (~tremon@83.80.159.219) (Quit: getting boxed in) |
2024-03-23 00:59:46 +0100 | __monty__ | (~toonn@user/toonn) (Quit: leaving) |
2024-03-23 01:11:01 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2024-03-23 01:23:48 +0100 | clairejoseph | (~clairejos@69.80.12.40) |
2024-03-23 01:35:34 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 255 seconds) |
2024-03-23 01:48:15 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 272 seconds) |
2024-03-23 01:50:46 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-03-23 01:57:12 +0100 | clairejoseph | (~clairejos@69.80.12.40) (Ping timeout: 250 seconds) |
2024-03-23 02:00:30 +0100 | sroso | (~sroso@user/SrOso) |
2024-03-23 02:13:58 +0100 | mmhat | (~mmh@p200300f1c706a2a9ee086bfffe095315.dip0.t-ipconnect.de) (Quit: WeeChat 4.2.1) |
2024-03-23 02:15:35 +0100 | euleritian | (~euleritia@77.22.252.56) (Read error: Connection reset by peer) |
2024-03-23 02:23:59 +0100 | mima | (~mmh@aftr-62-216-211-172.dynamic.mnet-online.de) (Ping timeout: 252 seconds) |
2024-03-23 02:27:28 +0100 | vnogueira_ | (~vnogueira@user/vnogueira) |
2024-03-23 02:28:26 +0100 | vnogueira | (~vnogueira@user/vnogueira) (Ping timeout: 260 seconds) |
2024-03-23 02:28:53 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-03-23 02:31:02 +0100 | qeef | (~qeef@138-169-143-94.cust.centrio.cz) (Ping timeout: 264 seconds) |
2024-03-23 02:36:15 +0100 | vnogueira_ | (~vnogueira@user/vnogueira) (Remote host closed the connection) |
2024-03-23 02:36:34 +0100 | vnogueira | (~vnogueira@user/vnogueira) |
2024-03-23 02:37:40 +0100 | qeef | (~qeef@138-169-143-94.cust.centrio.cz) |
2024-03-23 02:49:16 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2024-03-23 03:14:36 +0100 | qeef | (~qeef@138-169-143-94.cust.centrio.cz) (Ping timeout: 252 seconds) |
2024-03-23 03:27:14 +0100 | otto_s | (~user@p4ff277d6.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
2024-03-23 03:28:49 +0100 | euleritian | (~euleritia@77.22.252.56) |
2024-03-23 03:29:12 +0100 | otto_s | (~user@p5b04451e.dip0.t-ipconnect.de) |
2024-03-23 03:37:47 +0100 | son0p | (~ff@152.203.80.45) |
2024-03-23 04:02:07 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 260 seconds) |
2024-03-23 04:02:29 +0100 | benkard | (~mulk@p5b2dc71d.dip0.t-ipconnect.de) |
2024-03-23 04:03:26 +0100 | mulk | (~mulk@p5b112e7d.dip0.t-ipconnect.de) (Ping timeout: 264 seconds) |
2024-03-23 04:03:26 +0100 | benkard | mulk |
2024-03-23 04:11:48 +0100 | komikat | (~akshitkr@218.185.248.66) (Ping timeout: 252 seconds) |
2024-03-23 04:11:50 +0100 | komikat_ | (~akshitkr@218.185.248.66) (Ping timeout: 264 seconds) |
2024-03-23 04:19:38 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) (Remote host closed the connection) |
2024-03-23 04:34:29 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) (Remote host closed the connection) |
2024-03-23 04:34:48 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2024-03-23 04:39:06 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2024-03-23 04:40:07 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2024-03-23 04:40:15 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) |
2024-03-23 04:41:12 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
2024-03-23 04:41:46 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2024-03-23 04:44:14 +0100 | td_ | (~td@i5387092D.versanet.de) (Ping timeout: 264 seconds) |
2024-03-23 04:45:44 +0100 | td_ | (~td@i53870906.versanet.de) |
2024-03-23 04:46:11 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 245 seconds) |
2024-03-23 04:52:14 +0100 | szkl | (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity) |
2024-03-23 05:03:49 +0100 | sadie_ | (~sadie@c-76-155-235-153.hsd1.co.comcast.net) |
2024-03-23 05:04:05 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2024-03-23 05:08:23 +0100 | aforemny_ | (~aforemny@i59F516EB.versanet.de) |
2024-03-23 05:09:18 +0100 | aforemny | (~aforemny@2001:9e8:6ce7:be00:a07f:df32:373b:9c12) (Ping timeout: 255 seconds) |
2024-03-23 05:18:48 +0100 | Guest52 | (~Guest52@185.57.29.142) |
2024-03-23 05:45:28 +0100 | Square | (~Square@user/square) (Ping timeout: 268 seconds) |
2024-03-23 06:02:06 +0100 | ddellacosta | (~ddellacos@ool-44c73d16.dyn.optonline.net) |
2024-03-23 06:12:54 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) (Ping timeout: 260 seconds) |
2024-03-23 06:15:54 +0100 | harveypwca | (~harveypwc@2601:246:c200:2740:15b6:f225:14ff:9821) |
2024-03-23 06:21:34 +0100 | pastly | (~pastly@gateway/tor-sasl/pastly) |
2024-03-23 06:23:31 +0100 | falafel | (~falafel@2607:fb91:8aa:877b:e203:1c7d:5ebc:b59) |
2024-03-23 06:23:42 +0100 | Guest52 | (~Guest52@185.57.29.142) (Ping timeout: 250 seconds) |
2024-03-23 06:29:34 +0100 | ddellacosta | (~ddellacos@ool-44c73d16.dyn.optonline.net) (Quit: WeeChat 4.2.1) |
2024-03-23 06:33:41 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 245 seconds) |
2024-03-23 07:10:02 +0100 | sroso | (~sroso@user/SrOso) (Ping timeout: 264 seconds) |
2024-03-23 07:12:17 +0100 | sroso | (~sroso@user/SrOso) |
2024-03-23 07:17:11 +0100 | falafel | (~falafel@2607:fb91:8aa:877b:e203:1c7d:5ebc:b59) (Ping timeout: 260 seconds) |
2024-03-23 07:21:51 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2024-03-23 07:29:06 +0100 | gmg | (~user@user/gehmehgeh) |
2024-03-23 07:30:08 +0100 | zetef | (~quassel@2a02:2f00:500b:ce00:aba1:3782:4e7c:41a) |
2024-03-23 07:31:57 +0100 | <Inst> | any people do prolog here? |
2024-03-23 07:32:15 +0100 | <Inst> | do you know if there's a way to multiply declare, i.e, state multiple facts to a predicate? |
2024-03-23 07:36:46 +0100 | gmg | (~user@user/gehmehgeh) (Remote host closed the connection) |
2024-03-23 07:37:29 +0100 | gmg | (~user@user/gehmehgeh) |
2024-03-23 07:43:50 +0100 | <Inst> | ummm, back to Hasklel |
2024-03-23 07:43:52 +0100 | <Inst> | Haskell |
2024-03-23 07:44:28 +0100 | <Inst> | is for_ [1..100] \item -> print item intrinsically slow? |
2024-03-23 07:44:38 +0100 | <Inst> | because I know Haskell tends to be a bit slower with monadic effects |
2024-03-23 07:45:25 +0100 | <mauke> | shouldn't be |
2024-03-23 07:48:13 +0100 | <Inst> | using some time benchmarking |
2024-03-23 07:48:32 +0100 | <Inst> | 17 ms to for_ through 100 items |
2024-03-23 07:48:39 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2024-03-23 07:48:48 +0100 | <Inst> | python takes 53 ms, which is how it should be :3 |
2024-03-23 07:48:55 +0100 | <Inst> | just, ghci :( |
2024-03-23 07:50:12 +0100 | <Inst> | wish someone would pay for an equivalent to utop :3 |
2024-03-23 07:52:19 +0100 | bilegeek | (~bilegeek@2600:1008:b04f:ac16:241:4e7b:fce9:569f) (Quit: Leaving) |
2024-03-23 08:00:30 +0100 | euleritian | (~euleritia@77.22.252.56) (Read error: Connection reset by peer) |
2024-03-23 08:00:52 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 08:01:33 +0100 | <Inst> | ouch, ocaml does it in 6 ms :( |
2024-03-23 08:06:20 +0100 | <c_wraith> | I mean, print *is* slow |
2024-03-23 08:07:01 +0100 | <c_wraith> | both show and putStrLn are not the fastest. |
2024-03-23 08:09:57 +0100 | adanwan_ | (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection) |
2024-03-23 08:10:22 +0100 | adanwan | (~adanwan@gateway/tor-sasl/adanwan) |
2024-03-23 08:10:26 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-23 08:13:33 +0100 | <sadie_> | perhaps it's faster with Data.Text(.IO) |
2024-03-23 08:22:51 +0100 | zetef | (~quassel@2a02:2f00:500b:ce00:aba1:3782:4e7c:41a) (Ping timeout: 245 seconds) |
2024-03-23 08:25:57 +0100 | acidjnk | (~acidjnk@p200300d6e70d3f39710acbcd8de4867e.dip0.t-ipconnect.de) |
2024-03-23 08:26:51 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-23 08:28:56 +0100 | todi | (~todi@p57803331.dip0.t-ipconnect.de) |
2024-03-23 08:32:06 +0100 | derpyxdhs | (~Thunderbi@user/derpyxdhs) |
2024-03-23 08:35:41 +0100 | jrm | (~jrm@user/jrm) (Quit: ciao) |
2024-03-23 08:36:07 +0100 | jrm | (~jrm@user/jrm) |
2024-03-23 08:36:37 +0100 | <Inst> | c does it in 3 seconds |
2024-03-23 08:36:42 +0100 | <Inst> | there's probably going to be a spoolup for RTS as well |
2024-03-23 08:36:53 +0100 | <c_wraith> | eh, it's miniscule. |
2024-03-23 08:37:04 +0100 | <c_wraith> | the problem is the combination of show and putStrLn |
2024-03-23 08:37:11 +0100 | <c_wraith> | they are both *slow* |
2024-03-23 08:37:58 +0100 | derpyxdhs | (~Thunderbi@user/derpyxdhs) (Quit: derpyxdhs) |
2024-03-23 08:38:00 +0100 | <Inst> | oh |
2024-03-23 08:38:05 +0100 | <Inst> | maybe it's because I'm getting defaults to integer? |
2024-03-23 08:38:10 +0100 | <c_wraith> | no |
2024-03-23 08:38:15 +0100 | <c_wraith> | it's because of show and putStrLn |
2024-03-23 08:41:03 +0100 | <Inst> | I don't think so, change it to for_ ['0'..'9'] putChar |
2024-03-23 08:41:10 +0100 | <Inst> | still 16 ms |
2024-03-23 08:41:26 +0100 | <c_wraith> | yes, part of why putStrLn is so slow is that it calls putChar |
2024-03-23 08:41:59 +0100 | <Inst> | no, but the number of iterations was reduced from 100 to 10 |
2024-03-23 08:42:03 +0100 | <Inst> | still same time |
2024-03-23 08:42:24 +0100 | <c_wraith> | Oh, maybe you're on an older version of GHC that doesn't quit immediately |
2024-03-23 08:42:38 +0100 | <c_wraith> | I think until the last release, it would wait a while before quitting. |
2024-03-23 08:43:30 +0100 | <Inst> | currently running 9.6.3 |
2024-03-23 08:43:53 +0100 | <c_wraith> | that's definitely before the fix |
2024-03-23 08:44:33 +0100 | <Inst> | set to 9.8.1 |
2024-03-23 08:45:28 +0100 | <Inst> | i loled |
2024-03-23 08:45:31 +0100 | <Inst> | 0.03 seconds |
2024-03-23 08:45:38 +0100 | <Inst> | erm, 3 ms, rather |
2024-03-23 08:45:40 +0100 | target_i | (~target_i@user/target-i/x-6023099) |
2024-03-23 08:46:18 +0100 | <c_wraith> | ah, that's better |
2024-03-23 08:46:32 +0100 | <Inst> | so roughly same order of magnitude now as ocaml |
2024-03-23 08:48:16 +0100 | <ski> | Inst : "do you know if there's a way to multiply declare, i.e, state multiple facts to a predicate?" -- just do it ? |
2024-03-23 08:48:54 +0100 | <Inst> | I'm going over adventures in prolog |
2024-03-23 08:49:08 +0100 | <Inst> | all I really need is pick up logic programming, then I'm bad at 4 programming paradigms ;) |
2024-03-23 08:49:18 +0100 | <Inst> | LogicT, here I come :3 |
2024-03-23 08:49:47 +0100 | <ski> | you can just state multiple clauses (facts and rules) of the same predicate, in a row, just like stating multiple defining equations for a function, in Haskell |
2024-03-23 08:50:10 +0100 | <Inst> | no, but how do I avoid having to type out the predicate repeatedly? |
2024-03-23 08:50:36 +0100 | <Inst> | room(kitchen). room(office). ~~~> room([kitchen, office]).? |
2024-03-23 08:50:40 +0100 | <ski> | huh ? .. dunno what you mean |
2024-03-23 08:51:08 +0100 | <Inst> | I mean that I want something that's semantically equivalent to room(kitchen). room(office)., without having to type room twice |
2024-03-23 08:51:08 +0100 | <ski> | oh, no there's no way to abbreviate that, really. except by calling member/2 or something, but that does it at run-time |
2024-03-23 08:51:19 +0100 | <Inst> | oof :( |
2024-03-23 08:51:30 +0100 | <ski> | room(Room) :- member(Room,[kitchen,office]). |
2024-03-23 08:51:54 +0100 | <ski> | well, maybe you could do it with term_expansion/2, actually |
2024-03-23 08:52:07 +0100 | <Inst> | seems icky |
2024-03-23 08:52:17 +0100 | <ski> | (basically a kind of macro facility) |
2024-03-23 08:52:38 +0100 | <Inst> | everything is secretly just a macro :3 |
2024-03-23 08:52:44 +0100 | <ski> | not really |
2024-03-23 08:52:45 +0100 | mc47 | (~mc47@xmonad/TheMC47) |
2024-03-23 08:53:03 +0100 | <Inst> | i mean you can think of any programming language as simply a macro to machine code or bytecode |
2024-03-23 08:53:26 +0100 | <ski> | .. even if you're using an interpreter ? |
2024-03-23 08:54:00 +0100 | <Inst> | :( |
2024-03-23 08:56:15 +0100 | <Inst> | I guess member/2 works, not sure if it's idiomatic |
2024-03-23 08:58:18 +0100 | ski | would probably just enumerate the cases as separate facts |
2024-03-23 09:02:52 +0100 | <c_wraith> | Inst: https://paste.tomsmeding.com/g2jJhUvK testing on my system shows that if the terminal speed isn't an issue, print takes more than double the time going via bytestring does. When the terminal is relevant, it's more like a 20% speed penalty. Also, terminal IO is a terrible thing to benchmark. :) |
2024-03-23 09:08:32 +0100 | <Inst> | I know, only time when Python beats C (at least in Windows) :; |
2024-03-23 09:09:01 +0100 | tzh | (~tzh@c-73-164-206-160.hsd1.or.comcast.net) (Quit: zzz) |
2024-03-23 09:10:17 +0100 | mima | (~mmh@aftr-62-216-211-106.dynamic.mnet-online.de) |
2024-03-23 09:11:51 +0100 | sroso | (~sroso@user/SrOso) (Ping timeout: 255 seconds) |
2024-03-23 09:13:59 +0100 | sroso | (~sroso@user/SrOso) |
2024-03-23 09:14:00 +0100 | dunj3_ | dunj3 |
2024-03-23 09:16:08 +0100 | Guest52 | (~Guest52@185.57.29.142) |
2024-03-23 09:23:14 +0100 | dcoutts_ | (~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) (Ping timeout: 264 seconds) |
2024-03-23 09:26:58 +0100 | danza | (~francesco@an-19-165-10.service.infuturo.it) |
2024-03-23 09:30:49 +0100 | <Inst> | also, nice |
2024-03-23 09:30:54 +0100 | <Inst> | you can stuff a tuple |
2024-03-23 09:30:55 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2024-03-23 09:31:08 +0100 | <Inst> | into member to get multi-arg predicates in |
2024-03-23 09:32:05 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-23 09:32:38 +0100 | Guest52 | (~Guest52@185.57.29.142) (Ping timeout: 250 seconds) |
2024-03-23 09:33:01 +0100 | cyphase | (~cyphase@user/cyphase) (Ping timeout: 255 seconds) |
2024-03-23 09:36:36 +0100 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) |
2024-03-23 09:38:59 +0100 | <ski> | Prolog doesn't really have tuples |
2024-03-23 09:43:28 +0100 | cyphase | (~cyphase@user/cyphase) |
2024-03-23 09:56:41 +0100 | <Inst> | why is it wrong to try to abuse member this way? |
2024-03-23 09:57:00 +0100 | <Inst> | I assume there's a performance penalty, which is why you're suggesting term_expansion/2 |
2024-03-23 09:59:57 +0100 | <ski> | it's not wrong, you should just be aware of what's happening |
2024-03-23 10:01:28 +0100 | <ski> | isRoom Kitchen = True |
2024-03-23 10:01:34 +0100 | <ski> | isRoom Office = True |
2024-03-23 10:01:41 +0100 | <ski> | isRoom _ = False |
2024-03-23 10:01:43 +0100 | <ski> | vs. |
2024-03-23 10:01:56 +0100 | <ski> | isRoom place = place `elem` [Kitchen,Office] |
2024-03-23 10:02:00 +0100 | <ski> | which do you prefer ? |
2024-03-23 10:03:01 +0100 | <ski> | (of course, that only covers the testing mode (+) of room/1, not the enumerating mode (-)) |
2024-03-23 10:04:52 +0100 | <danza> | the latter is more readable |
2024-03-23 10:14:27 +0100 | ss4 | (~wootehfoo@user/wootehfoot) |
2024-03-23 10:14:49 +0100 | <probie> | but requires the compiler to do more work to produce equally performant code |
2024-03-23 10:16:31 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-23 10:17:01 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds) |
2024-03-23 10:17:26 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Ping timeout: 245 seconds) |
2024-03-23 10:18:22 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-03-23 10:18:31 +0100 | dcoutts_ | (~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) |
2024-03-23 10:18:33 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 10:19:06 +0100 | rvalue | (~rvalue@user/rvalue) (Quit: ZNC - https://znc.in) |
2024-03-23 10:20:48 +0100 | econo_ | (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
2024-03-23 10:20:55 +0100 | Guest52 | (~Guest52@185.57.29.142) |
2024-03-23 10:22:28 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-23 10:28:54 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-03-23 10:31:12 +0100 | <Inst> | also, is it me or is logic programming just "everything is a list"? |
2024-03-23 10:31:21 +0100 | <Inst> | that's probably too simplified |
2024-03-23 10:31:56 +0100 | <tomsmeding> | the more basic data structures you have, the more pointlessly complicated the inference engine becomes |
2024-03-23 10:32:00 +0100 | <Inst> | the reason i'm abusing member this way is because I think of room(kitchen)... etc not as a series of predicates, but rather as a list |
2024-03-23 10:32:20 +0100 | <tomsmeding> | and the more semantics you have to keep in your head |
2024-03-23 10:32:22 +0100 | <Inst> | so it feels unnatural, same reason i barely use top-level pattern matching these days |
2024-03-23 10:32:28 +0100 | <Inst> | foo = /case, which is now GHC2023 <3 |
2024-03-23 10:32:33 +0100 | <Inst> | \\case, rather |
2024-03-23 10:32:39 +0100 | <Inst> | \case, ffs |
2024-03-23 10:33:03 +0100 | <tomsmeding> | have you felt the need for \cases yet |
2024-03-23 10:33:13 +0100 | <Inst> | i barely know how to use cases :3 |
2024-03-23 10:33:51 +0100 | <ski> | "everything is a list" -- nope |
2024-03-23 10:34:19 +0100 | ss4 | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-03-23 10:34:37 +0100 | <Inst> | there's more to it, like unification |
2024-03-23 10:34:50 +0100 | <Inst> | i was going to remark about how ridiculously powerful logic programming can feel |
2024-03-23 10:34:54 +0100 | ski | normally prefers matching in the definiendum in defining equations, rather than in `case' or `\' or `\case' |
2024-03-23 10:35:48 +0100 | <Inst> | location(X, kitchen), write(X), nl, fail. |
2024-03-23 10:35:49 +0100 | <tomsmeding> | I match on the LHS (sorry ski) in the generic case but use \case when I'm splitting on an intuitively many-constructor data type |
2024-03-23 10:36:05 +0100 | <ski> | (because it gives a more declarative, and orthogonal/separated, reading of the code) |
2024-03-23 10:36:27 +0100 | <Inst> | wait, i need a compound to simulate this properly |
2024-03-23 10:36:45 +0100 | <Inst> | but in Haskell it'd be: |
2024-03-23 10:36:50 +0100 | <tomsmeding> | like, if I split on an expression data type with 8 constructors but I also take 4 additional parameters, I find 'foo something and another thing = \case' much more readable |
2024-03-23 10:38:04 +0100 | <ski> | forall(( location(X,kitchen) ),( write(X),nl )). % Inst |
2024-03-23 10:38:23 +0100 | <Inst> | mapM_ (print . fst) $ filter (\(a,b) -> b == Kitchen) location |
2024-03-23 10:38:34 +0100 | <ski> | a forall/2 is commonly preferable to a (generic) failure-driven loop |
2024-03-23 10:38:42 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 255 seconds) |
2024-03-23 10:38:53 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
2024-03-23 10:39:00 +0100 | <ski> | (and forall/2 means implication .. but the implicit universal quantification is why it got that name) |
2024-03-23 10:39:13 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) |
2024-03-23 10:39:16 +0100 | <Inst> | the failure-driven loop feels more readable |
2024-03-23 10:39:28 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2024-03-23 10:39:31 +0100 | <ski> | it's more operational/procedural, less declarative/logical |
2024-03-23 10:39:39 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-03-23 10:39:49 +0100 | <Inst> | i mean the forall solution can be done in Haskell with functions, tbh |
2024-03-23 10:39:57 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 10:39:59 +0100 | <ski> | tomsmeding : or one can declare a local helper function |
2024-03-23 10:40:05 +0100 | <tomsmeding> | true |
2024-03-23 10:40:05 +0100 | <Inst> | it's essentially equivalent to a function call |
2024-03-23 10:40:58 +0100 | <tomsmeding> | but then if the matching is on a GADT you need a type signature on said helper function, and you very quickly need ScopedTypeVariables :p |
2024-03-23 10:41:00 +0100 | <tomsmeding> | which is a bit overkill |
2024-03-23 10:41:19 +0100 | <Inst> | for_ location $ \(a,b) -> if b == Kitchen then print a else pure () |
2024-03-23 10:41:24 +0100 | <Inst> | sort of more readable |
2024-03-23 10:41:30 +0100 | <Inst> | oh |
2024-03-23 10:41:37 +0100 | <tomsmeding> | :t when |
2024-03-23 10:41:38 +0100 | <lambdabot> | Applicative f => Bool -> f () -> f () |
2024-03-23 10:41:54 +0100 | <Inst> | for_ location $ \(a,b) -> when (b == Kitchen) (print a) |
2024-03-23 10:42:10 +0100 | <ski> | for_ location \(thing,place) -> when (place == Kitchen) do print thing |
2024-03-23 10:42:20 +0100 | <tomsmeding> | ew, BlockArguments |
2024-03-23 10:43:24 +0100 | <ski> | (`forall(Antecedent,Consequent)' means `\+ ( Antecedent,\+ Consequent )', where (\+)/1 is negation(-as-failure)) |
2024-03-23 10:43:38 +0100 | <Inst> | yeah i was instinctively going to refactor to unless, until i remmeber that when exists |
2024-03-23 10:44:04 +0100 | <Inst> | :hoogle |
2024-03-23 10:44:54 +0100 | <ski> | (==>) :: Logic m o a -> (a -> Logic m p o) -> Logic m p o -- my version of forall/2, in a Haskell eDSL |
2024-03-23 10:45:11 +0100 | <tomsmeding> | ski: /me trying to parse that with limited prolog experience; does that mean that if Consequent ever succeeds, the forall enumeration stops? |
2024-03-23 10:45:19 +0100 | <Inst> | actually sort of wishing we had a similar function |
2024-03-23 10:45:29 +0100 | <tomsmeding> | because Antecedent && not Consequent is then falsified, so the whole \+ is satisfied? |
2024-03-23 10:45:30 +0100 | <ski> | tomsmeding : yes |
2024-03-23 10:45:53 +0100 | <tomsmeding> | does 'nl' never succeed then |
2024-03-23 10:46:05 +0100 | <tomsmeding> | otherwise that forall looks different from Inst's for_ |
2024-03-23 10:46:13 +0100 | <Inst> | (Foldable t, Applicative f) => (a -> Bool) -> t a -> (a -> f b) -> f () |
2024-03-23 10:46:13 +0100 | <ski> | oh, sorry, misread you |
2024-03-23 10:46:22 +0100 | <ski> | tomsmeding : the other way around |
2024-03-23 10:46:51 +0100 | <Inst> | and of course |
2024-03-23 10:46:54 +0100 | <Inst> | (Foldable t, Applicative f) => (a -> Bool) -> t a -> (a -> f b) -> f b |
2024-03-23 10:46:58 +0100 | todi | (~todi@p57803331.dip0.t-ipconnect.de) (Remote host closed the connection) |
2024-03-23 10:47:05 +0100 | <ski> | tomsmeding : if `Consequent' gives no solution, for any particular solution of `Antecedent', then the enumeration of `Antecedent' stops, and the whole implication goal fails |
2024-03-23 10:47:27 +0100 | <ski> | tomsmeding : whole implication only succeeds, if `Consequent' succeeds for every solution of `Antecedent' |
2024-03-23 10:47:32 +0100 | <Inst> | we don't have a function like that, right? |
2024-03-23 10:47:39 +0100 | <tomsmeding> | oh right |
2024-03-23 10:47:48 +0100 | <tomsmeding> | yeah my logic intuition is not procedural enough :p |
2024-03-23 10:47:56 +0100 | <ski> | (including if `Antecedent' has no solutions at all) |
2024-03-23 10:48:17 +0100 | <mauke> | why did the original haskell spec disallow block arguments? |
2024-03-23 10:48:32 +0100 | sroso | (~sroso@user/SrOso) (Read error: Connection reset by peer) |
2024-03-23 10:48:38 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2024-03-23 10:48:40 +0100 | <ski> | however, forall/2 can only be used to *check* (yes or no) whether the implication holds. it can't be used to compute and export information from it (unless you use side-effects, of course .. like in the write/1 and nl/0 example) |
2024-03-23 10:48:59 +0100 | <ski> | .. but, my `(==>)' version *can* export information ! |
2024-03-23 10:49:31 +0100 | <Inst> | your Logic... wait, are you one of the maintainers on LogicT? |
2024-03-23 10:49:41 +0100 | <ski> | no |
2024-03-23 10:49:43 +0100 | <Inst> | i'm trying to feel around for the typing |
2024-03-23 10:49:52 +0100 | <Inst> | i know prolog is untyped |
2024-03-23 10:50:04 +0100 | <ski> | i made a different eDSL prototype, years ago |
2024-03-23 10:50:21 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 245 seconds) |
2024-03-23 10:50:42 +0100 | <ski> | (.. using an unboundendly deep monad transformer stack consisting of `ContT' frames) |
2024-03-23 10:50:44 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) |
2024-03-23 10:50:57 +0100 | <tomsmeding> | O.O |
2024-03-23 10:51:36 +0100 | <ski> | for ordinary logic programming, you need two-level continuations, `ContT o (ContT p m) a' |
2024-03-23 10:51:40 +0100 | euphores | (~SASL_euph@user/euphores) (Read error: Connection reset by peer) |
2024-03-23 10:52:03 +0100 | <ski> | but my version can "backtrack backtracking" (and "backtrack backtrack backtrackign", &c.) -- hence it needs unboundedly deep |
2024-03-23 10:52:15 +0100 | <ski> | @unmtl ContT o m a |
2024-03-23 10:52:15 +0100 | <lambdabot> | (a -> m o) -> m o |
2024-03-23 10:52:16 +0100 | euphores | (~SASL_euph@user/euphores) |
2024-03-23 10:52:22 +0100 | <ski> | @unmtl ContT o (ContT p m) a |
2024-03-23 10:52:22 +0100 | <lambdabot> | (a -> (o -> m p) -> m p) -> (o -> m p) -> m p |
2024-03-23 10:52:40 +0100 | tomsmeding | cowardly refuses to try to understand this on a saturday morning |
2024-03-23 10:52:44 +0100 | <haskellbridge> | <irregularsphere> ...backtrack backtracking? isn't that just forward tracking xD |
2024-03-23 10:53:09 +0100 | <ski> | ?- Xs = [1,4,2,9],( member(X,Xs) => X < 10 ). |
2024-03-23 10:53:12 +0100 | <ski> | true |
2024-03-23 10:53:15 +0100 | <Inst> | LP seems pretty amazing though, for how powerful it is with conditionals, however |
2024-03-23 10:53:16 +0100 | <ski> | ?- Xs = [1,4,2,9],( member(X,Xs) => X < 5 ). |
2024-03-23 10:53:18 +0100 | <ski> | false |
2024-03-23 10:53:23 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) (Ping timeout: 264 seconds) |
2024-03-23 10:53:40 +0100 | <ski> | ((=>)/2 there is implication, spelled forall/2 in e.g. SWI) |
2024-03-23 10:54:21 +0100 | <tomsmeding> | here you backtrack the backtracking you did in member/2 if it turns out the consequent doesn't hold? |
2024-03-23 10:54:22 +0100 | <ski> | ?- XYs = [(1,_),(4,_),(2,_),(9,_)],( member((X,Y),XYs) => square(X,Y) ). |
2024-03-23 10:54:22 +0100 | <ski> | XYs = [(1,1),(4,16),(2,4),(9,81)] |
2024-03-23 10:54:45 +0100 | <ski> | forall/2, defined in terms of (\+)/1 as above (negation-as-failure), *can't* do the last example above ! |
2024-03-23 10:55:22 +0100 | <ski> | because it can't export information about what `Y' has been instantiated/bound to, by the square/2 call(s), from inside to outside the implication |
2024-03-23 10:55:57 +0100 | <Inst> | not sure if i'm being too annoying |
2024-03-23 10:56:09 +0100 | <Inst> | but can LP be thought of as conditionals on steroids? |
2024-03-23 10:56:25 +0100 | <Inst> | one comment I made to others is that haskell has excellent conditions compared to more traditional languages due to pattern matching and ADTs |
2024-03-23 10:56:49 +0100 | <ski> | note that `XYs = [(1,_),(4,_),(2,_),(9,_)],( member((X,Y),XYs) => square(X,Y) )' here amounts to `XYs = [(1,Y0),(4,Y1),(2,Y2),(9,Y3)],square(1,Y0),square(4,Y1),square(2,Y2),square(9,Y3) )' |
2024-03-23 10:57:16 +0100 | <tomsmeding> | ^H |
2024-03-23 10:57:36 +0100 | sroso | (~sroso@user/SrOso) |
2024-03-23 10:57:37 +0100 | rvalue | (~rvalue@user/rvalue) (Quit: ZNC - https://znc.in) |
2024-03-23 10:57:41 +0100 | Tuplanolla | (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
2024-03-23 10:57:57 +0100 | rvalue | (~rvalue@user/rvalue) |
2024-03-23 10:57:57 +0100 | <ski> | in `( member((X,Y),XYs) => square(X,Y) )', my implementation associates `X' and `Y' with the components of a pair in `XYs', where `X' is instantiated to a number, and `Y' is aliased to the second component of the same pair. then `square(X,Y)' is called, instantiating `Y' to the square of `X' |
2024-03-23 10:58:10 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-03-23 10:58:56 +0100 | <ski> | then the member/2 call is backtracked, to generate the *next* solution for `X' and `Y'. so `X' will become uninstantiated, and then instantiated to a *different* number. and `Y' will become unaliased with the previous pair component, and aliased to another one |
2024-03-23 10:59:26 +0100 | <ski> | *despite* this, the instantiation in `XYs' of the second component of the previous pair, to the just computed square, *persists* ! |
2024-03-23 10:59:31 +0100 | <ski> | Prolog can't do this |
2024-03-23 11:00:46 +0100 | <ski> | so, `Y' is aliased to a second component of a pair. then square/2 unifies `Y' with a number, and via the alias chain, that instantiates the pair component. then the alias of `Y' to that component is broken, but the instantiation of the component persists |
2024-03-23 11:01:14 +0100 | <tomsmeding> | sounds pretty coo] |
2024-03-23 11:01:16 +0100 | <tomsmeding> | *cool |
2024-03-23 11:01:24 +0100 | <tomsmeding> | I have zero use for something like this though :p |
2024-03-23 11:01:53 +0100 | danza | (~francesco@an-19-165-10.service.infuturo.it) (Read error: Connection reset by peer) |
2024-03-23 11:01:58 +0100 | <ski> | "here you backtrack the backtracking you did in member/2 if it turns out the consequent doesn't hold?" -- well, yes .. but that doesn't really lead to anything interesting, in this example (because each number as just one square) |
2024-03-23 11:02:15 +0100 | <ski> | however, now consider .. |
2024-03-23 11:02:40 +0100 | <ski> | ?- XYs = [(_,1),(_,4),(_,9)],( member((X,Y),XYs) => square(X,Y) ). |
2024-03-23 11:02:45 +0100 | <ski> | XYs = [(1,1),(2,4),(3,9)] ; |
2024-03-23 11:02:48 +0100 | <ski> | XYs = [(1,1),(2,4),(-3,9)] ; |
2024-03-23 11:02:52 +0100 | <ski> | XYs = [(1,1),(-2,4),(3,9)] ; |
2024-03-23 11:02:54 +0100 | <ski> | XYs = [(1,1),(-2,4),(-3,9)] ; |
2024-03-23 11:02:58 +0100 | <ski> | XYs = [(-1,1),(2,4),(3,9)] ; |
2024-03-23 11:03:00 +0100 | <ski> | XYs = [(-1,1),(2,4),(-3,9)] ; |
2024-03-23 11:03:03 +0100 | <ski> | XYs = [(-1,1),(-2,4),(3,9)] ; |
2024-03-23 11:03:10 +0100 | <ski> | XYs = [(-1,1),(-2,4),(-3,9)] |
2024-03-23 11:03:15 +0100 | tomsmeding | got the point after the first two results :D |
2024-03-23 11:03:23 +0100 | <tomsmeding> | quirky |
2024-03-23 11:03:25 +0100 | <ski> | this is an example of "backtracking backtracking" |
2024-03-23 11:04:18 +0100 | <ski> | this example dynamically generates (/ operates in the same way as) a sequence of three calls to square/2, `square(X0,1),square(X1,4),square(X2,9)' |
2024-03-23 11:04:40 +0100 | <ski> | each square/2 call has two solutions, so we get `2 * 2 * 2' solutions, backtracking back and forth |
2024-03-23 11:05:43 +0100 | <ski> | in terms of (=>)/2, we first associate `X' and `Y' to the first pair, then compute `X' (instantiating that pair in `XYs'). then the same for the next pair, and the final pair |
2024-03-23 11:06:38 +0100 | <ski> | then, when we ask for the next solution, at the top-level, backtracking starts. we get back to the last square/2 call, and it generates its second solution. when we ask (`;') for the next solution, we backtrack back again, but the last call square/2 has no more solutions |
2024-03-23 11:07:35 +0100 | <ski> | so, we need to get to the next to last call. but this means we need to undo the *backtracking* that member/2 did .. because it was by backtracking member/2, that we found the three solutions (bindings to the three pairs in the list), which we then checked with square/2 |
2024-03-23 11:07:45 +0100 | <ski> | that's what i mean by "backtracking backtracking" |
2024-03-23 11:08:40 +0100 | <tomsmeding> | what languages besides haskell would you dare implement this in |
2024-03-23 11:08:44 +0100 | <ski> | there's also another interesting component of this, in that, whenever we switch polarity/context, negating it, all uninstantiated variables automagically gets turned into constants (skolems). (and vice versa) |
2024-03-23 11:09:32 +0100 | <ski> | (generating new skolems at run-time here was inspired by lambdaProlog) |
2024-03-23 11:09:50 +0100 | <ski> | (more specifically, universal implication goals generate skolems) |
2024-03-23 11:10:46 +0100 | <ski> | (er .. universal quantification, i meant to say) |
2024-03-23 11:11:56 +0100 | <ski> | .. if i just wanted to be able to have implication goals `( foo => bar )', then three continuations levels would suffice. but since i wanted to be able to nest arbitrarily, like `( ( foo => bar) => baz )',&c., i needed unbounded number of levels |
2024-03-23 11:12:33 +0100 | danza | (~francesco@151.35.171.81) |
2024-03-23 11:12:59 +0100 | <ski> | newtype Logic m o a = L (forall n p. ContStack m n => ({- exit :: -} a -> ({- redo :: -} o -> n p) -> n p) -> ({- fail :: -} o -> n p) -> n p) |
2024-03-23 11:14:01 +0100 | igemnace | (~ian@user/igemnace) |
2024-03-23 11:16:13 +0100 | <ski> | tomsmeding : well, i guess SML or OCaml might've worked. or Scheme, perhaps |
2024-03-23 11:16:53 +0100 | <tomsmeding> | if you understand very well what you're doing |
2024-03-23 11:17:16 +0100 | <ski> | but .. of course, it helped to have this be quite typeful, having the type system yell at me when i deviated from the narrow path, with pitfalls on both sides of the trail |
2024-03-23 11:17:24 +0100 | zer0bitz_ | (~zer0bitz@user/zer0bitz) |
2024-03-23 11:18:02 +0100 | <ski> | .. this whole exercise came about, as a result of trying to port a Sudoko solver from Common Lisp, to Prolog |
2024-03-23 11:19:48 +0100 | <ski> | (and then generalizing array primitives, to multi-dimensional, and then being annoyed that one aspect of that didn't work as intended .. even with some low-level unsafe mucking with update-in-place (presumably code optimization got in the way). then the idea of backtracking backtracking came to me, and i just had to implement it) |
2024-03-23 11:21:22 +0100 | <ski> | imagine a tree, with solutions at the leaves (some nodes may have zero children, and are not leaves). finding all solutions can be done with DFS through the tree. going left-to-right. "backtracking backtracking" amounts to, sometimes, going right-to-left, instead, undoing part of the traversal you've already done |
2024-03-23 11:21:26 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-03-23 11:21:49 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 11:21:52 +0100 | zer0bitz | (~zer0bitz@user/zer0bitz) (Ping timeout: 268 seconds) |
2024-03-23 11:21:57 +0100 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) |
2024-03-23 11:22:27 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds) |
2024-03-23 11:22:38 +0100 | dcoutts_ | (~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) (Ping timeout: 264 seconds) |
2024-03-23 11:23:33 +0100 | <tomsmeding> | where "normal" backtracking is merely going up and then again left-to-right in the next sibling? |
2024-03-23 11:24:10 +0100 | <ski> | yep |
2024-03-23 11:24:48 +0100 | <ski> | disjunction is concatenation, placing one tree beside another one (under a new root node, say) |
2024-03-23 11:24:55 +0100 | Lord_of_Life_ | Lord_of_Life |
2024-03-23 11:25:13 +0100 | <ski> | conjunction is grafting, putting a copy of the second conjunct, at each leaf of the first tree (conjunct) |
2024-03-23 11:25:27 +0100 | tomsmeding | . o O ( (>>=) ) |
2024-03-23 11:25:31 +0100 | <ski> | right |
2024-03-23 11:25:52 +0100 | <ski> | this i also very closely related to arithmetic on natural numbers |
2024-03-23 11:26:05 +0100 | <ski> | disjunction is addition, conjunction is multiplication, implication is exponentiation |
2024-03-23 11:26:23 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 264 seconds) |
2024-03-23 11:26:23 +0100 | <ski> | and the Church representation of naturals is two-level continuations |
2024-03-23 11:26:26 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-23 11:26:49 +0100 | <ski> | type ChurchNat = forall o. (o -> o) -> o -> o |
2024-03-23 11:27:20 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 11:27:35 +0100 | <ski> | @unmtl ContT () (Cont o) () |
2024-03-23 11:27:35 +0100 | <lambdabot> | (() -> (() -> o) -> o) -> (() -> o) -> o |
2024-03-23 11:31:36 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 245 seconds) |
2024-03-23 11:31:56 +0100 | <ski> | m + n = \s f -> m s (n s f) |
2024-03-23 11:32:07 +0100 | <ski> | = \s -> m s . n s |
2024-03-23 11:32:22 +0100 | <ski> | m * n = \s f -> m (n s) f |
2024-03-23 11:32:30 +0100 | <ski> | = \s -> m (n s) |
2024-03-23 11:32:33 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) |
2024-03-23 11:32:36 +0100 | <ski> | = m . n |
2024-03-23 11:34:46 +0100 | <ski> | n ^ m = \s f -> m (\s' f' -> n s' f') s f |
2024-03-23 11:34:46 +0100 | <tomsmeding> | naming: data ? = Explicit | Implicit |
2024-03-23 11:34:53 +0100 | <ski> | n ^ m = \s f -> m n s f |
2024-03-23 11:34:58 +0100 | <ski> | n ^ m = m n |
2024-03-23 11:35:05 +0100 | <tomsmeding> | I always loved how those simplify |
2024-03-23 11:35:56 +0100 | <ski> | the definition of `+' and `*' works without the rank-2, but the definition of `^' doesn't, because it passes `o -> o' as the `o' type parameter of `m' (it adds another continuation level to the antecedent) |
2024-03-23 11:36:38 +0100 | <mauke> | data Plicit = Ex | In |
2024-03-23 11:36:49 +0100 | <tomsmeding> | that was my first thought as well but... er |
2024-03-23 11:37:14 +0100 | ski | . o O ( `Com :: Plicit' ) |
2024-03-23 11:39:46 +0100 | <ski> | the s' above is a failure ("redo") continuation of `m', that it passes to its callback, in order for the callback to be able to backtrack, request the search for the next solution of `m' |
2024-03-23 11:40:37 +0100 | <tomsmeding> | ski: FYI I have stopped trying to properly understand this :) |
2024-03-23 11:40:39 +0100 | <ski> | but s' is passed in the argument position of *success* continuation to `n'. which means that when `n' (consequent) succeeds, we'll *fail* `m' (causing it to backtrack, possibly generating another solution and then invoking `n' again) |
2024-03-23 11:42:59 +0100 | ski | nods |
2024-03-23 11:43:19 +0100 | <Inst> | thanks ski |
2024-03-23 11:43:22 +0100 | <Inst> | for the forall |
2024-03-23 11:44:46 +0100 | <Inst> | put it into my prolog glorified hello world, feels a bit more fun |
2024-03-23 11:47:24 +0100 | <ski> | np |
2024-03-23 11:57:40 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-03-23 11:57:58 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) |
2024-03-23 11:58:21 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-03-23 11:58:40 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 12:04:02 +0100 | tv | (~tv@user/tv) (Ping timeout: 264 seconds) |
2024-03-23 12:10:38 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) (Ping timeout: 264 seconds) |
2024-03-23 12:17:08 +0100 | tv | (~tv@user/tv) |
2024-03-23 12:20:03 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds) |
2024-03-23 12:20:14 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 12:24:02 +0100 | sroso | (~sroso@user/SrOso) (Quit: Leaving :)) |
2024-03-23 12:27:17 +0100 | Inst | (~Inst@120.244.192.126) (Ping timeout: 272 seconds) |
2024-03-23 12:31:50 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
2024-03-23 12:34:56 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 245 seconds) |
2024-03-23 12:35:16 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) |
2024-03-23 12:38:36 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) |
2024-03-23 12:38:40 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) (Remote host closed the connection) |
2024-03-23 12:38:55 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) |
2024-03-23 12:55:41 +0100 | Inst | (~Inst@2409:8900:15d7:9ecd:d952:d0b5:5dd6:eba8) |
2024-03-23 13:08:36 +0100 | danza | (~francesco@151.35.171.81) (Ping timeout: 252 seconds) |
2024-03-23 13:15:04 +0100 | Inst_ | (~Inst@2409:8900:18e8:1b53:ba8d:1851:aecf:7a32) |
2024-03-23 13:17:27 +0100 | Inst | (~Inst@2409:8900:15d7:9ecd:d952:d0b5:5dd6:eba8) (Ping timeout: 260 seconds) |
2024-03-23 13:31:17 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-03-23 13:31:36 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 13:39:27 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) (Read error: Connection reset by peer) |
2024-03-23 13:42:54 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Quit: ChaiTRex) |
2024-03-23 13:44:15 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) |
2024-03-23 13:47:39 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
2024-03-23 13:48:12 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2024-03-23 13:51:53 +0100 | Inst_ | (~Inst@2409:8900:18e8:1b53:ba8d:1851:aecf:7a32) (Remote host closed the connection) |
2024-03-23 13:53:43 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) (Read error: Connection reset by peer) |
2024-03-23 13:54:56 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-03-23 13:55:23 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 13:59:40 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2024-03-23 14:00:26 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2024-03-23 14:06:57 +0100 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-03-23 14:07:09 +0100 | dcoutts_ | (~duncan@cpc69402-oxfd27-2-0-cust903.4-3.cable.virginm.net) |
2024-03-23 14:11:11 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2024-03-23 14:11:28 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2024-03-23 14:12:31 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-03-23 14:12:46 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 14:12:57 +0100 | Inst_ | (~Inst@2409:8900:18e8:1b53:ba8d:1851:aecf:7a32) |
2024-03-23 14:13:20 +0100 | <Inst_> | man, prolog is amazing |
2024-03-23 14:13:22 +0100 | Inst_ | Inst |
2024-03-23 14:13:32 +0100 | <Inst> | I mean, I should go try Mercury or something |
2024-03-23 14:13:37 +0100 | <Inst> | or Verse, for that matter, hahahaha |
2024-03-23 14:15:51 +0100 | Inst | (~Inst@2409:8900:18e8:1b53:ba8d:1851:aecf:7a32) (Read error: Connection reset by peer) |
2024-03-23 14:15:58 +0100 | Inst_ | (~Inst@223.104.40.121) |
2024-03-23 14:21:17 +0100 | lvdv | (~lvdv@203.7.118.37) (Ping timeout: 240 seconds) |
2024-03-23 14:23:15 +0100 | mzg | (mzg@lazy.unconscious.biz) (Ping timeout: 255 seconds) |
2024-03-23 14:23:18 +0100 | ph88 | (~ph88@2a02:8109:9e26:c800:d827:6191:39c4:2643) |
2024-03-23 14:23:31 +0100 | ph88 | (~ph88@2a02:8109:9e26:c800:d827:6191:39c4:2643) (Remote host closed the connection) |
2024-03-23 14:25:48 +0100 | Inst_ | Inst |
2024-03-23 14:25:49 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-03-23 14:25:58 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 14:26:12 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-03-23 14:26:23 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) |
2024-03-23 14:26:55 +0100 | Manideep | (~Manideep@2401:4900:4fd5:1d80:31a2:32ee:6c3b:9ff6) |
2024-03-23 14:28:30 +0100 | Manideep90 | (~Manideep@2401:4900:4fd5:1d80:31a2:32ee:6c3b:9ff6) |
2024-03-23 14:31:11 +0100 | euleritian | (~euleritia@dynamic-176-006-196-018.176.6.pool.telefonica.de) (Ping timeout: 264 seconds) |
2024-03-23 14:31:30 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 14:31:34 +0100 | Lycurgus | (~georg@li1192-118.members.linode.com) |
2024-03-23 14:31:34 +0100 | Lycurgus | (~georg@li1192-118.members.linode.com) (Changing host) |
2024-03-23 14:31:34 +0100 | Lycurgus | (~georg@user/Lycurgus) |
2024-03-23 14:33:56 +0100 | ania123 | (~ania123@94-43-231-47.dsl.utg.ge) |
2024-03-23 14:39:30 +0100 | Manideep90 | (~Manideep@2401:4900:4fd5:1d80:31a2:32ee:6c3b:9ff6) (Quit: Client closed) |
2024-03-23 14:39:43 +0100 | Manideep | (~Manideep@2401:4900:4fd5:1d80:31a2:32ee:6c3b:9ff6) (Quit: Client closed) |
2024-03-23 14:46:07 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) |
2024-03-23 14:49:19 +0100 | mik3d | (~mik3d@pool-173-61-131-199.cmdnnj.fios.verizon.net) (Client Quit) |
2024-03-23 14:53:43 +0100 | zer0bitz_ | zer0bitz |
2024-03-23 14:59:48 +0100 | ania123 | (~ania123@94-43-231-47.dsl.utg.ge) (Ping timeout: 250 seconds) |
2024-03-23 15:01:36 +0100 | Inst | (~Inst@223.104.40.121) (Ping timeout: 245 seconds) |
2024-03-23 15:09:58 +0100 | marinelli | (~weechat@gateway/tor-sasl/marinelli) |
2024-03-23 15:15:49 +0100 | shapr | (~user@c-24-218-186-89.hsd1.ma.comcast.net) |
2024-03-23 15:19:18 +0100 | shapr | (~user@c-24-218-186-89.hsd1.ma.comcast.net) (Remote host closed the connection) |
2024-03-23 15:19:51 +0100 | driib | (~driib@vmi931078.contaboserver.net) (Quit: The Lounge - https://thelounge.chat) |
2024-03-23 15:22:09 +0100 | driib | (~driib@vmi931078.contaboserver.net) |
2024-03-23 15:28:29 +0100 | Inst | (~Inst@120.244.192.126) |
2024-03-23 15:29:16 +0100 | Inst | (~Inst@120.244.192.126) (Remote host closed the connection) |
2024-03-23 15:29:42 +0100 | Inst | (~Inst@120.244.192.126) |
2024-03-23 15:36:02 +0100 | <Inst> | iirc Kmett mentioned he liked LogicT |
2024-03-23 15:36:50 +0100 | <Inst> | doesn't seem to be a lot of attention to LogicT |
2024-03-23 15:39:53 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-03-23 15:44:06 +0100 | alexherbo2 | (~alexherbo@2a02-8440-3441-13b3-f842-e4eb-f5b3-2e87.rev.sfr.net) |
2024-03-23 15:48:26 +0100 | Square | (~Square@user/square) |
2024-03-23 15:49:12 +0100 | Guest52 | (~Guest52@185.57.29.142) (Ping timeout: 250 seconds) |
2024-03-23 15:49:50 +0100 | ania123 | (~ania123@94-43-231-47.dsl.utg.ge) |
2024-03-23 15:51:08 +0100 | <ania123> | If we know n = N div 2^k and 2^k * (n mod 2) + N mod 2^k can we conclude N mod 2^(k+1)? |
2024-03-23 16:24:42 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2024-03-23 16:25:34 +0100 | mc47 | (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
2024-03-23 16:46:39 +0100 | sadie_ | (~sadie@c-76-155-235-153.hsd1.co.comcast.net) (Remote host closed the connection) |
2024-03-23 16:49:41 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 240 seconds) |
2024-03-23 16:49:56 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) (Ping timeout: 245 seconds) |
2024-03-23 16:50:23 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 16:57:16 +0100 | Inst | (~Inst@120.244.192.126) (Remote host closed the connection) |
2024-03-23 16:57:43 +0100 | Inst | (~Inst@120.244.192.126) |
2024-03-23 17:11:59 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-03-23 17:12:31 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 17:15:12 +0100 | tzh | (~tzh@c-73-164-206-160.hsd1.or.comcast.net) |
2024-03-23 17:20:10 +0100 | otto_s | (~user@p5b04451e.dip0.t-ipconnect.de) (Quit: leaving) |
2024-03-23 17:21:16 +0100 | otto_s | (~user@p5b04451e.dip0.t-ipconnect.de) |
2024-03-23 17:24:31 +0100 | otto_s | (~user@p5b04451e.dip0.t-ipconnect.de) (Client Quit) |
2024-03-23 17:28:41 +0100 | ania123 | (~ania123@94-43-231-47.dsl.utg.ge) (Quit: Client closed) |
2024-03-23 17:29:35 +0100 | otto_s | (~user@p5b04451e.dip0.t-ipconnect.de) |
2024-03-23 17:41:26 +0100 | <Inst> | btw, just to confirm |
2024-03-23 17:41:29 +0100 | <Inst> | I can liftIO into STM, right? |
2024-03-23 17:41:59 +0100 | <Inst> | oh, it's not MonadIO |
2024-03-23 17:42:16 +0100 | <Inst> | would require twiddling to make sure the IO action only fires if the STM action succeeds, which is probably not possible |
2024-03-23 17:49:06 +0100 | trev | (~trev@user/trev) (Ping timeout: 252 seconds) |
2024-03-23 17:51:01 +0100 | econo_ | (uid147250@id-147250.tinside.irccloud.com) |
2024-03-23 17:51:07 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) () |
2024-03-23 17:53:38 +0100 | Guest52 | (~Guest52@185.57.29.142) |
2024-03-23 17:56:01 +0100 | <monochrom> | Any wish for injecting IO into STM leads to questionable semantics only. Don't even try. |
2024-03-23 17:56:11 +0100 | <monochrom> | Ugh pun on "try" hahaha. |
2024-03-23 18:02:29 +0100 | <Inst> | by the way, just curious |
2024-03-23 18:02:29 +0100 | <Inst> | https://www.fpcomplete.com/haskell/library/stm/ |
2024-03-23 18:02:32 +0100 | <Inst> | what's happening here? |
2024-03-23 18:02:46 +0100 | <Inst> | it's a freakshow because there should be a new TVar being created every time |
2024-03-23 18:02:56 +0100 | <Inst> | but somehow replicateM_ etc is sharing the TVar |
2024-03-23 18:04:20 +0100 | <monochrom> | Huh that's a long article. How do I jump right to the code fragment you are talking about? |
2024-03-23 18:04:58 +0100 | <Inst> | oh, doip, it is creating a single TVar |
2024-03-23 18:05:05 +0100 | <Inst> | basics |
2024-03-23 18:05:38 +0100 | <Inst> | it's returning an IO action, of all things |
2024-03-23 18:06:27 +0100 | <monochrom> | Soon you will find that STM (IO X) is a liberating technique, too. |
2024-03-23 18:06:56 +0100 | <Inst> | Why does that sound sinister? |
2024-03-23 18:07:19 +0100 | <Inst> | so the IO action is containing the created TVar, and thus inheriting it |
2024-03-23 18:07:44 +0100 | <Inst> | this seems horrifically sinister |
2024-03-23 18:08:13 +0100 | <monochrom> | It is just, for example, [IO X] but s/[]/STM/ |
2024-03-23 18:08:23 +0100 | <monochrom> | Or as you have seen, s/[]/IO/ |
2024-03-23 18:09:26 +0100 | <monochrom> | In other FP languages, it is just [() -> X], STM (() -> X), and () -> (() -> X), respectively. |
2024-03-23 18:09:28 +0100 | <Inst> | wow, so this is a valid and horrifying way to work with mutables that feels so much like an OOP "new" |
2024-03-23 18:10:15 +0100 | <Inst> | private methods / properties! |
2024-03-23 18:10:39 +0100 | <Inst> | it doesn't help that i've been in poor emotional health recently, but thank you Haskell, for horrifying me even more |
2024-03-23 18:10:39 +0100 | <monochrom> | In this realm we call them closures. |
2024-03-23 18:10:54 +0100 | <Inst> | "a poor man's object, just as objects are a poor man's closures" |
2024-03-23 18:12:45 +0100 | <monochrom> | One person's horror movie is another person's comedy. |
2024-03-23 18:13:26 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Ping timeout: 260 seconds) |
2024-03-23 18:14:15 +0100 | <monochrom> | True story: I went to watch The Neon Demon. The only other audience in the theatre were two girls. At the most horrifying and gross scene, they laughed. I admire that. |
2024-03-23 18:14:19 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2024-03-23 18:17:22 +0100 | <monochrom> | Also, if you learn monads by way of (fmap, pure, join) rather than the usual >>=, then IO (IO X) is a necessity. join :: IO (IO X) -> IO X. |
2024-03-23 18:17:23 +0100 | <Inst> | it seems more reasonable to just build an object via record types and IO functions, then use lens / optics to manipulate them and call it a day |
2024-03-23 18:17:27 +0100 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-03-23 18:17:44 +0100 | <Inst> | join + fmap actually makes more sense and is more accessible |
2024-03-23 18:18:05 +0100 | <monochrom> | Sure. So you have IO MyRecord, no? |
2024-03-23 18:18:18 +0100 | <Inst> | If you need inheritance, just stack your objects together |
2024-03-23 18:18:28 +0100 | <Inst> | it's actually neater than 23482 method OOP objects in OOP languages |
2024-03-23 18:18:37 +0100 | <monochrom> | But MyRecord ≅ (X -> IO Y, A -> IO B, S -> IO T), no? |
2024-03-23 18:18:57 +0100 | <Inst> | or just IO foo, etc, operating on a TVar |
2024-03-23 18:19:04 +0100 | <monochrom> | Therefore you have IO (X -> IO Y, A -> IO B, S -> IO T), no? |
2024-03-23 18:19:19 +0100 | <Inst> | what are you implying? |
2024-03-23 18:19:20 +0100 | <monochrom> | Now how is that "better" than IO (IO Z)? |
2024-03-23 18:19:36 +0100 | <Inst> | don't worry, monochrom, my mirth is proportional to my horror |
2024-03-23 18:20:23 +0100 | <monochrom> | In fact, IO MyRecord is IO (IO Z) on steroid. It is not "simpler" or whatever euphemism. |
2024-03-23 18:20:36 +0100 | <Inst> | because of private methods and properties |
2024-03-23 18:20:54 +0100 | <Inst> | Someone really needs to write the blog post "Haskell is the best OOP language" |
2024-03-23 18:21:32 +0100 | igemnace | (~ian@user/igemnace) (Read error: Connection reset by peer) |
2024-03-23 18:22:18 +0100 | falafel | (~falafel@2607:fb91:8aa:877b:ec1c:7577:7427:5731) |
2024-03-23 18:22:34 +0100 | <monochrom> | The only thing I can agree to is that by the time you have a 3-tuple it is probably better to change it to a user-defined named record type. (But even that depends on the actual situation.) |
2024-03-23 18:23:27 +0100 | <monochrom> | But don't lie to yourself. IO MyRecord is an extension of the IO (IO Z) idea, not a watering down. |
2024-03-23 18:23:56 +0100 | emmanuelux | (~emmanuelu@user/emmanuelux) |
2024-03-23 18:24:04 +0100 | <Inst> | it is, but if it's already essentially OOP, just do real OOP isntead of faking it |
2024-03-23 18:24:33 +0100 | <monochrom> | Oh I don't mind calling it OO. |
2024-03-23 18:24:44 +0100 | <Inst> | might as well add -XOverloadedRecordDot |
2024-03-23 18:25:23 +0100 | <Inst> | and I still think it's moral to have to jump through hoops to get your fake OOP objects instead of having first-class syntactical support |
2024-03-23 18:25:52 +0100 | <c_wraith> | there's nothing about OOP that requires dots. |
2024-03-23 18:27:15 +0100 | <Inst> | i actually use overloadedrecorddot a lot |
2024-03-23 18:27:28 +0100 | <tomsmeding> | what was that "rule" called again that if a name is longer than its definition, you can better just inline it? |
2024-03-23 18:27:40 +0100 | <Inst> | you have private properties and methods via the mutvar, |
2024-03-23 18:28:05 +0100 | <c_wraith> | tomsmeding: something about the Fairborn threshold? |
2024-03-23 18:28:16 +0100 | zetef | (~quassel@2a02:2f00:500b:ce00:aba1:3782:4e7c:41a) |
2024-03-23 18:28:22 +0100 | <tomsmeding> | fairbairn, thanks c_wraith |
2024-03-23 18:28:32 +0100 | <monochrom> | This is where I agree with https://cs.brown.edu/courses/csci1730/2012/ about ignoring "paradigms" "FP" "OOP" etc, and instead speak of more fine-grained constructs, e.g., closures, mutable states. |
2024-03-23 18:28:34 +0100 | <c_wraith> | I'm very bad at names |
2024-03-23 18:28:34 +0100 | <ski> | "real OOP" has little to do with concrete syntax |
2024-03-23 18:28:43 +0100 | <tomsmeding> | c_wraith: good enough to tickle my memory :) |
2024-03-23 18:29:57 +0100 | <monochrom> | I recommend watching at least the first lecture video, where the prof explains what's wrong with "paradigms" and what he does instead. |
2024-03-23 18:31:15 +0100 | <monochrom> | To a large extent, since then, I axiomatize "paradigm = religion". And in secular matters such as programming, I denounce religions. |
2024-03-23 18:34:08 +0100 | <monochrom> | In Haskell's STM and even IO, a closure over a mutable variable is a useful technique. (As with all techniques, use it with discretion.) It does not matter that people call that "OO" or "actor model" or "the way of the saviour" or "the way of the tempter". |
2024-03-23 18:35:01 +0100 | <monochrom> | But yeah, what's really wrong is the stance that if it is called "OO" then it must be in Java syntax. |
2024-03-23 18:37:52 +0100 | enikar | thinks smalltalk doesn't use dot to call a message of an object… |
2024-03-23 18:38:16 +0100 | <monochrom> | OCaml uses # instead of dot. :) |
2024-03-23 18:38:36 +0100 | <ski> | closing over lexical scope is one take on "OO". existentials is another. record types is a third |
2024-03-23 18:38:59 +0100 | igemnace | (~ian@user/igemnace) |
2024-03-23 18:39:00 +0100 | <ski> | enikar ifTrue: [ ... ] ifFalse: [ ... ] |
2024-03-23 18:39:13 +0100 | <enikar> | ski: yes ;) |
2024-03-23 18:40:52 +0100 | <Inst> | i mean if you're a pragmatist, and you find all this FP GUI stuff experimental and immature, you might as well switch to OOP-based GUI |
2024-03-23 18:41:13 +0100 | <Inst> | being able to use mutvars to implement objects is a plus, not a minus |
2024-03-23 18:41:24 +0100 | <tomsmeding> | GUI is still hard, though |
2024-03-23 18:42:29 +0100 | <Inst> | I just got a sort of horror of OOP from the Haskell community, so just seeing Snoyman using a closure to manage and hide TVars in STM was sort of a shock |
2024-03-23 18:42:32 +0100 | <monochrom> | I am beginning to feel that when I write in OO-GUI I am hand-compiling reactive programming to OO code. |
2024-03-23 18:43:12 +0100 | <monochrom> | And the only reason I tolerate that is only because OO-GUI libraries are more ready for production. |
2024-03-23 18:43:56 +0100 | igemnace | (~ian@user/igemnace) (Quit: WeeChat 4.2.1) |
2024-03-23 18:43:59 +0100 | <c_wraith> | If only someone had started a 20-programmer full-time effort to build a good haskell GUI library 15 years ago. It might be starting to get decent by now! |
2024-03-23 18:44:34 +0100 | ski | reminisces Fudgets |
2024-03-23 18:44:45 +0100 | <monochrom> | And we all know how this kind of things is determined solely by historical accidents not technical merit. |
2024-03-23 18:45:17 +0100 | <ski> | "worse is better",&c. |
2024-03-23 18:46:01 +0100 | <monochrom> | For example, the only reason mutable state is dominant is because Turing and von Neumann were born 100 years ago rather than 100 years in the future. |
2024-03-23 18:46:24 +0100 | <monochrom> | Because without them, Church would be the only game in town. |
2024-03-23 18:46:46 +0100 | <tomsmeding> | are you sure? |
2024-03-23 18:46:54 +0100 | <monochrom> | >:) |
2024-03-23 18:47:01 +0100 | <tomsmeding> | I'm not saying you're wrong in general, but for this particular thing I doubt |
2024-03-23 18:47:28 +0100 | <tomsmeding> | surely someone would have figured out that register machines are useful to implement as hardware chips |
2024-03-23 18:48:22 +0100 | <tomsmeding> | the first technology has the advantage of more prior work, but a silicon processor based on functional concepts would have been... challenging |
2024-03-23 18:53:43 +0100 | ski | . o O ( "The Rise of Worse is Better" (in "Lisp: Good News, Bad News, How to Win Big") by Richard P. Gabriel in 1991 at <https://dreamsongs.com/RiseOfWorseIsBetter.html>,<https://dreamsongs.com/WorseIsBetter.html>,<https://dreamsongs.com/WIB.html> ) |
2024-03-23 18:57:41 +0100 | ph88 | (~ph88@2a02:8109:9e26:c800:32fc:1140:12f0:2672) |
2024-03-23 19:05:19 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 256 seconds) |
2024-03-23 19:06:02 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Quit: Leaving) |
2024-03-23 19:06:47 +0100 | <ph88> | anyone know how to watch the hs and automatically build & run the program? I'm using stack |
2024-03-23 19:06:50 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) (Remote host closed the connection) |
2024-03-23 19:07:41 +0100 | chiselfuse | (~chiselfus@user/chiselfuse) |
2024-03-23 19:07:49 +0100 | <monochrom> | https://hackage.haskell.org/package/ghcide and give it the stack command. |
2024-03-23 19:08:37 +0100 | <monochrom> | It's a general "watch and run command" program that defaults to command=ghc but you can change it to anything. |
2024-03-23 19:09:28 +0100 | destituion | (~destituio@2a02:2121:655:c95b:88d4:b861:7bfd:c1a4) (Ping timeout: 255 seconds) |
2024-03-23 19:09:41 +0100 | euleritian | (~euleritia@dynamic-046-114-095-014.46.114.pool.telefonica.de) |
2024-03-23 19:09:43 +0100 | destituion | (~destituio@2001:4644:c37:0:6086:64f4:a213:b80d) |
2024-03-23 19:10:41 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2024-03-23 19:10:42 +0100 | trev | (~trev@user/trev) |
2024-03-23 19:11:39 +0100 | <ph88> | thanks ! |
2024-03-23 19:14:48 +0100 | <geekosaur> | doesn't "stack watch" do that? |
2024-03-23 19:15:22 +0100 | <monochrom> | :( |
2024-03-23 19:15:35 +0100 | <monochrom> | "not on my watch" :) |
2024-03-23 19:16:10 +0100 | <geekosaur> | also are you confusing ghcide with ghcid? |
2024-03-23 19:16:36 +0100 | <monochrom> | Oh right! OOps sorry! |
2024-03-23 19:16:46 +0100 | <geekosaur> | ghcide is part og HLS |
2024-03-23 19:16:51 +0100 | <monochrom> | https://hackage.haskell.org/package/ghcid |
2024-03-23 19:16:59 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2024-03-23 19:19:30 +0100 | mechap | (~mechap@user/mechap) |
2024-03-23 19:21:29 +0100 | zetef | (~quassel@2a02:2f00:500b:ce00:aba1:3782:4e7c:41a) (Ping timeout: 272 seconds) |
2024-03-23 19:28:44 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2024-03-23 19:29:46 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) |
2024-03-23 19:41:00 +0100 | <Inst> | so, about STM |
2024-03-23 19:41:12 +0100 | <Inst> | I suppose you COULD attempt an unsafePerformIO read |
2024-03-23 19:41:52 +0100 | <Inst> | not sure if that's safe, though |
2024-03-23 19:42:08 +0100 | <Inst> | then you could attempt to run a retry, then return an IO action, and employ what Snoyman calls the join trick |
2024-03-23 19:42:11 +0100 | <Inst> | https://www.fpcomplete.com/haskell/library/stm/ |
2024-03-23 19:42:20 +0100 | <Inst> | atomically :: STM a -> IO a |
2024-03-23 19:42:33 +0100 | <Inst> | then join to compress IO (IO a) into IO a at the end |
2024-03-23 19:43:04 +0100 | <Inst> | it only returns and runs if the STM succeeds, no? |
2024-03-23 19:43:12 +0100 | <Inst> | or am I mistaken somewhere here? |
2024-03-23 19:45:39 +0100 | <[exa]> | good evening all |
2024-03-23 19:46:02 +0100 | <[exa]> | Inst: what's the goal there? |
2024-03-23 19:46:05 +0100 | shapr | (~user@c-24-218-186-89.hsd1.ma.comcast.net) |
2024-03-23 19:46:06 +0100 | <monochrom> | Instead of a direct clumsy answer, I'll just show you this idiom: |
2024-03-23 19:46:47 +0100 | <Inst> | [exa]: I discovered that logic programming is cool, which sort of brought me into backtracking capabilities in Haskell in an attempt to learn how to mimic logic programming |
2024-03-23 19:46:55 +0100 | <Inst> | STM is interesting for that reason |
2024-03-23 19:46:58 +0100 | <monochrom> | join ( (foo >> pure (putStrLn x) `orElse` (bar >> pure (putStrLn y)) ) |
2024-03-23 19:47:20 +0100 | <monochrom> | err |
2024-03-23 19:47:28 +0100 | <monochrom> | join (atomically ( (foo >> pure (putStrLn x) `orElse` (bar >> pure (putStrLn y)) )) |
2024-03-23 19:47:37 +0100 | <[exa]> | ah yeah logic programming is underappreciated. |
2024-03-23 19:47:53 +0100 | <monochrom> | equivalently, do-notation: a <- atomically ( (foo >> pure (putStrLn x) `orElse` (bar >> pure (putStrLn y)) ); a |
2024-03-23 19:48:27 +0100 | <geekosaur> | also iirc the RTS will abort if you use unsafePerformIO with STM |
2024-03-23 19:48:59 +0100 | <geekosaur> | (although maybe only if you use STM inside an unsafePerformIO) |
2024-03-23 19:50:32 +0100 | <monochrom> | One of those times when a long article is less efficient than just one line of code and "exercise for the reader: play with various foo and bar and learn what this idiom does for you". |
2024-03-23 19:50:51 +0100 | <monochrom> | Not to mention that playing is a better way to learn than reading. |
2024-03-23 19:51:57 +0100 | <Inst> | this is awesome |
2024-03-23 19:52:58 +0100 | <monochrom> | That idiom was what I had in mind when I said that STM (IO X) is useful. I did not really think of closures containing states. |
2024-03-23 19:53:15 +0100 | <monochrom> | But OK putStrLn contains states too, so meh. |
2024-03-23 19:53:27 +0100 | <monochrom> | (buffers, for starters) |
2024-03-23 19:53:55 +0100 | <monochrom> | Err no, that doesn't count. I had "pure" there heh. |
2024-03-23 19:58:45 +0100 | zetef | (~quassel@2a02:2f00:500b:ce00:aba1:3782:4e7c:41a) |
2024-03-23 20:00:09 +0100 | falafel | (~falafel@2607:fb91:8aa:877b:ec1c:7577:7427:5731) (Remote host closed the connection) |
2024-03-23 20:02:02 +0100 | euleritian | (~euleritia@dynamic-046-114-095-014.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-03-23 20:02:12 +0100 | falafel | (~falafel@2607:fb91:8aa:877b:ec1c:7577:7427:5731) |
2024-03-23 20:02:21 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 20:03:17 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-23 20:07:11 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 264 seconds) |
2024-03-23 20:09:34 +0100 | euleritian | (~euleritia@dynamic-046-114-095-014.46.114.pool.telefonica.de) |
2024-03-23 20:10:19 +0100 | vgtw | (~vgtw@user/vgtw) (Quit: ZNC - https://znc.in) |
2024-03-23 20:20:16 +0100 | dsrt^ | (~cd@c-98-242-74-66.hsd1.ga.comcast.net) (Remote host closed the connection) |
2024-03-23 20:20:43 +0100 | thailigur | (~thailigur@151.240.245.105) |
2024-03-23 20:20:58 +0100 | thailigur | (~thailigur@151.240.245.105) (Client Quit) |
2024-03-23 20:26:39 +0100 | euleritian | (~euleritia@dynamic-046-114-095-014.46.114.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-03-23 20:26:58 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 20:28:48 +0100 | thailigur | (~thailigur@185.110.188.241) |
2024-03-23 20:30:52 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-23 20:32:01 +0100 | falafel | (~falafel@2607:fb91:8aa:877b:ec1c:7577:7427:5731) (Ping timeout: 245 seconds) |
2024-03-23 20:32:06 +0100 | Daxson_ | (~Daxson@176.254.244.83) |
2024-03-23 20:33:08 +0100 | Silver_X | (~Silver_X@182.178.246.138) |
2024-03-23 20:35:19 +0100 | Daxson | (~Daxson@176.254.244.83) (Ping timeout: 268 seconds) |
2024-03-23 20:46:16 +0100 | target_i | (~target_i@user/target-i/x-6023099) (Quit: leaving) |
2024-03-23 21:07:24 +0100 | thailigur | (~thailigur@185.110.188.241) (Quit: Client closed) |
2024-03-23 21:07:51 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 260 seconds) |
2024-03-23 21:08:47 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 21:17:41 +0100 | qeef | (~qeef@138-169-143-94.cust.centrio.cz) |
2024-03-23 21:19:15 +0100 | Daxson | (~Daxson@176.254.244.83) |
2024-03-23 21:22:01 +0100 | Daxson_ | (~Daxson@176.254.244.83) (Ping timeout: 245 seconds) |
2024-03-23 21:26:59 +0100 | TonyStone | (~TonyStone@074-076-057-186.res.spectrum.com) |
2024-03-23 21:29:19 +0100 | a51 | (a51@gateway/vpn/protonvpn/a51) |
2024-03-23 21:30:45 +0100 | ezzieyguywuf | (~Unknown@user/ezzieyguywuf) (Ping timeout: 252 seconds) |
2024-03-23 21:30:56 +0100 | endojelly | (~eselber_p@user/endojelly) (Ping timeout: 260 seconds) |
2024-03-23 21:32:34 +0100 | ezzieyguywuf | (~Unknown@user/ezzieyguywuf) |
2024-03-23 21:33:55 +0100 | visilii | (~visilii@188.254.126.99) |
2024-03-23 21:34:07 +0100 | endojelly | (~eselber_p@user/endojelly) |
2024-03-23 21:50:17 +0100 | szkl | (uid110435@id-110435.uxbridge.irccloud.com) |
2024-03-23 22:03:12 +0100 | tt1231 | (~tt1231@2603-6010-8700-4a81-219f-50d3-618a-a6ee.res6.spectrum.com) (Read error: Connection reset by peer) |
2024-03-23 22:03:36 +0100 | tt1231 | (~tt1231@2603-6010-8700-4a81-219f-50d3-618a-a6ee.res6.spectrum.com) |
2024-03-23 22:05:01 +0100 | Lycurgus | (~georg@user/Lycurgus) (Quit: leaving) |
2024-03-23 22:05:44 +0100 | Silver_X | (~Silver_X@182.178.246.138) (Quit: Leaving) |
2024-03-23 22:06:28 +0100 | todi | (~todi@p57803331.dip0.t-ipconnect.de) |
2024-03-23 22:12:20 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-23 22:13:11 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-23 22:13:47 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-03-23 22:14:35 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 22:22:52 +0100 | _ht | (~Thunderbi@28-52-174-82.ftth.glasoperator.nl) (Remote host closed the connection) |
2024-03-23 22:30:46 +0100 | tt12310 | (~tt1231@075-185-104-199.res.spectrum.com) |
2024-03-23 22:33:43 +0100 | tt1231 | (~tt1231@2603-6010-8700-4a81-219f-50d3-618a-a6ee.res6.spectrum.com) (Ping timeout: 268 seconds) |
2024-03-23 22:33:44 +0100 | tt12310 | tt1231 |
2024-03-23 22:36:11 +0100 | TonyStone | (~TonyStone@074-076-057-186.res.spectrum.com) (Ping timeout: 245 seconds) |
2024-03-23 22:40:45 +0100 | Lycurgus | (~georg@user/Lycurgus) |
2024-03-23 22:41:29 +0100 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-03-23 23:01:11 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 245 seconds) |
2024-03-23 23:06:37 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 23:16:27 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 272 seconds) |
2024-03-23 23:25:16 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 23:28:05 +0100 | qeef | (~qeef@138-169-143-94.cust.centrio.cz) (Ping timeout: 240 seconds) |
2024-03-23 23:30:46 +0100 | peterbecich | (~Thunderbi@047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds) |
2024-03-23 23:30:46 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Read error: Connection reset by peer) |
2024-03-23 23:31:39 +0100 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) |
2024-03-23 23:37:14 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
2024-03-23 23:52:03 +0100 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-03-23 23:57:00 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Ping timeout: 255 seconds) |