Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-24 08:46:22 chkno joins (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net)
2020-11-24 08:46:55 <dminuoso> merijn: Cool, I think I saw the initial works from matthew a while ago
2020-11-24 08:46:55 × chkno quits (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net) (Read error: Connection reset by peer)
2020-11-24 08:46:59 <dminuoso> was waiting for this
2020-11-24 08:47:04 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 260 seconds)
2020-11-24 08:47:15 <dminuoso> Though the text based profiling is *fine*
2020-11-24 08:47:29 <dminuoso> but an interactive flamegraph is just tons better obviously
2020-11-24 08:47:57 <n0042> I'm using 8.8.4. Perhaps that's a good reason to upgrade soon though
2020-11-24 08:48:04 <merijn> dminuoso: The flamegraph isn't his, that's just the speedscope.app website
2020-11-24 08:48:10 borne joins (~fritjof@200116b864eb5c00394a967dc8ef4e61.dip.versatel-1u1.de)
2020-11-24 08:48:16 <dminuoso> Ah
2020-11-24 08:48:17 <merijn> dminuoso: hs-speedscope is just turning the event log into output for it
2020-11-24 08:48:25 <merijn> Although there's still room for improvement
2020-11-24 08:48:35 <merijn> For one it currently doesn't track foreign calls, sadly
2020-11-24 08:48:55 <dminuoso> Ive stopped profiling our largest project because all that's left is a gazillion "improve 0.1% here" spots.
2020-11-24 08:49:09 <dminuoso> Too much effort for too little value. At this point Im largely I/O bound. :p
2020-11-24 08:49:46 <dminuoso> Im still amazed by how fast GHC generated code is
2020-11-24 08:49:55 thc202 joins (~thc202@unaffiliated/thc202)
2020-11-24 08:50:07 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-11-24 08:51:07 × drbean quits (~drbean@TC210-63-209-58.static.apol.com.tw) (Ping timeout: 246 seconds)
2020-11-24 08:52:52 × cfricke quits (~cfricke@unaffiliated/cfricke) (Quit: WeeChat 2.9)
2020-11-24 08:53:11 cfricke joins (~cfricke@unaffiliated/cfricke)
2020-11-24 08:53:27 <n0042> My biggest hurdle for testing the performance for this class is actually feeding it input in a way that simulates the test conditions. They've got some automated system that inputs during runtime, like a person sitting at a keyboard. No command-line arguments.
2020-11-24 08:53:46 <n0042> Would be easier if everything was command line arguments
2020-11-24 08:54:10 <dminuoso> 09:27:34 merijn | n0042: Compile with -rtsopts and run with "+RTS -sstderr" to get GC diagnostics
2020-11-24 08:54:16 <dminuoso> Oh
2020-11-24 08:54:18 <dminuoso> Mm
2020-11-24 08:55:03 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 260 seconds)
2020-11-24 08:55:15 <merijn> Well, you can use --with-rtsoprts to permanently enable those ;)
2020-11-24 08:55:47 <dminuoso> mmm can you output the profiling data to stderr as well?
2020-11-24 08:55:57 michalz joins (~user@185.246.204.39)
2020-11-24 08:56:22 chkno joins (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net)
2020-11-24 08:56:47 <acagastya> Is this called a function signature? If not, what is it called? `fib :: Int -> Int`
2020-11-24 08:56:47 × eyenx quits (~eyenxeyen@unaffiliated/eye/x-1653358) (Quit: Bridge terminating on SIGTERM)
2020-11-24 08:57:09 eyenx joins (~eyenxeyen@unaffiliated/eye/x-1653358)
2020-11-24 08:57:11 <n0042> Type declaration, I think
2020-11-24 08:57:23 <n0042> But basically a function signature
2020-11-24 08:57:29 m0rphism joins (~m0rphism@HSI-KBW-095-208-098-207.hsi5.kabel-badenwuerttemberg.de)
2020-11-24 08:58:02 <dminuoso> Type signature / type annotation
2020-11-24 08:58:10 <dminuoso> Syntactically it also happens to be a declaration.
2020-11-24 08:58:46 <dminuoso> Haskell does not have the notion of "function signatures" that have some kind of forward declaring behavior
2020-11-24 08:58:51 <dminuoso> Like in C
2020-11-24 08:58:51 × chkno quits (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net) (Read error: Connection reset by peer)
2020-11-24 08:59:22 kritzefitz joins (~kritzefit@fw-front.credativ.com)
2020-11-24 08:59:31 <n0042> For the first couple weeks I was just writing everything with type inference and asking ghci for the type using `:t`
2020-11-24 08:59:36 <dminuoso> With some considerations, you can just attach a type signature/ascription to anything. `f (x :: Int) = x * 2`
2020-11-24 08:59:51 <dminuoso> Though that requires ScopedTypeVariables :p
2020-11-24 08:59:56 <idnar> I never know where to put cost centres for profiling
2020-11-24 09:00:01 <n0042> Felt real proud of myself when I didn't have to do that all the time any more.
2020-11-24 09:00:52 <merijn> idnar: You just use -fprof-auto? :p
2020-11-24 09:00:56 <dminuoso> n0042: For advanced users, you can just insert a typed hole, that works nicely with ghc or ghcid.
2020-11-24 09:01:10 <merijn> idnar: Or better yet, just use --enable-profiling with cabal :p
2020-11-24 09:01:19 <n0042> That sounds fancy. Can you give me an example? I'm intrigued
2020-11-24 09:01:20 <dminuoso> n0042: say you're in the middle of an expression deep down in code, and you want to know the type of some sub-expression, you can just do `.... f (x :: _) ....`
2020-11-24 09:01:33 <dminuoso> And then GHC will generate a diagnostic, telling you the type of x
2020-11-24 09:01:39 <n0042> Oh that is cool
2020-11-24 09:02:00 × dansho quits (~dansho@ec2-52-194-192-222.ap-northeast-1.compute.amazonaws.com) (Remote host closed the connection)
2020-11-24 09:02:03 <dminuoso> This doesnt just work for singular things, but entire expressions too
2020-11-24 09:02:10 <dminuoso> say `(f x) :: _`
2020-11-24 09:02:31 dansho joins (~dansho@ec2-52-194-192-222.ap-northeast-1.compute.amazonaws.com)
2020-11-24 09:02:54 <n0042> I've been really surprised at how good the interactive programming environment is since I started with Haskell. ghci is fantastic
2020-11-24 09:03:02 <dminuoso> Though its my experience, if you have to do this its because you're not sure. Just move it to a binding and give it a permanent type singature
2020-11-24 09:03:16 <idnar> merijn: -fprof-auto just changes the problem to "I never know where to put INLINE"
2020-11-24 09:03:53 <n0042> dminuoso: Noted. That's a sweet trick, thank you
2020-11-24 09:04:21 <merijn> dminuoso: That's a type hole, not a typed hole :p
2020-11-24 09:04:36 <dminuoso> -_-
2020-11-24 09:04:47 <dminuoso> I still need to implement -fno-typed-holes
2020-11-24 09:05:27 <merijn> How so?
2020-11-24 09:05:47 <dminuoso> I use optics a lot in this project, and for convenience I use the underscore based renamer
2020-11-24 09:05:56 <dminuoso> So I have a lot of fields that start with `_foo`
2020-11-24 09:06:01 <merijn> So?
2020-11-24 09:06:30 <dminuoso> well, if you use these field accessors and make a typo `_fo v` then you get a very annoying diagnostic and not even a "did yu mean _foo" error
2020-11-24 09:07:02 <dminuoso> Id rather it tells me "_fo not in scope"
2020-11-24 09:07:13 <merijn> dminuoso: That sounds more like "I need to improve the diagnostics", not "implement a way to disable typed holes" :p
2020-11-24 09:08:01 <idnar> dminuoso: switch to generic-optics ;)
2020-11-24 09:08:45 <acagastya> When should I use `.` and when do I use `$`?
2020-11-24 09:10:45 jonatanb joins (jonatanb@gateway/vpn/protonvpn/jonatanb)
2020-11-24 09:11:24 chkno joins (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net)
2020-11-24 09:11:54 <n0042> If I understand it correctly, `.` actually combines two functions while `$` just alters precedence. I've only needed to use `.` for I/O so far. Would be interested in hearing the answer to that.
2020-11-24 09:12:35 solonarv joins (~solonarv@astrasbourg-653-1-156-4.w90-6.abo.wanadoo.fr)
2020-11-24 09:13:38 × _xor quits (~xor@74.215.46.133) (Quit: brb)
2020-11-24 09:13:39 × chkno quits (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net) (Read error: Connection reset by peer)
2020-11-24 09:14:26 × eyenx quits (~eyenxeyen@unaffiliated/eye/x-1653358) (Quit: Bridge terminating on SIGTERM)
2020-11-24 09:14:50 eyenx joins (~eyenxeyen@unaffiliated/eye/x-1653358)
2020-11-24 09:15:05 × jonatanb quits (jonatanb@gateway/vpn/protonvpn/jonatanb) (Ping timeout: 240 seconds)
2020-11-24 09:15:47 <guest112`> is Except a typeclass?
2020-11-24 09:16:24 <guest112`> why Control.Monad.Error is no longer suggested?
2020-11-24 09:18:33 chkno joins (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net)
2020-11-24 09:19:41 Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi)
2020-11-24 09:19:41 × chkno quits (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net) (Read error: Connection reset by peer)
2020-11-24 09:20:08 <idnar> n0042: btw, if your editor has LSP support then with haskell-language-server you can get subexpression types on-hover
2020-11-24 09:20:34 <n0042> Fancy! Good to know
2020-11-24 09:20:46 <idnar> (among many other useful things)
2020-11-24 09:21:42 hidedagger joins (~nate@unaffiliated/hidedagger)
2020-11-24 09:22:03 × plutoniix quits (~q@ppp-124-121-237-69.revip2.asianet.co.th) (Remote host closed the connection)
2020-11-24 09:23:33 chkno joins (~chkno@75-7-2-127.lightspeed.sntcca.sbcglobal.net)
2020-11-24 09:24:43 kuribas joins (~user@ptr-25vy0i6zrjp217580gl.18120a2.ip6.access.telenet.be)
2020-11-24 09:25:10 × Entertainment quits (~entertain@104.246.132.210) (Ping timeout: 256 seconds)
2020-11-24 09:26:01 <dminuoso> idnar: I dont think that is the real solution here
2020-11-24 09:26:13 <dminuoso> lenses generated into OverloadedLabels seems more sane

All times are in UTC.