Logs: freenode/#haskell
| 2021-03-12 16:32:24 | × | ddellaco_ quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection) |
| 2021-03-12 16:32:29 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2021-03-12 16:32:55 | <lyxia> | > let f | let b :: Bool ; b = True , b = 0 in f |
| 2021-03-12 16:32:56 | <lambdabot> | 0 |
| 2021-03-12 16:35:52 | <tomjaguarpaw> | Interesting, thanks! One day I may understand Haskell's syntax |
| 2021-03-12 16:37:34 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 2021-03-12 16:38:42 | × | frozenErebus quits (~frozenEre@94.128.82.20) (Ping timeout: 256 seconds) |
| 2021-03-12 16:39:54 | × | joebobjoe quits (~joebobjoe@unaffiliated/joebobjoe) (Ping timeout: 246 seconds) |
| 2021-03-12 16:39:58 | → | ukari joins (~ukari@unaffiliated/ukari) |
| 2021-03-12 16:40:32 | → | joebobjoe joins (~joebobjoe@unaffiliated/joebobjoe) |
| 2021-03-12 16:40:41 | → | shutdown_-h_now joins (~arjan@2001:1c06:2d0b:2312:84fd:19e6:b34a:aa93) |
| 2021-03-12 16:40:56 | × | vchlup_ quits (~vchlup@nat.brnet.cz) (Read error: Connection reset by peer) |
| 2021-03-12 16:41:23 | → | vchlup_ joins (~vchlup@nat.brnet.cz) |
| 2021-03-12 16:45:35 | → | ezrakilty joins (~ezrakilty@75-172-115-167.tukw.qwest.net) |
| 2021-03-12 16:45:40 | × | joebobjoe quits (~joebobjoe@unaffiliated/joebobjoe) (Ping timeout: 276 seconds) |
| 2021-03-12 16:47:42 | → | crobbins joins (~crobbins@2601:2c1:200:ec50:e447:130a:d760:fb15) |
| 2021-03-12 16:49:04 | × | ixlun quits (~user@109.249.184.132) (Read error: Connection reset by peer) |
| 2021-03-12 16:50:36 | × | Kaiepi quits (~Kaiepi@47.54.252.148) (Ping timeout: 256 seconds) |
| 2021-03-12 16:50:53 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:c79:3d13:d977:c947) |
| 2021-03-12 16:51:41 | → | ep1ctetus_ joins (~epictetus@ip72-194-215-136.sb.sd.cox.net) |
| 2021-03-12 16:51:44 | → | ixlun joins (~user@109.249.184.132) |
| 2021-03-12 16:51:50 | → | Kaiepi joins (~Kaiepi@47.54.252.148) |
| 2021-03-12 16:52:10 | × | Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection) |
| 2021-03-12 16:52:30 | → | Kaiepi joins (~Kaiepi@47.54.252.148) |
| 2021-03-12 16:52:42 | × | kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection) |
| 2021-03-12 16:53:04 | → | geekosaur joins (82650c7a@130.101.12.122) |
| 2021-03-12 16:54:26 | × | rj quits (~x@gateway/tor-sasl/rj) (Ping timeout: 268 seconds) |
| 2021-03-12 16:54:35 | → | kritzefitz joins (~kritzefit@212.86.56.80) |
| 2021-03-12 16:55:45 | × | epicte7us quits (~epictetus@152.89.204.159) (Ping timeout: 264 seconds) |
| 2021-03-12 16:55:53 | → | rj joins (~x@gateway/tor-sasl/rj) |
| 2021-03-12 17:01:44 | × | toorevitimirp quits (~tooreviti@117.182.180.50) (Remote host closed the connection) |
| 2021-03-12 17:02:29 | × | nyaomin quits (~naomi@cpe-74-75-6-125.maine.res.rr.com) (Ping timeout: 265 seconds) |
| 2021-03-12 17:03:27 | × | ph88_ quits (~ph88@ip5f5af71a.dynamic.kabel-deutschland.de) (Ping timeout: 265 seconds) |
| 2021-03-12 17:04:13 | → | borne joins (~fritjof@2a06:8782:ffbb:1337:e811:68d9:a46:a27f) |
| 2021-03-12 17:05:42 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-03-12 17:06:12 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:c79:3d13:d977:c947) (Remote host closed the connection) |
| 2021-03-12 17:06:29 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-03-12 17:07:36 | × | hyperisco quits (~hyperisco@d192-186-117-226.static.comm.cgocable.net) (Ping timeout: 256 seconds) |
| 2021-03-12 17:10:41 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2021-03-12 17:11:00 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 2021-03-12 17:11:24 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Max SendQ exceeded) |
| 2021-03-12 17:11:43 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2021-03-12 17:12:13 | × | mrus quits (~mrus@128.199.8.231) (Ping timeout: 260 seconds) |
| 2021-03-12 17:12:28 | → | sparsity joins (5ce955fb@gateway/web/cgi-irc/kiwiirc.com/ip.92.233.85.251) |
| 2021-03-12 17:12:30 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Max SendQ exceeded) |
| 2021-03-12 17:12:34 | <sparsity> | hi |
| 2021-03-12 17:12:49 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2021-03-12 17:14:41 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 2021-03-12 17:15:33 | ← | jakalx parts (~jakalx@base.jakalx.net) ("Error from remote client") |
| 2021-03-12 17:18:06 | × | chele quits (~chele@ip5b40237d.dynamic.kabel-deutschland.de) (Remote host closed the connection) |
| 2021-03-12 17:25:34 | × | conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.) |
| 2021-03-12 17:26:09 | → | conal joins (~conal@64.71.133.70) |
| 2021-03-12 17:26:39 | → | michaelh joins (~user@ip-109-42-114-163.web.vodafone.de) |
| 2021-03-12 17:28:56 | × | thc202 quits (~thc202@unaffiliated/thc202) (Ping timeout: 240 seconds) |
| 2021-03-12 17:29:08 | × | notzmv quits (~zmv@unaffiliated/zmv) (Ping timeout: 256 seconds) |
| 2021-03-12 17:29:27 | × | stree quits (~stree@68.36.8.116) (Quit: Caught exception) |
| 2021-03-12 17:29:37 | → | conal_ joins (~conal@64.71.133.70) |
| 2021-03-12 17:29:53 | → | thc202 joins (~thc202@unaffiliated/thc202) |
| 2021-03-12 17:29:53 | → | stree joins (~stree@68.36.8.116) |
| 2021-03-12 17:30:18 | × | conal quits (~conal@64.71.133.70) (Ping timeout: 246 seconds) |
| 2021-03-12 17:31:36 | × | cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 3.0.1) |
| 2021-03-12 17:33:18 | → | cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) |
| 2021-03-12 17:35:17 | <michaelh> | Hi, Haskell beginner here. A state monad question, which I am just learning about. We'll see if I can explain it properly... So I have something like `do xs <- (takeWhile (> 0)) <$> mapM f [1..]`, where f has type `Int -> State (Map Int Int) Int`. Its a function which memoizes the calculations it does into a Map. This works as far as only the values are concerned, I get the list of Ints. But when I want to retrieve the state with `s <- |
| 2021-03-12 17:35:17 | <michaelh> | get`, it hangs. I suppose that's because the `mapM` operation works on an infinite list, and I'll never get the finished state. |
| 2021-03-12 17:35:32 | × | rajivr quits (uid269651@gateway/web/irccloud.com/x-xljhenfdjyrbvgti) (Quit: Connection closed for inactivity) |
| 2021-03-12 17:36:01 | <michaelh> | My question is: Is there a simple way to obtain the last state? That is the state after the caluclation of the last value of my finite list. |
| 2021-03-12 17:36:59 | × | rj quits (~x@gateway/tor-sasl/rj) (Ping timeout: 268 seconds) |
| 2021-03-12 17:37:13 | → | bahamas joins (~lucian@188.27.48.99) |
| 2021-03-12 17:37:13 | × | bahamas quits (~lucian@188.27.48.99) (Changing host) |
| 2021-03-12 17:37:13 | → | bahamas joins (~lucian@unaffiliated/bahamas) |
| 2021-03-12 17:37:15 | → | f-a joins (~f-a@151.36.221.225) |
| 2021-03-12 17:39:19 | <sm[m]> | michaelh: you say finite list, but your example shows an infinite one ? |
| 2021-03-12 17:40:56 | → | joebobjoe joins (~joebobjoe@unaffiliated/joebobjoe) |
| 2021-03-12 17:41:00 | × | Mrbuck quits (~Mrbuck@gateway/tor-sasl/mrbuck) (Quit: WeeChat 1.9.1) |
| 2021-03-12 17:41:26 | <koz_> | michaelh: If you're dealing with infinite lists + monads, you have to be _very_ careful. |
| 2021-03-12 17:41:32 | → | rj joins (~x@gateway/tor-sasl/rj) |
| 2021-03-12 17:41:46 | <michaelh> | sm[m]: The (takeWhile (> 0)) will give me a finite list, no? |
| 2021-03-12 17:41:50 | <koz_> | michaelh: No. |
| 2021-03-12 17:41:56 | <michaelh> | Oh |
| 2021-03-12 17:42:00 | <koz_> | The mapM has to drag its way through the _entire_ list first. |
| 2021-03-12 17:42:09 | <sm[m]> | as you suspected, the mapM tries to process the whole list |
| 2021-03-12 17:42:10 | <koz_> | Once you're in a monad, lists no longer stream. |
| 2021-03-12 17:42:25 | <koz_> | There was a question on this like, a few days ago. |
| 2021-03-12 17:42:34 | <sm[m]> | sequentiality is enforced, by this monad at least |
| 2021-03-12 17:42:42 | <koz_> | If you need this kind of behaviour (aka, streaming in a monad), you want something like pipes. |
| 2021-03-12 17:43:23 | <koz_> | sm[m]: This has nothing to do with sequentiality and everything to do with monads forcing full evaluation of said list. |
| 2021-03-12 17:43:23 | → | dbmikus joins (~dbmikus@cpe-76-167-86-219.natsow.res.rr.com) |
| 2021-03-12 17:43:31 | <koz_> | Because bind is a real pain. |
| 2021-03-12 17:43:37 | <koz_> | (or rather, a necessary evil) |
| 2021-03-12 17:43:47 | <fendor> | does haskell have a state of the art mutation testing framework? |
| 2021-03-12 17:43:56 | <koz_> | fendor: What's 'mutation testing'? |
| 2021-03-12 17:44:40 | <fendor> | koz_, you introduce small changes in your source-code programmatically, and run your test-suite against your changed code-base |
| 2021-03-12 17:44:42 | → | vavagee joins (~vavagee@122.172.247.204) |
| 2021-03-12 17:44:53 | ← | f-a parts (~f-a@151.36.221.225) () |
| 2021-03-12 17:45:00 | <michaelh> | Hehe okay. Well, then this was a lot harder than I thought. Still have some difficulty wrapping my head around just the state monad, so this obviously was a too hard a problem I chose for myself. |
| 2021-03-12 17:45:04 | <fendor> | if one of your test-case fails, the "mutation" has been killed, thus judging a bit your tests quality/coverage |
| 2021-03-12 17:45:06 | <michaelh> | Thanks sm[m] and koz_ |
| 2021-03-12 17:45:25 | <koz_> | michaelh: I would say this much - this is a problem with monads more generally. It's not specific to State. |
| 2021-03-12 17:45:32 | <koz_> | Finitize the list and it should go away. |
| 2021-03-12 17:45:50 | <koz_> | Basically, for now, keep in your head that 'once lists touch a monad, they no longer stream'. |
All times are in UTC.