Home liberachat/#haskell: Logs Calendar

Logs on 2021-07-27 (liberachat/#haskell)

00:01:03 roboguy__ parts (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200) ()
00:01:05 × deejaytee quits (~deejaytee@cpc91196-cmbg18-2-0-cust215.5-4.cable.virginm.net) (Ping timeout: 258 seconds)
00:04:21 oldleather joins (~Old@172.58.168.61)
00:04:42 oldleather parts (~Old@172.58.168.61) (Leaving)
00:06:42 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Read error: Connection reset by peer)
00:07:28 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
00:11:33 × Atum_ quits (~IRC@user/atum/x-2392232) (Quit: Atum_)
00:12:18 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
00:12:21 × Deide quits (~Deide@user/deide) (Quit: Seeee yaaaa)
00:14:03 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
00:14:49 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
00:16:51 slack1256 joins (~slack1256@191.125.99.204)
00:18:58 × slac61603 quits (~slack1256@191.125.21.222) (Ping timeout: 240 seconds)
00:20:51 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Quit: ZNC 1.8.2 - https://znc.in)
00:22:23 × myShoggoth quits (~myShoggot@97-120-70-214.ptld.qwest.net) (Quit: Leaving)
00:23:42 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
00:24:27 jeetelongname joins (~jeet@host-89-241-98-229.as13285.net)
00:30:19 mr-red joins (~drd@93-39-151-19.ip76.fastwebnet.it)
00:30:45 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 265 seconds)
00:32:38 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
00:33:44 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
00:39:35 × mr-red quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Quit: ZNC 1.8.2 - https://znc.in)
00:40:44 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
00:43:27 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
00:43:42 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
00:46:16 pschorf joins (~user@c-73-77-28-188.hsd1.tx.comcast.net)
00:47:22 × zebrag quits (~chris@user/zebrag) (Ping timeout: 240 seconds)
00:56:35 × raehik1 quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 255 seconds)
00:56:40 × slack1256 quits (~slack1256@191.125.99.204) (Ping timeout: 258 seconds)
00:57:17 × jeetelongname quits (~jeet@host-89-241-98-229.as13285.net) (Remote host closed the connection)
00:58:52 × renzhi quits (~xp@142.184.90.63) (Ping timeout: 256 seconds)
00:59:38 LukeHoersten joins (~LukeHoers@user/lukehoersten)
01:00:22 lavaman joins (~lavaman@98.38.249.169)
01:03:35 falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net)
01:03:54 × pschorf quits (~user@c-73-77-28-188.hsd1.tx.comcast.net) (Remote host closed the connection)
01:11:13 notzmv joins (~zmv@user/notzmv)
01:11:42 pschorf joins (~user@c-73-77-28-188.hsd1.tx.comcast.net)
01:14:35 × xff0x quits (~xff0x@2001:1a81:523c:b300:ba7e:c7d5:b4b7:3493) (Ping timeout: 255 seconds)
01:14:41 ham joins (~ham4@user/ham)
01:16:13 xff0x joins (~xff0x@2001:1a81:527c:b500:49fa:e8ed:ea99:60ec)
01:23:30 <arkho> As a Haskell newb, should I read the Haskell Report?
01:24:11 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
01:24:16 <sclv> arkho: depends how comfortable you are with bnf grammer, specs, etc in general
01:24:33 <sclv> if you are, then the report can be helpful -- if not, it might be a bit dense and you could be better off reading other things
01:24:48 <sclv> I _do_ suggest reading the report's version of the haskell prelude, because it is simple and idiomatic
01:24:51 <geekosaur> I would say no, formal language reports are rarely a good way to get to know a language unless you are fairly experienced with those kinds of reports
01:25:20 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 252 seconds)
01:25:28 <sclv> there are lots of intro books (some free) linked from the haskell homepage
01:25:30 <sclv> ?where documentation
01:25:31 <lambdabot> I know nothing about documentation.
01:25:48 <sclv> oh her
01:25:50 <sclv> er
01:25:52 <sclv> ?where docs
01:25:52 <lambdabot> https://www.haskell.org/documentation/
01:25:57 <sclv> ?botsnack
01:25:57 <lambdabot> :)
01:28:57 × alx741 quits (~alx741@186.178.108.3) (Quit: alx741)
01:32:37 × falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 265 seconds)
01:33:24 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Read error: Connection reset by peer)
01:35:03 drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
01:37:05 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Client Quit)
01:37:21 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
01:41:11 × Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Quit: Leaving.)
01:42:12 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
01:42:37 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
01:44:12 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 258 seconds)
01:54:22 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 265 seconds)
01:55:07 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
01:55:57 Erutuon joins (~Erutuon@user/erutuon)
01:57:26 <smtnet3> cute
01:59:27 derelict joins (~derelict@user/derelict)
02:00:10 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 265 seconds)
02:09:05 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
02:10:20 × LukeHoersten quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:10:21 × epolanski quits (uid312403@id-312403.brockwell.irccloud.com) (Quit: Connection closed for inactivity)
02:13:29 × AkechiShiro quits (~licht@user/akechishiro) (Ping timeout: 268 seconds)
02:13:32 × Raito_Bezarius quits (~Raito@wireguard/tunneler/raito-bezarius) (Ping timeout: 255 seconds)
02:15:09 Raito_Bezarius joins (~Raito@wireguard/tunneler/raito-bezarius)
02:15:35 AkechiShiro joins (~licht@user/akechishiro)
02:15:36 aegon joins (~mike@174.127.249.180)
02:15:47 derelict_ joins (~derelict@user/derelict)
02:16:00 <aegon> holy balls guys, i just got hasktorch working with rocm and it is blazing fast, going to make a post about perf next weekend or the one after
02:19:15 × derelict quits (~derelict@user/derelict) (Ping timeout: 276 seconds)
02:19:17 lavaman joins (~lavaman@98.38.249.169)
02:23:30 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
02:23:37 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
02:30:14 finn_elija joins (~finn_elij@user/finn-elija/x-0085643)
02:30:14 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (copper.libera.chat (Nickname regained by services)))
02:30:14 finn_elija is now known as FinnElija
02:31:05 × Morrow quits (~Morrow@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 255 seconds)
02:31:13 Morrow- joins (~Morrow@bzq-110-168-31-106.red.bezeqint.net)
02:31:14 Morrow joins (~Morrow@bzq-110-168-31-106.red.bezeqint.net)
02:31:22 × MorrowM quits (~Morrow@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 245 seconds)
02:32:15 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 276 seconds)
02:34:58 × pschorf quits (~user@c-73-77-28-188.hsd1.tx.comcast.net) (Ping timeout: 265 seconds)
02:43:11 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
02:51:41 × favonia quits (~favonia@user/favonia) (Ping timeout: 252 seconds)
02:57:06 derelict joins (~derelict@user/derelict)
02:59:56 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Ping timeout: 250 seconds)
03:00:06 × derelict_ quits (~derelict@user/derelict) (Ping timeout: 258 seconds)
03:00:14 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
03:00:34 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
03:01:10 favonia joins (~favonia@user/favonia)
03:01:16 × td_ quits (~td@94.134.91.47) (Ping timeout: 256 seconds)
03:02:48 td_ joins (~td@muedsl-82-207-238-215.citykom.de)
03:05:17 × Morrow quits (~Morrow@bzq-110-168-31-106.red.bezeqint.net) (Remote host closed the connection)
03:05:37 Morrow joins (~Morrow@bzq-110-168-31-106.red.bezeqint.net)
03:09:43 pottsy joins (~pottsy@2400:4050:b560:3700:3495:fb9e:8fab:95bf)
03:10:28 × MidAutumnMoon90 quits (~MidAutumn@user/midautumnmoon) (Quit: Leaving for a break - theLounge)
03:10:42 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
03:11:03 MidAutumnMoon90 joins (~MidAutumn@user/midautumnmoon)
03:11:13 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 265 seconds)
03:11:25 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
03:15:07 dermato_ joins (~dermatobr@154.21.114.128)
03:16:38 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
03:16:53 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
03:17:26 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 255 seconds)
03:21:56 × zaquest quits (~notzaques@5.128.210.178) (Remote host closed the connection)
03:23:20 zaquest joins (~notzaques@5.128.210.178)
03:31:28 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
03:32:17 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
03:33:21 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Read error: Connection reset by peer)
03:33:35 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
03:34:48 × tomboy64 quits (~tomboy64@user/tomboy64) (Ping timeout: 255 seconds)
03:37:29 wei2912 joins (~wei2912@112.199.250.21)
03:39:16 lavaman joins (~lavaman@98.38.249.169)
03:39:24 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
03:40:30 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
03:40:43 <Cajun> rocm = Radeon Open Compute and hasktorch is the pytorch equivalent?
03:41:01 <Cajun> hasktorch does look interesting, havent heard of that before
03:44:04 pesada joins (~agua@2804:18:4c:684a:1:0:5b66:52cd)
03:46:10 × agua quits (~agua@2804:14c:8793:8e2f:39e9:c5a8:c532:7498) (Ping timeout: 240 seconds)
03:46:12 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
03:46:26 derelict_ joins (~derelict@user/derelict)
03:46:52 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
03:48:15 × Topsi quits (~Tobias@dyndsl-037-138-065-137.ewe-ip-backbone.de) (Read error: Connection reset by peer)
03:48:23 nate3 joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net)
03:49:23 × derelict quits (~derelict@user/derelict) (Ping timeout: 255 seconds)
03:51:34 × yauhsien quits (~yauhsien@61-231-38-146.dynamic-ip.hinet.net) (Remote host closed the connection)
03:51:49 roboguy_ joins (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200)
03:54:25 flounders_ joins (~flounders@173.246.200.33)
03:55:06 × flounders quits (~flounders@173.246.200.33) (Ping timeout: 272 seconds)
03:59:08 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Ping timeout: 258 seconds)
04:01:38 tomboy64 joins (~tomboy64@user/tomboy64)
04:02:59 pe200012_ joins (~pe200012@113.105.10.33)
04:03:31 × roboguy_ quits (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200) (Remote host closed the connection)
04:03:40 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
04:03:55 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
04:04:05 roboguy_ joins (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200)
04:09:16 × roboguy_ quits (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200) (Ping timeout: 256 seconds)
04:09:56 yauhsien joins (~yauhsien@61-231-38-146.dynamic-ip.hinet.net)
04:10:46 lavaman joins (~lavaman@98.38.249.169)
04:11:41 × paddymahoney quits (~paddymaho@cpe9050ca207f83-cm9050ca207f80.cpe.net.cable.rogers.com) (Remote host closed the connection)
04:14:05 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
04:14:42 <eltonpinto> yea, hasktorch uses pytorch's tensor library
04:14:51 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
04:15:29 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 255 seconds)
04:17:43 × Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer)
04:18:17 Vajb joins (~Vajb@2001:999:62:1d53:26b1:6c9b:c1ed:9c01)
04:19:35 × Melantha quits (~pyon@user/pyon) (Quit: WeeChat 3.2)
04:19:53 Melantha joins (~pyon@user/pyon)
04:19:53 × Vajb quits (~Vajb@2001:999:62:1d53:26b1:6c9b:c1ed:9c01) (Read error: Connection reset by peer)
04:21:32 <Cajun> i read that it uses the underlying C++ library that pytorch also uses, i assume thats what you mean lol
04:21:41 Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi)
04:22:38 <eltonpinto> yes, that is correct. it has bindings to the underlying c++ library
04:27:38 × nate3 quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 255 seconds)
04:28:07 × Cajun quits (~Cajun@ip98-163-211-112.no.no.cox.net) (Ping timeout: 246 seconds)
04:28:21 Cajun joins (~Cajun@ip98-163-211-112.no.no.cox.net)
04:36:27 <Arahael> Is it possible, with proto-lens, to have the `Message msg` types converted to JSON in a generic fashion? (They do not use GHC.Generics)
04:36:37 roboguy_ joins (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200)
04:37:38 <Arahael> If so, what should I be looking at to achieve it?
04:38:39 fef joins (~thedawn@user/thedawn)
04:39:44 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
04:41:17 <dsal> The descriptor is available, so it should be relatively straightforward to generate a JSON representation.
04:46:58 × roboguy_ quits (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200) (Ping timeout: 240 seconds)
04:52:58 amahl joins (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi)
04:56:24 × amahl quits (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi) (Read error: Connection reset by peer)
04:59:48 dunkeln joins (~dunkeln@94.129.69.87)
05:00:15 × Feuermagier quits (~Feuermagi@user/feuermagier) (Quit: Leaving)
05:00:20 amahl joins (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi)
05:02:44 × derelict_ quits (~derelict@user/derelict) (Ping timeout: 255 seconds)
05:06:47 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Read error: Connection reset by peer)
05:06:57 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
05:08:04 <Arahael> dsal: Could you elaborate?
05:08:53 <dsal> Not very much unfortunately. I've only used the proto stuff for proto directly. I only know about the descriptor stuff because I stuffed them into the library: https://github.com/google/proto-lens/commits?author=dustin
05:09:12 <dsal> But theoretically, for a given message type, you can look up the descriptor which will tell you the fields and then you can generate a ToJSON from that.
05:09:33 <Arahael> dsal: What I can't figure out is how to get the values given a FieldDescriptor.
05:09:51 <Arahael> The field names themselves are the easy bit.
05:12:51 × yaroot quits (~yaroot@6.3.30.125.dy.iij4u.or.jp) (Quit: The Lounge - https://thelounge.chat)
05:13:38 yaroot joins (~yaroot@6.3.30.125.dy.iij4u.or.jp)
05:13:53 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds)
05:17:16 <dsal> I see. I've not used this lib in a year or so. It looks like the answer is in Message, but I don't have any protos to poke around with. It's possible the answer isn't there since you're expected to use lens to access all the field data, but it's been a while. It looks like digging around in the Message module should have the answer, though.
05:17:47 codelegend joins (~codelegen@27.5.195.204)
05:17:48 × amahl quits (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi) (Remote host closed the connection)
05:17:59 michalz joins (~michalz@185.246.204.58)
05:18:11 <codelegend> ```
05:18:47 peterhil joins (~peterhil@mobile-access-b04815-181.dhcp.inet.fi)
05:18:49 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 265 seconds)
05:19:44 <codelegend> https://paste.tomsmeding.com/wf5VMlDI
05:20:20 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 250 seconds)
05:21:02 <codelegend> I was writing something using ST, and this failed to typecheck. Can someone explain why? The error says `No instance for (MArray (STUArray s) Int (ST s1))`, I don't understand why it assumes the states are different (s and s1)
05:21:12 anandprabhu joins (~anandprab@94.202.243.198)
05:22:20 × anandprabhu quits (~anandprab@94.202.243.198) (Client Quit)
05:22:28 <codelegend> updated paste with the error: https://paste.tomsmeding.com/govHGUlu
05:23:06 × doyougnu quits (~user@c-73-25-202-122.hsd1.or.comcast.net) (Remote host closed the connection)
05:24:12 nate3 joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net)
05:28:53 × nate3 quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
05:34:28 pe200012 joins (~pe200012@218.107.49.28)
05:34:40 <c_wraith> short answer: you need ScopedTypeVariables
05:34:46 × pe200012_ quits (~pe200012@113.105.10.33) (Ping timeout: 265 seconds)
05:35:07 <c_wraith> slightly longer answer - without that extension, type variables in different type ascriptions are assumed to always be different
05:36:23 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
05:36:50 <c_wraith> So the two different s variables on line 7? They're in the same type, so they're the same s. But they're different from the s on line 5 or the s on line 8
05:38:31 <Arahael> dsal: Yeah, sadly for me, poking in it seems a bit of a rabbit hole for me. I consider myself good at Haskell, but I'm still frankly still a novice.
05:40:33 <dsal> Arahael: Yeah, it'll take some digging. It's a bit late for me. I understand the rabbit hole, though. Those two changes I made were for a similar excursion. I was surprised the functionality was missing. I would be less surprised if more functionality were missing.
05:40:36 vish joins (~igloo@24.130.32.174)
05:40:42 × vish quits (~igloo@24.130.32.174) (Client Quit)
05:41:32 roboguy_ joins (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200)
05:41:38 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds)
05:41:40 <Arahael> dsal: Not supporting Generics was a deliberate design decision from what I can tell from the issue tracker.
05:41:56 <Arahael> dsal: Though perhaps you should get some sleep. :) I'm at work, myself, and work is Swift, not Haskell. :(
05:42:06 <codelegend> c_wraith Ah okay. So I was reading the wiki on ScopedTypeVariables (https://wiki.haskell.org/Scoped_type_variables), and I don't really understand the example. It seems to claim that `b` is a free variable in the third case. But if that is the case here, how does it ensure all the `s` are the same?
05:42:40 <dsal> Arahael: yeah, that's a good idea. I have no excuse to still be sitting here. Didn't work on any of my own problems. heh 'night
05:43:02 <c_wraith> codelegend: that example is really confusing. It doesn't explain *why* each case works the way it does.
05:43:07 <Arahael> Ha. :) Lovely thing about side personal projects: There's no deadline! It'll still be here next week!
05:43:12 <Arahael> dsal: G'night!
05:43:35 <c_wraith> codelegend: the important thing is that to actually scope a type variable, you need to use an explicit forall to introduce it
05:43:43 <c_wraith> codelegend: the third example on that page doesn't do that
05:43:59 <c_wraith> The other two examples do
05:44:24 <codelegend> Ah okay, I think I get it now (sort of). I'll play around with some more examples and see. Thanks a lot!
05:48:37 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
05:48:52 Null_A joins (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99)
05:48:56 × Null_A quits (~null_a@2601:645:8700:2290:98e5:42b9:7e41:db99) (Remote host closed the connection)
05:51:32 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 252 seconds)
05:53:29 jneira joins (~jneira@212.8.115.226)
05:54:56 × azeem quits (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) (Ping timeout: 255 seconds)
05:55:42 azeem joins (~azeem@176.200.228.157)
05:56:39 jneira39 joins (~jneira@212.8.115.226)
05:58:53 × codelegend quits (~codelegen@27.5.195.204) (Quit: Client closed)
06:00:10 × jneira quits (~jneira@212.8.115.226) (Ping timeout: 246 seconds)
06:01:20 jneira39 is now known as jneira
06:02:18 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
06:04:56 × zmt01 quits (~zmt00@user/zmt00) (Ping timeout: 272 seconds)
06:08:02 × xff0x quits (~xff0x@2001:1a81:527c:b500:49fa:e8ed:ea99:60ec) (Ping timeout: 245 seconds)
06:08:55 pe200012_ joins (~pe200012@113.105.10.33)
06:09:05 × pe200012 quits (~pe200012@218.107.49.28) (Ping timeout: 265 seconds)
06:09:06 xff0x joins (~xff0x@2001:1a81:527c:b500:a365:4553:d50c:f6f5)
06:10:31 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
06:10:45 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Read error: Connection reset by peer)
06:10:57 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
06:11:37 burnside_ joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
06:11:38 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Read error: Connection reset by peer)
06:12:40 jgeerds joins (~jgeerds@55d45555.access.ecotel.net)
06:12:48 × ham quits (~ham4@user/ham) (Ping timeout: 256 seconds)
06:13:34 ham2 joins (~ham4@d8D8627D5.access.telenet.be)
06:15:49 × zaquest quits (~notzaques@5.128.210.178) (Read error: Connection reset by peer)
06:16:16 zaquest joins (~notzaques@5.128.210.178)
06:17:48 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
06:17:54 × aegon quits (~mike@174.127.249.180) (Remote host closed the connection)
06:18:40 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 258 seconds)
06:19:01 Lord_of_Life_ is now known as Lord_of_Life
06:20:51 × burnside_ quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
06:21:15 × roboguy_ quits (~roboguy_@2605:a601:ac0e:ae00:119d:d383:500:6200) ()
06:21:18 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
06:21:40 andreabedini joins (~andreabed@202.94.72.249)
06:22:52 dhil joins (~dhil@195.213.192.47)
06:23:41 burnside_ joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
06:25:18 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Read error: Connection reset by peer)
06:26:29 × jgeerds quits (~jgeerds@55d45555.access.ecotel.net) (Ping timeout: 265 seconds)
06:26:53 × azeem quits (~azeem@176.200.228.157) (Ping timeout: 255 seconds)
06:27:15 azeem joins (~azeem@176.200.241.36)
06:32:13 dunkeln joins (~dunkeln@94.129.69.87)
06:34:30 × shriekingnoise quits (~shrieking@186.137.144.80) (Quit: Quit)
06:34:42 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 272 seconds)
06:34:55 azeem joins (~azeem@176.200.241.36)
06:36:09 × yauhsien quits (~yauhsien@61-231-38-146.dynamic-ip.hinet.net) (Remote host closed the connection)
06:37:32 zeenk joins (~zeenk@2a02:2f04:a008:d600:18f2:3421:bac6:8f38)
06:39:01 × burnside_ quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
06:39:27 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
06:41:59 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:42:29 lavaman joins (~lavaman@98.38.249.169)
06:43:06 chomwitt joins (~chomwitt@2a02:587:dc0c:8100:12c3:7bff:fe6d:d374)
06:43:59 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 255 seconds)
06:44:02 yauhsien joins (~yauhsien@61-231-38-146.dynamic-ip.hinet.net)
06:46:44 pe200012_ is now known as pe200012
06:47:16 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
06:47:47 oxide joins (~lambda@user/oxide)
06:48:30 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
06:49:38 lortabac joins (~lortabac@2a01:e0a:541:b8f0:7d8e:40bb:852a:65d0)
06:50:48 Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es)
06:52:10 chele joins (~chele@user/chele)
06:52:25 × Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer)
06:52:33 Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi)
06:53:04 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 265 seconds)
06:53:56 × ham2 quits (~ham4@d8D8627D5.access.telenet.be) (Ping timeout: 258 seconds)
06:54:19 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 258 seconds)
06:55:50 × andreabedini quits (~andreabed@202.94.72.249) (Quit: WeeChat 2.8)
06:56:57 dunkeln joins (~dunkeln@94.129.69.87)
06:57:16 neceve joins (~quassel@2a02:c7f:607e:d600:f762:20dd:304e:4b1f)
06:58:56 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
07:00:12 × taktoa[c] quits (sid282096@id-282096.tinside.irccloud.com) (Read error: Connection reset by peer)
07:00:23 taktoa[c] joins (sid282096@id-282096.tinside.irccloud.com)
07:00:32 × martin02 quits (silas@hund.fs.lmu.de) (Ping timeout: 245 seconds)
07:01:08 × ikex quits (~ash@user/ikex) (Quit: ZNC - https://znc.in)
07:01:27 ikex joins (~ash@user/ikex)
07:03:12 × jneira_ quits (~jneira_@28.red-80-28-169.staticip.rima-tde.net) (Quit: Connection closed)
07:03:27 jakalx parts (~jakalx@base.jakalx.net) ()
07:03:42 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 265 seconds)
07:06:30 × Pent quits (sid313808@id-313808.tooting.irccloud.com) (Ping timeout: 250 seconds)
07:06:32 pe200012_ joins (~pe200012@113.105.10.33)
07:06:35 × pe200012 quits (~pe200012@113.105.10.33) (Ping timeout: 258 seconds)
07:08:27 Pent joins (sid313808@id-313808.tooting.irccloud.com)
07:09:03 fendor_ is now known as fendor
07:10:22 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
07:10:23 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:10:24 × Pent quits (sid313808@id-313808.tooting.irccloud.com) (Max SendQ exceeded)
07:10:38 × meinside_ quits (uid24933@id-24933.brockwell.irccloud.com) (Ping timeout: 252 seconds)
07:10:38 epolanski joins (uid312403@id-312403.brockwell.irccloud.com)
07:11:10 martin02 joins (silas@hund.fs.lmu.de)
07:11:40 Pent joins (sid313808@id-313808.tooting.irccloud.com)
07:12:15 meinside_ joins (uid24933@id-24933.brockwell.irccloud.com)
07:13:58 × nrr quits (sid20938@id-20938.tooting.irccloud.com) (Ping timeout: 272 seconds)
07:14:08 × sa quits (sid1055@2a03:5180:f::41f) (Ping timeout: 255 seconds)
07:15:00 × hongminhee quits (sid295@id-295.tinside.irccloud.com) (Ping timeout: 276 seconds)
07:15:32 × jakesyl quits (sid56879@id-56879.stonehaven.irccloud.com) (Ping timeout: 245 seconds)
07:15:34 sa joins (sid1055@id-1055.tinside.irccloud.com)
07:16:12 hongminhee joins (sid295@id-295.tinside.irccloud.com)
07:17:37 nrr joins (sid20938@id-20938.tooting.irccloud.com)
07:17:58 × meinside_ quits (uid24933@id-24933.brockwell.irccloud.com) (Ping timeout: 256 seconds)
07:18:18 jakesyl joins (sid56879@id-56879.stonehaven.irccloud.com)
07:19:46 meinside_ joins (uid24933@id-24933.brockwell.irccloud.com)
07:20:00 × jakesyl quits (sid56879@id-56879.stonehaven.irccloud.com) (Max SendQ exceeded)
07:20:00 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
07:20:34 jakesyl joins (sid56879@id-56879.stonehaven.irccloud.com)
07:22:11 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 252 seconds)
07:24:16 dunkeln joins (~dunkeln@94.129.69.87)
07:24:17 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 245 seconds)
07:26:27 acidjnk_new3 joins (~acidjnk@p200300d0c72b953020abcb826e8e1ebf.dip0.t-ipconnect.de)
07:27:40 × jolly quits (~jolly@208.180.97.158) (Ping timeout: 258 seconds)
07:28:10 × hnOsmium0001 quits (uid453710@id-453710.stonehaven.irccloud.com) (Ping timeout: 256 seconds)
07:30:29 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
07:30:30 hnOsmium0001 joins (uid453710@id-453710.stonehaven.irccloud.com)
07:31:55 jakalx joins (~jakalx@base.jakalx.net)
07:32:04 × johnw quits (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net) (Ping timeout: 250 seconds)
07:32:06 mikoto-chan joins (~mikoto-ch@ip-193-121-10-50.dsl.scarlet.be)
07:38:24 × dpratt_ quits (sid193493@id-193493.brockwell.irccloud.com) (Ping timeout: 276 seconds)
07:38:41 dpratt_ joins (sid193493@id-193493.brockwell.irccloud.com)
07:44:09 kenran joins (~kenran@b2b-37-24-119-190.unitymedia.biz)
07:44:32 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds)
07:44:44 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 255 seconds)
07:45:01 × kenran quits (~kenran@b2b-37-24-119-190.unitymedia.biz) (Client Quit)
07:45:09 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:45:32 azeem joins (~azeem@176.200.241.36)
07:46:49 cfricke joins (~cfricke@user/cfricke)
07:52:31 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 265 seconds)
07:53:04 azeem joins (~azeem@176.200.241.36)
07:54:05 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
07:59:45 deejaytee joins (~deejaytee@cpc91196-cmbg18-2-0-cust215.5-4.cable.virginm.net)
08:00:12 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 272 seconds)
08:00:21 azeem joins (~azeem@176.200.241.36)
08:06:03 × chele quits (~chele@user/chele) (Remote host closed the connection)
08:06:21 chele joins (~chele@user/chele)
08:08:13 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 244 seconds)
08:08:25 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
08:13:00 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 268 seconds)
08:15:12 dunkeln joins (~dunkeln@94.129.69.87)
08:15:28 × aerona quits (~aerona@2600:6c54:4600:f300:5d:533e:d781:9302) (Read error: Connection reset by peer)
08:17:08 × chomwitt quits (~chomwitt@2a02:587:dc0c:8100:12c3:7bff:fe6d:d374) (Ping timeout: 255 seconds)
08:17:48 allbery_b joins (~geekosaur@xmonad/geekosaur)
08:17:48 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
08:17:51 allbery_b is now known as geekosaur
08:18:31 chomwitt joins (~chomwitt@2a02:587:dc0c:8100:12c3:7bff:fe6d:d374)
08:20:29 × cjb quits (~cjb@user/cjb) (Quit: rcirc on GNU Emacs 28.0.50)
08:20:44 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 255 seconds)
08:22:41 × deejaytee quits (~deejaytee@cpc91196-cmbg18-2-0-cust215.5-4.cable.virginm.net) (Killed (iridium.libera.chat (Nickname regained by services)))
08:22:45 deejaytee joins (~deejaytee@193.46-255-62.static.virginmediabusiness.co.uk)
08:25:57 × acidjnk_new3 quits (~acidjnk@p200300d0c72b953020abcb826e8e1ebf.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
08:26:29 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
08:27:48 acidjnk_new3 joins (~acidjnk@p200300d0c72b953020abcb826e8e1ebf.dip0.t-ipconnect.de)
08:28:28 jumper149 joins (~jumper149@80.240.31.34)
08:33:17 burnside_ joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
08:33:37 × cfricke quits (~cfricke@user/cfricke) (Read error: Connection reset by peer)
08:33:59 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Read error: Connection reset by peer)
08:35:31 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 258 seconds)
08:35:59 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 252 seconds)
08:36:09 azeem joins (~azeem@176.200.241.36)
08:36:40 fossdd joins (~fossdd@sourcehut/user/fossdd)
08:40:04 × yauhsien quits (~yauhsien@61-231-38-146.dynamic-ip.hinet.net) (Quit: Leaving...)
08:40:45 × chomwitt quits (~chomwitt@2a02:587:dc0c:8100:12c3:7bff:fe6d:d374) (Ping timeout: 268 seconds)
08:44:31 mastarija joins (~mastarija@31.217.8.174)
08:44:34 johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
08:44:34 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
08:45:28 <mastarija> Say that I have a type `MyType i m v`, and that type can be a functor on either i or v, how would I write an instance for functor over i?
08:45:42 <mastarija> V is easy, instance Functor (MyType i m v)
08:46:02 <mastarija> * instance Functor (MyType i m)
08:46:24 <mastarija> But what about i? Can I use some type family to "swap" the arguments?
08:48:42 <thomasjm[m]> mastarija: probably just write out the `fmap` instance explicitly? you might want https://hackage.haskell.org/package/base-4.15.0.0/docs/Data-Bifunctor.html
08:49:04 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
08:49:12 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 250 seconds)
08:49:22 <mastarija> thomasjm[m], a... but my type is not a Bifunctor
08:49:37 <mastarija> It's either a functor on i, or a functor on v
08:49:42 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
08:50:03 <lortabac> mastarija: since you can't have 2 Functor instances for the same type, you need to define a newtype with a different variable order
08:50:40 <mastarija> lortabac, hm.. yes, I was hoping there could be some trick
08:50:59 <lortabac> mastarija: how would you select which instance you want?
08:51:16 <mastarija> Didn't think about that :D
08:52:16 <deejaytee> mastarija: could you explain a bit more about the underlying structure, and why that means that it's either one functor or the other?
08:52:55 <deejaytee> I don't doubt such a thing is possible, I'm just having trouble thinking of an example
08:53:08 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
08:53:08 × _bin quits (~bin@user/bin/x-1583188) (Quit: ZNC - https://znc.in)
08:53:15 <mastarija> deejaytee, it's a bit complex, but basically I have a type like either (a bit more complex)
08:53:21 _bin joins (~bin@user/bin/x-1583188)
08:53:46 <mastarija> So I might want to fmap over left or right
08:54:00 <lortabac> isn't it the definition of a Bifunctor?
08:54:06 <mastarija> No
08:54:12 <mastarija> It can be
08:54:14 ham joins (~ham4@user/ham)
08:54:17 <mastarija> But I don't want a bifunctor
08:54:29 <lortabac> ok, you want it to be a Functor in both cases
08:54:46 <mastarija> I want just a functor over a, and just a functor over b in `Either a b`
08:55:12 <deejaytee> well Either is a Bifunctor - it's just that lmap and rmap don't do anything
08:55:24 <deejaytee> But if your heart is set on fmap, yeah a newtype wrapper is what you'll need
08:55:56 <mastarija> Although, now that I think about selecting the right instance, I guess that function type could be the "clue" to select the right instance
08:56:04 <deejaytee> (*it's just that first and second don't do anything unless you're on the correct constructor)
08:56:21 × burnside_ quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
08:56:23 <mastarija> Problem is, I want to have different Monad instances as well :D
08:56:29 <mastarija> And applicatives
08:56:42 <mastarija> So bifunctor doesn't help
08:57:45 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds)
08:57:45 <tomsmeding> % map (Data.Bifunctor.first (+1)) [Left 2, Right 2]
08:57:46 <yahb> tomsmeding: [Left 3,Right 2]
08:58:04 <deejaytee> Yeah for your monad instance you're definitely going to want a newtype, otherwise I wager it'll be difficult to tell `do` which instance to pick, even if you find a trick to get the functor & applicative instances working
08:58:47 dunkeln joins (~dunkeln@94.129.69.87)
08:59:02 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
09:00:19 <mastarija> I guess, but one can dream :D
09:01:18 <deejaytee> unless you're too cool for do notation, in which case: https://hackage.haskell.org/package/bifunctors-5.5.11/docs/Data-Bifunctor-Functor.html#t:BifunctorMonad
09:02:01 bingruns joins (~bingruns@bxk158.neoplus.adsl.tpnet.pl)
09:03:24 agua joins (~agua@2804:14c:8793:8e2f:39e9:c5a8:c532:7498)
09:03:53 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 258 seconds)
09:06:43 × bingruns quits (~bingruns@bxk158.neoplus.adsl.tpnet.pl) (Client Quit)
09:06:57 bingruns joins (~bingruns@bxk158.neoplus.adsl.tpnet.pl)
09:07:20 × pesada quits (~agua@2804:18:4c:684a:1:0:5b66:52cd) (Ping timeout: 256 seconds)
09:08:11 × bingruns quits (~bingruns@bxk158.neoplus.adsl.tpnet.pl) (Client Quit)
09:08:21 bingruns joins (~bingruns@bxk158.neoplus.adsl.tpnet.pl)
09:09:47 × mei quits (~mei@user/mei) (Read error: Connection reset by peer)
09:10:03 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 276 seconds)
09:10:14 mei joins (~mei@user/mei)
09:15:07 × bingruns quits (~bingruns@bxk158.neoplus.adsl.tpnet.pl) (Quit: Client closed)
09:26:22 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 245 seconds)
09:26:49 azeem joins (~azeem@176.200.241.36)
09:29:04 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 250 seconds)
09:29:25 <tomsmeding> why does that type class use 't' as the monad type, instead of 'm'
09:29:52 <ixlun> What's the best way to implement a fast circular buffer of fixed sized?
09:29:54 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:7d8e:40bb:852a:65d0) (Ping timeout: 240 seconds)
09:30:12 fossdd joins (~fossdd@sourcehut/user/fossdd)
09:30:25 <ixlun> So as you add one element at the head, an element gets dropped at the tail
09:30:44 <tomsmeding> ixlun: should it be functional, or can it be in ST?
09:30:48 <deejaytee> tomsmeding: I assume because it "transforms" the underlying bifunctor
09:31:00 <ixlun> Can be in ST
09:31:09 <tomsmeding> deejaytee: then I'd expect 't' to be a monad transformer :p
09:31:18 <tomsmeding> but it doesn't matter anyway
09:31:27 <ixlun> or IO
09:31:29 <tomsmeding> ixlun: then just an STArray, right? or the vector equivalent
09:31:36 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 265 seconds)
09:31:37 <tomsmeding> not going to get a faster one
09:31:47 chomwitt joins (~chomwitt@athedsl-32041.home.otenet.gr)
09:31:54 <deejaytee> agree that I'd expect a transformer, agree that it doesn't matter :P
09:32:18 azeem joins (~azeem@176.200.241.36)
09:32:28 <ixlun> Right, so I'm looking at Data.Vector.Unboxed.Mutable
09:32:41 <ixlun> That sound about right?
09:32:50 <tomsmeding> yeah
09:32:58 <tomsmeding> if your data type can be unboxed, that is
09:33:08 <tomsmeding> I wrote this at some point for a different #haskell'er: https://gist.github.com/tomsmeding/1a9f9f6d64ab60699751c9bdeb99bc81
09:33:21 <tomsmeding> uses array, not vector, but it should be similar
09:34:11 tomsmeding isn't sure why that declares DataKinds, it doesn't use it
09:35:18 × hnOsmium0001 quits (uid453710@id-453710.stonehaven.irccloud.com) (Quit: Connection closed for inactivity)
09:35:29 Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi)
09:35:42 <ixlun> Right, that's perfect, I'll try and convert that to Vector code and see how I get on. Thanks for the help tomsmeding !
09:36:26 <tomsmeding> ixlun: FYI the name is because the person I wrote it for used 'fog' as a nick :p
09:36:52 <ixlun> Haha, I was wondering if there was some subtle joke with the name
09:40:20 cfricke joins (~cfricke@user/cfricke)
09:40:27 × cfricke quits (~cfricke@user/cfricke) (Client Quit)
09:51:25 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 265 seconds)
09:51:34 dunkeln joins (~dunkeln@94.129.69.87)
09:52:45 lortabac joins (~lortabac@2a01:e0a:541:b8f0:5a6e:2d28:b93b:2c96)
09:52:45 azeem joins (~azeem@176.200.241.36)
09:54:43 × mikoto-chan quits (~mikoto-ch@ip-193-121-10-50.dsl.scarlet.be) (Quit: mikoto-chan)
09:55:20 × troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Quit: What is Hope? That all of your wishes and all of your dreams come true? To turn back time because things were not supposed to happen like that (C) Rau Le Creuset)
09:59:07 troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua)
09:59:28 × SoF quits (~skius@user/skius) (Quit: Ping timeout (120 seconds))
09:59:49 SoF joins (~skius@user/skius)
10:00:32 jippiedoe joins (~david@2a02-a44c-e14e-1-19ba-6ff5-814d-2f81.fixed6.kpn.net)
10:00:42 × haritz quits (~hrtz@user/haritz) (Remote host closed the connection)
10:00:50 haritz joins (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220)
10:00:51 × haritz quits (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host)
10:00:51 haritz joins (~hrtz@user/haritz)
10:01:47 × mastarija quits (~mastarija@31.217.8.174) (Ping timeout: 245 seconds)
10:01:52 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
10:02:17 geekosaur joins (~geekosaur@xmonad/geekosaur)
10:02:59 texasmynsted_ joins (~texasmyns@99.96.221.112)
10:03:27 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 245 seconds)
10:04:42 × texasmynsted quits (~texasmyns@99.96.221.112) (Ping timeout: 240 seconds)
10:05:18 × tomsmeding quits (~tomsmedin@2a03:b0c0:0:1010::767:3001) (Remote host closed the connection)
10:05:34 dunkeln joins (~dunkeln@94.129.69.87)
10:05:36 × chomwitt quits (~chomwitt@athedsl-32041.home.otenet.gr) (Ping timeout: 258 seconds)
10:05:37 tomsmeding joins (~tomsmedin@tomsmeding.com)
10:09:03 lavaman joins (~lavaman@98.38.249.169)
10:14:19 <pmk> I have a function f :: t -> Either a String and I would like to do something like "<" ++ f x ++ ">". I am not sure how to map (++) through Either. I've tried (++) <$> Right "<" <*> f x <*> Right ">" but the second (<*>) rightly complains since its first argument is not a function. I probably could write a function to do it with do notation but is there an idiomatic way to accomplish this using Applicative?
10:14:53 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 252 seconds)
10:15:30 fossdd joins (~fossdd@sourcehut/user/fossdd)
10:16:57 × jippiedoe quits (~david@2a02-a44c-e14e-1-19ba-6ff5-814d-2f81.fixed6.kpn.net) (Ping timeout: 268 seconds)
10:17:56 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
10:18:01 __monty__ joins (~toonn@user/toonn)
10:18:21 <sshine_> > let f x = pure (show x) :: Either a String; between l r m = l <> m <> r in between "<" ">" <$> f 42
10:18:23 <lambdabot> Right "<42>"
10:19:36 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:5a6e:2d28:b93b:2c96) (Ping timeout: 276 seconds)
10:20:13 <pmk> Thanks sshine_!
10:20:26 <deejaytee> Using <&> from Data.Functor, you can preserve infix placement if you *really* want to :P
10:20:31 <deejaytee> e.g. ("<" ++) <$> Right "a" <&> (++ ">")
10:20:38 <sshine_> > concat <$> sequence [Right "<", Right "42", Right ">"]
10:20:40 <lambdabot> Right "<42>"
10:22:10 <sshine_> :t sequence
10:22:12 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
10:22:31 <sshine_> > sequence [Just "hello", Nothing, Just "world"]
10:22:33 <lambdabot> Nothing
10:22:41 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 252 seconds)
10:22:45 <sshine_> > sequence [Just "hello", Just " ", Just "world"]
10:22:46 <lambdabot> Just ["hello"," ","world"]
10:22:47 Kaipi joins (~Kaiepi@nwcsnbsc03w-47-54-173-93.dhcp-dynamic.fibreop.nb.bellaliant.net)
10:23:12 <sshine_> > concat ["hello", " ", "world"]
10:23:15 <lambdabot> "hello world"
10:23:23 <sshine_> > fmap concat (Just ["hello", " ", "world"])
10:23:25 <lambdabot> Just "hello world"
10:23:37 <sshine_> :t fmap concat . sequence
10:23:39 <lambdabot> (Traversable t, Monad f) => t (f [a]) -> f [a]
10:23:48 <dexterfoo> Is there something like memcpy for Data.Vector.Unboxed.Mutable?
10:24:03 <sshine_> :t fmap concat . sequence :: [Either a String] -> Either a [String]
10:24:04 <lambdabot> error:
10:24:04 <lambdabot> • Couldn't match type ‘Char’ with ‘[Char]’
10:24:05 <lambdabot> Expected type: [Either a1 String] -> Either a1 [String]
10:24:11 <sshine_> er :)
10:24:21 <pmk> hehe :)
10:24:46 × Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-54-173-93.dhcp-dynamic.fibreop.nb.bellaliant.net) (Ping timeout: 265 seconds)
10:24:47 Gurkenglas joins (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de)
10:24:49 <pmk> I think fmap concat . sequence is what I was looking for (or pretty close to it). Thanks!
10:25:03 <sshine_> :t fmap concat . sequence :: [Either a String] -> Either a String -- there
10:25:04 <lambdabot> [Either a String] -> Either a String
10:25:37 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Read error: Connection reset by peer)
10:25:56 Gurkenglas joins (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de)
10:26:09 sshine_ is now known as sshine
10:26:17 × royo quits (~royo@user/royo) (Remote host closed the connection)
10:26:33 pesada joins (~agua@177.79.68.96)
10:28:11 euouae joins (~euouae@user/euouae)
10:28:15 <euouae> Hello
10:28:22 dunkeln joins (~dunkeln@94.129.69.87)
10:28:54 <euouae> How do I use haddock to comment individual arguments? I am not sure how to format it. For example, now I use this style: https://paste.tomsmeding.com/jDqAB5mL
10:29:15 <euouae> Notice that I have to place :: on a newline so that -> always matches up. If I don't do this, my editor does not enter the right amount of spaces (I have to tab it myself)
10:29:17 × agua quits (~agua@2804:14c:8793:8e2f:39e9:c5a8:c532:7498) (Ping timeout: 268 seconds)
10:31:47 royo joins (~royo@user/royo)
10:31:47 <tomsmeding> euouae: looks like the "standard style", for as far as there's one https://hackage.haskell.org/package/base-4.14.0.0/docs/src/System.IO.html#line-458
10:32:10 <euouae> do you know which formatter follows that style?
10:32:12 × azeem quits (~azeem@176.200.241.36) (Ping timeout: 245 seconds)
10:32:19 tomsmeding doesn't use a formatter
10:32:20 <euouae> The one formatter I just tried replaces my -- ^ with newlines and --
10:32:21 <euouae> -- |
10:32:35 <euouae> You don't? Oh I love them!
10:32:37 <tomsmeding> can you post what its output is?
10:32:46 <tomsmeding> does it put the -- | before the argument instead of after it?
10:32:53 <euouae> https://paste.tomsmeding.com/U2AKRT6Q
10:33:03 <tomsmeding> that looks horrible to me :p
10:33:31 azeem joins (~azeem@62.18.161.85)
10:33:48 <euouae> I agree
10:33:52 <euouae> It's not too great
10:33:57 <tomsmeding> so I guess your question is: which formatter preserves "-> Int -- ^ documentation" formatting for function arguments
10:34:15 <euouae> What I can say is that I prefer a formatter over custom stylistic stuff
10:36:36 <tomsmeding> but it's all opinion anyway
10:36:41 <tomsmeding> which formatting is "nicest"
10:37:23 jippiedoe joins (~david@2a02-a44c-e14e-1-46af-5566-11c4-28b2.fixed6.kpn.net)
10:37:26 × acidjnk_new3 quits (~acidjnk@p200300d0c72b953020abcb826e8e1ebf.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
10:37:29 × terrorjack quits (~terrorjac@ec2-54-95-39-30.ap-northeast-1.compute.amazonaws.com) (Remote host closed the connection)
10:37:33 <tomsmeding> euouae: a regular here in this channel expresses this sentiment https://twitter.com/comerijn/status/1257804634833420292
10:38:26 terrorjack joins (~terrorjac@ec2-54-95-39-30.ap-northeast-1.compute.amazonaws.com)
10:38:39 <euouae> Doesn't matter what they think
10:39:09 <euouae> I know I waste time and energy overthinking it and it's better spent elsewhere
10:41:28 neurocyte0 joins (~neurocyte@46.243.81.131)
10:41:28 × neurocyte0 quits (~neurocyte@46.243.81.131) (Changing host)
10:41:28 neurocyte0 joins (~neurocyte@user/neurocyte)
10:41:54 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
10:43:03 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
10:43:39 × neurocyte0 quits (~neurocyte@user/neurocyte) (Client Quit)
10:43:51 neurocyte0 joins (~neurocyte@46.243.81.131)
10:43:51 × neurocyte0 quits (~neurocyte@46.243.81.131) (Changing host)
10:43:51 neurocyte0 joins (~neurocyte@user/neurocyte)
10:44:02 × Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 252 seconds)
10:44:17 neurocyte0 is now known as neurocyte
10:44:35 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 265 seconds)
10:44:59 fossdd joins (~fossdd@sourcehut/user/fossdd)
10:45:52 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
10:45:52 × MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Read error: Connection reset by peer)
10:46:25 MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com)
10:46:30 × jippiedoe quits (~david@2a02-a44c-e14e-1-46af-5566-11c4-28b2.fixed6.kpn.net) (Ping timeout: 256 seconds)
10:48:20 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 255 seconds)
10:48:50 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
10:49:22 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
10:49:52 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
10:51:36 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 256 seconds)
10:53:54 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
10:54:17 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 258 seconds)
10:54:30 lortabac joins (~lortabac@2a01:e0a:541:b8f0:63c6:890b:fddc:7714)
10:54:39 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
10:54:50 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
10:57:23 <Arahael> It's remarkable how quickly one gets used to using lenses.
10:59:05 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds)
10:59:18 <Rembane> And then gets unused to them again after not using them for a while.
11:00:02 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 255 seconds)
11:00:32 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:01:58 <Arahael> Indeed.
11:02:24 <Arahael> I should re-learn the whole` Lens s t a b` thing again.
11:02:41 <Arahael> (But not today)
11:03:21 × euouae quits (~euouae@user/euouae) (Quit: euouae)
11:04:08 dunkeln joins (~dunkeln@94.129.69.87)
11:04:48 × neurocyte quits (~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
11:06:22 neurocyte joins (~neurocyte@46.243.81.131)
11:06:22 × neurocyte quits (~neurocyte@46.243.81.131) (Changing host)
11:06:22 neurocyte joins (~neurocyte@user/neurocyte)
11:07:41 × chele quits (~chele@user/chele) (Ping timeout: 255 seconds)
11:07:51 chele joins (~chele@user/chele)
11:09:45 jippiedoe joins (~david@2a02-a44c-e14e-1-b572-7a56-aa26-eb3.fixed6.kpn.net)
11:10:46 <arkanoid> would you suggesto to learn error handling via Control.Exception or prefer Data.Either where left is custom Error type
11:11:46 <Rembane> arkanoid: I would go for Data.Either as long as possible
11:12:37 <Arahael> arkanoid: I'd use Control.Exception for seriously exceptional cases.
11:13:53 <arkanoid> Arahael: like when the program should really crash but it may be a library so it's up to the caller to decide what to do?
11:13:54 × jippiedoe quits (~david@2a02-a44c-e14e-1-b572-7a56-aa26-eb3.fixed6.kpn.net) (Ping timeout: 240 seconds)
11:14:08 <arkanoid> Rembane: thanks!
11:14:15 <Arahael> arkanoid: I think so.
11:15:04 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
11:15:38 <Rembane> arkanoid: np!
11:16:08 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
11:16:44 <arkanoid> is there anything else I should consider for this topic apart from Control.Exception, Data.Either and Data.Maybe and obviously Monad pattern?
11:19:47 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
11:24:06 jippiedoe joins (~david@2a02-a44c-e14e-1-bf41-1b3a-cc17-853c.fixed6.kpn.net)
11:25:36 × azeem quits (~azeem@62.18.161.85) (Ping timeout: 256 seconds)
11:26:01 azeem joins (~azeem@62.18.161.85)
11:26:08 acidjnk_new3 joins (~acidjnk@p200300d0c72b950729faca9193881d78.dip0.t-ipconnect.de)
11:29:08 tazca[m] joins (~tazcamatr@2001:470:69fc:105::c809)
11:29:40 Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es)
11:30:17 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
11:30:59 <merijn> Simple heuristic: Either for library interfaces, exceptions for within my own program
11:31:11 <merijn> i.e. exceptions across package boundaries should be opt-in
11:31:50 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
11:34:40 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 256 seconds)
11:36:10 tazca[m] parts (~tazcamatr@2001:470:69fc:105::c809) ()
11:36:16 Guest67 joins (~Guest67@bxk158.neoplus.adsl.tpnet.pl)
11:36:50 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 258 seconds)
11:38:14 arjun joins (~Srain@user/arjun)
11:42:57 gehmehgeh joins (~user@user/gehmehgeh)
11:45:00 × azeem quits (~azeem@62.18.161.85) (Ping timeout: 265 seconds)
11:45:17 azeem joins (~azeem@62.18.161.85)
11:47:33 <Arahael> Hmm. With lenses, I want to do `aVar & aField .~ aValue`, except I *don't* want the field set if aValue is Nothing. What should I do?
11:47:55 <Arahael> (ie, aValue is a `Maybe a`, and I want it to set the 'a' value if it exists)
11:48:36 raehik1 joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
11:48:52 <Arahael> merijn: That's fair - I remember getting surprised that wreq, as an example, didn't seem to work weirdly - turned out it was raising an exception. :) Using Either would have made that very explicit. (Though I think it was using Either, so I was quite confused)
11:50:44 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
11:51:21 <Arahael> I'm thinking of defining a new operator: .~? This sets the specified field to a if the RHS is "Just a", otherwise does nothing.
11:53:14 × Guest67 quits (~Guest67@bxk158.neoplus.adsl.tpnet.pl) (Quit: Client closed)
11:55:38 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds)
11:57:10 dunkeln joins (~dunkeln@94.129.69.87)
11:57:13 <Arahael> Hmm, that was too easy.
11:57:24 guest6474 joins (~guest6474@79.184.16.172.ipv4.supernova.orange.pl)
11:57:29 mastarija joins (~mastarija@31.217.8.174)
11:57:51 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
11:59:20 × guest6474 quits (~guest6474@79.184.16.172.ipv4.supernova.orange.pl) (Remote host closed the connection)
12:02:23 <jippiedoe> Arahael: if it's not a common enough pattern to want a `.~?`, you could use `aVar & aField %~ (`fromMaybe` aValue)` instead
12:05:06 × justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 240 seconds)
12:05:23 lavaman joins (~lavaman@98.38.249.169)
12:05:25 <Arahael> jippiedoe: It's common enough, but that looks even easier! Except that replaces the value in either case.
12:06:14 <Arahael> jippiedoe: I went with `a .~? (Just b) = a .~ b` and `a .~? Nothing = id`
12:06:40 <Arahael> (Right? That `fromMaybe` isn't preserving the input, isn't it?)
12:06:41 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
12:06:47 <jippiedoe> What do you mean with 'it replaces the value in either case'?
12:06:58 <Arahael> jippiedoe: What does it do if aValue is Nothing?
12:07:23 <jippiedoe> fromMaybe d x = case x of {Nothing -> d;Just v -> v}
12:07:47 <jippiedoe> fromMaybe a Nothing = a
12:08:07 anandprabhu joins (~anandprab@94.202.243.198)
12:09:19 <Arahael> Oh, yeah. I was confused.
12:09:30 <Arahael> Thanks - the user-provided function provides the original value.
12:10:02 <Arahael> Hmm, which means it becomes explicitly set?
12:10:36 Arahael thinks it doesn't make a difference - the lens don't distinguish, he thinks.
12:10:59 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
12:12:00 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 250 seconds)
12:13:05 fossdd joins (~fossdd@sourcehut/user/fossdd)
12:13:27 × anandprabhu quits (~anandprab@94.202.243.198) (Ping timeout: 245 seconds)
12:15:33 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds)
12:19:47 lavaman joins (~lavaman@98.38.249.169)
12:23:46 × raehik1 quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 240 seconds)
12:25:01 raehik1 joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
12:26:32 × raehik1 quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Client Quit)
12:29:35 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
12:32:33 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
12:32:50 lavaman joins (~lavaman@98.38.249.169)
12:32:58 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
12:33:35 lavaman joins (~lavaman@98.38.249.169)
12:33:43 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
12:34:39 lavaman joins (~lavaman@98.38.249.169)
12:39:42 × arjun quits (~Srain@user/arjun) (Ping timeout: 258 seconds)
12:41:11 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
12:41:43 <tomsmeding> Arahael: what about `aVar & aField %~ (aValue <|>)`
12:42:03 <tomsmeding> disclaimer: I have no idea about lenses, but with regards to Maybe, that should have the semantics that you describe I think?
12:42:24 <tomsmeding> ( (<|>) from Alternative in Control.Applicative)
12:42:35 <Arahael> tomsmeding: That's a variant of what jippiedoe suggested, I think. That works also, I think.
12:42:47 <Arahael> So I have three options now. :D And I've now learnt about %~
12:43:06 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 268 seconds)
12:43:45 fossdd joins (~fossdd@sourcehut/user/fossdd)
12:43:54 × texasmynsted_ quits (~texasmyns@99.96.221.112) (Ping timeout: 240 seconds)
12:45:08 gzj joins (~GZJ0X@199.193.127.138.16clouds.com)
12:45:11 <tomsmeding> oh wait 'aField' is not a Maybe but just the value itself? Then yes, fromMaybe :p
12:45:28 hendursaga joins (~weechat@user/hendursaga)
12:45:47 <jippiedoe> Ah, I interpreted the field to be of type `a` that you want to replace if the replacement exists, whereas tomsmeding's suggestion works if the field is of type `Maybe a`
12:45:54 <tomsmeding> ^
12:46:10 <jippiedoe> and while I was typing I didn't see you saw it too already :)
12:46:23 tomsmeding high-5's jippiedoe
12:48:16 <Arahael> Ah, interesting.
12:53:18 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
12:55:05 × azeem quits (~azeem@62.18.161.85) (Ping timeout: 265 seconds)
12:55:17 jolly joins (~jolly@208.180.97.158)
12:57:59 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds)
12:58:19 azeem joins (~azeem@62.18.161.85)
12:58:34 × jneira quits (~jneira@212.8.115.226) (Quit: Client closed)
13:00:24 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 265 seconds)
13:00:25 argento joins (~argent0@168-227-96-51.ptr.westnet.com.ar)
13:01:06 alx741 joins (~alx741@186.178.108.3)
13:02:14 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
13:02:39 <xerox> :t fmap . const
13:02:41 <lambdabot> Functor f => b -> f a -> f b
13:02:49 <xerox> I'd do it like that
13:03:14 chris_ joins (~chris@81.96.113.213)
13:03:28 <Taneb> :t (<$)
13:03:30 <lambdabot> Functor f => a -> f b -> f a
13:04:30 lavaman joins (~lavaman@98.38.249.169)
13:04:37 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
13:06:14 × gzj quits (~GZJ0X@199.193.127.138.16clouds.com) (Remote host closed the connection)
13:06:32 gzj joins (~GZJ0X@199.193.127.138.16clouds.com)
13:07:12 × gzj quits (~GZJ0X@199.193.127.138.16clouds.com) (Remote host closed the connection)
13:07:32 gzj joins (~GZJ0X@199.193.127.138.16clouds.com)
13:08:12 × gzj quits (~GZJ0X@199.193.127.138.16clouds.com) (Read error: Connection reset by peer)
13:08:30 gzj joins (~GZJ0X@199.193.127.138.16clouds.com)
13:09:11 × gzj quits (~GZJ0X@199.193.127.138.16clouds.com) (Remote host closed the connection)
13:09:31 gzj joins (~GZJ0X@199.193.127.138.16clouds.com)
13:11:13 × gzj quits (~GZJ0X@199.193.127.138.16clouds.com) (Remote host closed the connection)
13:12:22 Morgan joins (~Morgan@host81-152-76-173.range81-152.btcentralplus.com)
13:13:15 × Morgan quits (~Morgan@host81-152-76-173.range81-152.btcentralplus.com) (Client Quit)
13:13:49 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
13:13:49 × wei2912 quits (~wei2912@112.199.250.21) (Quit: Lost terminal)
13:16:48 × adanwan_ quits (~adanwan@gateway/tor-sasl/adanwan) (Remote host closed the connection)
13:17:02 adanwan joins (~adanwan@gateway/tor-sasl/adanwan)
13:17:54 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
13:18:21 × jippiedoe quits (~david@2a02-a44c-e14e-1-bf41-1b3a-cc17-853c.fixed6.kpn.net) (Ping timeout: 276 seconds)
13:18:46 <arkanoid> where I can find good examples of simple haskell programs that can show me a picture of IO, error handling and Monads in general? I keep finding snippets of different topics, but not real programs
13:19:27 Morgan joins (~Morgan@host81-152-76-173.range81-152.btcentralplus.com)
13:20:50 <merijn> shellcheck? pandoc?
13:20:58 <merijn> xmonad, I suppose?
13:22:20 <tomsmeding> not sure those count as "simple" :p
13:23:12 × Morgan quits (~Morgan@host81-152-76-173.range81-152.btcentralplus.com) (Client Quit)
13:25:30 <[exa]> arkanoid: we can write some for you, if you have a topic
13:26:19 <[exa]> arkanoid: a deceiving problem in haskell is that "simple" usually means "oneliner" which people sometimes refuse to accept as a valid example program :D
13:29:05 <arkanoid> shellcheck and xmonad "simple" :D for simple I mean classic example of small game like tic tac toe (with input and output). Just random guessing. I prefer a good example of haskell code (yet doing IO) than a specific task
13:29:48 <merijn> tic-tac-toe sounds much harder than shellcheck, tbh
13:30:43 <[exa]> arkanoid: for tic-tac-toe, check out Brick library (or maybe Gloss)
13:30:57 jippiedoe joins (~david@77-171-152-62.fixed.kpn.net)
13:31:03 <__monty__> Error handling isn't very common in Haskell fwiw. So you're not likely to find it in short examples. IME
13:31:03 <[exa]> iirc Brick even has some simple game in demos, it might have been snake or something
13:31:21 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
13:35:45 lavaman joins (~lavaman@98.38.249.169)
13:37:37 justsomeguy joins (~justsomeg@user/justsomeguy)
13:37:56 × azeem quits (~azeem@62.18.161.85) (Ping timeout: 252 seconds)
13:38:19 azeem joins (~azeem@62.18.161.85)
13:39:12 × yahb quits (xsbot@user/mniip/bot/yahb) (Ping timeout: 252 seconds)
13:39:42 × mastarija quits (~mastarija@31.217.8.174) (Ping timeout: 245 seconds)
13:40:28 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds)
13:41:40 motherfsck joins (~motherfsc@user/motherfsck)
13:44:17 × Morrow quits (~Morrow@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 255 seconds)
13:44:29 yahb joins (xsbot@user/mniip/bot/yahb)
13:46:17 arthurxavierx joins (~arthurxav@201.17.157.69)
13:46:58 kayprish joins (~kayprish@cable-188-2-229-172.dynamic.sbb.rs)
13:49:23 × lambdap quits (~lambdap@static.167.190.119.168.clients.your-server.de) (Quit: lambdap)
13:53:23 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
13:53:29 × kayprish quits (~kayprish@cable-188-2-229-172.dynamic.sbb.rs) (Read error: Connection reset by peer)
13:54:06 Guest67 joins (~Guest67@bxk158.neoplus.adsl.tpnet.pl)
13:55:11 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
13:55:21 × Guest67 quits (~Guest67@bxk158.neoplus.adsl.tpnet.pl) (Client Quit)
13:58:25 lambdap joins (~lambdap@static.167.190.119.168.clients.your-server.de)
13:58:40 × jmorris quits (uid433911@id-433911.stonehaven.irccloud.com) (Quit: Connection closed for inactivity)
13:58:41 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Read error: Connection reset by peer)
13:59:08 Gurkenglas joins (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de)
14:03:06 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 272 seconds)
14:03:39 shriekingnoise joins (~shrieking@186.137.144.80)
14:05:46 dunkeln joins (~dunkeln@94.129.69.87)
14:10:37 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
14:12:05 amahl joins (~amahl@84.251.202.64)
14:12:47 jolly95 joins (~jolly@208.180.97.158)
14:14:53 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 255 seconds)
14:16:17 × jolly quits (~jolly@208.180.97.158) (Ping timeout: 265 seconds)
14:17:35 jolly95 is now known as jolly
14:17:53 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
14:18:18 mastarija joins (~mastarija@31.217.8.174)
14:19:22 andreabedini[m] joins (~andreabed@2001:470:69fc:105::c821)
14:20:37 lavaman joins (~lavaman@98.38.249.169)
14:20:45 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
14:21:20 jneira_ joins (~jneira_@28.red-80-28-169.staticip.rima-tde.net)
14:22:04 arjun joins (~Srain@user/arjun)
14:26:33 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
14:28:21 jakalx joins (~jakalx@base.jakalx.net)
14:30:28 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
14:31:42 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Read error: Connection reset by peer)
14:31:55 enoq joins (~enoq@194-208-179-35.lampert.tv)
14:31:58 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
14:32:24 Gurkenglas joins (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de)
14:33:18 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
14:35:06 <dsal> > [Nothing, Just 3] & each . _Just .~ 1 -- Arahael
14:35:08 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds)
14:35:08 <lambdabot> [Nothing,Just 1]
14:35:26 chris_ joins (~chris@81.96.113.213)
14:36:12 <dsal> Oh wait, you're doing it the other way around?
14:38:21 abarbu joins (~user@c-66-31-23-28.hsd1.ma.comcast.net)
14:38:53 × acidjnk_new3 quits (~acidjnk@p200300d0c72b950729faca9193881d78.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
14:39:58 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Ping timeout: 256 seconds)
14:40:19 abarbu parts (~user@c-66-31-23-28.hsd1.ma.comcast.net) ()
14:41:17 falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net)
14:41:19 × falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Remote host closed the connection)
14:41:35 falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net)
14:42:25 Guest1981 joins (~user@c-66-31-23-28.hsd1.ma.comcast.net)
14:43:24 <Guest1981> I have a ghci question. when I run "x :: Int; x = 1" then ":t x" I get "error: Variable not in scope: x"
14:44:05 <Guest1981> Shouldn't x be in scope?
14:44:59 <Orbstheorem> Works in my shell 🤔
14:45:27 <geekosaur> works here too
14:45:58 <Guest1981> Everything I can see online says it should work, but it doesn't
14:46:40 <Orbstheorem> If you try to print the variable, does it not work either?
14:48:48 <Guest1981> <interactive>:105:7: error: Variable not in scope: x
14:49:56 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
14:50:02 <Orbstheorem> That 105 is curious, how are you using ghci?
14:50:25 <Guest1981> Oh, that's just because I had run quite a few other commands before.
14:50:49 <Orbstheorem> have you tried in a fresh repl?
14:50:57 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
14:51:09 <Orbstheorem> Maybe you were in some scope when you originally bound it.
14:51:20 <Guest1981> Hah, so.. without -fobject-code this works. With -fobject-code it's never in scope
14:51:24 Sgeo joins (~Sgeo@user/sgeo)
14:51:29 <Guest1981> In a fresh ghci
14:52:02 lavaman joins (~lavaman@98.38.249.169)
14:52:28 <geekosaur> I can reproduce that locally
14:52:38 <geekosaur> interesting
14:52:54 <Guest1981> Prelude> x :: Int; x = 1
14:52:54 <Guest1981> Prelude> x
14:52:54 <Guest1981> 1
14:52:54 <Guest1981> Prelude> :set -fobject-code
14:52:57 <Guest1981> Prelude> y :: Int; y = 1
14:53:00 <Guest1981> Prelude> y
14:53:04 <Guest1981> <interactive>:5:1: error: Variable not in scope: y
14:53:07 <Guest1981>
14:53:10 <Guest1981> Is this intended behavior?
14:55:29 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 252 seconds)
14:56:29 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
14:56:33 × jippiedoe quits (~david@77-171-152-62.fixed.kpn.net) (Ping timeout: 258 seconds)
14:58:20 × arjun quits (~Srain@user/arjun) (Ping timeout: 265 seconds)
15:02:10 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:63c6:890b:fddc:7714) (Quit: WeeChat 2.8)
15:03:04 × azeem quits (~azeem@62.18.161.85) (Ping timeout: 258 seconds)
15:03:09 <merijn> Yes, no, maybe
15:03:09 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
15:03:36 azeem joins (~azeem@62.18.161.85)
15:03:45 <merijn> ghci never really behaved like a normal source file, but has been incrementally hacked up over the years to act more like a source file
15:03:52 <geekosaur> I can see how it might be happening, and suspect it wouldn't be readily fixable
15:04:27 <geekosaur> -fobject-code is really meant to work with something preloaded and probably doesn'[t interact very well with, er, interaction
15:05:00 LukeHoersten joins (~LukeHoers@user/lukehoersten)
15:05:55 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Quit: ZNC 1.8.2 - https://znc.in)
15:05:56 <geekosaur> and yes, ghci is a hyuge mess
15:06:41 <merijn> ghci is great for toying with stuff
15:07:11 <merijn> But don't expect reasonable behaviour on all inputs that happen to be syntactically valid at the file level
15:07:45 drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
15:08:02 <merijn> tbh, I'd mostly recommend only using it for evaluating expressions, not really anything resembling "interactive programming" like some people do in python's repl/notebooks
15:08:38 slowButPresent joins (~slowButPr@user/slowbutpresent)
15:09:09 <Guest1981> Is this behavior documented anywhere?
15:09:16 <geekosaur> doubt it
15:10:49 <merijn> I still consider the change to ghci to make it behave more like a top level file a mistake >.>
15:11:07 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
15:11:14 spruit11_ joins (~quassel@2a02:a467:ccd6:1:c892:977a:b4bf:318c)
15:11:52 × spruit11_ quits (~quassel@2a02:a467:ccd6:1:c892:977a:b4bf:318c) (Client Quit)
15:12:10 spruit11_ joins (~quassel@2a02:a467:ccd6:1:c892:977a:b4bf:318c)
15:12:21 × mastarija quits (~mastarija@31.217.8.174) (Ping timeout: 265 seconds)
15:12:50 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 265 seconds)
15:13:01 <Guest1981> Thanks. I'll file a bug.
15:13:09 × enoq quits (~enoq@194-208-179-35.lampert.tv) (Quit: enoq)
15:14:40 × spruit11 quits (~quassel@2a02:a467:ccd6:1:3536:e6ac:e02d:6c68) (Ping timeout: 272 seconds)
15:15:22 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds)
15:15:30 Null_A joins (~null_a@2601:645:8700:2290:74e6:d8ab:910e:9608)
15:17:02 × pe200012_ quits (~pe200012@113.105.10.33) (Ping timeout: 250 seconds)
15:17:40 × azeem quits (~azeem@62.18.161.85) (Ping timeout: 265 seconds)
15:18:14 azeem joins (~azeem@5.168.230.43)
15:18:29 <dexterfoo> is there a list of all of the Haskell operators, so that I can choose one that isn't in use yet?
15:19:45 <Hecate> dexterfoo: hoogle
15:20:11 <geekosaur> I suspect that'd get you an argument. like, some people would count lens operators
15:20:17 <Hecate> dexterfoo: just realise that operators are just functions, they're usually overloadable
15:20:22 <[exa]> dexterfoo: good luck, really. :D
15:22:23 <dexterfoo> According to Hoogle (>>>>) is not used, so I will take it
15:23:17 × argento quits (~argent0@168-227-96-51.ptr.westnet.com.ar) (Ping timeout: 255 seconds)
15:26:10 <dsal> It only has to not be taken in your project.
15:27:11 geekosaur used >.> — feel free
15:31:15 × jumper149 quits (~jumper149@80.240.31.34) (Quit: WeeChat 3.2)
15:31:28 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
15:33:21 <merijn> Asking for "what operators aren't used yet" is like asking for "a number nobody has thought of yet" :p
15:35:21 dunkeln joins (~dunkeln@94.129.69.87)
15:35:32 × chele quits (~chele@user/chele) (Remote host closed the connection)
15:36:12 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds)
15:36:31 <davean> merijn: no one has thought of most numbers yet
15:36:51 <DigitalKiwi> ur moms
15:38:22 arjun joins (~Srain@user/arjun)
15:38:29 argento joins (~argent0@168-227-96-51.ptr.westnet.com.ar)
15:38:48 <Taneb> davean: and most possible operators are still available for use
15:41:39 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
15:43:59 × truckasaurus quits (sid457088@2001:67c:2f08:5::6:f980) (Ping timeout: 255 seconds)
15:44:16 <zzz> is something like `(take n &&& drop n) ls` optimized to avoid 2n operations?
15:44:57 <xerox> :t splitAt
15:44:58 <lambdabot> Int -> [a] -> ([a], [a])
15:45:08 <glguy> zzz: I would expect not
15:45:39 × dajoer quits (~david@user/gvx) (Quit: leaving)
15:45:49 <zzz> ok thanks
15:46:41 truckasaurus joins (sid457088@id-457088.brockwell.irccloud.com)
15:47:52 zmt01 joins (~zmt00@user/zmt00)
15:48:04 jumper149 joins (~jumper149@80.240.31.34)
15:48:14 × mcfilib quits (sid302703@user/mcfilib) (Ping timeout: 250 seconds)
15:48:52 <merijn> davean: Sure
15:49:09 <merijn> davean: But the second you think of one, nothing stops anyone else :p
15:49:09 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
15:49:30 mcfilib joins (sid302703@user/mcfilib)
15:49:57 <monochrom> "what functions names aren't used yet" is the perfect equivalent.
15:53:14 × peterhil quits (~peterhil@mobile-access-b04815-181.dhcp.inet.fi) (Ping timeout: 252 seconds)
15:53:36 Guest966 joins (~Guest9@43.242.116.41)
15:53:50 Morrow joins (~Morrow@37.142.145.18)
15:54:29 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
15:54:52 lbseale joins (~lbseale@user/ep1ctetus)
15:55:03 × Null_A quits (~null_a@2601:645:8700:2290:74e6:d8ab:910e:9608) (Remote host closed the connection)
15:55:38 Null_A joins (~null_a@2601:645:8700:2290:74e6:d8ab:910e:9608)
15:57:51 comerijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
15:58:42 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
15:59:00 × Morrow quits (~Morrow@37.142.145.18) (Ping timeout: 272 seconds)
15:59:22 chris_ joins (~chris@81.96.113.213)
15:59:46 × Null_A quits (~null_a@2601:645:8700:2290:74e6:d8ab:910e:9608) (Ping timeout: 240 seconds)
15:59:56 Morrow joins (~Morrow@31.154.96.164)
16:00:12 × haskl quits (~haskl@98.37.78.63) (Ping timeout: 265 seconds)
16:02:11 chris__ joins (~chris@81.96.113.213)
16:02:34 × chris_ quits (~chris@81.96.113.213) (Read error: Connection reset by peer)
16:04:12 haskl joins (~haskl@98.37.78.63)
16:07:53 Atum_ joins (~IRC@user/atum/x-2392232)
16:08:15 × lbseale quits (~lbseale@user/ep1ctetus) (Quit: Leaving)
16:09:38 × chris__ quits (~chris@81.96.113.213) (Remote host closed the connection)
16:10:04 lbseale joins (~lbseale@user/ep1ctetus)
16:13:08 chris_ joins (~chris@81.96.113.213)
16:13:13 × arjun quits (~Srain@user/arjun) (Remote host closed the connection)
16:13:37 gehmehgeh_ joins (~user@user/gehmehgeh)
16:15:26 × gehmehgeh quits (~user@user/gehmehgeh) (Ping timeout: 244 seconds)
16:15:59 × Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer)
16:18:12 × spruit11_ quits (~quassel@2a02:a467:ccd6:1:c892:977a:b4bf:318c) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:18:28 spruit11 joins (~quassel@2a02:a467:ccd6:1:c892:977a:b4bf:318c)
16:19:53 Null_A joins (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c)
16:24:20 × comerijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds)
16:24:56 × azeem quits (~azeem@5.168.230.43) (Ping timeout: 255 seconds)
16:28:32 Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi)
16:28:46 × soft-warm quits (~soft-warm@2600:8801:db01:8f0:4884:3488:98a1:1fd9) (Ping timeout: 246 seconds)
16:29:46 × Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer)
16:32:02 × LukeHoersten quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:32:28 × gehmehgeh_ quits (~user@user/gehmehgeh) (Quit: Leaving)
16:35:40 azeem joins (~azeem@5.168.230.43)
16:36:46 pavonia joins (~user@user/siracusa)
16:36:59 × Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 258 seconds)
16:37:54 × Morrow quits (~Morrow@31.154.96.164) (Ping timeout: 276 seconds)
16:42:10 × meinside_ quits (uid24933@id-24933.brockwell.irccloud.com) (Quit: Connection closed for inactivity)
16:43:38 gehmehgeh joins (~user@user/gehmehgeh)
16:43:41 econo joins (uid147250@user/econo)
16:44:39 peterhil joins (~peterhil@mobile-access-b04815-181.dhcp.inet.fi)
16:45:10 × deejaytee quits (~deejaytee@193.46-255-62.static.virginmediabusiness.co.uk) (Killed (zirconium.libera.chat (Nickname regained by services)))
16:45:14 deejaytee joins (~deejaytee@cpc91196-cmbg18-2-0-cust215.5-4.cable.virginm.net)
16:46:05 × azeem quits (~azeem@5.168.230.43) (Ping timeout: 255 seconds)
16:46:06 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
16:46:06 allbery_b joins (~geekosaur@xmonad/geekosaur)
16:46:09 allbery_b is now known as geekosaur
16:47:46 azeem joins (~azeem@176.200.192.84)
16:50:32 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
16:51:26 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 265 seconds)
16:52:01 fossdd joins (~fossdd@sourcehut/user/fossdd)
16:52:05 × azeem quits (~azeem@176.200.192.84) (Ping timeout: 252 seconds)
16:52:33 doyougnu joins (~user@c-73-25-202-122.hsd1.or.comcast.net)
16:52:40 azeem joins (~azeem@176.200.192.84)
16:54:03 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
16:54:40 aerona joins (~aerona@2600:6c54:4600:f300:85b8:3678:dd3f:eeda)
16:54:42 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 268 seconds)
16:55:56 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 252 seconds)
16:55:59 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
16:57:19 zebrag joins (~chris@user/zebrag)
16:59:04 Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi)
16:59:06 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
16:59:15 × pottsy quits (~pottsy@2400:4050:b560:3700:3495:fb9e:8fab:95bf) (Ping timeout: 245 seconds)
16:59:25 gehmehgeh joins (~user@user/gehmehgeh)
17:01:50 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 255 seconds)
17:02:52 Hanicef joins (~gustaf@81-229-9-108-no92.tbcn.telia.com)
17:04:16 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
17:08:59 LukeHoersten joins (~LukeHoers@user/lukehoersten)
17:12:15 anandprabhu joins (~anandprab@94.202.243.198)
17:12:59 × azeem quits (~azeem@176.200.192.84) (Ping timeout: 252 seconds)
17:13:27 × anandprabhu quits (~anandprab@94.202.243.198) (Client Quit)
17:13:44 azeem joins (~azeem@176.200.252.165)
17:15:33 lavaman joins (~lavaman@98.38.249.169)
17:16:17 × peterhil quits (~peterhil@mobile-access-b04815-181.dhcp.inet.fi) (Ping timeout: 252 seconds)
17:18:59 peterhil joins (~peterhil@mobile-access-b04815-181.dhcp.inet.fi)
17:21:16 rmoe joins (~rmoe@c-71-236-207-44.hsd1.wa.comcast.net)
17:22:24 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
17:24:31 × argento quits (~argent0@168-227-96-51.ptr.westnet.com.ar) (Ping timeout: 258 seconds)
17:26:11 × michalz quits (~michalz@185.246.204.58) (Remote host closed the connection)
17:26:36 × jiribenes quits (~jiribenes@rosa.jiribenes.com) (Ping timeout: 250 seconds)
17:27:03 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
17:28:09 <lechner> Hi, is there an elegant way to deal with several Maybe values in a row without increasing the indentation in the source code but while reporting errors properly (i.e no fromJust)? Thanks!
17:28:47 <geekosaur> use the Monad instance?
17:28:55 <monochrom> >>=
17:29:21 <lechner> i am so new. is there an example on the web?
17:31:25 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Ping timeout: 258 seconds)
17:32:45 agua joins (~agua@2804:14c:8793:8e2f:39e9:c5a8:c532:7498)
17:34:25 dunkeln_ joins (~dunkeln@94.129.69.87)
17:35:55 Core8816 joins (~agua@2804:18:4a:f76c:1:0:5e60:e39)
17:36:12 × azeem quits (~azeem@176.200.252.165) (Ping timeout: 256 seconds)
17:36:12 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds)
17:36:22 × pesada quits (~agua@177.79.68.96) (Ping timeout: 245 seconds)
17:36:28 azeem joins (~azeem@176.201.0.90)
17:36:56 Gurkenglas joins (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de)
17:39:02 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
17:39:20 <sm> lechner: write a do block, where each line extracts the next Just value with <-. If any of those fail, the whole block evaluates to Nothing
17:39:22 × agua quits (~agua@2804:14c:8793:8e2f:39e9:c5a8:c532:7498) (Ping timeout: 240 seconds)
17:39:44 × LukeHoersten quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:39:57 × dunkeln_ quits (~dunkeln@94.129.69.87) (Quit: leaving)
17:40:17 <lechner> That's longhand for this, right? "By definition, when the first argument to >>= is Nothing, it just returns Nothing while ignoring whatever function it is given." https://en.m.wikibooks.org/wiki/Haskell/Understanding_monads/Maybe
17:42:59 <Cale> do-notation is a shorthand syntax for a chain of uses of (>>=)
17:43:21 <Cale> @undo do { u <- x; v <- y; return (f u v) }
17:43:22 <lambdabot> x >>= \ u -> y >>= \ v -> return (f u v)
17:43:29 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
17:43:32 argento joins (~argent0@168-227-96-51.ptr.westnet.com.ar)
17:43:56 <lechner> thanks! i am making baby steps
17:44:02 <Cale> and so in the case of Maybe, you're allowed to have x and y be Maybe values there
17:44:16 <Cale> and then u and v will be the contents of the Just constructor in the case that they're both Just
17:44:51 <Cale> So it's a good way to unpack a bunch of Maybes and produce Nothing if any of them happens to be Nothing
17:45:46 <Cale> (the do-block as a whole will be a Maybe value in the case that x and y are)
17:46:48 chris_ joins (~chris@81.96.113.213)
17:47:14 <Cale> There are also a bunch of functions which work with any instance of Monad, that specialise to possibly-useful functions on Maybe
17:47:17 <Cale> :t sequence
17:47:18 <lambdabot> (Traversable t, Monad m) => t (m a) -> m (t a)
17:47:36 <Cale> (That one is even more general now...)
17:47:51 <Cale> Well, if you just think of it as (Monad m) => [m a] -> m [a]
17:47:55 <Cale> for Maybe, that becomes
17:48:01 <Cale> [Maybe a] -> Maybe [a]
17:48:20 <lechner> thanks! my code is slowly gaining style. haskell is amazing. i already found several potential bugs in my Perl code, which i am translating
17:48:40 × peterhil quits (~peterhil@mobile-access-b04815-181.dhcp.inet.fi) (Ping timeout: 256 seconds)
17:48:46 <Cale> i.e. take a list of Maybe things, and see if they're all Just, if so, then you get Just of a list of the contents, if any was Nothing, you get Nothing
17:49:05 <DigitalKiwi> monochrom: https://twitter.com/krisajenkins/status/1420022268177027090?s=20
17:50:02 <lechner> Cale: thanks!
17:51:36 × Hanicef quits (~gustaf@81-229-9-108-no92.tbcn.telia.com) (Quit: leaving)
17:51:59 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
17:52:45 <Cale> DigitalKiwi: I don't know how deterministic twitter's "More Tweets" section is, so https://twitter.com/d6/status/1419885183793344512 was pretty funny
17:52:53 DigitalKiwi takes them to clout court
17:54:40 × azeem quits (~azeem@176.201.0.90) (Read error: Connection reset by peer)
17:54:47 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 252 seconds)
17:55:21 hnOsmium0001 joins (uid453710@id-453710.stonehaven.irccloud.com)
17:55:40 fossdd joins (~fossdd@sourcehut/user/fossdd)
17:55:42 <DigitalKiwi> Cale: i follow d6 and this is the first time i've seen it lol
17:56:42 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
17:56:48 mr-red joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
17:57:11 azeem joins (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it)
17:57:21 <lechner> Hi, how can a function that returns a "Maybe (IO ()) perform an IO task, please?
17:57:32 LukeHoersten joins (~LukeHoers@user/lukehoersten)
17:57:42 jiribenes joins (~jiribenes@rosa.jiribenes.com)
17:57:54 <Cale> So, it might give you an action you could run to perform some IO, and it might not
17:58:30 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 276 seconds)
17:58:32 <Cale> The most straightforward thing you should understand first is just to pattern match on it with case
17:58:48 <Cale> case theMaybeIO of
17:58:55 <Cale> Nothing -> ... do something else ...
17:59:05 <Cale> Just x -> x
17:59:22 <Cale> If you want to do nothing in the Nothing case, then you could write return ()
17:59:33 <kmein> :t maybe (return ()) id
17:59:34 <lambdabot> Monad m => Maybe (m ()) -> m ()
17:59:35 <Cale> (which is an action that does nothing)
17:59:44 <kmein> (for a one-liner)
17:59:53 sedeki joins (~textual@user/sedeki)
18:00:49 <Cale> Yeah, or in fact, that sequence function I mentioned earlier would also work because Maybe is Traversable
18:00:59 <lechner> that's exactly what i tried to avoid with the Maybe monad. i kind of came from there: https://dpaste.org/SL7E
18:01:01 <Cale> sequence :: Maybe (IO a) -> IO (Maybe a)
18:01:22 × dunkeln quits (~dunkeln@94.129.69.87) (Ping timeout: 240 seconds)
18:01:34 <Cale> There's also a version called sequence_ which drops the result
18:01:36 <Cale> :t sequence_
18:01:37 <lambdabot> (Foldable t, Monad m) => t (m a) -> m ()
18:02:06 <lechner> it's probably hard to see in the diff, but i replaced the "case of"s with <-
18:02:14 <Cale> So, t = Maybe and m = IO will get you a thing that does nothing if the Maybe is Nothing, and executes the action if it's Just of some action
18:02:40 <lechner> that's what i need
18:03:56 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Ping timeout: 265 seconds)
18:04:17 <Cale> I honestly don't mind your original case expressions though (but I would usually avoid defining the scrutinee with let immediately prior)
18:04:34 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
18:04:43 <Cale> However, it depends on how we expect the program to change over time
18:05:14 <lechner> it will change because i am learning
18:05:18 <Cale> If you end up wanting to handle the failure cases more nicely, you'll probably end up replacing the return () in the failure case with something else, and then there won't necessarily be a shorthand.
18:05:41 <Cale> (at least, not one which is more readable than a case expression would be)
18:06:19 <lechner> i don't actually need to handle them, I don't think, but I will hold onto the case expressions for now
18:06:32 mastarija joins (~mastarija@31.217.8.174)
18:06:39 <lechner> what did you mean with scrutinee plesae?
18:06:49 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
18:07:09 <lechner> the "let"s that is
18:07:18 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
18:07:28 <monochrom> In "case foo x of ...", the scrutinee is "foo x".
18:07:54 <monochrom> The victim of pattern matching.
18:08:46 <monochrom> DigitalKiwi: Haha congrats
18:08:50 <lechner> yes, that was kind of pointless. i see it now
18:10:13 <lechner> monochrom Cale: so elegant. thank you!
18:10:21 <DigitalKiwi> <butterfly meme> is this a thunk?
18:10:37 dunkeln joins (~dunkeln@94.129.69.87)
18:10:53 × dunkeln quits (~dunkeln@94.129.69.87) (Client Quit)
18:11:00 <DigitalKiwi> the previously unevalutaed lazy joke has been evaluated
18:11:29 <monochrom> :)
18:11:48 <DigitalKiwi> https://ircbrowse.tomsmeding.com/day/lchaskell/2021/07/26?id=112114#trid112114 for anyone lost about wtf we're talking about lol
18:12:11 chris_ joins (~chris@81.96.113.213)
18:16:26 × chris_ quits (~chris@81.96.113.213) (Ping timeout: 250 seconds)
18:17:12 × zmt01 quits (~zmt00@user/zmt00) (Quit: Gone.)
18:18:52 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
18:20:17 zmt00 joins (~zmt00@user/zmt00)
18:22:10 × stefan-_ quits (~cri@42dots.de) (Ping timeout: 240 seconds)
18:23:30 × xff0x quits (~xff0x@2001:1a81:527c:b500:a365:4553:d50c:f6f5) (Ping timeout: 268 seconds)
18:23:47 xff0x joins (~xff0x@2001:1a81:527c:b500:2b8c:4e21:9ff9:e65e)
18:24:46 × jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection)
18:25:42 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
18:26:10 stefan-_ joins (~cri@42dots.de)
18:26:52 × sedeki quits (~textual@user/sedeki) (Quit: Textual IRC Client: www.textualapp.com)
18:27:03 jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net)
18:27:47 × mr-red quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Quit: ZNC 1.8.2 - https://znc.in)
18:28:16 Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es)
18:29:48 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
18:29:55 drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
18:31:50 × mastarija quits (~mastarija@31.217.8.174) (Quit: Leaving)
18:33:37 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
18:36:55 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
18:39:27 <lechner> Hi, what's is the z0 in my function's "ZMQ z0 ()" return type, please? This is inside the ZMQ monad. https://hackage.haskell.org/package/zeromq4-haskell
18:40:30 <Rembane> lechner: Probably the rest of the monad transformer stack.
18:40:38 <Rembane> lechner: Do you have some example code?
18:41:07 <geekosaur> that said, when ghc appends a number to a type it usually means you forgot to connect something up, so it's inventing a new type
18:41:23 <Rembane> Yes, and also typed holes are great.
18:41:32 <Cale> The maintainer should really build and upload the documentation for that package separately
18:41:52 <lechner> why did it FTB?
18:42:07 <Cale> Probably the external library dependencies
18:42:28 <lechner> Rembane: https://dpaste.org/STjO#L87
18:42:46 <lechner> geekosaur: I think i invented it!
18:42:51 <Cale> Apparently, ZMQ is like ST, and so the "z" parameter is actually meaningless, it's just there to prevent you from using ZMQ sockets created by one session with another.
18:43:17 <lechner> is see
18:43:24 <Cale> runZMQ :: MonadIO m => (forall z. ZMQ z a) -> m a -- in order to use this, any occurrence of the "z" parameter can't occur in "a"
18:44:30 <Cale> And so data structures which have a "z" in them can't be smuggled out in the result, (and even if you did somehow, e.g. by using an existential type, you still couldn't use them with another runZMQ, since there's effectively a new "z" each time.
18:46:53 <lechner> i tried _ instead of z0 but GHC did not like it, and referred me to PartialTypeSignatures which i did not adopt
18:47:17 <Cale> Yeah, if you want to use _'s in types, you have to turn on PartialTypeSignatures
18:47:22 <DigitalKiwi> lechner is ghc
18:47:46 <Cale> Any variable letter will do there, but I'd stick with the z that the library uses.
18:47:57 <DigitalKiwi> that's why ghc is so slow sometimes; it has to ask lechner to type infer!
18:48:04 <lechner> in the well-defined world of Haskell, how can i legally refer to a z0 that was never defined?
18:48:13 <Cale> Well, what are you trying to do?
18:48:37 <lechner> Just compile (TM)
18:48:54 <Cale> Usually you will want to leave the z polymorphic, so writing just z there will do
18:49:20 <lechner> okay
18:49:29 <Cale> (in fact, if it became not-polymorphic, that would mean that you could never use the action)
18:50:24 <lechner> i don't know what that means, but it sounds like something that could make me sleep poorly
18:50:34 <Cale> When you have a ZMQ action which returns something like a socket, you'll have to ensure the z's match, like ZMQ z (Socket z)
18:51:00 <lechner> i see
18:51:23 <Cale> It's as though each time you use runZMQ, it gets to invent its own z type
18:51:26 <lechner> what does the zero do then, please?
18:51:44 <lechner> it means nothing?
18:51:46 <Cale> and that prevents sockets and such from being created in one runZMQ and being used in another
18:51:52 <lechner> yeah
18:51:54 <c_wraith> z0 is just a name
18:51:58 <lechner> that makes sense
18:52:02 <c_wraith> It has no inherent meaning
18:52:13 <monochrom> Every name has no meaning, actually.
18:52:24 <Cale> Yeah, it's just an arbitrary variable, it doesn't really mean anything, but you can think of it as referring to the runZMQ session.
18:53:18 <Cale> There's some context that runZMQ sets up, and we don't want sockets and such that are created with one context being used by another
18:53:35 <Cale> and we're using a type system trick to prevent this
18:54:04 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
18:54:10 <lechner> does haskell know any other
18:54:55 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
18:54:59 × falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 258 seconds)
18:55:11 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
18:56:24 × LukeHoersten quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:58:11 × fef quits (~thedawn@user/thedawn) (Ping timeout: 244 seconds)
18:59:47 potato_dev joins (~potato_to@elara.whatbox.ca)
19:00:22 <monochrom> Haskell doesn't want to be anthropomophized.
19:01:06 <lechner> you are right; it is our trick
19:02:56 <c_wraith> I don't think the joke works quite right with that wording.
19:04:22 <lechner> sorry, bad joke. trying to cope with a learning curve
19:04:22 <c_wraith> I meant monochrom's joke
19:04:48 burnsidesLlama joins (~burnsides@dhcp168-022.wadham.ox.ac.uk)
19:05:01 <c_wraith> It can be vacuously true, as opposed to wording like "Haskell hates being anthropomorphized"
19:05:44 <monochrom> Oh, that.
19:06:26 <c_wraith> English and logic have a very weird intersection :)
19:06:46 <lechner> they have one?
19:07:38 × jolly quits (~jolly@208.180.97.158) (Ping timeout: 258 seconds)
19:07:57 <monochrom> That would be a Church vs Curry thing. "X doesn't want Y" can be "type error, not even wrong".
19:08:34 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 256 seconds)
19:08:48 <c_wraith> that is an option too.
19:09:46 <DigitalKiwi> I heard that parallel lines actually do meet, but they are very discrete.
19:10:00 <monochrom> :)
19:10:30 Erutuon joins (~Erutuon@user/erutuon)
19:20:59 pgib joins (~textual@173.38.117.81)
19:22:06 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
19:22:27 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2)
19:27:07 <lechner> Hi, a question about $ vs () please. Why does this work liftIO $ putStrLn $ "Response from collector: " <> Lazy.unpack (Lazy.fromStrict acknowledgement) but this doesn't liftIO $ putStrLn $ "Response from collector: " <> Lazy.unpack $ Lazy.fromStrict acknowledgement
19:27:58 <monochrom> Do you know the precedence level and associativity of $ ? Can you compare that with the precendence level of <> ?
19:28:10 <monochrom> I think it's high time you find out.
19:29:00 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
19:29:13 <monochrom> It doesn't scale if every time you have $ and the nth operator you cannot be independent for the nth time.
19:29:49 jolly joins (~jolly@208.180.97.158)
19:29:56 <Cale> lechner: $ is just a function defined as f $ x = f x, but it's defined to bind as weakly as possible to its arguments, while normal function application binds more tightly than any infix operator could
19:30:33 <Cale> (and also, it's specified to be right-associating, which I think is kind of a mistake, but it allows for that particular style of chaining)
19:30:44 <lechner> okay i thought about it the wrong way. it seemed like "the buck stops here from the right"
19:31:29 <lechner> actually, maybe that is still true
19:31:52 <lechner> it's really right vs left like monochrom said
19:31:53 <Cale> So, your second expression brackets like liftIO $ (putStrLn $ (("Response from collector: " <> Lazy.unpack) $ Lazy.fromStrict acknowledgement))
19:32:05 <Cale> and you can see the problem there with the Lazy.unpack not getting an argument
19:32:57 mr-red joins (~drd@93-39-151-19.ip76.fastwebnet.it)
19:33:27 <Cale> Plain function application (whitespace) binds more tightly to its arguments than any infix operator possibly can. If you remember nothing else about how infix operators get parsed, that's probably the most important thing.
19:34:19 <lechner> that's the exact opposite of $ then
19:34:24 <Cale> right
19:34:35 <lechner> no pun intended
19:34:39 <Cale> Also, it's left-associating, so f x y z means ((f x) y) z
19:34:57 <lechner> yeah i get that. wow. TIL thanks!
19:35:07 <Cale> I do kind of wish that ($) associated to the left as well, since whenever you have f $ g $ h $ x you could always rewrite that as f . g . h $ x
19:35:17 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 255 seconds)
19:35:35 <lechner> i wondered about that
19:36:02 <lechner> i think i use too too mank $$'s and not enough point free
19:36:06 <Cale> But if it associated to the left instead, we could remove some more parens sometimes
19:36:16 <monochrom> I wouldn't say whitespace. map(+)[ 1 , 2 , 3 ] these whitespaces and these function applications are mutually exclusive.
19:36:35 <Cale> Yeah, that's fair, it doesn't have to be whitespace proper :)
19:36:41 <Cale> juxtaposition :)
19:36:44 <lechner> i got the point though
19:36:45 <monochrom> The correct model is juxtaposition of two expressions.
19:36:54 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
19:37:10 <lechner> that's where logic and plain english drift apart
19:37:31 <lechner> why juxtaposition?
19:37:45 <monochrom> Because it is juxtaposition?
19:37:46 <Cale> If you start out by replacing all but the last $ with . where you can, it's a good syntactic trick for starting to think about composing functions instead
19:38:05 × berberman quits (~berberman@user/berberman) (Ping timeout: 252 seconds)
19:38:15 Guest4 joins (~Guest4@210.18.130.156)
19:38:34 <lechner> for some reason that never works, at least not with lazy and strict ByteStrings
19:38:42 <Cale> hmm
19:38:49 <lechner> maybe with lazy alone
19:38:56 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
19:39:01 <Cale> The types shouldn't affect anything
19:39:06 × Guest4 quits (~Guest4@210.18.130.156) (Client Quit)
19:39:24 <Cale> You do need to leave spaces around the composition dots though, and not put spaces around the ones which are module qualifiers
19:39:46 <Cale> I'm still a little bit salty that we went with "." for module qualification, given how important composition is.
19:40:05 <Cale> I get that it matches all the other languages in the world but still :)
19:40:08 <lechner> you would have preferred?
19:40:30 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 250 seconds)
19:40:35 <Cale> I'm not sure, maybe | would have worked out.
19:40:41 × alx741 quits (~alx741@186.178.108.3) (Ping timeout: 255 seconds)
19:40:44 <lechner> isn't the dot usally for records, like in PureScript?
19:40:55 <Cale> Well, that too
19:41:06 <geekosaur> ' might have worked if not for the stuff that took it later
19:41:13 <Cale> Yeah
19:41:15 <lechner> i would have liked | it's like a pipe
19:41:17 <monochrom> Would you prefer Control∘Monad∘State haha
19:41:17 fossdd joins (~fossdd@sourcehut/user/fossdd)
19:41:32 <Cale> I prefer things that I can easily type, to be sure
19:41:49 <yushyin> Control-Monad-State
19:41:57 <Cale> Otherwise, I probably would prefer using ∘ for composition
19:43:07 <lechner> Can I do anything about the $'s here? send catcher [] $ Lazy.toStrict $ Lzma.compress $ JSON.encode task
19:43:27 × epolanski quits (uid312403@id-312403.brockwell.irccloud.com) (Quit: Connection closed for inactivity)
19:43:27 <lechner> does that operator have a name?
19:43:27 <Cale> You could rewrite that as send catcher [] . Lazy.toStrict . Lzma.compress $ JSON.encode task
19:43:42 <Cale> Which one?
19:43:46 <lechner> $
19:44:16 <Cale> I think most people just say "dollar sign", but you could say "function application"
19:44:20 <monochrom> You know what, in Chinese, or at least Chinese writings in the early 20th century, we write Western people names by: (after transliterating to Chinese characters of similar sounds) FirstName·LastName
19:44:41 <monochrom> Perhaps that would also be the perfect scheme for hierarchical module names.
19:45:11 <Clint> transliterating them to hanzi?
19:45:18 <monochrom> Yes.
19:45:24 Clint nods.
19:45:45 <Cale> FirstName・LastName
19:45:53 <lechner> doesn't the last name come first?
19:46:05 <monochrom> No.
19:46:23 <Cale> I guess that's why the dot
19:46:42 <lechner> sorry, i got confused with my chinese name. yours is for transliteration
19:46:46 <Cale> Well, apart from the fact that it would be awkward to figure out where one name ends and the other begins
19:47:09 <lechner> it does not matter
19:47:24 <lechner> for one person
19:48:44 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 250 seconds)
19:48:51 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
19:48:53 <lechner> is using too many $ must be a beginner's mistake
19:49:14 fossdd joins (~fossdd@sourcehut/user/fossdd)
19:49:44 × Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 252 seconds)
19:50:01 <geekosaur> it's often recommended not to use $ at all until you get used to haskell
19:50:42 <lechner> too many brackets. i wear glasses
19:51:55 <lechner> but i am not using a single . ! i was so excited about them. also, the pure parts of my programs are tiny. monad in. monad out.
19:52:19 <yushyin> the general opinion here seems to be that $ is overused and that it is better to use parentheses more often
19:52:52 <Cale> I dunno, there are places where you definitely want to use $ -- particularly if the argument is long enough that it's annoying to find the matching closing parens
19:52:53 <monochrom> The correct way to get rid of parenthesis is to defeat the point of Fortran and go back to 3-address instructions: let tmp1 = f x; tmp2 = g tmp1; tmp3 = h tmp2 in k tmp3
19:53:24 <Cale> But I'll tend not to chain $'s myself, unless I'm trying to blend in with an existing code style
19:53:40 <Cale> I'll always use composition and then a single $ when I use it
19:53:57 <monochrom> and roll back 60 years of progress in languages and compilers.
19:54:28 <Cale> monochrom: Or RPN
19:54:44 alx741 joins (~alx741@181.196.69.4)
19:54:53 <DigitalKiwi> don't be silly everyone knows there's no $ in haskell! /s
19:55:07 <Cale> I wish I hadn't lost all my silly dc snippets
19:55:37 <Cale> I remember at one point working out how to do maps and folds over the stack in dc :)
19:55:44 <yushyin> pure $ whatever comes next -- is a common pattern for me
19:56:12 <Cale> I also never use pure unless it's important that my definition is Applicative polymorphic
19:56:29 <lechner> i actually understood that
19:56:32 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 250 seconds)
19:56:35 <lechner> vs return
19:56:39 <monochrom> Backus and Knuth worked so hard to find algorithms that can parse (a+b)*c+d so that if you see that formula in math books you can just copy that and it's valid code. Now entitled millenials trash that and want to go back to 3-address instructions.
19:56:43 <geekosaur> showing your age :þ
19:56:43 <Cale> When I see "pure" in code, I take it as a sign that Applicative is being used in some nontrivial way, and if it's not, I'm mildly annoyed :)
19:57:15 fossdd joins (~fossdd@sourcehut/user/fossdd)
19:58:05 <geekosaur> bet you hate "monad of no return"
19:58:25 <Cale> I'm less concerned about that
19:58:33 <lechner> others have told me prefer "pure"
19:58:38 <lechner> to
19:59:00 <Cale> I *would* be opposed to return :: Applicative f => a -> f a though
20:00:01 <Cale> It just helps make typechecking in your head that much easier to have that little cue
20:00:16 <monochrom> I use pure when the context uses liftA2 or >>= etc so they are on the same page.
20:00:23 <Cale> Yeah, that's fair
20:00:36 <Cale> I might use pure in cases where I'm also using (<*>) immediately adjacent to it
20:00:36 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
20:00:53 <Rembane> I always use pure, I blame Purescript.
20:01:17 <Cale> Like, maybe I know the thing is a monad, but I'm still using Applicative syntax to combine a bunch of stuff, in that case, pure seems okay.
20:01:18 <DigitalKiwi> Cale: lol so that tweet you sent earlier from d6 (who i follow on twitter) finally showed up in my feed...only after someone else had quoted tweeted it and d6 retweeted *that*...
20:01:25 <Cale> hah
20:01:28 <geekosaur> quite a few people say "just use pure" these days
20:01:45 <yushyin> i roll a dice before every use. even is pure, odd is return
20:01:46 <Cale> geekosaur: I'm aware, but I think it does lose something
20:01:55 LukeHoersten joins (~LukeHoers@user/lukehoersten)
20:02:02 pschorf joins (~user@208.127.190.222)
20:02:28 <Cale> Also, I'm of the mindset that "return" is also a pretty good name for what it is most of the time
20:02:30 <maerwald> I use `pure`
20:02:38 Deide joins (~Deide@217.155.19.23)
20:02:38 × Deide quits (~Deide@217.155.19.23) (Changing host)
20:02:38 Deide joins (~Deide@user/deide)
20:02:50 × mr-red quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 258 seconds)
20:02:58 <Cale> i.e. it makes an action which does nothing except to return the given value as its result
20:03:01 <monochrom> I prefer "impurify" >:)
20:03:14 <Cale> haha
20:04:08 <monochrom> class Monad m => Animate m where anthropomorphize :: a -> m a
20:04:21 <Cale> Of course, people who just came from imperative programming sometimes find "return" a bit jarring, because it doesn't have the control effects that they're used to.
20:05:07 × juhp quits (~juhp@128.106.188.220) (Ping timeout: 245 seconds)
20:05:26 Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es)
20:05:28 <Cale> Imagine being used to having all your stuff implicitly wrapped in callCC
20:06:49 juhp joins (~juhp@128.106.188.220)
20:06:53 chris_ joins (~chris@81.96.113.213)
20:08:32 <lechner> return actually makes monads less scary. would it be fair to somehow compare monads to imperative function prototypes?
20:09:33 <jiribenes> it makes monads _look_ less scary, but its semantics confuse the heck out of imperative programmers
20:10:18 <monochrom> The difference between "I understand, meaning I feel so good" and "I understand, meaning I write correct code".
20:10:37 <lechner> does it have semantics
20:10:52 <lechner> it does nothing
20:10:57 <monochrom> A little bit of semantics from the monad laws.
20:11:06 <geekosaur> but tey expect semantics
20:11:13 <monochrom> Beyond that, it's up to actual instances.
20:11:20 gehmehgeh joins (~user@user/gehmehgeh)
20:11:37 P1RATEZ joins (piratez@user/p1ratez)
20:12:00 <monochrom> But do look at "return x >>= k = k x". This tells you a lot. For example, this tells you "not an exit".
20:12:34 <jiribenes> ^ this
20:13:04 <monochrom> I know of a monad tutorial (that even makes it to Haskell Weekly News) that gets this wrong.
20:13:18 <monochrom> Subsequently I shamed them in an exam question.
20:13:53 <Cale> haha, nice
20:15:07 <Cale> You also have (x >>= \v -> return v) = x, which is another way to say that return isn't doing a whole lot
20:15:38 <Cale> But yeah, the actual meaning of return (and (>>=)) varies based on which monad we're talking about
20:15:55 lavaman joins (~lavaman@98.38.249.169)
20:16:27 <Cale> So while there's a sort of "imperative-ish" feel to things, sometimes it'll subvert your expectations a bit. Monads can have backtracking, state can flow in the opposite direction from the rest of the computation, etc.
20:17:03 <maerwald> is that a good thing?
20:17:18 <Cale> Can be.
20:17:20 <maerwald> I'd argue it basically makes reasoning harder
20:17:38 <maerwald> about monadic combinators at least
20:17:51 <Cale> It's good because we get to define a bunch of functions generically that'll work in any monad, and then use them in every monad we define.
20:18:00 <maerwald> "work" how?
20:18:11 <maerwald> rather "somehow"
20:18:11 <Cale> and that saves us a bunch of trouble defining e.g. "forM" in every library we write
20:18:23 <maerwald> never understood this argument
20:18:24 <dsal> `return` is a bad name and often makes people think something is happening when something else is happening.
20:18:29 <maerwald> rust is doing fine without this
20:18:44 <dsal> I've had issues reading code that looked pretty weird and used return in a way where I had to make sure the author actually understood what was happening.
20:18:50 <Cale> The reason for the monad abstraction to exist is the same as the reason for any abstraction to exist
20:19:11 <maerwald> that's too vague for me :)
20:19:12 <Cale> We define a lot of things which happen to be monads, it's nice to avoid repeating ourselves when the pattern exists.
20:19:45 <maerwald> I'm just questioning that the whole expressivity monads give is actually a good idea to utilize
20:19:47 chomwitt joins (~chomwitt@athedsl-32041.home.otenet.gr)
20:19:57 <maerwald> at least on a general basis
20:20:10 <maerwald> especially when it breaks your intuition about combinators
20:20:16 × pschorf quits (~user@208.127.190.222) (Remote host closed the connection)
20:20:17 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 255 seconds)
20:20:25 <Cale> Well, combinator libraries in general are a good idea. If your combinator library happens to define a monad, it's nice to recognise that.
20:20:30 <maerwald> that expands more generally to type classes
20:20:45 <monochrom> If you can bring your same argument against rings, fields, monoids, vector spaces, topologies... then perhaps it applies to monads too.
20:20:49 × Guest966 quits (~Guest9@43.242.116.41) (Quit: Connection closed)
20:20:55 <maerwald> you refactor your stuff, luckily it still compiles... but the underlying instance does something entirely different
20:20:59 <maerwald> that's a lens moment
20:21:17 <Cale> Well, that's what the monad laws are for
20:21:24 <monochrom> It is both nice and useful to know that, for example, the binomial theorem works for all commutative rings, even though I will end up just using the real number ring anyway.
20:21:26 <maerwald> oh, it's not a law problem
20:21:29 <Cale> They tell you some refactorings it's okay to make
20:21:35 <maerwald> lenses broke my code in a lawful way
20:21:38 × Null_A quits (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c) (Remote host closed the connection)
20:21:40 × Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Quit: WeeChat 2.8)
20:21:43 <maerwald> that didn't help
20:21:57 <maerwald> typeclasses can do that
20:22:14 <Cale> Well, it is important to know what you're doing, and I think using things which are overpowered relative to your needs is often a bad idea
20:22:46 <dsal> I look at it like applicative functors are a newer thing that monads also are, and since `return = pure` in (hopefully) all the cases, using the less confusing name is better.
20:22:48 <maerwald> they can cloud control flow and make behavior reasoning impossible... now you're just reasoning about abstractions and what you roughly think they do, instead of having the actual control flow in your head... most of the time this may work out
20:22:51 <maerwald> but sometimes not
20:22:58 <Cale> Lens has its places for good use, but I wouldn't recommend using it everywhere all the time.
20:22:59 <dsal> > let f x = do { a <- if odd x then return 3 else return 6; return 4 } in f 1 :: Maybe Int -- because people write code like this and end up confused.
20:23:01 <lambdabot> Just 4
20:23:03 jmtd joins (jon@dow.land)
20:23:11 × robertm quits (robertm@rojoma.com) (Ping timeout: 252 seconds)
20:23:44 × Jon quits (jon@dow.land) (Ping timeout: 272 seconds)
20:23:44 <Cale> dsal: Well, I think that's just getting used to what the monad laws say about return
20:23:50 × mrmonday quits (~robert@what.i.hope.is.not.a.tabernaevagant.es) (Ping timeout: 250 seconds)
20:24:05 jmtd is now known as Jon
20:24:07 <maerwald> generics take this a step further... idk how to understand my own generics code without writing it again from scratch
20:24:12 mrmonday joins (~robert@what.i.hope.is.not.a.tabernaevagant.es)
20:24:29 <dsal> It's generally people who are somewhat new to the language and who have a lot of things to get used to. Telling them `return` does something entirely different than anything they've ever experienced just makes the curve steeper.
20:24:37 <Cale> But also, it makes sense from the perspective that e.g. when you apply f to an odd number, return 3 is going to be the action which does nothing except to return 3
20:24:41 <maerwald> so yeah... haskell has some nice properties wrt "reasoning", but it can break that easily
20:24:49 <Cale> and a is the result of executing that, so a will be 3
20:25:13 <Cale> dsal: It's only confusing if you're used to having all your shit wrapped in callCC implicitly :D
20:25:27 × chomwitt quits (~chomwitt@athedsl-32041.home.otenet.gr) (Remote host closed the connection)
20:25:32 <maerwald> whether you need to keep global variables in your head or odd class instance behavior, does it really matter?
20:25:44 Null_A joins (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c)
20:26:05 × Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Remote host closed the connection)
20:26:13 × ukari quits (~ukari@user/ukari) (Ping timeout: 268 seconds)
20:26:52 <dsal> Sure, but it confuses a lot of folks. `return` in a function doesn't cause the function to return and that surprises people.
20:26:56 <dsal> I can't remember the exact case I saw like this, but I had to confirm that they actually understood that the code would continue processing effects after the `return` because it was weird looking code and it wasn't clear whether they understood it.
20:26:58 <maerwald> we're almost there (talking about effects systems)
20:27:06 <maerwald> (and how they will save us all)
20:27:25 <dsal> It's kind of like using the word "peruse" in English. Its definition includes its antonym so you have to ask what people mean all the time and you might as well avoid using the word altogether so nobody's confused.
20:27:27 <maerwald> but Cale prefers transformers anyway :p
20:27:34 × gehmehgeh quits (~user@user/gehmehgeh) (Ping timeout: 244 seconds)
20:27:48 gehmehgeh joins (~user@user/gehmehgeh)
20:28:09 <Cale> dsal: I totally get that, but people who are trying to read Haskell as though it were e.g. Python, are going to be confused by much more than that anyway, and I think the name "return v" is a fine name for what action it denotes.
20:28:39 <Cale> Once you understand that nothing possibly could have the effect that they expected, then it's not confusing at all that return doesn't have that effect
20:29:13 roboguy_ joins (~roboguy_@2605:a601:ac0e:ae00:bc41:cf44:b56:1727)
20:29:35 <Cale> The reason it's forbidden is that one of the monad laws effectively says you can chop a segment out of any do-block and move it into a new definition without changing the meaning
20:29:56 <Cale> (that's what the associativity law basically means)
20:30:15 <Cale> and so, that includes stuff with returns in it
20:30:20 Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi)
20:30:44 <dsal> The idea of what `return` does is similar to the idea of what `fail` does, though. `fail` gets to return early, so I can just evaluate stuff until I `return` or `fail`.
20:30:44 bwe_ is now known as bwe
20:30:52 × gehmehgeh quits (~user@user/gehmehgeh) (Remote host closed the connection)
20:30:58 <dsal> Anyway, I find it confusing, but don't know why I'd actually *want* to use `return`. It's never made any code clearer for me.
20:31:03 <Cale> It's not though...
20:31:12 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 250 seconds)
20:31:17 <Cale> fail will cause the entire computation to fail, sure.
20:31:29 <Cale> But that's not the same as ending the present definition
20:31:32 gehmehgeh joins (~user@user/gehmehgeh)
20:31:43 <Cale> It extends arbitrarily far beyond that
20:31:48 <dsal> Why not, though? What's the difference between Left and Right here?
20:32:12 <Cale> Like, what you probably expect of your f from before is that 3 gets returned *from f*
20:32:33 <Cale> Not that 3 gets returned from the entire final action of which f 1 was only possibly a small part
20:32:33 × amk quits (~amk@176.61.106.150) (Remote host closed the connection)
20:32:46 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
20:32:46 × LukeHoersten quits (~LukeHoers@user/lukehoersten) (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:32:48 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
20:32:48 allbery_b joins (~geekosaur@xmonad/geekosaur)
20:32:51 allbery_b is now known as geekosaur
20:33:29 <Cale> i.e. you expect something like f x = callCC $ \ret -> if odd x then ret 3 else ret 6; return 4
20:33:45 <dsal> Yeah, I think that's what people often expect.
20:34:00 amk joins (~amk@176.61.106.150)
20:34:04 <Cale> But if return behaved like Left, that's not what would happen
20:34:12 <dsal> Nobody ever expects that with `pure` though.
20:34:25 <Cale> Because if we had something like do f 1; f 2
20:34:38 <Cale> then we might not expect 3 to be returned
20:35:11 <Cale> The monad laws tell us that we're always allowed to inline the definition of f 1
20:35:28 <dsal> Sure, I agree with that model. It's simply the word that's confusing.
20:35:33 <dsal> I don't even have a good mental model for what `return` should mean (other than just aliasing it to `pure` in my head). I have a mechanical rewrite so that I don't think of anything being returned because the concept doesn't make sense.
20:35:52 <lechner> dsal: in the two meanings of "peruse" I see a range of reading activities. it's the logical way to combine them
20:35:54 <Cale> It might be confusing for all of a few minutes until someone tells you what return means
20:36:06 × jushur quits (~human@user/jushur) (Quit: ¯\_(ツ)_/¯)
20:36:27 <Cale> But like, that's also true of the entire rest of the programming language, so I don't see it as a really big deal
20:36:38 <dsal> lechner: peruse means you've seen something, but the original definition implies you studied it very carefully and the other meaning suggests you've only taken a cursory glance.
20:36:44 <Cale> You're going to be introduced to return at some point, and you might've thought it meant something a bit different before then
20:36:48 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
20:36:50 alexfmpe[m] joins (~alexfmpem@2001:470:69fc:105::38ba)
20:36:50 robertm joins (robertm@rojoma.com)
20:37:01 <Cale> But I've never seen anyone get *really* stuck on it
20:37:16 <Cale> once they're aware that "return v" is the no-op action that does nothing except return v
20:37:23 <dsal> Cale: I don't think I fundamentally disagree with you. `return` doesn't confuse me that much, but only because I don't think of it as a word and instead immediately alias it to `pure` and move on.
20:37:33 <dsal> But you suggest that it's important to *use* `return` and that part I don't understand.
20:37:50 ukari joins (~ukari@user/ukari)
20:38:31 <Cale> Well, the part about using return when appropriate is just that its type is a little more specific, and so the distinction of return vs. pure helps us know when we're really making use of a broader abstraction.
20:38:37 <alexfmpe[m]> I could have sworn I had seen an util for folding two lists at once but am unable to find it, anyone know what I'm talking about?
20:38:44 <dsal> But `return v` doesn't `return v` it just places a pure value inside the current Monad. i.e. `return = Just` or `return = Right` or whatever. It's an abstraction of a constructor, not any kind of flow control thing like the verb suggests.
20:38:44 × amk quits (~amk@176.61.106.150) (Ping timeout: 255 seconds)
20:38:57 <lechner> dsal: it's a super old rhetorical device: one morning, one night---a day. it describes the range between the edge cases
20:38:59 <Cale> alexfmpe[m]: hmm... you mean like, folding through their zip?
20:39:12 <Cale> alexfmpe[m]: Or it's supposed to do something different if one of them ends early?
20:39:25 amk joins (~amk@176.61.106.150)
20:39:35 <Cale> dsal: Well, it does
20:39:50 <Cale> In the same way that when we have something like v <- x
20:39:55 <alexfmpe[m]> cale: more of the later, as in the merge step of mergesort
20:39:56 <Cale> The v is the value that x returned
20:40:02 <Cale> So when you write v <- return 3
20:40:05 <Cale> then v is 3
20:40:11 <dsal> :t zipWith bimap
20:40:13 <lambdabot> Bifunctor p => [a -> b] -> [c -> d] -> [p a c -> p b d]
20:40:30 <alexfmpe[m]> dsal: "abstraction of a constructor" isn't at all how I would put it, take ZipList or Cont for instance
20:40:55 <maerwald> dsal: I think `success` and `fail` would be reasonble shortcut names. `return` is more from the ASM days
20:41:18 <Cale> I think of "return v" as meaning "the action which, when executed, produces v as its result"
20:41:37 <dsal> Cale: I think I can at least parse that.
20:41:55 <Cale> So return v is the action which... returns v
20:42:10 <Cale> It doesn't mean "return from the caller immediately with v"
20:42:12 <maerwald> `return` means `return to the address on the top of the stack`
20:42:13 <dsal> I feel like it's a stretch, but I can at least accept it. :)
20:42:23 <maerwald> for anything else, the word doesn't make any sense
20:42:26 × neceve quits (~quassel@2a02:c7f:607e:d600:f762:20dd:304e:4b1f) (Ping timeout: 252 seconds)
20:42:32 <Cale> I think it's *less* of a stretch than the traditional sense of return in programming
20:42:52 <dsal> ...but why do you consider using `pure` for the same thing less desirable?
20:42:52 <alexfmpe[m]> I dunno, every intuition besides `pure` being identity-ish (which exactly what the laws require), seems more of a trap to me
20:43:17 <maerwald> Cale: "returning v" may make sense in rust, where you return ownership
20:43:30 <dsal> alexfmpe[m]: Sure, sure. I don't mind traps as long as I can get back out of them.
20:43:43 <maerwald> but in most languages you don't even have such a concept
20:43:47 <alexfmpe[m]> I meant traps as in actually getting in the way
20:43:48 <maerwald> no one owns anything
20:43:56 <dsal> alexfmpe[m]: Yeah, I get the meaning.
20:44:06 <deejaytee> I tend to use pure instead of return everywhere, since it prevents people unfamiliar with haskell for mistaking it for the return they know
20:44:25 <alexfmpe[m]> I've hated the normal formulation of applicative/monad ever since I saw the monoidal and join/fmap based laws
20:44:39 <dsal> My understanding of haskell is good enough that it's my go-to language for just about everything including just thinking of stuff. But if I ever have a completely intuitive understanding of all of it, I'll have to find something else.
20:44:40 <deejaytee> admittedly a pretty weird use - nobody ever really reads my code anyways
20:44:49 chris_ joins (~chris@81.96.113.213)
20:44:51 <maerwald> deejaytee: I know that feeling
20:44:54 <alexfmpe[m]> it's just...collapsing and mapping
20:45:04 <alexfmpe[m]> trying to treat it as anything else is just going to confuse me
20:46:16 acidjnk_new3 joins (~acidjnk@p200300d0c72b950729faca9193881d78.dip0.t-ipconnect.de)
20:46:45 <Cale> alexfmpe[m]: foldr2 b l r z (x:xs) [] = foldr l z (x:xs); foldr2 b l r z [] (y:ys) = foldr r z (y:ys); foldr2 b l r z (x:xs) (y:ys) = b l r (foldr2 b l r z xs ys)
20:46:48 <Cale> maybe?
20:47:12 <Cale> There's probably something more general still...
20:47:39 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
20:47:48 <Cale> Actually, maybe it's saner to factor out the uses of foldr at the ends
20:47:56 <alexfmpe[m]> oh hmm
20:47:58 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
20:48:00 <alexfmpe[m]> not quite like that
20:48:32 <Cale> (and I didn't handle the doubly empty case, I was going to generalise the (x:xs) pattern match...)
20:48:33 <alexfmpe[m]> I'm basically gate-ing one of the lists against the other
20:48:36 <alexfmpe[m]> like, whitelisting
20:48:48 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 276 seconds)
20:49:05 <Cale> Ohh... like, say to compute the intersection of sorted lists?
20:49:12 fossdd joins (~fossdd@sourcehut/user/fossdd)
20:49:30 <alexfmpe[m]> welll, almost whitelisting, I'm checking that a subsequence of one list matches is included in the other
20:50:18 <alexfmpe[m]> I've done it manually, with normal pattern matching and recursion
20:50:53 <Cale> Is the order important?
20:51:14 <Cale> (Or could we pass to using e.g. Data.Set, which would be more efficient a lot of the time)
20:51:29 <alexfmpe[m]> I'm not 100%, as it's been a while but I think so
20:51:37 <alexfmpe[m]> otherwise, yeah, intersection
20:52:03 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
20:52:43 <alexfmpe[m]> oh, this might work https://hackage.haskell.org/package/base-4.15.0.0/docs/Data-List.html#v:intersect
20:53:22 <alexfmpe[m]> take the intersection and check it matches the original list I'm whitelisting against
20:53:44 pschorf joins (~user@c-73-77-28-188.hsd1.tx.comcast.net)
20:54:04 <dsal> :t fold . zipWith
20:54:05 <lambdabot> Foldable ((->) [a]) => (a -> b -> c) -> [b] -> [c]
20:54:09 <Cale> It could, but note that this thing only requires Eq, so there's no way it's anything cheaper than quadratic
20:54:30 <alexfmpe[m]> bah
20:54:45 <alexfmpe[m]> in my case I actually needed `intersectBy :: (a -> b -> Bool) -> [a] -> [b] -> [a]` or something
20:54:59 <alexfmpe[m]> but `intersectBy` is `a -> a -> Bool` for some reaosn
20:55:06 <alexfmpe[m]> and, yeah, quadratic
20:55:25 <Cale> I'm sure I've written this higher order function before...
20:55:28 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
20:55:42 <Cale> that applies a function to know whether to walk down one list or the other
20:55:51 <Cale> and produces results as it goes
20:55:53 <dsal> :t \f l1 -> fold . zipWith (\a b -> f a b) l1
20:55:55 <lambdabot> Monoid c => (t1 -> t2 -> c) -> [t1] -> [t2] -> c
20:55:59 <dsal> Well that's kind of gross.
20:56:06 <Cale> It's different from folding over the zip
20:56:14 <alexfmpe[m]> well, this is assymetric, I always go down the whitelist one, and may or may not go down the whitelisted one depending on whether it matches
20:56:26 <dsal> Yeah, sorry, I'm not actually aware of the topic here. Just was wondering about that.
20:56:43 <alexfmpe[m]> I dunno, maybe I should fold the whitelist one, and have a pair as the accumulator
20:57:17 <alexfmpe[m]> `(already-whitelisted, check-whether-whitelisted) :: ([a], [a])`
20:58:01 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
21:00:50 mr-red joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
21:01:06 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 240 seconds)
21:03:22 × doyougnu quits (~user@c-73-25-202-122.hsd1.or.comcast.net) (Remote host closed the connection)
21:04:20 × amahl quits (~amahl@84.251.202.64) (Remote host closed the connection)
21:06:06 <dsal> alexfmpe[m]: Is that just something like `[ a | a <- l1, b <- l2, f a b]` ?
21:06:57 <dsal> Oh, intersectBy is in Data.OldList with a definition similar to that.
21:07:18 <alexfmpe[m]> I don't think I can get away with intersection, since multiplicity matters here
21:07:49 <alexfmpe[m]> well, and order, otherwise some multiset intersection thing would work
21:10:00 chomwitt joins (~chomwitt@2a02:587:dc01:5c00:12c3:7bff:fe6d:d374)
21:10:10 guest76 joins (~guest76@2604:3d08:6f7e:cf00::2e50)
21:10:43 roboguy__ joins (~roboguy_@2605:a601:ac0e:ae00:3db6:b926:dbf2:890a)
21:11:02 × amk quits (~amk@176.61.106.150) (Ping timeout: 252 seconds)
21:11:07 × guest76 quits (~guest76@2604:3d08:6f7e:cf00::2e50) (Client Quit)
21:13:30 × roboguy_ quits (~roboguy_@2605:a601:ac0e:ae00:bc41:cf44:b56:1727) (Ping timeout: 240 seconds)
21:13:38 <Cale> alexfmpe[m]: Here's a fun one: https://gist.github.com/cgibbard/b129fe412b74cca676ac2a2c941362ea
21:14:06 nineonine joins (~nineonine@50.216.62.2)
21:14:46 × Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Remote host closed the connection)
21:14:55 × roboguy__ quits (~roboguy_@2605:a601:ac0e:ae00:3db6:b926:dbf2:890a) (Client Quit)
21:14:57 <Cale> Pretty close to the most general thing you can do with a pair of lists, lol
21:15:09 Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi)
21:16:09 <alexfmpe[m]> huh that looks like it works for my case
21:16:19 <alexfmpe[m]> though, Pick seems suspiciously like `These`
21:17:29 <Cale> yeah
21:17:42 <alexfmpe[m]> `these :: (a -> c) -> (b -> c) -> (a -> b -> c) -> These a b -> c`
21:18:12 <Cale> I probably should have just used These
21:18:20 <Cale> For some reason it slipped my mind
21:18:44 bruceleewees joins (~bruceleew@83.24.236.64.ipv4.supernova.orange.pl)
21:18:45 <Cale> Though this is kinda sorta dual to it
21:18:47 jolly23 joins (~jolly@208.180.97.158)
21:18:56 <alexfmpe[m]> it's backwards though?
21:18:57 <alexfmpe[m]> yeah
21:19:05 <alexfmpe[m]> more like `These a b -> (c -> c)`
21:19:32 <Cale> Yeah, you'd have something like (a -> b -> These a b) and (These a b -> c -> c)
21:20:35 × fendor quits (~fendor@77.119.218.44.wireless.dyn.drei.com) (Remote host closed the connection)
21:20:35 × bruceleewees quits (~bruceleew@83.24.236.64.ipv4.supernova.orange.pl) (Read error: Connection reset by peer)
21:21:17 bruceleewees joins (~bruceleew@83.24.236.64.ipv4.supernova.orange.pl)
21:22:11 × jolly quits (~jolly@208.180.97.158) (Ping timeout: 258 seconds)
21:22:24 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
21:23:26 × xff0x quits (~xff0x@2001:1a81:527c:b500:2b8c:4e21:9ff9:e65e) (Ping timeout: 256 seconds)
21:23:26 × gentauro quits (~gentauro@user/gentauro) (Read error: Connection reset by peer)
21:23:43 × Null_A quits (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c) (Remote host closed the connection)
21:23:48 gentauro joins (~gentauro@user/gentauro)
21:23:58 xff0x joins (~xff0x@2001:1a81:527c:b500:2843:4b18:8f2c:3a0f)
21:24:00 × mr-red quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 256 seconds)
21:24:20 jolly joins (~jolly@208.180.97.158)
21:25:32 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
21:26:47 × jolly23 quits (~jolly@208.180.97.158) (Ping timeout: 258 seconds)
21:28:59 Null_A joins (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c)
21:30:56 pbrisbin joins (~patrick@174-083-170-200.res.spectrum.com)
21:32:12 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 245 seconds)
21:32:14 justsomeguy joins (~justsomeg@user/justsomeguy)
21:32:28 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
21:32:43 fossdd joins (~fossdd@sourcehut/user/fossdd)
21:36:07 <peutri> what's the standard these days to parse a relaxng-constrained xml?
21:36:38 <peutri> i looked around for some sort of validate-parser combo, but it always return some form of generic xml structure
21:37:07 amk joins (~amk@176.61.106.150)
21:37:12 × curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 272 seconds)
21:37:14 × jumper149 quits (~jumper149@80.240.31.34) (Quit: WeeChat 3.2)
21:37:58 <peutri> i was hoping for actual sum types, to (help) get a feeling I'm not forgetting branches in my cases
21:38:47 × Null_A quits (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c) (Remote host closed the connection)
21:39:30 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 276 seconds)
21:40:31 <dsal> Huh, I've never really looked at these, but it's been brought up twice in the last couple of days. It's pretty neat.
21:40:38 fossdd joins (~fossdd@sourcehut/user/fossdd)
21:44:07 sheepduck joins (~sheepduck@user/sheepduck)
21:48:04 agua joins (~agua@2804:14c:8793:8e2f:24cc:893e:e794:aea7)
21:48:45 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
21:50:38 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 256 seconds)
21:51:25 fossdd joins (~fossdd@sourcehut/user/fossdd)
21:51:31 pesada joins (~agua@2804:18:4a:f76c:1:0:5e60:e39)
21:52:05 × Core8816 quits (~agua@2804:18:4a:f76c:1:0:5e60:e39) (Ping timeout: 255 seconds)
21:54:36 × agua quits (~agua@2804:14c:8793:8e2f:24cc:893e:e794:aea7) (Ping timeout: 256 seconds)
21:56:39 × sheepduck quits (~sheepduck@user/sheepduck) (Quit: Konversation terminated!)
21:57:16 × deejaytee quits (~deejaytee@cpc91196-cmbg18-2-0-cust215.5-4.cable.virginm.net) (Quit: Leaving)
21:57:22 × Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds)
21:58:21 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 265 seconds)
21:59:02 fossdd joins (~fossdd@sourcehut/user/fossdd)
21:59:22 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
21:59:44 Erutuon joins (~Erutuon@user/erutuon)
22:00:08 × Guest1981 quits (~user@c-66-31-23-28.hsd1.ma.comcast.net) (Ping timeout: 258 seconds)
22:01:52 <lechner> Hi, why do I have to send my Haskell programs Ctrl-C two times to terminate, please?
22:02:47 <geekosaur> are you trapping exceptions? ctrl-c is translated into an exception
22:03:15 <lechner> i am
22:03:33 <glguy> You shouldn't be blanket-dropping exceptions
22:03:48 <lechner> actually, not in this program
22:03:57 <hpc> the first ctrl-c is for your program, the second ctrl-c is for the rts to go "uh oh"
22:04:04 <hpc> otherwise you'd be stuck
22:04:46 <monochrom> I only need one ctrl-c.
22:04:56 <lechner> can i do anything useful in the RTS?
22:05:13 <monochrom> Unless my ghci is inside emacs, but then it's emacs that requires two ctrl-c.
22:05:37 <hpc> *c-c
22:05:51 <lechner> i use 'cabal install' and then run the program from that path via fish
22:06:12 <geekosaur> fwiw I just tested one of my programs and it only requires one ctrl-c. I don't use exceptions
22:06:16 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 258 seconds)
22:07:03 <geekosaur> (took some time to get it to run long enough to let me interrupt it though)
22:07:15 <lechner> maybe something with the ZMQ loop
22:07:29 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:07:37 <monochrom> This is what goes wrong when you overgeneralize your question.
22:08:02 jmorris joins (uid433911@id-433911.stonehaven.irccloud.com)
22:08:46 <glguy> When I press ^C I just got C added to my program's input buffer
22:09:13 <hpc> this reproduces the ^C^C behavior - Prelude Control.Exception Control.Concurrent> catch (threadDelay 100000000) (\(SomeException e) -> threadDelay 10000000)
22:10:25 <hpc> you have to ^C while execution is in an exception handler, it seems
22:11:59 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2)
22:12:02 × burnsidesLlama quits (~burnsides@dhcp168-022.wadham.ox.ac.uk) (Remote host closed the connection)
22:12:05 agua joins (~agua@2804:14c:8793:8e2f:24cc:893e:e794:aea7)
22:12:47 <lechner> Hi, is there a way to assign values to a constituent in a "data" type (sorry, if that lingo is bogus) or do I always have to construct a new one?
22:12:49 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection)
22:13:15 <monochrom> Immutable data means you have to construct a new one.
22:13:21 <geekosaur> you always ocnstruct a new one although it may be based on an old one
22:13:49 <monochrom> It also means that you can still get 90% reuse.
22:14:25 drd joins (~drd@93-39-151-19.ip76.fastwebnet.it)
22:14:29 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
22:15:31 <hpc> record update syntax can be a nice shortcut for having to fully type out constructing a new value
22:15:54 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 276 seconds)
22:15:59 × pesada quits (~agua@2804:18:4a:f76c:1:0:5e60:e39) (Ping timeout: 268 seconds)
22:16:32 <lechner> that discipline is great. i keep finding bugs, or near misses
22:16:57 fossdd joins (~fossdd@sourcehut/user/fossdd)
22:17:14 Null_A joins (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c)
22:18:17 <lechner> i really have to get my types in order
22:18:35 jpds joins (~jpds@gateway/tor-sasl/jpds)
22:19:28 <sm> get your ducks in a row 🦆 🦆 🦆
22:20:14 <lechner> if they only were all ducks!
22:22:08 <lechner> this program will be so reliable, they can take it to Mars
22:23:22 × dhil quits (~dhil@195.213.192.47) (Ping timeout: 240 seconds)
22:24:19 <sm> all must be ducks in ducks compartment. Please stay in your assigned seating so that we can depart for Mars on time.
22:25:34 <lechner> actually, with "duck typing" being a common expression elsewhere we should really pick a different animal
22:25:34 sheepduck joins (~sheepduck@user/sheepduck)
22:26:16 <sm> these are space ducks
22:27:02 × Null_A quits (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c) (Remote host closed the connection)
22:27:03 <sm> highly trained
22:27:32 <Axman6> These ducks know their type, and will not accept gooses
22:28:28 <Axman6> (and gooses are distinct from geese too)
22:30:46 <lechner> with so much professionalism required, I was more thinking about penguins: https://www.youtube.com/watch?v=j1iejIfJ0gk
22:31:28 <DigitalKiwi> what do you call a flock of geese at 1600 Amphitheatre Parkway?
22:31:34 <DigitalKiwi> a gaggle
22:32:24 × arthurxavierx quits (~arthurxav@201.17.157.69) (Remote host closed the connection)
22:34:36 <DigitalKiwi> if that is not improved upon and posted to twitter later ya'll have failed me ;(
22:35:31 Null_A joins (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c)
22:36:06 × vysn quits (~vysn@user/vysn) (Remote host closed the connection)
22:37:00 × chris_ quits (~chris@81.96.113.213) (Remote host closed the connection)
22:37:13 chris_ joins (~chris@81.96.113.213)
22:38:49 <Cale> lechner: Yeah, the way that I think about it is that if you want to write good software in a language without a good type system, you still need to think about types, it's just that the computer isn't going to be much help.
22:39:58 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
22:40:21 <lechner> Cale: I feel silly about having done so much in Perl
22:40:32 <DigitalKiwi> plz buy my new book on dysfunctional programming; types without thinking, available soon but maybe never!
22:40:51 × finsternis quits (~X@23.226.237.192) (Remote host closed the connection)
22:41:14 × ukari quits (~ukari@user/ukari) (Ping timeout: 252 seconds)
22:41:53 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 252 seconds)
22:42:04 fossdd joins (~fossdd@sourcehut/user/fossdd)
22:42:22 geekosaur joins (~geekosaur@xmonad/geekosaur)
22:42:44 <DigitalKiwi> (this is parody)
22:43:52 meinside_ joins (uid24933@id-24933.brockwell.irccloud.com)
22:44:41 peterhil joins (~peterhil@mobile-access-b04815-181.dhcp.inet.fi)
22:45:34 × P1RATEZ quits (piratez@user/p1ratez) (Remote host closed the connection)
22:45:47 <DigitalKiwi> kind of want that book though ;(
22:45:48 × drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 276 seconds)
22:46:54 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
22:47:17 <monochrom> I think I can contribute to that book. When I was undergrad, some classmates did the following, I had to correct them.
22:47:40 <monochrom> We were learning C and reading man pages for library functions like strcpy for example.
22:48:22 <monochrom> man page had a line about the type, "char *strcpy(char *dest, const char *src)".
22:48:52 <monochrom> My classmates fulfilled that line only, without reading the rest of the man page or understanding why we need dst, by coding:
22:49:04 <monochrom> char *foo; strcpy(foo, "hello");
22:49:21 <geekosaur> oy
22:50:21 × zeenk quits (~zeenk@2a02:2f04:a008:d600:18f2:3421:bac6:8f38) (Quit: Konversation terminated!)
22:51:23 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
22:53:02 × acidjnk_new3 quits (~acidjnk@p200300d0c72b950729faca9193881d78.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
22:53:30 drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
22:53:40 × Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Remote host closed the connection)
22:54:49 ukari joins (~ukari@user/ukari)
22:56:04 <lechner> i once worked with a gentleman who took on an Excel task at work. the resulting file contained no formulas; he had used a desk calculator for the computations and then typed in all the values
22:58:10 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 240 seconds)
22:58:32 fossdd joins (~fossdd@sourcehut/user/fossdd)
22:58:34 Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi)
22:58:46 × mnrmnaugh quits (~mnrmnaugh@pool-96-252-87-182.bstnma.fios.verizon.net) (Ping timeout: 265 seconds)
22:59:10 betelgeuse joins (~john2gb@94-225-47-8.access.telenet.be)
22:59:29 <hpc> that reminds me of a story from a web developer job interview
23:00:01 <hpc> the interviewer asked "how would you calculate the area of a square", and the interviewee asked "how long are the sides?"
23:00:17 <hpc> and just couldn't understand that they wanted a formula
23:00:50 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Read error: Connection reset by peer)
23:01:25 drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
23:02:12 dermato_ is now known as dermato
23:05:49 <DigitalKiwi> A mathematician, a physicist, and an engineer were all given a red rubber ball and told to find the volume.
23:05:50 <DigitalKiwi> The mathematician carefully measured the diameter and evaluated a triple integral.
23:05:52 <DigitalKiwi> The physicist filled a beaker with water, put the ball in the water, and measured the total displacement.
23:05:54 <DigitalKiwi> The engineer looked up the model and serial numbers in his red-rubber-ball table.
23:06:05 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Read error: Connection reset by peer)
23:06:25 Atum__ joins (~IRC@user/atum/x-2392232)
23:06:28 drd joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
23:07:10 × dermato quits (~dermatobr@154.21.114.128) (Quit: WeeChat 3.1)
23:07:16 × chomwitt quits (~chomwitt@2a02:587:dc01:5c00:12c3:7bff:fe6d:d374) (Remote host closed the connection)
23:07:54 Atum___ joins (~IRC@user/atum/x-2392232)
23:08:20 dermato joins (~dermatobr@154.21.114.128)
23:09:42 × Atum_ quits (~IRC@user/atum/x-2392232) (Ping timeout: 245 seconds)
23:09:57 <hpc> when i measured my red rubber ball at home i came up with a volume of 0db
23:11:29 × Atum__ quits (~IRC@user/atum/x-2392232) (Ping timeout: 252 seconds)
23:12:53 mrus joins (~mrus@2001:19f0:5:1535:5400:3ff:fe7d:10ae)
23:12:58 <monochrom> Wait, I would expect the mathematician to measure the surface areas and divide by 3.
23:13:22 <DigitalKiwi> the web developer is still trying to figure out how long the sides are
23:13:42 <hpc> monochrom: that doesn't work in anti-de sitter space
23:14:39 <monochrom> I also missed a factor of the radius.
23:14:55 <monochrom> But heh anti-de-sitter space is more funny.
23:18:58 <Axman6> lechner: there will be times where the type system frustrates you, and you will ask yourself questions that begin "Why can't I just..." but then you'll remember that the compiler is your friend and wants to help you, and you also need to work to help it understand your needs. It's like a good relationship
23:19:08 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
23:19:28 <Axman6> (Yes, writing perl, python and ruby is like having a relationship where you throw abuse at your partner and expect it to do what you mean)
23:19:59 × Null_A quits (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c) (Remote host closed the connection)
23:20:15 Null_A joins (~null_a@2601:645:8700:2290:5520:ed9a:24da:3d0c)
23:20:19 <Axman6> DigitalKiwi: Either (Soon Book) (Maybe Never)
23:21:31 mr-red joins (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4)
23:21:56 × drd quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Ping timeout: 252 seconds)
23:27:02 <Cajun> well the compiler does its best to help, sometimes it just isnt very good at it lol
23:27:37 <lechner> it's the thought that counts
23:27:53 pesada joins (~agua@2804:18:4a:f76c:1:0:5e60:e39)
23:28:27 × mr-red quits (~drd@2001:b07:a70:9f1f:1562:34de:f50f:77d4) (Quit: ZNC 1.8.2 - https://znc.in)
23:28:39 <Axman6> exactly, you shouldn't expect perfection from your partner. Sometimes they will mess up and delete your source code when it doesn't type check
23:29:28 <cheater> hmm... a compiler that deletes code that's too stupid... that's an interesting design idea
23:29:34 <hpc> i read that windows defender did that to someone the other day with a tool they wrote to generate license keys for some software they sold
23:29:44 <hpc> so not even outside the realm of possibility lol
23:29:46 <Axman6> cheater: that was an actual GHC bug
23:29:53 <cheater> nice
23:30:05 <cheater> but did it commit and force push the git?
23:30:16 <cheater> because if not, then it's just half measures
23:30:16 <Axman6> it might have been before git...
23:30:18 <DigitalKiwi> well if you weren't so careless GHC wouldn't have thrown it out!
23:31:32 <DigitalKiwi> https://gitlab.haskell.org/ghc/ghc/-/issues/163
23:31:35 <Cajun> how about if you abuse unsafePerformIO to get around immutability it throws it out
23:32:07 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
23:32:10 × pbrisbin quits (~patrick@174-083-170-200.res.spectrum.com) (Ping timeout: 240 seconds)
23:32:36 × agua quits (~agua@2804:14c:8793:8e2f:24cc:893e:e794:aea7) (Ping timeout: 276 seconds)
23:36:25 Matthias1 joins (~Matthias1@2603-8001-b545-4900-d18f-7add-ad3c-4ebe.res6.spectrum.com)
23:36:34 × Matthias1 quits (~Matthias1@2603-8001-b545-4900-d18f-7add-ad3c-4ebe.res6.spectrum.com) (Client Quit)
23:38:59 × argento quits (~argent0@168-227-96-51.ptr.westnet.com.ar) (Ping timeout: 252 seconds)
23:40:38 <lechner> Hi, is there a naming convention for function variables, other than starting with a lowercase letter?
23:41:41 <monochrom> I hate camel case but I respect that it's a community choice so I play along.
23:41:46 <Axman6> make the name meaningful is there is a meaningful name, otherwise use a well used placeholder - x and xs are common because they can usually represent anything
23:41:51 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
23:42:39 aegon joins (~mike@174.127.249.180)
23:42:47 <geekosaur> for a generic function variable, something like f / g / h
23:43:26 <monochrom> And yeah, supposedly generic entities shouldn't take your time choosing "meaningful" names. Save it for really specific entities.
23:43:47 <Axman6> there are conventions for type variable names, and sometimes using that same name for the variables with that type can be useful (but also confusing to those who are very new)
23:44:32 <lechner> i use meaningful names but they can get long, and because of the JSON i have I'm getting drawn into the East Coast underscore_style
23:45:50 <Axman6> Jed Wesley-Smith's talk 'Why "Names Don't Matter" matters' is pretty good on the topic IIRC https://www.youtube.com/watch?v=ZSNg6KNzydQ (I'm a bit biased though)
23:46:24 <Axman6> you can control the names that are generated in your json and have it convery to snake case if you need that
23:46:38 cjb joins (~cjb@user/cjb)
23:47:03 <Cajun> functions also tend to have some way of denoting what it uses, like mapM (monadic), foldl' (its strict), etc
23:49:10 <janus> % :t replicateM
23:49:10 <yahb> janus: Applicative m => Int -> m a -> m [a]
23:49:14 <janus> and they can lie about it :P
23:50:02 <Axman6> It's like conferate statues in the US, a relic of the past that should be changed
23:51:17 dajoer joins (~david@user/gvx)
23:51:19 <monochrom> BTW I avoid using the word "isomorphism" and its derivatives.
23:51:38 finsternis joins (~X@23.226.237.192)
23:51:54 <dsal> replicate'M
23:52:08 <Axman6> yeah the cool kids use s'morphism these days
23:52:14 <dsal> @hoogle replicate'M
23:52:14 <lambdabot> No results found
23:52:16 <dsal> boo
23:52:19 <Axman6> sounds less like an apple product
23:52:35 <Axman6> @hoogle m'Lady
23:52:35 <lambdabot> No results found
23:52:45 <dsal> "meaningful names" are often pretty terrible and distracting.
23:52:45 <monochrom> It can be a very precise and meaningful word, but only when me and my audience have already established context regarding what structure is being preserved.
23:53:57 <monochrom> If I am just explaining to a beginner that "Bool->X" and "(X,X)" represent the same thing, I stay informal and say "equivalent" in the daily English sense, or at most I go "bijective".
23:54:08 <Axman6> "One-to-one correspondy boi"
23:54:33 <monochrom> There is absolutely no need to encourage beginners to cargo-cult the word "ismorphism".
23:55:02 <lechner> can the scrutinee be an expression?
23:55:15 <dsal> Sure, yeah.
23:55:31 <monochrom> If you take a poll in the Haskell community, I bet you that you will find that most people reply "I say 'isomorphism' because, only because, I hear other people say it, I don't really know why".
23:55:33 <DigitalKiwi> replicate'm? damn near killed'em
23:55:56 <Axman6> XD
23:56:09 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
23:57:23 <lechner> Can something like this tool_folder <- getTool (tool config) tempdir really be turned into something like case (getTool (tool config) tempdir) of ?
23:57:38 <Axman6> no
23:57:45 <Axman6> well, it depends which monad you're working in
23:57:58 <Axman6> there's a lot of missing context around that <-
23:58:10 <dsal> You can lambdacase it.
23:58:12 <lechner> yeah
23:58:55 <dsal> But `x <- a` isn't an expression, it's a fancy way to write `x >>= \a -> ...`
23:59:11 × Deide quits (~Deide@user/deide) (Quit: Seeee yaaaa)
23:59:16 <lechner> i know i did not use the right term
23:59:55 <dsal> With LambdaCase you can write `getTool (tool config) tempDir >>= \case ...`

All times are in UTC on 2021-07-27.