Logs: liberachat/#haskell
| 2021-07-19 19:28:01 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 258 seconds) |
| 2021-07-19 19:29:49 | <h98> | yeah I think so |
| 2021-07-19 19:29:51 | × | Matthias1 quits (~Matthias1@cpe-76-170-236-166.socal.res.rr.com) (Remote host closed the connection) |
| 2021-07-19 19:29:52 | <h98> | I tried this: https://paste.tomsmeding.com/QVCoWxOz |
| 2021-07-19 19:30:05 | × | qbt quits (~edun@user/edun) (Quit: WeeChat 3.2) |
| 2021-07-19 19:30:14 | <h98> | if I compile and run it i get 6467616768 after a few seconds |
| 2021-07-19 19:30:26 | <h98> | if I call test in ghci I get a stack overflow |
| 2021-07-19 19:30:30 | <h98> | version 8.10.4 |
| 2021-07-19 19:32:16 | <euouae> | Thank you ! |
| 2021-07-19 19:32:27 | <euouae> | Did you have to enable optimizations ? |
| 2021-07-19 19:33:13 | <h98> | I have no idea how, so I don't think so |
| 2021-07-19 19:33:21 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 2021-07-19 19:34:14 | <euouae> | Thanks |
| 2021-07-19 19:34:22 | <geekosaur> | ghci can't do optimizations except in very recent versions |
| 2021-07-19 19:36:39 | × | maerwald quits (~maerwald@mail.hasufell.de) (Changing host) |
| 2021-07-19 19:36:39 | → | maerwald joins (~maerwald@user/maerwald) |
| 2021-07-19 19:37:30 | × | alx741 quits (~alx741@186.178.109.120) (Ping timeout: 252 seconds) |
| 2021-07-19 19:38:00 | <h98> | oh but foldl' works |
| 2021-07-19 19:38:38 | <h98> | https://paste.tomsmeding.com/dLbV73r1 same thing, but no overflow in ghci |
| 2021-07-19 19:39:35 | <h98> | RWH p. 97 talks about this |
| 2021-07-19 19:42:33 | → | Maxdamantus joins (~Maxdamant@user/maxdamantus) |
| 2021-07-19 19:42:52 | <dsal> | why is `sum` bad? Is this one of those things where fixing it breaks something probably nobody cares about? |
| 2021-07-19 19:44:39 | → | Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es) |
| 2021-07-19 19:46:05 | → | _73 joins (~user@pool-96-252-123-136.bstnma.fios.verizon.net) |
| 2021-07-19 19:46:08 | <monochrom> | I compiled with -O, no stack overflow, in fact immediate answer. |
| 2021-07-19 19:46:47 | <monochrom> | main = print (let xs = [1..256] in sum [ x+y+z | x <- xs, y <- xs, z <- xs ]) |
| 2021-07-19 19:46:59 | <geekosaur> | dsal, there was a whole discussion on -cafe about various things using foldl instead of foldl' |
| 2021-07-19 19:47:15 | <geekosaur> | and thereby being prone to stack overflows |
| 2021-07-19 19:47:28 | <geekosaur> | sum being the prime example |
| 2021-07-19 19:47:35 | <_73> | what is the right abstraction to avoid explicit recursion on a function using a monadic action. I tried to write it as a foldr but wasn't able to succeed. Here is my code that does use explicit recursion: http://dpaste.com/2SKMBLTA8 |
| 2021-07-19 19:48:15 | → | Matthias1 joins (~Matthias1@cpe-76-170-236-166.socal.res.rr.com) |
| 2021-07-19 19:48:32 | <dsal> | :t foldM |
| 2021-07-19 19:48:33 | <lambdabot> | (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b |
| 2021-07-19 19:48:48 | <geekosaur> | I think it comes down to nobody thought about it and the original Prelude was written for comprehensibility by newcomers rather than performance |
| 2021-07-19 19:49:05 | <dsal> | @src sum |
| 2021-07-19 19:49:06 | <lambdabot> | sum = foldl (+) 0 |
| 2021-07-19 19:49:22 | <monochrom> | Oh don't worry about @src, it's independently handwritten. |
| 2021-07-19 19:49:28 | <monochrom> | Hell, s/worry/trust/ |
| 2021-07-19 19:49:39 | <dsal> | Yeah. I just tend to assume it's a simplification for understanding. |
| 2021-07-19 19:49:57 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2021-07-19 19:50:10 | <monochrom> | Yeah, great educational tool. |
| 2021-07-19 19:50:44 | <geekosaur> | and @src is mostly lifted from the Report, and is similarly intended for reading rather than running |
| 2021-07-19 19:50:52 | × | paolino quits (~paolo@84.33.141.5) (Remote host closed the connection) |
| 2021-07-19 19:51:52 | × | oso quits (~oso@2601:58c:c080:a950:f275:2530:b398:680b) (Ping timeout: 246 seconds) |
| 2021-07-19 19:52:04 | → | alx741 joins (~alx741@186.178.108.174) |
| 2021-07-19 19:52:05 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-19 19:52:17 | → | o1lo01ol1o joins (~o1lo01ol1@bl11-109-140.dsl.telepac.pt) |
| 2021-07-19 19:52:32 | × | Maxdamantus quits (~Maxdamant@user/maxdamantus) (Ping timeout: 252 seconds) |
| 2021-07-19 19:52:42 | × | favonia quits (~favonia@user/favonia) (Ping timeout: 240 seconds) |
| 2021-07-19 19:52:55 | <_73> | I got it work with foldM thanks |
| 2021-07-19 19:53:28 | → | favonia joins (~favonia@user/favonia) |
| 2021-07-19 19:53:38 | × | Matthias1 quits (~Matthias1@cpe-76-170-236-166.socal.res.rr.com) (Ping timeout: 252 seconds) |
| 2021-07-19 19:56:51 | × | ziman quits (~ziman@user/ziman) (Ping timeout: 276 seconds) |
| 2021-07-19 19:57:11 | → | Matthias1 joins (~Matthias1@cpe-76-170-236-166.socal.res.rr.com) |
| 2021-07-19 19:57:17 | → | ziman joins (~ziman@c25-5.condornet.sk) |
| 2021-07-19 19:57:47 | × | o1lo01ol1o quits (~o1lo01ol1@bl11-109-140.dsl.telepac.pt) (Ping timeout: 255 seconds) |
| 2021-07-19 19:59:59 | × | ziman quits (~ziman@c25-5.condornet.sk) (Changing host) |
| 2021-07-19 19:59:59 | → | ziman joins (~ziman@user/ziman) |
| 2021-07-19 20:00:53 | <euouae> | Heh I got “killed” after I run ghc |
| 2021-07-19 20:01:14 | <euouae> | What does that mean ? |
| 2021-07-19 20:01:29 | <geekosaur> | the OOM killer got you |
| 2021-07-19 20:01:50 | × | Matthias1 quits (~Matthias1@cpe-76-170-236-166.socal.res.rr.com) (Ping timeout: 255 seconds) |
| 2021-07-19 20:01:57 | <geekosaur> | i.e. the Linux kernel decided your process was eating too much memory and nuked it |
| 2021-07-19 20:03:39 | <geekosaur> | (or similar for OS X, etc.; only Windows will differ but it has its own way of dealing with that) |
| 2021-07-19 20:04:39 | <euouae> | Hmm alright the oom reaper |
| 2021-07-19 20:05:15 | × | juhp quits (~juhp@128.106.188.66) (Ping timeout: 255 seconds) |
| 2021-07-19 20:06:33 | × | Obo quits (~roberto@70.pool90-171-81.dynamic.orange.es) (Ping timeout: 268 seconds) |
| 2021-07-19 20:07:44 | → | juhp joins (~juhp@128.106.188.66) |
| 2021-07-19 20:09:27 | × | norias quits (~jaredm@c-98-219-195-163.hsd1.pa.comcast.net) (Quit: Leaving) |
| 2021-07-19 20:15:09 | × | euouae quits (~euouae@user/euouae) (Quit: Ping timeout (120 seconds)) |
| 2021-07-19 20:15:31 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-19 20:15:51 | → | Matthias1 joins (~Matthias1@cpe-76-170-236-166.socal.res.rr.com) |
| 2021-07-19 20:16:07 | <ddb> | geekosaur: is that discussion about things using foldl instead of foldl' logged or archived anywhere? |
| 2021-07-19 20:17:23 | <maerwald> | can you have extaustiveness check with NamedFieldPuns? |
| 2021-07-19 20:18:25 | → | ubert joins (~Thunderbi@91.141.42.221.wireless.dyn.drei.com) |
| 2021-07-19 20:18:25 | <maerwald> | let's say you have Foo = Foo { foo1 :: String, foo2 :: String, foo3 :: String } and you want to pattern match on it without relying on the order, but also make sure you don't miss something when a new record is added |
| 2021-07-19 20:19:21 | → | me_ joins (~me@87-59-111-97-cable.dk.customer.tdc.net) |
| 2021-07-19 20:19:27 | × | me_ quits (~me@87-59-111-97-cable.dk.customer.tdc.net) (Client Quit) |
| 2021-07-19 20:19:49 | <maerwald> | Relying on order is shitty when all the records are of the same type |
| 2021-07-19 20:19:52 | → | me_ joins (~me@87-59-111-97-cable.dk.customer.tdc.net) |
| 2021-07-19 20:20:06 | × | MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Ping timeout: 255 seconds) |
| 2021-07-19 20:20:12 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 2021-07-19 20:20:33 | × | favonia quits (~favonia@user/favonia) (Ping timeout: 255 seconds) |
| 2021-07-19 20:20:58 | × | _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection) |
| 2021-07-19 20:21:18 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2021-07-19 20:22:19 | <geekosaur> | ddb, somewhere on the haskell-cafe mailing list archives |
| 2021-07-19 20:23:10 | → | MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com) |
| 2021-07-19 20:23:55 | × | me_ quits (~me@87-59-111-97-cable.dk.customer.tdc.net) (Remote host closed the connection) |
| 2021-07-19 20:24:06 | → | favonia joins (~favonia@user/favonia) |
| 2021-07-19 20:25:36 | → | zebrag joins (~chris@user/zebrag) |
| 2021-07-19 20:26:04 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Remote host closed the connection) |
| 2021-07-19 20:26:21 | → | Brumaire joins (~quassel@81-64-14-121.rev.numericable.fr) |
| 2021-07-19 20:30:18 | × | Brumaire quits (~quassel@81-64-14-121.rev.numericable.fr) (Remote host closed the connection) |
| 2021-07-19 20:30:19 | × | drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 268 seconds) |
| 2021-07-19 20:31:43 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-19 20:32:09 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 2021-07-19 20:35:04 | × | Matthias1 quits (~Matthias1@cpe-76-170-236-166.socal.res.rr.com) (Remote host closed the connection) |
| 2021-07-19 20:35:24 | → | Matthias1 joins (~Matthias1@cpe-76-170-236-166.socal.res.rr.com) |
| 2021-07-19 20:35:30 | × | BestSteve quits (~beststeve@220-135-3-239.HINET-IP.hinet.net) (Ping timeout: 245 seconds) |
| 2021-07-19 20:35:54 | → | BestSteve joins (~beststeve@220-135-3-239.HINET-IP.hinet.net) |
All times are in UTC.