Logs: liberachat/#haskell
| 2021-07-23 02:59:51 | <slycelote_> | in the first example return "returns" immediately I guess |
| 2021-07-23 03:00:48 | <romes85> | :) I'm very happy, thank you for your insights |
| 2021-07-23 03:02:41 | × | Null_A quits (~null_a@2601:645:8700:2290:b5ac:63df:d679:fb5d) (Remote host closed the connection) |
| 2021-07-23 03:03:25 | → | Null_A joins (~null_a@2601:645:8700:2290:b5ac:63df:d679:fb5d) |
| 2021-07-23 03:04:20 | <Axman6> | romes85: using "return !$ doo" is often a good way to force things, at least to WHNF |
| 2021-07-23 03:04:49 | <Axman6> | so you should be able to say return !$ y which would ensure that y is evaluated before being passed to return |
| 2021-07-23 03:05:04 | × | favonia quits (~favonia@user/favonia) (Ping timeout: 256 seconds) |
| 2021-07-23 03:05:29 | → | favonia joins (~favonia@user/favonia) |
| 2021-07-23 03:06:14 | <romes85> | I still don't understand WHNF completely, but I'll look into it soon and remember what you said. I'll also attempt to use that operator |
| 2021-07-23 03:06:44 | <Axman6> | it's when a value is evaluated enough to know which constructor it is |
| 2021-07-23 03:07:44 | <romes85> | did you mean $! ? |
| 2021-07-23 03:07:46 | <Axman6> | in the case of Bool, that means fully evaluating it. but if you have return $! (undefined :: Either String Bool) then this will blow up right away, if you have return $! (Left undefined) this won't blow up until someone looks at that value in the Left |
| 2021-07-23 03:07:57 | <Axman6> | uh yeah |
| 2021-07-23 03:08:03 | <romes85> | oh, that's a good explanation |
| 2021-07-23 03:09:21 | → | m7zs3gzw joins (~m7zs3gzw@188.170.195.101) |
| 2021-07-23 03:09:40 | <romes85> | yep, $! also works |
| 2021-07-23 03:09:55 | <romes85> | thank you everyone, it's 4AM, I'm logging off |
| 2021-07-23 03:10:26 | <Axman6> | D: |
| 2021-07-23 03:10:38 | <romes85> | ahahahah I've been at this timeout problem for hours |
| 2021-07-23 03:11:10 | <romes85> | lazy IO, who would've thought, here I was thinking that's the kind of thing "that only happens to others" hahahah |
| 2021-07-23 03:11:22 | <Axman6> | I don't think this is lazy IO |
| 2021-07-23 03:11:26 | <romes85> | oh |
| 2021-07-23 03:11:27 | <romes85> | :) |
| 2021-07-23 03:11:39 | <romes85> | it's just general lazy ? ahaha |
| 2021-07-23 03:11:54 | <Axman6> | lazy IO generally refers to things like how readFile works, where it reads from the String it produces as you demant more characters |
| 2021-07-23 03:12:09 | <romes85> | understood :) |
| 2021-07-23 03:12:15 | <Axman6> | yeah just normal laziness, in that values returned by IO may not have been evaluated when they're returned |
| 2021-07-23 03:12:43 | <romes85> | got it, good night! |
| 2021-07-23 03:12:49 | × | romes85 quits (~romes@44.190.189.46.rev.vodafone.pt) (Quit: Client closed) |
| 2021-07-23 03:12:51 | <slycelote_> | yeah, lazy in IO would be better way to put it :) |
| 2021-07-23 03:13:02 | × | m7zs3gzw quits (~m7zs3gzw@188.170.195.101) (Remote host closed the connection) |
| 2021-07-23 03:13:16 | → | m7zs3gzw joins (~m7zs3gzw@188.170.195.101) |
| 2021-07-23 03:13:20 | <h98> | i'm honestly surprised that could be a thing..is it actually a thing? |
| 2021-07-23 03:13:37 | <h98> | when I do an IO (), I expect an IO action to be performed |
| 2021-07-23 03:14:10 | <slycelote_> | not when you ignore the result |
| 2021-07-23 03:14:44 | <slycelote_> | > return undefined >> return 5 |
| 2021-07-23 03:14:45 | <lambdabot> | error: |
| 2021-07-23 03:14:45 | <lambdabot> | • Ambiguous type variable ‘m0’ arising from a use of ‘show_M555254866422... |
| 2021-07-23 03:14:46 | <lambdabot> | prevents the constraint ‘(Show (m0 Integer))’ from being solved. |
| 2021-07-23 03:14:49 | <monochrom> | (Sarcasm) Right, for example, the result of putStrLn "hello" is (). If you ignore the () result, hello is not printed. |
| 2021-07-23 03:15:04 | <slycelote_> | > return undefined >> return (5 :: Int) |
| 2021-07-23 03:15:06 | <lambdabot> | error: |
| 2021-07-23 03:15:06 | <lambdabot> | • Ambiguous type variable ‘m0’ arising from a use of ‘show_M288721645296... |
| 2021-07-23 03:15:06 | <lambdabot> | prevents the constraint ‘(Show (m0 Int))’ from being solved. |
| 2021-07-23 03:15:21 | <slycelote_> | > return (undefined :: Int) >> return (5 :: Int) |
| 2021-07-23 03:15:22 | <lambdabot> | error: |
| 2021-07-23 03:15:22 | <lambdabot> | • Ambiguous type variable ‘m0’ arising from a use of ‘show_M141220481975... |
| 2021-07-23 03:15:22 | <lambdabot> | prevents the constraint ‘(Show (m0 Int))’ from being solved. |
| 2021-07-23 03:15:35 | <slycelote_> | grr, why? :-D |
| 2021-07-23 03:15:42 | <monochrom> | If you have "getLine >> putStrLn "hello"", you are ignoring both the result of getLine and putStrLn, so nothing happens at all. |
| 2021-07-23 03:16:39 | <monochrom> | If that is contrary to what you actually observe, then it means the model "nothing happens when you ignore the result" is wrong. |
| 2021-07-23 03:17:36 | <c_wraith> | > let x = putStrLn "hi" in 3 |
| 2021-07-23 03:17:37 | × | nate1 quits (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 245 seconds) |
| 2021-07-23 03:17:37 | <lambdabot> | 3 |
| 2021-07-23 03:17:43 | <c_wraith> | I ignored the result. :) |
| 2021-07-23 03:17:46 | <monochrom> | haha |
| 2021-07-23 03:18:20 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 255 seconds) |
| 2021-07-23 03:18:25 | <monochrom> | I have a student who is trying very hard to code up "newvalue = foo >>= \x -> return x" to set newvalue to that x. |
| 2021-07-23 03:18:41 | → | dtman34 joins (~dtman34@c-73-62-246-247.hsd1.mn.comcast.net) |
| 2021-07-23 03:19:10 | <slycelote_> | I mean in your examples there's actual I/O |
| 2021-07-23 03:19:20 | × | Null_A quits (~null_a@2601:645:8700:2290:b5ac:63df:d679:fb5d) (Remote host closed the connection) |
| 2021-07-23 03:19:27 | <motle> | ah, the old teaching by example... |
| 2021-07-23 03:19:34 | → | Null_A joins (~null_a@2601:645:8700:2290:b5ac:63df:d679:fb5d) |
| 2021-07-23 03:19:50 | <motle> | eg. \x -> ... |
| 2021-07-23 03:20:33 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Remote host closed the connection) |
| 2021-07-23 03:21:33 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 2021-07-23 03:24:13 | <h98> | I've just been using Ptrs too much lately...though malloc and free have never misled me :) |
| 2021-07-23 03:24:36 | <motle> | h98: what language? |
| 2021-07-23 03:24:45 | <h98> | haskell hah |
| 2021-07-23 03:24:57 | <motle> | no, they never misled me either!? |
| 2021-07-23 03:25:48 | × | m7zs3gzw quits (~m7zs3gzw@188.170.195.101) (Ping timeout: 272 seconds) |
| 2021-07-23 03:26:02 | → | m7zs3gzw joins (~m7zs3gzw@178.155.6.203) |
| 2021-07-23 03:27:43 | × | zebrag quits (~chris@user/zebrag) (Remote host closed the connection) |
| 2021-07-23 03:28:29 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 2021-07-23 03:28:53 | → | soft-warm joins (~soft-warm@2600:8801:db01:8f0:70ab:eb3d:e48f:3a0f) |
| 2021-07-23 03:32:24 | × | falafel_ quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Ping timeout: 252 seconds) |
| 2021-07-23 03:39:01 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-23 03:40:39 | × | h98 quits (~h98@187.83.249.216.dyn.smithville.net) (Quit: Client closed) |
| 2021-07-23 03:41:20 | × | favonia quits (~favonia@user/favonia) (Ping timeout: 256 seconds) |
| 2021-07-23 03:42:12 | × | johnw quits (~johnw@2600:1700:cf00:db0:b972:d95b:bd23:4be) (Ping timeout: 245 seconds) |
| 2021-07-23 03:43:47 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 2021-07-23 03:44:19 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-23 03:46:08 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 2021-07-23 03:46:22 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-23 03:46:31 | × | machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 258 seconds) |
| 2021-07-23 03:47:57 | × | chris_ quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-07-23 03:49:36 | → | favonia joins (~favonia@user/favonia) |
| 2021-07-23 03:51:39 | → | chris_ joins (~chris@81.96.113.213) |
| 2021-07-23 03:56:06 | → | nate1 joins (~nate@108-233-125-227.lightspeed.sntcca.sbcglobal.net) |
| 2021-07-23 03:59:42 | × | jmorris quits (uid433911@id-433911.stonehaven.irccloud.com) (Quit: Connection closed for inactivity) |
| 2021-07-23 04:00:10 | × | soft-warm quits (~soft-warm@2600:8801:db01:8f0:70ab:eb3d:e48f:3a0f) (Ping timeout: 246 seconds) |
| 2021-07-23 04:00:29 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 2021-07-23 04:01:01 | → | lavaman joins (~lavaman@98.38.249.169) |
| 2021-07-23 04:05:05 | × | favonia quits (~favonia@user/favonia) (Ping timeout: 250 seconds) |
| 2021-07-23 04:05:28 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds) |
| 2021-07-23 04:05:29 | → | favonia joins (~favonia@user/favonia) |
| 2021-07-23 04:09:05 | → | P1RATEZ joins (piratez@user/p1ratez) |
| 2021-07-23 04:10:12 | × | hexfive quits (~eric@50.35.83.177) (Quit: WeeChat 3.0) |
| 2021-07-23 04:16:01 | × | terrorjack quits (~terrorjac@ec2-54-95-39-30.ap-northeast-1.compute.amazonaws.com) (Read error: Connection reset by peer) |
| 2021-07-23 04:17:12 | → | terrorjack joins (~terrorjac@ec2-54-95-39-30.ap-northeast-1.compute.amazonaws.com) |
All times are in UTC.