Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2021-04-30 21:19:21 <tomsmeding> :t \f -> flip (flip . flip f)
2021-04-30 21:19:22 <lambdabot> (a -> b1 -> b2 -> c) -> b2 -> b1 -> a -> c
2021-04-30 21:19:24 <alfianguide> Omg haha
2021-04-30 21:19:25 <tomsmeding> better
2021-04-30 21:19:35 <alfianguide> So you're invoking the pointfree converter
2021-04-30 21:19:39 <hololeap> alfianguide: in general, that is true because of the type of (.) ; you would need something like with the type like this to use more than one param: (c -> d) -> (a -> b -> c) -> a -> b -> d
2021-04-30 21:19:44 <tomsmeding> see also http://pointfree.io/
2021-04-30 21:20:38 <alfianguide> I'm sorry is there real example?
2021-04-30 21:21:02 <hololeap> @hoogle (c -> d) -> (a -> b -> c) -> a -> b -> d
2021-04-30 21:21:03 <lambdabot> Util (??) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
2021-04-30 21:21:03 <lambdabot> Data.Composition (.:) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
2021-04-30 21:21:03 <lambdabot> Data.Composition (.*) :: (c -> d) -> (a -> b -> c) -> a -> b -> d
2021-04-30 21:21:20 <alfianguide> Oh my, nice bot.
2021-04-30 21:21:25 <tomsmeding> if the pointfree conversion doesn't seem evident to you, it's probably better (in the interest of readable code) to not make your code pointfree :)
2021-04-30 21:21:40 <geekosaur> and sometimes when it is evident to you
2021-04-30 21:21:51 <tomsmeding> unless, of course, this is a question born out of curiosity and having fun
2021-04-30 21:21:55 stree joins (~stree@68.36.8.116)
2021-04-30 21:21:57 <alfianguide> Oh, so be it, I thought it's must be pointfree to be considered good haskell code
2021-04-30 21:22:02 <geekosaur> nope
2021-04-30 21:22:13 <tomsmeding> in which case, https://wiki.haskell.org/Pointfree#Combinator_discoveries
2021-04-30 21:22:26 <tomsmeding> alfianguide: no by all means not
2021-04-30 21:22:46 <geekosaur> even we like readable code, and pointfree tends to be unreadable by humans. the compiler likes it, but programs need to be readable by programmers to be maintainable
2021-04-30 21:22:51 alfianguide79 joins (67692343@103.105.35.67)
2021-04-30 21:22:53 <tomsmeding> sometimes, not often, having less "points" (explicit) variables makes the code more readable
2021-04-30 21:23:21 <monochrom> I don't think the compiler likes it either.
2021-04-30 21:23:27 <alfianguide79> Yeah that's true, I've just do eta-reduction again then.
2021-04-30 21:23:47 <alfianguide79> And when need more params, I do it non-pointfree
2021-04-30 21:23:52 <tomsmeding> case in point (heh): ghc eta-expands sometimes in order to make typechecking succeed or to improve performance slightly
2021-04-30 21:23:57 <hololeap> there is a balance, ofc. sometimes pointfree is clearer because it minimizes the clutter. but if you go too far it starts adding more clutter
2021-04-30 21:24:05 × vchlup quits (~vchlup@115.128.broadband17.iol.cz) (Remote host closed the connection)
2021-04-30 21:24:29 vchlup joins (~vchlup@115.128.broadband17.iol.cz)
2021-04-30 21:24:44 <alfianguide79> Yeah, anyway I guess @impurepics just make a joke about pointfree, but it's good to direct me to this usage.
2021-04-30 21:24:54 <monochrom> My http://www.vex.net/~trebla/weblog/pointfree.html explains why some code fragments are pointfree.
2021-04-30 21:24:56 × ADG1089 quits (~aditya@223.226.237.158) (Remote host closed the connection)
2021-04-30 21:25:46 <monochrom> The real goal is conveying structures. There are times, but not always, when pointfree conveys structures, such as when you would use pipelining in a shell script.
2021-04-30 21:26:03 × alfianguide quits (67692375@103.105.35.117) (Ping timeout: 240 seconds)
2021-04-30 21:26:04 <alfianguide79> Oh yeah, that's yours? I've got that from reddit link, and read about it, but yeah, cannot do it in ghci tho.
2021-04-30 21:26:41 <monochrom> Oh, you need "import Data.List" for some of the functions.
2021-04-30 21:27:28 <monochrom> So I guess I'm reddit-famous now.
2021-04-30 21:27:35 <alfianguide79> Oh yeah, didn't read the note inside parentheses, lol, I don't pay attention in little thing.
2021-04-30 21:29:46 <alfianguide79> anyway, is traverse a next-level of map?
2021-04-30 21:30:18 motherfsck joins (~motherfsc@unaffiliated/motherfsck)
2021-04-30 21:30:31 <monochrom> Yes.
2021-04-30 21:30:41 × __minoru__shirae quits (~shiraeesh@109.166.56.124) (Ping timeout: 240 seconds)
2021-04-30 21:30:58 <alfianguide79> I think of it as map in a wrapped value
2021-04-30 21:31:33 mrchampion joins (~mrchampio@38.18.109.23)
2021-04-30 21:32:57 <alfianguide79> How do we call value inside Just ? or Nothing? or IO ? I call it wrapped value haha.
2021-04-30 21:33:34 × oish quits (~charlie@228.25.169.217.in-addr.arpa) (Ping timeout: 252 seconds)
2021-04-30 21:35:55 × biglama quits (~alex@static-176-165-167-17.ftth.abo.bbox.fr) (Remote host closed the connection)
2021-04-30 21:36:47 × ddellac__ quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
2021-04-30 21:36:58 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-30 21:37:05 × zebrag quits (~inkbottle@alagny-155-1-30-153.w83-200.abo.wanadoo.fr) (Remote host closed the connection)
2021-04-30 21:37:24 × seven_three quits (~user@pool-96-252-123-136.bstnma.fios.verizon.net) (Remote host closed the connection)
2021-04-30 21:37:35 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
2021-04-30 21:37:41 seven_three joins (~user@pool-96-252-123-136.bstnma.fios.verizon.net)
2021-04-30 21:37:49 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-30 21:38:25 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
2021-04-30 21:38:36 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-30 21:39:13 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
2021-04-30 21:39:17 seven_three parts (~user@pool-96-252-123-136.bstnma.fios.verizon.net) ()
2021-04-30 21:39:25 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
2021-04-30 21:40:02 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
2021-04-30 21:40:44 heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
2021-04-30 21:42:24 proofofkeags joins (~proofofke@205.209.28.54)
2021-04-30 21:44:25 <geekosaur> IO doesn't wrap anything, it's an action that can produce a value
2021-04-30 21:44:27 kristijonas joins (~kristijon@78-56-32-39.static.zebra.lt)
2021-04-30 21:45:06 todda7 joins (~torstein@athedsl-4519432.home.otenet.gr)
2021-04-30 21:45:36 cdsmith joins (49cf15a2@c-73-207-21-162.hsd1.ga.comcast.net)
2021-04-30 21:45:39 <int-e> it's the burrito analogy :)
2021-04-30 21:46:54 <cdsmith> Any way to make GHC print the whole splice with -ddump-splices?  It keeps putting ellipses and leaving bits out.
2021-04-30 21:47:23 × alfianguide79 quits (67692343@103.105.35.67) (Ping timeout: 240 seconds)
2021-04-30 21:48:45 × mikoto-chan quits (~mikoto-ch@gateway/tor-sasl/mikoto-chan) (Ping timeout: 240 seconds)
2021-04-30 21:50:03 ulidtko|kk joins (~ulidtko@194.54.80.38)
2021-04-30 21:50:15 × ulidtko|k quits (~ulidtko@194.54.80.38) (Ping timeout: 265 seconds)
2021-04-30 21:52:02 × heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2021-04-30 21:52:15 seven_three joins (~user@pool-96-252-123-136.bstnma.fios.verizon.net)
2021-04-30 21:53:02 <dibblego> I've never seen it print ellipses, even with large output — is it the terminal config?
2021-04-30 21:55:40 seven_three parts (~user@pool-96-252-123-136.bstnma.fios.verizon.net) ()
2021-04-30 22:08:25 Rudd0 joins (~Rudd0@185.189.115.108)
2021-04-30 22:09:31 enthropy joins (~aavogt@135-23-166-92.cpe.pppoe.ca)
2021-04-30 22:10:49 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 252 seconds)
2021-04-30 22:12:52 × wonko7 quits (~wonko7@62.115.229.50) (Ping timeout: 240 seconds)
2021-04-30 22:13:12 <cdsmith> dibblego: I'm not sure?  Here's what I'm seeing: https://gist.github.com/cdsmith/ca20492c3b290df99bc7828b701c599a  Note line 18.
2021-04-30 22:14:48 <cdsmith> I doubt it's the terminal ellipsizing, because the ellipses happen inside Haskell syntax elements.
2021-04-30 22:15:25 <cdsmith> Maybe it's haskell-language-server doing it.  I'll try it from a console.
2021-04-30 22:17:11 <dibblego> hmm I've never seen that, can you send some code?
2021-04-30 22:18:11 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-04-30 22:18:36 <cdsmith> Oh yeah, it works fine from the console.  Must be haskell-language-server doing it.
2021-04-30 22:18:48 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
2021-04-30 22:19:25 <cdsmith> I was doing the right-click Copy Message deal from VSCode, and trusting that I got the real GHC output.  My mistake, I guess?
2021-04-30 22:19:48 <dibblego> ah ok
2021-04-30 22:20:07 Alleria joins (~textual@2603-7000-3040-0000-f13f-9b4c-5fb5-809d.res6.spectrum.com)
2021-04-30 22:20:30 Alleria is now known as Guest41112
2021-04-30 22:20:43 × zva quits (~zava@ip5f5bdf0f.dynamic.kabel-deutschland.de) (Ping timeout: 252 seconds)
2021-04-30 22:22:12 isd parts (zenhackmat@gateway/shell/matrix.org/x-ldodnpkwkyhiluzj) ("User left")
2021-04-30 22:25:06 × fendor quits (~fendor@77.119.128.145.wireless.dyn.drei.com) (Ping timeout: 268 seconds)
2021-04-30 22:29:33 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
2021-04-30 22:32:38 × juliagoda quits (~juliagoda@2a02:a31a:e13a:eb00:758f:d455:b475:46e4) (Quit: Leaving)
2021-04-30 22:32:45 × gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving)
2021-04-30 22:33:13 × __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving)

All times are in UTC.