Logs on 2021-08-06 (liberachat/#haskell)
| 00:00:44 | → | Codaraxis_ joins (~Codaraxis@user/codaraxis) |
| 00:01:04 | × | retroid_ quits (~retro@5ec19a54.skybroadband.com) (Ping timeout: 258 seconds) |
| 00:03:07 | → | kor1 joins (~kor1@user/kor1) |
| 00:03:12 | ← | kor1 parts (~kor1@user/kor1) () |
| 00:04:18 | × | Codaraxis__ quits (~Codaraxis@user/codaraxis) (Ping timeout: 240 seconds) |
| 00:07:05 | → | jmorris joins (uid433911@id-433911.stonehaven.irccloud.com) |
| 00:09:10 | → | euouae joins (~euouae@user/euouae) |
| 00:09:13 | <euouae> | Hello |
| 00:09:19 | <Axman6> | o/ |
| 00:09:32 | <euouae> | How does --config-file work in cabal? Does anyone know? |
| 00:09:59 | <euouae> | I read in the docs that you can use it together with user-config, such as cabal user-config --config-file foo.cabal, but I get that "--config-file" is not recognized |
| 00:12:34 | <geekosaur> | it works for me but --config-file has to come before the command |
| 00:12:48 | <geekosaur> | cabal --config-file foo.cabal user-config ... |
| 00:13:39 | <euouae> | Oh I see, it's a global option then. Sorry |
| 00:14:06 | <euouae> | Another question is, does cabal 3.4 have any drastic changes in terms of building and installing packages? I noticed the section is not yet written in the docs, but 3.2 is |
| 00:15:34 | <geekosaur> | that I can't help with. (I note that 3.6 was just released but has no online manual at all yet.) |
| 00:17:34 | <euouae> | oh wow |
| 00:19:08 | jess | is now known as sandcat |
| 00:19:29 | <monochrom> | New today: We're now on to 3.6.0.0 >:) |
| 00:20:06 | → | vicfred joins (~vicfred@user/vicfred) |
| 00:21:02 | <euouae> | cabal tells me 3.4 is up to date, although hackage mentions 3.6 |
| 00:21:03 | × | jao quits (jao@gateway/vpn/protonvpn/jao) (Ping timeout: 276 seconds) |
| 00:21:07 | <euouae> | Not sure why, even though I updated. |
| 00:22:54 | <davean> | euouae: cabal-install and Cabal are seperate |
| 00:22:57 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 00:23:08 | <davean> | there is a 3.6 Cabal, not so for cabal-install |
| 00:23:20 | <euouae> | what's 3.6 Cabal? Is it cabal-the-spec? |
| 00:23:25 | <geekosaur> | oh, I missed that |
| 00:23:41 | <geekosaur> | Caal is a library for manipulating package descriptions |
| 00:23:57 | <euouae> | Okay |
| 00:23:59 | <geekosaur> | it's used by ghc, stack, cabal-install, and other tools |
| 00:24:12 | <davean> | The important part of Cabal 3.6 is 9.2 stuff |
| 00:24:13 | <euouae> | so Cabal is the library, cabal-install is ... cabal the tool? and we also have the cabal spec. Right? |
| 00:24:25 | <davean> | euouae: correct |
| 00:24:26 | × | hiruji quits (~hiruji@user/hiruji) (Read error: Connection reset by peer) |
| 00:24:58 | <euouae> | davean: Do you know if reading the building & install section of cabal-install 3.2 is OK for using cabal-install 3.4 or am I missing anything super useful? |
| 00:25:23 | → | hiruji joins (~hiruji@user/hiruji) |
| 00:25:33 | <davean> | euouae: It'll be fine, the spec is versioned and backwards compatible |
| 00:26:29 | <euouae> | great thanks |
| 00:30:46 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 00:30:47 | × | hiruji quits (~hiruji@user/hiruji) (Read error: Connection reset by peer) |
| 00:31:19 | → | hiruji joins (~hiruji@user/hiruji) |
| 00:31:30 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 00:33:15 | × | hiruji quits (~hiruji@user/hiruji) (Read error: Connection reset by peer) |
| 00:33:29 | → | falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) |
| 00:33:47 | → | hiruji joins (~hiruji@user/hiruji) |
| 00:33:55 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 00:37:04 | × | hiruji quits (~hiruji@user/hiruji) (Read error: Connection reset by peer) |
| 00:37:23 | → | hiruji joins (~hiruji@user/hiruji) |
| 00:41:02 | × | arkho quits (~ccc@dynamic-acs-24-112-153-241.zoominternet.net) (Quit: Leaving) |
| 00:45:01 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 00:45:44 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 00:48:30 | → | P1RATEZ joins (piratez@user/p1ratez) |
| 01:05:39 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 01:06:10 | × | hiruji quits (~hiruji@user/hiruji) (Read error: Connection reset by peer) |
| 01:07:23 | → | hiruji joins (~hiruji@user/hiruji) |
| 01:07:41 | × | falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Remote host closed the connection) |
| 01:08:05 | → | falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) |
| 01:08:51 | × | hiruji quits (~hiruji@user/hiruji) (Read error: Connection reset by peer) |
| 01:09:27 | → | hiruji joins (~hiruji@user/hiruji) |
| 01:10:54 | × | hiruji quits (~hiruji@user/hiruji) (Read error: Connection reset by peer) |
| 01:11:16 | → | hiruji joins (~hiruji@user/hiruji) |
| 01:20:17 | × | alx741 quits (~alx741@186.178.109.254) (Quit: alx741) |
| 01:20:59 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 01:30:58 | × | favonia quits (~favonia@user/favonia) (Ping timeout: 240 seconds) |
| 01:35:51 | → | favonia joins (~favonia@user/favonia) |
| 01:40:32 | → | pe200012 joins (~pe200012@218.107.49.28) |
| 01:44:00 | → | Guest099 joins (~Guest0@187.83.249.216.dyn.smithville.net) |
| 01:44:22 | × | Guest099 quits (~Guest0@187.83.249.216.dyn.smithville.net) (Client Quit) |
| 01:45:10 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 01:54:10 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 02:00:10 | × | xff0x_ quits (~xff0x@2001:1a81:5296:aa00:8dc0:fe3f:5c9e:fa3a) (Ping timeout: 240 seconds) |
| 02:02:22 | → | xff0x_ joins (~xff0x@2001:1a81:52cf:a900:fe8a:f909:9f2c:b4df) |
| 02:08:35 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 02:08:47 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 02:09:37 | → | Codaraxis__ joins (~Codaraxis@user/codaraxis) |
| 02:10:15 | × | _xor quits (~xor@74.215.232.67) (Quit: brb) |
| 02:12:05 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 02:12:24 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 02:12:33 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 258 seconds) |
| 02:14:09 | × | Codaraxis_ quits (~Codaraxis@user/codaraxis) (Ping timeout: 276 seconds) |
| 02:15:53 | → | _xor joins (~xor@74.215.232.67) |
| 02:17:56 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 02:17:57 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (lithium.libera.chat (Nickname regained by services))) |
| 02:17:57 | finn_elija | is now known as FinnElija |
| 02:21:31 | × | ukari quits (~ukari@user/ukari) (Remote host closed the connection) |
| 02:25:20 | × | td_ quits (~td@94.134.91.183) (Ping timeout: 272 seconds) |
| 02:25:28 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection) |
| 02:26:26 | → | td_ joins (~td@muedsl-82-207-238-118.citykom.de) |
| 02:31:11 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 02:45:16 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 02:47:17 | → | wei2912 joins (~wei2912@112.199.250.21) |
| 02:49:27 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Remote host closed the connection) |
| 02:53:41 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 02:56:23 | → | retroid_ joins (~retro@5ec19a54.skybroadband.com) |
| 03:00:49 | → | ukari joins (~ukari@user/ukari) |
| 03:02:07 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 03:06:13 | → | Cajun joins (~Cajun@user/cajun) |
| 03:07:04 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 256 seconds) |
| 03:11:04 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 03:17:53 | → | oso joins (~oso@2601:58c:c080:a950:f275:2530:b398:680b) |
| 03:20:10 | × | MQ-17J quits (~MQ-17J@8.21.10.94) (Ping timeout: 240 seconds) |
| 03:20:58 | × | euouae quits (~euouae@user/euouae) (Quit: Client closed) |
| 03:23:32 | → | MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com) |
| 03:33:52 | × | pe200012 quits (~pe200012@218.107.49.28) (Ping timeout: 245 seconds) |
| 03:34:00 | → | pe200012_ joins (~pe200012@183.236.83.77) |
| 03:36:54 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds) |
| 03:42:16 | × | xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer) |
| 03:42:25 | × | doyougnu quits (~user@c-73-25-202-122.hsd1.or.comcast.net) (Read error: Connection reset by peer) |
| 03:42:39 | → | doyougnu joins (~user@c-73-25-202-122.hsd1.or.comcast.net) |
| 03:50:30 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 03:55:07 | × | doyougnu quits (~user@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 245 seconds) |
| 03:55:11 | → | Guest56 joins (~Guest56@2001:8003:33f0:c100:e466:919:f866:6e35) |
| 03:58:55 | × | slack1256 quits (~slack1256@181.203.118.140) (Remote host closed the connection) |
| 03:59:43 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 244 seconds) |
| 04:03:07 | → | dansh joins (~dansh@101.190.222.236) |
| 04:03:22 | → | lavaman joins (~lavaman@98.38.249.169) |
| 04:03:43 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 04:04:17 | × | pe200012_ quits (~pe200012@183.236.83.77) (Ping timeout: 245 seconds) |
| 04:04:27 | → | pe200012_ joins (~pe200012@113.105.10.33) |
| 04:04:34 | × | dansh quits (~dansh@101.190.222.236) (Client Quit) |
| 04:05:29 | × | pgib quits (~textual@173.38.117.68) (Ping timeout: 252 seconds) |
| 04:06:11 | × | Guest56 quits (~Guest56@2001:8003:33f0:c100:e466:919:f866:6e35) (Quit: Client closed) |
| 04:07:53 | × | MidAutumnHotaru quits (~MidAutumn@user/midautumnmoon) (Quit: Leaving for a break - theLounge) |
| 04:08:24 | → | MidAutumnHotaru joins (~MidAutumn@user/midautumnmoon) |
| 04:08:32 | × | wagle quits (~wagle@quassel.wagle.io) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
| 04:09:01 | → | wagle joins (~wagle@quassel.wagle.io) |
| 04:11:32 | → | bluehat joins (~bluehat@202.14.120.238) |
| 04:11:40 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 04:11:50 | → | willbush joins (~user@47.183.200.14) |
| 04:12:09 | × | euandreh quits (~euandreh@2804:14c:33:9fe5:cf01:7cd6:622f:9fda) (Ping timeout: 258 seconds) |
| 04:12:23 | → | moveeax joins (~moveeax@202.14.120.238) |
| 04:12:36 | <moveeax> | hi |
| 04:13:55 | × | bluehat quits (~bluehat@202.14.120.238) (Remote host closed the connection) |
| 04:16:48 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds) |
| 04:17:21 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 04:22:45 | × | P1RATEZ quits (piratez@user/p1ratez) (Remote host closed the connection) |
| 04:24:32 | × | falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 250 seconds) |
| 04:26:57 | → | moveax86_64 joins (~moveax86_@202.14.120.238) |
| 04:27:22 | × | moveeax quits (~moveeax@202.14.120.238) (Quit: Connection closed) |
| 04:27:37 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 245 seconds) |
| 04:27:50 | × | moveax86_64 quits (~moveax86_@202.14.120.238) (Remote host closed the connection) |
| 04:28:18 | → | vlatkoB joins (~IRC_clien@188.252.173.111) |
| 04:31:56 | <jle`> | hi |
| 04:31:57 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 04:33:01 | × | jle` quits (~justin@cpe-23-240-75-236.socal.res.rr.com) (Quit: WeeChat 2.7) |
| 04:33:19 | → | jle` joins (~justin@cpe-23-240-75-236.socal.res.rr.com) |
| 04:33:30 | <vlatkoB> | /msg NickServ IDENTIFY vlatkoB vlatkoLiberaNode |
| 04:33:37 | <janus> | oops :( |
| 04:34:00 | <janus> | vlatkoB: you should change your password, everybody saw that |
| 04:34:50 | × | vlatkoB quits (~IRC_clien@188.252.173.111) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
| 04:36:37 | → | endlesseditions joins (~endlessed@135.129.112.36) |
| 04:39:45 | × | xff0x_ quits (~xff0x@2001:1a81:52cf:a900:fe8a:f909:9f2c:b4df) (Ping timeout: 258 seconds) |
| 04:40:33 | → | xff0x_ joins (~xff0x@2001:1a81:52cf:a900:d9f9:1622:609d:b2ef) |
| 04:41:43 | endlesseditions | is now known as endless |
| 04:44:17 | × | endless quits (~endlessed@135.129.112.36) (Quit: Textual IRC Client: www.textualapp.com) |
| 04:44:36 | → | endlesseditions joins (~endlessed@135.129.112.36) |
| 04:44:58 | × | ukari quits (~ukari@user/ukari) (Remote host closed the connection) |
| 04:45:22 | → | ukari joins (~ukari@user/ukari) |
| 04:48:54 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 04:49:14 | → | falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) |
| 04:50:01 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 04:51:49 | × | slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving) |
| 04:53:22 | <jle`> | does anyone know if there's a way to "cabal repl" outside of a project and include packages in scope? like `stack ghci --package lens` |
| 04:53:32 | <jle`> | but cabal |
| 04:55:53 | <c_wraith> | cabal repl -b packagename |
| 04:56:01 | <c_wraith> | or --build-depends, but -b is easier to spell |
| 05:00:26 | <jle`> | ooh |
| 05:00:29 | <jle`> | that's the magic word |
| 05:03:06 | <jle`> | hooray it worked thanks! |
| 05:04:14 | × | stevenxl quits (uid133530@id-133530.highgate.irccloud.com) (Quit: Connection closed for inactivity) |
| 05:04:42 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: Lost terminal) |
| 05:17:05 | → | anandprabhu joins (~anandprab@94.202.243.198) |
| 05:17:35 | → | moveax86_64 joins (~moveax86_@202.14.120.238) |
| 05:18:13 | → | moveeax joins (~moveeax@202.14.120.238) |
| 05:20:03 | × | bgamari quits (~bgamari@72.65.101.147) (Ping timeout: 276 seconds) |
| 05:20:10 | → | bgamari_ joins (~bgamari@72.65.101.13) |
| 05:21:56 | <moveax86_64> | testPRIVMSG #haskell :this is a testPONG :pingis |
| 05:22:12 | × | meinside_ quits (uid24933@id-24933.brockwell.irccloud.com) (Quit: Connection closed for inactivity) |
| 05:22:20 | <Axman6> | please don't use the channel for testing |
| 05:23:10 | × | moveax86_64 quits (~moveax86_@202.14.120.238) (Remote host closed the connection) |
| 05:23:36 | × | moveeax quits (~moveeax@202.14.120.238) (Quit: Connection closed) |
| 05:26:53 | × | tomku quits (~tomku@user/tomku) (Ping timeout: 252 seconds) |
| 05:27:50 | → | tomku joins (~tomku@user/tomku) |
| 05:28:16 | <Cajun> | so a friend gave me a small challenge: given a file like so "[(233,173,20), (200, 10, 155)....]", turn it into an image without the dimensions given. the text file is massive, ~189mb but its all there. i can strictly read the file, but when i go to convert it to a `[(Word8, Word8, Word8)]` the program quickly eats up ~24gb of ram and requires a |
| 05:28:16 | <Cajun> | segfault. heres the meat of the issue: https://paste.tomsmeding.com/r5DDLhAW |
| 05:29:25 | <Cajun> | is there a way i can get that string from the reading of the file to a list without requiring an insane amount of ram? also when i turn on -s, its mainly the GC taking up >90% of runtime |
| 05:29:55 | <Cajun> | kinda like `coerce` but for String -> [(Word8, Word8, Word8)] |
| 05:30:33 | <jle`> | Cajun: what are the Word8s supposed to represent? |
| 05:30:40 | <Cajun> | pixels |
| 05:30:54 | <jle`> | like color channels? |
| 05:31:15 | <jle`> | and this is like a row major representation? |
| 05:31:20 | <Cajun> | in the juicypixels library, it uses `Pixel8` which is a synonym for `Word8` so i might as well convert to Word8 |
| 05:31:39 | <jle`> | i'm just trying to understand how the image is encoded heh |
| 05:31:56 | <jle`> | when first looking at the list it seemed like a list of points to connect like an svg maybe heh |
| 05:32:43 | <Cajun> | its literally just a list like this: "[(Num, Num, Num), (Num, Num, Num)......]" where each Num is an RGB value and each tuple makes a pixel |
| 05:32:44 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 05:32:59 | <Axman6> | I would be inclined to split the reading into smaller chunks - assuming you don't need to be super strict with the format, you could so something like: map read . splitOn "," . drop 1 . init |
| 05:33:03 | → | oxide joins (~lambda@user/oxide) |
| 05:33:35 | <jle`> | Cajun: so, it's like a scan of pixels from left to right, row to row? |
| 05:33:44 | <jle`> | the color values at each point? |
| 05:34:10 | <Axman6> | it's a lot like a pgm image |
| 05:34:24 | <Cajun> | well its essentially one row, but the challenge is to recover it, so i can say how far the rows go jle` |
| 05:35:04 | <Axman6> | or ppm I guess |
| 05:35:08 | <Axman6> | https://en.wikipedia.org/wiki/Netpbm#File_formats |
| 05:36:18 | <jle`> | hm, i guess the challenge is if there's a streaming file format for images |
| 05:36:21 | <jle`> | then you can just convert directly into there |
| 05:36:54 | <Cajun> | i tried looking for a library that would directly take up a list of tuples and churn out an image, but its appearing to be more difficult |
| 05:37:11 | <Axman6> | I feel like you're overthinking this jle`, it's just the Show output of a [(Word8,Word8,Word8)] that needs to be Read |
| 05:37:16 | <Cajun> | i can try that strategy of splitting the file, but that just defers the work, no? |
| 05:37:27 | <jle`> | Axman6: it can'be be read because it doesn't fit into memory |
| 05:37:32 | <jle`> | at least, that's how i'm interpreting it |
| 05:37:43 | <jle`> | hm but 189mb should fit in memory |
| 05:37:48 | <Axman6> | using lazyIO it should be fine |
| 05:37:53 | <Cajun> | well for some reason its also taking up a bunch of memory and i have no idea why |
| 05:37:54 | <Axman6> | yeah |
| 05:38:08 | <jle`> | if it fits into memory then lazy or non-lazy io shouldn't be an issue either way i think |
| 05:38:20 | <jle`> | the only reason you'd want lazy io if you don't want your whole data in memory |
| 05:38:26 | <Axman6> | well, you can do some calculations, but remember that (Word8,Word8,Word8) takes up much more space than 3*8 bytes |
| 05:38:40 | <Axman6> | there's like two words for the tuple, then two words per Word8 |
| 05:38:43 | <Cajun> | reading the file isnt an issue, but `read` -ing it to convert the String to (Word8, Word8, Word8) eats all the ram and essentially crashes it |
| 05:39:00 | <jle`> | ah yeah, 'read' is not really meant for actual work |
| 05:39:05 | <jle`> | it's mostly for debugging |
| 05:39:17 | <Axman6> | so, you might want to add: data Pixel = Pixel {-#UNPACK#-}Word8 {-#UNPACK#-}Word8 {-#UNPACK#-}Word8 and convert the tuple into that |
| 05:39:38 | <Axman6> | missing the ! on those Word8's |
| 05:39:58 | <Cajun> | convert the tuple during the `read` to that? |
| 05:40:08 | <jle`> | so using like splitOn "," (like Axman suggested) should work, that's pretty efficient, especially if you do it over lazy io. otherwise you can use a parser library like attoparsec but that'd be overkill too |
| 05:40:27 | <jle`> | read is mostly meant for debugging, so i wouldn't use it for anything serious |
| 05:40:35 | <Axman6> | yeah - if you have (Word8, Word8, Word8) -> Pixel, then do rdo map (toPixel . read) . ... |
| 05:40:53 | <jle`> | > splitOn ", " "(1,2,3), (4,5,6), (7,8,9)" |
| 05:40:54 | <lambdabot> | ["(1,2,3)","(4,5,6)","(7,8,9)"] |
| 05:41:22 | <jle`> | or depending on your file format you can splitOn "," and chunksOf 3 it or something like that |
| 05:41:23 | <Axman6> | % read " (1,2)" :: (Word8,Word8) |
| 05:41:23 | <yahb> | Axman6: (1,2) |
| 05:41:32 | <Axman6> | splitOn "," should be enough |
| 05:41:48 | <Cajun> | and should that be in another `let` right before it? |
| 05:42:11 | <Cajun> | like `let splitArr = splitOn "," rawList` |
| 05:42:48 | <Axman6> | I would just do it in one go, let imageArr = map (toPixel . read) . splitOn "," . init . drop 1 $ rawList |
| 05:42:56 | × | falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 272 seconds) |
| 05:43:08 | <Cajun> | why do you need the `init . drop 1` in this instance? |
| 05:43:21 | <Axman6> | to get rid ot the [ and ] |
| 05:43:27 | <Cajun> | yeah just figured, makes sense |
| 05:43:48 | <Axman6> | I would definitely not use readFile' either, whatever that is |
| 05:43:54 | × | koz quits (~koz@121.99.240.58) (Remote host closed the connection) |
| 05:43:56 | <Axman6> | lazy IO will help you here |
| 05:44:09 | → | koz joins (~koz@121.99.240.58) |
| 05:44:14 | <Axman6> | one of the cases where it can actually work, without having to resort to streaming |
| 05:44:21 | <Cajun> | so i do want to lazily read the file, not strictly with `readFile'` ? |
| 05:44:27 | <Axman6> | yes |
| 05:44:58 | <Axman6> | think about the oveahead that 186 million Chars has |
| 05:45:12 | <Axman6> | you will need gigabytes of memory to put that in RAM |
| 05:45:19 | <jle`> | yeah, the advantage of splitOn, map, etc. is that they process the list char-by-char, they never need anything beyond that |
| 05:45:44 | <jle`> | so with lazy io, io is driven by what splitOn, drop, init, map demand |
| 05:45:47 | <Axman6> | each (:) is like three words, then each Char is another two words. and a word is 8 bytes |
| 05:45:48 | <jle`> | and the demand is piece-by-piece |
| 05:46:09 | <jle`> | so you never keep any char's in memory other than what toPixel/read/splitOn are directly processing |
| 05:46:10 | <Cajun> | what library is `splitOn` from? it doesnt seem to be in the prelude |
| 05:46:20 | <jle`> | should be in base in Data.List i think |
| 05:46:36 | <jle`> | oh, it's not :o |
| 05:46:53 | <Cajun> | hoogle says it exists for the `Text` datatype but not for strings |
| 05:46:59 | <jle`> | looks like it's in the 'split' library |
| 05:47:04 | <jle`> | which is pretty commonly used |
| 05:47:57 | <Axman6> | we need to just merge all of splity into base already -_- |
| 05:48:02 | <Axman6> | split* |
| 05:48:04 | <jle`> | +1 |
| 05:48:33 | <jle`> | but ì you're learning haskell, it's actually a neat exercise to write it from scratch too. on an unrelated note :) |
| 05:48:43 | <Axman6> | agreed |
| 05:49:13 | <jle`> | *if |
| 05:49:21 | <Axman6> | splitOn :: [a] -> [a] -> [[a]] is significant;y more difficult for a beginner than splitOn :: a -> [a] -> [[a]] too |
| 05:49:34 | <Cajun> | and what is `toPixel` doing in that instance Axman6 ? |
| 05:50:06 | <Axman6> | literally just putting the Word8's into the Pixel constructor, but it's a much more compact representation than the tuple |
| 05:50:24 | <Axman6> | toPixel (r,g,b) = Pixel r g b |
| 05:50:41 | <Axman6> | if you're using juicypixels, this type probably already exists |
| 05:51:17 | <Axman6> | https://hackage.haskell.org/package/JuicyPixels-3.3.5/docs/Codec-Picture.html#t:PixelRGB8 |
| 05:51:18 | <jle`> | i feel like you also need to account for the three-ness of the pixels |
| 05:51:33 | <Axman6> | jle`: ? |
| 05:51:40 | <Cajun> | i have a type synonym for something similar: `type RGB8 = (Pixel8, Pixel8, Pixel8)` |
| 05:51:54 | <jle`> | > splitAt "," . drop 1 . init $ "[(233,173,20), (200, 10, 155)]" |
| 05:51:56 | <lambdabot> | error: |
| 05:51:56 | <lambdabot> | • Couldn't match expected type ‘Int’ with actual type ‘[Char]’ |
| 05:51:56 | <lambdabot> | • In the first argument of ‘splitAt’, namely ‘","’ |
| 05:52:07 | <jle`> | > splitOn "," . drop 1 . init $ "[(233,173,20), (200, 10, 155)]" |
| 05:52:09 | <lambdabot> | ["(233","173","20)"," (200"," 10"," 155)"] |
| 05:52:17 | <jle`> | you get each number instead of each triple |
| 05:52:33 | <Axman6> | aren't you just handing this to juicypixels eventually? why not just go straight to its type? (Word8,Word8,Word8) is horrifically inefficient |
| 05:53:01 | <Cajun> | well what isnt shown in that code segment is handing it off to Repa then to Juicepixels |
| 05:53:24 | <jle`> | if you're just getting the raw Word8's then no need to do anything fancy i think |
| 05:53:30 | <Axman6> | 3*2 + 4 words, so 10 words, which is 80 bytes, per pixel. |
| 05:53:41 | <jle`> | > map read . filter isDigit . splitOn "," $ "[(233,173,20), (200, 10, 155)]" :: [Word8] |
| 05:53:43 | <lambdabot> | error: |
| 05:53:43 | <lambdabot> | • Couldn't match type ‘Char’ with ‘[Char]’ |
| 05:53:43 | <lambdabot> | Expected type: [Char] -> [String] |
| 05:53:59 | <jle`> | > map (read . filter isDigit) . splitOn "," $ "[(233,173,20), (200, 10, 155)]" :: [Word8] |
| 05:54:01 | <lambdabot> | [233,173,20,200,10,155] |
| 05:54:04 | <Cajun> | i already have a function `toImage :: Array U DIM2 RGB8 -> Image PixelRGB8` to convert the repa array to a juicepixels image (i could also find something from juicepixels-repa) |
| 05:54:35 | <endlesseditions> | random question thats probably been asked 1 billion times before,,,, but, do you all think haskell is a good lang as an introduction to FP? I mostly use Go and Typescript for microsystem development. Really want to get more into FP but not sure what lang i should mess around with first. |
| 05:54:46 | <Axman6> | just go straight to Pixel8, seriously, you don't have the RAM not to |
| 05:55:18 | <Cajun> | straight to pixel8 but how would i get a list of pixel8 into an image? |
| 05:55:32 | <jle`> | endlesseditions: i'd say just jump straight into fp with haskell :) i got a small taste with ruby but jumping from ruby to haskell worked well for me personally |
| 05:55:39 | <Axman6> | endlesseditions: if you actually want to learn FP, there's basicaslly no better language, because you don't have the choice to dumb things like use mutation or arbitrary effects in the middle of seemingly pure functions |
| 05:55:47 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 05:57:18 | <endlesseditions> | cool yeah i was seeing some similar stuff to what you said Axman, regarding other langs that are more multiparidigm and can be a bit more lax in terms of what style of programming you do |
| 05:57:23 | <Axman6> | you could quite easily use generateFoldImage, where acc is actually the list of pixels, assuming that it works in the same order as your image |
| 05:57:50 | <jle`> | Cajun: a juicy pixels image is essentially internally a Data.Vector of pixels |
| 05:58:01 | <jle`> | oh, not even of pixels. of pixel components |
| 05:58:14 | <Axman6> | endlesseditions: people get caught up in wanting features they had in other languages because that's what they're used to. It's a trap (as someone who's been writing Scala recently, I can recommend you never, ever, touch it, just don't) |
| 05:58:15 | <jle`> | https://hackage.haskell.org/package/JuicyPixels-3.3.5/docs/Codec-Picture-Types.html#t:Image |
| 05:58:27 | <Cajun> | hold up am i converting to a list of Pixel8 or a list of PixelRGB8? |
| 05:58:32 | <jle`> | Cajun: so you can literally just throw in a vecotor of Word8's |
| 05:58:42 | <endlesseditions> | oh man i mean scala looked interesting and all but i kinda want to stay away from jvm to be honest aha |
| 05:58:56 | <jle`> | `Image w h (Vector.fromList myListOfWord8s)` |
| 05:59:05 | <endlesseditions> | one thing i really like about go is its ability to compile down into simple binary (even if it is a bit bloated) |
| 05:59:11 | → | anandprabhu_ joins (~anandprab@86.106.121.228) |
| 05:59:25 | <Axman6> | generateFoldImage (\(p:ps) _x _y (ps,p)) pixels width height should work |
| 05:59:28 | <jle`> | Cajun: of type `Image Pixel8` |
| 05:59:56 | <Axman6> | endlesseditions: Haskell is also a compiled language, which usually doeasn't link to much |
| 06:00:00 | <Cajun> | that would wind up being greyscale, then im turning an rgb image greyscale and would mess it up entirely |
| 06:00:06 | <endlesseditions> | is the Learn You book still the top rec for hoping straight in? |
| 06:00:20 | <Cajun> | as each RGB channel would turn into their own monochrome pixels |
| 06:00:39 | <lechner> | Hi, I would like to mirror Hackage locally to find prerequisites that are not declared correctly. Unfortunately that is what I may be encountering when trying to build the mirroring tool hackage-mirror. What's the fix, please? Thanks! https://paste.debian.net/1206740/ |
| 06:00:39 | <Cajun> | they need to stay as 3-tuples then into PixelRGB8 |
| 06:00:44 | <jle`> | Cajun: no, it's an internal represetation (if you're talking about my method) |
| 06:00:51 | <endlesseditions> | and do people ever make CLI's or TUI's in haskell? those are some things im definitely interested as i've mostly just been making cli's lately |
| 06:01:03 | <jle`> | Cajun: internally it's stored as a contiguous vector of Word8's. but when you process it as an image, it automatically chunks them up into 3's |
| 06:01:19 | <Axman6> | Cajun: why do you say that? o.O |
| 06:01:27 | <jle`> | so i guess my method is a bit low-level, heh |
| 06:01:33 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Quit: leaving) |
| 06:01:39 | <Cajun> | ahhh i see. so am i manually constructing an image or something? i still dont get how im making an `Image Pixel8` from a list of word8s |
| 06:01:47 | × | anandprabhu quits (~anandprab@94.202.243.198) (Ping timeout: 258 seconds) |
| 06:01:47 | × | cheater quits (~Username@user/cheater) (Ping timeout: 258 seconds) |
| 06:01:49 | <jle`> | the JuicyPixels library provides an abstraction to work over the raw contiguous bytes as if it were a color image |
| 06:02:01 | <Axman6> | Ignore jle` and listen to me :P |
| 06:02:19 | <lechner> | I tried to use hvr's hackage-mirror-tool instead but did not fare much better https://paste.debian.net/1206742/ https://github.com/haskell-hvr/hackage-mirror-tool https://groups.google.com/g/stackage/c/Y7NU6qVElZs?pli=1 |
| 06:02:20 | <Axman6> | (This is usually very bad advice, but I know what I'm talking about here XD) |
| 06:02:46 | → | cheater joins (~Username@user/cheater) |
| 06:03:49 | <Cajun> | now im really confused lol, i now have no idea how im getting from this string to this list of word 8s (im doing this: `map (read . filter isDigit) . splitOn "," $ "[(233,173,20), (200, 10, 155)]" :: [Word8]` right?) then i need that to be a vector and use some function to shove that into an `Image`? |
| 06:03:54 | <jle`> | yeah, we are giving sort of contradictory method, so just having one channel of communication is probably better :p |
| 06:03:58 | <Axman6> | If you do what I'm saying, you will use the minimum memory needed to allocate the image and read data lazily from disk |
| 06:04:20 | <Axman6> | Cajun: that's why you should do what I said instead |
| 06:04:40 | <Axman6> | lechner: #haskell-infrastructure might be a better place to ask |
| 06:04:45 | <Cajun> | well now i have no idea what that was |
| 06:05:22 | <lechner> | Axman6: thanks! |
| 06:06:23 | <Axman6> | you code will literally be: generateFoldImage (\(p:ps) _x _y (ps,p)) (map (toPixel . read) . splitOn "," . init . drop 1 $ rawList) width height, assuming you know the dimensions of the image |
| 06:06:56 | <Cajun> | i dont know the dimensions of the image, but i guess i just can guess and check. is there any harm if the dimensions are too small/big than the original? |
| 06:07:06 | <Cajun> | like, there are too many pixels than are in those dimensions |
| 06:07:09 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds) |
| 06:07:09 | × | jespada quits (~jespada@90.254.247.46) (Ping timeout: 258 seconds) |
| 06:08:20 | <Axman6> | if they're too small, that'll be fine. if they're too big, then that "(\(p:ps)" will fail and you'll get an exception |
| 06:09:03 | → | jespada joins (~jespada@90.254.247.46) |
| 06:10:16 | <Axman6> | you could put in a case statement in there which checks if the list's empty, and outputs Pixel8 0 0 0 |
| 06:11:51 | <Cajun> | i would rather get an exception yelling at me than false hopes raysL |
| 06:12:01 | <Cajun> | oh yeah no emotes lol |
| 06:12:08 | × | zmt00 quits (~zmt00@user/zmt00) (Ping timeout: 258 seconds) |
| 06:12:45 | <Cajun> | so `generateFoldImage` gives type `([Pixel], Image Pixel)` which is great, so what do i do with that `Image Pixel` ? |
| 06:13:38 | <Axman6> | whatever you want? |
| 06:13:41 | <Axman6> | save it to disk? |
| 06:13:51 | <Cajun> | alright, ima see if this works, thanks! |
| 06:14:21 | <Axman6> | writePng looks like a good place to start |
| 06:15:48 | × | willbush quits (~user@47.183.200.14) (Remote host closed the connection) |
| 06:16:07 | <Cajun> | problem being, you defined `data Pixel` but that means i need an instance of PngSavable for it |
| 06:17:42 | <Axman6> | like I said a few times, use Pixel8 from JuicyPixels |
| 06:18:21 | → | slavaqq joins (~slavaqq@sdmail.sdserver.cz) |
| 06:22:12 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 245 seconds) |
| 06:22:15 | <Cajun> | now im really confused. `toPixel` doesnt exist for Pixel8, i dont want to use the custom defined thing because it doesnt play well with juicypixels, and that code you gave runs into both of those issues |
| 06:22:31 | <Cajun> | also, the splitOn makes a mess of the strings |
| 06:22:34 | <Axman6> | write it |
| 06:22:49 | <Cajun> | i tried and im quite confused how, considering Pixel8 is a type synonym for word8 |
| 06:23:15 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 258 seconds) |
| 06:23:19 | <Axman6> | noit's not, it's identical to what I defined before: https://hackage.haskell.org/package/JuicyPixels-3.3.5/docs/Codec-Picture.html#t:PixelRGB8 |
| 06:23:26 | <Axman6> | uh, ignore that |
| 06:23:31 | <Cajun> | that pixelrgb8 not pixel8 |
| 06:23:55 | <Axman6> | right, you have Word8's, just stick them into the PixelRGB8 constructor |
| 06:24:00 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 06:24:11 | <Cajun> | alright this makes more sense. i was seriously confused when you were saying pixel8 instead of pixelrgb8 |
| 06:24:12 | → | fendor joins (~fendor@178.115.49.9.wireless.dyn.drei.com) |
| 06:24:14 | <Cajun> | it compiles now |
| 06:24:36 | <Axman6> | yeah sorry, I forgot those had different names |
| 06:25:26 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 06:25:46 | × | xff0x_ quits (~xff0x@2001:1a81:52cf:a900:d9f9:1622:609d:b2ef) (Ping timeout: 240 seconds) |
| 06:25:52 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 250 seconds) |
| 06:26:40 | Lord_of_Life_ | is now known as Lord_of_Life |
| 06:26:44 | <Cajun> | so yeah issue with the parsing. the `splitOn` doesnt play well with list-like strings like jle` showed earlier |
| 06:26:45 | <Cajun> | > splitOn "," . drop 1 . init $ "[(233,173,20), (200, 10, 155)]" |
| 06:26:46 | <lambdabot> | ["(233","173","20)"," (200"," 10"," 155)"] |
| 06:27:36 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Client Quit) |
| 06:27:43 | → | xff0x_ joins (~xff0x@2001:1a81:52e3:2500:9c72:9058:eb7a:ca08) |
| 06:27:58 | <Axman6> | oh, that's a great point... |
| 06:28:19 | <Axman6> | I forgot that tuples also have ,'s XD |
| 06:28:20 | × | juhp quits (~juhp@128.106.188.220) (Quit: juhp) |
| 06:31:08 | → | chele joins (~chele@user/chele) |
| 06:33:00 | <Cajun> | > endBy ", " . drop 1 . init $ "[(233,173,20), (200, 10, 155)]" |
| 06:33:01 | <lambdabot> | ["(233,173,20)","(200","10","155)"] |
| 06:33:05 | → | timexdd joins (~timexdd@202.14.120.238) |
| 06:34:11 | <Cajun> | i have no idea if the file has spaces |
| 06:34:11 | → | juhp joins (~juhp@128.106.188.220) |
| 06:34:48 | <Cajun> | there are, which makes this harder |
| 06:34:55 | <Axman6> | might be time to start using parsers... |
| 06:35:07 | <Cajun> | so much for nice memory usage |
| 06:37:01 | → | kenran joins (~kenran@b2b-37-24-119-190.unitymedia.biz) |
| 06:37:18 | <Axman6> | eh? why do you think that won't let you have decent memory usage? |
| 06:38:01 | <Cajun> | thinking it would have some big overhead |
| 06:38:10 | <Axman6> | you should think again |
| 06:38:10 | × | timexdd quits (~timexdd@202.14.120.238) (Quit: Connection closed) |
| 06:38:31 | <Axman6> | attoparsec isn't named after a very small unit of measure for nothing |
| 06:40:17 | <Cajun> | i only know so much about parsers. the textbook i read touched on a homemade variety, but i havent touched on them much more |
| 06:41:26 | × | markpythonicbitc quits (~markpytho@2601:647:5a00:35:298a:b52c:58df:cdd4) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 06:41:42 | <Cajun> | hm, attoparsec doesnt seem to be useful for Strings, only ByteStrings |
| 06:44:44 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:113:1bce:1dde:b94a) |
| 06:50:02 | → | m4m41 joins (~goober@49.207.205.58) |
| 06:51:30 | → | burnsidesLlama joins (~burnsides@client-8-91.eduroam.oxuni.org.uk) |
| 06:51:35 | × | burnsidesLlama quits (~burnsides@client-8-91.eduroam.oxuni.org.uk) (Remote host closed the connection) |
| 06:52:01 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 06:53:12 | → | burnside_ joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 06:53:14 | × | burnside_ quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer) |
| 06:53:14 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer) |
| 06:53:36 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 06:54:05 | → | burnside_ joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 06:54:05 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer) |
| 06:55:05 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 06:55:06 | × | burnside_ quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer) |
| 06:55:40 | → | burnside_ joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 06:55:41 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer) |
| 06:55:45 | <Axman6> | yes, you really want to be doing this using ByteStrings, String is absolutely terrible |
| 06:56:54 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 06:56:55 | × | burnside_ quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer) |
| 06:58:08 | × | m4m41 quits (~goober@49.207.205.58) (Quit: Leaving) |
| 06:59:43 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 07:00:43 | <Cajun> | though i thought we wanted lazy file reading. `Data.ByteString.readFile` is strict |
| 07:02:42 | × | oxide quits (~lambda@user/oxide) (Ping timeout: 250 seconds) |
| 07:03:49 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 07:04:47 | <Axman6> | right, you use lazy bytestrings |
| 07:05:44 | <Cajun> | ah yeah forgot those existed |
| 07:07:08 | <Cajun> | ill have to leave making the parsers for another day, its already 2am lol |
| 07:07:24 | <Cajun> | thanks for the help! |
| 07:07:26 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection) |
| 07:07:35 | × | Cajun quits (~Cajun@user/cajun) (Quit: Client closed) |
| 07:08:18 | → | Cajun joins (~Cajun@user/cajun) |
| 07:08:27 | → | michalz joins (~michalz@185.246.204.62) |
| 07:09:25 | → | oxide joins (~lambda@user/oxide) |
| 07:09:29 | <jle`> | Cajun: yeah, i think overall you can just do map (read . filter isChar) . splitOn "," -- and then you can use `Image PixelRGB8` |
| 07:10:00 | <jle`> | Cajun: the way PixelRGB8 works is that it expects the internal vector to be a list of Word8's, where each group of 3 represents a 3-color-channel pixel |
| 07:10:37 | <jle`> | so you can just do stringToImg :: String -> Image PixelRGB8; stringToImg = Image 100 100 . Vector.fromList . map (read . filter isDigit) . splitOn "," |
| 07:11:26 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 07:11:37 | <jle`> | note that internally, in the JuicyPixels library, an image of PixelRGB8's doesn't actually contain any PixelRGB8. it contains a "continguous memory" vector of each component |
| 07:12:16 | <jle`> | PixelRGB8 itself is merely a "view"/abstraction over the internal representation. and so ideally you never access the bytes directly, you ask for pixelrgb8's, and juicypixels aggregates them and gives them to you |
| 07:13:14 | <jle`> | so using the Image constructor is "unsafe" in a way and is pretty low-level, because if you don't have the bytes in exactly the right order and orientation it will fail. but luckily in your case, it happens to magically line up |
| 07:14:10 | × | wolfshappen_ quits (~waff@irc.furworks.de) (Ping timeout: 258 seconds) |
| 07:14:57 | × | endlesseditions quits (~endlessed@135.129.112.36) (Quit: Textual IRC Client: www.textualapp.com) |
| 07:15:26 | → | Cajun85 joins (~Cajun@user/cajun) |
| 07:15:34 | <Cajun85> | random disconnects are a pain |
| 07:15:55 | → | epolanski joins (uid312403@id-312403.brockwell.irccloud.com) |
| 07:16:17 | × | anandprabhu_ quits (~anandprab@86.106.121.228) (Quit: Leaving) |
| 07:16:23 | <jle`> | Cajun85: ah heh, i figured you did sleep. but i sent a few messages about five minutes ago if you're interested still |
| 07:16:47 | <Cajun85> | i can see them, its just disconnecting for a split second lol |
| 07:17:12 | → | Shires joins (~Shires@user/shires) |
| 07:18:58 | × | Cajun quits (~Cajun@user/cajun) (Ping timeout: 246 seconds) |
| 07:19:34 | <Cajun85> | it surely did something, though its definitely not 100 by 100 |
| 07:19:49 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 07:19:58 | <Cajun85> | idk how big it is, so ill just keep scaling up until it errors |
| 07:21:03 | → | _ht joins (~quassel@82-169-194-8.biz.kpn.net) |
| 07:21:32 | × | tommd quits (~tommd@cpe-76-179-204-251.maine.res.rr.com) (Remote host closed the connection) |
| 07:23:32 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 07:25:30 | <jle`> | Cajun85: ah yeah, that was just a placeholder :) |
| 07:26:04 | <jle`> | if you're guessing and checking, one thinkg you can do is to count the number of items and see what the factors are |
| 07:26:16 | <jle`> | length . splitOn "," |
| 07:26:23 | <jle`> | er, and divide that by three :) |
| 07:27:07 | <jle`> | Cajun85: but yeah, important to remember that the only reason this scheme works is because of a big coincidence in that the way your data is encoded happens to be exactly the internal representation juicypixels uses for images (if you flatten the tuples out). so, a happy coincidence |
| 07:27:26 | <jle`> | *for 3-channel color images |
| 07:27:36 | <Cajun85> | very interesting, i didnt realize that. would this also work for 4 channel RGBA? |
| 07:27:37 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 07:27:52 | <Cajun85> | if it were arity 4 tuples instead |
| 07:28:00 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 07:28:09 | <maerwald[m]> | Anyone running stack on FreeBSD? |
| 07:28:35 | <Axman6> | I tried, but it doesn't work on 13.0 :'( |
| 07:29:23 | <maerwald[m]> | I'm building it on 12.2 |
| 07:29:25 | × | aman quits (~aman@user/aman) (Quit: aman) |
| 07:29:33 | <jle`> | Cajun85: it looks like from https://hackage.haskell.org/package/JuicyPixels-3.3.5/docs/src/Codec.Picture.Types.html#line-1753, PixelRGBA8 expects r, g, b, then alpha channel bytes |
| 07:29:36 | <Axman6> | can't you grab it from pkg? |
| 07:29:40 | <jle`> | so it would work if you did Image PixelRGBA8 |
| 07:29:52 | <jle`> | but again, this isn't really a robust way of doing this heh |
| 07:30:09 | <maerwald[m]> | Axman6: i don't use FreeBSD. I'm trying to run the integration tests on it and build binaries |
| 07:30:15 | <jle`> | so an ImageRGBA8 would, in its internal representation, be [r1,g1,b1,a1,r2,g2,b2,a2,...] etc. |
| 07:30:58 | <jle`> | but juicypixels is designed around not having to deal with the internal rep. just taking advantage of a happy coincidence here :) |
| 07:32:01 | → | kuribas joins (~user@ptr-25vy0i8khwnki6rybr8.18120a2.ip6.access.telenet.be) |
| 07:33:03 | <maerwald[m]> | Axman6: so what doesn't work on 13? |
| 07:33:23 | <Axman6> | stack is liked against something that has a newer version on 13 |
| 07:33:48 | <maerwald[m]> | Ah so you mean upstream binaries don't work |
| 07:34:34 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 07:34:42 | × | oxide quits (~lambda@user/oxide) (Ping timeout: 245 seconds) |
| 07:42:35 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 07:44:43 | → | aman joins (~aman@user/aman) |
| 07:46:52 | → | pe200012 joins (~pe200012@113.105.10.33) |
| 07:47:04 | × | pe200012_ quits (~pe200012@113.105.10.33) (Ping timeout: 272 seconds) |
| 07:47:09 | <Axman6> | yeah |
| 07:47:14 | <Axman6> | I think ghc fails to run too |
| 07:47:30 | <maerwald[m]> | do you have the freebsd 12 compat pkg? |
| 07:47:43 | <Axman6> | no |
| 07:47:52 | <maerwald[m]> | try that |
| 07:49:04 | → | lavaman joins (~lavaman@98.38.249.169) |
| 07:49:08 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 07:49:33 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 276 seconds) |
| 07:49:40 | → | lavaman joins (~lavaman@98.38.249.169) |
| 07:50:58 | → | slavaqq82 joins (~slavaqq@sdmail.sdserver.cz) |
| 07:51:52 | × | slavaqq quits (~slavaqq@sdmail.sdserver.cz) (Ping timeout: 246 seconds) |
| 07:54:33 | × | kenran quits (~kenran@b2b-37-24-119-190.unitymedia.biz) (Quit: WeeChat info:version) |
| 07:55:51 | → | neceve joins (~quassel@2a02:c7f:607e:d600:f762:20dd:304e:4b1f) |
| 07:57:30 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
| 07:58:09 | → | vysn joins (~vysn@user/vysn) |
| 08:00:09 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 08:05:55 | → | hendursa1 joins (~weechat@user/hendursaga) |
| 08:08:45 | × | hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 244 seconds) |
| 08:17:27 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 08:17:28 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 08:17:31 | allbery_b | is now known as geekosaur |
| 08:20:25 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 08:22:37 | <Axman6> | Do we have any nice ways to write streams of bits? Looking at https://blog.tempus-ex.com/hello-video-codec/ and wanting a BitstreamWriter |
| 08:24:46 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds) |
| 08:27:22 | × | Maxdamantus quits (~Maxdamant@user/maxdamantus) (Ping timeout: 240 seconds) |
| 08:28:16 | × | slavaqq82 quits (~slavaqq@sdmail.sdserver.cz) (Ping timeout: 246 seconds) |
| 08:30:03 | <[exa]> | Axman6: you mean "huge amount of stuff that isn't aligned to bytes" ? |
| 08:30:14 | <Axman6> | yeah I guess |
| 08:30:52 | × | hnOsmium0001 quits (uid453710@id-453710.stonehaven.irccloud.com) (Quit: Connection closed for inactivity) |
| 08:31:06 | <Axman6> | huge isn't a necessaty but the rest, yes |
| 08:34:48 | <[exa]> | like, if you don't need total top performance, you might be good with wrapping a ByteString builder or something |
| 08:36:04 | Cajun85 | is now known as Cajun |
| 08:36:37 | <[exa]> | data ByteBuilder = {buffer :: ByteString, currentByte::Word8, nextBit::Word8 } |
| 08:37:05 | × | Cajun quits (~Cajun@user/cajun) (Quit: Client closed) |
| 08:38:34 | → | drd joins (~drd@93-39-151-19.ip76.fastwebnet.it) |
| 08:43:30 | → | gzj joins (~GZJ0X@192.243.120.171.16clouds.com) |
| 08:44:19 | × | azeem quits (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) (Ping timeout: 258 seconds) |
| 08:44:55 | → | lavaman joins (~lavaman@98.38.249.169) |
| 08:45:58 | → | azeem joins (~azeem@176.201.8.137) |
| 08:47:09 | × | michalz quits (~michalz@185.246.204.62) (Read error: No route to host) |
| 08:47:37 | → | tengu12 joins (~tengu12@cpe-70-121-244-14.neb.res.rr.com) |
| 08:48:09 | × | gzj quits (~GZJ0X@192.243.120.171.16clouds.com) (Ping timeout: 258 seconds) |
| 08:49:17 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds) |
| 08:56:06 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 272 seconds) |
| 08:57:21 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 258 seconds) |
| 09:00:03 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 09:00:34 | → | azeem joins (~azeem@176.201.8.137) |
| 09:03:12 | × | jneira_ quits (~jneira_@28.red-80-28-169.staticip.rima-tde.net) (Quit: Connection closed) |
| 09:03:30 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 09:05:12 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 256 seconds) |
| 09:07:09 | <tomsmeding> | presumably with another integer indicating the number of bits in nextBit :) |
| 09:07:47 | → | mei joins (~mei@user/mei) |
| 09:07:52 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 09:09:16 | → | agua_pesada joins (~agua_pesa@2804:14c:8793:8e2f:48b4:3d09:2f3b:552b) |
| 09:09:36 | → | azeem joins (~azeem@176.201.8.137) |
| 09:13:24 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 276 seconds) |
| 09:14:16 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 256 seconds) |
| 09:14:26 | <[exa]> | tomsmeding: better move the nextBit with << directly than have a counter that you need to transform with << everytime |
| 09:14:33 | <maerwald[m]> | Sounds like `SerialT m (Array Word8)` |
| 09:15:22 | <[exa]> | that can do bits? |
| 09:15:47 | <maerwald[m]> | hmm |
| 09:15:50 | <tomsmeding> | [exa]: yeah sure, but with your current representation how are you going to distinguish between writing 0b1 and writing 0b10 |
| 09:16:22 | <tomsmeding> | (or the 1 and 0 the other way round depending on your favourite endianness :p ) |
| 09:16:28 | <[exa]> | currentBit = currentBit | nextBit ? |
| 09:16:42 | <[exa]> | (and nextBit <<= 1, sorry for C notation) |
| 09:17:00 | <tomsmeding> | oh wait, 0 <= nextBit < 8 ? |
| 09:17:12 | <[exa]> | nextBit is a power of 2 |
| 09:17:23 | <tomsmeding> | aaaaaah yes that makes sense, ignore what I said |
| 09:17:27 | <[exa]> | literally the next bit that would be added if you.. ok |
| 09:17:31 | <tomsmeding> | I mistook the meaning of your fields :p |
| 09:17:40 | <maerwald[m]> | I think you can transform it into a `SerialT m Word8`, but that would be slow, because the event loop is then over every bit. |
| 09:17:50 | <[exa]> | I originally wanted to have nextBitPos :: Word3 but alas, no Word3. |
| 09:17:51 | <[exa]> | :( |
| 09:18:26 | tomsmeding | wonders if (bit * mask) is faster or slower than (bit << index) |
| 09:19:02 | <[exa]> | maerwald[m]: if you get the data bit by bit, you're unlikely to improve the speed much...otoh for block data you'd need word shifting anyway |
| 09:19:50 | <[exa]> | tomsmeding: << and & may eat less energy and take less cycles than * |
| 09:20:08 | <[exa]> | but I was over-optimizing for sure, this won't be ever visible with haskell around :D |
| 09:20:22 | <tomsmeding> | wanting the << version means that you want the Word3 version |
| 09:20:37 | <tomsmeding> | yes lol |
| 09:20:46 | → | azeem joins (~azeem@176.201.8.137) |
| 09:21:09 | <[exa]> | I like how I still nerdrage on such tiny details, feels like I'm 15 again. :D |
| 09:21:57 | × | shriekingnoise quits (~shrieking@186.137.144.80) (Quit: Quit) |
| 09:22:14 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 09:23:03 | <tomsmeding> | an important reason why premature micro-optimisation needed to be called evil is that programmers like to do it :p |
| 09:23:54 | <Rembane> | But it's so fun! |
| 09:24:25 | <tomsmeding> | yes |
| 09:25:07 | <tomsmeding> | in that vein: probably better to have {ByteString, Word64, Word6} |
| 09:25:42 | <[exa]> | that is the way. |
| 09:26:05 | <[exa]> | you meant Word64String right. |
| 09:26:28 | <tomsmeding> | lol yes |
| 09:26:39 | <tomsmeding> | (UnboxedVector Word64) possibly |
| 09:27:14 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 09:29:00 | × | xff0x_ quits (~xff0x@2001:1a81:52e3:2500:9c72:9058:eb7a:ca08) (Ping timeout: 256 seconds) |
| 09:29:57 | → | xff0x_ joins (~xff0x@2001:1a81:52e3:2500:4853:8255:fc4e:2378) |
| 09:30:26 | <[exa]> | totally forgot about the !'s |
| 09:31:17 | → | Maxdamantus joins (~Maxdamant@user/maxdamantus) |
| 09:31:19 | × | mei quits (~mei@user/mei) (Read error: Connection reset by peer) |
| 09:31:21 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 09:32:37 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 258 seconds) |
| 09:33:03 | <tomsmeding> | ! |
| 09:35:40 | × | mcglk_ quits (~mcglk@131.191.49.120) (Read error: Connection reset by peer) |
| 09:37:19 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 09:42:40 | → | slavaqq joins (~slavaqq@sdmail.sdserver.cz) |
| 09:43:19 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 09:48:22 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:113:1bce:1dde:b94a) (Ping timeout: 268 seconds) |
| 09:53:40 | → | burnside_ joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 09:53:40 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer) |
| 09:53:48 | × | derelict quits (~derelict@user/derelict) (Quit: WeeChat 3.2) |
| 09:55:36 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 250 seconds) |
| 09:58:26 | → | peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) |
| 09:59:27 | × | xff0x_ quits (~xff0x@2001:1a81:52e3:2500:4853:8255:fc4e:2378) (Ping timeout: 258 seconds) |
| 10:00:10 | → | xff0x_ joins (~xff0x@2001:1a81:52e3:2500:1069:a9de:7caa:cf07) |
| 10:00:33 | → | azeem joins (~azeem@176.201.8.137) |
| 10:04:31 | → | pe200012_ joins (~pe200012@113.105.10.33) |
| 10:04:42 | × | pe200012 quits (~pe200012@113.105.10.33) (Ping timeout: 256 seconds) |
| 10:05:58 | → | Gurkenglas joins (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) |
| 10:08:44 | → | __monty__ joins (~toonn@user/toonn) |
| 10:14:53 | × | slavaqq quits (~slavaqq@sdmail.sdserver.cz) (Quit: Client closed) |
| 10:16:19 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 258 seconds) |
| 10:17:56 | × | jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Read error: Connection reset by peer) |
| 10:18:16 | → | jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) |
| 10:19:30 | → | elf_fortrez joins (~elf_fortr@adsl-72-50-4-118.prtc.net) |
| 10:20:59 | → | azeem joins (~azeem@176.201.8.137) |
| 10:21:51 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 10:23:08 | × | paddymahoney quits (~paddymaho@cpe9050ca207f83-cm9050ca207f80.cpe.net.cable.rogers.com) (Remote host closed the connection) |
| 10:24:51 | → | derelict joins (~derelict@user/derelict) |
| 10:25:52 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 10:26:17 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds) |
| 10:28:36 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:460a:4755:73b5:e6f5) |
| 10:39:19 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 258 seconds) |
| 10:43:23 | → | azeem joins (~azeem@176.201.8.137) |
| 10:48:54 | → | enoq joins (~enoq@194-208-179-35.lampert.tv) |
| 10:51:01 | <kuribas> | what are your ideas on units, or similar packages? Are they worth it, or is it better to just use Double everywhere (with some type synonyms for clarity)? |
| 10:52:01 | × | HotblackDesiato quits (~HotblackD@gateway/tor-sasl/hotblackdesiato) (Ping timeout: 244 seconds) |
| 10:53:07 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 268 seconds) |
| 10:53:17 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 10:57:43 | <kuribas> | wasn't there a ship that sank because they mixed units? |
| 11:00:14 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 11:00:17 | → | hsek[m] joins (~hsekmatri@2001:470:69fc:105::d18f) |
| 11:04:36 | → | lavaman joins (~lavaman@98.38.249.169) |
| 11:04:54 | × | tengu12 quits (~tengu12@cpe-70-121-244-14.neb.res.rr.com) (Quit: Client closed) |
| 11:07:07 | × | burnside_ quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection) |
| 11:07:35 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 11:08:33 | → | AlexNoo_ joins (~AlexNoo@178.34.160.135) |
| 11:08:34 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 11:08:52 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 245 seconds) |
| 11:09:19 | → | Vajb joins (~Vajb@85-76-2-199-nat.elisa-mobile.fi) |
| 11:09:33 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:460a:4755:73b5:e6f5) (Quit: WeeChat 2.8) |
| 11:11:08 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 258 seconds) |
| 11:11:34 | × | Alex_test quits (~al_test@94.233.240.129) (Ping timeout: 272 seconds) |
| 11:11:34 | × | AlexZenon quits (~alzenon@94.233.240.129) (Ping timeout: 272 seconds) |
| 11:11:35 | → | Akronymus joins (~Akronymus@85.31.8.181) |
| 11:11:47 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 245 seconds) |
| 11:12:14 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 11:12:16 | <Akronymus> | Haskell is a pretty cool language. |
| 11:12:16 | × | AlexNoo quits (~AlexNoo@94.233.240.129) (Ping timeout: 272 seconds) |
| 11:12:33 | <Akronymus> | Altough, not sure if I am ready yet. |
| 11:12:40 | × | ablutor quits (~quassel@wasscher.com) (Quit: going for vitamine d) |
| 11:13:12 | <kuribas> | Akronymus: ready for what? |
| 11:13:18 | <Akronymus> | For haskell. |
| 11:13:24 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 11:13:32 | → | ablutor joins (~quassel@wasscher.com) |
| 11:13:42 | <kuribas> | Just try it? You'll never know everything anyway... |
| 11:13:44 | <Akronymus> | So far, only dabbled in f# a bit, and quite frankly, haskell seems a bit scary. |
| 11:14:41 | <kuribas> | Akronymus: haskell is a big language, but you don't need to know everything. |
| 11:14:48 | <Akronymus> | Yeah I get that. |
| 11:15:13 | <kuribas> | If you understand monad transformers, you'll be able to tackle most code. |
| 11:15:43 | <Akronymus> | And there is the big m already. (I think I understand them somewhat at least though) |
| 11:15:43 | × | Vajb quits (~Vajb@85-76-2-199-nat.elisa-mobile.fi) (Read error: Connection reset by peer) |
| 11:15:51 | → | Vajb joins (~Vajb@n2bovg6licdnldblt-2.v6.elisa-mobile.fi) |
| 11:16:01 | <Akronymus> | Monads aren't that bad. |
| 11:16:04 | <kuribas> | Akronymus: it's more important to understand the concepts behind it, and the idioms. |
| 11:16:06 | → | Alex_test joins (~al_test@178.34.160.135) |
| 11:16:08 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 252 seconds) |
| 11:16:14 | → | AlexZenon joins (~alzenon@178.34.160.135) |
| 11:17:35 | <kuribas> | Like: how to separate effects in your program, understanding the state, leveraging combinators to make small languages that solve your problem in a declarative way. |
| 11:18:05 | <kuribas> | I think most people miss the last part, then get disillusioned because they program haskell as if it's java. |
| 11:18:06 | <Akronymus> | I did most of that in f# already. |
| 11:18:20 | <kuribas> | Akronymus: in that case, you're ready for haskell :) |
| 11:18:25 | <Akronymus> | Just, haskell goes so much further with HKT and stuff. |
| 11:18:58 | <kuribas> | HKT are overrated. |
| 11:19:12 | <Akronymus> | And i'll definitely miss the type inference. |
| 11:19:40 | <kuribas> | I mean the sofisticated stuff, basic HKT are ok. |
| 11:19:44 | <maerwald[m]> | Maybe you want to look into F*, which can compile to F# |
| 11:20:03 | <kuribas> | maerwald: F* and haskell have different usecases... |
| 11:20:05 | <Akronymus> | Yeah, you can go quite crazy with types in haskell. |
| 11:20:18 | <maerwald[m]> | kuribas: Haskell has no use case |
| 11:20:35 | <kuribas> | maerwald[m]: go away... |
| 11:20:48 | <maerwald[m]> | F* was designed with a use case in mind, Haskell was an experiment with open ended result |
| 11:21:26 | <maerwald[m]> | So if at all, it's general purpose |
| 11:22:11 | <Akronymus> | Even if it is just learning to be a better programmer, haskell has a use. |
| 11:22:23 | <Akronymus> | And pushing other languages features forward. |
| 11:22:41 | <maerwald[m]> | I didn't say it doesn't, kuribas just misunderstood my statement |
| 11:23:03 | <kuribas> | languages like f# or ocaml allow you to code like it's java or C# |
| 11:23:15 | <kuribas> | in haskell you are forced to do it the functional way. |
| 11:23:20 | <kuribas> | or make a big mess. |
| 11:23:32 | <Akronymus> | That alone is already a use case. |
| 11:23:36 | <Akronymus> | Being limited to functional |
| 11:23:59 | <Akronymus> | F# makes it easy to fall back to imperative/OOP code |
| 11:24:09 | <maerwald[m]> | kuribas: https://hackage.haskell.org/package/xeno is this functional? :) |
| 11:24:12 | <Akronymus> | Which, while useful, also hurts learning |
| 11:25:06 | <maerwald[m]> | apparently, it's the fastest xml parser there is (or so ppl say) even beating several C libraries |
| 11:25:14 | <maerwald[m]> | But when you look at the code, hmm |
| 11:25:32 | <kuribas> | maerwald[m]: don't use that, use my package :) https://hackage.haskell.org/package/hexpat-streamparser |
| 11:25:43 | <maerwald[m]> | kuribas: is it faster? |
| 11:25:47 | <kuribas> | maerwald[m]: it's fast by cheating |
| 11:26:00 | <kuribas> | maerwald[m]: no, but it's standards compliant... |
| 11:26:31 | <kuribas> | and should be efficient enough for most cases... |
| 11:26:33 | <Akronymus> | Does it interface with as functional? |
| 11:26:37 | <maerwald[m]> | well, the reason I brought it up is... there are many cases of non-idiomatic haskell code |
| 11:26:42 | <maerwald[m]> | that somewhat have their place |
| 11:26:42 | <kuribas> | Akronymus: yes it does. |
| 11:26:49 | <Akronymus> | Mostly in libraries though maerwald |
| 11:26:59 | <maerwald[m]> | Are you sure? |
| 11:27:04 | <Akronymus> | kuribas than for most users it is a functional lib |
| 11:27:09 | <Akronymus> | then |
| 11:27:36 | <kuribas> | Akronymus: you build your parser declaratively. |
| 11:27:57 | <kuribas> | parseXMLByteString :: EventListParser e a -> ParseOptions Text Text -> ByteString -> Either (EventParseError e, Maybe XMLParseLocation) a |
| 11:28:07 | <Akronymus> | Like fparsec? |
| 11:28:17 | <Akronymus> | (I know it is a derivative of the parsec from haskell) |
| 11:28:18 | <kuribas> | It's a pure function, though it uses an imperative library under the hood (expat). |
| 11:28:20 | <maerwald[m]> | xeno is the opposite of declarative... so my take is: haskell doesn't force you to be declarative. It just gives you the option |
| 11:28:40 | <kuribas> | Akronymus: yeah, this is structured like parsec. |
| 11:28:43 | <Akronymus> | It HEAVILY encourages you to write idiomatic code. |
| 11:28:45 | <maerwald[m]> | That's why I object that haskell has a use case |
| 11:29:46 | <kuribas> | Akronymus: my library builds on top of the parser-combinators library, which is modelled after parsec. |
| 11:31:56 | <kuribas> | maerwald[m]: What I mean is that the use case people want to use haskell for, is actually not a usecase for haskell. That is, writing programs where you prove everything in the typesystem. |
| 11:32:13 | <maerwald[m]> | I agree |
| 11:32:33 | <maerwald[m]> | But we have forces that want to drive Haskell into that direction |
| 11:33:22 | × | drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 240 seconds) |
| 11:34:22 | → | MoC joins (~moc@user/moc) |
| 11:34:54 | <hpc> | to be fair, the tools of writing proofs could be useful for expressing properties of more useful code |
| 11:35:26 | <maerwald[m]> | I don't understand that sentence |
| 11:35:33 | <hpc> | idris is turing-complete and nobody complains about it being a bad proof assistant |
| 11:36:56 | <juri_> | kuribas: I'm 9 years a haskeller, both professionally, and for fun, and i still don't understand monad transformers. :D |
| 11:37:38 | <maerwald[m]> | Maybe because there's not much to understand |
| 11:38:01 | × | fendor quits (~fendor@178.115.49.9.wireless.dyn.drei.com) (Remote host closed the connection) |
| 11:38:50 | <maerwald[m]> | well, except for abominations like MonadBaseControl |
| 11:39:08 | → | fendor joins (~fendor@178.115.49.9.wireless.dyn.drei.com) |
| 11:39:39 | × | fendor quits (~fendor@178.115.49.9.wireless.dyn.drei.com) (Remote host closed the connection) |
| 11:43:03 | <maerwald[m]> | I hate to say it, but maybe `RIO` isn't so far from the truth. Although I prefer an ExceptT/Excepts at the outside |
| 11:43:11 | → | fendor joins (~fendor@178.115.49.9.wireless.dyn.drei.com) |
| 11:44:28 | <kuribas> | juri_: I use monad transformers in most of my projects. It means less boilerplate and plumbing. |
| 11:44:35 | <maerwald[m]> | Never understood Snoymans argument against mixing ExceptT with IO |
| 11:45:18 | × | fendor quits (~fendor@178.115.49.9.wireless.dyn.drei.com) (Read error: Connection reset by peer) |
| 11:45:19 | <maerwald[m]> | yes, ExceptT with IO means you may need to catch on two different levels. Isn't that obvious to everyone? |
| 11:45:36 | <Rembane> | Is that argument that he prefers to only have one kind of going-wrong instead of both Left and exceptions? |
| 11:45:42 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:460a:4755:73b5:e6f5) |
| 11:45:53 | → | fendor joins (~fendor@178.115.49.9.wireless.dyn.drei.com) |
| 11:46:03 | <maerwald[m]> | I think the argument was that the type lies and you still need to handle IO exceptions yeah |
| 11:46:56 | <maerwald[m]> | but then you could say `IO (Either a b)` lies as well |
| 11:47:07 | <maerwald[m]> | ExceptT is just a glorified inner Either |
| 11:47:13 | <maerwald[m]> | that composes better |
| 11:47:18 | <kuribas> | It makes sense to have two going-wrongs. One if for stuff you expect the program to handle, the other for stuff where intervention of an admin or operations guy is expected. |
| 11:48:34 | <kuribas> | I use Exceptions for the latter. You just catch the exteption, log it somewhere, and abort the operation. |
| 11:48:58 | <maerwald[m]> | in low level libraries, such as filepath/directory etc, of course I wouldn't expect an ExceptT, because there's no way you can tell what error is expected and what isn't |
| 11:49:17 | <Akronymus> | I know I read about some REALLY weirdly named monad before that someone made as a joke, but can't find it anymore. |
| 11:49:25 | <Akronymus> | It was relevant like 3 pages ago |
| 11:50:15 | × | wei2912 quits (~wei2912@112.199.250.21) (Quit: Lost terminal) |
| 11:50:46 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 11:50:57 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 11:51:14 | <Rembane> | Akronymus: Have you seen the Tardis monad? |
| 11:51:25 | <Akronymus> | Nope |
| 11:51:33 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 11:51:34 | <maerwald[m]> | I think the weirdest monad is ContT |
| 11:51:37 | <Akronymus> | But the one I thought of had a 5 word name or something |
| 11:51:58 | <maerwald[m]> | I forget how it works every time |
| 11:52:15 | <maerwald[m]> | learn it again, forget it again |
| 11:52:19 | <Rembane> | maerwald[m]: Yeah, type lie all the time, and we need to handle that too. |
| 11:54:14 | → | futty joins (~futty@c83-252-75-55.bredband.tele2.se) |
| 11:56:17 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 252 seconds) |
| 11:56:40 | <kuribas> | Akronymus: These? |
| 11:56:50 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 11:57:15 | <kuribas> | https://hackage.haskell.org/package/these-1.1.1.1/docs/Data-These.html |
| 11:57:19 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 11:57:47 | <Akronymus> | Nope |
| 11:57:58 | <Akronymus> | It was a really long name made out of multiple words |
| 12:01:31 | × | phma quits (phma@2001:5b0:210d:cf58:911f:3237:b853:e162) (Read error: Connection reset by peer) |
| 12:01:44 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 258 seconds) |
| 12:02:29 | → | phma joins (~phma@2001:5b0:210d:73a8:1482:7584:9a9a:de0a) |
| 12:04:02 | × | pe200012_ quits (~pe200012@113.105.10.33) (Ping timeout: 258 seconds) |
| 12:04:03 | → | pe200012 joins (~pe200012@113.105.10.33) |
| 12:04:57 | <Akronymus> | Sadly gotta go. |
| 12:04:59 | × | Akronymus quits (~Akronymus@85.31.8.181) (Quit: Client closed) |
| 12:06:36 | → | Guest9112 joins (~Guest91@2a02:a212:2180:8d00:cfb7:369e:490f:8f0e) |
| 12:08:35 | → | Neuromancer joins (~Neuromanc@user/neuromancer) |
| 12:10:25 | → | Flow joins (~none@gentoo/developer/flow) |
| 12:12:53 | <maerwald[m]> | oh, I abuse `Excepts` for `These` and then decide later what error is a warning (and encapsulate a value in the error) |
| 12:13:28 | <maerwald[m]> | not sure anyone has written open sum type version of These |
| 12:15:35 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 12:16:29 | → | burnside_ joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 12:16:30 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Read error: Connection reset by peer) |
| 12:18:07 | <hpc> | ContT isn't that bad - just think (pure x) = ($ x), and what you can do to compose those sorts of functions |
| 12:18:29 | <hpc> | it just looks bad because the definitions have a ton of lambdas and data constructor wrapping |
| 12:19:12 | × | Guest9112 quits (~Guest91@2a02:a212:2180:8d00:cfb7:369e:490f:8f0e) (Quit: Client closed) |
| 12:37:06 | × | xff0x_ quits (~xff0x@2001:1a81:52e3:2500:1069:a9de:7caa:cf07) (Remote host closed the connection) |
| 12:37:22 | → | xff0x_ joins (~xff0x@2001:1a81:52e3:2500:8766:3fda:9e97:b8d5) |
| 12:38:05 | <lechner> | Hi, what's everone's favorite command line option parser, please? Thanks! |
| 12:38:06 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 250 seconds) |
| 12:38:29 | <[exa]> | lechner: optparse-applicative |
| 12:38:37 | <maerwald[m]> | haskell or in general? |
| 12:38:55 | <lechner> | here |
| 12:39:01 | <lechner> | [exa]: thanks! |
| 12:39:02 | <maerwald[m]> | here? |
| 12:39:18 | <lechner> | hi my name is dory :0 |
| 12:39:31 | <maerwald[m]> | nice to meet you dory |
| 12:39:42 | <lechner> | i meant in haskell |
| 12:40:04 | <maerwald[m]> | I don't like any of them, really |
| 12:40:18 | → | mikoto-chan joins (~mikoto-ch@ip-193-121-10-50.dsl.scarlet.be) |
| 12:40:21 | <lechner> | and i thought it was early for me |
| 12:40:21 | → | azeem joins (~azeem@176.201.8.137) |
| 12:40:46 | <[exa]> | you know the routine |
| 12:40:52 | <[exa]> | coffee >>= back to work |
| 12:40:58 | <lechner> | maerwald[m]: you only write libraries? |
| 12:41:05 | <maerwald[m]> | no |
| 12:41:26 | <maerwald[m]> | but I like cli stuff to be declarative, optparse-applicative isn't |
| 12:41:43 | <maerwald[m]> | although I use it |
| 12:41:53 | <lechner> | [exa]: finally i understand that operator |
| 12:42:05 | <maerwald[m]> | but don't ask me to come up with something better... I'd probably do TH hacks |
| 12:42:47 | <lechner> | maerwald[m]: isn't all of haskell declarative? |
| 12:42:53 | <maerwald[m]> | no |
| 12:43:45 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 12:44:01 | <maerwald[m]> | I don't see how any language can be declarative, unless it's a DSL |
| 12:44:33 | <maerwald[m]> | but you can stretch the word "declarative" to mean "purely functional", but that isn't what it really means |
| 12:44:34 | × | xff0x_ quits (~xff0x@2001:1a81:52e3:2500:8766:3fda:9e97:b8d5) (Ping timeout: 240 seconds) |
| 12:44:35 | <[exa]> | only pure data is purely declarative |
| 12:44:48 | <[exa]> | json for victory! |
| 12:45:19 | <lechner> | this page may be a good place to enshrine valuable opinions. it says it's out of date, in a remark from 2012! https://wiki.haskell.org/GetOpt |
| 12:46:19 | → | Pickchea joins (~private@user/pickchea) |
| 12:47:11 | <lechner> | is 'procedural' or 'imperative' the opposite of 'declarative'? |
| 12:47:26 | <maerwald[m]> | odd question |
| 12:48:02 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 245 seconds) |
| 12:48:22 | <futty> | Uploaded file: https://uploads.kiwiirc.com/files/bc188da828f4d06043793f35724e5baf/Screenshot_20210806_144733.png |
| 12:48:50 | <[exa]> | futty: many people on IRC won't be able to see that |
| 12:49:00 | <[exa]> | futty: if you can, do a pastebin |
| 12:49:07 | <futty> | I get this error when I try to run the program. I am a bit certain that if I were to define the 0-9 as an aux/helper, I wouldnt get an error. But I want to know why this happens? |
| 12:49:12 | <futty> | alright going to do that |
| 12:49:25 | <maerwald[m]> | futty: you're missing an `x` on the last definitioon |
| 12:49:46 | <futty> | https://pastebin.com/8WXf0tY3 |
| 12:49:49 | <maerwald[m]> | below the `9` |
| 12:50:37 | AlexNoo_ | is now known as AlexNoo |
| 12:50:38 | <futty> | I dont Inderstand, I dont have a `9`, which line is it? |
| 12:50:48 | <[exa]> | just below that |
| 12:51:01 | <[exa]> | line 12 on pastebin, add x |
| 12:51:16 | <maerwald[m]> | yes you have a `9` |
| 12:51:32 | <[exa]> | this way it has no idea that the argument is actually called 'x' |
| 12:52:43 | <lechner> | before the guard |
| 12:52:50 | × | kuribas quits (~user@ptr-25vy0i8khwnki6rybr8.18120a2.ip6.access.telenet.be) (Remote host closed the connection) |
| 12:53:06 | × | Guest5389 quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 12:53:11 | → | mcglk joins (~mcglk@131.191.49.120) |
| 12:53:12 | <[exa]> | yes, the guards come behind the parameter list; you need to specify that you're using 1 parameter there |
| 12:53:22 | → | markpythonicbitc joins (~markpytho@50.228.44.6) |
| 12:53:28 | <[exa]> | futty: btw you might like this: |
| 12:53:31 | <[exa]> | > toEnum (fromEnum '0' + 5) :: Char |
| 12:53:32 | <lambdabot> | '5' |
| 12:53:47 | <lechner> | wow |
| 12:54:17 | <Athas> | The GHC bug I encounter most often is the "PAP object entered" thing when enabling profiling. Is there an architectural explanation for why it is so common? |
| 12:54:51 | [exa] | discovers console-program for option parsing |
| 12:54:52 | <futty> | I got it. I just forgot the x before guards. Thanks for the toEnum. My uni course showed this long list as pattern matching purposes. |
| 12:55:25 | × | hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1) |
| 12:55:25 | → | jgeerds joins (~jgeerds@55d45555.access.ecotel.net) |
| 12:55:32 | <[exa]> | futty: it's got an educative value but we're obsessed with compact code :D |
| 12:55:41 | → | euouae joins (~euouae@user/euouae) |
| 12:55:43 | → | hendursaga joins (~weechat@user/hendursaga) |
| 12:55:47 | → | shriekingnoise joins (~shrieking@186.137.144.80) |
| 12:55:55 | <euouae> | Hello |
| 12:56:00 | × | charukiewicz quits (~quassel@irouteince04.i.subnet.rcn.com) (Ping timeout: 265 seconds) |
| 12:56:12 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 12:56:13 | <lechner> | hi |
| 12:56:16 | <euouae> | It seems that cabal has changed from sandbox model to nix packages |
| 12:56:17 | <futty> | My first encounters with pattern matching and recursion was a nightmare and i failed the exams but now i find it quite intresting. |
| 12:56:29 | <euouae> | did that happen after cabal install 3.2 ? |
| 12:56:53 | <maerwald[m]> | euouae: yes, sandboxes were removed |
| 12:57:11 | <euouae> | I’m noticing that the docs don’t have build / install instructions |
| 12:57:39 | <euouae> | i was told to learn cabal and stack but the docs of 3.4 are incomplete on that section and it seems like a major featur |
| 12:58:01 | → | chris joins (~chris@81.96.113.213) |
| 12:58:05 | chris | is now known as Guest6130 |
| 12:58:17 | <euouae> | Is there some other way I can learn about cabal install 3.4 ? Other than readthedocs |
| 13:01:06 | → | alx741 joins (~alx741@186.178.109.254) |
| 13:01:51 | × | inkbottle[m] quits (~inkbottle@2001:470:69fc:105::2ff5) (Quit: You have been idle for 30+ days) |
| 13:01:53 | × | hjulle[m] quits (~hjullemat@2001:470:69fc:105::1dd) (Quit: You have been idle for 30+ days) |
| 13:02:10 | × | Morrow[m] quits (~morrowmma@2001:470:69fc:105::1d0) (Quit: You have been idle for 30+ days) |
| 13:02:11 | × | Drezil quits (~drezilkif@2001:470:69fc:105::7f8) (Quit: You have been idle for 30+ days) |
| 13:02:12 | × | kosmikus[m] quits (~andresloe@2001:470:69fc:105::95d) (Quit: You have been idle for 30+ days) |
| 13:02:12 | × | Guest4241 quits (~sylveonma@2001:470:69fc:105::2d95) (Quit: You have been idle for 30+ days) |
| 13:02:12 | × | autrim64[m] quits (~autrim64m@2001:470:69fc:105::16a1) (Quit: You have been idle for 30+ days) |
| 13:02:13 | × | jellz[m] quits (~jellzmatr@2001:470:69fc:105::2daa) (Quit: You have been idle for 30+ days) |
| 13:02:18 | × | Guest6130 quits (~chris@81.96.113.213) (Ping timeout: 240 seconds) |
| 13:02:37 | → | drd joins (~drd@93-39-151-19.ip76.fastwebnet.it) |
| 13:02:45 | <euouae> | Maybe I can just ignore cabal for now and focus on stack? Or does the sandbox change affect stack too? |
| 13:03:00 | → | Morrow[m] joins (~morrowmma@2001:470:69fc:105::1d0) |
| 13:03:12 | → | Drezil joins (~drezilkif@2001:470:69fc:105::7f8) |
| 13:03:24 | → | kosmikus[m] joins (~andresloe@2001:470:69fc:105::95d) |
| 13:03:31 | <lechner> | what is your problem with cabal? |
| 13:03:36 | → | autrim64[m] joins (~autrim64m@2001:470:69fc:105::16a1) |
| 13:03:50 | → | Sylveon joins (~sylveonma@2001:470:69fc:105::2d95) |
| 13:04:02 | → | jellz[m] joins (~jellzmatr@2001:470:69fc:105::2daa) |
| 13:04:14 | Sylveon | is now known as Guest4011 |
| 13:04:23 | × | mikoto-chan quits (~mikoto-ch@ip-193-121-10-50.dsl.scarlet.be) (Quit: mikoto-chan) |
| 13:04:32 | ← | Morrow[m] parts (~morrowmma@2001:470:69fc:105::1d0) () |
| 13:04:37 | ← | Drezil parts (~drezilkif@2001:470:69fc:105::7f8) () |
| 13:04:44 | ← | kosmikus[m] parts (~andresloe@2001:470:69fc:105::95d) () |
| 13:04:45 | ← | autrim64[m] parts (~autrim64m@2001:470:69fc:105::16a1) () |
| 13:04:46 | ← | Guest4011 parts (~sylveonma@2001:470:69fc:105::2d95) () |
| 13:04:54 | ← | jellz[m] parts (~jellzmatr@2001:470:69fc:105::2daa) () |
| 13:04:54 | <euouae> | I’m new to the tools and I’m trying to read the docs but the 3.4 docs do not describe build & install instructions (says todo) |
| 13:05:09 | <euouae> | and the 3.2 docs describe an obsolete method (sandboxes) |
| 13:05:24 | <yushyin> | https://cabal.readthedocs.io/en/3.4/cabal-commands.html#cabal-v2-build |
| 13:06:04 | → | machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca) |
| 13:06:07 | <euouae> | Aaah that’s great. Thank you |
| 13:06:58 | <euouae> | https://cabal.readthedocs.io/en/3.4/installing-packages.html#building-and-installing-packages Here’s what I was talking about if anyone is curious |
| 13:08:31 | <euouae> | On 3.4 don’t I just have to say build for v2-build? |
| 13:09:36 | <yushyin> | euouae: yup, with a recent cabal `v2-*' is the default so `build' it is |
| 13:10:09 | <euouae> | Thanks ! |
| 13:11:39 | <yushyin> | euouae: I also often don't understand the structure and outline of the cabal documentation. it needs work. |
| 13:12:28 | <lechner> | Should I leave a note here that section 6 still has a Backpack warning? https://github.com/haskell/cabal/issues/6005#issuecomment-850468676 |
| 13:14:01 | → | slowButPresent joins (~slowButPr@user/slowbutpresent) |
| 13:14:04 | × | jgeerds quits (~jgeerds@55d45555.access.ecotel.net) (Ping timeout: 250 seconds) |
| 13:16:35 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 252 seconds) |
| 13:17:02 | → | xff0x_ joins (~xff0x@2001:1a81:52e3:2500:8766:3fda:9e97:b8d5) |
| 13:17:15 | × | burnside_ quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection) |
| 13:17:26 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 13:17:36 | × | img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in) |
| 13:17:53 | → | img joins (~img@user/img) |
| 13:20:53 | → | vicfred_ joins (~vicfred@user/vicfred) |
| 13:22:58 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 240 seconds) |
| 13:24:00 | × | vicfred quits (~vicfred@user/vicfred) (Ping timeout: 272 seconds) |
| 13:24:32 | → | azeem joins (~azeem@176.201.8.137) |
| 13:25:11 | <yushyin> | or a pull request |
| 13:25:32 | <lechner> | just drop it? |
| 13:27:11 | <yushyin> | if the issue is resolved, yeah why not? |
| 13:27:30 | sandcat | is now known as jess |
| 13:27:53 | <lechner> | okay, i am just new and don't want to look too dumb |
| 13:31:26 | × | futty quits (~futty@c83-252-75-55.bredband.tele2.se) (Ping timeout: 252 seconds) |
| 13:31:32 | <yushyin> | I think phadej is happy for the help and the worst that can happen is that your PR is closed down. |
| 13:33:27 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 245 seconds) |
| 13:33:33 | <Athas> | I have a program that goes into an infinite loop. Profiling shows it happens in a cost centre called "CAF:$dAllocator_r20f3G", with no location information available. How can I debug this? |
| 13:35:46 | × | vicfred_ quits (~vicfred@user/vicfred) (Quit: Leaving) |
| 13:36:24 | → | jneira_ joins (~jneira_@28.red-80-28-169.staticip.rima-tde.net) |
| 13:36:51 | → | oxide joins (~lambda@user/oxide) |
| 13:39:04 | → | charukiewicz joins (~quassel@irouteinc255.i.subnet.rcn.com) |
| 13:45:43 | <lechner> | yushyin: https://github.com/haskell/cabal/pull/7518 |
| 13:47:05 | × | euouae quits (~euouae@user/euouae) (Quit: Client closed) |
| 13:47:09 | → | Pickchea joins (~private@user/pickchea) |
| 13:47:28 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 13:49:00 | → | chris joins (~chris@81.96.113.213) |
| 13:49:04 | chris | is now known as Guest5588 |
| 13:49:57 | → | vicfred joins (~vicfred@user/vicfred) |
| 13:52:25 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 13:53:27 | × | Guest5588 quits (~chris@81.96.113.213) (Ping timeout: 245 seconds) |
| 13:58:44 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 256 seconds) |
| 14:00:43 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 14:01:44 | → | azeem joins (~azeem@176.201.8.137) |
| 14:02:08 | → | amahl joins (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi) |
| 14:02:15 | <janus> | Athas: have you enabled -fprof-auto ? otherwise the cost centres may not be as granular as they could be. afaik https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html#compiler-options-for-profiling |
| 14:02:36 | × | pe200012 quits (~pe200012@113.105.10.33) (Ping timeout: 250 seconds) |
| 14:03:50 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:460a:4755:73b5:e6f5) (Quit: WeeChat 2.8) |
| 14:04:13 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Ping timeout: 244 seconds) |
| 14:04:19 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 14:06:32 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 14:06:55 | × | aman quits (~aman@user/aman) (Quit: aman) |
| 14:07:46 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 240 seconds) |
| 14:14:11 | → | Magnus[m] joins (~magthetch@2001:470:69fc:105::d1a7) |
| 14:15:42 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection) |
| 14:16:11 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 14:17:38 | × | __monty__ quits (~toonn@user/toonn) (Ping timeout: 252 seconds) |
| 14:19:00 | → | __monty__ joins (~toonn@user/toonn) |
| 14:21:00 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 272 seconds) |
| 14:22:05 | <Athas> | janus: turns out it was a typeclass dictionary. I have no idea how that one could be infinitely recursive. I fixed it by refactoring the program to remove the typeclass. |
| 14:23:17 | → | Tuplanolla joins (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) |
| 14:23:53 | <janus> | i can't imagine how instance resolution can be infinite since any program any only has a finite amount of types in play, i'd say? |
| 14:24:30 | <janus> | anyway, it would be decided at compile time, no? |
| 14:26:38 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds) |
| 14:28:43 | <Ollie[m]> | What's the easiest way to attach an attoparsec `Parser` to a network socket? I want to read and parse enough bytes to fulfill my parser. I guess that parser has no way to really inform `network` of how many bytes it needs, so I'm fine with something that gives me back some left over |
| 14:28:50 | <Athas> | It might create a self-referential dictionary, but I also can't see how that can happen... |
| 14:29:24 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 14:33:04 | <c_wraith> | maybe something with UndecidableSuperclasses? |
| 14:33:18 | × | amahl quits (~amahl@dsl-jklbng12-54fbca-64.dhcp.inet.fi) (Ping timeout: 256 seconds) |
| 14:43:07 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 258 seconds) |
| 14:43:14 | → | lbseale joins (~lbseale@user/ep1ctetus) |
| 14:44:10 | → | azeem joins (~azeem@176.201.8.137) |
| 14:49:02 | → | chris joins (~chris@81.96.113.213) |
| 14:49:07 | chris | is now known as Guest7240 |
| 14:50:29 | × | elf_fortrez quits (~elf_fortr@adsl-72-50-4-118.prtc.net) (Quit: Client closed) |
| 14:50:42 | × | jmorris quits (uid433911@id-433911.stonehaven.irccloud.com) (Quit: Connection closed for inactivity) |
| 14:50:56 | → | fendor_ joins (~fendor@77.119.214.156.wireless.dyn.drei.com) |
| 14:51:24 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 276 seconds) |
| 14:51:29 | × | vicfred quits (~vicfred@user/vicfred) (Quit: Leaving) |
| 14:52:00 | → | azeem joins (~azeem@176.201.8.137) |
| 14:53:16 | → | viluon joins (uid453725@id-453725.brockwell.irccloud.com) |
| 14:53:28 | × | fendor quits (~fendor@178.115.49.9.wireless.dyn.drei.com) (Ping timeout: 258 seconds) |
| 14:53:52 | <viluon> | hello, I'd like to compile all Stackage packages with a patched GHC. Is this a good place to ask for guidance? |
| 14:58:09 | <viluon> | I'd like to run the packages' test suites after compiling them |
| 15:00:32 | → | pgib joins (~textual@173.38.117.81) |
| 15:01:53 | <janus> | viluon: nix makes it easy to swap out the compiler ;) |
| 15:02:07 | <janus> | and they have CI to rebuild hackage |
| 15:03:41 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 15:06:04 | <viluon> | janus: interesting, could you please point me to some resources? I'm sceptical about using Nix, but it may be a viable option |
| 15:07:59 | <janus> | viluon: gabriella has some docs. havn't tried them, but always loved all that she did : https://github.com/Gabriel439/haskell-nix |
| 15:12:10 | <janus> | hmm now i don't know if that is their name any more, thought i saw it somewhere. |
| 15:13:02 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 245 seconds) |
| 15:14:28 | <viluon> | janus: thanks for the link, I'm reading it now |
| 15:15:28 | × | enoq quits (~enoq@194-208-179-35.lampert.tv) (Read error: Connection reset by peer) |
| 15:15:28 | → | timex joins (~timex@202.14.120.238) |
| 15:16:06 | → | azeem joins (~azeem@176.201.8.137) |
| 15:16:07 | × | timex quits (~timex@202.14.120.238) (Client Quit) |
| 15:16:08 | → | enoq joins (~enoq@194-208-179-35.lampert.tv) |
| 15:16:58 | → | notzmv joins (~zmv@user/notzmv) |
| 15:17:06 | × | dispater quits (~dispater@user/brprice) (Quit: ZNC 1.8.1 - https://znc.in) |
| 15:17:51 | <absence> | is it possible to implement something like (MonadIO m1, MonadIO m2) => m1 a -> ExceptT e m2 a? |
| 15:18:54 | → | dispater joins (~dispater@user/brprice) |
| 15:20:20 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 15:21:01 | <davean> | of course not |
| 15:21:22 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 268 seconds) |
| 15:21:33 | <Rembane> | absence: Do you need it for something in particular? |
| 15:23:08 | → | zebrag joins (~chris@user/zebrag) |
| 15:24:01 | <absence> | davean: why "of course"? i realise that m1 is not the same as m2, but at the same time m1 "needs" IO, which m2 "has"... |
| 15:24:47 | <davean> | absence: So? I have something you need, can I be you? |
| 15:24:55 | × | dajoer quits (~david@user/gvx) (Quit: leaving) |
| 15:25:32 | <davean> | Its that level of absurdity |
| 15:25:55 | <davean> | I have lungs, you need lungs - what does this mean for us being the same person? |
| 15:26:27 | → | Core8888 joins (~agua_pesa@191.177.175.57) |
| 15:26:37 | <davean> | We also know you have lungs |
| 15:26:52 | <absence> | davean: right, so i guess what i want would have to be expressed in a different way? |
| 15:27:03 | <davean> | You haven't given any indication of what you want |
| 15:27:08 | <geekosaur> | more to the point, m1 would just be IO if that were enough; the fact that it has a MonbadIo constraint means it needs more. what guarantee is there that m2 provides that more? |
| 15:27:12 | × | neceve quits (~quassel@2a02:c7f:607e:d600:f762:20dd:304e:4b1f) (Ping timeout: 258 seconds) |
| 15:28:25 | <absence> | geekosaur: ah, so it's about the "unused" parts of the transformer stacks |
| 15:28:26 | <maerwald[m]> | I want your lungs |
| 15:28:26 | <maerwald[m]> | xD |
| 15:28:47 | <geekosaur> | nor can you "extract" the IO from a MonadIO m => m and use it elsewhere, for the same reason you can't extract the a from an IO a |
| 15:28:55 | <davean> | absence: you've given us no idea how to dissasseble an m1 and look at its parts for example |
| 15:29:02 | <davean> | or to build an m2 for that matter |
| 15:29:05 | <davean> | other than liftIO |
| 15:29:44 | <davean> | Some things allow you to extract the IO, for example ReaderT r IO a does, just runReaderT |
| 15:31:03 | × | agua_pesada quits (~agua_pesa@2804:14c:8793:8e2f:48b4:3d09:2f3b:552b) (Ping timeout: 276 seconds) |
| 15:35:20 | <absence> | hmm, i think i expected mtl style stacks to magically sort that out, but that only works when they're related |
| 15:35:30 | × | rmoe quits (~rmoe@c-71-236-207-44.hsd1.wa.comcast.net) (Ping timeout: 265 seconds) |
| 15:36:27 | <geekosaur> | in general stuff like this works only because you can build a chain of related monadic expressions. otherwise you couldn't for example have conditionals |
| 15:36:36 | <davean> | absence: I mean even if that could work - you haven't given any constraints that give such a knowlege! |
| 15:36:42 | <davean> | absence: ALL you have given is MonadIO |
| 15:37:35 | <davean> | And you didn't say something like "m1 is some abstract monad that is allowed to do up to X things" and then have m2 have said capabilities |
| 15:37:43 | <davean> | you just said "MonadIO" |
| 15:37:50 | <davean> | if you'd said "forall m1" that might be different |
| 15:38:27 | <davean> | Perhaps you were thinking something like (forall m1 . MonadIO m1 => m1 a) -> ExceptT e m2 a? |
| 15:38:42 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 258 seconds) |
| 15:40:06 | <davean> | absence: I want to make the point you didn't say m1 was abstract, you said it was exactly something. So theres really nothing for MTL to sort out |
| 15:40:16 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 15:40:21 | <davean> | the forall case though might leave some sorting to happen, under the right conditions |
| 15:42:38 | <absence> | davean: i knew that my signature as written doesn't work, the compiler already told me that ;) i wanted to explore related ideas, so the forall m1 one looks interesting. thanks! |
| 15:43:49 | × | gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 15:45:14 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds) |
| 15:46:22 | × | charukiewicz quits (~quassel@irouteinc255.i.subnet.rcn.com) (Ping timeout: 258 seconds) |
| 15:46:31 | → | charukiewicz_ joins (~quassel@irouteince04.i.subnet.rcn.com) |
| 15:46:56 | → | zmt00 joins (~zmt00@user/zmt00) |
| 15:48:11 | <janus> | absence: did you see that mtl already has lift for ExceptT? |
| 15:49:36 | → | jeetelongname joins (~jeet@host-89-241-98-229.as13285.net) |
| 15:49:39 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 15:49:57 | → | zebrag joins (~chris@user/zebrag) |
| 15:50:13 | <janus> | you have lift, you have "except" (in transformers for taking an Either to ExceptT). it's hard for me to imagine other functions that put things in ExceptT |
| 15:50:13 | × | MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Read error: Connection reset by peer) |
| 15:50:18 | <janus> | but maybe my imagination is limited :P |
| 15:50:42 | <jeetelongname> | :t (***) |
| 15:50:43 | <lambdabot> | Arrow a => a b c -> a b' c' -> a (b, b') (c, c') |
| 15:52:07 | <janus> | ok , throwError, may need that also if you have an unconditional failure |
| 15:52:30 | × | charukiewicz_ quits (~quassel@irouteince04.i.subnet.rcn.com) (Ping timeout: 258 seconds) |
| 15:52:41 | → | charukiewicz joins (~quassel@irouteinc02.i.subnet.rcn.com) |
| 15:53:27 | → | MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com) |
| 15:53:45 | × | chele quits (~chele@user/chele) (Remote host closed the connection) |
| 15:54:53 | → | pschorf joins (~user@c-73-77-28-188.hsd1.tx.comcast.net) |
| 15:55:05 | → | shapr joins (~user@pool-108-28-144-11.washdc.fios.verizon.net) |
| 15:55:54 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 268 seconds) |
| 15:56:08 | → | hnOsmium0001 joins (uid453710@id-453710.stonehaven.irccloud.com) |
| 15:56:26 | × | oso quits (~oso@2601:58c:c080:a950:f275:2530:b398:680b) (Quit: Client closed) |
| 15:57:40 | → | berberman joins (~berberman@user/berberman) |
| 15:58:15 | × | berberman_ quits (~berberman@user/berberman) (Ping timeout: 258 seconds) |
| 15:58:48 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 15:58:54 | × | ukari quits (~ukari@user/ukari) (Remote host closed the connection) |
| 15:59:38 | → | ukari joins (~ukari@user/ukari) |
| 16:00:16 | <absence> | janus: thanks, but the problem was the mismatch between m1 and m2 |
| 16:00:48 | <janus> | aah right , ok. so actually not really related to ExceptT |
| 16:01:44 | → | euandreh joins (~euandreh@2804:14c:33:9fe5:4cf:cdfb:eec8:75c0) |
| 16:02:55 | → | neceve joins (~quassel@2a02:c7f:607e:d600:d2c9:6317:8847:51b6) |
| 16:05:09 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 258 seconds) |
| 16:06:47 | → | azeem joins (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) |
| 16:09:32 | → | curiousgay joins (~curiousga@77-120-186-48.kha.volia.net) |
| 16:11:00 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 16:12:29 | → | rmoe joins (~rmoe@c-71-236-207-44.hsd1.wa.comcast.net) |
| 16:14:21 | <lechner> | Hi, why does connectPostgreSQL in postgresql-simple expect a ByteString and not a String, please? |
| 16:15:12 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 250 seconds) |
| 16:15:18 | <dsal> | String is bad in general. They'd have to pack it in to a bytestring to send it over the wire anyway, so might as well take it. |
| 16:15:45 | <dsal> | With overloaded strings and optparse-applicative or similar for taking parameters, you might generally not notice the difference. |
| 16:16:37 | <maerwald[m]> | with optparse-applicative you will notice something: https://github.com/pcapriotti/optparse-applicative/issues/368 |
| 16:17:19 | <maerwald[m]> | and https://github.com/haskell/bytestring/issues/140 |
| 16:17:42 | <maerwald[m]> | (which is used by OverloadedStrings) |
| 16:17:45 | × | azeem quits (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) (Read error: Connection reset by peer) |
| 16:17:55 | → | azeem joins (~azeem@176.201.8.137) |
| 16:18:20 | <dsal> | Ah. For the same reason ... yeah |
| 16:19:29 | <maerwald[m]> | I use quasi quoters |
| 16:19:42 | <dsal> | You wouldn't notice if you used ascii connection strings. :) |
| 16:19:59 | <dsal> | I've never written a qq. What's the input? |
| 16:20:11 | <maerwald[m]> | yeah |
| 16:20:36 | <maerwald[m]> | A string |
| 16:20:54 | <dsal> | Makes sense. |
| 16:20:58 | × | Vajb quits (~Vajb@n2bovg6licdnldblt-2.v6.elisa-mobile.fi) (Ping timeout: 256 seconds) |
| 16:21:07 | <maerwald[m]> | xD |
| 16:22:24 | × | charukiewicz quits (~quassel@irouteinc02.i.subnet.rcn.com) (Ping timeout: 258 seconds) |
| 16:22:29 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 252 seconds) |
| 16:22:52 | → | charukiewicz joins (~quassel@irouteince04.i.subnet.rcn.com) |
| 16:23:03 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 16:23:22 | → | azeem joins (~azeem@176.201.8.137) |
| 16:24:53 | → | Vajb joins (~Vajb@2001:999:40:408d:1d9e:a80c:4ab7:8954) |
| 16:26:14 | × | Core8888 quits (~agua_pesa@191.177.175.57) (Ping timeout: 258 seconds) |
| 16:26:18 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Quit: WeeChat 3.2) |
| 16:27:28 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 16:28:20 | → | lbseale_ joins (~lbseale@user/ep1ctetus) |
| 16:30:07 | × | haykam1 quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:30:31 | → | haykam2 joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:30:57 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 16:32:22 | × | lbseale quits (~lbseale@user/ep1ctetus) (Ping timeout: 258 seconds) |
| 16:33:07 | × | haykam2 quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:33:26 | → | haykam3 joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:33:50 | × | neceve quits (~quassel@2a02:c7f:607e:d600:d2c9:6317:8847:51b6) (Remote host closed the connection) |
| 16:34:35 | × | haykam3 quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:34:52 | → | haykam4 joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:35:05 | → | neceve joins (~quassel@2a02:c7f:607e:d600:f762:20dd:304e:4b1f) |
| 16:36:00 | × | cpape` quits (~user@2a01:4f9:c010:632d::1) (Remote host closed the connection) |
| 16:36:01 | × | enoq quits (~enoq@194-208-179-35.lampert.tv) (Quit: enoq) |
| 16:36:12 | → | cpape` joins (~user@2a01:4f9:c010:632d::1) |
| 16:36:13 | fendor_ | is now known as fendor |
| 16:36:23 | → | Guest7946 joins (~Guest79@S0106bc3e07325ee3.vw.shawcable.net) |
| 16:36:26 | <lechner> | dsal: Hi, why is String bad in general (other than how it is implemented), please? |
| 16:36:45 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
| 16:36:47 | × | haykam4 quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:37:08 | → | haykam5 joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:37:57 | <dsal> | lechner: mainly that. It's a linked list and has to be serialized to communicate externally |
| 16:38:14 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 16:38:20 | <Guest7946> | Hi All - I have a question about getting emacs haskell modes working with ghcup installed haskell/ghci. Is this the right place? |
| 16:39:40 | × | haykam5 quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:40:25 | <lechner> | dsal: i don't mean to argue, but wouldn't the "wire" argument also apply to putX and printX? |
| 16:40:32 | → | haykam6 joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:40:46 | × | smarton quits (~smarton@gnu/webmaster/smarton) (Quit: ZNC 1.7.2+deb3 - https://znc.in) |
| 16:41:06 | <dsal> | Yeah. It doesn't always matter. |
| 16:41:20 | × | haykam6 quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:41:37 | → | haykam joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:41:43 | × | dustinm- quits (~dustinm@static.38.6.217.95.clients.your-server.de) (Quit: Leaving) |
| 16:41:50 | → | smarton joins (~smarton@gnu/webmaster/smarton) |
| 16:42:07 | <dsal> | I'm using an xml library that uses strings and it feels wrong, but I'm also not making anything big or spending much of my time there, so I can't be bothered. :) |
| 16:42:44 | × | hrnz quits (~ulli@irc.plumbing) (Ping timeout: 252 seconds) |
| 16:43:02 | <adamCS> | Guest7946: Might be! What's the specific question? |
| 16:43:36 | → | Pickchea joins (~private@user/pickchea) |
| 16:43:46 | <lechner> | dsal: Shouldn't that be a reason to reimplement String rather than encourage it's avoidance, like Data.Text? |
| 16:43:46 | × | haykam quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:44:20 | → | haykam joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:44:23 | <geekosaur> | lechner: there is no reimplementation that would help aside from things like Data.Text |
| 16:44:24 | → | dustinm joins (~dustinm@static.38.6.217.95.clients.your-server.de) |
| 16:44:43 | <Guest7946> | Thanks adamCS - I'm running on OS X, I've modified the init.el file to find the ghci executable in the .ghcup directory but the haskell inferior process just keeps dying. I'm not sufficently knowledgable about emacs debugging of subprocesses so I cannot tell why. |
| 16:45:04 | <Guest7946> | Is this configuration known to work? OS X/ghcup installation/emacs modes? |
| 16:45:33 | <monochrom> | I bet backward compatibility may block redefining String. |
| 16:45:58 | <geekosaur> | yes, anything assuming it's a list would fail |
| 16:46:00 | <dsal> | lechner: String is really easy to think about and work with. It's fine for many things. But if you have OverloadedStrings enabled, you don't notice a lot of issues. |
| 16:46:06 | <geekosaur> | which means most things using String |
| 16:46:20 | <adamCS> | Guest7946: Yes, at least for some modes. What are you trying to get working? I use ghcup installed toolchain (ghc/cabal/hls) and then in emacs I use lsp which uses hls (haskell-language-server), What mode needs ghci? |
| 16:46:23 | <dsal> | Though bytestring is weird, I guess. It means something else that overlaps a lot |
| 16:46:27 | <monochrom> | Besides, the same can be said about Bool. |
| 16:47:04 | <monochrom> | You can't solve boolean blindness by redefining Bool. The only solution is discouragement and education. |
| 16:47:13 | <geekosaur> | adamCS: inferior haskell mode |
| 16:47:18 | <adamCS> | Guest7946: often emacs has a buffer someplace that has the stderr of the inferior process. Or maybe the mode can be configured to make such a buffer. |
| 16:47:41 | × | haykam quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:47:59 | → | haykam joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:48:22 | <adamCS> | geekosaur: Maybe you have better ideas! I don't even really understand major/minor modes. I just have it (haskell and lsp modes) working. |
| 16:48:53 | <monochrom> | I use haskell-mode rather than lsp/hls. |
| 16:49:00 | <geekosaur> | not really, I don't use inferior haskell mode much |
| 16:49:11 | <Guest7946> | @adamCS I think it's just inferior haskell mode... just to run ghci within emacs |
| 16:49:11 | <lambdabot> | Unknown command, try @list |
| 16:49:15 | <dsal> | I've never got lsp working. Too many weird levels of misdirection in my setup. |
| 16:49:25 | <lechner> | monochrom: the disagreement is over String == [Char] right? |
| 16:49:28 | <dsal> | And haskell-mode has worked well on my lawn |
| 16:49:36 | <adamCS> | took me a while to get lsp/hls working. But it's pretty cool when it does. |
| 16:49:40 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 16:49:46 | <monochrom> | But within haskell-mode, the "inferior" option is really an old relic that no one should use. |
| 16:49:53 | <Guest7946> | "There isn't a problem in CS that can't be solved by another level of indirection" ... i forget who said it. |
| 16:50:17 | <monochrom> | Use "interactive-haskell-mode" instead. |
| 16:50:51 | <Guest7946> | Ok, thanks @monochrom I'll reconfigure to use interactive :) |
| 16:50:54 | × | haykam quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:51:03 | <monochrom> | But either way, unless you do manual configuration, haskell-mode honours PATH. |
| 16:51:10 | × | azeem quits (~azeem@176.201.8.137) (Ping timeout: 250 seconds) |
| 16:51:18 | → | haykam joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:51:28 | × | dustinm quits (~dustinm@static.38.6.217.95.clients.your-server.de) (Quit: Leaving) |
| 16:52:59 | <Guest7946> | Yes, PATH would be an answer if I know how to modify the "login" PATH in OS X. I'm unsure how PATH gets set in the case where you start from gui. |
| 16:53:09 | × | haykam quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:53:46 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds) |
| 16:54:15 | → | haykam joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:54:59 | × | haykam quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:55:00 | → | econo joins (uid147250@user/econo) |
| 16:55:22 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 240 seconds) |
| 16:55:25 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 16:55:47 | → | haykam joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:56:11 | × | haykam quits (~haykam@static.100.2.21.65.clients.your-server.de) (Remote host closed the connection) |
| 16:56:13 | → | Atum_ joins (~IRC@user/atum/x-2392232) |
| 16:56:31 | × | oxide quits (~lambda@user/oxide) (Ping timeout: 258 seconds) |
| 16:56:39 | → | haykam joins (~haykam@static.100.2.21.65.clients.your-server.de) |
| 16:57:14 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds) |
| 17:00:11 | → | Cajun joins (~Cajun@user/cajun) |
| 17:00:38 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 256 seconds) |
| 17:01:07 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 258 seconds) |
| 17:01:34 | × | Vajb quits (~Vajb@2001:999:40:408d:1d9e:a80c:4ab7:8954) (Ping timeout: 250 seconds) |
| 17:02:51 | → | Vajb joins (~Vajb@2001:999:51:e847:deb5:e55f:2c83:fc9d) |
| 17:03:17 | × | Guest7946 quits (~Guest79@S0106bc3e07325ee3.vw.shawcable.net) (Quit: Client closed) |
| 17:05:36 | <maerwald[m]> | There's also https://gitlab.haskell.org/haskell/ghcup-hs#with_ghc-wrapper-eg-for-hls |
| 17:07:39 | × | MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Read error: Connection reset by peer) |
| 17:09:01 | <dsal> | Guest6153: emacs has two paths you can set. There's the `PATH` environment that's passed down to subprocesses and the `exec-path` list that it uses to find things. |
| 17:09:20 | <dsal> | Argh, hit the wrong guest. |
| 17:09:32 | → | hrnz joins (~ulli@irc.plumbing) |
| 17:09:33 | × | Vajb quits (~Vajb@2001:999:51:e847:deb5:e55f:2c83:fc9d) (Ping timeout: 258 seconds) |
| 17:09:52 | → | MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com) |
| 17:10:12 | × | euandreh quits (~euandreh@2804:14c:33:9fe5:4cf:cdfb:eec8:75c0) (Quit: WeeChat 3.2) |
| 17:10:37 | <monochrom> | Yeah the right guest left. Confounding even smart autocompletion. |
| 17:11:16 | <maerwald[m]> | the Right guest Left... english is weird |
| 17:11:39 | → | mattil joins (~mattilinn@87-92-57-75.bb.dnainternet.fi) |
| 17:12:24 | <dsal> | Is there `swap` for Either? |
| 17:12:27 | × | gawen quits (~gawen@user/gawen) (Quit: cya) |
| 17:12:36 | → | Vajb joins (~Vajb@nawgi2ugr2ypv0v7x-3.v6.elisa-mobile.fi) |
| 17:13:02 | <dsal> | I wrote some type that's basically `Either a a`. No idea where I put that or what I called it.... |
| 17:13:12 | <monochrom> | I haven't seen one in libraries, but I would be inclined to name it "ingsoc". |
| 17:13:15 | × | markpythonicbitc quits (~markpytho@50.228.44.6) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 17:16:42 | → | gawen joins (~gawen@user/gawen) |
| 17:16:50 | × | Vajb quits (~Vajb@nawgi2ugr2ypv0v7x-3.v6.elisa-mobile.fi) (Ping timeout: 258 seconds) |
| 17:17:23 | → | Vajb joins (~Vajb@n4o6cmlync08x7vgp-3.v6.elisa-mobile.fi) |
| 17:17:56 | → | Pickchea joins (~private@user/pickchea) |
| 17:18:54 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 17:23:32 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 252 seconds) |
| 17:28:32 | × | Guest7240 quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 17:29:27 | → | delYsid joins (~user@62-178-101-151.cable.dynamic.surfer.at) |
| 17:29:50 | <delYsid> | @hoogle (Monoid (f a), Applicative f) => Maybe a -> f a |
| 17:29:51 | <lambdabot> | Generic.Data.Internal.Utils coerce' :: Coercible (f x) (g x) => f x -> g x |
| 17:29:51 | <lambdabot> | Control.Effect.Lift sendM :: (Has (Lift n) sig m, Functor n) => n a -> m a |
| 17:29:51 | <lambdabot> | Blanks.ScopeW scopeWLiftAnno :: (NatNewtype (ScopeW t n f g) g, Functor t) => t a -> g a |
| 17:31:48 | × | ukari quits (~ukari@user/ukari) (Remote host closed the connection) |
| 17:32:19 | → | ukari joins (~ukari@user/ukari) |
| 17:33:24 | → | chris joins (~chris@81.96.113.213) |
| 17:33:29 | chris | is now known as Guest3433 |
| 17:35:41 | → | azeem joins (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) |
| 17:36:00 | → | markpythonicbitc joins (~markpytho@2600:380:c133:d5e:9df4:26a8:3f28:73a8) |
| 17:38:36 | × | Guest3433 quits (~chris@81.96.113.213) (Ping timeout: 272 seconds) |
| 17:42:31 | × | Vajb quits (~Vajb@n4o6cmlync08x7vgp-3.v6.elisa-mobile.fi) (Ping timeout: 258 seconds) |
| 17:43:02 | → | Atum__ joins (~IRC@user/atum/x-2392232) |
| 17:45:03 | × | Atum_ quits (~IRC@user/atum/x-2392232) (Ping timeout: 268 seconds) |
| 17:45:36 | → | Vajb joins (~Vajb@nzwkg4b83ts4sgjo-3.v6.elisa-mobile.fi) |
| 17:46:05 | × | curiousgay quits (~curiousga@77-120-186-48.kha.volia.net) (Ping timeout: 252 seconds) |
| 17:48:28 | × | markpythonicbitc quits (~markpytho@2600:380:c133:d5e:9df4:26a8:3f28:73a8) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 17:48:41 | → | oxide joins (~lambda@user/oxide) |
| 17:52:49 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2) |
| 17:58:37 | × | oxide quits (~lambda@user/oxide) (Ping timeout: 268 seconds) |
| 18:02:44 | → | pavonia joins (~user@user/siracusa) |
| 18:06:41 | → | chris joins (~chris@81.96.113.213) |
| 18:06:44 | chris | is now known as Guest2445 |
| 18:07:20 | × | delYsid quits (~user@62-178-101-151.cable.dynamic.surfer.at) (Remote host closed the connection) |
| 18:13:33 | × | oldsk00l quits (~znc@ec2-18-130-254-135.eu-west-2.compute.amazonaws.com) (Ping timeout: 265 seconds) |
| 18:15:30 | <lechner> | Hi, why does connectPostgreSQL in postgresql-simple expect a strict ByteString instead of lazy, please (or provide an implementation for the latter)? Thanks! |
| 18:17:07 | <monochrom> | You can use "toStrict" easily? |
| 18:18:06 | <monochrom> | I am not the author, but if I were, I wouldn't expect a query to be more than even 1MB long such that lazy bytestring would be called for. |
| 18:18:11 | × | epolanski quits (uid312403@id-312403.brockwell.irccloud.com) (Quit: Connection closed for inactivity) |
| 18:18:40 | <lechner> | I do, but I thought Haskell is lazy by default. I also do not understand why a separate type is needed to ensure evalution. |
| 18:19:33 | <monochrom> | But postgresql is eager by default. |
| 18:19:48 | <monochrom> | Especially when it wants you to submit a query. |
| 18:19:54 | <lechner> | it's the connection string |
| 18:20:05 | <monochrom> | That too. |
| 18:21:08 | <lechner> | i understand that some routines, like a socket 'receive', deliver a fully evaluated string, but why does that require a separate type? |
| 18:21:23 | × | Atum__ quits (~IRC@user/atum/x-2392232) (Quit: Atum__) |
| 18:24:18 | × | Neuromancer quits (~Neuromanc@user/neuromancer) (Ping timeout: 258 seconds) |
| 18:25:38 | × | rmoe quits (~rmoe@c-71-236-207-44.hsd1.wa.comcast.net) (Ping timeout: 250 seconds) |
| 18:26:26 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 18:27:39 | × | caubert quits (~caubert@136.244.111.235) (Quit: WeeChat 3.2) |
| 18:28:38 | → | caubert joins (~caubert@136.244.111.235) |
| 18:29:50 | × | bjobjo quits (~bjobjo@user/bjobjo) (Remote host closed the connection) |
| 18:31:17 | × | caubert quits (~caubert@136.244.111.235) (Client Quit) |
| 18:32:03 | → | rmoe joins (~rmoe@c-71-236-207-44.hsd1.wa.comcast.net) |
| 18:32:23 | → | lavaman joins (~lavaman@98.38.249.169) |
| 18:33:18 | → | caubert joins (~caubert@136.244.111.235) |
| 18:33:24 | <monochrom> | Given that both kinds of bytestrings are available, I would agree with the author in choosing the non-lazy one to make clear the semantics of the API. |
| 18:33:47 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 18:34:01 | <monochrom> | So you would have to escalate it to the level of: why would the bytestring library give you a choice, why didn't it be a dictator. |
| 18:34:15 | → | goepsilongo joins (~chacho@2603-7000-ab00-62ed-e8e0-40c9-c788-8ef8.res6.spectrum.com) |
| 18:34:19 | <monochrom> | But I guess once framed that way the answer is pretty clear. |
| 18:34:41 | <monochrom> | We do recognize that laziness is bad for some use cases and there should always be a choice. |
| 18:35:20 | <lechner> | i guess it was too slow or inefficient to have only lazy ByteStrings and "evaluate $ force" at the relevant IO points |
| 18:39:17 | <lechner> | My issue with the ByteString paradigm is, I suppose, that I like to convert UTF-8 to code points at the earliest possibility for input (and the latest for output). Those intermediate Strings are lazy, so in addition to UTF-8 I have to deal with lazy and strict more often |
| 18:41:19 | <lechner> | For Haskell those two often seem to come together; either I have a (lazy) String or a strict BysteString, which nowadays is usually in UTF-8 |
| 18:42:52 | → | burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk) |
| 18:43:05 | × | drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 258 seconds) |
| 18:46:23 | <lechner> | which means I can make my life easier by using the strict version of UTF8.fromString. sorry about thinking aloud |
| 18:47:12 | <Gurkenglas> | When a compilation error is confusing, could I run a debugger on GHC to get more info on how the error arose? |
| 18:48:10 | × | burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Ping timeout: 240 seconds) |
| 18:48:28 | <Gurkenglas> | Also, is there a graphical debugger for Haskell? I notice that they are much more pleasant to work with than command-line debuggers. |
| 18:48:46 | <monochrom> | In practice there is no debugger for GHC. |
| 18:49:04 | <monochrom> | Or rather, no debugger that works well on GHC. |
| 18:49:27 | <lechner> | what's the error? most are confusing |
| 18:50:18 | <lechner> | or rather would benefit from more explanation |
| 18:50:29 | <lechner> | for newbies |
| 18:50:47 | <monochrom> | Regarding unicode codepoints, I am surprised that you act like you have never heard of Data.Text before. As if. |
| 18:53:05 | × | viluon quits (uid453725@id-453725.brockwell.irccloud.com) (Quit: Connection closed for inactivity) |
| 18:53:16 | × | jeetelongname quits (~jeet@host-89-241-98-229.as13285.net) (Remote host closed the connection) |
| 18:53:29 | <lechner> | monochrom: i only read about it, but my JSON and YAML definitions use String, Should I switch? |
| 18:53:40 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 18:54:10 | <lechner> | they are all short |
| 18:54:38 | <dsal> | IMO: You should fix things you measure as being problems. |
| 18:55:19 | <dsal> | I saw a cool video about unboxing recently that showed how memory is reduced by unboxing. Unless you turn on the optimizer, at which point the unboxed version is optimized less aggressively and it ends up using more memory. |
| 18:57:32 | <lechner> | dsal: right now, i am the bottleneck. that's why i ask so many questions |
| 18:57:36 | <monochrom> | "There isn't a problem in CS that can't be solved by another level of indirection" pairs well with "There isn't a performance penalty that can't be solved by another level of unboxing" >:) |
| 18:57:36 | <dsal> | heh |
| 18:58:25 | <dsal> | lechner: IMO, it's good to have a vague idea of what some of these concepts are. When they show up in bugs, implementation difficulties, or performance issues, you know what to look for. |
| 18:58:47 | <dsal> | There are a lot of Haskell features that just seem stupid and weird to me. Until that one day when I'm like, "Ugh, I can't figure out how to do this... wait..." |
| 18:59:53 | <Gurkenglas> | monochrom, what stops the ghci debugger from working on GHC? |
| 19:00:11 | <monochrom> | GHC is compiled. |
| 19:00:35 | <monochrom> | gdb works poorly on code generated by GHC. GHC code is generated by GHC. |
| 19:00:39 | <Gurkenglas> | Ah. What stops one from running GHC uncompiled? |
| 19:00:51 | <monochrom> | I haven't tried. |
| 19:00:55 | <geekosaur> | there is a way to load ghc into ghci, which ships with the ghc source. it's fragile and breaks every so often |
| 19:01:32 | <monochrom> | ghci debugger is pretty primitive in the first place. |
| 19:02:38 | × | jpds quits (~jpds@gateway/tor-sasl/jpds) (Remote host closed the connection) |
| 19:02:48 | <monochrom> | Type checking and inference are pretty detailed algorithms in GHC such that even with most ideal debuggers you risk missing the forest for the trees, you will be drowned in unnecessary details. |
| 19:03:00 | → | jpds joins (~jpds@gateway/tor-sasl/jpds) |
| 19:03:22 | <dsal> | `Debug.Trace` == universal debugger. |
| 19:03:33 | <Gurkenglas> | dsal-- |
| 19:03:37 | → | markpythonicbitc joins (~markpytho@2601:647:5a00:35:a8c6:4beb:a469:3f6e) |
| 19:03:48 | <monochrom> | dsal++ |
| 19:04:04 | <lechner> | that costs a beer |
| 19:04:05 | → | rk04 joins (~rk04@user/rajk) |
| 19:04:12 | <maerwald[m]> | Yes, it allows to debug laziness behavior |
| 19:05:54 | <xerox> | dsal++ |
| 19:06:33 | <dsal> | There are different kinds of bugs that require different kinds of debugging procedures. Proper debugger style hasn't been very useful for me in most languages (it was nice in Smalltalk). I had an incredibly rare failure in a server that I found by enabling traces and building a tool to reconstruct the scenario that lead to a stuck thread. |
| 19:06:37 | <int-e> | dsal: do you include https://hackage.haskell.org/package/base-4.15.0.0/docs/Debug-Trace.html#v:traceEvent in that? |
| 19:06:37 | <monochrom> | Moreover, modern type inference algorithms in GHC are written for getting it done, not for explanation. Following its execution does not give you the explanation a human wants, only an explanation a computer wants. |
| 19:07:10 | <dsal> | int-e: I've not used that exact function, but I did go through and name all my threads for eventlog processing. Now I'm going to start using that. :) |
| 19:07:38 | <monochrom> | Although, if you're well-versed with those papers like the OutsideIn(X) paper, you may be able to decode an execution trace. |
| 19:08:23 | × | peterhil quits (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 258 seconds) |
| 19:08:48 | <int-e> | I mean, I love Debug.Trace.trace{,Show} but it has obvious scalability issues. |
| 19:09:11 | <maerwald[m]> | not webscale? |
| 19:18:21 | × | rk04 quits (~rk04@user/rajk) (Ping timeout: 258 seconds) |
| 19:21:08 | <int-e> | maerwald[m]: wtf does that even mean |
| 19:21:47 | <maerwald[m]> | Means growing your business |
| 19:22:08 | <int-e> | bzzzt |
| 19:22:15 | <int-e> | so buzzy |
| 19:23:48 | <lechner> | it was a tough week for everyone, i can tell |
| 19:24:19 | <monochrom> | I think maerwald[m] was just joking. |
| 19:24:48 | <lechner> | that too. |
| 19:24:54 | <int-e> | yeah I got that, but I did realize that "webscale" is a totally empty word to me, genuinely. |
| 19:25:14 | × | mattil quits (~mattilinn@87-92-57-75.bb.dnainternet.fi) (Quit: Leaving) |
| 19:25:18 | <maerwald[m]> | Let me sell you microservices |
| 19:25:26 | <int-e> | Unless you're talking about one of the big companies like Google. |
| 19:25:43 | <maerwald[m]> | And when you get into deployment issues, I'll sell yoe kubernetes |
| 19:25:52 | <monochrom> | I prefer to breathe life back into that empty word and make it a joke word. :) |
| 19:25:56 | <int-e> | Which make up enough of the "web" for the word "webscale" to kind of make sense. |
| 19:26:16 | <maerwald[m]> | Ya, Haskell needs better sales ppl. But it seems that's the main goal of HF. So we're covered. |
| 19:26:32 | <int-e> | Microservices I've seen... https://blog.davetcode.co.uk/post/21st-century-emulator/ |
| 19:26:32 | <maerwald[m]> | Sarcastic Friday |
| 19:26:59 | <lechner> | the weekend is coming |
| 19:27:17 | <int-e> | maerwald[m]: tbf your answer was probably exactly what I deserved |
| 19:27:26 | <maerwald[m]> | xD |
| 19:27:56 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds) |
| 19:33:23 | × | _bin quits (~bin@user/bin/x-1583188) (Quit: ZNC - https://znc.in) |
| 19:33:35 | → | _bin joins (~bin@user/bin/x-1583188) |
| 19:33:54 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds) |
| 19:35:07 | → | emliunix joins (~emliunix@2a09:bac0:23::815:b8b) |
| 19:36:16 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Remote host closed the connection) |
| 19:39:30 | <sm> | re "could I run a debugger on GHC to get more info on how the error arose?", yes but isn't it often quicker to search for the error message and stare at the code ? |
| 19:41:11 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 19:43:39 | × | alx741 quits (~alx741@186.178.109.254) (Ping timeout: 258 seconds) |
| 19:54:28 | × | Guest2445 quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 19:55:13 | → | lavaman joins (~lavaman@98.38.249.169) |
| 19:57:43 | → | alx741 joins (~alx741@186.178.108.253) |
| 19:58:00 | <monochrom> | "A Fresh Calculus for Names Management" I didn't know Moggi was also capable of making puns in paper titles. :) |
| 19:58:44 | <emliunix> | Client: HexChat 2.14.2 • OS: Microsoft Windows 11 专业版 (x64) • CPU: Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz (3.00GHz) • Memory: 47.9 GiB Total (32.7 GiB Free) • Storage: 2.0 TiB / 4.4 TiB (2.5 TiB Free) • VGA: NVIDIA GeForce GTX 1060 6GB, Intel(R) UHD Graphics 630 • Uptime: 56m 10s |
| 19:59:01 | <emliunix> | sorry |
| 20:00:11 | <lechner> | wow |
| 20:01:05 | <dsal> | sm: Sometimes the error is just "you used `head`" which is painful the first time you learn you shouldn't have done that. :) |
| 20:02:44 | → | peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) |
| 20:03:35 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 258 seconds) |
| 20:05:06 | → | aegon joins (~mike@174.127.249.180) |
| 20:05:32 | × | juhp quits (~juhp@128.106.188.220) (Ping timeout: 272 seconds) |
| 20:06:51 | → | juhp joins (~juhp@128.106.188.220) |
| 20:10:00 | × | emliunix quits (~emliunix@2a09:bac0:23::815:b8b) (Remote host closed the connection) |
| 20:10:02 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 20:10:23 | → | emliunix joins (~emliunix@2a09:bac0:23::815:b8b) |
| 20:10:33 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 20:16:58 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:c77:b134:29be:aae9) |
| 20:19:20 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 20:23:07 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 20:23:07 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 20:23:10 | allbery_b | is now known as geekosaur |
| 20:24:32 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds) |
| 20:25:34 | <Gurkenglas> | sm, yes but id like to live in a world where this is automatic |
| 20:26:52 | <Gurkenglas> | a compiler designed such that instead of printing compile errors it has you look at a compiler stacktrace <3 |
| 20:26:53 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 20:27:23 | <geekosaur> | I suspect that'd get old quickly |
| 20:28:21 | <Gurkenglas> | (or debugger states rather than stacktraces) |
| 20:28:31 | <Gurkenglas> | and when that gets old you improve the debugger UI |
| 20:28:42 | × | silverwhitefish quits (~hidden@47.202.102.10) (Ping timeout: 250 seconds) |
| 20:32:49 | × | fendor quits (~fendor@77.119.214.156.wireless.dyn.drei.com) (Remote host closed the connection) |
| 20:34:15 | → | Pickchea joins (~private@user/pickchea) |
| 20:35:10 | → | jgeerds joins (~jgeerds@55d45555.access.ecotel.net) |
| 20:37:42 | <sm> | Gurkenglas: to be clear, you want to debug the state of the compiler when it reports a compile error in your program here, not debug your program - right ? |
| 20:38:28 | <Gurkenglas> | yep :) |
| 20:38:34 | <Gurkenglas> | can't debug my program if it won't compile |
| 20:38:40 | <sm> | would that be because you're a ghc developer, or because ghc's error messages are too hard to understand ? |
| 20:39:14 | <Gurkenglas> | the latter. i expect that to happen whenever one has advanced libraries and a strong type system. |
| 20:39:29 | <sm> | I think the "automatic" world you want is one where the errors are simply easy to understand, like Elm |
| 20:39:35 | <geekosaur> | I hyave to imagine that if the compile error is too hard to understand, the backtrace will be no better and probably worse |
| 20:39:36 | <sm> | (reputedly) |
| 20:40:10 | <sm> | way worse.. |
| 20:40:30 | <Gurkenglas> | geekosaur, I imagine that as you get more advanced libraries in the same type system, the errors get harder to understand faster than the backtraces |
| 20:41:24 | <sm> | an "EXPLAIN" mode for ghc errors, where it tries to walk you through them in more detail, sounds useful, more than backtraces of ghc's terrifying internals |
| 20:42:53 | <sm> | ie, something designed for human comprehension, rather than a direct reflection of the implementation structure |
| 20:43:24 | <sm> | but sure, both, all, would be great to have |
| 20:43:42 | <sm> | and I'm sure it's doable with some #ghc magic |
| 20:44:12 | <sm> | just stick a printCallStack into ghc's error display code |
| 20:44:17 | → | Atum_ joins (~IRC@user/atum/x-2392232) |
| 20:49:50 | <dsal> | Gurkenglas: Do you have an example of this sort of thing? |
| 20:50:16 | <dsal> | Most of the time when I have a sufficiently bad type error, it's because I've underspecified things and the guesses/constraints start getting too broad. |
| 20:50:44 | <c_wraith> | another way of saying that is "overuse of classes" |
| 20:51:14 | <dsal> | Yeah. Sometimes you can get really far by just saying what the thing is that you expect to see at a particular site. |
| 20:51:15 | <Gurkenglas> | lens errors, i would guess |
| 20:51:33 | <dsal> | People who don't like lens errors tend to favor optics. :) |
| 20:53:23 | × | ham2 quits (~ham4@d8D8627D5.access.telenet.be) (Read error: Connection reset by peer) |
| 20:53:28 | <lbseale_> | I am trying to build a GHC package without using cabal or stack, I see I need to define this unit-id hash value in the package info, but I don't know how to generate it. Does anyone? |
| 20:53:31 | <c_wraith> | at least lens errors mean you did something wrong. As opposed to the errors of the form "this is too polymorphic and I can't figure out what you meant" |
| 20:55:40 | × | azeem quits (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) (Remote host closed the connection) |
| 20:55:49 | → | ham2 joins (~ham4@d8D8627D5.access.telenet.be) |
| 20:55:49 | → | azeem joins (~azeem@dynamic-adsl-94-34-48-122.clienti.tiscali.it) |
| 20:56:33 | ham2 | is now known as ham |
| 20:56:37 | × | ham quits (~ham4@d8D8627D5.access.telenet.be) (Changing host) |
| 20:56:37 | → | ham joins (~ham4@user/ham) |
| 20:57:27 | <dsal> | TBH, I bat around at lens errors sometime because I sometimes like not thinking. |
| 20:59:34 | <monochrom> | lens is a case of very leaky abstraction therefore errors require familiarity with implementation details and coding tricks. |
| 20:59:55 | <c_wraith> | Honestly, I don't even see lens as an abstraction |
| 21:00:26 | <c_wraith> | It's a swiss-army knife. It doesn't remove needing to understand things, but it gives you very precise tools for doing exactly what you need |
| 21:00:36 | <monochrom> | OTOH lens not exposing that information is also a strength in being very adaptable, so I don't really complain. |
| 21:00:51 | <monochrom> | err! s/not // |
| 21:01:08 | <monochrom> | (I wasn't making up my mind between "not hiding" and "exposing" heh) |
| 21:01:27 | <monochrom> | <-- quantum superposed typist |
| 21:02:00 | <monochrom> | Yeah swiss-army knife nails it. |
| 21:02:31 | <monochrom> | Generally if you have very interesting type aliases instead of newtypes, you expect this. |
| 21:02:59 | <monochrom> | C++ takes this practice to the level of daily bread. |
| 21:03:51 | <monochrom> | and butter and peanut butter and nutella. :) |
| 21:05:08 | <lbseale_> | Update: the documentation is in a comment in the GHC Main.hs source code >_< |
| 21:05:11 | <lbseale_> | https://github.com/ghc/ghc/blob/master/ghc/Main.hs |
| 21:05:29 | <monochrom> | In which case actually wanting a type checker execution trace is barking up the wrong tree. You think the algorithm actually understands sh*t? |
| 21:05:37 | × | _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection) |
| 21:08:21 | <monochrom> | John Searle missed the opportunity for coining "The Unification Room". >:) |
| 21:13:42 | × | pgib quits (~textual@173.38.117.81) (Quit: 00 PC LOAD LETTER) |
| 21:17:49 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 21:18:20 | × | markpythonicbitc quits (~markpytho@2601:647:5a00:35:a8c6:4beb:a469:3f6e) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 21:22:08 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 21:24:18 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 21:27:54 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 21:29:22 | × | jiribenes quits (~jiribenes@rosa.jiribenes.com) (Ping timeout: 240 seconds) |
| 21:33:29 | → | jiribenes joins (~jiribenes@rosa.jiribenes.com) |
| 21:36:53 | → | arkho joins (~ccc@dynamic-acs-24-112-153-241.zoominternet.net) |
| 21:36:55 | × | arkho quits (~ccc@dynamic-acs-24-112-153-241.zoominternet.net) (Remote host closed the connection) |
| 21:37:30 | × | neceve quits (~quassel@2a02:c7f:607e:d600:f762:20dd:304e:4b1f) (Ping timeout: 258 seconds) |
| 21:40:16 | <raehik> | Got a C library that I want to make some Haskell bindings for, and have work on Windows and Linux, but not sure how to build the lib in GHC/Cabal (which I saw a relevant pkg for a simpler lib) |
| 21:40:56 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 21:41:13 | <raehik> | I've got some function calls working from Cabal, but I don't get how linking will work. How do I tell GHC to link against a dynamic library? Is this a bad idea/what's the alternative |
| 21:41:23 | → | lavaman joins (~lavaman@98.38.249.169) |
| 21:42:38 | <geekosaur> | it will link against dynamic C libraries by default; it's shared libraries that are the problem |
| 21:42:43 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 21:42:55 | <sclv> | raehik: take a look at some bindings for things like curl to see how they're set up https://hackage.haskell.org/package/curl-1.3.8/curl.cabal |
| 21:43:03 | <geekosaur> | (because there's no portable way to do that without also linkingf libc shared, which will break glibc) |
| 21:43:53 | <raehik> | sclv: thank you! was looking for more examples |
| 21:44:16 | <raehik> | geekosaur: I don't think I know what the diff between a dynamic and shared lib is. |
| 21:44:38 | <raehik> | are they both .so / .dlls? |
| 21:45:14 | <sclv> | network has a more complex cabal that can show a bit more stuff off too, like cbits, platform specific conditionals, etc https://hackage.haskell.org/package/network-3.1.2.2/network.cabal |
| 21:45:22 | <geekosaur> | they're the same thing, just different names for it |
| 21:45:30 | <janus> | geekosaur: are you saying it is more portable when linking libc shared? why would that be the case? surely it using musl statically should be more portable than glibc, just because you can link it statically |
| 21:46:07 | <monochrom> | geekosaur, I think you had a typo in "dynamic is default, shared is the problem" in which it should be s/shared/static/ |
| 21:46:11 | <geekosaur> | janus, the problem with glibc is it will insist on loading some stuff dynamically anyway (notably nss) and that will break between glibc versions |
| 21:46:19 | <geekosaur> | yes, sorry |
| 21:46:42 | <geekosaur> | static is the problem because glibc doesn't like being static.l which is why musl is recommended for static builds |
| 21:47:16 | <janus> | right, ok, so with the correction it makes more sense. static is perfectly portable (except musl doesn't run on windows) , if you can get it built |
| 21:49:48 | <raehik> | I thought this (tiny) pkg built the C functions into it rather than being dynamic https://hackage.haskell.org/package/lzo |
| 21:50:44 | <raehik> | is that correct. apologies I'm unclear on what goes on during linking in GHC |
| 21:55:39 | × | gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 21:55:44 | × | lbseale_ quits (~lbseale@user/ep1ctetus) (Ping timeout: 272 seconds) |
| 21:56:20 | <geekosaur> | that package includes the entirety of the C minilzo package, yes. this is usually done to make things easier on Windows, where it can be hard ti locate and use C libraries |
| 21:57:19 | → | lbseale joins (~lbseale@user/ep1ctetus) |
| 21:58:35 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 258 seconds) |
| 22:00:40 | → | dermato joins (~dermatobr@cpe-70-114-219-76.austin.res.rr.com) |
| 22:00:55 | <raehik> | got it, thank you. I want to use the full lzo2 library and weighing up my options |
| 22:01:27 | × | Tuplanolla quits (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.) |
| 22:01:59 | → | roboguy__ joins (~roboguy_@2605:a601:afe7:9f00:6574:78ba:36fc:f777) |
| 22:03:23 | → | _73 joins (~user@pool-96-252-123-136.bstnma.fios.verizon.net) |
| 22:05:30 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:c77:b134:29be:aae9) (Ping timeout: 256 seconds) |
| 22:05:56 | ← | _73 parts (~user@pool-96-252-123-136.bstnma.fios.verizon.net) () |
| 22:11:45 | × | roboguy__ quits (~roboguy_@2605:a601:afe7:9f00:6574:78ba:36fc:f777) (Remote host closed the connection) |
| 22:14:41 | × | machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 258 seconds) |
| 22:14:43 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:6574:78ba:36fc:f777) |
| 22:18:54 | × | lbseale quits (~lbseale@user/ep1ctetus) (Quit: Leaving) |
| 22:20:17 | → | Codaraxis_ joins (~Codaraxis@user/codaraxis) |
| 22:22:18 | × | Codaraxis_ quits (~Codaraxis@user/codaraxis) (Client Quit) |
| 22:23:14 | × | ukari quits (~ukari@user/ukari) (Remote host closed the connection) |
| 22:23:46 | → | ukari joins (~ukari@user/ukari) |
| 22:23:54 | × | Codaraxis__ quits (~Codaraxis@user/codaraxis) (Ping timeout: 240 seconds) |
| 22:25:25 | → | _73 joins (~user@pool-96-252-123-136.bstnma.fios.verizon.net) |
| 22:27:10 | <_73> | Would a haskell vector with 8 Word8's use just as much memory as a vector with 2 Word32's? I am trying to understand the difference between a vector and an array in C. |
| 22:29:43 | → | euouae joins (~euouae@user/euouae) |
| 22:29:56 | <euouae> | hello I’m making a simple hangman game of guessing the word |
| 22:30:26 | × | shapr quits (~user@pool-108-28-144-11.washdc.fios.verizon.net) (Ping timeout: 252 seconds) |
| 22:30:49 | <euouae> | I wrote a type Game containing a type State which among other things has a list of Hide Char which may be hidden or visible |
| 22:31:44 | <euouae> | and the usual update functions and such, had trouble naming variables and I sense some duplication in code maybe. Is that a good approach in general ? |
| 22:32:04 | <dsal> | euouae: It'd be easier to see the code instead of imagining your concern. :) |
| 22:32:18 | <euouae> | Hmm alright give me 5 |
| 22:33:23 | <dsal> | `data Game = Game { _phrase :: String, shown _visible :: Set Char }` would seem to do it all. |
| 22:33:39 | <euouae> | Yeah but then you’re delegating a lot to algorithms |
| 22:33:53 | <dsal> | Ah, the eternal battle between data structures and algorithms. |
| 22:33:56 | <euouae> | whereas you can also have more duplication of info in the state |
| 22:34:05 | <euouae> | Ahah ok |
| 22:34:34 | <euouae> | Actually need to make a call I’ll post code in 10 |
| 22:34:37 | <dsal> | Duplicating data is useful when your algorithm is slow. |
| 22:35:28 | × | dispater quits (~dispater@user/brprice) (Quit: ZNC 1.8.1 - https://znc.in) |
| 22:35:58 | <monochrom> | The other technique for efficiency is structured data. |
| 22:36:20 | → | PinealGlandOptic joins (~PinealGla@37.115.210.35) |
| 22:37:14 | → | dispater joins (~dispater@user/brprice) |
| 22:37:22 | <geekosaur> | _73, the smallest value ghc natively supports is a machine word, so a vector of 8 Word8s takes up the same space as a vector of Word64s on a 64-bit platform |
| 22:37:37 | <geekosaur> | this is a GHC limitation, not a Vector limitation |
| 22:38:02 | <geekosaur> | that said, there are variants of Vector which go behind GHC's back and support packed vectors |
| 22:39:03 | × | euouae quits (~euouae@user/euouae) (Quit: Ping timeout (120 seconds)) |
| 22:39:11 | <_73> | geekosaur: are you saying that in the end Word8's take up 64 bits on my 64-bit computer? |
| 22:39:20 | <geekosaur> | yes |
| 22:39:36 | × | vysn quits (~vysn@user/vysn) (Remote host closed the connection) |
| 22:40:09 | <geekosaur> | ghc 9.2 is taking the first steps in changing this but I believe it still requires word-size alignment right now,, so things won't change there |
| 22:40:21 | <_73> | oh ok. I need to look into packed vectors then. |
| 22:40:53 | <geekosaur> | I *think* Nyou want Storable Vector |
| 22:42:37 | → | roboguy__ joins (~roboguy_@2605:a601:afe7:9f00:cdb7:2350:8543:710d) |
| 22:42:40 | <_73> | So if I have a length 8 `Data.Vector.Storable.Vector Word8` it will truly be 64 bits? |
| 22:43:50 | <geekosaur> | I said "I *think*". I haven't looked closely and there's several vector variants I haven't used yet., including both storable and unpacked vectors |
| 22:44:00 | <geekosaur> | someone else here may know more |
| 22:44:27 | <_73> | ok thanks for this. |
| 22:45:01 | → | robogu___ joins (~roboguy_@2605:a601:afe7:9f00:49e1:58f7:bf60:9b3c) |
| 22:46:10 | × | sim590 quits (~simon@modemcable090.207-203-24.mc.videotron.ca) (Ping timeout: 240 seconds) |
| 22:46:24 | × | roboguy_ quits (~roboguy_@2605:a601:afe7:9f00:6574:78ba:36fc:f777) (Ping timeout: 272 seconds) |
| 22:47:11 | <geekosaur> | meanwhile it's even worse than you think because normal Vectors are also storing a worde-sized constructor tag even though it's always 0 for Word8 |
| 22:47:46 | × | roboguy__ quits (~roboguy_@2605:a601:afe7:9f00:cdb7:2350:8543:710d) (Ping timeout: 240 seconds) |
| 22:48:32 | <geekosaur> | so 8 Word8s take up 32 words or 256 bytes |
| 22:49:18 | × | Cajun quits (~Cajun@user/cajun) (Quit: Client closed) |
| 22:49:19 | → | roboguy_ joins (~roboguy_@2605:a601:afe7:9f00:38b9:e9e9:c93:b099) |
| 22:49:43 | <nshepperd> | unboxed and storable vectors should both be efficient i think |
| 22:51:00 | <_73> | ok this was the kind of thing I was worried about and why I asked the question in the first place. Im looking for the closest thing I can get to an immutable C array. |
| 22:51:01 | <nshepperd> | the difference is that storable uses pinned memory that you can use with the FFI |
| 22:51:33 | <geekosaur> | that'd be (and be the point of) Storable |
| 22:52:38 | × | robogu___ quits (~roboguy_@2605:a601:afe7:9f00:49e1:58f7:bf60:9b3c) (Ping timeout: 258 seconds) |
| 22:54:09 | <monochrom> | Some of the very primitive low-level bytearray types in GHC.* would be the only thing remotely close to a C array, mutable or immutable. |
| 22:54:16 | <nshepperd> | unboxed uses https://hackage.haskell.org/package/primitive-0.7.2.0/docs/Data-Primitive-ByteArray.html for storage |
| 22:54:52 | <monochrom> | Meaning, you don't spend 8 bytes to store size, you don't spend 8 bytes to store one level of indirection. |
| 22:54:53 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 22:56:14 | <monochrom> | Of an 8-element array, the Data.Vector.* solutions of "8 bytes for size, 8 bytes for offset index, 8 bytes for pointer to the actual bytes" is very significant. |
| 22:56:49 | <monochrom> | And oh 8 bytes for the data constructor itself, too. |
| 22:59:04 | × | nvmd quits (~nvmd@user/nvmd) (Quit: Later, nerds.) |
| 23:00:11 | → | sim590 joins (~simon@modemcable090.207-203-24.mc.videotron.ca) |
| 23:00:37 | <monochrom> | And I have unfavourable opinions on optimizing merely 8 elements, too. |
| 23:02:01 | <monochrom> | If you have a million instances of these 8-element arrays, the container that contains those 1 million pointers would be just as worrisome. |
| 23:02:48 | <monochrom> | If your question is a proxy question for "I really have 1 array of 1 million elements", that's very easy to whip up some code to empirically measure. |
| 23:02:50 | × | Pickchea quits (~private@user/pickchea) (Quit: Leaving) |
| 23:03:40 | <_73> | I really have 1 array of 1 million elements. Each element is a Word8. |
| 23:03:50 | → | lavaman joins (~lavaman@98.38.249.169) |
| 23:04:25 | <dsal> | That's very verbose. |
| 23:07:55 | <_73> | I know. I have been at this weeks. I am making a Y86-64 implementation (simple version of X86-64), and the 2 main goals of the project are purity, and accuracy to a true Y86-64 computer. I still can't think of a better way to represent memory. |
| 23:08:10 | → | euouae joins (~euouae@user/euouae) |
| 23:08:21 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 258 seconds) |
| 23:08:24 | <euouae> | https://termbin.com/tdaw -- here is my Hangman lib |
| 23:08:53 | <euouae> | with confusing logic and overengineering |
| 23:09:00 | <euouae> | and if possible, underengineering too |
| 23:09:26 | × | Melantha quits (~pyon@user/pyon) (Quit: WeeChat 3.2) |
| 23:10:42 | <dsal> | Yeah, I don't really like that `[CharStatus]` thing because once a character is guessed, it needs to be revealed (unless you require them to guess the same thing multiple times). |
| 23:11:00 | <dsal> | I was thinking something more like this: |
| 23:11:13 | <dsal> | > let st = ("This is a string", ['a', 's', 't', ' ']); printG (s, ls) = map (\x -> bool '_' x (x `elem` ls)) s in printG st |
| 23:11:15 | <lambdabot> | "___s _s a st____" |
| 23:11:30 | <euouae> | yeah but these are haskell tricks you're doing |
| 23:11:35 | <euouae> | little tricks for the pros |
| 23:11:40 | <dsal> | heh. Did I do a trick? |
| 23:12:11 | <euouae> | I didn't know of 'bool' |
| 23:12:22 | <dsal> | Oh. |
| 23:12:29 | <dsal> | That's just a function. |
| 23:12:34 | <dsal> | > let st = ("This is a string", ['a', 's', 't', ' ']); printG (s, ls) = map (\x -> if x `elem` ls then x else '_') s in printG st |
| 23:12:36 | <lambdabot> | "___s _s a st____" |
| 23:12:58 | <c_wraith> | at least bool is in base now. It was awkward not having a function that did that without adding packages |
| 23:13:12 | <dsal> | It's similar to yours, I just separated the string being guessed from the list of chars. I also didn't do a case conversion. |
| 23:13:30 | <dsal> | > let st = ("This is a string", ['a', 's', 't', ' ']); printG (s, ls) = map (\x -> bool '_' x (toLower x `elem` ls)) s in printG st |
| 23:13:32 | <lambdabot> | "T__s _s a st____" |
| 23:14:06 | <dsal> | But the idea is you've got the one thing that's the input being guessed, and you've got the list of guesses. You can track how many guesses there were and you can apply that list of guesses when forming the string. |
| 23:14:24 | <euouae> | It's not that I couldnt' write this myself |
| 23:14:34 | <euouae> | I guess I'm more struggling with the rest of it, the state of the game and updating it, reading input etc |
| 23:16:16 | <dsal> | Sure, I'm suggesting reducing state a bit. With the data structure I've got there, you've won when all the letters in your word are in the list. A guess adds a word to that list and does that evaluation. |
| 23:16:44 | <euouae> | Yeh you've won when s == printG s |
| 23:17:06 | <dsal> | You can compute bad guesses by counting words in the list that aren't in the word, and good guesses are the other ones. The minimally required state makes the necessary functions emerge pretty easily. |
| 23:17:12 | <dsal> | Yeah, I didn't even think about doing it that way. :) |
| 23:17:34 | <euouae> | What do you think about 'CurrentState'? It's supposed to keep track of what happpend in the last move, which helps i.e. with the next user message |
| 23:17:43 | <_73> | the way you represent the state of the game and update it with `update :: Game -> Char -> Game` makes sense to me. You cannot just modify some global state like in regular languages, you have to pass an old state and return a new state and that is what you did. |
| 23:18:29 | <dsal> | euouae: CurrentState seems to conflate total game state and previous move state. |
| 23:18:37 | → | futty joins (~futty@c83-252-75-55.bredband.tele2.se) |
| 23:18:50 | <dsal> | but yeah, as _73 says, that part looks right. |
| 23:19:15 | <euouae> | How do you keep it in a loop until the game is over? |
| 23:19:17 | → | rlp10 joins (~rlp10@cpc77289-basf12-2-0-cust607.12-3.cable.virginm.net) |
| 23:19:35 | <dsal> | I think the confusion is mixing all that state up. You can decide whether a particular guess is good or bad by just checking to see if the char you just picked up is in the list. |
| 23:20:05 | <dsal> | `until (gameOver st) $ repl st` |
| 23:20:23 | <euouae> | Yeah, I see what you mean. Minimal state is good for this problem but I was trying to engineer it |
| 23:20:28 | <rlp10> | How do I create a lazy list (from which I can 'take') when I already have the first item and a function (call it 'nextItem') which takes the previous item in the list and gives the next one? |
| 23:20:41 | <dsal> | :t iterate -- rlp10 |
| 23:20:42 | <lambdabot> | (a -> a) -> a -> [a] |
| 23:20:52 | <rlp10> | dsal: Thank you! |
| 23:20:54 | → | kor1 joins (~kor1@user/kor1) |
| 23:21:07 | ← | kor1 parts (~kor1@user/kor1) () |
| 23:22:00 | <euouae> | wait how does until work |
| 23:22:01 | <euouae> | I'm confused |
| 23:22:12 | × | jgeerds quits (~jgeerds@55d45555.access.ecotel.net) (Ping timeout: 245 seconds) |
| 23:22:21 | <dsal> | :t until |
| 23:22:22 | <lambdabot> | (a -> Bool) -> (a -> a) -> a -> a |
| 23:22:26 | <euouae> | aah nice. I see |
| 23:22:39 | <euouae> | Good ol recursion saves the day |
| 23:22:50 | <dsal> | @hoogle until |
| 23:22:50 | <lambdabot> | Prelude until :: (a -> Bool) -> (a -> a) -> a -> a |
| 23:22:50 | <lambdabot> | GHC.Base until :: (a -> Bool) -> (a -> a) -> a -> a |
| 23:22:50 | <lambdabot> | Test.Hspec.Discover until :: () => (a -> Bool) -> (a -> a) -> a -> a |
| 23:23:10 | <dsal> | I meant unless |
| 23:23:18 | <dsal> | :t unless -- euouae |
| 23:23:19 | <lambdabot> | Applicative f => Bool -> f () -> f () |
| 23:23:24 | <euouae> | Oh, unless! Whoopos :D |
| 23:23:27 | × | pschorf quits (~user@c-73-77-28-188.hsd1.tx.comcast.net) (Ping timeout: 245 seconds) |
| 23:23:36 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 23:23:42 | <euouae> | How do I use hedgehog for unit tests |
| 23:23:44 | <dsal> | I actually am not familiar with until. That's strange. |
| 23:23:53 | <dsal> | I've recently started using hedgehog. |
| 23:24:26 | <euouae> | Seems complicated |
| 23:24:35 | <euouae> | Not sure what generators are |
| 23:24:39 | <dsal> | You just have to think of the property that's useful and build the generators around it. |
| 23:24:42 | <dsal> | A generator creates input. |
| 23:25:02 | <euouae> | So a generator for Int is, say, a random even Int? |
| 23:25:07 | <dsal> | So like, you might have a phrase generator that creates a string "some test for junk" |
| 23:25:58 | <dsal> | Then you could say something like "after all chars in this string are guessed, the game is over and I won" |
| 23:26:48 | <euouae> | With until? yeah. I notice I have until and not unless |
| 23:26:58 | <dsal> | I've mostly used QuickCheck so my brain still thinks of things that way. There are specific generator functions that give you different parts of range and stuff. |
| 23:26:58 | <euouae> | At least in GHC.Base |
| 23:27:07 | <dsal> | unless is Control.Monad |
| 23:27:11 | <dsal> | I have no idea what until is. heh |
| 23:27:24 | <euouae> | until is pure |
| 23:27:40 | <euouae> | It's basically like iterate and take the first non-failure |
| 23:27:49 | <dsal> | Yeah. I've not had a use for that before. |
| 23:28:06 | <euouae> | Well, come to think of it, I can't use until since my functions need IO |
| 23:28:13 | <euouae> | or I'd have to use >>= etc |
| 23:28:43 | <dsal> | Forget I ever said until because that was confusing. I meant unless. |
| 23:28:58 | <euouae> | Yaeh np I am on the same page now |
| 23:29:13 | <dsal> | You have `repl :: Game -> IO Game` -- that needs to loop while the game is running, doesn't it? |
| 23:29:58 | <euouae> | Yeah |
| 23:29:59 | <dsal> | @hoogle untilM -- If you want to get fancy |
| 23:30:00 | <lambdabot> | Prelude undefined :: forall (r :: RuntimeRep) . forall (a :: TYPE r) . HasCallStack => a |
| 23:30:00 | <lambdabot> | Control.Exception.Base absentSumFieldError :: a |
| 23:30:00 | <lambdabot> | Text.Printf errorShortFormat :: a |
| 23:30:11 | <dsal> | that's... not what's supposed to happen |
| 23:30:13 | <dsal> | @hoogle untilM |
| 23:30:13 | <lambdabot> | Control.Monad.Loops untilM :: Monad m => m a -> m Bool -> m [a] |
| 23:30:13 | <lambdabot> | Control.Monad.HT untilM :: Monad m => (a -> Bool) -> m a -> m a |
| 23:30:13 | <lambdabot> | Control.Monad.Loops untilM' :: (Monad m, MonadPlus f) => m a -> m Bool -> m (f a) |
| 23:30:21 | <dsal> | But you can just use unless for that. |
| 23:30:21 | <euouae> | Lol |
| 23:30:30 | <_73> | I made this modification to the repl function. It is not fancy like untilM: http://dpaste.com/695CCJ27U |
| 23:30:52 | <euouae> | ooh modifications :D |
| 23:30:55 | <dsal> | Yeah, that's basically `unless` |
| 23:31:45 | <dsal> | This is the implementation of unless: `unless p s = if p then pure () else s` |
| 23:31:51 | <euouae> | Yeah nice, thanks for that. Makes it clear |
| 23:32:40 | <euouae> | That doesn't look like a loop, unless I call it inside repl |
| 23:33:00 | <euouae> | Oh OK. So untilM is the fancy way of doing it, where you don't have to write it /inside/ repl |
| 23:33:58 | <dsal> | `untilM` is a little extra fancy because the condition is monadic as well: `untilM :: Monad m => m a -> m Bool -> m [a]` |
| 23:34:33 | <dsal> | But doing explicit recursion is fine. The nice thing about doing that condition explicitly is that you can return the final game state (or whatever you think that should return) |
| 23:36:53 | <euouae> | _73's code? |
| 23:37:09 | <euouae> | (is that... a boost lambda?) |
| 23:37:38 | <dsal> | ? |
| 23:37:45 | euouae | made a joke about the IRC user handle |
| 23:37:50 | → | jmorris joins (uid433911@id-433911.stonehaven.irccloud.com) |
| 23:38:22 | <euouae> | But the explicit recursion you spoke of, that's shown in the dpaste above. Or are you including unless? |
| 23:39:01 | <dsal> | Well, they're both explicit recursion, but `unless` can only return (), with the dpaste above you can return whatever you want. |
| 23:39:54 | <euouae> | Gotcha |
| 23:41:52 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 23:44:16 | <euouae> | Nice, thanks you two :) |
| 23:45:10 | <euouae> | One issue for me is that I'm too used to writing C++ to the point where I am trained to think in ways that optimize in time or space |
| 23:45:44 | <euouae> | Can't strike a sensible balance |
| 23:46:17 | <euouae> | It's a hangman game, have some mercy! |
| 23:47:01 | × | rlp10 quits (~rlp10@cpc77289-basf12-2-0-cust607.12-3.cable.virginm.net) (Ping timeout: 246 seconds) |
| 23:48:24 | × | MoC quits (~moc@user/moc) (Quit: Konversation terminated!) |
| 23:51:33 | × | neightchan quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 23:51:53 | → | natechan joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) |
| 23:54:54 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
All times are in UTC on 2021-08-06.