Logs on 2025-02-09 (liberachat/#haskell)
| 00:06:02 | × | mesaoptimizer0 quits (~mesaoptim@user/PapuaHardyNet) (Ping timeout: 265 seconds) |
| 00:06:02 | × | jathan quits (~jathan@69.61.93.38) (Ping timeout: 265 seconds) |
| 00:06:09 | → | alfiee joins (~alfiee@user/alfiee) |
| 00:10:28 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds) |
| 00:13:34 | × | Maxdamantus quits (~Maxdamant@user/maxdamantus) (Ping timeout: 244 seconds) |
| 00:16:53 | × | TMA quits (tma@twin.jikos.cz) (Ping timeout: 248 seconds) |
| 00:17:38 | × | mulk quits (~mulk@pd95141d7.dip0.t-ipconnect.de) (Ping timeout: 265 seconds) |
| 00:18:05 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 268 seconds) |
| 00:18:07 | × | m1dnight quits (~m1dnight@d8D861908.access.telenet.be) (Ping timeout: 265 seconds) |
| 00:19:49 | → | m1dnight joins (~m1dnight@d8D861908.access.telenet.be) |
| 00:20:09 | → | mulk joins (~mulk@pd95141d7.dip0.t-ipconnect.de) |
| 00:20:15 | × | otbergsten quits (~otbergste@user/otbergsten) () |
| 00:20:20 | → | Maxdamantus joins (~Maxdamant@user/maxdamantus) |
| 00:20:33 | × | L29Ah quits (~L29Ah@wikipedia/L29Ah) (Ping timeout: 268 seconds) |
| 00:21:15 | → | jathan joins (~jathan@2607:1a00:0:19::2:1dc) |
| 00:25:14 | → | TMA joins (tma@twin.jikos.cz) |
| 00:36:05 | zero | is now known as zwro |
| 00:37:29 | → | L29Ah joins (~L29Ah@wikipedia/L29Ah) |
| 00:40:00 | → | alx741 joins (~alx741@186.33.188.229) |
| 00:43:56 | → | yegorc joins (~yegorc@user/yegorc) |
| 00:44:24 | → | aaronv joins (~aaronv@user/aaronv) |
| 00:44:32 | → | Square2 joins (~Square@user/square) |
| 00:44:34 | → | Square3 joins (~Square@user/square) |
| 00:47:00 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 264 seconds) |
| 00:47:24 | → | ljdarj1 joins (~Thunderbi@user/ljdarj) |
| 00:47:53 | × | sprotte24 quits (~sprotte24@p200300d16f1e3a00501959556750eb7a.dip0.t-ipconnect.de) (Quit: Leaving) |
| 00:49:58 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 00:50:19 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 260 seconds) |
| 00:50:19 | ljdarj1 | is now known as ljdarj |
| 00:54:53 | → | alfiee joins (~alfiee@user/alfiee) |
| 00:57:47 | → | migas97787 joins (~migas@static.140.65.63.178.clients.your-server.de) |
| 00:59:15 | → | sixfourtwelve joins (~ethanmorg@82.18.82.103) |
| 00:59:16 | × | sixfourtwelve quits (~ethanmorg@82.18.82.103) (Client Quit) |
| 00:59:24 | × | migas9778 quits (~migas@static.140.65.63.178.clients.your-server.de) (Read error: Connection reset by peer) |
| 00:59:24 | migas97787 | is now known as migas9778 |
| 00:59:33 | → | sixfourtwelve joins (~ethanmorg@82.18.82.103) |
| 00:59:41 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 265 seconds) |
| 01:05:05 | × | alx741 quits (~alx741@186.33.188.229) (Quit: alx741) |
| 01:21:31 | × | sixfourtwelve quits (~ethanmorg@82.18.82.103) (Quit: leaving) |
| 01:21:40 | → | Guest46 joins (~Guest46@149.40.58.147) |
| 01:25:03 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 01:25:18 | × | acidjnk_new3 quits (~acidjnk@p200300d6e7283f0584678bbe6a824f58.dip0.t-ipconnect.de) (Ping timeout: 268 seconds) |
| 01:31:17 | × | Guest46 quits (~Guest46@149.40.58.147) (Quit: Client closed) |
| 01:35:28 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 01:36:15 | → | califax joins (~califax@user/califx) |
| 01:43:37 | → | alfiee joins (~alfiee@user/alfiee) |
| 01:43:59 | × | Tuplanolla quits (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) (Quit: Leaving.) |
| 01:48:07 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 268 seconds) |
| 02:14:18 | × | aaronv quits (~aaronv@user/aaronv) (Ping timeout: 252 seconds) |
| 02:18:59 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@79.127.217.43) |
| 02:23:35 | → | aaronv joins (~aaronv@user/aaronv) |
| 02:28:07 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 02:29:14 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
| 02:32:00 | × | gmg quits (~user@user/gehmehgeh) (Ping timeout: 264 seconds) |
| 02:32:02 | → | alfiee joins (~alfiee@user/alfiee) |
| 02:32:10 | → | gmg joins (~user@user/gehmehgeh) |
| 02:36:50 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 268 seconds) |
| 02:53:33 | → | tavare joins (~tavare@150.129.88.189) |
| 02:53:33 | × | tavare quits (~tavare@150.129.88.189) (Changing host) |
| 02:53:33 | → | tavare joins (~tavare@user/tavare) |
| 03:05:04 | × | op_4 quits (~tslil@user/op-4/x-9116473) (Remote host closed the connection) |
| 03:05:35 | → | op_4 joins (~tslil@user/op-4/x-9116473) |
| 03:20:26 | → | alfiee joins (~alfiee@user/alfiee) |
| 03:23:03 | × | Jeanne-Kamikaze quits (~Jeanne-Ka@79.127.217.43) (Quit: Leaving) |
| 03:24:36 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 03:47:14 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 03:59:25 | × | jle` quits (~jle`@2603:8001:3b02:84d4:6618:6c83:b259:edfc) (Ping timeout: 252 seconds) |
| 04:02:18 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Remote host closed the connection) |
| 04:03:48 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 264 seconds) |
| 04:04:31 | × | TheCoffeMaker quits (~TheCoffeM@user/thecoffemaker) (Ping timeout: 244 seconds) |
| 04:08:19 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 04:08:50 | → | alfiee joins (~alfiee@user/alfiee) |
| 04:13:54 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 272 seconds) |
| 04:17:57 | × | aaronv quits (~aaronv@user/aaronv) (Ping timeout: 248 seconds) |
| 04:22:21 | → | aaronv joins (~aaronv@user/aaronv) |
| 04:32:59 | → | jle` joins (~jle`@syn-023-240-067-073.res.spectrum.com) |
| 04:34:54 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 04:35:53 | <tri> | hi, why is this not working please? |
| 04:35:55 | <tri> | https://paste.tomsmeding.com/jV6JdsBd |
| 04:36:48 | <tri> | it has something to do with 2 parameters passing into zip, but I can't really explain |
| 04:39:51 | → | dtman34 joins (~dtman34@c-75-72-179-251.hsd1.mn.comcast.net) |
| 04:43:45 | <tri> | seems like I can only compose 1 input function... |
| 04:44:02 | <monochrom> | Do you accept: getTotalDistance xs ys = sum (zipWith (\(left, right) -> abs $ left -right) xs ys) |
| 04:45:48 | <tri> | yea that works, I'm just trying to make it work using function composition. I forgot what concept force me to use 1 input function to compose, I have to look it up |
| 04:47:13 | × | yegorc quits (~yegorc@user/yegorc) (Quit: Leaving) |
| 04:47:30 | <tri> | btw I've just come back to Haskell after a long break, and still seeing you here helping people out. Thank you |
| 04:51:33 | → | encyde joins (~ensyde@2601:5c6:c200:6dc0::16fe) |
| 04:54:10 | → | aforemny_ joins (~aforemny@2001:9e8:6cdf:f800:9bf4:7ea7:4c6a:c80f) |
| 04:55:19 | × | aforemny quits (~aforemny@2001:9e8:6cc0:9f00:f26a:4821:630d:3b0c) (Ping timeout: 260 seconds) |
| 04:56:34 | → | alfiee joins (~alfiee@user/alfiee) |
| 04:57:26 | <tri> | oh the (.) is actually a function, which takes two 1-input functions |
| 04:57:46 | <tri> | so that's why zip was failing because it is a 2-input function |
| 05:01:02 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 05:01:09 | <monochrom> | Now to probe the boundary of your understanding, "g xs ys = sum (zipWith f xs ys)" can still be simplified with (.), but only as: g xs = sum . zipWith f xs |
| 05:06:27 | <tri> | hmm ok |
| 05:07:41 | × | jle` quits (~jle`@syn-023-240-067-073.res.spectrum.com) (Quit: WeeChat 4.5.1) |
| 05:14:10 | → | jle` joins (~jle`@2603:8001:3b00:11:8cd8:7ce2:93ee:a30) |
| 05:18:58 | → | Loshki joins (~Loshki@c-98-42-126-198.hsd1.ca.comcast.net) |
| 05:19:02 | ← | Loshki parts (~Loshki@c-98-42-126-198.hsd1.ca.comcast.net) (Leaving) |
| 05:27:17 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 05:28:07 | × | weary-traveler quits (~user@user/user363627) (Quit: Konversation terminated!) |
| 05:34:52 | → | weary-traveler joins (~user@user/user363627) |
| 05:35:00 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 264 seconds) |
| 05:41:06 | <tri> | https://paste.tomsmeding.com/XPlMpEUw |
| 05:42:09 | <tri> | Cannot apply expression of type ‘m0 a0’ |
| 05:42:09 | <tri> | to a visible type argument ‘[Int] |
| 05:42:20 | <tri> | how could I fix this please? I don't understand the error message, especially m0 and a0 |
| 05:42:32 | <c_wraith> | Add parens |
| 05:42:36 | <c_wraith> | return (...) |
| 05:42:47 | <int-e> | :t return read |
| 05:42:48 | <lambdabot> | (Monad m, Read a) => m (String -> a) |
| 05:43:01 | <int-e> | that's the m0 a0, more or less |
| 05:43:18 | <int-e> | the "expression of type ‘m0 a0’" I mean |
| 05:43:44 | <int-e> | you can drop the @[Int], but you still need parentheses |
| 05:44:14 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds) |
| 05:44:21 | <int-e> | (the type will then be taken from the type signature or `readList`) |
| 05:44:29 | <int-e> | s/or/of/ |
| 05:44:38 | → | alfiee joins (~alfiee@user/alfiee) |
| 05:45:36 | <int-e> | tri: keep in mind that in Haskell `return` is a function, not syntax. |
| 05:46:09 | <monochrom> | Conversely, I see people writing in C "return(x+y)" all the time. :) |
| 05:47:55 | <tri> | ah! thank you. It's been a long time since I last used Haskell :) |
| 05:49:14 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 268 seconds) |
| 05:56:45 | <ski> | @type readLn -- tri |
| 05:56:45 | <lambdabot> | Read a => IO a |
| 05:57:23 | <ski> | better to use that, rather than `getLine' & `read' |
| 05:58:18 | <ski> | (if there's parse-error, that will raise the error while the action is executed, as opposed to when the result is forced) |
| 06:01:12 | × | chiselfuse quits (~chiselfus@user/chiselfuse) (Remote host closed the connection) |
| 06:01:49 | → | chiselfuse joins (~chiselfus@user/chiselfuse) |
| 06:06:39 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 06:08:29 | <tri> | thank you |
| 06:13:17 | × | aaronv quits (~aaronv@user/aaronv) (Ping timeout: 268 seconds) |
| 06:14:23 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 06:14:49 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 265 seconds) |
| 06:14:49 | tnt2 | is now known as tnt1 |
| 06:16:13 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 06:16:58 | → | gmg joins (~user@user/gehmehgeh) |
| 06:18:08 | → | aaronv joins (~aaronv@user/aaronv) |
| 06:20:00 | × | Square2 quits (~Square@user/square) (Quit: Leaving) |
| 06:25:01 | Square3 | is now known as Square2 |
| 06:27:44 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 06:29:05 | → | img joins (~img@user/img) |
| 06:29:22 | × | tri quits (~tri@2601:182:780:720::55a0) (Remote host closed the connection) |
| 06:32:43 | → | alfiee joins (~alfiee@user/alfiee) |
| 06:34:02 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 06:34:48 | × | euphores quits (~SASL_euph@user/euphores) (Quit: Leaving.) |
| 06:35:21 | → | img joins (~img@user/img) |
| 06:37:05 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 06:37:59 | × | forell quits (~forell@user/forell) (Ping timeout: 260 seconds) |
| 06:43:13 | × | jjhoo_ quits (jahakala@user/jjhoo) (Remote host closed the connection) |
| 06:44:35 | → | euphores joins (~SASL_euph@user/euphores) |
| 06:45:10 | → | causal joins (~eric@50.35.84.231) |
| 06:54:56 | × | causal quits (~eric@50.35.84.231) (Quit: WeeChat 4.5.1) |
| 06:55:09 | → | jjhoo joins (jahakala@user/jjhoo) |
| 07:20:28 | → | alfiee joins (~alfiee@user/alfiee) |
| 07:25:10 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 272 seconds) |
| 07:43:07 | → | tri joins (~tri@c-73-186-227-171.hsd1.ct.comcast.net) |
| 07:47:30 | × | tri quits (~tri@c-73-186-227-171.hsd1.ct.comcast.net) (Ping timeout: 252 seconds) |
| 07:47:51 | → | r-sta joins (~r-sta@sgyl-37-b2-v4wan-168528-cust2421.vm6.cable.virginm.net) |
| 07:47:53 | <r-sta> | why dont we have numbers at type level? |
| 07:48:27 | <r-sta> | is it because the class system does not work at type level? |
| 07:48:35 | <r-sta> | can i use associated type families? |
| 07:48:53 | <r-sta> | i should be able to have a binary encoding be just as good as Nats |
| 07:49:19 | <r-sta> | esp because when its supposed to recurse over nat parametric instances... |
| 07:49:25 | <r-sta> | and it has to prove constraints |
| 07:49:51 | <r-sta> | its always saying things like "idk if 1+(x-1) = x" and stuff |
| 07:50:40 | <r-sta> | maybe im being mistaken to think that an abstract representation for numbers would solve anything |
| 07:51:13 | <r-sta> | infact, i always opt for the represtanttion that does basically tail recursion by being a piano natural |
| 07:51:24 | × | r-sta quits (~r-sta@sgyl-37-b2-v4wan-168528-cust2421.vm6.cable.virginm.net) (Client Quit) |
| 08:00:00 | × | caconym quits (~caconym@user/caconym) (Quit: bye) |
| 08:00:07 | × | tt12310978324354 quits (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) (Quit: The Lounge - https://thelounge.chat) |
| 08:00:58 | → | caconym joins (~caconym@user/caconym) |
| 08:04:15 | → | tt12310978324354 joins (~tt1231@2603:6010:8700:4a81:219f:50d3:618a:a6ee) |
| 08:08:53 | → | alfiee joins (~alfiee@user/alfiee) |
| 08:10:45 | → | acidjnk_new3 joins (~acidjnk@p200300d6e7283f26657989b577b132fd.dip0.t-ipconnect.de) |
| 08:12:04 | × | rvalue quits (~rvalue@user/rvalue) (Read error: Connection reset by peer) |
| 08:12:39 | → | rvalue joins (~rvalue@user/rvalue) |
| 08:13:02 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds) |
| 08:14:31 | → | tabaqui1 joins (~root@87.200.129.102) |
| 08:16:20 | → | kenran joins (~kenran@user/kenran) |
| 08:26:13 | × | aaronv quits (~aaronv@user/aaronv) (Ping timeout: 245 seconds) |
| 08:26:21 | × | monochrom quits (trebla@216.138.220.146) (Quit: ZNC 1.9.1+deb1 - https://znc.in) |
| 08:33:30 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 08:33:42 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 244 seconds) |
| 08:33:42 | tnt2 | is now known as tnt1 |
| 08:33:42 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds) |
| 08:35:45 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 08:37:53 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 245 seconds) |
| 08:38:23 | → | monochrom joins (trebla@216.138.220.146) |
| 08:38:29 | → | tnt1 joins (~Thunderbi@user/tnt1) |
| 08:40:52 | × | tzh quits (~tzh@c-76-115-131-146.hsd1.or.comcast.net) (Quit: zzz) |
| 08:41:21 | × | euphores quits (~SASL_euph@user/euphores) (Read error: Connection reset by peer) |
| 08:41:26 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 08:42:48 | × | chiselfuse quits (~chiselfus@user/chiselfuse) (Ping timeout: 264 seconds) |
| 08:42:57 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds) |
| 08:42:58 | tnt2 | is now known as tnt1 |
| 08:44:26 | → | chiselfuse joins (~chiselfus@user/chiselfuse) |
| 08:46:57 | → | __monty__ joins (~toonn@user/toonn) |
| 08:48:38 | <tomsmeding> | peutri: that's hilarious. |
| 08:48:41 | × | kenran quits (~kenran@user/kenran) (Ping timeout: 268 seconds) |
| 08:48:59 | <tomsmeding> | you can even read it as "fix it" with a bit of imagination. |
| 08:49:17 | <tomsmeding> | :t fix error |
| 08:49:18 | <lambdabot> | [Char] |
| 08:49:22 | <tomsmeding> | ah too bad |
| 08:50:35 | → | euphores joins (~SASL_euph@user/euphores) |
| 08:53:13 | → | takuan joins (~takuan@d8D86B601.access.telenet.be) |
| 08:53:43 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 245 seconds) |
| 08:55:41 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 08:56:37 | → | alfiee joins (~alfiee@user/alfiee) |
| 09:00:50 | × | dsrt^ quits (~dsrt@108.192.66.114) (Ping timeout: 252 seconds) |
| 09:01:05 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 265 seconds) |
| 09:01:34 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 252 seconds) |
| 09:20:20 | <mauke> | fix id ~ undefined |
| 09:20:38 | <mauke> | Void ~ newtype V = MkV V |
| 09:24:15 | → | kenran joins (~kenran@user/kenran) |
| 09:25:04 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 09:29:30 | × | tri quits (~tri@2601:182:780:720::55a0) (Ping timeout: 246 seconds) |
| 09:44:30 | → | dsrt^ joins (~dsrt@108.192.66.114) |
| 09:45:01 | → | alfiee joins (~alfiee@user/alfiee) |
| 09:49:14 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 09:51:26 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds) |
| 09:52:12 | mniip_ | is now known as mniip |
| 09:58:14 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 10:02:24 | → | otbergsten joins (~otbergste@user/otbergsten) |
| 10:13:08 | → | lxsameer joins (~lxsameer@Serene/lxsameer) |
| 10:13:09 | × | econo_ quits (uid147250@id-147250.tinside.irccloud.com) (Quit: Connection closed for inactivity) |
| 10:21:29 | × | Square2 quits (~Square@user/square) (Remote host closed the connection) |
| 10:23:07 | → | Square2 joins (~Square@user/square) |
| 10:27:36 | → | Tuplanolla joins (~Tuplanoll@91-159-69-59.elisa-laajakaista.fi) |
| 10:28:15 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 10:31:10 | → | dhil joins (~dhil@2a0c:b381:5bf:3500:ab56:7ab1:bb07:5d4e) |
| 10:33:05 | → | alfiee joins (~alfiee@user/alfiee) |
| 10:33:06 | × | tri quits (~tri@2601:182:780:720::55a0) (Ping timeout: 276 seconds) |
| 10:33:18 | → | misterfish joins (~misterfis@84.53.85.146) |
| 10:37:45 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 265 seconds) |
| 10:43:44 | × | Square2 quits (~Square@user/square) (Ping timeout: 260 seconds) |
| 10:44:56 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 10:56:37 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 11:07:43 | × | dhil quits (~dhil@2a0c:b381:5bf:3500:ab56:7ab1:bb07:5d4e) (Ping timeout: 265 seconds) |
| 11:10:24 | → | sprotte24 joins (~sprotte24@p200300d16f25850039a3b2714e26a8e3.dip0.t-ipconnect.de) |
| 11:21:29 | → | alfiee joins (~alfiee@user/alfiee) |
| 11:22:16 | → | tri joins (~tri@c-73-186-227-171.hsd1.ct.comcast.net) |
| 11:25:41 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 248 seconds) |
| 11:26:45 | × | tri quits (~tri@c-73-186-227-171.hsd1.ct.comcast.net) (Ping timeout: 248 seconds) |
| 11:28:54 | → | ss4 joins (~wootehfoo@user/wootehfoot) |
| 11:29:28 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 11:34:19 | × | tri quits (~tri@2601:182:780:720::55a0) (Ping timeout: 260 seconds) |
| 11:43:00 | → | famubu joins (~julinuser@14.139.174.50) |
| 11:43:00 | × | famubu quits (~julinuser@14.139.174.50) (Changing host) |
| 11:43:00 | → | famubu joins (~julinuser@user/famubu) |
| 11:43:49 | <famubu> | How can we get a function to decrement an integer like we can increment with `(+1)`? I tried `(-1)` but it is same as `-1`. |
| 11:44:40 | <famubu> | `(-1) 4` doesn't decrement, but `(1-) 4` does. |
| 11:45:36 | <tomsmeding> | :t subtract 1 |
| 11:45:37 | <lambdabot> | Num a => a -> a |
| 11:46:03 | <tomsmeding> | or set LexicalNegation and use (- 1) :p |
| 11:46:29 | <tomsmeding> | famubu: ^ |
| 11:51:30 | <mauke> | > map (\f -> f 4) [subtract 1, pred, (+(-1))] |
| 11:51:31 | <lambdabot> | [3,3,3] |
| 11:52:14 | <mauke> | > map (\f -> f 4) [subtract 1, pred, (+(-1)), flip (-) 1] |
| 11:52:16 | <lambdabot> | [3,3,3,3] |
| 11:53:00 | <tomsmeding> | mind that one of those is not like the others |
| 11:53:13 | <mauke> | oh, it's about to get wrose |
| 11:53:24 | <tomsmeding> | > map (\f -> f (minBound :: Int)) [subtract 1, (+(-1)), flip (-) 1, pred] |
| 11:53:25 | <lambdabot> | [9223372036854775807,9223372036854775807,9223372036854775807,*Exception: Pre... |
| 11:53:42 | <tomsmeding> | > succ (maxBound :: Int) -- similarly |
| 11:53:43 | <lambdabot> | *Exception: Prelude.Enum.succ{Int}: tried to take `succ' of maxBound |
| 11:54:12 | <mauke> | > map (\f -> f 4) [subtract 1, pred, (+(-1)), flip (-) 1, complement . negate] |
| 11:54:14 | <lambdabot> | [3,3,3,3,3] |
| 12:00:54 | × | mrmr155334346318 quits (~mrmr@user/mrmr) (Quit: Bye, See ya later!) |
| 12:02:15 | → | target_i joins (~target_i@user/target-i/x-6023099) |
| 12:02:30 | <int-e> | :t (-1+) |
| 12:02:30 | <lambdabot> | Num a => a -> a |
| 12:02:57 | <tomsmeding> | wait why is that a thing without LexicalNegation |
| 12:03:24 | <int-e> | I don't know. It's a thing that GHC and Hugs used to disagree on. Hugs wanted (+ -1) instead. |
| 12:04:08 | <int-e> | the precedence of unary minus agrees with the default ones of - and + (what's that, 5? No, it's 6. |
| 12:04:24 | × | bcksl quits (~bcksl@user/bcksl) (Quit: \) |
| 12:04:24 | × | end quits (~end@user/end/x-0094621) (Quit: end) |
| 12:09:06 | <mauke> | pickup_artist = complement . negate |
| 12:09:53 | → | alfiee joins (~alfiee@user/alfiee) |
| 12:09:58 | <tomsmeding> | map ($ 4) [complement <$> negate, complement <&> negate] |
| 12:10:00 | <tomsmeding> | > map ($ 4) [complement <$> negate, complement <&> negate] |
| 12:10:02 | <lambdabot> | [3,5] |
| 12:12:18 | → | mrmr155334346318 joins (~mrmr@user/mrmr) |
| 12:13:25 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 268 seconds) |
| 12:14:19 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds) |
| 12:14:34 | <int-e> | the mother of all bit hacks |
| 12:17:43 | × | misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 252 seconds) |
| 12:21:23 | × | tavare quits (~tavare@user/tavare) (Remote host closed the connection) |
| 12:22:23 | → | bcksl joins (~bcksl@user/bcksl) |
| 12:23:29 | → | sixfourtwelve joins (~ethanmorg@82.18.82.103) |
| 12:23:38 | → | tri joins (~tri@c-73-186-227-171.hsd1.ct.comcast.net) |
| 12:24:18 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 12:25:17 | → | Digitteknohippie joins (~user@user/digit) |
| 12:25:48 | × | Digit quits (~user@user/digit) (Ping timeout: 245 seconds) |
| 12:32:24 | × | tri quits (~tri@c-73-186-227-171.hsd1.ct.comcast.net) (Ping timeout: 252 seconds) |
| 12:32:41 | → | end joins (~end@user/end/x-0094621) |
| 12:34:23 | × | pie_ quits (~pie_bnc@user/pie/x-2818909) (Quit: No Ping reply in 180 seconds.) |
| 12:35:14 | → | Guest75 joins (~Guest63@2405:201:e02d:9053:c861:d50c:f158:db37) |
| 12:35:33 | × | Guest75 quits (~Guest63@2405:201:e02d:9053:c861:d50c:f158:db37) (Client Quit) |
| 12:35:42 | → | pie_ joins (~pie_bnc@user/pie/x-2818909) |
| 12:37:14 | → | ash3en1 joins (~Thunderbi@146.70.124.222) |
| 12:37:47 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Ping timeout: 244 seconds) |
| 12:37:48 | ash3en1 | is now known as ash3en |
| 12:40:58 | → | misterfish joins (~misterfis@84.53.85.146) |
| 12:47:05 | → | ljdarj joins (~Thunderbi@user/ljdarj) |
| 12:49:33 | × | kenran quits (~kenran@user/kenran) (Remote host closed the connection) |
| 12:51:16 | → | dhil joins (~dhil@2a0c:b381:5bf:3500:e1f7:3d09:6349:4c17) |
| 12:54:10 | → | Square2 joins (~Square@user/square) |
| 12:59:57 | → | alfiee joins (~alfiee@user/alfiee) |
| 13:00:54 | → | yegorc joins (~yegorc@user/yegorc) |
| 13:01:48 | → | xff0x_ joins (~xff0x@2405:6580:b080:900:a75:2366:4e5c:4ce9) |
| 13:02:45 | × | xff0x quits (~xff0x@2405:6580:b080:900:a44a:d727:8d11:d274) (Ping timeout: 268 seconds) |
| 13:04:03 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 246 seconds) |
| 13:06:36 | → | benjamin joins (~benjamin@2a03:4b80:a720:6e10:2b04:9d3:4ad9:6811) |
| 13:07:38 | Digitteknohippie | is now known as Digit |
| 13:07:39 | × | ash3en quits (~Thunderbi@146.70.124.222) (Quit: ash3en) |
| 13:10:32 | × | m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 252 seconds) |
| 13:11:04 | ss4 | is now known as wootehfoot |
| 13:13:04 | xff0x_ | is now known as xff0x |
| 13:14:30 | → | euouae joins (~euouae@user/euouae) |
| 13:14:47 | <euouae> | Does anyone else find lsp-haskell to be finicky on emacs? |
| 13:15:31 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 13:15:57 | × | sixfourtwelve quits (~ethanmorg@82.18.82.103) (Quit: leaving) |
| 13:16:01 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds) |
| 13:18:43 | → | tnt1 joins (~Thunderbi@user/tnt1) |
| 13:19:49 | × | tnt2 quits (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds) |
| 13:23:14 | × | benjamin quits (~benjamin@2a03:4b80:a720:6e10:2b04:9d3:4ad9:6811) (Quit: benjamin) |
| 13:23:24 | → | benjamin joins (~benjamin@2a03:4b80:a720:6e10:8b55:ff55:7658:babe) |
| 13:28:29 | × | benjamin quits (~benjamin@2a03:4b80:a720:6e10:8b55:ff55:7658:babe) (Quit: benjamin) |
| 13:28:39 | → | benjamin joins (~benjamin@2a03:4b80:a720:6e10:8b55:ff55:7658:babe) |
| 13:30:46 | × | benjamin quits (~benjamin@2a03:4b80:a720:6e10:8b55:ff55:7658:babe) (Client Quit) |
| 13:30:54 | → | benjamin joins (~benjamin@2a03:4b80:a720:6e10:8b55:ff55:7658:babe) |
| 13:32:04 | → | m5zs7k joins (aquares@web10.mydevil.net) |
| 13:32:30 | × | ft quits (~ft@p3e9bcd97.dip0.t-ipconnect.de) (Ping timeout: 276 seconds) |
| 13:33:51 | → | ft joins (~ft@p4fc2a610.dip0.t-ipconnect.de) |
| 13:34:31 | → | JuanDaugherty joins (~juan@user/JuanDaugherty) |
| 13:35:36 | × | benjamin quits (~benjamin@2a03:4b80:a720:6e10:8b55:ff55:7658:babe) (Ping timeout: 265 seconds) |
| 13:41:21 | → | benjamin joins (~benjamin@2a03:4b80:a720:6e10:c43:857b:f09b:159d) |
| 13:41:38 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 13:42:07 | JuanDaugherty | is now known as ColinRobinson |
| 13:42:13 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 248 seconds) |
| 13:42:13 | tnt2 | is now known as tnt1 |
| 13:45:08 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 13:46:28 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds) |
| 13:48:21 | → | alfiee joins (~alfiee@user/alfiee) |
| 13:48:43 | → | tnt1 joins (~Thunderbi@user/tnt1) |
| 13:50:03 | × | tnt2 quits (~Thunderbi@user/tnt1) (Ping timeout: 276 seconds) |
| 13:52:42 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 13:59:41 | × | benjamin quits (~benjamin@2a03:4b80:a720:6e10:c43:857b:f09b:159d) (Quit: benjamin) |
| 14:01:52 | × | misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 252 seconds) |
| 14:04:04 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds) |
| 14:05:47 | × | igemnace quits (~igemnace@user/igemnace) (Quit: ZNC 1.9.0+deb2build3 - https://znc.in) |
| 14:08:07 | × | encyde quits (~ensyde@2601:5c6:c200:6dc0::16fe) (Ping timeout: 268 seconds) |
| 14:08:39 | → | igemnace joins (~igemnace@user/igemnace) |
| 14:10:57 | × | otbergsten quits (~otbergste@user/otbergsten) (Remote host closed the connection) |
| 14:11:04 | ← | euouae parts (~euouae@user/euouae) () |
| 14:13:04 | → | tnt1 joins (~Thunderbi@user/tnt1) |
| 14:15:56 | → | tnt2 joins (~Thunderbi@user/tnt1) |
| 14:17:16 | × | tnt1 quits (~Thunderbi@user/tnt1) (Ping timeout: 252 seconds) |
| 14:17:16 | tnt2 | is now known as tnt1 |
| 14:17:34 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 14:21:07 | × | dhil quits (~dhil@2a0c:b381:5bf:3500:e1f7:3d09:6349:4c17) (Ping timeout: 244 seconds) |
| 14:21:57 | → | paul_j joins (~user@8.190.187.81.in-addr.arpa) |
| 14:22:19 | × | tri quits (~tri@2601:182:780:720::55a0) (Ping timeout: 260 seconds) |
| 14:22:52 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 14:23:04 | × | yegorc quits (~yegorc@user/yegorc) (Quit: Leaving) |
| 14:23:15 | <kaol> | > take 5 [1..5] :: [NominalDiffTime] |
| 14:23:16 | <lambdabot> | error: |
| 14:23:17 | <lambdabot> | Not in scope: type constructor or class ‘NominalDiffTime’ |
| 14:23:30 | → | yegorc joins (~yegorc@user/yegorc) |
| 14:31:44 | × | tri quits (~tri@2601:182:780:720::55a0) (Remote host closed the connection) |
| 14:32:02 | → | tri joins (~tri@c-73-186-227-171.hsd1.ct.comcast.net) |
| 14:37:05 | → | alfiee joins (~alfiee@user/alfiee) |
| 14:40:06 | × | todi quits (~todi@p57803331.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
| 14:40:19 | → | todi joins (~todi@p57803331.dip0.t-ipconnect.de) |
| 14:40:23 | × | erdem quits (~erdem@user/erdem) (Quit: ZNC 1.9.1 - https://znc.in) |
| 14:42:02 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 268 seconds) |
| 14:44:24 | × | lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 252 seconds) |
| 15:03:05 | haritz | is now known as saimazoon |
| 15:04:12 | × | paul_j quits (~user@8.190.187.81.in-addr.arpa) (Read error: Connection reset by peer) |
| 15:04:56 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds) |
| 15:07:06 | → | lxsameer joins (~lxsameer@Serene/lxsameer) |
| 15:10:12 | × | tri quits (~tri@c-73-186-227-171.hsd1.ct.comcast.net) (Remote host closed the connection) |
| 15:18:51 | → | piele joins (~piele@eiseth.creativeserver.net) |
| 15:21:56 | × | ColinRobinson quits (~juan@user/JuanDaugherty) (Quit: praxis.meansofproduction.biz (juan@acm.org)) |
| 15:25:11 | → | alfiee joins (~alfiee@user/alfiee) |
| 15:26:39 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 15:29:30 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 15:32:18 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 15:33:03 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Client Quit) |
| 15:49:07 | → | tri joins (~tri@c-73-186-227-171.hsd1.ct.comcast.net) |
| 15:49:20 | → | erdem joins (~erdem@user/erdem) |
| 15:54:08 | ← | erdem parts (~erdem@user/erdem) (WeeChat 3.8) |
| 15:54:26 | → | kenran joins (~kenran@user/kenran) |
| 15:56:19 | <EvanR> | % take 5 [1..5] :: [NominalDiffTime] |
| 15:56:19 | <yahb2> | <interactive>:115:19: error: [GHC-76037] ; Not in scope: type constructor or class ‘NominalDiffTime’ |
| 15:57:01 | <EvanR> | the bots inhabit a dimension without time like that entity at the end of dr strange |
| 15:57:22 | × | tri quits (~tri@c-73-186-227-171.hsd1.ct.comcast.net) (Ping timeout: 252 seconds) |
| 15:59:26 | <ski> | % import Data.Time.Clock |
| 15:59:26 | <yahb2> | <no output> |
| 15:59:28 | <ski> | % take 5 [1..5] :: [NominalDiffTime] |
| 15:59:28 | <yahb2> | [1s,1.000000000001s,1.000000000002s,1.000000000003s,1.000000000004s] |
| 16:00:04 | ski | notes a bad `Show' instance |
| 16:00:38 | <EvanR> | what the actual F though |
| 16:00:56 | <EvanR> | NominalDiffTime is implemented as a Pico |
| 16:01:03 | <ski> | % (read . show) (take 5 [1..5]) :: [NominalDiffTime] |
| 16:01:03 | <yahb2> | *** Exception: Prelude.read: no parse |
| 16:01:07 | <EvanR> | how did we get 1.0000000004 |
| 16:01:27 | <EvanR> | oooh |
| 16:01:44 | <EvanR> | wait |
| 16:01:47 | <EvanR> | wtf |
| 16:02:23 | <EvanR> | % take 5 (enumFrom [2..]) :: [NominalDiffTime] |
| 16:02:23 | <yahb2> | <interactive>:129:18: error: [GHC-83865] ; • Couldn't match expected type ‘NominalDiffTime’ ; with actual type ‘[a0]’ ; • In the first argument of ‘enumFrom’, namely ‘[2 .... |
| 16:02:35 | <EvanR> | % take 5 (enumFrom 2) :: [NominalDiffTime] |
| 16:02:35 | <yahb2> | [2s,2.000000000001s,2.000000000002s,2.000000000003s,2.000000000004s] |
| 16:03:06 | <EvanR> | I was so used to the Enum instance of floats |
| 16:04:10 | <EvanR> | floats and NominalDiffTime are like bargin bin real numbers so I dunno if Enum makes sense |
| 16:04:58 | → | j1n37- joins (~j1n37@user/j1n37) |
| 16:05:48 | × | j1n37 quits (~j1n37@user/j1n37) (Ping timeout: 252 seconds) |
| 16:14:15 | → | alfiee joins (~alfiee@user/alfiee) |
| 16:17:07 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 16:18:38 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 16:19:06 | → | manwithluck` joins (~manwithlu@2a09:bac1:5be0:20::49:de) |
| 16:22:09 | × | manwithluck quits (~manwithlu@194.177.28.164) (Ping timeout: 276 seconds) |
| 16:24:49 | × | eL_Bart0 quits (eL_Bart0@dietunichtguten.org) (Ping timeout: 248 seconds) |
| 16:34:46 | → | rvalue- joins (~rvalue@user/rvalue) |
| 16:35:30 | × | rvalue quits (~rvalue@user/rvalue) (Ping timeout: 252 seconds) |
| 16:36:55 | → | dhil joins (~dhil@2a0c:b381:5bf:3500:6cf:adc3:4aba:323f) |
| 16:40:56 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 16:41:36 | <justsomeguy> | What is lifting in functional programming? I've read a few definitions, but it doesn't make sense to me right now. |
| 16:42:07 | <EvanR> | there's a few things referred to as lifting |
| 16:42:33 | <EvanR> | unrelated things |
| 16:43:16 | rvalue- | is now known as rvalue |
| 16:43:47 | <EvanR> | any function of type A -> B can be lifted to a function on F a, where F is a Functor, using fmap |
| 16:44:29 | <mauke> | lift0 :: a -> F a; lift1 :: (a -> b) -> (F a -> F b); lift2 :: (a -> b -> c) -> (F a -> F b -> F c) |
| 16:44:39 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 16:44:50 | <EvanR> | any monadic action m a can be lifted to an action in t m a where t is monad transformer, with lift |
| 16:44:51 | <ncf> | it's a terrible word used all over the place by people trying to sound mathy |
| 16:45:17 | <EvanR> | a lifted type is an type with an additional semantics bottom |
| 16:45:36 | <EvanR> | like Int has a bottom while Int# doesn't |
| 16:46:01 | <mauke> | isn't that a boxed type? |
| 16:46:05 | <monochrom> | Yeah, disregard the "intuitive" word "lifting". Learn each of Functor's fmap, Applicative's liftA2, MonadTrans's lift on its own terms. |
| 16:46:08 | <EvanR> | it's also boxed |
| 16:47:03 | <EvanR> | Only Int where data Only a = MkOnly a is lifted a second time |
| 16:47:11 | <mauke> | and here I thought lifting and boxing made you sound jocky, not nerdy |
| 16:47:12 | <monochrom> | In general, learn everything on its own terms, disregard "meaningful" names. |
| 16:47:17 | <EvanR> | lol |
| 16:47:41 | <monochrom> | GHC does the heavy-lifting. |
| 16:48:06 | <monochrom> | GHC does the heavy-lifting, but you have to think outside the box. |
| 16:48:42 | <EvanR> | RealWorld is deeply magical. It is primitive, but it is not unlifted. |
| 16:49:45 | <monochrom> | lifted types have bottoms, boxed types take heap space. For example array types are unlifted but boxed. |
| 16:50:33 | <monochrom> | But that's about the only exception to the lifted-boxed correlation. :) |
| 16:50:44 | <mauke> | magical realism |
| 16:50:57 | <EvanR> | RealWorld is "not unlifted" |
| 16:51:10 | <EvanR> | smh so british |
| 16:51:39 | <monochrom> | Speaking of which, "heap" is another great example of having multiple unrelated meanings. |
| 16:53:03 | <mauke> | why do we have stacks and heaps, but no piles? |
| 16:53:29 | <monochrom> | After a while you ought to realize that there are fewer "intuition"s than there are mutually unrelated concepts. That should inform you how "helpful" "intuition"s are. |
| 16:53:39 | <EvanR> | https://en.wikipedia.org/wiki/Pile_(abstract_data_type) |
| 16:54:01 | <monochrom> | https://www.smbc-comics.com/comic/precise |
| 16:54:40 | <justsomeguy> | I'll admit that the only part of your explanation I understood was the first bit (a -> b) -> (f a -> f b), which can work on multiple arities of functions. |
| 16:54:48 | × | tri quits (~tri@2601:182:780:720::55a0) (Remote host closed the connection) |
| 16:55:01 | <justsomeguy> | I haven't gotten to monad transformers yet, and don't really understand what an action is. |
| 16:55:14 | <EvanR> | like, getChar :: IO Char |
| 16:55:17 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 16:55:17 | <EvanR> | it's an IO action |
| 16:55:27 | <mauke> | ignore things that don't make sense yet |
| 16:56:14 | <monochrom> | Sure. Learn what you're ready to or interested in. Just disbelieve meaningful names and essay "explanation"s. |
| 16:56:23 | <mauke> | but I'll mention that Functor provides (a -> b) -> (f a -> f b), and Applicative provides all other arities |
| 16:56:29 | <mniip> | I like how "hence ptrArg" refers to nothing anymore |
| 16:57:07 | <mauke> | :t pure |
| 16:57:08 | <lambdabot> | Applicative f => a -> f a |
| 16:57:12 | <mauke> | :t liftA2 |
| 16:57:13 | <lambdabot> | Applicative f => (a -> b -> c) -> f a -> f b -> f c |
| 16:59:32 | <EvanR> | then hoist had the decency to use a different word for something unrelated |
| 17:02:16 | <mauke> | :t hoist lift |
| 17:02:17 | <lambdabot> | error: |
| 17:02:17 | <lambdabot> | Variable not in scope: hoist :: (m0 a0 -> t0 m0 a0) -> t |
| 17:02:59 | → | alfiee joins (~alfiee@user/alfiee) |
| 17:03:36 | <mauke> | EvanR: that wp article sucks |
| 17:04:24 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 264 seconds) |
| 17:05:00 | <haskellbridge> | <Bowuigi> The intuition for lift is mostly "put this thing inside this other thing that's higher up", where "thing", "higher up", "inside" and "put" are context specific. Usually liftings are sort of "free", as in, they don't add more properties than the ones implied by the other context |
| 17:05:42 | <mauke> | "put this thing inside this other thing" => embed |
| 17:07:05 | <justsomeguy> | An unwrapper wrapper function? |
| 17:07:16 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 244 seconds) |
| 17:09:13 | <haskellbridge> | <Bowuigi> It can sometimes wrap functions but it isn't a wrapper function |
| 17:09:35 | <haskellbridge> | <Bowuigi> mauke the "higher up" is what turns embed into lift I guess |
| 17:11:52 | <haskellbridge> | <Bowuigi> For example, liftFree lifts a Functor "f" into a Monad "Free f" |
| 17:13:23 | <EvanR> | mauke, ikr |
| 17:14:47 | <haskellbridge> | <Bowuigi> Usually "inverses" to lift, pure and embed are prefixed with run, un and lower, and folds and traversals with fold, traverse, elim, cata, mcata, for |
| 17:15:29 | <haskellbridge> | <Bowuigi> Maps are usually prefixed with map or on |
| 17:16:22 | → | aaronv joins (~aaronv@user/aaronv) |
| 17:16:27 | × | Axman6 quits (~Axman6@user/axman6) (Ping timeout: 248 seconds) |
| 17:17:25 | <haskellbridge> | <Bowuigi> Which word to use depends on the context. Stuff that represents wrappers tends to use wrap/embed and un, stuff that represents computations pure and run, categorical stuff lift and lower, etc |
| 17:21:05 | → | tzh joins (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
| 17:25:58 | × | kenran quits (~kenran@user/kenran) (Remote host closed the connection) |
| 17:32:01 | → | kenran joins (~kenran@user/kenran) |
| 17:32:43 | × | gutszu quits (~gutszu@187.85.204.144) (Quit: Client closed) |
| 17:42:36 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 17:43:26 | × | tri quits (~tri@2601:182:780:720::55a0) (Remote host closed the connection) |
| 17:43:38 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 17:50:44 | × | dhil quits (~dhil@2a0c:b381:5bf:3500:6cf:adc3:4aba:323f) (Ping timeout: 268 seconds) |
| 17:51:44 | → | alfiee joins (~alfiee@user/alfiee) |
| 17:54:06 | → | machinedgod joins (~machinedg@d108-173-18-100.abhsia.telus.net) |
| 17:56:09 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 18:02:36 | × | AkechiShiro quits (~licht@user/akechishiro) (Ping timeout: 246 seconds) |
| 18:02:56 | × | Raito_Bezarius quits (~Raito@wireguard/tunneler/raito-bezarius) (Ping timeout: 272 seconds) |
| 18:04:46 | → | AkechiShiro joins (~licht@user/akechishiro) |
| 18:05:05 | <tri> | https://paste.tomsmeding.com/kY0jmKNs |
| 18:05:33 | <tri> | I would like to keep the type variable a instead of changing it to a concrete type like Int, which will be compilable |
| 18:05:55 | <tomsmeding> | :t read |
| 18:05:56 | <lambdabot> | Read a => String -> a |
| 18:06:11 | <tomsmeding> | tri: mind that `Read a` constraint |
| 18:06:11 | <tri> | I *understand* that keeping just at a will not compile, because read will not know what to parse to |
| 18:06:12 | → | Raito_Bezarius joins (~Raito@wireguard/tunneler/raito-bezarius) |
| 18:06:19 | <tomsmeding> | no, that's not the problem |
| 18:06:29 | <tomsmeding> | `read` knows damn well what to parse to: it's `a` |
| 18:06:34 | <tomsmeding> | it just doesn't know _how_ |
| 18:06:42 | <tomsmeding> | the `Read a` constraint contains information that tells it how |
| 18:06:55 | <tri> | yea Tom, so I tried to use the type Num a => String -> IO a, in hope that read can parse to a Num |
| 18:06:57 | <tri> | but it still fail |
| 18:07:09 | <tomsmeding> | try Read a instead of Num a ;) |
| 18:07:17 | <tomsmeding> | Num and Read are unrelated |
| 18:07:38 | <tri> | ah ok let me read it a bit more to understand |
| 18:07:40 | <tri> | thank you |
| 18:07:47 | ← | yegorc parts (~yegorc@user/yegorc) (Leaving) |
| 18:08:05 | <tomsmeding> | `Num` tells you how (+), (-), (*), negate, abas, signum and fromInteger are defined |
| 18:08:23 | <tomsmeding> | there's also, of course, a bunch more functions that can work using just those few, and those work on any Num type too |
| 18:08:40 | <tomsmeding> | `Read` tells you how `read` is defined, essentially |
| 18:09:01 | <tomsmeding> | tri: in fact, at runtime, that `Read a` constraint on your function becomes an actual function _argument_ |
| 18:09:28 | <tomsmeding> | at runtime, it's a record with a few fields, one for each method in the type class |
| 18:09:43 | <tomsmeding> | so if you have `myFoo :: Num a => a -> a -> a`, then myFoo takes _three_ arguments at runtime |
| 18:10:07 | <tomsmeding> | and the first one of those contains 7 values: the definition of (+) for `a`, the definition of (-) for `a`, ..., the definition of `fromInteger` for `a` |
| 18:10:19 | <tomsmeding> | `Read a` gives you the definition of `read` for `a`. :) |
| 18:10:43 | <tomsmeding> | (Actually it gives you the definition of `readsPrec`, and `read` is implemented in terms of `readsPrec`. But that's mostly beside the point.) |
| 18:10:53 | <tri> | thank you |
| 18:11:00 | × | Raito_Bezarius quits (~Raito@wireguard/tunneler/raito-bezarius) (Max SendQ exceeded) |
| 18:11:07 | × | tri quits (~tri@2601:182:780:720::55a0) (Remote host closed the connection) |
| 18:11:34 | × | aaronv quits (~aaronv@user/aaronv) (Ping timeout: 260 seconds) |
| 18:11:35 | <haskellbridge> | <Bowuigi> Oh, this is a case where you learn more about a concepts when you understand how it is compiled |
| 18:11:59 | <tomsmeding> | some people may disagree, but I think so |
| 18:12:02 | <tomsmeding> | in this case |
| 18:12:15 | <tomsmeding> | you can specify how type classes work just fine without talking about how they're compiled |
| 18:12:51 | <tomsmeding> | but then it becomes an abstract, rather algebraic specification that only people who are already familiar with PL concepts will be able to work with |
| 18:13:31 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 18:14:14 | → | Raito_Bezarius joins (~Raito@wireguard/tunneler/raito-bezarius) |
| 18:18:22 | <monochrom> | I use algebra because everyone has acquired algebra skills. |
| 18:18:47 | <monochrom> | from public mandatory education |
| 18:20:03 | <tomsmeding> | I'm not talking about high-school algebra, I'm talking about abstract algebra that one learns either in an advanced FP / introductory PL course, or in a maths bachelor :p |
| 18:20:24 | <monochrom> | Yeah I don't use that on other people. Don't worry! |
| 18:20:57 | <tomsmeding> | if someone comes here with a question of what constraint to put on their function to make `read` work, I'm not going to assume they understand abstract algebra |
| 18:21:15 | <tomsmeding> | if they had that kind of mental pathways already developed, they would have intuited the answer already ;) |
| 18:23:52 | <monochrom> | This is how I teach classes and what the constraints are doing there: https://www.cs.utoronto.ca/~trebla/CSCC24-2024-Summer/04-haskell-types-2.html |
| 18:24:15 | × | Square2 quits (~Square@user/square) (Ping timeout: 244 seconds) |
| 18:26:11 | <monochrom> | It does not use advanced math, but it does not use dictionaries either. For C++ compiler has already proved that there is another way. |
| 18:27:06 | <monochrom> | (Meanwhile, people complain that GHC exes are already too big haha) |
| 18:28:56 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 18:29:49 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds) |
| 18:30:26 | Lord_of_Life_ | is now known as Lord_of_Life |
| 18:31:08 | <tomsmeding> | monochrom: nice, I like |
| 18:31:26 | <tomsmeding> | now I just have to remember where this lives when someone asks about type classes |
| 18:32:08 | <monochrom> | It disappears soon. Namely, the "2024" part in the URL keeps changing, for obvious reasons. |
| 18:32:42 | <monochrom> | Hrm I could easily make a "latest" alias! |
| 18:32:48 | <tomsmeding> | 2023 is still up, it looks like |
| 18:33:11 | <monochrom> | Ah I forgot to delete that haha |
| 18:33:30 | <monochrom> | Usually in year N I keep both N and N-1. |
| 18:33:58 | <tomsmeding> | given that not all directories are readable I assume you're aware that requesting /~trebla/ just gives a listing :) |
| 18:34:24 | <tomsmeding> | but this will make it easier to find this stuff if I even remember to look for it, thanks |
| 18:37:08 | <monochrom> | Yeah I am too lazy to make index.html so I just enable "just list everything" |
| 18:37:48 | <tomsmeding> | when people do put an index.html in, they often forget to remove stuff from the directory that shouldn't be public any more in the first place |
| 18:38:08 | <tomsmeding> | and then while they're kind of hidden then, they're still available if you know the URL |
| 18:38:16 | <monochrom> | OK https://www.cs.utoronto.ca/~trebla/CSCC24-latest/ should be pretty reliable now! |
| 18:38:27 | <tomsmeding> | sweet! |
| 18:39:48 | <monochrom> | I wonder whether they forget or they simply have the wrong mental model. |
| 18:40:07 | <tomsmeding> | probably first the latter, then later the former |
| 18:40:47 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 18:41:53 | → | tri joins (~tri@2601:182:780:720::55a0) |
| 18:47:06 | × | tri quits (~tri@2601:182:780:720::55a0) (Ping timeout: 276 seconds) |
| 18:54:15 | → | aaronv joins (~aaronv@user/aaronv) |
| 18:58:29 | × | kenran quits (~kenran@user/kenran) (Remote host closed the connection) |
| 18:59:49 | → | alfiee joins (~alfiee@user/alfiee) |
| 19:04:00 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 19:04:10 | × | aaronv quits (~aaronv@user/aaronv) (Remote host closed the connection) |
| 19:04:33 | × | Googulator quits (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) (Quit: Client closed) |
| 19:04:49 | → | Googulator joins (~Googulato@2a01-036d-0106-4074-758c-12a1-cbb4-05eb.pool6.digikabel.hu) |
| 19:08:59 | → | yegorc joins (~yegorc@user/yegorc) |
| 19:09:51 | → | Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
| 19:11:03 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 265 seconds) |
| 19:12:18 | → | misterfish joins (~misterfis@84.53.85.146) |
| 19:12:54 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 19:19:24 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 252 seconds) |
| 19:25:26 | → | peterbecich joins (~Thunderbi@syn-047-229-123-186.res.spectrum.com) |
| 19:27:22 | → | Anushka joins (~Anushka@101.0.63.173) |
| 19:27:29 | × | misterfish quits (~misterfis@84.53.85.146) (Ping timeout: 265 seconds) |
| 19:28:20 | × | Anushka quits (~Anushka@101.0.63.173) (Client Quit) |
| 19:28:59 | → | misterfish joins (~misterfis@84.53.85.146) |
| 19:29:22 | → | weary-traveler joins (~user@user/user363627) |
| 19:31:28 | ← | yegorc parts (~yegorc@user/yegorc) (Leaving) |
| 19:36:35 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
| 19:39:15 | × | emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir) |
| 19:42:12 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 19:44:17 | → | lunitur joins (~halloy485@2a00:1bb8:11c:a9a5:5d31:a95b:66b2:d7f4) |
| 19:46:13 | × | peterbecich quits (~Thunderbi@syn-047-229-123-186.res.spectrum.com) (Ping timeout: 245 seconds) |
| 19:49:34 | → | alfiee joins (~alfiee@user/alfiee) |
| 19:51:06 | × | acidjnk_new3 quits (~acidjnk@p200300d6e7283f26657989b577b132fd.dip0.t-ipconnect.de) (Ping timeout: 246 seconds) |
| 19:53:52 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 19:54:38 | × | takuan quits (~takuan@d8D86B601.access.telenet.be) (Remote host closed the connection) |
| 19:55:02 | <EvanR> | :t negate . read |
| 19:55:04 | <lambdabot> | (Num c, Read c) => String -> c |
| 19:55:36 | <EvanR> | parses into a Num insofar as that makes any sense |
| 19:56:20 | <EvanR> | not sure what happened to 'a' and 'b' there xD |
| 19:57:42 | → | dhil joins (~dhil@2a0c:b381:5bf:3500:d34b:be83:5f4c:606f) |
| 20:00:04 | × | caconym quits (~caconym@user/caconym) (Quit: bye) |
| 20:00:42 | → | caconym joins (~caconym@user/caconym) |
| 20:03:19 | → | michalz joins (~michalz@185.246.207.203) |
| 20:05:10 | × | dhil quits (~dhil@2a0c:b381:5bf:3500:d34b:be83:5f4c:606f) (Ping timeout: 268 seconds) |
| 20:09:38 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Ping timeout: 252 seconds) |
| 20:11:29 | → | vanishingideal joins (~vanishing@user/vanishingideal) |
| 20:12:46 | → | tri joins (~tri@ool-44c70bcb.dyn.optonline.net) |
| 20:14:04 | × | weary-traveler quits (~user@user/user363627) (Remote host closed the connection) |
| 20:15:06 | × | vanishingideal quits (~vanishing@user/vanishingideal) (Client Quit) |
| 20:16:49 | <lunitur> | Hi guys, I was thinking about making a GHC plugin for synthatic sugar that would make handling of monadic expressions easier, like !-notation or Monadic comprehensions in Idris. I would greatly appreciate if I could get some pointers. |
| 20:16:53 | × | tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 244 seconds) |
| 20:18:03 | → | tri joins (~tri@ool-44c70bcb.dyn.optonline.net) |
| 20:18:33 | → | emmanuelux joins (~emmanuelu@user/emmanuelux) |
| 20:19:37 | → | weary-traveler joins (~user@user/user363627) |
| 20:20:41 | → | otbergsten joins (~otbergste@user/otbergsten) |
| 20:21:20 | → | Guest0 joins (~Guest0@101.0.63.173) |
| 20:21:28 | × | Guest0 quits (~Guest0@101.0.63.173) (Client Quit) |
| 20:21:37 | → | pavonia joins (~user@user/siracusa) |
| 20:24:21 | × | tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 248 seconds) |
| 20:25:00 | → | zaz joins (~zaz@cmbg-18-b2-v4wan-168328-cust3861.vm17.cable.virginm.net) |
| 20:25:31 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 20:26:26 | zaz | is now known as Zaz_ |
| 20:27:15 | <EvanR> | it's funny that in web world they want you to not do that and put individual side effecting code on its own line and store the result to a temporary |
| 20:27:59 | <EvanR> | instead of making a more complex expression with multiple side effects |
| 20:28:12 | <EvanR> | maybe they are just cargo culting haskell though |
| 20:30:48 | → | Guest0 joins (~Guest0@101.0.63.173) |
| 20:31:07 | × | Guest0 quits (~Guest0@101.0.63.173) (Client Quit) |
| 20:34:33 | <geekosaur> | you might want to read https://www.reddit.com/r/haskell/comments/106opzn/ann_monadic_bang_a_plugin_for_more_concise/ |
| 20:35:19 | <geekosaur> | also I've seen a discussion somewhere pitching something similar and a number of responses asking about various corner cases that come up in Haskell |
| 20:35:46 | <geekosaur> | (I thought there was a ghc proposal at one point but I can't find it) |
| 20:37:38 | → | alfiee joins (~alfiee@user/alfiee) |
| 20:38:18 | → | tri joins (~tri@ool-44c70bcb.dyn.optonline.net) |
| 20:41:54 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 20:44:45 | × | tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds) |
| 20:46:35 | → | ash3en joins (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) |
| 20:47:02 | → | talismanick joins (~user@2601:644:937c:ed10::ae5) |
| 20:51:48 | → | zfnmxt joins (~zfnmxt@user/zfnmxt) |
| 20:52:04 | <talismanick> | for `newtype RMonoid m = RMonoid (Monoid m => m -> m)`, is there a way to communicate the constraint when writing a Functor instance? |
| 20:52:51 | × | ash3en quits (~Thunderbi@2a03:7846:b6eb:101:93ac:a90a:da67:f207) (Quit: ash3en) |
| 20:53:20 | × | emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir) |
| 20:54:13 | → | prasad joins (~Thunderbi@2601:243:c001:3f07::d1) |
| 20:54:40 | → | emmanuelux joins (~emmanuelu@user/emmanuelux) |
| 20:55:15 | <lunitur> | thanks, i'm happy to see this exists but kinda bummed out because i really wanted to do some ghc related project |
| 20:57:44 | × | lxsameer quits (~lxsameer@Serene/lxsameer) (Ping timeout: 272 seconds) |
| 20:59:50 | → | zaz joins (~zaz@109.224.141.163) |
| 21:01:15 | <ncf> | talismanick: what do you mean? that's not functorial in m |
| 21:01:40 | × | Zaz_ quits (~zaz@cmbg-18-b2-v4wan-168328-cust3861.vm17.cable.virginm.net) (Ping timeout: 240 seconds) |
| 21:03:49 | <talismanick> | wait, you're right |
| 21:03:56 | <talismanick> | what was I thinking? |
| 21:04:35 | <ncf> | i don't know! |
| 21:04:43 | <ncf> | forall m. RMonoid m is isomorphic to ℕ though |
| 21:05:02 | <ncf> | (unrelatedly) |
| 21:05:45 | <talismanick> | oh right, I was trying to write down a general rule for difference list style optimizations |
| 21:06:17 | <talismanick> | (I just came back to this code after months and saw a halfwritten Functor instance with a type error) |
| 21:06:41 | × | remedan quits (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Quit: Bye!) |
| 21:07:13 | <talismanick> | maybe isomorphism to the naturals is part of what I was missing... |
| 21:07:23 | → | remedan joins (~remedan@ip-62-245-108-153.bb.vodafone.cz) |
| 21:13:00 | → | tri joins (~tri@ool-44c70bcb.dyn.optonline.net) |
| 21:16:08 | × | emmanuelux quits (~emmanuelu@user/emmanuelux) (Quit: au revoir) |
| 21:17:39 | → | emmanuelux joins (~emmanuelu@user/emmanuelux) |
| 21:18:12 | × | tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 252 seconds) |
| 21:20:00 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Read error: Connection reset by peer) |
| 21:20:34 | <zaz> | Hello! I'm interested in doing a deep dive over the coming months on bijective programming and in particular bijective parsing. I've skimmed a bunch of academic papers and am planning on learning more category theory, but what's the best way to get my hands dirty playing around with these ideas? Are there any bijective libraries out there that are |
| 21:20:34 | <zaz> | relatively beginner-friendly? |
| 21:20:35 | <zaz> | Also, why is bijectivity not built in? For example, why is there no way to do `invert(span isLower)`? It would seem like a really handy feature that if you compose a function out of a bunch of bijective functions that you could automatically invert it. |
| 21:21:15 | <tomsmeding> | talismanick: the typical generalisation of difference lists is simply Endo |
| 21:21:22 | <tomsmeding> | also known as Cayley transform |
| 21:21:30 | <tomsmeding> | (when done to a monoid) |
| 21:24:56 | <tomsmeding> | zaz: I can only reply to your last point (y no builtin), I'll leave the rest to others: there are very few expressions in practical code that are, in fact, bijective -- and if they are, then their subexpressions often are not. Indeed, `span` is not bijective, but `span isLower` suddenly is. `a * b` is not bijective, but `(a, a * b)` suddenly is. It would be a feature with rather significant (and |
| 21:24:58 | <tomsmeding> | research-y!) implementation effort in GHC, with only very limited practical application |
| 21:26:29 | <ncf> | span isLower is not bijective (it just has a left inverse) |
| 21:27:28 | <talismanick> | tomsmeding: yes, what I had in mind was "automating" the Endo optimization |
| 21:27:42 | → | alfiee joins (~alfiee@user/alfiee) |
| 21:27:45 | <ncf> | anyway if you're willing to ignore that and work with lenses you could have span :: (a → Bool) → Iso [a] ([a], [a]) |
| 21:29:54 | × | sp1ff quits (~user@c-67-160-173-55.hsd1.wa.comcast.net) (Ping timeout: 248 seconds) |
| 21:30:01 | <talismanick> | because you, the programmer, know `((([] ++ [a]) ++ [b]) ++ [c]) ++ [d]` is quadratic and `[a] ++ ([b] ++ ([c] ++ ([d] ++ [])))` is linear by inspection of `(++)`'s definition (traverse LHS to end, set its pointer to RHS's head) |
| 21:31:29 | × | michalz quits (~michalz@185.246.207.203) (Remote host closed the connection) |
| 21:32:07 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 268 seconds) |
| 21:32:32 | <talismanick> | which seems like something that could be automated "by hypothesis" (symbolic substitution by expanding definitions) because associativity guarantees safe local rearrangement (no sudden nontermination, etc) |
| 21:33:19 | <talismanick> | except there's arbitrary parenthetical lookahead, and iso to ℕ means it's additionally streamlike |
| 21:33:47 | <tomsmeding> | talismanick: automatic in what way? A compiler optimisation or a compiler plugin? Or something else? |
| 21:33:56 | <talismanick> | compiler optimization |
| 21:34:06 | <tomsmeding> | GHC doesn't know that (++) is associative |
| 21:34:58 | <talismanick> | is it not allowed to assume associativity when told `[a]` has a Semigroup instance? |
| 21:35:25 | <tomsmeding> | no, typeclass laws are not actually laws in haskell, you're allowed (by the language semantics) to break them |
| 21:35:34 | → | acidjnk_new3 joins (~acidjnk@p200300d6e7283f26c4dbaee3a15423f1.dip0.t-ipconnect.de) |
| 21:35:36 | <tomsmeding> | you're quite _expected_ not to |
| 21:36:04 | <talismanick> | no fun allowed :( |
| 21:36:28 | <tomsmeding> | usual caveat for built-in classes like WithDict that have GHC magic associated to them, where if you break the preconditions in the documentation you get nasal demons |
| 21:36:55 | <tomsmeding> | or perhaps the new WithDict is safer than what was there before, I don't recall precisely |
| 21:37:14 | <talismanick> | what if I /want/ -O3 to summon nasal demons? all those back and forths on C2 about a sufficiently smart compiler - I want to see what it can do lol |
| 21:37:39 | <tomsmeding> | fork microHs? :p |
| 21:37:45 | <monochrom> | Just hire a grad student. |
| 21:37:46 | <tomsmeding> | or ghc if you dare |
| 21:37:56 | <tomsmeding> | that costs money (usually) |
| 21:38:04 | <tomsmeding> | not very much in some countries |
| 21:38:16 | <monochrom> | Yeah but cheaper than industry :) |
| 21:38:39 | <monochrom> | in some cases one slice of cheap pizza is all you need |
| 21:39:00 | → | tri joins (~tri@ool-44c70bcb.dyn.optonline.net) |
| 21:39:10 | × | zaz quits (~zaz@109.224.141.163) (Ping timeout: 240 seconds) |
| 21:39:27 | tomsmeding | . o O ( -ffast-math ) |
| 21:39:34 | <monochrom> | :) |
| 21:44:27 | × | tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 268 seconds) |
| 21:45:19 | <haskellbridge> | <Bowuigi> talismanick look into the Cayley monoid |
| 21:45:44 | <haskellbridge> | <Bowuigi> More generally, the Cayley theorem, but that's a categorical thing |
| 21:49:10 | <haskellbridge> | <Bowuigi> You can just define "lit = (<>)", "render m = m mempty", note that functions that directly act on the monoid are also allowed, so on strings you can do "tail . lit "a" . lit "b"" to get "lit "b"" |
| 21:49:32 | <tomsmeding> | https://en.wikipedia.org/wiki/Transformation_semigroup |
| 21:49:49 | <tomsmeding> | that's what wikipedia calls it, apparently |
| 21:50:33 | <tomsmeding> | (it even mentions difference lists) |
| 21:51:35 | <haskellbridge> | <Bowuigi> I also like to define "litC = (:)" for strings. Note that "tail . litC x = id" (mempty on the Cayley monoids) |
| 21:54:24 | <haskellbridge> | <Bowuigi> I call it the Cayley monoid (technically "Cayley monoid of a monoid M", or just "Cayley monoid of M") because of that one theorem |
| 21:54:50 | <talismanick> | yes, I was thinking about how best to automate that process |
| 21:55:27 | <haskellbridge> | <Bowuigi> Just use the definitions above, doesn't require wrappers or anything like that |
| 21:56:03 | <tomsmeding> | it's tricky, because rendering is not O(1), so if you render, you want to continue computation with the rendered value, not the composition you had before |
| 21:56:38 | <tomsmeding> | i.e. if you `let x = lit "abc" . lit "def" . lit "ghi" in f (render x) (render x)` then you're doing work twice |
| 21:56:55 | <haskellbridge> | <Bowuigi> Yeah, tho I'd recommend not rendering unless absolutely necessary |
| 21:57:06 | <tomsmeding> | right, but you're going to auto-transform, you'll have to render sometimes |
| 21:57:26 | <haskellbridge> | <Bowuigi> You can modify the composition directly, as I've shown before |
| 21:57:52 | <tomsmeding> | talismanick: also this is only beneficial for monoids where the wrong associativity is actually slow; doing Cayley to `Sum Int` will only make everything slow |
| 21:58:20 | <tomsmeding> | Bowuigi: what if the original program passed the String to `putStrLn`? You'll have to render it at that point. |
| 21:58:22 | <haskellbridge> | <Bowuigi> Indeed, the same can be said for the other Cayley transformations |
| 21:59:04 | <tomsmeding> | or what if the original program put the String in a `case`? Can't evaluate that `case` without rendering |
| 22:00:56 | × | target_i quits (~target_i@user/target-i/x-6023099) (Quit: leaving) |
| 22:00:57 | <haskellbridge> | <Bowuigi> The case can be incorporated into the pipeline by just composing that function with the unrendered value in most cases. As for IO, that's what I mean by "absolutely necessary" |
| 22:01:43 | <tomsmeding> | depends on what exactly is returned from the `case`, but yes, sometimes that works |
| 22:01:50 | <haskellbridge> | <Bowuigi> Obviously this means that rendering is no longer O(n) but it allows you to keep adding stuff to the monoid afterwards |
| 22:03:00 | <haskellbridge> | <Bowuigi> And if the entire pipeline is exposed to GHC, it can do its magic, as usual |
| 22:03:41 | <tomsmeding> | you also have to render whenever the original program _shares_ a monoid value: with `let x = ... ; f y = y ++ y in putStrLn (f x x)`, if you don't take care, you're going to compute x twice (whereas this program as written only computes x once) |
| 22:04:19 | <tomsmeding> | anyway we're doing talismanick's grad student's research for them :) |
| 22:04:50 | <haskellbridge> | <Bowuigi> True lol |
| 22:05:14 | <haskellbridge> | <Bowuigi> Gotta continue with my not-grad-student research then lol |
| 22:07:58 | × | tabaqui1 quits (~root@87.200.129.102) (Ping timeout: 244 seconds) |
| 22:21:06 | → | alfiee joins (~alfiee@user/alfiee) |
| 22:25:18 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 22:38:01 | → | tri joins (~tri@ool-44c70bcb.dyn.optonline.net) |
| 22:39:36 | <haskellbridge> | <Bowuigi> Related, which syntax for visible and invisible foralls is preferred nowadays? |
| 22:39:58 | <haskellbridge> | <Bowuigi> In general I mean, not just in Haskell |
| 22:42:26 | × | tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Ping timeout: 248 seconds) |
| 22:46:00 | <haskellbridge> | <Bowuigi> Currently I have "func : {a b : *} (f : * -> *) a -> f b = ...", where a and b are invisibly quantified (AKA their applications are inferred) and f is visibly quantified (AKA you must apply it as if it was a term), with "func @A @B F" as the application syntax |
| 22:46:19 | × | myxos quits (~myxos@syn-065-028-251-121.res.spectrum.com) (Ping timeout: 260 seconds) |
| 22:46:56 | → | tri joins (~tri@ool-44c70bcb.dyn.optonline.net) |
| 22:48:01 | → | sixfourtwelve joins (~ethanmorg@82.18.82.103) |
| 22:48:02 | <haskellbridge> | <Bowuigi> Sorry, "(x : k) -> t" is visible quantification, "{x : k} t" is invisible |
| 22:48:04 | → | mange joins (~user@user/mange) |
| 22:48:09 | × | sixfourtwelve quits (~ethanmorg@82.18.82.103) (Client Quit) |
| 22:53:43 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 22:59:39 | × | lunitur quits (~halloy485@2a00:1bb8:11c:a9a5:5d31:a95b:66b2:d7f4) (Ping timeout: 265 seconds) |
| 23:01:07 | → | myxos joins (~myxos@syn-065-028-251-121.res.spectrum.com) |
| 23:04:25 | → | ljdarj1 joins (~Thunderbi@user/ljdarj) |
| 23:07:36 | × | ljdarj quits (~Thunderbi@user/ljdarj) (Ping timeout: 244 seconds) |
| 23:07:36 | ljdarj1 | is now known as ljdarj |
| 23:09:29 | → | alfiee joins (~alfiee@user/alfiee) |
| 23:12:00 | × | xff0x quits (~xff0x@2405:6580:b080:900:a75:2366:4e5c:4ce9) (Ping timeout: 246 seconds) |
| 23:13:10 | → | xff0x joins (~xff0x@2405:6580:b080:900:f1ee:cf4b:ec98:147a) |
| 23:13:48 | × | alfiee quits (~alfiee@user/alfiee) (Ping timeout: 252 seconds) |
| 23:16:00 | × | xff0x quits (~xff0x@2405:6580:b080:900:f1ee:cf4b:ec98:147a) (Client Quit) |
| 23:18:55 | × | tri quits (~tri@ool-44c70bcb.dyn.optonline.net) (Remote host closed the connection) |
| 23:28:37 | → | xff0x joins (~xff0x@2405:6580:b080:900:f597:997a:28cf:fd48) |
| 23:32:48 | × | robertm quits (robertm@lattice.rojoma.com) (Quit: WeeChat 3.8) |
| 23:35:15 | → | robertm joins (robertm@lattice.rojoma.com) |
| 23:55:17 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@static-198-54-134-151.cust.tzulo.com) |
| 23:57:54 | → | alfiee joins (~alfiee@user/alfiee) |
All times are in UTC on 2025-02-09.