Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 587 588 589 590 591 592 593 594 595 596 597 .. 5022
502,152 events total
2020-10-12 07:39:17 fleursdumal joins (4832064b@gateway/web/cgi-irc/kiwiirc.com/ip.72.50.6.75)
2020-10-12 07:40:49 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-10-12 07:41:15 kritzefitz joins (~kritzefit@fw-front.credativ.com)
2020-10-12 07:45:14 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-10-12 07:46:03 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2020-10-12 07:46:57 hackage ttn 0.2.0.0 - Things Tracker Network JSON Types https://hackage.haskell.org/package/ttn-0.2.0.0 (srk)
2020-10-12 07:47:15 × falafel quits (~falafel@2605:e000:1527:d491:1ccf:5c8d:7928:e9cc) (Ping timeout: 244 seconds)
2020-10-12 07:48:05 knupfer joins (~Thunderbi@dynamic-046-114-150-219.46.114.pool.telefonica.de)
2020-10-12 07:48:48 alp joins (~alp@2a01:e0a:58b:4920:8ce:75eb:bbc3:eb73)
2020-10-12 07:49:06 × jedws quits (~jedws@121.209.161.98) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-12 07:49:45 cpressey joins (~cpressey@88.144.68.224)
2020-10-12 07:50:31 × Zetagon quits (~leo@c151-177-52-233.bredband.comhem.se) (Ping timeout: 256 seconds)
2020-10-12 07:52:02 Zetagon joins (~leo@c151-177-52-233.bredband.comhem.se)
2020-10-12 07:52:37 xff0x joins (~fox@217.110.198.158)
2020-10-12 07:56:38 darjeeli1 joins (~darjeelin@122.245.210.138)
2020-10-12 07:56:39 × darjeeling_ quits (~darjeelin@122.245.210.138) (Read error: Connection reset by peer)
2020-10-12 07:56:49 × chenshen quits (~chenshen@2620:10d:c090:400::5:f372) (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
2020-10-12 07:57:40 × xff0x quits (~fox@217.110.198.158) (Ping timeout: 256 seconds)
2020-10-12 07:58:47 xff0x joins (~fox@217.110.198.158)
2020-10-12 07:59:28 hackage ttn-client 0.2.0.0 - TheThingsNetwork client https://hackage.haskell.org/package/ttn-client-0.2.0.0 (srk)
2020-10-12 07:59:34 bahamas joins (~lucian@188.24.181.166)
2020-10-12 07:59:34 × bahamas quits (~lucian@188.24.181.166) (Changing host)
2020-10-12 07:59:34 bahamas joins (~lucian@unaffiliated/bahamas)
2020-10-12 08:00:03 <bahamas> does anyone have an example of a function in the prelude that uses pattern matching in the definition? and another example that uses guards?
2020-10-12 08:02:23 raichoo joins (~raichoo@213.240.178.58)
2020-10-12 08:02:27 snakemas1 joins (~snakemast@213.100.206.23)
2020-10-12 08:02:31 × ericsagnes quits (~ericsagne@2405:6580:0:5100:65f3:1e6d:ab49:97d4) (Ping timeout: 272 seconds)
2020-10-12 08:04:00 Ariakenom joins (~Ariakenom@193.254.193.1)
2020-10-12 08:04:09 <hc> bahamas: pattern matching: https://hackage.haskell.org/package/base-4.14.0.0/docs/src/GHC.List.html#head
2020-10-12 08:04:46 <hc> guards: https://hackage.haskell.org/package/base-4.14.0.0/docs/src/GHC.List.html#dropWhile
2020-10-12 08:05:46 m0rphism joins (~m0rphism@HSI-KBW-046-005-177-122.hsi8.kabel-badenwuerttemberg.de)
2020-10-12 08:11:15 <bahamas> hc: thank you!
2020-10-12 08:11:15 × fleursdumal quits (4832064b@gateway/web/cgi-irc/kiwiirc.com/ip.72.50.6.75) (Quit: Connection closed)
2020-10-12 08:11:53 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-10-12 08:11:57 × GyroW quits (~GyroW@unaffiliated/gyrow) (Quit: Someone ate my pie)
2020-10-12 08:12:07 GyroW joins (~GyroW@d54c03e98.access.telenet.be)
2020-10-12 08:12:07 × GyroW quits (~GyroW@d54c03e98.access.telenet.be) (Changing host)
2020-10-12 08:12:07 GyroW joins (~GyroW@unaffiliated/gyrow)
2020-10-12 08:14:02 <bahamas> hc: interesting definition for "take". it uses a guard without `otherwise`, but it doesn't seem to be a problem
2020-10-12 08:14:06 × snakemas1 quits (~snakemast@213.100.206.23) (Ping timeout: 256 seconds)
2020-10-12 08:14:35 snakemas1 joins (~snakemast@213.100.206.23)
2020-10-12 08:14:39 pfurla_ joins (~pfurla@185.108.105.110)
2020-10-12 08:14:47 ericsagnes joins (~ericsagne@2405:6580:0:5100:8f5:b7cb:eb3d:6e86)
2020-10-12 08:15:56 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Ping timeout: 272 seconds)
2020-10-12 08:17:51 <hc> bahamas: it isn't a problem because of the ordering of patterns
2020-10-12 08:18:22 <hc> bahamas: if the list is empty, #2 will match regardless of the value of n, unless n<=0 in which case the 2nd parameter won't be evaluated and thus an empty list wouldn't be a problem here either
2020-10-12 08:18:44 <hc> the 3rd case will only be attempted to match if the list isn't empty
2020-10-12 08:20:05 pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net)
2020-10-12 08:21:17 × pfurla_ quits (~pfurla@185.108.105.110) (Ping timeout: 258 seconds)
2020-10-12 08:21:25 × drbean quits (~drbean@TC210-63-209-219.static.apol.com.tw) (Ping timeout: 240 seconds)
2020-10-12 08:22:05 <bahamas> hc: yes. btw, an exclamation mark in front of a function argument forces the evaluation, right?
2020-10-12 08:24:37 <hc> bahamas: I think so; at least that's the case in Data declarations
2020-10-12 08:25:12 cfricke joins (~cfricke@unaffiliated/cfricke)
2020-10-12 08:25:45 <dminuoso> bahamas: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#bang-patterns-informal
2020-10-12 08:27:02 × maroloccio quits (~marolocci@212.129.83.39) (Ping timeout: 244 seconds)
2020-10-12 08:29:23 tdammers_ is now known as tdammers
2020-10-12 08:31:02 <merijn> bahamas: btw, if all guards of a pattern fail it simply "falls through" to the next pattern of the function (similar to failing pattern matches) which can be useful in places :)
2020-10-12 08:31:08 × snakemas1 quits (~snakemast@213.100.206.23) (Ping timeout: 272 seconds)
2020-10-12 08:31:53 maroloccio joins (~marolocci@212.129.83.39)
2020-10-12 08:33:46 dhouthoo joins (~dhouthoo@ptr-eiv6509pb4ifhdr9lsd.18120a2.ip6.access.telenet.be)
2020-10-12 08:34:35 DavidEichmann joins (~david@43.240.198.146.dyn.plus.net)
2020-10-12 08:34:52 <bahamas> merijn: right. I had forgotten about that. `otherwise` is a catch all
2020-10-12 08:35:08 <bahamas> dminuoso: thanks!
2020-10-12 08:35:10 chaosmasttter joins (~chaosmast@p200300c4a72cce019c42f7589bbe6c59.dip0.t-ipconnect.de)
2020-10-12 08:35:27 <maerwald> @src otherwise
2020-10-12 08:35:27 <lambdabot> otherwise = True
2020-10-12 08:35:49 <bahamas> dminuoso: oh, so it's an extension. it's not part of the report
2020-10-12 08:36:09 <dminuoso> Right.
2020-10-12 08:36:19 <dminuoso> bahamas: Roughly, think it to be equivalent to `seq`
2020-10-12 08:36:29 <dminuoso> Perhaps, in hindsight, we should have had bang patterns instead of seq.
2020-10-12 08:36:57 <dminuoso> The ergonomics of bang patterns are much better. :)
2020-10-12 08:37:54 <dminuoso> So bang patterns are just syntactic sugar around Haskell2010, rather than introducing additional semantics.
2020-10-12 08:37:55 × yoja quits (~yoel.jaco@89.237.104.52) (Ping timeout: 246 seconds)
2020-10-12 08:38:16 <bahamas> I see
2020-10-12 08:39:12 <dminuoso> Then we could have defined `seq !l r = r`
2020-10-12 08:39:50 RichardW joins (0140a8cb@1-64-168-203.static.netvigator.com)
2020-10-12 08:41:18 <bahamas> btw, judging from this file I assume there's an unwritten rule to put a fixity declaration at the top of a module? https://hackage.haskell.org/package/base-4.14.0.0/docs/src/GHC.Base.html#.
2020-10-12 08:41:57 <Taneb> bahamas: differnet libraries do it differently, I prefer to keep it close to the operator
2020-10-12 08:42:11 × plutoniix quits (~q@175.176.222.7) (Quit: Leaving)
2020-10-12 08:42:25 <Taneb> If you're defining a lot of operators with a lot of different fixities it can make things clearer how they relate if the fixity declarations are together, though
2020-10-12 08:42:57 <dminuoso> Though, you can quickly extract the latter knowledge by just `grep infix foo.hs`
2020-10-12 08:42:58 hackage Z-Data 0.1.6.1 - Array, vector and text https://hackage.haskell.org/package/Z-Data-0.1.6.1 (winterland)
2020-10-12 08:43:22 <bahamas> ok. it makes sense
2020-10-12 08:43:24 <dminuoso> Whereas relating a fixity declaration to its definition is not as easy, so I'd say keeping fixity declarations close to the definition is more useful
2020-10-12 08:44:15 <merijn> bahamas: No, I mean even in the absense of "otherwise"
2020-10-12 08:44:40 <merijn> bahamas: I'd say "put fixity near the definition", tbh
2020-10-12 08:45:36 <dminuoso> But really at the end, code convention is flexible and should fit your needs.
2020-10-12 08:45:47 heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net)
2020-10-12 08:46:11 polyrain_ joins (~polyrain@2001:8003:e501:6901:1ec:b302:c264:1713)
2020-10-12 08:46:18 <nshepperd2> I'd always put it right next to the type signature
2020-10-12 08:46:28 <dminuoso> nshepperd2: with a semicolon?
2020-10-12 08:46:35 <dminuoso> Or do you mean above/below?
2020-10-12 08:46:40 × chaosmasttter quits (~chaosmast@p200300c4a72cce019c42f7589bbe6c59.dip0.t-ipconnect.de) (Ping timeout: 244 seconds)
2020-10-12 08:47:13 <nshepperd2> err, above
2020-10-12 08:47:32 × xff0x quits (~fox@217.110.198.158) (Ping timeout: 256 seconds)
2020-10-12 08:47:46 <nshepperd2> is a semicolon legal? that would be interesting
2020-10-12 08:48:09 <dminuoso> GHCi accepts it at least
2020-10-12 08:48:17 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 2.9)
2020-10-12 08:48:18 yoja joins (~yoel.jaco@89.237.104.52)
2020-10-12 08:48:44 × polyrain quits (~polyrain@2001:8003:e501:6901:1d4a:4b8a:8ea1:adc0) (Ping timeout: 244 seconds)

All times are in UTC.