Logs: freenode/#haskell
| 2021-05-13 14:41:08 | → | xft0 joins (~xft0@185.234.208.208.r.toneticgroup.pl) |
| 2021-05-13 14:42:21 | × | undvrainbowvita8 quits (~egp_@128-71-13-3.broadband.corbina.ru) (Read error: Connection reset by peer) |
| 2021-05-13 14:43:02 | → | kingswim joins (~kevinying@102.91.4.33) |
| 2021-05-13 14:43:15 | → | undvrainbowvita8 joins (~egp_@128-71-13-3.broadband.corbina.ru) |
| 2021-05-13 14:43:44 | → | chris__ joins (~chris@81.96.113.213) |
| 2021-05-13 14:44:07 | <kingswim> | why Just 9 >>= return Just 5 --- result is Just 9. but [6] >>= return [8] ---result is [8] |
| 2021-05-13 14:45:19 | <kingswim> | newbie help |
| 2021-05-13 14:46:20 | <Taneb> | kingswim: there's a few things going on here. Firstly, return is a function, not a statement. |
| 2021-05-13 14:46:34 | × | chris__ quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-05-13 14:46:58 | → | ddellac__ joins (~ddellacos@86.106.143.215) |
| 2021-05-13 14:47:04 | × | phaul quits (~phaul@ruby/staff/phaul) (Ping timeout: 268 seconds) |
| 2021-05-13 14:47:08 | → | chris__ joins (~chris@81.96.113.213) |
| 2021-05-13 14:47:26 | × | chris__ quits (~chris@81.96.113.213) (Remote host closed the connection) |
| 2021-05-13 14:47:30 | <Taneb> | Secondly, the way you're using "return" here isn't in the monad you're intending to use. Because the RHS of >>= should be a function, it uses the ((->) e) monad instance, so "return [8]" is the same as "\e -> [8]" |
| 2021-05-13 14:47:42 | → | chris__ joins (~chris@81.96.113.213) |
| 2021-05-13 14:48:30 | <Taneb> | Because return is a function, "return Just 5" is the same as "(return Just) 5", and we need this to have type "Integer -> Maybe something". |
| 2021-05-13 14:48:52 | <Taneb> | So "return Just" needs type "Integer -> Integer -> Maybe something" because we're passing it an integer |
| 2021-05-13 14:49:36 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 2021-05-13 14:51:04 | <Taneb> | return in the ((->) e) monad is the same as const |
| 2021-05-13 14:51:17 | <Taneb> | So "return Just 5" ends up the same as "Just" which is of the right type |
| 2021-05-13 14:51:37 | <Taneb> | But note that that's entirely dropped the 5 |
| 2021-05-13 14:51:46 | <Taneb> | kingswim: are you managing to follow this? |
| 2021-05-13 14:51:51 | <kingswim> | Taneb:trying to understand |
| 2021-05-13 14:52:00 | × | ddellac__ quits (~ddellacos@86.106.143.215) (Ping timeout: 268 seconds) |
| 2021-05-13 14:52:53 | <Taneb> | "[6] >>= return [8]" is the same as "[6] >>= \x -> [8]" |
| 2021-05-13 14:53:26 | <Taneb> | "Just 9 >>= return Just 5" is the same as "Just 9 >>= (\x -> Just) 5" is the same as "Just 9 >>= Just" is the same as "Just 9 >>= \x -> Just x" |
| 2021-05-13 14:53:43 | × | berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 260 seconds) |
| 2021-05-13 14:53:59 | → | wonko7 joins (~wonko7@62.115.229.50) |
| 2021-05-13 14:54:05 | → | kritzefitz joins (~kritzefit@212.86.56.80) |
| 2021-05-13 14:57:22 | → | berberman joins (~berberman@unaffiliated/berberman) |
| 2021-05-13 14:58:41 | ← | jakalx parts (~jakalx@base.jakalx.net) ("Error from remote client") |
| 2021-05-13 14:59:17 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 2021-05-13 15:00:16 | × | coot quits (~coot@37.30.58.122.nat.umts.dynamic.t-mobile.pl) (Quit: coot) |
| 2021-05-13 15:01:02 | <xenon-> | function monad is not the simplest one to grasp for beginners, so don't worry if you don't get it at this point |
| 2021-05-13 15:02:01 | × | berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 250 seconds) |
| 2021-05-13 15:02:56 | → | xkapastel joins (uid17782@gateway/web/irccloud.com/x-fkhouktirrkpcdzt) |
| 2021-05-13 15:03:16 | × | geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 252 seconds) |
| 2021-05-13 15:05:24 | → | itai33 joins (~itai@2a0d:6fc0:87d:b00:f50f:77b6:28be:b274) |
| 2021-05-13 15:05:25 | → | berberman joins (~berberman@unaffiliated/berberman) |
| 2021-05-13 15:05:44 | <itai33> | :q |
| 2021-05-13 15:06:01 | <xenon-> | > (do x <- (+10); y <- (*3); return $ x + y) 10 |
| 2021-05-13 15:06:03 | <lambdabot> | 50 |
| 2021-05-13 15:06:22 | → | tromp joins (~tromp@dhcp-077-249-230-040.chello.nl) |
| 2021-05-13 15:06:31 | itai33 | is now known as iyefrat |
| 2021-05-13 15:07:07 | × | CrazyPython quits (~crazypyth@206.214.238.6) (Ping timeout: 252 seconds) |
| 2021-05-13 15:08:27 | × | iyefrat quits (~itai@2a0d:6fc0:87d:b00:f50f:77b6:28be:b274) (Client Quit) |
| 2021-05-13 15:11:29 | × | tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 260 seconds) |
| 2021-05-13 15:13:11 | → | berberman_ joins (~berberman@unaffiliated/berberman) |
| 2021-05-13 15:13:18 | → | deejaytee joins (~deejaytee@193.46-255-62.static.virginmediabusiness.co.uk) |
| 2021-05-13 15:13:30 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 2021-05-13 15:14:13 | × | berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 276 seconds) |
| 2021-05-13 15:15:13 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 2021-05-13 15:17:33 | → | heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-05-13 15:17:45 | → | `slikts joins (~nelabs@2a00:d880:5:395::37ca) |
| 2021-05-13 15:17:45 | × | `slikts quits (~nelabs@2a00:d880:5:395::37ca) (Changing host) |
| 2021-05-13 15:17:45 | → | `slikts joins (~nelabs@wikipedia/reinis) |
| 2021-05-13 15:19:28 | × | berberman_ quits (~berberman@unaffiliated/berberman) (Ping timeout: 246 seconds) |
| 2021-05-13 15:19:34 | → | berberman joins (~berberman@unaffiliated/berberman) |
| 2021-05-13 15:19:43 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 2021-05-13 15:20:01 | × | ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection) |
| 2021-05-13 15:20:32 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 2021-05-13 15:20:36 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 2021-05-13 15:20:36 | × | chimera quits (~chimera@120-192-113-92.pool.ukrtel.net) (Quit: Konversation terminated!) |
| 2021-05-13 15:21:59 | → | ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net) |
| 2021-05-13 15:22:13 | × | heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 2021-05-13 15:22:54 | → | ddellac__ joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-05-13 15:27:11 | × | ddellac__ quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 246 seconds) |
| 2021-05-13 15:29:24 | → | isovector joins (~isovector@172.103.216.166) |
| 2021-05-13 15:30:01 | × | ixlun` quits (~user@109.249.184.235) (Quit: ERC (IRC client for Emacs 28.0.50)) |
| 2021-05-13 15:30:45 | → | ixlun joins (~user@109.249.184.235) |
| 2021-05-13 15:31:28 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-05-13 15:32:59 | → | boxscape joins (54a350dc@gateway/web/cgi-irc/kiwiirc.com/ip.84.163.80.220) |
| 2021-05-13 15:33:30 | → | proofofkeags joins (~proofofke@205.209.28.54) |
| 2021-05-13 15:38:15 | <boxscape> | I have a pattern that can't occur and get a warning no matter what I do - is there no way to make GHC happy here? |
| 2021-05-13 15:38:16 | <boxscape> | https://paste.tomsmeding.com/6nOwyiZb |
| 2021-05-13 15:39:01 | × | DavidEichmann quits (~david@156.59.147.147.dyn.plus.net) (Ping timeout: 252 seconds) |
| 2021-05-13 15:39:29 | × | zgrep quits (~zgrep@ircpuzzles/2015/april-fools/sixth/zgrep) (Quit: It's a quitter's world.) |
| 2021-05-13 15:40:07 | <boxscape> | guess I should try to find an example without singletons and check if the same happens in HEAD... |
| 2021-05-13 15:40:11 | <boxscape> | (no pun intended) |
| 2021-05-13 15:40:46 | <monochrom> | I would blame -Wall. |
| 2021-05-13 15:40:54 | → | zgrep joins (~zgrep@ircpuzzles/2015/april-fools/sixth/zgrep) |
| 2021-05-13 15:41:11 | <boxscape> | monochrom sure, but I *want* those warnings where they're appropriate, I just don't think non-exhaustive is appropriate here |
| 2021-05-13 15:41:40 | <monochrom> | I would not use -Wall. But if you insist, you have to locate the exact -W??? option that kills just the non-exhaustive-pattern warning. |
| 2021-05-13 15:41:54 | <geekosaur> | shouldn't it say? |
| 2021-05-13 15:42:06 | <geekosaur> | sadly it can't be applied just to that one place, at least not yet |
| 2021-05-13 15:42:06 | <boxscape> | -Wincomplete-patterns |
| 2021-05-13 15:42:18 | <geekosaur> | they'e still working over the errors/warnings system |
| 2021-05-13 15:43:22 | <dolio> | Warnings about incomplete patterns are desired in general, though, right? |
| 2021-05-13 15:43:26 | <boxscape> | yes |
| 2021-05-13 15:43:44 | <dolio> | The problem is that your type hackery is too complicated for the checker to figure out. |
| 2021-05-13 15:43:56 | <boxscape> | :( |
| 2021-05-13 15:44:42 | → | jao joins (~jao@pdpc/supporter/professional/jao) |
| 2021-05-13 15:44:48 | <boxscape> | It seems as though if ghc can figure something out once I add a pattern, it should in principle be figure-outable before I add that pattern, as least if it's not a nested pattern, but I suppose ghc just doesn't do that |
| 2021-05-13 15:45:26 | × | _bin quits (~bin@75-54-107-59.lightspeed.hstntx.sbcglobal.net) (Ping timeout: 240 seconds) |
| 2021-05-13 15:46:09 | × | waleee-cl quits (uid373333@gateway/web/irccloud.com/x-wurzaxiwxfwflzzd) (Quit: Connection closed for inactivity) |
| 2021-05-13 15:46:53 | × | ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 268 seconds) |
| 2021-05-13 15:48:30 | <dolio> | At some point I remember some work to make the exhaustiveness checker better in that respect, but I'm not sure what all it incorporates. |
| 2021-05-13 15:48:36 | → | alexander joins (~alexander@2a02:587:dc01:3b00:38f4:60b0:4dbb:46) |
| 2021-05-13 15:48:42 | → | ddellacosta joins (~ddellacos@2607:fb90:7bc8:cdb:85b6:fc05:3196:93a7) |
| 2021-05-13 15:49:05 | alexander | is now known as Guest28161 |
All times are in UTC.