Home liberachat/#haskell: Logs Calendar

Logs on 2022-07-30 (liberachat/#haskell)

00:00:52 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds)
00:01:39 yin joins (~yin@user/zero)
00:02:14 yauhsien joins (~yauhsien@61-231-30-230.dynamic-ip.hinet.net)
00:03:24 geekosaur is now known as xmonadtrack
00:04:54 xmonadtrack is now known as geekosaur
00:06:42 × yauhsien quits (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) (Ping timeout: 245 seconds)
00:06:42 × yin quits (~yin@user/zero) (Ping timeout: 245 seconds)
00:07:37 × nckx quits (~nckx@tobias.gr) (Quit: Updating my Guix System <https://guix.gnu.org>)
00:12:44 nckx joins (~nckx@tobias.gr)
00:16:37 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
00:16:37 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
00:16:37 wroathe joins (~wroathe@user/wroathe)
00:21:54 × kraftwerk28 quits (~kraftwerk@178.62.210.83) (Quit: ZNC 1.8.2 - https://znc.in)
00:27:51 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 268 seconds)
00:28:58 matthewmosior joins (~matthewmo@173.170.253.91)
00:29:24 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
00:30:01 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 272 seconds)
00:32:41 notzmv joins (~zmv@user/notzmv)
00:35:19 × Guest3 quits (~textual@64.145.79.82) (Quit: Textual IRC Client: www.textualapp.com)
00:35:23 kraftwerk28 joins (~kraftwerk@178.62.210.83)
00:35:53 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds)
00:37:48 × adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Ping timeout: 268 seconds)
00:39:21 adanwan joins (~adanwan@gateway/tor-sasl/adanwan)
00:49:12 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
00:54:42 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Ping timeout: 264 seconds)
01:11:07 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:14:44 naso joins (~naso@193-116-244-197.tpgi.com.au)
01:17:15 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:18:53 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
01:20:02 × dvdrw quits (~dvdrw@user/dvdrw) (Ping timeout: 245 seconds)
01:21:03 × alp_ quits (~alp@user/alp) (Ping timeout: 276 seconds)
01:23:34 Katarushisu4 joins (~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net)
01:24:17 × Katarushisu quits (~Katarushi@cpc147790-finc20-2-0-cust502.4-2.cable.virginm.net) (Ping timeout: 252 seconds)
01:24:17 Katarushisu4 is now known as Katarushisu
01:26:46 lemonsni- joins (~lemonsnic@cpc159519-perr18-2-0-cust114.19-1.cable.virginm.net)
01:27:13 × lemonsnicks quits (~lemonsnic@cpc159519-perr18-2-0-cust114.19-1.cable.virginm.net) (Ping timeout: 252 seconds)
01:28:33 <naso> hello, i'm having trouble building and running tests in my cabal project. when i do `cabal test` everything compiles, thenn it says:
01:28:40 <naso> <no location info>: error:
01:28:40 <naso> output was redirected with -o, but no output will be generated
01:28:40 <naso> because there is no Main module.
01:29:01 <naso> in my cabal file I have `main-is: Spec.hs`
01:34:12 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds)
01:43:13 matthewmosior joins (~matthewmo@173.170.253.91)
01:46:08 AlexZenon_2 joins (~alzenon@178.34.150.131)
01:47:45 × AlexZenon quits (~alzenon@178.34.150.131) (Ping timeout: 252 seconds)
01:48:06 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
01:52:44 × xff0x quits (~xff0x@ae132116.dynamic.ppp.asahi-net.or.jp) (Ping timeout: 255 seconds)
01:55:00 <qrpnxz> naso: change the module name in Spec.hs to Main
01:55:13 Sciencentistguy5 joins (~sciencent@hacksoc/ordinary-member)
01:56:55 × Sciencentistguy quits (~sciencent@hacksoc/ordinary-member) (Ping timeout: 252 seconds)
01:56:55 Sciencentistguy5 is now known as Sciencentistguy
01:57:10 xff0x joins (~xff0x@ap007189.d.east.v6connect.net)
01:57:58 × lagash quits (lagash@lagash.shelltalk.net) (Ping timeout: 240 seconds)
01:59:32 × sarahtheaudi quits (~sarahthea@S01069050ca4e3573.cg.shawcable.net) (Ping timeout: 252 seconds)
02:00:51 <naso> qrpnxz: thanks! i always thought the module name had to match the file name. actually it also works if i just remove the module declaration altogether
02:01:41 × PiDelport quits (uid25146@id-25146.lymington.irccloud.com) (Quit: Connection closed for inactivity)
02:01:59 <naso> another problem now: although the tests seem to run, nothing is printed from my `putStrLn` calls within `main`
02:02:16 <qrpnxz> it generally does, but here you are specifying which file is main, so it doesn't have to be called main, but the module does need to be main or it doesn't know to make an executable
02:02:56 <qrpnxz> naso: ah yeah, so there's a flag to get it to display that output, i will look for it, but the output is also put into a file in dist-newstyle or whatever it's called
02:03:53 <qrpnxz> use --show-details flag
02:04:01 <qrpnxz> for example, --show-details=streaming
02:04:12 <qrpnxz> but there's other setting you can put that i forget
02:04:24 lagash joins (lagash@2605:6400:20:b4:9c76:1538:3398:ce71)
02:07:50 <naso> thanks qrpnxz i'll look in the manual. I tried `cabal test --show-details=streaming` but get error 'unrecognized 'test' option `--show-details=streaming'' . Also tried putting it in the .cabal file under ghc-options: but did not seem to have aan effect
02:08:48 <qrpnxz> naso: try --test-show-details
02:09:33 <naso> ok that worked! do you know how i can put that in the cabal file so it's on automatically
02:12:37 dcoutts_ joins (~duncan@host109-149-1-189.range109-149.btcentralplus.com)
02:15:02 × dcoutts__ quits (~duncan@host86-150-41-142.range86-150.btcentralplus.com) (Ping timeout: 245 seconds)
02:15:19 sarahtheaudi joins (~sarahthea@S01069050ca4e3573.cg.shawcable.net)
02:16:12 <naso> putting it under `ghc-options:` in the test section did not work
02:26:20 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 268 seconds)
02:28:18 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
02:32:10 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
02:32:29 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 252 seconds)
02:34:25 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
02:34:35 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
02:36:56 × adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection)
02:37:24 adanwan joins (~adanwan@gateway/tor-sasl/adanwan)
02:37:40 <qrpnxz> i do not
02:38:07 <qrpnxz> you could make a shell alias or function or script to do that for you tho
02:39:36 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
02:39:49 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 252 seconds)
02:40:49 <naso> ok thanks
02:41:09 zaquest joins (~notzaques@5.130.79.72)
02:41:46 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
02:43:32 <sarahtheaudi> https://www.youtube.com/watch?v=7wvLIWe6qxA
02:45:22 × td_ quits (~td@muedsl-82-207-238-203.citykom.de) (Ping timeout: 268 seconds)
02:45:41 × Jeanne-Kamikaze quits (~Jeanne-Ka@142.147.89.243) (Quit: Leaving)
02:46:51 td_ joins (~td@94.134.91.248)
02:48:44 × cbdlt^ quits (~cbdlt@50-242-35-142-static.hfc.comcastbusiness.net) (Remote host closed the connection)
02:49:07 × terrorjack quits (~terrorjac@2a01:4f8:1c1e:509a::1) (Quit: The Lounge - https://thelounge.chat)
02:49:24 × sarahtheaudi quits (~sarahthea@S01069050ca4e3573.cg.shawcable.net) (Ping timeout: 252 seconds)
02:50:20 terrorjack joins (~terrorjac@2a01:4f8:1c1e:509a::1)
02:53:06 zxx7529 joins (~Thunderbi@user/zxx7529)
02:53:07 yin joins (~yin@user/zero)
02:55:52 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds)
02:56:57 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 272 seconds)
02:58:07 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
03:01:19 notzmv joins (~zmv@user/notzmv)
03:04:58 × maerwald quits (~maerwald@mail.hasufell.de) (Changing host)
03:04:58 maerwald joins (~maerwald@user/maerwald)
03:08:36 Inst joins (~Inst@2601:6c4:4080:3f80:88fb:d6ca:60f6:4fa2)
03:08:48 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 268 seconds)
03:10:35 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
03:21:27 × adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection)
03:22:35 adanwan joins (~adanwan@gateway/tor-sasl/adanwan)
03:28:18 × zxx7529 quits (~Thunderbi@user/zxx7529) (Quit: zxx7529)
03:36:23 × meow_mew quits (uid562569@id-562569.ilkley.irccloud.com) (Quit: Connection closed for inactivity)
03:41:03 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Ping timeout: 252 seconds)
03:45:03 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
03:47:53 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
03:49:24 Haskelytic joins (~Haskelyti@118.179.211.17)
03:51:38 × vglfr quits (~vglfr@91.192.47.10) (Read error: Connection reset by peer)
03:51:48 vglfr joins (~vglfr@91.192.47.10)
03:58:17 × vglfr quits (~vglfr@91.192.47.10) (Read error: Connection reset by peer)
03:58:32 Guest33 joins (~Guest33@ool-4a5964de.dyn.optonline.net)
03:58:36 Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net)
03:59:04 <Guest33> hello
03:59:21 vglfr joins (~vglfr@91.192.47.10)
04:00:06 matthewmosior joins (~matthewmo@173.170.253.91)
04:00:09 × Guest33 quits (~Guest33@ool-4a5964de.dyn.optonline.net) (Client Quit)
04:01:56 yauhsien joins (~yauhsien@61-231-30-230.dynamic-ip.hinet.net)
04:02:48 × Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Client Quit)
04:03:47 × vglfr quits (~vglfr@91.192.47.10) (Ping timeout: 252 seconds)
04:04:09 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
04:04:58 vglfr joins (~vglfr@91.192.47.10)
04:06:17 × yauhsien quits (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) (Ping timeout: 245 seconds)
04:07:59 <Haskelytic> https://hackage.haskell.org/package/monads-tf-0.1.0.3/docs/Control-Monad-List.html#t:ListT
04:08:11 × yin quits (~yin@user/zero) (Ping timeout: 252 seconds)
04:08:18 <Haskelytic> what does it mean that "the argument monad is commutative"
04:08:42 <Haskelytic> if arg is `m` then `m t` = `t m`?
04:12:35 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 252 seconds)
04:18:04 × Me-me quits (~me-me@tunnel690570-pt.tunnel.tserv12.mia1.ipv6.he.net) (Remote host closed the connection)
04:19:19 × noteness quits (~noteness@user/noteness) (Quit: bye)
04:19:37 noteness joins (~noteness@user/noteness)
04:22:03 yauhsien joins (~yauhsien@61-231-30-230.dynamic-ip.hinet.net)
04:26:46 adanwan_ joins (~adanwan@gateway/tor-sasl/adanwan)
04:27:41 × adanwan quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection)
04:31:46 Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net)
04:32:04 × finsternis quits (~X@23.226.237.192) (Ping timeout: 244 seconds)
04:33:43 matthewmosior joins (~matthewmo@173.170.253.91)
04:34:01 finsternis joins (~X@23.226.237.192)
04:34:35 × yauhsien quits (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) (Ping timeout: 252 seconds)
04:44:28 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
04:45:37 × machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 268 seconds)
04:46:11 × Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
04:47:25 × vglfr quits (~vglfr@91.192.47.10) (Read error: Connection reset by peer)
04:47:47 × russruss quits (~russruss@my.russellmcc.com) (Quit: The Lounge - https://thelounge.chat)
04:48:41 vglfr joins (~vglfr@91.192.47.10)
04:57:27 × vglfr quits (~vglfr@91.192.47.10) (Read error: Connection reset by peer)
05:01:09 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
05:01:09 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
05:01:09 wroathe joins (~wroathe@user/wroathe)
05:02:55 yauhsien joins (~yauhsien@61-231-30-230.dynamic-ip.hinet.net)
05:03:40 Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net)
05:04:54 × Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host)
05:04:54 Guest3 joins (~textual@user/polo)
05:04:59 Guest3 is now known as money
05:05:12 × money quits (~textual@user/polo) (Client Quit)
05:05:31 vglfr joins (~vglfr@91.192.47.10)
05:05:34 Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net)
05:09:19 Me-me joins (~me-me@tunnel690570-pt.tunnel.tserv12.mia1.ipv6.he.net)
05:09:37 × vglfr quits (~vglfr@91.192.47.10) (Ping timeout: 245 seconds)
05:09:37 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
05:10:46 × Me-me quits (~me-me@tunnel690570-pt.tunnel.tserv12.mia1.ipv6.he.net) (Changing host)
05:10:46 Me-me joins (~me-me@user/me-me)
05:14:12 × yauhsien quits (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) (Ping timeout: 245 seconds)
05:38:08 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
05:44:27 × dtman34 quits (~dtman34@2601:446:4400:2ad9:8c87:c49c:8d33:7100) (Quit: ZNC 1.7.2+deb3 - https://znc.in)
05:45:19 dtman34 joins (~dtman34@2601:446:4400:2ad9:d95d:5c8c:b796:d6dc)
05:46:06 × gawen quits (~gawen@user/gawen) (Quit: cya)
05:47:56 gawen joins (~gawen@user/gawen)
05:50:28 × Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
05:57:39 azimut joins (~azimut@gateway/tor-sasl/azimut)
06:00:02 matthewmosior joins (~matthewmo@173.170.253.91)
06:01:48 zxx7529 joins (~Thunderbi@user/zxx7529)
06:04:32 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
06:09:35 matthewmosior joins (~matthewmo@173.170.253.91)
06:12:10 alp_ joins (~alp@user/alp)
06:15:54 × mvk quits (~mvk@2607:fea8:5ce3:8500::311d) (Ping timeout: 244 seconds)
06:26:20 enemeth79 joins (uid309041@id-309041.lymington.irccloud.com)
06:28:49 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
06:32:17 × alp_ quits (~alp@user/alp) (Ping timeout: 272 seconds)
06:36:01 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
06:36:07 × kraftwerk28 quits (~kraftwerk@178.62.210.83) (Quit: ZNC 1.8.2 - https://znc.in)
06:36:11 × Vajb quits (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
06:36:12 <[Leary]> Haskelytic: I believe it refers to the *effects* of the monad. I.e. forall x :: m a, y :: m b, f :: (a -> b -> c): liftM2 f x y = liftM2 (flip f) y x.
06:36:23 Vajb joins (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi)
06:37:28 <Haskelytic> ah, that makes a lot more sense
06:39:04 img joins (~img@user/img)
06:39:30 kraftwerk28 joins (~kraftwerk@178.62.210.83)
06:40:10 <Haskelytic> another question, it seems to me that the `Writer` monad is kind of redundant? you could just use `State` to do the same kind of computation
06:42:49 <[Leary]> You could use state to do both reader and writer; you could use IO to do state. Sometimes you'd rather have certain restrictions than more power.
06:45:22 × zxx7529 quits (~Thunderbi@user/zxx7529) (Ping timeout: 244 seconds)
06:47:04 acidjnk_new joins (~acidjnk@p200300d6e7058679a001276fdd936342.dip0.t-ipconnect.de)
06:48:29 Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net)
06:48:30 zxx7529 joins (~Thunderbi@user/zxx7529)
06:48:34 <Haskelytic> I'm still coming to grips with the `IO` monad. It feels like some kind of deep magic.
06:49:56 <Maxdamantus> Maybe my OI monad can make it seem less magical: https://gist.github.com/Maxdamantus/a9e7413521a07a7f922d09d3588692e5
06:50:23 <Haskelytic> lmao that name
06:50:42 <Maxdamantus> Wrote that quickly a few years ago as a demonstration of how it doesn't need to involve impure functions (unlike eg GHC's `IO` implementation), dunno if other people have made similar demonstrations.
06:51:07 <Haskelytic> I'm kind of in that stage where I can use `IO` as an opaque type (through its methods) but it feels like a black hole :)
06:51:25 <Haskelytic> a black hole with a white hole on the other side for binding vals
06:51:37 <Haskelytic> Maxdamantus: thanks for the link!
06:53:13 <Haskelytic> Maxdamantus: dang there's a lot going on there haha...I'm not familiar with GADTs yet
06:53:37 <Haskelytic> time to hunker down :)
06:55:04 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
06:55:05 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
06:55:05 × adanwan_ quits (~adanwan@gateway/tor-sasl/adanwan) (Write error: Connection reset by peer)
06:55:05 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
06:55:05 × jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
06:55:05 × califax quits (~califax@user/califx) (Remote host closed the connection)
06:55:15 <pavonia> Is TH the only way to force evaluation of a top-level value at compile time?
06:55:26 adanwan joins (~adanwan@gateway/tor-sasl/adanwan)
06:55:36 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
06:55:50 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
06:55:55 jpds1 joins (~jpds@gateway/tor-sasl/jpds)
06:55:56 califax joins (~califax@user/califx)
06:59:06 × dtman34 quits (~dtman34@2601:446:4400:2ad9:d95d:5c8c:b796:d6dc) (Quit: ZNC 1.7.2+deb3 - https://znc.in)
06:59:27 × jargon quits (~jargon@184.101.188.251) (Remote host closed the connection)
06:59:32 dtman34 joins (~dtman34@c-73-62-246-247.hsd1.mn.comcast.net)
07:01:02 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
07:01:25 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
07:01:35 vglfr joins (~vglfr@91.192.47.10)
07:03:44 × dtman34 quits (~dtman34@c-73-62-246-247.hsd1.mn.comcast.net) (Client Quit)
07:04:36 dtman34 joins (~dtman34@2601:446:4400:2ad9:8627:39fc:b68b:80d8)
07:05:03 Guest52 joins (~Guest52@46.245.121.30)
07:05:49 × Guest52 quits (~Guest52@46.245.121.30) (Client Quit)
07:08:58 <jackdk> could use `{-# NOINLINE #-}` and `rnf`?
07:09:04 JannisO joins (~JannisO@dyndsl-089-166-213-108.ewe-ip-backbone.de)
07:11:27 yauhsien joins (~yauhsien@61-231-30-230.dynamic-ip.hinet.net)
07:12:13 <pavonia> Would that actually evaluate at compile-time?
07:12:57 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds)
07:16:17 × cheater quits (~Username@user/cheater) (Ping timeout: 252 seconds)
07:16:47 × califax quits (~califax@user/califx) (Ping timeout: 268 seconds)
07:16:55 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
07:17:09 <[Leary]> Haskelytic: An `IO a` is a recipe to perform certain effects and perhaps produce an `a`. We're given primitive recipes as our building blocks and we can combine them via the monadic interface. `main` is where we put a recipe we'd like to see performed. Anything 'deeper' than that is implementation details you aren't supposed to know; using IO as an opaque type via its methods is right and proper.
07:17:37 califax joins (~califax@user/califx)
07:18:25 × dos__^^ quits (~user@user/dos/x-1723657) (Remote host closed the connection)
07:19:33 dos__^^ joins (~user@user/dos/x-1723657)
07:22:10 gurkenglas joins (~gurkengla@p548ac71b.dip0.t-ipconnect.de)
07:25:57 × yauhsien quits (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) (Ping timeout: 268 seconds)
07:27:43 matthewmosior joins (~matthewmo@173.170.253.91)
07:33:16 misterfish joins (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl)
07:33:56 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
07:44:35 × Vajb quits (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi) (Read error: Connection reset by peer)
07:44:51 Vajb joins (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi)
07:50:03 cheater joins (~Username@user/cheater)
07:52:30 × zmt00 quits (~zmt00@user/zmt00) (Quit: Leaving)
07:52:57 × cheater quits (~Username@user/cheater) (Client Quit)
07:53:58 Pickchea joins (~private@user/pickchea)
07:53:59 cheater joins (~Username@user/cheater)
07:55:20 gmg joins (~user@user/gehmehgeh)
07:55:28 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:28f8:ffd7:495f:96f8)
07:56:38 × califax quits (~califax@user/califx) (Remote host closed the connection)
07:57:03 califax joins (~califax@user/califx)
08:00:19 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:28f8:ffd7:495f:96f8) (Ping timeout: 272 seconds)
08:02:07 zmt00 joins (~zmt00@user/zmt00)
08:02:33 matthewmosior joins (~matthewmo@173.170.253.91)
08:07:05 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
08:13:03 × vglfr quits (~vglfr@91.192.47.10) (Read error: Connection reset by peer)
08:13:09 vglfr joins (~vglfr@91.192.47.10)
08:22:29 × naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection)
08:23:28 naso joins (~naso@193-116-244-197.tpgi.com.au)
08:25:18 chomwitt joins (~chomwitt@2a02:587:dc12:b700:8e4f:832:bb90:1d0b)
08:26:19 × vglfr quits (~vglfr@91.192.47.10) (Ping timeout: 252 seconds)
08:26:34 vglfr joins (~vglfr@91.192.47.10)
08:28:48 × vglfr quits (~vglfr@91.192.47.10) (Read error: Connection reset by peer)
08:29:04 vglfr joins (~vglfr@91.192.47.10)
08:29:13 × misterfish quits (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl) (Ping timeout: 244 seconds)
08:29:44 × chomwitt quits (~chomwitt@2a02:587:dc12:b700:8e4f:832:bb90:1d0b) (Ping timeout: 244 seconds)
08:37:12 matthewmosior joins (~matthewmo@173.170.253.91)
08:38:49 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
08:39:48 coco joins (~coco@212-51-146-199.fiber7.init7.net)
08:41:42 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds)
08:44:37 <EvanR> Haskelytic, it's worse than that. State can do what you think writer does, and writer does something else xD
08:44:46 <EvanR> namely, eat all your memory
08:46:29 Tuplanolla joins (~Tuplanoll@91-159-68-204.elisa-laajakaista.fi)
08:47:49 × Pickchea quits (~private@user/pickchea) (Ping timeout: 272 seconds)
08:50:53 × jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection)
08:51:31 × Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:52:03 jpds1 joins (~jpds@gateway/tor-sasl/jpds)
08:52:41 Guest3 joins (~textual@pool-100-11-18-203.phlapa.fios.verizon.net)
08:53:15 × Guest3 quits (~textual@pool-100-11-18-203.phlapa.fios.verizon.net) (Client Quit)
08:54:39 matthewmosior joins (~matthewmo@173.170.253.91)
09:05:08 AlexZenon_2 is now known as AlexZenon
09:06:01 × enemeth79 quits (uid309041@id-309041.lymington.irccloud.com) (Quit: Connection closed for inactivity)
09:08:41 × naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection)
09:09:07 naso joins (~naso@193-116-244-197.tpgi.com.au)
09:10:03 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
09:10:52 × vglfr quits (~vglfr@91.192.47.10) (Ping timeout: 245 seconds)
09:17:17 × gmg quits (~user@user/gehmehgeh) (Remote host closed the connection)
09:17:17 × califax quits (~califax@user/califx) (Remote host closed the connection)
09:17:48 vglfr joins (~vglfr@91.192.47.10)
09:17:48 califax joins (~califax@user/califx)
09:18:05 gmg joins (~user@user/gehmehgeh)
09:18:07 sandy_doo joins (~sandydoo@185.209.196.136)
09:18:39 Pickchea joins (~private@user/pickchea)
09:23:17 × Vajb quits (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
09:24:09 Vajb joins (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi)
09:24:21 × JannisO quits (~JannisO@dyndsl-089-166-213-108.ewe-ip-backbone.de) (Ping timeout: 268 seconds)
09:24:52 yauhsien joins (~yauhsien@61-231-30-230.dynamic-ip.hinet.net)
09:25:49 × naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection)
09:26:46 naso joins (~naso@193-116-244-197.tpgi.com.au)
09:28:07 × naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection)
09:28:22 naso joins (~naso@193-116-244-197.tpgi.com.au)
09:30:02 <int-e> :t execWriter
09:30:05 <lambdabot> Writer w a -> w
09:31:49 × Vajb quits (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi) (Read error: Connection reset by peer)
09:35:17 Vajb joins (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi)
09:42:03 <albet70> is IO a monad?
09:42:57 <albet70> fmap :: (a-> b) -> IO a -> IO b?
09:43:15 <Axman6> what does the documentation for IO say?
09:43:35 <albet70> which document?
09:43:36 × gurkenglas quits (~gurkengla@p548ac71b.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
09:43:55 <Axman6> well, :info IO in GHCi will tell you a lot
09:44:50 <albet70> instance Applicative Functor Monad
09:45:13 benin0 joins (~benin@183.82.205.104)
09:45:27 × zxx7529 quits (~Thunderbi@user/zxx7529) (Ping timeout: 245 seconds)
09:46:05 <albet70> @djinn (a -> b) -> IO a -> IO b
09:46:05 <lambdabot> Error: Undefined type IO
09:48:22 <albet70> but IO a is an IO action, fmap f (a::IO a) will produce a (b:: IO b), it will run twice IO action?
09:48:41 <[exa]> no, why
09:49:21 <[exa]> "IO is an action" is a bit of oversimplification here, take IO types as descriptions of IO actions that happen once the runtime "interprets" the program
09:49:24 <albet70> 'cause there're two IO actions
09:49:51 <[exa]> so in your case, `fmap` takes a description of some action that produces `a`, and rewrites it to a description of some action that produces `b`
09:50:02 enemeth79 joins (uid309041@id-309041.lymington.irccloud.com)
09:50:09 <albet70> is there an example?
09:50:20 <albet70> for fmap on IO a?
09:51:00 <[exa]> yes, for example `fmap length getLine`
09:52:00 <[exa]> the `fmap` in there gets type `(String->Int) -> IO String -> IO Int`
09:56:37 <albet70> that getLine need input like anc from keyboard, then return 3 :: IO Int?
09:57:03 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
09:57:28 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:28f8:ffd7:495f:96f8)
10:01:41 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:28f8:ffd7:495f:96f8) (Ping timeout: 244 seconds)
10:04:12 × yauhsien quits (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) (Ping timeout: 245 seconds)
10:07:31 × sandy_doo quits (~sandydoo@185.209.196.136) (Ping timeout: 252 seconds)
10:11:17 <Midjak> Hello. I can't find the range function in the Data.Array package documentation. However, I have to import it in ghci to be able to use it. I don't understand... https://hackage.haskell.org/package/array-0.5.4.0/docs/Data-Array.html#g:2
10:12:01 matthewmosior joins (~matthewmo@173.170.253.91)
10:12:36 <Midjak> hummm ok it's in Data.Ix ... I have trouble to understand how import work... need to review this
10:15:57 × malte quits (~malte@mal.tc) (Ping timeout: 252 seconds)
10:22:02 × naso quits (~naso@193-116-244-197.tpgi.com.au) (Remote host closed the connection)
10:22:55 × vglfr quits (~vglfr@91.192.47.10) (Ping timeout: 252 seconds)
10:28:18 vglfr joins (~vglfr@194.9.14.33)
10:28:55 gurkenglas joins (~gurkengla@p548ac71b.dip0.t-ipconnect.de)
10:29:19 <tomsmeding> Midjak: in the documentation of Data.Array you see "module Data.Ix" near the top; this indicates a re-export of that entire module. In the source code, this looks like "module Data.Ix" in the export list: https://hackage.haskell.org/package/array-0.5.4.0/docs/src/Data.Array.html
10:29:26 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
10:29:32 dvdrw joins (~dvdrw@user/dvdrw)
10:30:06 <Midjak> hummm ok... thank you tomsmeding !
10:32:12 <tomsmeding> Midjak: I agree this makes documentation somewhat harder to navigate sometimes; example of a particularly bad case: https://hackage.haskell.org/package/stm-2.5.0.2/docs/Control-Concurrent-STM.html
10:32:14 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:28f8:ffd7:495f:96f8)
10:32:15 × stiell_ quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
10:32:44 stiell_ joins (~stiell@gateway/tor-sasl/stiell)
10:32:59 <tomsmeding> Though in the case of stm, it's usually clear where functions come from just because each module defines a separate data structure :)
10:33:23 <tomsmeding> Like, readTQueue is not going to be defined in the TVar module
10:33:55 <Midjak> ah yes, indeed, the package reexport all this sub-module .
10:36:03 <Midjak> oh I have just read the abstract pf the paper about STM. seems very interesting!
10:36:56 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:28f8:ffd7:495f:96f8) (Ping timeout: 255 seconds)
10:41:17 FragByte_ joins (~christian@user/fragbyte)
10:41:47 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
10:44:30 × FragByte quits (~christian@user/fragbyte) (Ping timeout: 264 seconds)
10:44:30 FragByte_ is now known as FragByte
10:45:21 <pavonia> When you have a local variable in a top-level function that doesn't depend on any of the function's parameters, will it get evaluated on each function call again?
10:45:56 <pavonia> e.g. f x y = x + y + c where c = <complicated expression>
10:48:14 naso joins (~naso@193-116-244-197.tpgi.com.au)
10:55:11 × naso quits (~naso@193-116-244-197.tpgi.com.au) (Ping timeout: 252 seconds)
10:55:21 <int-e> :t \x y -> x + y + c
10:55:22 <lambdabot> Expr -> Expr -> Expr
10:55:30 <int-e> err
10:55:31 <int-e> :t \x y -> x + y + ?c
10:55:33 <lambdabot> (Num a, ?c::a) => a -> a -> a
10:56:33 <int-e> There's let-floating if c has a fixed type.
10:56:43 <int-e> And that would avoid recomputation.
10:56:59 <int-e> If you have c :: Num a => a then that won't happen.
10:58:01 <int-e> So it depends, on types, and on the compiler actually performing that optimization. I'd worry more about the former.
10:58:18 <pavonia> Hhm, the type is Integral a => (Array Int Bool, a). Does that mean the array would not be re-evaluated but the number would?
10:59:13 <int-e> That's what I'd expect... well, provided there's no conversion from values of type a involved in creating the array.
10:59:38 <int-e> s/conversion from//
11:00:54 <int-e> (There's things like comparisons too which I wouldn't include under "conversion from")
11:01:25 <pavonia> There is
11:02:10 <pavonia> I'll let the values be created at top-level and don't care about that case then
11:02:41 naso joins (~naso@193-116-244-197.tpgi.com.au)
11:04:35 × naso quits (~naso@193-116-244-197.tpgi.com.au) (Client Quit)
11:05:52 <int-e> pavonia: And of course if you know the Integral instance that's going to be used, you could provide a type signature to fix that.
11:08:00 <int-e> But yeah, moving the value to the toplevel is an easy way to make certain it's not reevaluated.
11:10:27 acidjnk joins (~acidjnk@p200300d6e7058679941b85bc31e49e75.dip0.t-ipconnect.de)
11:10:51 × glguy quits (x@libera/staff/glguy) (Read error: Connection reset by peer)
11:10:52 glguy_ joins (x@libera/staff/glguy)
11:11:30 × acidjnk_new quits (~acidjnk@p200300d6e7058679a001276fdd936342.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
11:15:35 zxx7529 joins (~Thunderbi@user/zxx7529)
11:16:19 benin05 joins (~benin@183.82.30.242)
11:16:26 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
11:16:32 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
11:18:26 × benin0 quits (~benin@183.82.205.104) (Ping timeout: 268 seconds)
11:18:26 benin05 is now known as benin0
11:25:54 × gurkenglas quits (~gurkengla@p548ac71b.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
11:26:42 × vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 245 seconds)
11:35:36 vglfr joins (~vglfr@194.9.14.33)
11:40:03 × zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection)
11:40:11 zxx7530 joins (~Thunderbi@user/zxx7529)
11:41:46 naso joins (~naso@193-116-244-197.tpgi.com.au)
11:41:53 sandy_doo joins (~sandydoo@185.209.196.136)
11:42:30 zxx7530 is now known as zxx7529
11:42:42 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
11:43:21 × naso quits (~naso@193-116-244-197.tpgi.com.au) (Client Quit)
11:44:00 matthewmosior joins (~matthewmo@173.170.253.91)
11:52:08 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
11:53:41 mbuf joins (~Shakthi@122.165.55.71)
11:56:47 Guest|38 joins (~Guest|38@h217.18.214.67.dynamic.ip.windstream.net)
11:57:46 × Guest|38 quits (~Guest|38@h217.18.214.67.dynamic.ip.windstream.net) (Client Quit)
11:58:16 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
11:59:11 JannisO joins (~JannisO@dyndsl-089-166-213-108.ewe-ip-backbone.de)
12:02:44 odnes joins (~odnes@109-178-189-231.pat.ren.cosmote.net)
12:08:31 × JannisO quits (~JannisO@dyndsl-089-166-213-108.ewe-ip-backbone.de) (Ping timeout: 252 seconds)
12:11:13 doelie joins (~tom@c-73-17-195-134.hsd1.me.comcast.net)
12:12:32 × xff0x quits (~xff0x@ap007189.d.east.v6connect.net) (Ping timeout: 245 seconds)
12:15:18 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
12:16:42 hasbae joins (~hippoid@c-98-220-13-8.hsd1.il.comcast.net)
12:19:36 <doelie> hi all. is there anything special that needs to be done for foreign import capi functions that call pthread_create()? i have some code that starts a couple of threads which works fine from plain C executable, but doesn't seem to start threads when called from haskell.
12:23:08 <[exa]> doelie: any special compile flags? (I assume -threaded ?)
12:24:55 crazazy joins (~user@130.89.171.62)
12:26:32 russruss joins (~russruss@my.russellmcc.com)
12:29:07 <doelie> "/nix/store/gblb4a16xsgjbhc9iy5ad0x7x15f8ybf-ghc-8.10.7/bin/ghc" -threaded -I../tools -I../stm32f103 -I../../uc_tools -I../../uc_tools/linux hs_emu.hs
12:29:38 <[exa]> are the C functions calling back into haskell? (that's a common source of scheduling trouble)
12:29:56 <doelie> no haskell -> C only
12:31:01 <[exa]> ok weird, that should just work
12:31:19 <[exa]> I'd go `strace -f` and try to see what it's actually doing
12:33:49 naso joins (~naso@193-116-244-197.tpgi.com.au)
12:33:57 <naso> any good tutorials on quickcheck
12:34:44 <[exa]> naso: define "good" :D
12:35:32 <naso> not out of date... teaches me how to make Arbitrary instances for my custom types
12:35:41 xff0x joins (~xff0x@ap007189.d.east.v6connect.net)
12:36:11 × jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 244 seconds)
12:36:18 <[exa]> I was pretty happy with the official manual here http://www.cse.chalmers.se/~rjmh/QuickCheck/manual.html
12:37:10 <naso> thanks :)
12:37:49 <[exa]> like, hackage says this _might_ be out of date but it's probably not harshly out of date
12:37:57 <[exa]> if something looks broken feel free to ask here
12:38:51 benin05 joins (~benin@183.82.177.174)
12:39:03 <doelie> exa: the clone() calls are different in my C code and in the hs code. i'll strip it down to something simpler. thanks for the idea!
12:39:44 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:28f8:ffd7:495f:96f8)
12:39:58 <[exa]> naso: btw what's your type like? actually, the only conceptual problem with writing Arbitrary instances is that you must avoid generating an infinite object
12:40:47 × benin0 quits (~benin@183.82.30.242) (Ping timeout: 252 seconds)
12:40:47 benin05 is now known as benin0
12:41:36 <[exa]> doelie: ah ok, nice. it could be useful to check if the pthread_create doesn't actually return some kind of useful error (you might be hitting the limits because haskell already creates a few threads)
12:41:46 arjun joins (~arjun@user/arjun)
12:43:32 <[exa]> naso: btw it's often quite useful to copy code from this library https://hackage.haskell.org/package/quickcheck-instances :]
12:43:39 <naso> [exa]: the difficulty with my type is that it's consists of a bunch of (finite) sets and functions between them that have to satisfy some equations. just generating the data randomly, the chance of satisfying the equations is very low, so i have to think of a good way to sample the space of possibilities efficiently
12:43:55 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 244 seconds)
12:44:15 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:28f8:ffd7:495f:96f8) (Ping timeout: 260 seconds)
12:44:45 <naso> [exa]: thanks for that
12:46:35 <[exa]> ah so, that might be complicated. Is there some natural way to walk the space of "valid" values?
12:47:45 <doelie> exa: maybe this has something to do with signals. i've had issues before combining Haskell and C code that did not handle EINTR properly
12:47:59 <naso> yeah should be i just need to think of the best way to go about it
12:48:04 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
12:48:06 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
12:48:26 <geekosaur> doelie, try +RTS -V0
12:48:50 <geekosaur> the RTS uses a *lot* of timer signals
12:50:05 × acidjnk quits (~acidjnk@p200300d6e7058679941b85bc31e49e75.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
12:53:46 <[exa]> naso: how complex are the equations? one reasonable method is to generate a random case that doesn't satisfy anything, and then try to fix it towards the closest one that would pass
12:54:51 causal joins (~user@2001:470:ea0f:3:329c:23ff:fe3f:1e0e)
12:56:20 <naso> [exa]: essentially i am trying to generate a random finite set-valued functor on a a finite category, so the data consists of a bunch of sets, a bunch of funcitons between the sets, and the functions have to satisfy the the functor laws
12:56:42 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds)
12:56:57 <doelie> geekosaur: disabling timer didn't do anything
12:56:59 <naso> i think i need to find a generating set of arrows in the original category and just randomly get the values of the functor on that generating set
12:57:39 <doelie> i'll flatten the C code into a single pthread_create() call...
12:58:59 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
13:01:15 geekosaur wonders if hedgehog would be better suited to this than QuickCheck
13:02:17 Milan joins (~Milan@46.245.121.30)
13:02:23 matthewmosior joins (~matthewmo@173.170.253.91)
13:02:39 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 268 seconds)
13:02:54 <naso> never used hedgehog before ... looking it up now. thanks
13:04:57 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
13:06:23 <Milan> Hi ,Is it possible for  any one to answer  my question {is Lambda function always consider each function an identity function?}
13:09:26 chomwitt joins (~chomwitt@2a02:587:dc12:b700:d6f4:2a4f:a8e:737)
13:10:11 akegalj joins (~akegalj@95.168.118.31)
13:10:25 × akegalj quits (~akegalj@95.168.118.31) (Client Quit)
13:11:30 <[exa]> naso: oh wow. maybe test on a few smaller subsets of the functors that have reasonable generators?
13:12:25 misterfish joins (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl)
13:12:26 <[exa]> Milan: I'm not sure if I understood the question right, but in lambda calculus there are certainly functions that are _not_ identity functions, so the answer is probably no
13:13:59 <Milan> thank you ,but the process of currying forces me think like this
13:14:04 <doelie> stripped down example works fine... something not right with my C code. thanks for the help exa, geekosaur
13:14:49 <[exa]> Milan: like, all lambda functions are single-parameter functions (as in, λx.something), but that doesn't mean they have to be identities (λx.x)
13:15:29 <Milan> oh ,I got what u mean
13:15:53 <geekosaur> currying has nothing to do with identities, it's just a different way of looking at parameters, and supports partial application
13:16:21 × odnes quits (~odnes@109-178-189-231.pat.ren.cosmote.net) (Ping timeout: 252 seconds)
13:16:23 <[exa]> doelie: can you check whether the threads in the complicated code get started? (as in, code execution doesnt even reach the threads vs. the threads start but get interrupted forever)
13:16:34 odnes joins (~odnes@109-178-189-231.pat.ren.cosmote.net)
13:17:05 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 252 seconds)
13:17:18 <geekosaur> `foo a b = …` is `foo = \a -> \b -> …` so we can treat the expression `foo x` as filling in the `\a ->` and produce the closure `\b -> …` with `x` bound to `a`
13:17:29 <Milan> so the function returns one value but not necessarily the  same value as input
13:18:27 <[exa]> Milan: yes. take for example the K combinator, which is (λx.(λy.x)) -- upon receiving the 'x' parameter, it returns a function
13:20:28 <[exa]> (...which is different from `x` because it's `x` wrapped in a lambda :] )
13:20:49 <doelie> exa: i had a fprintf(stderr,...) right at the beginning of the thread main and that didn't get executed. what i think is going on here is that my C code is doing some preprocessor things that are not ok. it started working once i removed some includes. probably best to use a separate compilation unit then link that into haskell.
13:22:14 <Milan> excuse me for my questions ,because I am absolute beginner to programming ,is the final out put a `x`? which is different from the first `x`?
13:22:28 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 268 seconds)
13:23:24 <geekosaur> ultimately it's the same as the first x. but it has the "side effect" of consuming a y that disappears
13:23:45 <[exa]> Milan: np :] say you have the function (λx.(λy.x)) and you give it a parameter 123. You get: (λx.(λy.x)) 123, which may be β-reduced using substitution x:=123, receiving: (λy.123)
13:24:37 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
13:24:59 <[exa]> (λy.123) is not the same as 123, as geekosaur pointed out. But you can give it another parameter: (λy.123) 456 gets you your 123 back
13:26:27 <[exa]> (the reduction rule is: all occurences of `y` become 456 and the lambda disappears. Unfortunately there weren't any occurrences of `y` except in the lambda head)
13:28:21 × Milan quits (~Milan@46.245.121.30) (Quit: Client closed)
13:28:32 Milan joins (~Milan@46.245.121.30)
13:30:06 <Milan> I really appreciate your patience
13:30:47 × Milan quits (~Milan@46.245.121.30) (Client Quit)
13:30:57 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
13:42:03 × doelie quits (~tom@c-73-17-195-134.hsd1.me.comcast.net) (Remote host closed the connection)
13:45:50 califax_ joins (~califax@user/califx)
13:46:03 doelie joins (~tom@c-73-17-195-134.hsd1.ma.comcast.net)
13:47:45 × califax quits (~califax@user/califx) (Ping timeout: 268 seconds)
13:47:46 califax_ is now known as califax
13:52:14 zmt01 joins (~zmt00@user/zmt00)
13:52:33 JannisO joins (~JannisO@dyndsl-089-166-213-108.ewe-ip-backbone.de)
13:53:58 × m1dnight quits (~christoph@78.22.0.121) (Quit: WeeChat 3.6)
13:54:42 <doelie> works after adding .c -> .o compilation step, then linking that .o on ghc command line and using a clean header for foreign import capi.
13:56:15 × zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 272 seconds)
13:56:22 m1dnight joins (~christoph@78-22-0-121.access.telenet.be)
13:58:51 m1dnight_ joins (~christoph@78-22-0-121.access.telenet.be)
13:59:00 × m1dnight quits (~christoph@78-22-0-121.access.telenet.be) (Read error: Connection reset by peer)
14:01:05 × odnes quits (~odnes@109-178-189-231.pat.ren.cosmote.net) (Ping timeout: 252 seconds)
14:01:17 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds)
14:02:43 × szkl quits (uid110435@id-110435.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
14:03:28 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
14:08:41 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
14:18:40 <[exa]> doelie: kinda wondering what could have been the offender there. Something redefined pthread_create? :D
14:19:00 × sandy_doo quits (~sandydoo@185.209.196.136) (Ping timeout: 244 seconds)
14:19:35 <doelie> exa: i'm doing a lot of "creative" things there... this is microcontroller code wrapped to run as linux binaries for testing. i think it has something to do with feature macros
14:21:09 <[exa]> ah okay that is one easy way to collide. :]
14:21:12 zebrag joins (~chris@user/zebrag)
14:21:56 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
14:26:17 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 245 seconds)
14:28:28 × arjun quits (~arjun@user/arjun) (Quit: tip toe-ing my way outta here)
14:32:04 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
14:32:28 Swen joins (~Swen@2001:1c02:2b0f:ed00:f124:9a56:ad5e:5dc8)
14:34:05 × misterfish quits (~misterfis@ip214-130-173-82.adsl2.static.versatel.nl) (Ping timeout: 252 seconds)
14:36:03 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
14:36:07 <Swen> https://gist.github.com/Swendude/c3b6f639ba06a9277d2110dc849ac59c Any clue how to make cabal import my own executable to test it?
14:36:10 × dequbed quits (~dequbed@banana-new.kilobyte22.de) (Ping timeout: 244 seconds)
14:36:42 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds)
14:38:09 × Swen quits (~Swen@2001:1c02:2b0f:ed00:f124:9a56:ad5e:5dc8) (Quit: Client closed)
14:38:14 dequbed joins (~dequbed@banana-new.kilobyte22.de)
14:38:16 <geekosaur> iirc when you spe… feh
14:38:32 <albet70> is there a function turn [("a",1),("b",2),("a",2)...] to [("a",[1,2...]), ("b",[...])]?
14:38:44 <naso> using hedgehog, how can i turn [Property] into Property. i.e. i have a list of properties, and i want to check all of them
14:39:25 <geekosaur> > (group . sort) [("a",1),("b",2),("a",2)]
14:39:27 <lambdabot> [[("a",1)],[("a",2)],[("b",2)]]
14:39:51 <geekosaur> not quite
14:42:58 × dequbed quits (~dequbed@banana-new.kilobyte22.de) (Client Quit)
14:43:50 × JannisO quits (~JannisO@dyndsl-089-166-213-108.ewe-ip-backbone.de) (Ping timeout: 240 seconds)
14:44:12 <albet70> I wonder if list comprehension can do it?
14:45:05 dequbed joins (~dequbed@banana-new.kilobyte22.de)
14:50:34 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 268 seconds)
14:55:33 matthewmosior joins (~matthewmo@173.170.253.91)
15:00:11 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
15:05:37 × vglfr quits (~vglfr@194.9.14.33) (Remote host closed the connection)
15:06:46 vglfr joins (~vglfr@194.9.14.33)
15:08:08 <[Leary]> albet70: If you find yourself needing that, it might be time to replace your alist with a Map.
15:08:21 <[Leary]> :t M.fromListWith (++) . fmap (fmap pure)
15:08:22 <lambdabot> Ord k => [(k, a)] -> M.Map k [a]
15:08:30 <[Leary]> For example.
15:10:44 <albet70> Leary yeah, Map as the result is better
15:11:58 <albet70> turn [("a",1),("b",2),("a",2)...] to fromList [("a",[1,2...]), ("b",[...])].
15:12:08 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
15:16:05 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
15:16:06 machinedgod joins (~machinedg@d172-219-86-154.abhsia.telus.net)
15:16:52 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 244 seconds)
15:19:14 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
15:19:16 glguy_ is now known as glguy
15:19:43 × dvdrw quits (~dvdrw@user/dvdrw) (Quit: Lost terminal)
15:21:57 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
15:22:07 × machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 252 seconds)
15:24:06 machinedgod joins (~machinedg@d172-219-86-154.abhsia.telus.net)
15:29:42 matthewmosior joins (~matthewmo@173.170.253.91)
15:31:39 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
15:33:20 × hgolden quits (~hgolden2@cpe-172-251-233-141.socal.res.rr.com) (Quit: Konversation terminated!)
15:34:12 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 245 seconds)
15:35:19 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 252 seconds)
15:35:52 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 245 seconds)
15:36:07 hgolden joins (~hgolden2@cpe-172-251-233-141.socal.res.rr.com)
15:47:00 <albet70> there's a ugly way, first get all the first element in the tuple, group them get the unique ones, then add the second element in the tuple into the unique ones if the first element is equal
15:47:20 × enemeth79 quits (uid309041@id-309041.lymington.irccloud.com) (Quit: Connection closed for inactivity)
15:48:58 matthewmosior joins (~matthewmo@173.170.253.91)
15:49:09 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
15:50:37 acidjnk joins (~acidjnk@p200300d6e7058679941b85bc31e49e75.dip0.t-ipconnect.de)
15:51:33 × gmg quits (~user@user/gehmehgeh) (Quit: Leaving)
15:58:17 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection)
15:58:23 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
15:58:24 <[exa]> albet70: you won't get much better complexity than O(n log n) unless you know the # of "buckets" in advance. So what about just combining sortOn and groupOn and then an easy fold?
15:58:51 <[exa]> (whew, not even fold, map is sufficient!)
15:59:38 <[exa]> (I see others have already hinted in this direction :] )
16:00:00 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
16:03:00 × naso quits (~naso@193-116-244-197.tpgi.com.au) ()
16:13:12 odnes joins (~odnes@109-178-189-231.pat.ren.cosmote.net)
16:15:41 × odnes quits (~odnes@109-178-189-231.pat.ren.cosmote.net) (Client Quit)
16:20:29 × mbuf quits (~Shakthi@122.165.55.71) (Quit: Leaving)
16:22:59 × machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 252 seconds)
16:24:22 ChaiTRex joins (~ChaiTRex@user/chaitrex)
16:25:01 yin joins (~yin@user/zero)
16:28:29 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 252 seconds)
16:34:57 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
16:41:34 Jeanne-Kamikaze joins (~Jeanne-Ka@142.147.89.198)
16:43:05 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
16:45:30 wroathe joins (~wroathe@206-55-188-8.fttp.usinternet.com)
16:45:30 × wroathe quits (~wroathe@206-55-188-8.fttp.usinternet.com) (Changing host)
16:45:30 wroathe joins (~wroathe@user/wroathe)
16:49:57 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
16:50:23 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
16:56:08 econo joins (uid147250@user/econo)
16:58:07 gurkenglas joins (~gurkengla@p548ac71b.dip0.t-ipconnect.de)
16:59:33 PiDelport joins (uid25146@id-25146.lymington.irccloud.com)
17:02:44 matthewmosior joins (~matthewmo@173.170.253.91)
17:06:22 atkinjac joins (~atkinjac@2603:3026:105:6900::aa91)
17:13:11 × Techcable quits (~Techcable@user/Techcable) (Remote host closed the connection)
17:15:38 Techcable joins (~Techcable@user/Techcable)
17:16:25 × benin0 quits (~benin@183.82.177.174) (Quit: The Lounge - https://thelounge.chat)
17:17:46 × atkinjac quits (~atkinjac@2603:3026:105:6900::aa91) (Remote host closed the connection)
17:21:38 × Vajb quits (~Vajb@n1zigc3rgo9mpde2w-1.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
17:22:16 Vajb joins (~Vajb@hag-jnsbng11-58c3ad-40.dhcp.inet.fi)
17:26:48 pnotequalnp joins (~pnotequal@user/pnotequalnp)
17:27:06 <[itchyjunk]> I may or may not have made progress. I can turn "hello world" to "helloworld"
17:27:44 <hololeap> :t M.fromListWith (<>) . map (fmap S.singleton)
17:27:45 <lambdabot> (Ord k, Ord a) => [(k, a)] -> M.Map k (S.Set a)
17:28:25 <[itchyjunk]> Ah, why do I always end up with this output..
17:30:18 <EvanR> > filter (== ' ') "hello world"
17:30:20 <lambdabot> " "
17:30:25 <EvanR> crap
17:30:30 <geekosaur> heh
17:30:36 <geekosaur> (not that I never do that)
17:31:45 × mtjm quits (~mutantmel@2604:a880:2:d0::208b:d001) (Remote host closed the connection)
17:32:57 <hololeap> :t M.fromListWith (M.unionWith (+)) . map (fmap (`M.singleton` 1))
17:32:58 <lambdabot> (Ord k1, Ord k2, Num a) => [(k1, k2)] -> M.Map k1 (M.Map k2 a)
17:32:59 mtjm joins (~mutantmel@2604:a880:2:d0::208b:d001)
17:35:00 <hololeap> for each k1, keep count of each k2 that appeared with it
17:35:25 <hololeap> (just another possibility)
17:36:34 <hololeap> maps are great
17:37:16 <int-e> be sure to use a value-strict one
17:37:49 <hololeap> I'm not sure I've ever used Data.Map.Lazy (except by accident)
17:38:20 <EvanR> it's a specialty structure
17:38:21 <int-e> M.fromListWith (M.unionWith (+)) is the core of a ton of quick-and-dirty dynamic programming I've done.
17:39:04 <int-e> hololeap: I'm sure I have, but rarely... it's useful for some types of knot-tying.
17:40:38 <hololeap> I've never really understood "knot tying", it goes too far into implicit lazy evaluation voodoo for me
17:41:11 <hololeap> seems like a memleak waiting to happen
17:41:24 <EvanR> the idea is to avoid space leaks xD
17:41:36 <EvanR> which happen when you fail to tie the knot
17:42:42 hololeap confesses ignorance
17:42:47 <tomsmeding> > let l = [2 * l!!1, 5, l!!0 + 7] in l -- solving the system: a = 2b, b = 5, c = a + 7
17:42:48 <lambdabot> [10,5,17]
17:43:04 <hololeap> ah, of course!
17:43:07 <hololeap> ;)
17:43:18 <int-e> Right. And you can use a Map instead of a list and index things by their variable name.
17:43:25 <tomsmeding> Data.Map.Lazy just makes this n log n instead of n^2 :p
17:43:28 <tomsmeding> Yeah
17:43:54 <tomsmeding> Only works if the dependency graph has no cycles, of course
17:44:12 <tomsmeding> > let l = [2 * l!!1, l!!0, l!!0 + 7] in l
17:44:15 <lambdabot> [*Exception: <<loop>>
17:44:26 <int-e> It's... somewhat questionable because once you start checking for cycles (to detect invalid input), those tricks become kind of useless.
17:44:40 <EvanR> depends on which and how you look at the result!
17:44:56 <int-e> But it allows for some compact code for coding challenges where the input is guaranteed to be sound.
17:45:31 <int-e> ("coding challenges" may also be your own toy programs where you don't care about things like good error messages.)
17:50:24 <hololeap> >>> let m = LM.fromList [('a', 2 * m ! 'b'), ('b', 5), ('c', m ! 'a' + 7)] in m
17:50:27 <hololeap> fromList [('a',10),('b',5),('c',17)]
17:50:38 <hololeap> so yeah, it seems to work
17:51:01 <hololeap> could be a good example to take apart
17:51:06 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:51:10 <int-e> hololeap: Another knot-tying application I have are monadic DSLs with labels. So you'd start with `mdo`, define labels by `label <- makeLabel`, use labels anywhere (even before they're defined), and internally it would generate names for the labels and put some information about the location inside a Map. Though, hmm, I'm not sure whether I need a value-lazy map for that. It depends on the details.
17:51:12 <EvanR> and strict map would loop?
17:51:45 <hololeap> yeah, looks like it does
17:52:16 <hololeap> the output hangs on "fromList "
17:52:17 <int-e> (The knot is really just in taking the collected labels from the end and feeding them back into the computation.)
17:52:43 <int-e> Anyway. It rarely comes up, and it's usually deliberate.
17:53:21 <bontaq> hmm I have a modeling question related to a graph and how I could get rid of an extra parameter https://gist.github.com/bontaq/803cea883a62e95a25d39380e9ffe18e, if anyone could take a look. I feel like I'm missing something maybe obvious xD
17:53:25 <hololeap> I remember using mdo when I got way too deep into this frp application I was trying to make
17:53:36 <int-e> And of course there's memoization, but Map really isn't a great data structure for that if you're using the keys sparsely.
17:54:21 <int-e> (tries (finite and infinite) are better)
17:54:50 <int-e> But /if/ you do memization with Map you'll want a lazy one.
17:55:26 <hololeap> isn't a trie basically (Cofree (Map k))
17:56:27 <int-e> Hmm. Is it? Maybe it is.
17:57:03 <hololeap> I think I remember that being the case
17:57:16 <int-e> The point though is that tries can grow lazily, while using Map will always create the full tree of keys.
17:57:16 <albet70> what is Cofree? another drink?
17:58:41 <hololeap> yeah, ask for one at the cafe next time. they're deliciouis
17:58:51 <hololeap> delicious
17:59:00 <EvanR> no that's cofreefree
17:59:20 <[exa]> c'mon guys I thought we had enough Ffee jokes
17:59:38 <hololeap> @hoogle Cofree
17:59:39 <lambdabot> module Control.Comonad.Cofree
17:59:39 <lambdabot> Control.Comonad.Cofree data Cofree f a
17:59:39 <lambdabot> module Control.Comonad.Trans.Cofree
17:59:44 <int-e> We'll want `Trie k a = Trie a (Map k (Trie k a))`
18:00:06 <EvanR> sorry, *beats previous decade back with a golf club*
18:00:26 <hololeap> data Cofree = a :< (f (Cofree f a))
18:00:29 <[exa]> albet70: there's a concept of free data structures (as in, easily generated as free algebras), cofree is a dual concept to that
18:00:57 <int-e> hololeap: So yeah, that fits. Does that help you understand tries any better?
18:01:25 <EvanR> are f and a parameters to the data type there
18:01:26 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
18:01:31 <int-e> I can say that for me, it doesn't.
18:01:35 <int-e> EvanR: yes.
18:02:15 <hololeap> int-e: yeah it helps me
18:02:21 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 252 seconds)
18:02:29 <hololeap> EvanR: it should have been "data Cofree f a = ..."
18:02:41 Lord_of_Life_ is now known as Lord_of_Life
18:03:26 <EvanR> data Foo f a = a :< f (Foo f a), explains more than the term Cofree or any blurb about category theory, for me at this point xD
18:03:50 <hololeap> but I think of Cofree mostly in terms of its recursive structure, more than something to do with comonads
18:03:54 <EvanR> though I don't see what it has to do with tries
18:04:58 × pnotequalnp quits (~pnotequal@user/pnotequalnp) (Ping timeout: 252 seconds)
18:05:05 <int-e> EvanR: The (infinite) tries we want for memization memoize functions of type [k] -> a, so we need a value for the empty list (at the root) and a subtrie for every value of k.
18:05:25 <hasbae> i have the definition of bind (>>=), and need figure out fmap for the same type. is there equality relation fmap and >>=?
18:05:31 <int-e> And that's what Cofree (Map k) a allows you to do.
18:05:49 <int-e> provided k is finite, otherwise you have more work to do
18:06:00 <geekosaur> hasbae, there is a way to derive fmap from >>=, which you should be able to work out from the general definition of >>=
18:06:22 <int-e> :t fmap
18:06:22 <hasbae> ok
18:06:23 <lambdabot> Functor f => (a -> b) -> f a -> f b
18:06:45 <int-e> you'll need that other monad operation too.
18:06:51 <EvanR> i feel like there should be a way to "solve" one of the monad laws to get fmap in terms of >>= xD
18:06:53 <hololeap> EvanR: if you wanted a trie for strings, you would probably want `Cofree (Map Char) Bool`. the Bool is to keep track of whether or not this point in the structure corresponds with a string
18:06:56 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
18:07:21 <hasbae> int-e: return?
18:07:26 <int-e> hasbae: yes
18:08:28 <hololeap> (with the end of string that is cached in the trie)
18:11:19 <hololeap> a trie that has stored the strings "a" and "ab": False :< fromList [('a', True :< fromList [('b', True :< fromList []])]
18:11:34 <hololeap> False :< fromList [('a', True :< fromList [('b', True :< fromList []])]
18:12:01 <hololeap> (I think I'm missing a parens, but hopefully you get the point)
18:12:14 <EvanR> oh ok, that's a trie alright
18:13:35 × wroathe quits (~wroathe@user/wroathe) (Quit: leaving)
18:13:58 × acidjnk quits (~acidjnk@p200300d6e7058679941b85bc31e49e75.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
18:19:39 <koala_man> what's the current state of Haskell to WASM?
18:20:24 yauhsien joins (~yauhsien@61-231-30-230.dynamic-ip.hinet.net)
18:20:34 <geekosaur> still expected in 9.6
18:21:14 <geekosaur> if you want more details, talk to terrorjack in #ghc
18:21:53 <koala_man> awesome, thanks
18:23:30 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
18:23:59 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 252 seconds)
18:24:56 × yauhsien quits (~yauhsien@61-231-30-230.dynamic-ip.hinet.net) (Ping timeout: 244 seconds)
18:25:02 hermes2000 joins (~hermes200@136-24-143-232.cab.webpass.net)
18:25:29 × hermes2000 quits (~hermes200@136-24-143-232.cab.webpass.net) (Client Quit)
18:27:54 <koala_man> can an Array be length zero?
18:28:45 <koala_man> oh duh, array (0, -1). I confused myself
18:29:02 <geekosaur> (0,0) wouldn't it be?
18:29:34 <geekosaur> first and last index
18:29:47 <geekosaur> > array (0,0) []
18:29:48 <lambdabot> array (0,0) [(0,*Exception: (Array.!): undefined array element
18:30:15 <geekosaur> so it can make it but the Show instance doesn't work 🙂
18:30:31 <koala_man> > array (0,0) [(0,42)] ! 0
18:30:33 <lambdabot> 42
18:30:46 <koala_man> it's length 1
18:30:49 <geekosaur> hm, right, that's one element
18:31:05 <geekosaur> > array (0,-1) []
18:31:07 <lambdabot> array (0,-1) []
18:31:21 <geekosaur> I wonder if that only works by accident
18:31:34 <geekosaur> > array (True,False) []
18:31:35 <lambdabot> array (True,False) []
18:31:43 <geekosaur> apparently not
18:33:23 <EvanR> negative one in the index feels like python
18:33:27 <EvanR> make it go away
18:34:18 matthewmosior joins (~matthewmo@173.170.253.91)
18:35:50 × glguy quits (x@libera/staff/glguy) (Read error: Connection reset by peer)
18:35:55 glguy_ joins (x@libera/staff/glguy)
18:40:48 <EvanR> this is another mark against Array xD
18:41:21 <EvanR> the category theory of matrix algebra doesn't require negatives xD
18:45:16 <geekosaur> > array (-3,2) (zip [-3..2] "abcdef")
18:45:19 <lambdabot> array (-3,2) [(-3,'a'),(-2,'b'),(-1,'c'),(0,'d'),(1,'e'),(2,'f')]
18:46:33 <EvanR> oh right the indexes can be anything
18:46:45 <EvanR> implementing Ix
18:49:14 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
18:49:40 azimut joins (~azimut@gateway/tor-sasl/azimut)
18:52:36 glguy_ is now known as glguy
18:56:48 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
18:59:47 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
19:00:02 × Jeanne-Kamikaze quits (~Jeanne-Ka@142.147.89.198) (Ping timeout: 245 seconds)
19:05:12 × zxx7529 quits (~Thunderbi@user/zxx7529) (Remote host closed the connection)
19:09:24 <hpc> here's the real mark against Array
19:09:25 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:09:35 <hpc> > array ((), ()) ["can't make it empty"]
19:09:38 <lambdabot> error:
19:09:38 <lambdabot> • Couldn't match expected type ‘((), e)’ with actual type ‘[Char]’
19:09:38 <lambdabot> • In the expression: "can't make it empty"
19:09:48 <hpc> > array ((), ()) [((), "can't make it empty")]
19:09:49 <lambdabot> array ((),()) [((),"can't make it empty")]
19:10:02 <onosendi> How do I get the opposite of a boolean? Like `isTrue = True; isFalse = !isTrue`
19:10:24 <hpc> > not False
19:10:27 <lambdabot> True
19:10:28 <hpc> ^
19:10:37 <EvanR> isTrue = id
19:10:48 <hpc> isTrue = unsafeCoerce
19:10:55 × johnw quits (~johnw@2600:1700:cf00:db0:e87e:9cff:3897:94f) (Quit: ZNC - http://znc.in)
19:10:56 <geekosaur> unlike many languages, there is no autocoercion to Bool
19:11:22 <geekosaur> 0 is neither True nor False, it would be a type error if used as a Bool
19:14:26 <hpc> of course, that means 0 is FILE_NOT_FOUND
19:14:33 <EvanR> it's fine because a lot of, but not all, uses for doing that are covered by pattern matching
19:14:43 <hpc> https://thedailywtf.com/articles/What_Is_Truth_0x3f_
19:14:58 <onosendi> hpc: thanks
19:15:00 <EvanR> which skips the conversion to bool and gets to the actual point, often
19:15:15 <hpc> :P
19:17:48 Sgeo joins (~Sgeo@user/sgeo)
19:18:34 <onosendi> So `foldl` is like JS' `reduce`?
19:19:41 <hpc> yep
19:20:11 <hpc> also foldr
19:20:24 <EvanR> which is arguably less like js reduce
19:21:12 <onosendi> Well, we have `reduceRight` :P
19:22:24 <EvanR> ... what is that
19:23:15 <hpc> it's reduce, but right
19:23:24 <hpc> presumably it is less unlike foldr than reduce
19:23:24 Milan joins (~Milan@46.245.77.7)
19:23:26 <hpc> :P
19:24:00 <EvanR> now that we have Foldable, what foldr is is crystal clear
19:24:24 × Milan quits (~Milan@46.245.77.7) (Client Quit)
19:30:53 acidjnk joins (~acidjnk@p200300d6e7058679d19d5270ce8bc1dc.dip0.t-ipconnect.de)
19:31:23 <onosendi> The first one gives me a hint to change it. When I change it, I get an error. https://gist.github.com/onosendi/134aa0439a9f1c188d59a297a97bf70c
19:32:01 <EvanR> for the first issue, put a type signature
19:32:45 <EvanR> wait nvm
19:33:19 <EvanR> you need a type sig for the 2nd one but not the first? xD
19:33:41 <onosendi> Ah, got it. Thanks.
19:34:16 <EvanR> (I'm still confused lol)
19:34:18 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
19:34:40 <geekosaur> ghc 9.x?
19:34:43 <EvanR> I guess eta reduce doesn't always "just work", regarding type inference
19:35:07 <geekosaur> shallow subsumption broke eta reducing
19:35:32 <geekosaur> 9.2.4 added -DDeepSubsumption to bring back the old behavior
19:35:50 <EvanR> jeez
19:36:18 <geekosaur> (all of this happened because of QuickLook / ImpredicativeTypes, even when they're not involved)
19:36:47 <onosendi> `ghc --version` = The Glorious Glasgow Haskell Compilation System, version 8.10.7
19:37:01 <geekosaur> interesting, eta reduction should work in that version
19:37:30 <geekosaur> hm, but are you using ghc directly or using stack?
19:38:00 <dolio> I think you guys might be over-analyzing this.
19:38:10 <geekosaur> since stack can pick a ghc version based on the resolver, which may not be the version of ghc yuou get at the command line (if any)
19:38:22 <dolio> What applies to length2 but not length1?
19:38:37 <dolio> From Haskell 98.
19:38:48 Jeanne-Kamikaze joins (~Jeanne-Ka@142.147.89.198)
19:39:00 <geekosaur> oh, monomorphism restriction
19:39:05 <dolio> Bingo.
19:39:16 <geekosaur> which will apply because of Foldable
19:39:53 <geekosaur> and only with ExtendedDefaultRules would that then force defaulting to list
19:40:56 <EvanR> that involves prior technology but is no less complicated xD
19:41:19 <EvanR> thank you haskell may I please have another haskell
19:41:57 × yin quits (~yin@user/zero) (Read error: Connection reset by peer)
19:42:42 <geekosaur> and hidden behind all of this is that hlint knows nothing about types, monomorphism restriction, subsumption, etc. and will happily suggest eta reduction when it won't work
19:43:12 <geekosaur> it's based on heuristic analysis of code
19:43:34 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds)
19:46:19 azimut joins (~azimut@gateway/tor-sasl/azimut)
19:46:45 yin joins (~yin@user/zero)
19:47:06 pavonia joins (~user@user/siracusa)
19:47:36 <hololeap> hlint is occasionally helpful though, for instance reminding me that mapMaybe is a thing
19:48:06 × Inst quits (~Inst@2601:6c4:4080:3f80:88fb:d6ca:60f6:4fa2) (Ping timeout: 244 seconds)
19:49:08 <geekosaur> we silenced a warning in xmonad-contrib because it didn't realize that a `const` was needed to make types line up
19:50:17 <hololeap> I just have it enabled in hls locally. I wouldn't want it in the CI pipeline
19:51:26 <geekosaur> we only enable it in one CI job so it's fairly obvious when a failure is due to hlint
19:52:07 × mixfix41 quits (~sdenynine@user/mixfix41) (Ping timeout: 268 seconds)
19:54:35 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 268 seconds)
19:55:57 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
19:57:02 <onosendi> Given those hints/errors in that gist, is that hlint?
19:57:33 <geekosaur> the first one is hlint, the second is ghc
19:59:05 <onosendi> Ah ok.
19:59:30 × vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 240 seconds)
20:00:26 jmdaemon joins (~jmdaemon@user/jmdaemon)
20:02:52 <geekosaur> in vs code, hlint's messages are infos and ghc's are warnings or errors (check the icon next to the message). Also, hlint's always have that "Why not:"
20:03:28 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
20:03:40 <onosendi> Got it.
20:03:40 <geekosaur> and while hlint sometimes has some good ideas, you can feel free to ignore its suggestions or even disable them (in vs code that's available as one of the code actions)
20:06:19 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
20:06:23 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 268 seconds)
20:06:36 × Jeanne-Kamikaze quits (~Jeanne-Ka@142.147.89.198) (Quit: Leaving)
20:06:37 <onosendi> I'm in nvim using HLS, so I assume it's the same? I'm brand new to this language, so the hints seem to be helpful so far.
20:06:57 <geekosaur> I don't know how nvim presents them
20:07:00 × jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds)
20:07:03 waleee joins (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340)
20:07:10 <geekosaur> haven't tried HLS with either nvim or emacs as yet
20:08:16 <geekosaur> (probably won't try it with nvim as I only use that for quick edits)
20:08:32 jpds1 joins (~jpds@gateway/tor-sasl/jpds)
20:10:02 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 245 seconds)
20:10:54 × waleee quits (~waleee@2001:9b0:213:7200:cc36:a556:b1e8:b340) (Client Quit)
20:11:09 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
20:12:19 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
20:12:32 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 245 seconds)
20:12:54 vglfr joins (~vglfr@194.9.14.33)
20:13:12 <onosendi> Does hlint have a config file where you can config the rules?
20:13:21 <onosendi> ... per project
20:13:32 <geekosaur> yes
20:13:39 <onosendi> Ah, cool.
20:14:18 <geekosaur> should be .hlint.yaml at the root of a project, iirc
20:14:36 <geekosaur> there are also per-file annotations you can add
20:15:27 <onosendi> Nice. I'll read the docs.
20:16:03 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
20:16:39 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:17:02 machinedgod joins (~machinedg@d172-219-86-154.abhsia.telus.net)
20:17:17 × vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 252 seconds)
20:17:18 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
20:18:25 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
20:24:57 vglfr joins (~vglfr@194.9.14.33)
20:29:44 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 268 seconds)
20:30:25 Pickchea joins (~private@user/pickchea)
20:30:44 Milan joins (~Milan@46.245.77.7)
20:31:48 × Milan quits (~Milan@46.245.77.7) (Client Quit)
20:32:37 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
20:33:47 × vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 252 seconds)
20:33:56 vglfr joins (~vglfr@194.9.14.33)
20:34:33 briandaed joins (~briandaed@185.234.210.211.r.toneticgroup.pl)
20:34:37 × bontaq quits (~user@ool-45779fe5.dyn.optonline.net) (Ping timeout: 245 seconds)
20:36:03 <onosendi> I'm on datatypes section, and I'm not sure how to call these? https://gist.github.com/onosendi/75a3d9b55c5edf5f69c6d66c5f259f3c
20:38:11 × vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 252 seconds)
20:38:16 <geekosaur[m]> The same way you defined it
20:39:05 <geekosaur[m]> `calc (Add 1 1)`
20:39:58 <onosendi> Ah
20:42:07 matthewmosior joins (~matthewmo@173.170.253.91)
20:44:16 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
20:44:37 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 268 seconds)
20:45:09 × coco quits (~coco@212-51-146-199.fiber7.init7.net) (Ping timeout: 252 seconds)
20:45:14 × jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds)
20:45:14 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 268 seconds)
20:46:17 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
20:46:20 jpds1 joins (~jpds@gateway/tor-sasl/jpds)
20:46:32 ChaiTRex joins (~ChaiTRex@user/chaitrex)
20:47:21 vglfr joins (~vglfr@194.9.14.33)
20:53:45 sonologico joins (~raphael@dhcp-077-251-118-129.chello.nl)
20:57:49 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:58:08 coco joins (~coco@212-51-146-199.fiber7.init7.net)
20:58:49 tromp joins (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl)
21:02:45 × vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 252 seconds)
21:03:04 JannisO joins (~JannisO@dyndsl-089-166-213-108.ewe-ip-backbone.de)
21:03:06 vglfr joins (~vglfr@194.9.14.33)
21:07:54 × briandaed quits (~briandaed@185.234.210.211.r.toneticgroup.pl) (Remote host closed the connection)
21:10:01 × coco quits (~coco@212-51-146-199.fiber7.init7.net) (Quit: WeeChat 3.5)
21:15:27 × vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 245 seconds)
21:16:46 × dolio quits (~dolio@130.44.130.54) (Quit: ZNC 1.8.2 - https://znc.in)
21:18:49 dolio joins (~dolio@130.44.130.54)
21:20:07 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
21:22:15 × dolio quits (~dolio@130.44.130.54) (Client Quit)
21:22:24 × tromp quits (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:23:10 × shailangsa quits (~shailangs@host109-152-9-231.range109-152.btcentralplus.com) (Ping timeout: 240 seconds)
21:23:24 dolio joins (~dolio@130.44.130.54)
21:33:39 Milan joins (~Milan@46.245.77.7)
21:34:29 × mon_aaraj quits (~MonAaraj@user/mon-aaraj/x-4416475) (Ping timeout: 268 seconds)
21:35:35 × Milan quits (~Milan@46.245.77.7) (Client Quit)
21:39:20 × qrpnxz quits (~qrpnxz@fsf/member/qrpnxz) (Quit: WeeChat 3.5)
21:40:21 sandy_doo joins (~sandydoo@185.209.196.136)
21:40:35 vglfr joins (~vglfr@194.9.14.33)
21:46:32 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
21:52:37 × machinedgod quits (~machinedg@d172-219-86-154.abhsia.telus.net) (Ping timeout: 252 seconds)
21:56:40 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
21:58:04 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
21:59:15 × jinsun quits (~jinsun@user/jinsun) ()
21:59:40 matthewmosior joins (~matthewmo@173.170.253.91)
21:59:45 jinsun joins (~jinsun@user/jinsun)
22:03:45 mon_aaraj joins (~MonAaraj@user/mon-aaraj/x-4416475)
22:03:59 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)
22:05:41 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
22:06:22 ChaiTRex joins (~ChaiTRex@user/chaitrex)
22:06:29 Jeanne-Kamikaze joins (~Jeanne-Ka@142.147.89.198)
22:06:41 shailangsa joins (~shailangs@host86-185-98-81.range86-185.btcentralplus.com)
22:07:46 johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
22:08:57 × winny quits (~weechat@user/winny) (Quit: WeeChat 3.2)
22:15:21 × JannisO quits (~JannisO@dyndsl-089-166-213-108.ewe-ip-backbone.de) (Ping timeout: 252 seconds)
22:21:03 JNU99 joins (~JNU99@host-92-30-66-211.as13285.net)
22:21:58 JNU99 parts (~JNU99@host-92-30-66-211.as13285.net) ()
22:22:07 × yin quits (~yin@user/zero) (Ping timeout: 245 seconds)
22:32:27 × sonologico quits (~raphael@dhcp-077-251-118-129.chello.nl) (Ping timeout: 268 seconds)
22:33:26 matthewmosior joins (~matthewmo@173.170.253.91)
22:34:37 × vglfr quits (~vglfr@194.9.14.33) (Ping timeout: 245 seconds)
22:35:45 yin joins (~yin@user/zero)
22:44:09 × chomwitt quits (~chomwitt@2a02:587:dc12:b700:d6f4:2a4f:a8e:737) (Ping timeout: 276 seconds)
22:46:58 × acidjnk quits (~acidjnk@p200300d6e7058679d19d5270ce8bc1dc.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
22:51:39 × jpds1 quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 268 seconds)
22:52:39 jpds1 joins (~jpds@gateway/tor-sasl/jpds)
22:56:09 winny joins (~weechat@user/winny)
22:59:58 × triteraflops quits (~triterafl@user/triteraflops) (Ping timeout: 240 seconds)
23:06:20 × infinity0 quits (~infinity0@185.112.146.113) (Remote host closed the connection)
23:08:31 × Tuplanolla quits (~Tuplanoll@91-159-68-204.elisa-laajakaista.fi) (Quit: Leaving.)
23:17:33 × jespada quits (~jespada@181.80.249.105) (Read error: Connection reset by peer)
23:23:02 jespada joins (~jespada@181.80.249.105)
23:24:52 × sandy_doo quits (~sandydoo@185.209.196.136) (Ping timeout: 268 seconds)
23:25:21 <koala_man> is there a neat way to go from (a, Maybe b) -> Maybe (a,b) ?
23:26:26 <geekosaur> > sequence (5, Just 'a')
23:26:26 <dolio> > sequence (1, Just "a")
23:26:27 <lambdabot> Just (5,'a')
23:26:28 <lambdabot> Just (1,"a")
23:27:20 <koala_man> very nice, thanks!
23:28:10 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
23:34:17 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
23:35:22 <monochrom> That... is a life hack :)
23:37:02 <hpc> the real life hack is doing the reverse :P
23:37:41 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 255 seconds)
23:38:05 <monochrom> Uh that would be magic!
23:40:54 × ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection)
23:41:33 ChaiTRex joins (~ChaiTRex@user/chaitrex)
23:43:03 <jackdk> liquid haskell I suppose?
23:43:40 <geekosaur> don't think even that would work
23:44:15 <jackdk> If you prove that it's not Nothing, you should be right?
23:44:23 <jackdk> I've never used it
23:45:08 <hpc> yeah, you need a value of type 'a'
23:51:39 matthewmosior joins (~matthewmo@173.170.253.91)
23:52:33 <monochrom> If you prove that it's Nothing, I should be wrong? :)
23:52:54 <monochrom> I mean let's take it to the extreme...
23:53:16 <monochrom> You ask me to multiple an input number by 5.
23:53:39 <monochrom> If I use Liquid Haskell to prove that the input number is 0, then "f x = 0" is right? :)
23:56:06 × matthewmosior quits (~matthewmo@173.170.253.91) (Ping timeout: 244 seconds)

All times are in UTC on 2022-07-30.