Home liberachat/#haskell: Logs Calendar

Logs on 2021-10-16 (liberachat/#haskell)

00:01:50 hololeap_ is now known as hololeap
00:09:17 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
00:09:22 × gzj quits (~GZJ0X@199.193.127.89.16clouds.com) (Ping timeout: 252 seconds)
00:10:31 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
00:10:45 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
00:13:58 acidjnk_new3 joins (~acidjnk@p200300d0c703cb13046e85210638d6ab.dip0.t-ipconnect.de)
00:15:16 unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
00:17:31 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
00:18:34 machinedgod joins (~machinedg@24.105.81.50)
00:28:05 cheater joins (~Username@user/cheater)
00:29:15 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
00:32:10 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
00:37:13 jonatan joins (~nate@h85-8-60-194.cust.a3fiber.se)
00:37:58 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
00:38:15 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
00:40:02 × nitrix quits (~nitrix@user/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
00:45:23 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
00:45:29 idris joins (~idris@184.105.6.88)
00:45:40 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
00:46:11 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
00:46:59 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
00:47:10 <idris> >
00:47:12 <lambdabot> <no location info>: error: not an expression: ‘’
00:47:18 idris is now known as hippoid
00:47:37 <hippoid> > newtype Pair a b = Pair {first::a, second::b }
00:47:39 <lambdabot> <hint>:1:1: error: parse error on input ‘newtype’
00:47:56 <monochrom> You have two problems.
00:48:05 <hippoid> I only wanted to show the one problem
00:48:17 <monochrom> 1st problem: Use @let for declarations
00:48:29 <hippoid> @let newtype Pair a b = Pair {first::a, second::b }
00:48:29 <lambdabot> Parse failed: newtype declaration constructor must have exactly one parameter.
00:48:35 <monochrom> 2nd problem: Use "data" if you want 2 or more fields.
00:48:54 <hippoid> why is newtype limited to just 1 field?
00:49:24 <monochrom> Because it has a semantic difference from "data". The semantics of newtype makes sense for 1 field only (and 1 ctor only).
00:51:35 <hippoid> what is it about newtype semantics that only makes sense for it to have 1 field?
00:52:05 <hippoid> maybe it's about avoiding it becoming a product type
00:52:44 <monochrom> "newtype T = MkT S" means: After compiling to low level code and type erasure, I want T and S to be indistinguishable.
00:53:20 × haritz quits (~hrtz@user/haritz) (Quit: ZNC 1.7.2+deb3 - https://znc.in)
00:53:50 <hippoid> i can buy that
00:55:28 <monochrom> Have you been following a good Haskell book? All the good ones explain this.
00:55:35 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
00:55:52 MQ-17J joins (~MQ-17J@8.6.144.117)
00:55:54 <monochrom> Even the poor ones have to say something along that line if they dare to bring up "newtype" at all.
00:55:58 <hippoid> @let newtype T s = MkT s
00:55:59 <lambdabot> Defined.
00:56:22 <Inst> hum, weird
00:56:42 <monochrom> The other sane choice being never mentioning it. For example I don't use newtype in my course, I don't need it, and I don't need students to worry about one more thing.
00:56:57 Guest26 joins (~Guest26@50.25.34.71)
00:57:00 <Inst> i'd like to ask the haskell community, I'm learning C++ right now and I'm being told by people on other channels that it's bad form
00:57:13 <Inst> to just have int main() consist of nothing but function calls
00:57:31 <Inst> since you guys are functional programming paradigm, is it bad form in function-land?
00:57:40 <monochrom> No.
00:57:53 <Inst> they had a misunderstanding
00:57:54 <monochrom> And what more should be in main anyway?
00:57:55 × Guest26 quits (~Guest26@50.25.34.71) (Client Quit)
00:58:00 × Tuplanolla quits (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.)
00:58:10 <awpr> what else should it consist of? operators and literals?
00:58:17 <monochrom> And why should I put extra things there for the sake of putting extra things there?
00:58:19 <awpr> oh, that's what monochrom just said
00:58:27 <monochrom> :)
00:58:30 <awpr> oh I know, comments!
00:58:32 <hippoid> monochrom: the book did mention it... but after the point I was at.
00:58:38 <hippoid> monochrom: what's your course?
00:58:53 <monochrom> http://www.cs.utoronto.ca/~trebla/CSCC24-2021-Summer/
00:59:00 <hippoid> thanks
01:00:17 <monochrom> So let me relate an earlier conversation and explain my stance and why it is the same stance about what to add to main.
01:01:01 <monochrom> Someone on the library mailing list was suggesting to deprecate "read" because it is an oh-so-partial function.
01:01:39 <monochrom> So someone here (different person) polled our opinion here.
01:02:11 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 264 seconds)
01:02:32 <monochrom> I explained that I use it all the time, but with just cause: "x <- read <$> some digits" in parsers.
01:03:17 <monochrom> So suppose the madman's wish came true, read were banned, and I had to write "x <- fromJust . readMaybe <$> some digits"
01:03:35 dibblego joins (~dibblego@122-199-1-30.ip4.superloop.com)
01:03:35 × dibblego quits (~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
01:03:35 dibblego joins (~dibblego@haskell/developer/dibblego)
01:03:47 <monochrom> That would be what I call "using total functions for the sake of using total functions".
01:03:50 haritz joins (~hrtz@62.3.70.206)
01:03:51 × haritz quits (~hrtz@62.3.70.206) (Changing host)
01:03:51 haritz joins (~hrtz@user/haritz)
01:04:30 <monochrom> If you try to artificially add more things than function calls to main, you are adding other things to main for the sake of adding other things to main. Why.
01:04:40 × lbseale quits (~lbseale@user/ep1ctetus) (Read error: Connection reset by peer)
01:05:02 <awpr> maybe the intended advice was "don't hoist the implementation of `main` out to a different function and then just make main do nothing but call that function"?
01:05:20 <monochrom> Observe that in practice in most cases you will have a variety of things in main. But only because in each case you feel natural that way. Not because some religion wants it.
01:05:26 azimut_ joins (~azimut@gateway/tor-sasl/azimut)
01:06:05 <geekosaur> by any chance do you have some specific code they were commenting on?
01:06:18 <monochrom> Even that can have just cause in a minority of cases.
01:06:39 <awpr> I could see that being a reasonable position, since you probably don't want the entire implementation of `main` to be callable as a library function, since such a function would be a pretty poor interface.
01:06:42 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
01:06:55 <monochrom> For example "just in this version for now for simplicity. next version will be more interesting."
01:07:20 harveypwca joins (~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67)
01:07:35 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 264 seconds)
01:08:55 <geekosaur> a game. first version main() just inbvokes the game loop. next version adds loading and saving games to main before/after the game loop. next version after that adds a menu for picking a saved game to load and/or a user to play as
01:09:04 × retro_ quits (~retro@2e41e9c8.skybroadband.com) (Quit: Connection error?!)
01:11:01 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
01:11:50 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
01:16:57 × azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
01:18:01 azimut joins (~azimut@gateway/tor-sasl/azimut)
01:18:23 × douglascorrea_io quits (~douglasco@200.146.85.128.static.gvt.net.br) (Ping timeout: 264 seconds)
01:21:28 × acidjnk_new3 quits (~acidjnk@p200300d0c703cb13046e85210638d6ab.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
01:22:35 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 264 seconds)
01:24:13 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
01:24:43 xiongxin joins (~quassel@113.116.224.79)
01:27:28 × dsrt^ quits (~dsrt@70.166.66.234) (Ping timeout: 252 seconds)
01:29:19 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
01:30:08 abrantesasf joins (~abrantesa@187.36.170.211)
01:35:58 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
01:36:38 stiell joins (~stiell@gateway/tor-sasl/stiell)
01:38:51 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 265 seconds)
01:42:43 × hiredman quits (~hiredman@frontier1.downey.family) (Ping timeout: 265 seconds)
01:45:59 × MQ-17J quits (~MQ-17J@8.6.144.117) (Ping timeout: 264 seconds)
01:46:15 <unit73e> ugh... now gitlab is trying to convince people to use 'main' instead of 'master'
01:46:17 <unit73e> why?
01:46:38 <unit73e> anyway here's my new set of SDL2 examples: https://gitlab.com/unit73e/sdl2-examples
01:46:48 <unit73e> It's lazyfoo free
01:47:22 <unit73e> it's WIP. so far shows a window and draws some primitives.
01:49:12 <unit73e> geekosaur, I was actually thinking of doing something like that. not allowing to directly change the game loop. that's too much freedom that makes possible to have race conditions and so on
01:49:28 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 252 seconds)
01:49:36 <unit73e> a game dev shouldn't have to know those details
01:49:45 <unit73e> imo
01:50:13 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
01:51:08 <unit73e> all a game dev should care is game logic, now what each cycle does
01:53:26 <unit73e> next example will be keyboard events and then proper movement, not lazyfoo choppy version
01:55:31 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
01:56:49 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
01:59:07 × xff0x quits (~xff0x@2001:1a81:524d:6800:54c0:a41d:5321:6f97) (Ping timeout: 240 seconds)
01:59:15 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
01:59:15 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
01:59:15 wroathe joins (~wroathe@user/wroathe)
02:00:03 × sander quits (~sander@user/sander) (Quit: So long! :))
02:00:50 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
02:01:23 xff0x joins (~xff0x@2001:1a81:5288:5c00:50e4:894e:ef2c:4e1c)
02:01:25 sander joins (~sander@user/sander)
02:03:23 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
02:03:59 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
02:05:38 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
02:06:27 × eruditass_ quits (uid248673@id-248673.uxbridge.irccloud.com) (Ping timeout: 240 seconds)
02:06:34 × ysh quits (sid6017@id-6017.ilkley.irccloud.com) (Ping timeout: 252 seconds)
02:06:34 × degraafk quits (sid71464@id-71464.lymington.irccloud.com) (Ping timeout: 252 seconds)
02:06:34 × kristjansson_ quits (sid126207@id-126207.tinside.irccloud.com) (Ping timeout: 252 seconds)
02:06:34 × glowcoil quits (sid3405@id-3405.tinside.irccloud.com) (Ping timeout: 252 seconds)
02:06:34 × typetetris quits (sid275937@id-275937.tinside.irccloud.com) (Ping timeout: 252 seconds)
02:06:34 × _0x47 quits (sid508683@id-508683.tinside.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × pjlsergeant quits (sid143467@id-143467.hampstead.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × cbarrett quits (sid192934@id-192934.helmsley.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × gaze___ quits (sid387101@id-387101.helmsley.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × alinab quits (sid468903@id-468903.helmsley.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × carter quits (sid14827@id-14827.helmsley.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × idnar quits (sid12240@debian/mithrandi) (Ping timeout: 252 seconds)
02:06:40 × Pent quits (sid313808@id-313808.lymington.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × ephemient quits (uid407513@id-407513.lymington.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × hamishmack quits (sid389057@id-389057.hampstead.irccloud.com) (Ping timeout: 252 seconds)
02:06:40 × rune quits (sid21167@id-21167.ilkley.irccloud.com) (Ping timeout: 252 seconds)
02:06:46 × agander_m quits (sid407952@id-407952.tinside.irccloud.com) (Ping timeout: 245 seconds)
02:06:46 × hubvu quits (sid495858@user/hubvu) (Ping timeout: 245 seconds)
02:06:46 × taktoa[c] quits (sid282096@id-282096.tinside.irccloud.com) (Ping timeout: 245 seconds)
02:06:46 × bbhoss quits (sid18216@id-18216.tinside.irccloud.com) (Ping timeout: 245 seconds)
02:06:55 × pepeiborra quits (sid443799@id-443799.ilkley.irccloud.com) (Ping timeout: 268 seconds)
02:06:55 × caasih quits (sid13241@2a03:5180:f:3::33b9) (Ping timeout: 268 seconds)
02:06:55 × tnks quits (sid412124@2a03:5180:f:1::6:49dc) (Ping timeout: 268 seconds)
02:06:55 × ProofTechnique quits (sid79547@2a03:5180:f:3::1:36bb) (Ping timeout: 268 seconds)
02:06:55 × davetapley quits (sid666@2a03:5180:f:5::29a) (Ping timeout: 268 seconds)
02:06:55 × whez quits (sid470288@2a03:5180:f:2::7:2d10) (Ping timeout: 268 seconds)
02:06:55 × SethTisue__ quits (sid14912@2a03:5180:f:3::3a40) (Ping timeout: 268 seconds)
02:06:55 × mrianbloom quits (sid350277@id-350277.ilkley.irccloud.com) (Ping timeout: 268 seconds)
02:07:02 × awpr quits (uid446117@id-446117.lymington.irccloud.com) (Ping timeout: 265 seconds)
02:07:07 × NemesisD quits (sid24071@id-24071.lymington.irccloud.com) (Ping timeout: 240 seconds)
02:07:13 × hook54321 quits (sid149355@user/hook54321) (Ping timeout: 252 seconds)
02:07:13 × lightandlight quits (sid135476@id-135476.helmsley.irccloud.com) (Ping timeout: 252 seconds)
02:07:23 × sa1 quits (sid7690@id-7690.ilkley.irccloud.com) (Ping timeout: 250 seconds)
02:07:23 × cln quits (sid336875@id-336875.ilkley.irccloud.com) (Ping timeout: 250 seconds)
02:07:23 × stevenxl quits (sid133530@id-133530.uxbridge.irccloud.com) (Ping timeout: 250 seconds)
02:07:26 × obviyus_ quits (sid415299@id-415299.uxbridge.irccloud.com) (Ping timeout: 246 seconds)
02:07:26 × jakesyl_ quits (sid56879@id-56879.hampstead.irccloud.com) (Ping timeout: 246 seconds)
02:07:32 × scav quits (sid309693@2a03:5180:f:1::4:b9bd) (Ping timeout: 268 seconds)
02:07:35 × bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Ping timeout: 264 seconds)
02:07:40 × hnOsmium0001 quits (uid453710@id-453710.hampstead.irccloud.com) (Ping timeout: 252 seconds)
02:07:40 × Adeon quits (sid418992@id-418992.lymington.irccloud.com) (Ping timeout: 252 seconds)
02:07:46 × evertedsphere quits (sid434122@id-434122.hampstead.irccloud.com) (Ping timeout: 252 seconds)
02:07:50 × epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Ping timeout: 260 seconds)
02:08:08 × bw quits (sid2730@user/betawaffle) (Ping timeout: 246 seconds)
02:08:13 × gmc quits (sid58314@id-58314.ilkley.irccloud.com) (Ping timeout: 252 seconds)
02:08:13 × hongminhee quits (sid295@id-295.tinside.irccloud.com) (Ping timeout: 252 seconds)
02:08:13 × jackdk quits (sid373013@cssa/jackdk) (Ping timeout: 252 seconds)
02:08:19 × JSharp quits (sid4580@id-4580.lymington.irccloud.com) (Ping timeout: 252 seconds)
02:08:19 × systemfault quits (sid267009@id-267009.uxbridge.irccloud.com) (Ping timeout: 252 seconds)
02:08:19 × integral quits (sid296274@user/integral) (Ping timeout: 252 seconds)
02:08:19 × NiKaN quits (sid385034@id-385034.helmsley.irccloud.com) (Ping timeout: 252 seconds)
02:08:19 × bjs quits (sid190364@user/bjs) (Ping timeout: 252 seconds)
02:08:19 × angerman quits (sid209936@id-209936.ilkley.irccloud.com) (Ping timeout: 252 seconds)
02:08:25 × econo quits (uid147250@user/econo) (Ping timeout: 260 seconds)
02:08:33 × SrPx_ quits (sid108780@id-108780.uxbridge.irccloud.com) (Ping timeout: 268 seconds)
02:08:33 × truckasaurus quits (sid457088@id-457088.helmsley.irccloud.com) (Ping timeout: 268 seconds)
02:08:33 Adeon joins (sid418992@lymington.irccloud.com)
02:08:33 × meinside quits (uid24933@id-24933.helmsley.irccloud.com) (Ping timeout: 268 seconds)
02:08:33 bbhoss joins (sid18216@tinside.irccloud.com)
02:08:46 × nrr_ quits (sid20938@2a03:5180:f:2::51ca) (Ping timeout: 268 seconds)
02:08:46 × vito quits (sid1962@user/vito) (Ping timeout: 268 seconds)
02:08:46 × rubin55 quits (sid175221@id-175221.hampstead.irccloud.com) (Ping timeout: 268 seconds)
02:09:03 evertedsphere joins (sid434122@hampstead.irccloud.com)
02:09:04 rubin55 joins (sid175221@hampstead.irccloud.com)
02:09:06 hubvu joins (sid495858@user/hubvu)
02:09:13 econo joins (uid147250@user/econo)
02:09:18 bitmapper joins (uid464869@lymington.irccloud.com)
02:09:18 bjs joins (sid190364@user/bjs)
02:09:19 meinside joins (uid24933@helmsley.irccloud.com)
02:09:20 nrr_ joins (sid20938@lymington.irccloud.com)
02:09:21 scav joins (sid309693@helmsley.irccloud.com)
02:09:21 systemfault joins (sid267009@uxbridge.irccloud.com)
02:09:22 SrPx_ joins (sid108780@uxbridge.irccloud.com)
02:09:23 vito joins (sid1962@user/vito)
02:09:27 JSharp joins (sid4580@lymington.irccloud.com)
02:09:29 stevenxl joins (sid133530@uxbridge.irccloud.com)
02:09:29 bw joins (sid2730@user/betawaffle)
02:09:36 truckasaurus joins (sid457088@helmsley.irccloud.com)
02:09:43 gmc joins (sid58314@ilkley.irccloud.com)
02:09:43 lightandlight joins (sid135476@helmsley.irccloud.com)
02:09:43 NiKaN joins (sid385034@helmsley.irccloud.com)
02:09:45 angerman joins (sid209936@ilkley.irccloud.com)
02:10:13 hnOsmium0001 joins (uid453710@hampstead.irccloud.com)
02:10:18 pjlsergeant joins (sid143467@hampstead.irccloud.com)
02:10:22 jackdk joins (sid373013@cssa/jackdk)
02:10:22 taktoa[c] joins (sid282096@tinside.irccloud.com)
02:10:22 glowcoil joins (sid3405@tinside.irccloud.com)
02:10:30 NemesisD joins (sid24071@lymington.irccloud.com)
02:10:31 cln joins (sid336875@ilkley.irccloud.com)
02:10:31 integral joins (sid296274@user/integral)
02:10:33 cbarrett joins (sid192934@helmsley.irccloud.com)
02:10:33 epolanski joins (uid312403@helmsley.irccloud.com)
02:10:33 Pent joins (sid313808@lymington.irccloud.com)
02:10:44 jakesyl_ joins (sid56879@hampstead.irccloud.com)
02:11:02 obviyus_ joins (sid415299@uxbridge.irccloud.com)
02:11:06 sa1 joins (sid7690@ilkley.irccloud.com)
02:11:07 hongminhee joins (sid295@tinside.irccloud.com)
02:11:34 agander_m joins (sid407952@tinside.irccloud.com)
02:11:34 eruditass_ joins (uid248673@uxbridge.irccloud.com)
02:11:43 hook54321 joins (sid149355@user/hook54321)
02:11:49 × libertyprime quits (~libertypr@118.149.76.0) (Quit: leaving)
02:13:40 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
02:14:08 × eruditass_ quits (uid248673@uxbridge.irccloud.com) (Client Quit)
02:16:30 eruditass joins (uid248673@uxbridge.irccloud.com)
02:22:20 typetetris joins (sid275937@tinside.irccloud.com)
02:22:22 degraafk joins (sid71464@lymington.irccloud.com)
02:22:24 ysh joins (sid6017@ilkley.irccloud.com)
02:22:27 _0x47 joins (sid508683@tinside.irccloud.com)
02:23:01 gaze___ joins (sid387101@helmsley.irccloud.com)
02:23:01 pepeiborra joins (sid443799@ilkley.irccloud.com)
02:23:01 ephemient joins (uid407513@lymington.irccloud.com)
02:23:02 SethTisue__ joins (sid14912@ilkley.irccloud.com)
02:23:04 alinab joins (sid468903@helmsley.irccloud.com)
02:23:05 rune joins (sid21167@ilkley.irccloud.com)
02:23:06 davetapley joins (sid666@uxbridge.irccloud.com)
02:23:09 idnar joins (sid12240@debian/mithrandi)
02:23:30 awpr joins (uid446117@lymington.irccloud.com)
02:23:45 kristjansson_ joins (sid126207@tinside.irccloud.com)
02:23:52 unit73e parts (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Leaving)
02:24:14 × jespada quits (~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a) (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:24:14 tnks joins (sid412124@helmsley.irccloud.com)
02:24:20 hamishmack joins (sid389057@hampstead.irccloud.com)
02:24:22 caasih joins (sid13241@ilkley.irccloud.com)
02:24:23 unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
02:24:24 ProofTechnique joins (sid79547@ilkley.irccloud.com)
02:24:25 whez joins (sid470288@lymington.irccloud.com)
02:24:35 carter joins (sid14827@helmsley.irccloud.com)
02:25:57 mrianbloom joins (sid350277@ilkley.irccloud.com)
02:29:22 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
02:29:22 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
02:29:22 wroathe joins (~wroathe@user/wroathe)
02:42:19 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
02:43:09 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
02:43:47 × epolanski quits (uid312403@helmsley.irccloud.com) (Quit: Connection closed for inactivity)
02:44:12 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 276 seconds)
02:44:23 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
02:47:49 × td_ quits (~td@muedsl-82-207-238-175.citykom.de) (Ping timeout: 252 seconds)
02:49:26 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 265 seconds)
02:50:51 nuh^ joins (~nuh@70.166.66.234)
02:51:05 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
02:52:45 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
02:54:25 <sm> unit73e: +1 for making examples. But did you know about https://github.com/haskell-game/sdl2/tree/master/examples ?
02:54:52 <unit73e> sm, yes I do know. in fact mine are based on those.
02:55:04 <sm> I see, what's the difference ?
02:55:57 <sm> better than lazyfoo in various ways ?
02:56:07 <unit73e> those examples are incomplete in two ways. first neither uses font or audio because those are separate libraries and second is that they're based on lazyfoo and pals.
02:56:11 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 265 seconds)
02:56:16 <unit73e> lazyfoo examples are good to start
02:57:05 <unit73e> but it gets bad when you get to moving objects for example
02:57:58 <unit73e> lazyfoo ended up using the crappiest way of moving an object... just move N pixels with you press the key, without repetition
02:58:35 <unit73e> also apparently he rather developers not make ports or share code in any repository
02:59:00 <unit73e> I was making a complete port of lazyfoo btw
02:59:51 MQ-17J joins (~MQ-17J@8.21.10.20)
03:00:08 <unit73e> so my idea is to make something similar but better suited for real life games
03:00:09 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
03:00:31 <unit73e> nobody uses choppy movement in games. most games have acceleration and max velocity
03:01:10 <unit73e> also I get to do shared libraries while with lazyfoo everything was self-contained
03:02:14 <unit73e> I don't really like the pacing and order of lazyfoo examples either. it's too slow and doesn't follow what one would naturally think to make a game.
03:03:36 <unit73e> so yes it will be better. I just pushed documentation btw. my initial idea of self-documented code was bad after all so I'm just putting the explanation in the readme file.
03:06:49 flu joins (~flu@86.121.5.30)
03:07:15 <monochrom> BTW, github is also defaulting to "main".
03:07:24 <unit73e> ugh...
03:07:33 <unit73e> the wokes complained?
03:07:44 <monochrom> I don't know!
03:08:09 lavaman joins (~lavaman@98.38.249.169)
03:08:21 <unit73e> I bet it had something to do with master/slave dilemma that nobody cares...
03:09:03 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection)
03:09:11 <flu> probably someone who doesn't know anything about computers or git saw master on somebody's computer and went on a rampage, and then it snowballed
03:09:11 <unit73e> microsoft is a big fan of wasting time changing words
03:09:38 flu is now known as orangeFlu
03:09:42 <unit73e> because they're "offensive" to a loud minority, but that's just my opinion
03:09:59 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
03:10:15 <monochrom> I am sympathetic to changing "master/slave" to something else. But yeah I'm unsympathetic in contexts where there is just "master", no "slave", in which case there is nothing to fix.
03:10:31 chexum joins (~quassel@gateway/tor-sasl/chexum)
03:10:33 <unit73e> I don't really care either way, I just find it annoying
03:11:15 <orangeFlu> how is it offensive if doesn't have anything to do with that connotation. I know people of color who program and say it's just a waste of time to change it and they never thought of it that way
03:11:51 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
03:12:41 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
03:12:59 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
03:13:32 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
03:13:33 × abrantesasf quits (~abrantesa@187.36.170.211) (Remote host closed the connection)
03:14:42 <unit73e> orangeFlu, nobody knows and there's no point in debating. it will be like any pointless fight were the craziest person wins with experience. it's not a topic for haskell anyway, just the latest pointless trend.
03:15:23 <unit73e> big corpos are all in it to see who's has the biggest virtue points :\
03:17:13 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
03:21:25 × obviyus_ quits (sid415299@uxbridge.irccloud.com) (Changing host)
03:21:25 obviyus_ joins (sid415299@user/obviyus)
03:22:28 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Quit: WeeChat 2.8)
03:22:49 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
03:24:00 × MQ-17J quits (~MQ-17J@8.21.10.20) (Ping timeout: 268 seconds)
03:28:53 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Quit: WeeChat 2.8)
03:31:14 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
03:31:40 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
03:31:55 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
03:32:47 × phma quits (~phma@host-67-44-208-96.hnremote.net) (Read error: Connection reset by peer)
03:33:14 phma joins (~phma@host-67-44-208-96.hnremote.net)
03:33:53 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Client Quit)
03:34:08 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
03:34:50 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Client Quit)
03:35:16 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
03:35:40 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
03:36:48 <dsal> awpr: re: "probably don't want the entire implementation of `main` to be callable" -- you'd be surprised. I've got review responses telling me that code in `app/` should have nothing but a call to a library function otherwise it can't be tested. OK, but like, there's already code that does that elsewhere and it's not tested anyway. This is just grabbing some args and calling library functions with those args.
03:39:30 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
03:41:41 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection)
03:41:54 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
03:44:02 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
03:46:22 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
03:51:08 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
03:53:05 × alzgh quits (~alzgh@user/alzgh) (Remote host closed the connection)
03:53:51 alzgh joins (~alzgh@user/alzgh)
03:56:08 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection)
03:56:08 × alzgh quits (~alzgh@user/alzgh) (Remote host closed the connection)
03:56:26 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
03:57:11 × hughjfchen quits (~hughjfche@vmi556545.contaboserver.net) (Client Quit)
03:57:13 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
03:57:32 hughjfchen joins (~hughjfche@vmi556545.contaboserver.net)
03:58:26 alzgh joins (~alzgh@user/alzgh)
03:58:52 × alzgh quits (~alzgh@user/alzgh) (Remote host closed the connection)
03:59:56 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
04:01:14 alzgh joins (~alzgh@user/alzgh)
04:06:36 lavaman joins (~lavaman@98.38.249.169)
04:07:26 <dsal> :t unless
04:07:27 <lambdabot> Applicative f => Bool -> f () -> f ()
04:07:31 <dsal> Does anyone find this confusing?
04:09:13 <unit73e> dsal, not really. what makes it confusing?
04:09:39 <dsal> No idea. Just reading some hlint rules someone wrote up. Apparently `unless` is really confusing and you should use `when` instead.
04:11:21 <dsal> Also `either`. One function for when left and one for when right. No way to know which is which. mnemonic: The one on the left is for lefts and the one on the right is for rights.
04:12:54 <unit73e> for `either` I kind of get it
04:13:22 <unit73e> because the opposite of `right` should be `wrong` lol
04:13:37 <unit73e> but that would look stupid
04:13:58 <unit73e> so left/right it is
04:14:39 <dsal> Sometimes `either` is the perfect tool.
04:14:43 <dsal> :t either fail pure
04:14:44 <lambdabot> MonadFail m => Either String a -> m a
04:15:09 <unit73e> yes but the confusion is what to put on `left` and on `right`
04:15:18 <unit73e> we know `right` is for the correct path
04:15:22 <unit73e> but that's just a convention
04:15:36 <unit73e> it could be reversed
04:16:17 <sm> dsal, working with some new haskellers ?
04:16:26 <unit73e> for `unless`, I don't get it. It's just flipped `when`, so `do ... unless ...`.
04:16:31 <dsal> The argument isn't to avoid Either, but to avoid `either` and use a case statement instead. That doesn't change the Left/Right confusion. It just means instead of `either fail pure` you write `case e of Left x -> fail x; Right x -> pure x`
04:17:02 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
04:17:09 <dsal> sm: Worse, I'm working with someone who is allegedly a master of haskell but wants to write code that any beginner will easily understand.
04:17:19 <unit73e> lmao
04:17:22 <unit73e> good luck with that
04:17:27 <sm> ah, that is more complicated :)
04:17:41 <sm> I sympathise with both of you
04:18:05 <dsal> And someone who's at least a newbie strawman. Occasionally looks and code and says it wasn't immediately obvious so it should be changed.
04:18:08 <unit73e> how about just learn the language?
04:18:22 <sm> maybe one of the style guides out there can be used, to avoid arguments ?
04:18:24 <dsal> I mean, there *is* excessively confusing.
04:18:49 <dsal> I'm not sure anybody else's style guide would suffice.
04:18:54 <unit73e> I have a better idea. instead of just blindly using `either` and `unless`, read what it does first.
04:18:59 <sm> it's a place to start
04:19:01 <unit73e> just saying lol
04:19:16 <dsal> One of the things is "just pick a formatter and use it and don't have any arguments about it just apply it" with some justification as to how aesthetics don't help the user.
04:19:26 <dsal> But, TBH, ormolu slows me down a few times a day.
04:19:45 <dsal> unit73e: hlint prevents commits.
04:19:51 <unit73e> oof
04:20:28 <unit73e> you're getting yourself into a can of worms about to be openned
04:21:14 <unit73e> but if it's not your call I wouldn't bother much
04:21:48 <dsal> Yeah. I'll see where it goes. I took a job so I could help out some and learn a bit. But if we want to pull down towards the LCD programmer instead of pull people up a bit, I might just do something else.
04:22:18 <unit73e> I'm stilll trying to figure how `do ... unless ...` is confusing. reads like normal english.
04:23:10 <unit73e> I guess because it's a negative? not a positive?
04:24:20 <dsal> Yeah, I guess I'll ask. I have the same issue. `when (not . isGood) $ x` seems more confusing to me.
04:24:21 azimut joins (~azimut@gateway/tor-sasl/azimut)
04:25:04 <tapas> `let bad = not . isGood`
04:25:08 <tapas> `when bad x`
04:25:19 <unit73e> lol unless is just more readable
04:25:43 <tapas> `unless (not . bad) x`
04:25:49 <awpr> how to abide by that rule: `when't = when . not` and then just use that
04:26:17 <tapas> `unlessn't f = unless (not . f)`
04:27:38 <dsal> Yeah, the strawman newbie guy wrote a style guide that included always using `let` and ~never using `where` because it's really confusing for him to see things that are used before they're defined and I'm just like... no.
04:27:48 <dsal> Use a non-declarative language if that confuses you.
04:28:03 <dsal> I tend to write the thing I want and then fill in the details later, leaving the high level thing first.
04:29:14 <unit73e> that's just bad advice
04:29:31 <unit73e> not using `where`
04:29:41 <unit73e> I favor where to let tbh
04:30:07 <unit73e> I don't really care about particularities of the main code, so where hides htat
04:30:19 <unit73e> let doesn't. it's noise.
04:30:57 <unit73e> that newbie is probably used to imperative languages
04:30:58 <dsal> Yeah, that's kind of how I see it. People have weird views of readability.
04:31:57 <unit73e> in C it was (maybe still is) good pratice to declare everything first
04:32:05 <unit73e> I always found it silly
04:32:45 <dsal> The document also suggested using longer variable names for readability and gave a "bad" example and a "good" example where the "bad" example was clearly better. It had stuff like "serverEnvironment = getServerEnvironment" and then just uses it once on the next line. Like, dude, call it "env" and if I forget what it is, I'll look at the line above again.
04:33:37 <unit73e> yup that's Java style
04:33:41 <dsal> Some of these files have lots of symbol names with five or six words and minimal hamming distance between them. Almost can't read it without a code that will highlight symbols when you click on them.
04:33:57 <unit73e> even Scala got rid of that verbose nonsense
04:34:22 <unit73e> and Scala is just Java 2.0
04:34:40 <unit73e> well Java is already 2.X but you get the point
04:34:47 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
04:35:06 <dsal> I did go readability reviews for a bunch of years trying to convince people that they don't need really long names for really short scopes.
04:35:34 <unit73e> that's useful in Java because there's not much composition going on
04:35:58 <unit73e> but in haskell you're always using generic functions
04:36:06 <dsal> Only once had someone tell me he had a neurological problem that made it impossible for him to understand variable names that were not ~7 words long even used one time immediately after declaration and was super angry.
04:36:31 <unit73e> I only do that for examples
04:36:40 <unit73e> like my SDL examples project lol
04:36:55 <unit73e> call it "renderer" instead of "r"
04:37:08 <unit73e> it doesn't really make much of a difference for simple examples
04:37:17 <dsal> Yeah, there are times where it's illustrative.
04:37:41 × xiongxin quits (~quassel@113.116.224.79) (Ping timeout: 265 seconds)
04:39:03 <dsal> This thing also has the "don't use `sum`" thing. I have to wonder where that's a problem in practice. AIUI, they fixed it in newer GHCs. Seems easier to just fix the compiler than to train everyone that something incredibly basic is a bad idea.
04:39:28 machinedgod joins (~machinedg@24.105.81.50)
04:40:12 × Player001 quits (~Player001@user/player001) (Quit: Quitting)
04:42:36 <monochrom> Performance advices rarely stand the test of time. The 3-party dynamic dance of programmers, compiler writers, and hardware designers perpetually 2nd-guessing each others and lagging behind.
04:44:10 × unit73e quits (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Ping timeout: 268 seconds)
04:45:39 <clever> monochrom: ive also heard that a number of haskell performance benchmarks, that kept an eye on the rts, where dependant on the total size of the env vars when the test got ran
04:45:52 <clever> because the env vars go on the stack before main(), and change the alignment of the stack
04:46:06 <monochrom> haha yikes
04:46:48 <dsal> This specifically calls out Data.Foldable.sum which is `getSum #. foldMap Sum` But this still feels a bit like voodoo to try to avoid.
04:47:46 <awpr> `base` picked up the coercion-composition stuff from lens? presumably a version specialized to (->)?
04:47:50 <dsal> > foldMap (\x -> (Sum x, Sum 1)) [13..185] -- I do stuff like this which technically isn't `sum` but does the same thing.
04:47:52 <lambdabot> (Sum {getSum = 17127},Sum {getSum = 173})
04:48:22 <monochrom> A general form of Wadler's law applies. Most people pay most attention to the most superficial, simplistic things.
04:49:18 <monochrom> "Don't use short names." "Don't use a language that doesn't use {}". Simple enough for bird brains.
04:49:43 <monochrom> "Do what's right for the particular situation." Too hard.
04:49:50 <dsal> Part of the problem is that a coalition decided to declare "Simple Haskell" as a good way forward, but I can't figure out wtf it is. https://www.simplehaskell.org
04:50:14 <awpr> it's Go with layout
04:50:52 <awpr> (sensationalized for entertainment purposes)
04:51:11 <dsal> I get stuff like "don't use monad constraints, just run everything in IO" which is pretty cool except like, now there's a logging API and it only works in a specific reader monad and I have a different reader monad, so I don't get to do logging.
04:51:36 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
04:52:06 <monochrom> That may be solvable by monad morphisms. Learned it last night. :)
04:52:08 <dsal> The problem I'm running into with "Simple Haskell" is that, like go, Simple often means "just copy that code a lot." Don't use classes, run everything in IO, etc...
04:52:31 <monochrom> https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html
04:53:18 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
04:53:51 <dsal> I doubt it. That sounds "fancy." All I really needed was `HasLogger` for all the logging methods, but a `HasLogger` class might not work because someone might implement it incorrectly and break something or whatever.
04:56:32 <monochrom> Hey maybe next April 1 I should post my idea of simple haskell and get them to link to my post.
04:56:50 <monochrom> It's simply going to be "I don't teach newtype or do-notation to my students". >:)
04:56:51 <dolio> Why do you care about "simple haskell"?
04:57:36 <monochrom> But it's written in Snoyman style >:)
04:58:02 × lavaman quits (~lavaman@98.38.249.169) (Read error: Connection reset by peer)
04:58:16 <dsal> dolio: I care about making supportable code. To a degree, that's simple. But simple is so vague everyone argues about what it means.
04:58:29 lavaman joins (~lavaman@98.38.249.169)
04:58:44 <dolio> Yeah, but the thing you're talking about is some branded thing. Why do you care about that specifically?
04:59:00 <dsal> monochrom: I thought about you when asked to convert something simple to `do` syntax because it's "easier" for newbies. Well you and all the times I've seen people here (and myself) confused by what is happening in a `do` block before writing it out.
04:59:03 <monochrom> I think more like annoyed that it exists? :)
04:59:17 <dsal> dolio: Oh, I don't care about that specifically. But people talk about the name, so I go trying to find a definition and I find that.
05:00:12 <monochrom> The first time I taught this course I used do-notation. I got reliable feedback that skipping do-notation is better.
05:00:42 <dolio> Like, I agree that people waste a lot of time on things that don't contribute to getting the job done. The problem is that there isn't a specific feature list that rules out people doing that.
05:00:57 <monochrom> do-notation is easier for newbies who expect to cargo-cult, no doubt.
05:00:59 × xff0x quits (~xff0x@2001:1a81:5288:5c00:50e4:894e:ef2c:4e1c) (Ping timeout: 264 seconds)
05:01:40 xff0x joins (~xff0x@2001:1a81:5288:5c00:1568:382a:23d8:c3dd)
05:02:03 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 268 seconds)
05:02:08 <dsal> do notation is *really* confusing when trying to understand list or maybe monads. It's easy to understand those without it.
05:02:15 × segfaultfizzbuzz quits (~segfaultf@135-180-0-138.static.sonic.net) (Ping timeout: 260 seconds)
05:02:20 <monochrom> But my students did not expect to cargo-cult. They expect me to make sense.
05:02:48 <dolio> Most GHC features can be used in small amounts to make specific things nicer by people that know how, even if they can also be used to do complicated, unhelpful stuff.
05:04:25 <dsal> For me, fitting more things into existing categories is easier. e.g., I understand what a semigroup is, so telling me something is a semigroup is easier trying to keep up with several different concepts that are all semigroups but with different names, possibly different rules, and no ability to reuse existing parts.
05:04:33 <dsal> ("code being too generic is bad")
05:06:57 <monochrom> Oh yeah I don't teach type aliases either haha.
05:07:29 <dsal> type aliases seem kind of harmful.
05:07:58 <ski> monochrom : "ReadS is a type alias, so, not mandatory :)" -- but helpful, in this kind of situation, to avoid extra clutter. the main use of it, for me
05:08:25 <dsal> NamedFieldPuns is banned according to this list, but RecordWildCards is used in places where it's far easier, safer, and clearer not to.
05:09:40 <dsal> And TupleSections. This dude *hates* TupleSections for reasons I don't understand. When I was learning sections, I ran into TupleSections because it seemed like a super obvious way to write things and I didn't understand why I had to add a language extension use it.
05:09:41 <monochrom> Is that the same list that says "use longer names"?
05:09:53 <dsal> I don't think hlint itself allows that.
05:10:11 <dsal> hlint feature request: All symbol names must be complete sentences.
05:10:24 <monochrom> Because oddly enough "use more names" is a logical prerequisite for "use longer names", no?
05:10:32 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
05:10:36 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
05:10:48 <dsal> Function names must all be valid German words.
05:12:33 <monochrom> Oh yeah I don't teach ($) either. When explaining the equivalence between <*> and liftA2, I write liftA2 (\f x -> f x).
05:13:54 <monochrom> And I am still looking for a nice way to write Applicative laws with liftA2 rather than <*>. So that I can omit <*> too.
05:14:21 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
05:14:47 azimut joins (~azimut@gateway/tor-sasl/azimut)
05:15:46 stengah joins (~stengah@user/stengah)
05:16:24 <ski> yea, imho, `RecordWildCards' is more confusing than `NamedFieldPuns'. and the main problem with `NamedFieldPuns' is the clashing with reuse of field names as field name extraction functions .. without that, i wouldn't have a problem with `NamedFieldPuns'
05:16:29 <monochrom> Actually not just a nice way. A practical way, too.
05:17:16 <monochrom> Because at some point I explain that we care about identity laws and associative laws because they justify a lot of refactorings.
05:17:54 <monochrom> And if I dare say that, I ought to demo it a bit with an actual short proof of an actual short example, no?
05:18:18 <monochrom> Well, currently, both versions of Applicative laws make the proof very long and also very artificial.
05:18:22 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
05:18:48 <monochrom> Unlike monad laws. The monad laws are actually way better in this case.
05:18:49 <dsal> This code does a lot of `let thingKey = x; thingVal = y; thingStuff = z in Thing{..}` type of code. I changed a field name and suddenly fields just weren't set. Seems like a weird convention.
05:19:12 <monochrom> (Proofs that are both short and obvious.)
05:19:31 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
05:20:33 <ski> dsal : ugh, yea .. not a fan of bringing names into scope implicitly (or the reverse, implicitly using names in scope)
05:21:12 <dolio> The unit laws don't seem bad.
05:21:56 <dolio> And associative laws seem like they're going to be messy anyway.
05:22:19 <dsal> ski++
05:22:26 ski twitches
05:23:32 <dsal> succ ski
05:23:53 <ski> preferable, i guess
05:24:14 <dsal> I like that `undefined` is in the banned function list, but the author is a proponent for writing `let Thing _ _ _ _ = undefined` in various code as a change detector.
05:25:53 ski . o O ( `forall f ia ib ic. liftA2 (\(a,b) c -> f a b c) (liftA2 (,) ia ib) ic = liftA2 (\a (b,c) -> f a b c) ia (liftA2 (,) ib ic)' )
05:25:57 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
05:26:07 <ski> change detector ?
05:26:21 <dsal> Yeah, so like, if you add a new field to Thing, this code should break.
05:26:22 abhixec joins (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
05:26:39 <ski> oh
05:27:04 <dsal> That's marginally preferable to "this code should work correctly" but not enough that I lost all those arguments yet.
05:28:12 <dsal> This lists `fromEnum` as "# Does not do what you think it does." -- this one is kind of weird. I think it does do what I think it does. I found a couple pages of code where people had Enum instances for a simple sum type and then manually wrote out the exact same Enum instance under a different name.
05:31:19 <monochrom> This is why my simple (pun intended) model of the human brain is: memoizing random generator.
05:31:30 takuan joins (~takuan@178-116-218-225.access.telenet.be)
05:31:44 <monochrom> First randomly generate an opinion. Then remember to stick to it.
05:32:06 <dsal> It also spreads.
05:32:21 <monochrom> So suppose you want to opine on 100 functions in the standard library.
05:32:35 ski . o O ( oracles & forcing )
05:33:08 <monochrom> Easy! For each function, randomly generate an opinion. Done! Now you also prove yourself to have no consistency.
05:33:12 <ski> you flip a coin to determine whether to keep or to drop, and then invent reasons why ?
05:33:21 <monochrom> Yeah!
05:35:03 <monochrom> There is no simpler way to explain why a person can believe both "names should be more explicit" ("longer names") and "names should be more implicit" ("don't use NamedFieldPuns").
05:36:33 nitrix joins (~nitrix@user/nitrix)
05:37:12 ski . o O ( "Continuity of Gödel's system T definable functionals via effectful forcing" by Martín Hötzel Escardó in 2013 at <https://www.cs.bham.ac.uk/~mhe/dialogue/dialogue.pdf> )
05:37:44 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
05:38:08 <ski> monochrom : hm .. perhaps one of those is as a reaction to the other
05:38:21 <monochrom> I once wrote a memoizing random generator using unsafeInterleaveIO and posted on lpaste :) :(
05:39:42 <dolio> That's how some of Bouwer's counterexamples work.
05:39:44 <ski> istr hearing QuickCheck for Erlang used memoizing random generator, to generate a random function
05:40:14 <monochrom> A lazy binary tree. At each node there is data, but the data is randomly generated when the user first visits the node. Interactive.
05:41:32 ski . o O ( Fudget oracles tell the user the outcome of a concurrency scheduling decision )
05:41:47 <ski> dolio : elaborate ?
05:42:13 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Remote host closed the connection)
05:43:21 <dolio> Like, the counterexample to Markov's principle. You say, "there is an infinite bit sequence that satisfies the premise." I think it's supposed to be that not all are 0.
05:43:48 <dolio> Then when people ask you about individual bits, you always tell them 0, and remember the indexes they asked about.
05:44:31 <dolio> But, if they try to claim all bits are 0, you decide that an index they haven't asked about yet is 1.
05:44:38 <ski> hm, is that related to Kreisel's no-counterexample-interpretation ?
05:44:44 <monochrom> Adversary arguments :)
05:45:30 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
05:46:53 <dolio> Maybe. I'm not familiar with that.
05:48:20 <monochrom> For example why elem :: Eq a => a -> [a] -> Bool must examine more than n-1 elements (if n is the length of the list).
05:48:28 <ski> instead of `exists x. forall y. R (x,y)', you claim `forall f. exists x. R (x,f x)' (dual of AoC). so instead of constructing `x' immediately, you want for your opponent to tell how they intend to choose `y', given `x'. then you use that to construct your `x'
05:49:03 <ski> s/want/wait/
05:49:39 <monochrom> The adversary thinks up non-matching elements for your n-1 queries.
05:50:34 <monochrom> Then, if your algorithm returns True, the adversary thinks up one more non-matching element for the one spot you didn't ask about.
05:51:02 <monochrom> If your algorithm returns False, the adversary claims that the spot you didn't ask about has the element.
05:52:31 <monochrom> One more use case for unsafeInterleaveIO! :)
05:54:04 <dolio> Yeah. I think basically Brouwer doesn't think that infinite sequences need to be limited to some pre-defined describable procedure.
05:54:23 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 264 seconds)
05:55:07 <dolio> That's obviously a pathological example concocted for that particular principle.
05:56:45 xiongxin joins (~quassel@113.116.224.79)
05:57:25 <dolio> The broader point is, an infinite sequence generted by a mathematician who wants to invalidate Markov's principle is a valid sequence. Or if the sequence depends on their mood when you inquire about a particular bit (as long as they don't contradict themselves if you ask twice), or ...
06:00:01 × orangeFlu quits (~flu@86.121.5.30) (Ping timeout: 268 seconds)
06:00:16 orangeFlu joins (flu@gateway/vpn/protonvpn/orangeflu)
06:01:32 <dolio> Which is a useful notion, since it means you can accomodate sequences that can't feasibly be feasibly associated to, like, a Turing machine. Like, measuring a physical instrument, even if you for some reason believe that 'in principle' you could give a Turing machine that will reproduce those results.
06:01:52 <dolio> Oops, I duplicated a word.
06:02:07 <ski> "computable" vs. "algorithmic"
06:02:58 <ski> no need to assume a Cauchy sequence is algorithmic, to be able to compute with it, it's a superfluous assumption
06:03:26 <dolio> Right. You can run algorithms on data that is not generated by an algorithm.
06:03:57 <dolio> Even if it's merely because you don't know the algorithm.
06:04:07 <ski> iirc Escardó talks a little bit about that, in his thesis
06:04:39 <ski> (and the difference it makes for the topology, depending on whether you assume external data is algorithmic, or not)
06:07:12 <ski> i suppose induction vs. coinduction, introduction vs. elimination, finitary vs. infinitary, is related
06:07:50 <dolio> Yeah, this comes up with modest sets and realizability toposes, too. You can have things realized in a way where only some of the realizers are computable. The arrows are always realized by computable realizers, but the objects aren't necessarily.
06:08:20 <dolio> In that context "computable" means by an algorithm.
06:09:52 <ski> mm
06:09:56 <dolio> And there's a modality #A that picks out just the computable stuff.
06:09:59 × stengah quits (~stengah@user/stengah) (Ping timeout: 264 seconds)
06:10:03 <ski> the objects involve some function or relation ?
06:10:44 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
06:11:10 lavaman joins (~lavaman@98.38.249.169)
06:11:11 × orangeFlu quits (flu@gateway/vpn/protonvpn/orangeflu) (Ping timeout: 264 seconds)
06:11:57 kayprish joins (~kayprish@46.240.130.158)
06:11:59 × kayprish quits (~kayprish@46.240.130.158) (Remote host closed the connection)
06:12:55 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
06:15:14 × Maxdamantus quits (~Maxdamant@user/maxdamantus) (Quit: Lost terminal)
06:15:41 Maxdamantus joins (~Maxdamant@user/maxdamantus)
06:16:03 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
06:16:14 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Client Quit)
06:16:17 × xiongxin quits (~quassel@113.116.224.79) (Ping timeout: 265 seconds)
06:16:27 xiongxin_ joins (~quassel@113.116.33.28)
06:16:47 <dolio> I'm not sure what the question is. One view is that your realizers form a partial combinatory algebra, which is like a model of SK calculus. So ℕ^ℕ is one that contains non-computable stuff. A map `f : A → B` is always given by a computable realizer, but the exponential `B^A` 'has' non-computable realizers.
06:17:20 × nitrix quits (~nitrix@user/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
06:18:24 <dolio> I'm not sure how that shows up exactly, but probably there's some sense in which there are things that don't factor through 1 or something.
06:18:55 <ski> yea, i was wondering what it meant that objects aren't necessarily "computable", whether it e.g. meant that some function or relation that goes into the make-up of objects in this category wasn't necessarily that
06:18:58 <dolio> Because the points `f : 1 → B^A` are computable.
06:19:14 ski nods
06:21:36 <dolio> I guess 1 is probably not a "separator".
06:24:03 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
06:24:03 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
06:24:03 wroathe joins (~wroathe@user/wroathe)
06:24:03 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
06:24:14 mikoto-chan joins (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
06:24:19 MQ-17J joins (~MQ-17J@8.21.10.20)
06:27:52 × Maxdamantus quits (~Maxdamant@user/maxdamantus) (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
06:28:55 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
06:29:08 Maxdamantus joins (~Maxdamant@user/maxdamantus)
06:30:22 <ski> hm, inapropos, was it you who once mentioned some YouTube link of a mathematician (on a Zoom call or something), talking about coinduction and dynamical systems, or somesuch ?
06:30:34 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
06:31:18 <dolio> Hmm. Maybe.
06:32:42 <ski> (looking for it, i found "Monad-comonad interaction laws, monad algebras, comonad coalgebras" by Tarmo Uustalu in 2020-10-22 at <https://www.youtube.com/watch?v=LHIKGC_oxFA>, but i don't think that's the one i had in mind)
06:33:31 <dolio> Are you talking about this? https://www.youtube.com/watch?v=XqywV-wkKSE
06:34:02 <ski> hm, that might've been it !
06:35:00 × enicar quits (~enikar@user/enikar) (Quit: WeeChat 2.8)
06:36:00 enikar joins (~enikar@user/enikar)
06:38:09 fvr joins (uid503686@id-503686.uxbridge.irccloud.com)
06:45:18 nitrix joins (~nitrix@user/nitrix)
06:46:48 lavaman joins (~lavaman@98.38.249.169)
06:48:10 × slowtyper quits (~slowtyper@user/slowtyper) (Ping timeout: 252 seconds)
06:48:15 slowtype- joins (~slowtyper@46.12.91.253.dsl.dyn.forthnet.gr)
06:51:23 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
06:53:01 × euandreh quits (~euandreh@2804:14c:33:9fe5:11fc:225b:3e1b:f83b) (Ping timeout: 245 seconds)
06:54:12 euandreh joins (~euandreh@2804:14c:33:9fe5:8d5f:78c6:cd1:4a9b)
06:57:29 <hololeap> @hoogle (e -> m a) -> ExceptT e m a -> m a
06:57:30 <lambdabot> No results found
06:59:49 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
07:01:13 <ski> @type \h e -> either h return =<< runExceptT e
07:01:14 <lambdabot> Monad m => (a -> m b) -> ExceptT a m b -> m b
07:04:48 <hololeap> % :t \f -> either f pure <=< runExceptT
07:04:49 <yahb> hololeap: Monad m => (a -> m c) -> ExceptT a m c -> m c
07:05:13 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
07:05:19 <hololeap> yeah, i'm a little surprised this isn't in the ExceptT module
07:07:42 <ski> @hoogle (e -> m b) -> (a -> m b) -> (ExceptT e m a -> m b)
07:07:43 <lambdabot> Control.Error.Util exceptT :: Monad m => (a -> m c) -> (b -> m c) -> ExceptT a m b -> m c
07:08:04 <ski> @hoogle Exception e => (e -> IO b) -> (a -> IO b) -> (IO a -> IO b)
07:08:05 <lambdabot> No results found
07:09:16 gehmehgeh joins (~user@user/gehmehgeh)
07:09:31 falafel joins (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com)
07:11:22 lavaman joins (~lavaman@98.38.249.169)
07:11:29 max22- joins (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
07:16:13 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
07:27:26 × hnOsmium0001 quits (uid453710@hampstead.irccloud.com) (Quit: Connection closed for inactivity)
07:36:13 kuribas joins (~user@ptr-25vy0ial9ts1i2t1r9b.18120a2.ip6.access.telenet.be)
07:39:13 wonko joins (~wjc@62.115.229.50)
07:43:58 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:46:21 cfricke joins (~cfricke@user/cfricke)
07:49:29 mbuf joins (~Shakthi@122.173.255.77)
07:49:52 <tomsmeding> maerwald: I made some bad drawings https://tomsmeding.com/f/ghcup-logo/index.html
07:50:02 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
07:53:55 <kuribas> Do you think data-oriented programming in haskell is feasible or desirable? It means describing your business logic as data, and then having an interpreter to implement that logic.
07:54:06 <kuribas> It also looks hard to make robust and type safe.
07:54:14 arjun joins (~user@user/arjun)
07:54:59 <kuribas> Because if you want to be type-safe, those datastructures need to describe the types as well as the logic.
07:58:11 stengah joins (~stengah@user/stengah)
07:58:39 <kuribas> I suppose you need GADTs then.
08:00:14 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
08:04:04 <tomsmeding> kuribas: the predicate "can model this real-world concept in the Haskell type system" has some very non-intuitive structure
08:04:34 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
08:04:34 <tomsmeding> that is: innocuous changes in the requirements have a tendency to have a profound effect on how easily you can model your problem using haskell types
08:04:59 <kuribas> But what if you try to push as much as possible in value level?
08:05:11 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Ping timeout: 264 seconds)
08:05:24 <tomsmeding> if you're staying restrained in terms of how much you use from GADTs, GHC haskell has quite powerful tools for working with them
08:05:55 × bitmapper quits (uid464869@lymington.irccloud.com) (Quit: Connection closed for inactivity)
08:06:03 <tomsmeding> like, only simple type tags, preferably no type variables of kind other than Type
08:06:27 <kuribas> For example, using higher kinded types to map the meta information to actual runtime information.
08:06:31 hendursa1 joins (~weechat@user/hendursaga)
08:06:50 <tomsmeding> not that you cannot have those more fancy type variables; it works very well, but I think the correlation between "I need type variables of non-Type kind" and "my problem requires extensions/techniques that are not for the faint of heart" is quite high
08:07:26 <tomsmeding> but this is philosophising, I think you can't say anything much more concrete without having a case in front of you
08:07:55 <tomsmeding> kuribas: that sounds cool but I frankly have no idea what you mean with that, concretely :p
08:07:56 <kuribas> for example: describing a data model declaratively, then generating queries to fetch the model from the database.
08:08:03 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection)
08:08:05 <tomsmeding> hm
08:08:18 <kuribas> Assuming the data model has pointers to which tables are relevant etc...
08:08:24 LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao)
08:08:27 <tomsmeding> that sounds quite possible
08:08:39 <kuribas> But the question is of course, does this have an advantage over simply making a separate module with curstom queries.
08:08:56 <tomsmeding> also sounds like the type-indexedness of GADTs only helps for correctness here; plain ADTs would work fine if all programmers are diligent
08:09:12 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
08:09:14 <tomsmeding> (which is a precarious assumption :p )
08:10:09 <tomsmeding> module with custom queries is less cool and less flexible in some ways, but more flexible in other ways (easier to encode exceptions to the general patterns) and also easier for beginning haskellers to understand
08:10:26 <kuribas> indeed
08:11:04 <kuribas> And I find the ability to compose queries makes this not that painful.
08:11:41 <kuribas> As you can extract common patterns, and make flexible queries corresponding to the requirements.
08:12:24 <tomsmeding> I mean, don't get me wrong, not too long ago I willingly wrote and used a data type with 8 type parameters
08:12:45 <kuribas> hehe
08:13:22 <tomsmeding> it even made me write a tool to refactor my code to add a type parameter to that type while parsing existing occurrences of the type better than regexen can https://git.tomsmeding.com/refactor-type-parameters/tree/
08:13:41 <tomsmeding> may or may not have been a bad use of my time
08:13:54 <tomsmeding> kuribas: yes indeed
08:14:17 <tomsmeding> for a business application I would naively expect that the kind of flexibility that the "module with custom queries" approach gives you is precisely the flexibility that you need
08:14:50 <tomsmeding> the composability of the data-driven version is cool but ultimately more suited to more PL-theoretic environments like compilers, I think
08:14:57 <tomsmeding> (which is :( )
08:16:00 <kuribas> yeah, and I find in real business applications you often get edge cases etc which have to be encoded in the data model, so it becomes less and less clean over time.
08:18:09 × aegon quits (~mike@174.127.249.180) (Remote host closed the connection)
08:21:47 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
08:22:06 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
08:24:52 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
08:24:52 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
08:24:52 wroathe joins (~wroathe@user/wroathe)
08:25:58 acidjnk joins (~acidjnk@p200300d0c703cb13982ae5e8635fcd4e.dip0.t-ipconnect.de)
08:26:50 × nuh^ quits (~nuh@70.166.66.234) (Remote host closed the connection)
08:30:29 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
08:39:50 unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
08:40:39 arjun parts (~user@user/arjun) (ERC (IRC client for Emacs 28.0.50))
08:43:35 × stengah quits (~stengah@user/stengah) (Ping timeout: 264 seconds)
08:43:35 × wonko quits (~wjc@62.115.229.50) (Ping timeout: 264 seconds)
08:44:41 jushur joins (~human@user/jushur)
08:49:35 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
08:53:44 × Arsen quits (~arsen@managarm/dev/Arsen) (Quit: Quit.)
08:54:27 Arsen joins (~arsen@managarm/dev/Arsen)
08:56:51 emliunix joins (~emliunix@101.88.126.148)
09:00:23 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
09:00:59 Tuplanolla joins (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
09:04:03 × hrnz quits (~ethical@vegan.im.it) (Quit: das ist mir zu bld hier; bb)
09:04:18 hrnz joins (~ethical@vegan.im.it)
09:07:35 × falafel quits (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com) (Ping timeout: 264 seconds)
09:08:11 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 264 seconds)
09:10:47 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
09:13:57 fendor joins (~fendor@178.115.59.192.wireless.dyn.drei.com)
09:14:33 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
09:21:03 o1lo01ol1o joins (~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
09:23:29 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 265 seconds)
09:23:45 stengah joins (~stengah@user/stengah)
09:25:13 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
09:25:48 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Client Quit)
09:29:13 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
09:35:20 × hendursa1 quits (~weechat@user/hendursaga) (Remote host closed the connection)
09:37:51 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
09:38:49 <sm> what could explain this: an error call in my program can be caught, an error call in a lib can not be ?
09:38:53 sm sent a haskell code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/ce943f8bb2ade3235929801a0bf419b437d75e7e
09:39:31 mc47 joins (~mc47@xmonad/TheMC47)
09:40:17 <sm> displaySize code: https://hub.darcs.net/ffaf/ansi-terminal-game/browse/src/Terminal/Game/Layer/Object/IO.hs#120
09:40:37 × slowtype- quits (~slowtyper@46.12.91.253.dsl.dyn.forthnet.gr) (Quit: ZNC 1.8.2 - https://znc.in)
09:40:53 slowtyper joins (~slowtyper@user/slowtyper)
09:42:15 hendursa1 joins (~weechat@user/hendursaga)
09:42:29 <tomsmeding> sm: laziness
09:42:41 <tomsmeding> displaySize returns a pair of thunks, one of which contains the error call
09:42:52 <tomsmeding> evaluating the tuple is fine, and 'catch' only does WHNF
09:43:06 <tomsmeding> 'print' then forces the error
09:43:13 <tomsmeding> (or at least that's what I think is happening)
09:43:39 <sm> urgh.. that makes sense, thank you
09:44:00 <sm> stupid tuples..
09:44:14 <tomsmeding> throwing an asynchronous exception when getting TERM fails is bad though IMO
09:44:24 <tomsmeding> were it an IO exception, it would've been fine :p
09:44:27 × o1lo01ol1o quits (~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Remote host closed the connection)
09:44:37 caef^ joins (~caef@70.166.66.234)
09:45:19 <stengah> hey guys new here
09:45:30 <sm> agreed. An ErrorCall is not an IOException I guess.
09:45:30 <stengah> I learned basics
09:45:39 <stengah> how learn more?
09:45:45 <stengah> how to learn more?
09:46:00 <stengah> how to become pro like you guys?
09:47:00 sm wonders how to force it to fully evaluate
09:47:10 <tomsmeding> sm: the point with throwIO is that it's sequenced in the IO monad, so you're guaranteed to get the exception
09:47:16 <oak-> Write some more code and solve practical real world problems :)
09:47:24 <tomsmeding> sm: length (show result) `seq` restofyourcode
09:48:41 <stengah> Also I don't need I understand monad
09:49:00 <stengah> oak- : what practical real world problems you solved?
09:49:10 <stengah> do you also know PL theory?
09:50:05 <sm> tomsmeding: that's not quite it, but I'll get there
09:50:41 <kuribas> stengah: how much do you know now? What is your goal?
09:51:29 <stengah> My goal for now is to learn enough to write compilers
09:51:35 <stengah> getting into PL theory
09:51:50 <tomsmeding> sm: okay better guess: print =<< (displaySize >>= \sz -> length (show sz) `seq` return sz) `catch` \(_::SomeException) -> return (0,0)
09:52:07 <tomsmeding> (clearly that length . show thing should be deepseq but less deps and stuff)
09:52:25 <stengah> I've read the book by hutton
09:52:31 <stengah> and gentle introduction to haskell
09:52:48 <stengah> also wrote some small programs
09:53:07 × hendursa1 quits (~weechat@user/hendursaga) (Remote host closed the connection)
09:53:33 <sm> tomsmeding: nice! thanks for the example
09:53:51 hendursa1 joins (~weechat@user/hendursaga)
10:00:31 <tomsmeding> stengah: what's "small programs"?
10:03:23 <stengah> let's say code with less than 200 lines
10:03:51 × xff0x quits (~xff0x@2001:1a81:5288:5c00:1568:382a:23d8:c3dd) (Ping timeout: 245 seconds)
10:04:03 <stengah> programs that does nothing significant
10:06:10 <stengah> or worthy
10:06:30 bluenode joins (~bluenode@cpc99576-brnt1-2-0-cust237.4-2.cable.virginm.net)
10:06:37 <bluenode> hello folks
10:06:52 <bluenode> simple question; why won't this compile?
10:06:53 <bluenode> fullString = concat (intersperse " " ["hello","there","folks"])
10:06:53 <bluenode> let toPrint = ["a", "da"]
10:06:54 <bluenode> main = print toPrint
10:07:25 <tomsmeding> stengah: written a mandelbrot renderer yet?
10:07:36 <stengah> nope
10:07:40 <tomsmeding> just writing ascii art to output is fine :p
10:07:42 <tomsmeding> do that
10:07:53 <tomsmeding> far less than 200 lines but always nice
10:08:09 × hendursa1 quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
10:08:18 <stengah> Okay
10:08:38 <stengah> starting right now
10:08:53 hendursa1 joins (~weechat@user/hendursaga)
10:09:50 <tomsmeding> stengah: then write a calculator that takes input in https://en.wikipedia.org/wiki/Reverse_Polish_notation
10:10:13 <tomsmeding> slightly more advanced is making that accept normal infix notation
10:11:01 lavaman joins (~lavaman@98.38.249.169)
10:11:56 <stengah> ok
10:12:04 <stengah> will do both
10:12:27 <stengah> bluenode: try each line in ghci
10:12:29 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
10:13:24 <sm> bluenode: if only we had some kind of automatic analysis tool.. :)
10:13:30 <tomsmeding> stengah: also write interpreters for whatever language you like
10:13:36 <tomsmeding> start with brainfuck perhaps
10:14:09 <tomsmeding> then try to optimise the brainfuck before you execute it :p
10:14:29 <stengah> and how do you understand monad?
10:14:38 <bluenode> sm: if the compiler's error message was helpful then i wouldnt be asking here ;)
10:14:41 <stengah> is there a particular way to look into it?
10:14:43 <bluenode> stengah: yes that works in ghci but not in a script. i realise i need to get rid of the let if i want it to compile in a script, but why is that?
10:15:17 <tomsmeding> stengah: Monad is an abstraction that generalises _many_ different things. Most monad tutorials or descriptions give intuition for just one kind of monad.
10:15:17 <stengah> main = do print toPrint
10:15:20 <stengah> try this
10:15:20 <xsperry> bluenode ghci (roughly) pretends to be in IO block, where let works
10:15:32 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
10:15:45 <tomsmeding> stengah: I understood it by not understanding it and then working with them too often
10:15:54 <tomsmeding> also implement Monad instances for lots of types
10:16:37 <stengah> tomsmeding: so you just get familiar with the laws
10:16:53 <tomsmeding> yes, by playing with monads
10:17:02 × slowtyper quits (~slowtyper@user/slowtyper) (Quit: ZNC 1.8.2 - https://znc.in)
10:17:09 <sm> bluenode: I hear you. We can take a look.
10:17:09 <sm> @where paste
10:17:10 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
10:17:10 <tomsmeding> not by reading a book (I never learned programming by reading from a book, but I know other people like to work differently)
10:17:20 slowtyper joins (~slowtyper@user/slowtyper)
10:17:30 <stengah> I've read lots of books
10:17:48 <sm> (but I guess you figured it out)
10:17:51 <tomsmeding> stengah: which means you need to get writing instead of reading :)
10:17:52 <stengah> but always found myself stuck when doing thinhs
10:18:06 <tomsmeding> stengah: which means that you haven't been doing things often enough ;)
10:18:07 <stengah> s/thinhs/code
10:18:13 <stengah> yeah!
10:18:16 <tomsmeding> so do more things!
10:18:42 <stengah> I shall do things from now on :)
10:18:50 <tomsmeding> (sounds like I'm making a joke now but I really am not, practice makes perfect, especially in haskell)
10:20:25 <sm> +1
10:21:15 <stengah> I am going to do things
10:21:18 <stengah> starting now
10:21:26 <stengah> brb
10:21:27 <sm> be warned, it can also make you crazy. There sure is a lot to trip you up in haskell.
10:21:34 <bluenode> can confirm.
10:22:02 sm was going along fine for ages and suddenly it's dragons at every turn
10:23:30 <stengah> I have you guys for that.
10:23:43 <stengah> those who came before me
10:23:46 <stengah> :)
10:24:40 <bluenode> i find writing basic scripts to be more practical than ghci to help me learn haskell
10:24:57 <maerwald> tomsmeding: do you think so?
10:25:03 <maerwald> I'm not sure actually
10:25:33 <bluenode> what's the best way to leverage scripts to learn the language? do you print things as you go along? do you run it in the debugger with breakpoints?
10:25:52 <maerwald> debugger? :D
10:29:13 ubert joins (~Thunderbi@178.165.199.151.wireless.dyn.drei.com)
10:29:18 <tomsmeding> maerwald: that practice is especially important with haskell you mean?
10:29:41 jacks2 joins (~bc8165b6@199.204.85.195)
10:29:47 <tomsmeding> I'm saying that mostly in contrast with learning something new in the imperative world if you know a bit of imperative programming
10:29:58 <tomsmeding> you're not going to get the functional programming mindset without _doing_ it
10:30:12 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.)
10:30:18 <maerwald> tomsmeding: no, my hunch is that practice doesn't make a better programmer, because you usually stay in your bubble if you just ramp up programming time
10:30:32 <tomsmeding> you do have a point there
10:30:40 <maerwald> so I think it's more exposure to other programmers
10:30:41 <tomsmeding> but to get there you need to have done practice already
10:30:43 <jacks2> hi. thoughts on doing this with System.Console.Ansi: private to module themeRef = unsafePerformIO $ newTVarIO defaultTheme; and then expose withTheme :: Theme -> IO a -> IO a ?
10:31:00 <tomsmeding> maerwald: OP said that they'd read two (!) books on haskell and written some <200 line programs
10:31:08 <tomsmeding> to me that sounds like an off-balance scale
10:31:22 <maerwald> the times I really felt I've learned something usually was either 1) contributing to a project I didn't start or 2) coding with a work colleague who had wildly different mindset/style
10:31:24 <tomsmeding> once you've righted that balance, you can start thinking about learning more good things
10:31:25 o1lo01ol1o joins (~o1lo01ol1@107.127.31.33)
10:31:48 chexum joins (~quassel@gateway/tor-sasl/chexum)
10:32:02 <maerwald> practice just makes you faster/more efficient in what you naturally are good at
10:32:10 DNH joins (~DNH@2a02:8108:1100:16d8:11c6:13b4:148f:aabf)
10:32:21 <tomsmeding> and you need some baseline of efficiency in order to effectively build on the knowledge
10:32:34 <tomsmeding> you're right that practice won't make perfect, that was the wrong phrase perhaps
10:32:53 <tomsmeding> but with too little practice you're not going to get good either
10:34:11 <bluenode> speaking of which
10:34:13 <jacks2> where theme is something like this: withTheme theme action = do setTheme and update global reference..; check for nested calls; `finally` restore default theme
10:34:14 <bluenode> why won't this compile
10:34:17 <bluenode> myList = ["foo", "bar"]
10:34:17 <bluenode> "hello" : myList
10:34:26 <jacks2> +call action
10:34:28 <bluenode> (in a script, not in ghci)
10:35:06 × xiongxin_ quits (~quassel@113.116.33.28) (Ping timeout: 245 seconds)
10:35:07 <xsperry> : is wrong syntax for that. you already defined myList in previous line, type was inferred, and you can't change it
10:35:41 <bluenode> xsperry: ok so how am i supposed to do it?
10:36:16 <bluenode> and why is it wrong syntax if it's in the docs https://wiki.haskell.org/How_to_work_on_lists
10:36:19 xff0x joins (~xff0x@2001:1a81:5288:5c00:1568:382a:23d8:c3dd)
10:36:26 <xsperry> myList = ["foo", "bar"] :: [Type]
10:36:50 <xsperry> oh, you are using (:)
10:37:05 <xsperry> see the type of (:)
10:37:14 <xsperry> :t (:)
10:37:16 <lambdabot> a -> [a] -> [a]
10:37:22 × chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
10:37:41 chexum joins (~quassel@gateway/tor-sasl/chexum)
10:37:48 <xsperry> what is the type of myList?
10:38:07 <bluenode> [String]
10:38:21 <xsperry> that doesn't type check. first argument is a, second [a]
10:38:39 <bluenode> why does it work on ghci??
10:38:46 <stengah> tomsmeding: I never thought about balance between reading books and _doing_ it
10:38:47 <xsperry> I doubt it does
10:39:09 <stengah> I thank you for pointing me.
10:39:10 <bluenode> xsperry: it does, try it for yourself
10:39:28 <jacks2> bluenode what is the error
10:39:44 <bluenode> jacks2: Parse error: module header, import declaration or top-level declaration expected.typecheck
10:40:01 <jacks2> you can't put arbitrary code at top level
10:40:38 <phaazon> I realize that the problem I tried to fix yesterday is probably unsound, but I would like to be sure
10:40:40 <jacks2> top-level = outside of functions
10:41:04 <bluenode> jacks2: but i can do plenty of things at the top-level; i can define that list, print elements in it, etc.
10:41:34 <jacks2> but you can't do naked "hello" : mylist
10:41:46 <jacks2> what would that even accomplish
10:42:05 <bluenode> i am just trying to append a new element to a list
10:42:24 <tomsmeding> bluenode: you can't modify the list, you can only create a new list that is "the old list with a new element in front of it"
10:42:32 <jacks2> so assign it to a top-level variable
10:42:47 <bluenode> so lists are immutable in scripts but NOT in ghci?
10:42:47 <tomsmeding> writing '"hello" : myList' is like writing '1 + 2' -- it doesn't actually modify anything, it just computes a value
10:42:49 <jacks2> newList = "hello" : myList
10:43:01 <tomsmeding> bluenode: lists are also immutable in ghci
10:43:13 <phaazon> given a parametric typeclass (two type variables) representing a « backend feature » some backend packages will implement it for a set of parameters (second type variables), but they won’t implement the same; the big thing is that, I want to find a way to express values depending on that typeclass so that the second type variable is inferred from the use, a bit like a rank-N quantification;
10:43:15 <phaazon> the end goal is that I don’t want to restrict backends to all implement the same types for this second variable, and I don’t want users to annotate all the possible type classes; any idea? I tried both in Haskell and Rust and I have no solution
10:43:16 <bluenode> tomsmedding: why does this work:
10:43:17 <bluenode> Prelude> myList = ["foo", "bar"]
10:43:17 <bluenode> Prelude> "hello" : myList
10:43:18 <bluenode> ["hello","foo","bar"]
10:43:23 <jacks2> yes (:) doesn't mutate original list. there's no way to mutate it
10:43:25 <tomsmeding> > 1 + 2
10:43:26 <lambdabot> 3
10:43:33 <tomsmeding> bluenode: evaluating an expression gives a value :)
10:43:39 <phaazon> I guess the thing I want is really a rank-N constraint but I have no idea how to do that
10:43:41 <tomsmeding> bluenode: try typing "myList" after that
10:43:44 <tomsmeding> it didn't change
10:44:59 <phaazon> so for instance in some end-user code, right now, you need something like foo :: (Backend b Int, Backend b Double, Backend b Bool) => …
10:45:10 <phaazon> I want foo :: ExistsBackend b => …
10:45:36 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
10:46:10 <bluenode> tomsmeding jacks2: so to the expression result being unused produces a "import declaration or top-level declaration expected" error.
10:46:18 <tomsmeding> phaazon: what will determine what that second type parameter is? The caller, or because there _is_ only one instance of Backend with that b parameter, or something else?
10:46:22 <phaazon> in Rust it would be fn foo<B>(…) where B: Backend<i32> + Backend<f64> + Backend<bool>, and what I want would be fn foo<B>(…) where B: for<T> Backend<T>, // hence why I mention « rank-N » constraint
10:46:34 <kuribas> phaazon: can't you use a type family?
10:46:40 <phaazon> tomsmeding: the user code, mainly
10:46:43 <tomsmeding> bluenode: because writing an expression that does nothing at the top level is useless, haskell disallows it
10:46:46 <phaazon> it’s like « this backend can do that with this T »
10:46:47 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
10:47:04 <phaazon> imagine like the backend is a database, and the second variable is whether it knows how to handle a given type row
10:47:17 <bluenode> tomsmeding: i get it now. but you gotta admit that the compilation error message was misleading
10:47:18 <jacks2> bluenode, result being unused it not a problem, using code that isn't valid at top-level, at top-level, is
10:47:20 <phaazon> I « could » move that to the abstraction, but then all backends would be required to implement all the same types
10:47:25 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
10:47:27 <phaazon> so it would mean leveling by the bottom, or having runtime checks
10:47:29 <sm> bluenode: printing things as you go is helpful, and especially master Debug.Trace
10:47:30 <tomsmeding> phaazon: if there is only ever one t for a b in the Backend b t type class, you can add a functional dependency b -> t to the Backend type class
10:47:34 <phaazon> kuribas: I tried with that, I failed
10:47:54 <phaazon> tomsmeding: I showed example where you have several values
10:47:54 <tomsmeding> if the caller of 'foo' needs to decide, they need a way to express their decision
10:48:05 <phaazon> i.e. this:
10:48:15 <phaazon> phaazon | so for instance in some end-user code, right now, you need something like foo :: (Backend b Int, Backend b Double, Backend b Bool) => …
10:48:33 <phaazon> maybe that problem is unsound and there is no solution
10:48:38 <tomsmeding> 'foo :: forall t b. Backend b t => ...'; then use 'foo @Int' or 'foo @Bool' in user code?
10:48:47 <phaazon> I thought QuantifiedConstrain was a solution but awpr showed me yesterday it won’t work
10:48:56 <phaazon> QuantifiedConstraint*
10:48:56 <tomsmeding> (not sure if this solves your problem, but the reason why it doesn't helps me understand what the problem is)
10:49:12 <tomsmeding> also yeah you can have '(forall t. Backend b t) =>', but that's forall, not exists
10:49:25 <phaazon> yeah, that’s QuantifiedConstraint, it won’t help
10:49:30 <phaazon> maybe the problem is that I’m designing this wrong
10:50:08 <kuribas> phaazon: I find it hard to understand what you are solving?
10:50:10 <jacks2> bluenode, what is legal at top-level: imports, type and value declarations, module clause, pragmas
10:50:15 <phaazon> tomsmeding: so basically, without talking code, what I want to do is that I have two packages, one user facing, one backend package (we could have many backend packages and I actually have many)
10:50:19 <kuribas> phaazon: maybe some example code could be helpful.
10:50:45 <phaazon> I have this as a Rust example, if you want
10:51:04 <phaazon> I thought that if I can’t solve that in Haskell, I won’t be able to solve it in Rust :D
10:51:45 <phaazon> but mainly, the idea is that I there is a « backe type » in each backend package that will implement a typeclass in the user-facing package, and they will implement it for various types that are compatible with the bcakend
10:52:05 <phaazon> when the user wants to abstract other the backends, they can’t assume the backend implements the types they want
10:52:26 <tomsmeding> phaazon: as I understand your problem (please correct me!), you have a number of backends, each of which have some base type 'b' and implement some interface for one or more value types 't'. You want to write a function 'foo' that is generic over both the backend base type and the value type.
10:52:40 <phaazon> so if they use an Int and Bool version in their code, right now, they need to provide the constraints manually, as in (Backend t Int, Backend t BOol)
10:53:10 <kuribas> phaazon: so you want to move the supported types somewhere else?
10:53:14 <tomsmeding> oh wait you want ghc to infer the necessary Int/Bool values automatically?
10:53:15 <phaazon> tomsmeding: there’s no fundep between b and t
10:53:19 <phaazon> kuribas: yes
10:53:22 <phaazon> I want them to be rank-N
10:53:26 <phaazon> tomsmeding: yes
10:53:33 <tomsmeding> ghc won't do that
10:53:38 <tomsmeding> at least, not with this setup
10:54:01 <tomsmeding> if you want to let ghc do type inference, you should just not give the function a type signature
10:54:06 <tomsmeding> otherwise it won't
10:54:07 <phaazon> instead of (Backend b Int, Backend b Bool), I want (exists t. Backend b t) => UniversalBackend b
10:54:12 <phaazon> something like that
10:54:37 <tomsmeding> where ghc decides, based on the function body of 'foo', what the constraints of 'foo' need to actually be?
10:54:48 <phaazon> argh, I thought it was somehow possible to introduce that kind of existential quantification
10:54:57 <phaazon> tomsmeding: it has to look at the content
10:55:01 <phaazon> a bit like what you would do with rank-2
10:55:02 <kuribas> phaazon: those constraints look very reasonable to me.
10:55:06 <tomsmeding> the content of _what_ exactly?
10:55:13 <tomsmeding> of an argument? of foo?
10:55:15 <phaazon> tomsmeding: the right side of the expression
10:55:21 <tomsmeding> right
10:55:22 <phaazon> i.e. where you use « b »
10:55:23 <tomsmeding> that's impossible
10:55:25 <phaazon> like in rank-2
10:55:27 <phaazon> oh :(
10:55:33 <tomsmeding> rank-2 is something differnt
10:55:34 <kuribas> phaazon: rank-N is a forall right? But in your case you want to limit the types.
10:55:47 <phaazon> it’s not that different to me
10:55:50 <tomsmeding> rank-2 is allowing a polymorphic function as argument to a function
10:55:59 <tomsmeding> (an _explicitly_ polymorphic one)
10:56:11 <kuribas> phaazon: also, rank-N is not inferred.
10:56:38 <tomsmeding> there it's not that ghc decides what instantiations are necessary based on the right-hand side, it's that you as the programmer require in the type signature that the argument needs to be fully generic
10:56:46 <tomsmeding> it's like foo :: (forall t. Backend b t) => ...
10:56:47 <phaazon> foo :: (forall a. SomeConstraint a => a -> IO) -> …; inside foo, when can use foo for different types that will be checked inside the expression, but they won’t work nor all the types
10:56:57 <phaazon> so I thought it would be possible to do the same with type inference on the constraints
10:57:13 <phaazon> that sentence wasn’t very English, I hope you got what I meant :D
10:57:17 <tomsmeding> you can write something like that using rank-N types and quantifiedconstraints, but ghc won't _infer_ it
10:57:23 <kuribas> phaazon: or do you want to have a set of types which are supported by all backends?
10:57:39 <tomsmeding> s/something like that/precisely that
10:57:39 <phaazon> kuribas: so that’s the « leveling by the bottom » thing
10:57:39 <kuribas> phaazon: you could use a constraint type synonym.
10:57:42 <phaazon> and no, I don’t want that
10:57:48 <phaazon> right now, this is what it looks like in real code:
10:58:19 <phaazon> https://github.com/phaazon/luminance-rs/blob/master/examples/common/src/polymorphic_hello_world.rs#L115-L128
10:58:30 <phaazon> (it’s Rust, but you should be able to see the problem quickly even without knowing Rust :D)
10:58:51 <phaazon> for every usage in the user client, I need to add another constraint here
10:58:54 <phaazon> it’s… really annoying
10:58:57 <tomsmeding> well that trick you can do with type classes too
10:58:59 <phaazon> hence why I wanted some kind of rank-N
10:59:13 <phaazon> tomsmeding: what do you mean?
10:59:21 <tomsmeding> rank-N gives you more freedom in specifying types and constraints; it doesn't do anything with ghc's inference
10:59:28 <phaazon> also, I presented that as a technical problem, but maybe it’s a design problem and there is a better way to do that
10:59:47 <phaazon> I don’t want to restrict all backends to implement the same types
10:59:50 <phaazon> it would be obviously easier
11:00:04 <phaazon> but it would have huge impcat
11:00:06 <tomsmeding> class (Pipeline Dim2 a, RenderGate a, TessBackend () () () Interleaved a, ...) => Luminance a; instance (Pipeline Dim2 a, RenderGate a, TessBackend () () () Interleaved a, ...) => Luminance a
11:00:14 <tomsmeding> now Luminance is a synonym of those things
11:00:18 <phaazon> i.e. what if a backend doesn’t support a type? should it return an Either e a? then I have runtime checks, etc.
11:00:23 <tomsmeding> which is what you're doing here in rust, right?
11:00:29 <phaazon> tomsmeding: that’s what I do in Rust too
11:00:35 <phaazon> but I still need to annotate the « user » types here
11:00:37 <phaazon> so that’s not universal
11:00:42 <phaazon> yes it is
11:00:42 <tomsmeding> yeah I was saying, you can do this same thing with type classes :p
11:00:45 <tomsmeding> doesn't solve anything yet
11:00:51 <phaazon> https://github.com/phaazon/luminance-rs/blob/master/examples/common/src/polymorphic_hello_world.rs#L115-L128 here
11:01:30 <tomsmeding> you'll have to manually annotate what second-type-parameter-of-Backend's the function 'foo' requires
11:01:39 <phaazon> so there is no solution to this problem :(
11:02:00 <tomsmeding> as I understand it, not really no
11:02:07 <kuribas> phaazon: the type has to have all the constraints of the function.
11:02:10 <phaazon> besides either requiring all backends to support all types; taking the maximum of them leads to runtime checks — I don’t want that; taking the minimum is leveling by the bottom
11:02:24 <tomsmeding> but what is the _problem_? That you don't want to write out all the constraints because verbosity?
11:02:29 <tomsmeding> like, I accept that as a problem :p
11:02:34 <phaazon> tomsmeding: yes
11:02:39 <phaazon> that’s the problem
11:02:47 <kuribas> phaazon: make a big constraint type synonym with common constraints?
11:02:56 <phaazon> that’s not possible
11:02:58 <tomsmeding> AFAIK that's impossible to solve in this particular case
11:03:04 <phaazon> for instance, in the example I showed, Vertex is a user type
11:03:04 <Franciman> hi phaazon long time no see
11:03:06 <tomsmeding> aside from kuribas's last suggestion right now
11:03:08 <Franciman> everything alright?
11:03:09 <phaazon> and there is no « default Vertex »
11:03:23 <phaazon> hi Franciman! yeah I’ve been lurking here for ~10 years :D
11:03:27 <phaazon> yeah all good, what about you?
11:03:34 <jacks2> bluenode, while beginner questions are fine in here too, there's #haskell-beginners when this channel gets a bit busy, like now. os if you have any more questions you might want to try there
11:03:56 Hanicef joins (~gustaf@81-229-9-108-no92.tbcn.telia.com)
11:03:57 <phaazon> tomsmeding: kuribas yeah, thanks for your hindsight, it’s been two days I’ve been trying to find a solution
11:04:05 <phaazon> I found « one » but then I can’t write the instances
11:04:08 <phaazon> so it’s not usable
11:04:09 <bluenode> jacks2: (y) i didnt know about that channel, ill go lurk there
11:05:01 xiongxin joins (~quassel@113.116.32.200)
11:06:12 <tomsmeding> phaazon: one way I guess is that it's possible to write a type class Backends so that "Backends b '[Int, Bool, Char]" is the same as "(Backend b Int, Backend b Bool, Backend b Char)"
11:06:14 <tomsmeding> if that helps
11:07:01 <phaazon> well I thought about that but it’s a lot of work for no real improvement
11:07:15 <phaazon> I thought ghc could find a way to infer the constraint for me
11:07:19 <phaazon> given the user code
11:07:29 <tomsmeding> it can, right? if you don't give a type signature
11:07:30 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine)
11:08:02 <kuribas> phaazon: haskell is often verbose on the type level, that's just how it is.
11:08:09 <kuribas> phaazon: type synonyms can often help there.
11:08:23 <phaazon> sure, the problem is the same in Rust
11:08:35 <phaazon> my « super trait » allows to use SuperTrait instead of the whole list of constraints
11:08:40 <phaazon> but yet, if the user adds a new usage
11:08:44 <phaazon> like with a new Vertex type for instance
11:08:49 <phaazon> they will have to add another constraint to the list
11:08:59 <kuribas> phaazon: the user can make his own type synonym.
11:09:11 <phaazon> yes, which is currently what people do if they require polymorphic code
11:09:16 <phaazon> and they complained about that
11:09:34 <phaazon> I have a solution for people who don’t care that much about abstracting over the backend and let the compiler do the work for you
11:10:14 <phaazon> (I select the backend type at compilation time using the compilation target and replace types like TheType back a b c t… by TheType a b c t…
11:10:21 <phaazon> for this last use case, there is no issue
11:10:36 <phaazon> but for the case where people want the backend explicitely stated as a type variable…
11:10:38 <phaazon> :(
11:10:42 <kuribas> phaazon: or... you could not track the backend in the type system, and just throw an exception.
11:10:47 frosky joins (~froskyarr@66.90.88.140)
11:10:54 <phaazon> how do you track it?
11:10:56 <phaazon> at runtime?
11:11:14 <kuribas> yes
11:11:23 <phaazon> that’s not okay to me, the whole purpose of all of this is to make it safer at compile-time
11:11:25 <kuribas> then the backend is just a record of maybe functions.
11:11:36 <phaazon> yeah, nah :D
11:11:37 benin joins (~benin@183.82.25.86)
11:11:43 × frosky quits (~froskyarr@66.90.88.140) (Client Quit)
11:11:50 × o1lo01ol1o quits (~o1lo01ol1@107.127.31.33) (Ping timeout: 268 seconds)
11:11:51 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
11:11:58 <kuribas> phaazon: or group the functionality in features.
11:12:10 <kuribas> you cannot have type-safety and not tracking stuff in types.
11:12:13 <phaazon> maybe I will end up forcing backends to implement the same types
11:12:16 frosky joins (~froskyarr@66.90.88.140)
11:12:18 <phaazon> and « whatever » :
11:12:20 <phaazon> :D
11:12:39 <phaazon> kuribas: oh it would be tracked, but at the expression level, not at the head level
11:12:43 <phaazon> I guess I’m dreaming
11:13:12 <kuribas> phaazon: if you want *proof* that the backend supports it, it means you track at type level.
11:13:58 <phaazon> yeah, hence why I have so many constraints right now :D
11:14:53 <kuribas> group the constraints in features, then there has to be only a constraint per feature.
11:14:58 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
11:16:21 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 245 seconds)
11:16:22 Lord_of_Life_ is now known as Lord_of_Life
11:16:25 <phaazon> I don’t see how it’s doable
11:17:19 <phaazon> thanks for the hindsight :) maybe I will end up restricting types in the user package and pray for no backend supporting more :D
11:17:53 <kuribas> Or at least, make some feature mandatory, then there don't have to be constraints for those.
11:18:20 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3)
11:20:11 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
11:20:11 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
11:22:30 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
11:23:07 <kuribas> phaazon: so only constraints for features that are possibly not supported by the backend.
11:23:11 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds)
11:24:03 × bluenode quits (~bluenode@cpc99576-brnt1-2-0-cust237.4-2.cable.virginm.net) (Quit: Client closed)
11:25:00 × xiongxin quits (~quassel@113.116.32.200) (Ping timeout: 268 seconds)
11:25:20 Lord_of_Life_ is now known as Lord_of_Life
11:26:50 xiongxin joins (~quassel@113.116.224.79)
11:29:23 __monty__ joins (~toonn@user/toonn)
11:32:46 × enikar quits (~enikar@user/enikar) (Quit: WeeChat 3.0)
11:35:11 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds)
11:45:06 × stengah quits (~stengah@user/stengah) (Ping timeout: 265 seconds)
11:46:38 × OscarZ quits (~oscarz@95.175.104.139) (Quit: Leaving)
11:46:49 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 252 seconds)
11:52:38 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
11:53:33 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
11:56:33 × max22- quits (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Ping timeout: 265 seconds)
11:56:40 stengah joins (~stengah@user/stengah)
11:57:34 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
11:58:31 × stengah quits (~stengah@user/stengah) (Client Quit)
12:10:46 Midjak joins (~Midjak@82-65-111-221.subs.proxad.net)
12:11:48 <Midjak> Hi there
12:12:23 <yushyin> hi Midjak
12:13:50 <Midjak> I am a beginner is this channel ok for newbie question ? Or is there some channel for beginners ?
12:15:04 <yushyin> Midjak: beginner questions are welcome here, but if you feel that there is too much going on and your question is not getting through, there is also #haskell-beginners
12:16:30 <Midjak> Nice! Thank you yushyin
12:18:23 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 264 seconds)
12:20:14 × xiongxin quits (~quassel@113.116.224.79) (Ping timeout: 265 seconds)
12:23:32 stengah joins (~stengah@user/stengah)
12:29:04 mestre joins (~mestre@191.177.175.57)
12:29:39 × stengah quits (~stengah@user/stengah) (Quit: stengah)
12:30:56 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
12:32:03 × mestre quits (~mestre@191.177.175.57) (Client Quit)
12:32:18 mestre joins (~mestre@191.177.175.57)
12:39:11 slowButPresent joins (~slowButPr@user/slowbutpresent)
12:40:16 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
12:41:42 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
12:42:27 zer0bitz joins (~zer0bitz@dsl-hkibng31-54fafc-123.dhcp.inet.fi)
12:44:57 × mestre quits (~mestre@191.177.175.57) (Quit: leaving)
12:49:35 × ubert quits (~Thunderbi@178.165.199.151.wireless.dyn.drei.com) (Ping timeout: 264 seconds)
12:51:23 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Ping timeout: 264 seconds)
12:55:55 Vajb joins (~Vajb@n8vwdu04eps78g521-2.v6.elisa-mobile.fi)
12:58:58 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
13:00:56 geekosaur joins (~geekosaur@xmonad/geekosaur)
13:01:47 <Midjak> I have a fresh Haskell install pn macosx 11. When I try to install dependencies of a project I get an error about Cocoa. https://paste.tomsmeding.com/NBeA8Lci
13:02:44 <Midjak> I am looking on the internet. Any idea ?
13:04:08 Midjak looking this https://gitlab.haskell.org/ghc/ghc/-/issues/18592
13:04:15 lavaman joins (~lavaman@98.38.249.169)
13:04:38 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
13:06:21 kritzefitz joins (~kritzefit@212.86.56.80)
13:07:08 × frosky quits (~froskyarr@66.90.88.140) (Remote host closed the connection)
13:07:17 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
13:07:30 frosky joins (~froskyarr@59.41.160.121)
13:08:26 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
13:08:51 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Ping timeout: 245 seconds)
13:09:30 <sm> Midjak: it sounds like using a newer GHC version might fix it
13:09:42 <Midjak> yes sm
13:09:42 <sm> add --resolver=lts-18, eg
13:10:10 <Midjak> what does it means sm ?
13:11:04 <Midjak> I am looking what GHC version I have
13:11:27 <Midjak> I know I am on the stable release.
13:11:36 <sm> resolver means snapshot, it tells stack which set of packages and which GHC version to use
13:11:53 CiaoSen joins (~Jura@p5dcc1a24.dip0.t-ipconnect.de)
13:11:54 <Midjak> ok thank you sm
13:12:35 <sm> since you didn't specify a resolver in your command, it used the one in $HOME/.stack/global-project/stack.yaml. Yours seems a bit old since it has GHC 8.8.4, GHC 8.10 is the current best version
13:12:59 <Midjak> ok I am going to upgrade this
13:13:28 <Midjak> in fact I have made a default installation but I think 8.8.4 is related to a previous install
13:13:42 <Midjak> just now, the default install
13:15:36 × jess quits (~jess@libera/staff/jess) (Quit: Lost terminal)
13:16:05 jess joins (~jess@libera/staff/jess)
13:16:10 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
13:16:35 lavaman joins (~lavaman@98.38.249.169)
13:16:56 × unit73e quits (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Ping timeout: 265 seconds)
13:17:46 xiongxin joins (~quassel@113.116.33.28)
13:19:24 <Midjak> it works with the proper resolver. thank you sm
13:19:28 × sprout quits (~quassel@2a02:a467:ccd6:1:c9db:6eeb:465b:b3e9) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
13:20:07 <sm> no problem Midjak
13:23:25 max22- joins (~maxime@2a01cb0883359800eb44415b9b79cba1.ipv6.abo.wanadoo.fr)
13:23:26 machinedgod joins (~machinedg@24.105.81.50)
13:23:40 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
13:24:08 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
13:24:08 kritzefitz joins (~kritzefit@212.86.56.80)
13:24:51 Guest21 joins (~Guest21@94.228.150.252)
13:25:45 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 276 seconds)
13:25:54 Glassy joins (~Glassy@user/glassy)
13:26:52 hololeap joins (~hololeap@user/hololeap)
13:28:18 <Glassy> Hi I'm trying to learn how to use mutable unboxed vectors with ST. Suppose I create a new mutable vector (new 5) that holds 5 integers, what type should I give (new 5)? I've tried (forall s. ST s (STVector S Int) which doesn't seem to work.
13:28:21 jespada joins (~jespada@2803:9800:9842:7a62:a1db:843b:ed19:cad6)
13:28:31 <Glassy> i think it returns a reference actually not a mutable vector
13:28:49 <sm> what does :t say it is in GHCI ?
13:29:16 <Glassy> i've actually never included a package in ghci, let me learn how to do that
13:29:31 <sm> ghci -package vector, might work
13:29:35 × fendor quits (~fendor@178.115.59.192.wireless.dyn.drei.com) (Remote host closed the connection)
13:29:58 <Glassy> cannot satisfy, i guess i need to make a stack project
13:30:10 <sm> stack ghci --package vector, then
13:30:46 fendor joins (~fendor@178.115.59.192.wireless.dyn.drei.com)
13:37:39 betelgeuse joins (~betelgeus@94-225-47-8.access.telenet.be)
13:37:46 <Glassy> the command finished, `new 5
13:37:47 <Glassy> :: (primitive-0.7.2.0:Control.Monad.Primitive.PrimMonad m,
13:37:47 <Glassy> Unbox a) =>
13:37:48 <Glassy> m (MVector
13:37:48 <Glassy> (primitive-0.7.2.0:Control.Monad.Primitive.PrimState m) a)
13:37:49 <Glassy> `
13:39:23 stengah joins (~stengah@user/stengah)
13:40:27 <hpc> that looks like ST s (STVector s a)?
13:40:51 <hpc> or, MVcetor
13:41:48 <Glassy> what exactly is primstate/
13:43:04 <Glassy> it kind of looks like some sort of type family?
13:43:10 <hpc> it's a type family, yeah
13:43:15 <hpc> for ST, it does https://hackage.haskell.org/package/primitive-0.7.2.0/docs/src/Control.Monad.Primitive.html#line-213
13:43:29 <hpc> so (PrimState (ST s)) ~ s
13:45:27 <Glassy> thank you
13:46:50 × kritzefitz quits (~kritzefit@212.86.56.80) (Remote host closed the connection)
13:46:57 kritzefitz joins (~kritzefit@212.86.56.80)
13:48:41 × Vajb quits (~Vajb@n8vwdu04eps78g521-2.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
13:49:27 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
13:50:17 <Glassy> why does `y= new 2 :: (forall s. ST s (STVector s Int))` work but `y :: (forall s. ST s (STVector s Int)) = new 2` doesn't?
13:50:34 <Glassy> this is with `:set -XRankNTypes` and `:set -XScopedTypeVariables` in GHCi
13:51:09 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
13:53:04 × Glassy quits (~Glassy@user/glassy) (Quit: Client closed)
13:53:15 Glassy joins (~Glassy@user/glassy)
13:53:57 <hpc> weird rank n stuff?
13:54:12 <hpc> for the longest time even ($) didn't work quite right with it
13:54:30 <Glassy> is ($) type level?
13:54:38 <hpc> :t ($)
13:54:40 <lambdabot> (a -> b) -> a -> b
13:54:47 <Glassy> oh i was wondering if you promoted it or something
13:54:52 <Glassy> oh you just mean normal application
13:54:56 <hpc> yeah
13:55:21 <hpc> like you couldn't do runST $ do ..., because ($) breaks the forall s
13:55:45 <Glassy> rankN is a really old extension though i think
13:56:22 <ski> hm, i think a pattern signature is before generalization ?
13:56:38 <ski> try `let y :: ...; y = ...' instead ?
13:59:06 <Glassy> yeah it works `f x = 2 where y :: (forall s. ST s (STVector s Int)); y = new 2
13:59:06 <Glassy> `
13:59:11 <Glassy> also with where is fine
13:59:53 <Glassy> kinda strange but i guess i'll just put my type signature on the line above or to the right
14:01:15 <ski> in `y= new 2 :: (forall s. ST s (STVector s Int))', you're checking that `new 2' is polymorphic, then immediately specializing it to `ST _s (STVector _s Int)' for a new type variable `_s', and `y' gets this type, which is then generalized back to `forall s. ST s (STVector s Int)'
14:01:20 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
14:01:54 Guest21 parts (~Guest21@94.228.150.252) ()
14:02:34 <Glassy> is it because my type is too polymorphic?
14:02:47 <Glassy> like if i actually knew the state `s` it would work (not that I do)?
14:03:02 <ski> in `y :: (forall s. ST s (STVector s Int)) = new 2', `new 2' has type `ST _s (STVector _s Int)' (`new' is polymorphic, but is specialized upon use). so (i think), `y' (before generalization) gets type `ST _s (STVector _s Int)', and then you're attempting to check that it (already) has type `forall s. ST s (STVector s Int)', with the pattern signature, and apparently that doesn't work, since, it seems,
14:03:08 <ski> generalization only happens *after* this check
14:03:26 <ski> none of the types here are polymorphic, they're all monomorphic
14:04:34 <ski> (`forall s. ST s (STVector s Int)' is not a polymorphic type, and neither is `ST _s (STVector _s Int)'. they're both monomorphic. the first is a universal type, a `forall'-type. `forall'-types are the types of polymorphic *values*. a polymorphic *type* is something else)
14:04:56 <Glassy> why does the forall type get converted?
14:05:02 <ski> converted, how ?
14:05:20 × frosky quits (~froskyarr@59.41.160.121) (Read error: Connection reset by peer)
14:05:23 <Glassy> so my `forall s. ST s (STVector s Int)' becomes 'ST _s (STVector _s Int)'?
14:05:36 <ski> that's polymorphic instantiation
14:06:19 <ski> every time (apart from `PolymorphicComponents'/`Rank2Types'/`RankNTypes') you use a polymorphic value, that happens
14:06:44 <Glassy> is this like giving it an `s` to substitute?
14:07:13 <Glassy> sorry i've studied analysis but not lambda calculus so i haven't heard of polymorphic instantiation before
14:07:30 <Glassy> maybe i need to go read a book?
14:07:39 <ski> if you call `map toLower "Foo"', then `map' which has type `forall a b. (a -> b) -> [a] -> [b]', gets (implicitly) specialized, its type becomes instantiated to `(Char -> Char) -> [Char] -> [Char]' (by setting `a' and `b' to `Char')
14:08:03 <Glassy> okay yup sure
14:08:12 <ski> let's take `reverse', or `take'
14:08:33 <ski> take :: Int -> [Integer] -> [Integer]
14:08:41 <ski> is one valid signature for `take'
14:08:43 × acidjnk quits (~acidjnk@p200300d0c703cb13982ae5e8635fcd4e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
14:08:43 <ski> another one is
14:09:02 <ski> take :: Int -> [(Bool,Integer,IO String)] -> [(Bool,Integer,IO String)]
14:09:25 <ski> `take' has infinitely many types (hence "poly"-"morphic", "many" "shapes")
14:09:29 <Glassy> yup sure
14:09:30 <ski> but they're all of the pattern
14:09:37 <ski> take :: Int -> [a] -> [a]
14:09:47 <ski> where `a' is any type. has to be the same type in both places
14:10:08 <ski> however, taking one step back, the actual type of `take' is
14:10:17 <ski> take :: forall a. Int -> [a] -> [a]
14:11:26 <ski> Haskell allows one to omit the explicit `forall', commonly (but not always). but conceptually, it's still there, for `take'
14:12:37 <ski> note that, strictly speaking, under this view, `take' is not a function. it's a "polymorphic value". functions are values whose types have the shape `... -> ...'. polymorphic values are values whose types have the shape `forall a. ..a..'
14:12:57 <ski> `take' is a polymorphic value that, once specialized, becomes a function
14:13:27 <ski> just like `[2,3,5,7]' is not a number. it's a list that, once you extract an element from it, you get a number
14:14:25 <ski> however, you explicitly have to write code, to extract elements from a list. while, for polymorphic values, they *implicitly*, without you writing any extra code, gets converted to their specialization
14:14:37 <Glassy> alright
14:15:33 <ski> in `(reverse [2,3,5,7 :: Integer],reverse [True,False])', the first `reverse' is specialized to have type `[Integer] -> [Integer]', while the second `reverse' is specialized to have type `[Bool] -> [Bool]'
14:16:16 <Glassy> is this like the monomorphism restriction? how if you don't give something a type signature and use it once it gets specialised to something concrete?
14:16:24 <ski> there is actually an extension that allows you to write the specialization explicitly. it'd look like `(reverse @Integer [2,3,5,7],reverse @Bool [True,False])'. but if you don't use this, specialization happens implicitly
14:16:33 <Glassy> type application?
14:16:35 stilgart joins (~Christoph@chezlefab.net)
14:16:38 <ski> yea
14:17:06 <Glassy> yup i've used it for when things the type checker can't figure out the right type
14:17:07 <ski> DMR isn't really that similar to this, no
14:17:16 <Glassy> DMR?
14:17:24 <ski> Dreaded Monomorphism Restriction
14:17:43 <Glassy> lololol never heard of it like that
14:17:47 <Glassy> i thought it made your code speedy
14:18:59 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
14:20:12 <ski> it was introduced, as a way to avoid getting surprises that some computation wasn't cached under lazy evaluation, due to (type class) constrained polymorphism being inferred. unfortunately, DMR itself is causing a different confusion (especially for newbies), who wonders why their code isn't polymorphic when they expected it to be
14:21:06 <ski> anyway, please don't think that `Int -> [a] -> [a]' is "short for" `forall a. Int -> [a] -> [a]'. it is not
14:21:33 <Glassy> oh so is it a hack?
14:21:50 <ski> `take :: Int -> [a] -> [a]' is (usually) "short for" `take :: forall a. Int -> [a] -> [a]'. this is different
14:21:58 <ski> this only happens "directly after a `::'"
14:22:44 <ski> being able to write `take :: Int -> [a] -> [a]' is nothing deep. it's just a handy (and sometimes confusing) abbreviation
14:23:09 <jacks2> ski, how is it difference? I'm looking at both types, and I can't see any difference
14:23:13 <jacks2> different*
14:23:52 <ski> if, however, `Int -> [a] -> [a]' was actually short for `forall a. Int -> [a] -> [a]', then that would mean that e.g. `foo :: (Int -> [a] -> [a]) -> (Int -> [a] -> [a])' was short for `foo :: (forall a. Int -> [a] -> [a]) -> (forall a. Int -> [a] -> [a])' -- which is completely incorrect
14:24:33 <ski> similarly, it would also mean that `data Bar a = MkBar (Int -> [a] -> [a])' was short for `data Bar a = MkBar (forall a. Int -> [a] -> [a])' -- which is also false
14:25:14 <ski> "insertion of implicit `forall'" *only* happens directly after a `::' !
14:25:33 <Glassy> oh so is this like the compiler saying that's what we think you meant?
14:25:38 <ski> it's not the type `Int -> [a] -> [a]' which means `forall a. Int -> [a] -> [a]'
14:25:39 <Glassy> i know some languages require explicit forall
14:26:23 <ski> it's the type *signature* `take :: Int -> [a] -> [a]' (which strictly speaking has an unbound type variable `a') which is taken to mean `take :: forall a. Int -> [a] -> [a]' (in which the type variable `a' is bound by the `forall')
14:26:50 <Glassy> but in `data Bar a` that's because a is typically bound to something like Int or String and in take :: Int -> [a] -> [a] we don't have some variable a so there is nothing else reasonable to do but add forall a. ?
14:27:17 <Glassy> maybe this is lazy haha
14:27:37 <ski> Glassy : yes. that makes for less confusion about this issue. like i said, being able to omit (sometimes) `forall' in Haskell, is nothing conceptually deep. it's just "make the compiler insert a `forall' that i was too lazy to spell out", in some situations
14:27:51 <Glassy> okay yup cool
14:27:53 <ski> "oh so is this like the compiler saying that's what we think you meant?" -- exactly
14:28:02 <Glassy> so how does this relate to the specialisation and generalisation?
14:28:10 <Glassy> in my where pattern
14:29:20 <ski> Glassy : in `data Bar a = ..a..', the `Bar a' part binds the tyvar `a'. in `take :: forall a. ..a..', the `forall' binds `a'
14:29:44 <Glassy> sure
14:30:27 <Glassy> but i meant where does the specialization happen in `y :: (forall s. ST s (STVector s Int)) = new 2`
14:30:28 <ski> compare the `data Bar a = ..a..' situation with `f x = x*x + 1', where `f x' binds `x' in the body `x*x + 1'. and compare `forall a. ..a..' to `\x -> x*x + 1'. it's not exactly the same thing, but the binding behaviour is similar
14:30:50 <Glassy> is this because `new 2` finds itself a nice thing to put for `s`?
14:31:15 <Glassy> and it doesn't get regeneralized?
14:33:02 <ski> well, the type of `new' here is `forall s. Int -> ST s (STVector s a)' (simplifying somewhat from the more general situation, with overloading over different types of mutable vectors)
14:33:14 Psybur joins (~Psybur@mobile-166-170-34-168.mycingular.net)
14:33:43 <ski> er, actually, `forall s a. Int -> ST s (STVector s a)'
14:34:45 <ski> the first thing that happens is that this polymorphic value gets specialized, by substituting specific types, for the (bound) type variables `s' and `a'
14:35:59 <ski> we "know" that `a' will end up being chosen as `Int' (or at least, that's our intent) .. but what about `s' ?
14:36:56 <Glassy> what the compiler likes?
14:37:20 <ski> the type checker doesn't know, to begin with. so what it does is it uses "placeholders", aka "metavariables". later, we may discover what specific types we actually want to use in place of these. i'll write these placeholders as `_s' and `_a'
14:38:10 <Glassy> alright
14:38:20 <ski> so, the polymorphic `new' of type `forall s. Int -> ST s (STVector s a)' gets specialized to a *monomorphic* `new' (with the syntax from above, it would be `new @_s @_a') of type `Int -> ST _s (STVector _s _a)'
14:38:56 <ski> then this is applied to `2', which must have type `Int'. and the resulting application has type `ST _s (STVector _s _a)'
14:39:32 × xiongxin quits (~quassel@113.116.33.28) (Read error: Connection reset by peer)
14:39:47 <Glassy> is this where _a = Int?
14:39:55 <Glassy> or is it still a place holder?
14:39:57 xiongxin joins (~quassel@113.116.224.79)
14:40:12 <ski> let's say we're currently considering
14:40:20 <ski> y :: forall s. ST s (STVector s Int)
14:40:22 <ski> y = new 2
14:41:05 × peterhil quits (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Read error: Connection reset by peer)
14:42:05 peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
14:42:06 <ski> starting from the other end, that is the signature `y :: forall s. ST s (STVector s Int)', the way to check this is to first generate an instantiation of this type getting rid of the `forall'), and then checking the body (the defining equation) of `y', against this instantiation
14:42:53 <ski> so, at this point, we'd check that this instantiation (which i've not yet said how it looks like) agrees with the above inferred type for `new 2' (which was `ST _s (STVector _s _a)')
14:42:59 <ski> Glassy : following, so far ?
14:43:02 <Glassy> huh
14:43:10 <Glassy> so they both are given place holders
14:43:13 <Glassy> and the placeholders match up
14:43:20 <Glassy> or can match up
14:44:19 <ski> .. it might actually be better to start with a different example, say one in which we're *only* inferring (say for a polymorphic operation), with no explicit checking (apart from the checking that the operations and constructions you perform are consistent with each other)
14:46:33 <Glassy> actually i think it might help if i come back another time. just because i think i'm jumping too far ahead
14:47:04 <Glassy> i've studied first order logic before and maybe could look at the theoretical side of system-f omega or whatever then think about how to actually type check it
14:47:12 <Glassy> though thanks for the help :)
14:47:13 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 252 seconds)
14:47:18 <Glassy> just i got to go back to basics i think
14:47:50 <ski> ok. i was thinking perhaps we could consider say `totalLength rows = sum (map length rows)', as an example of inferring types
14:49:07 <Glassy> umm maybe another time sorry :( just i also got to go outside
14:49:30 <Glassy> anyway have a nice day /wave
14:49:38 Glassy parts (~Glassy@user/glassy) ()
14:50:15 <ski> "so they both are given place holders","and the placeholders match up" -- almost. the type `forall s. ST s (STVector s Int)' from the signature of `y' above would actually be specialized to something like `ST %s (STVector %s Int)', where `%s' is just a custom notation that i just invented for "skolems" aka "rigid type variables". they're not quite the same as the placeholders `_s',`_a' from before
14:50:21 <ski> ok
14:50:34 <ski> jacks2 : did it become clear ?
14:52:00 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
14:52:00 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
14:52:00 wroathe joins (~wroathe@user/wroathe)
14:53:53 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
15:01:00 × DNH quits (~DNH@2a02:8108:1100:16d8:11c6:13b4:148f:aabf) (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:01:38 o1lo01ol1o joins (~o1lo01ol1@bl19-157-209.dsl.telepac.pt)
15:06:28 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
15:09:57 <stengah> :t words
15:09:58 <lambdabot> String -> [String]
15:11:58 × Hanicef quits (~gustaf@81-229-9-108-no92.tbcn.telia.com) (Quit: leaving)
15:12:16 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
15:13:10 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
15:17:01 f-a joins (f2a@f2a.jujube.ircnow.org)
15:17:47 <f-a> can someone explain to me why RWS is not an instance of MonadThrow? https://hackage.haskell.org/package/exceptions-0.10.4/docs/Control-Monad-Catch.html#t:MonadThrow
15:18:04 <f-a> What blocks `Identity` from having its MonadThrow instance?
15:22:52 <janus> f-a: IdentityT does have MonadThrow, hmm, dunno what to conclude from that
15:23:19 <f-a> yeah that is what puzzled me
15:23:33 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
15:24:23 <hpc> (IdentityT m) has an instance because m can be MonadThrow
15:24:41 <hpc> and then when when throwM with the (IdentityT m) it defers to m's instance
15:26:24 segfaultfizzbuzz joins (~segfaultf@135-180-0-138.static.sonic.net)
15:27:26 <janus> but since State can be rewritten as StateT Identity, i was thinking maybe IdentityT could be rewritten in a similar way with something like IdentityT Unit, but Unit is not a monad so i guess it makes no sense
15:27:52 × talismanick quits (~talismani@76.78.246.30) (Ping timeout: 252 seconds)
15:29:06 <jacks2> is this a valid prime number, even if it isn't very efficient? it looks to me like it is. https://paste.tomsmeding.com/r16Z49gf
15:29:07 <geekosaur> Identity *is* the "unit" there
15:29:12 <jacks2> prime number checker*
15:30:03 <f-a> jacks2: why not checking it with https://hackage.haskell.org/package/primes-0.2.1.0/docs/Data-Numbers-Primes.html
15:30:35 <jacks2> it is a homework assignment
15:30:38 <f-a> and yup, it is quite slow
15:30:45 <jacks2> it is valid, though?
15:31:14 <ski> yes
15:31:34 <f-a> jacks2: that is why I said «check it with Data.Numbers.Primes». No better way to check your output that against a well know implementation, right? But yeah, it looks fine
15:32:58 <ski> `if ... then False else ...' is `not (...) && ...'
15:33:47 <f-a> running your assignment through `hlint` will make your tutor happy, too
15:34:30 <ski> `hlint' is opinionated
15:35:23 <Franciman> tbf 80% of the time i don't like hlint
15:35:33 <ski> (it often gives suggestions i don't care for)
15:35:34 <Franciman> what hlint
15:35:36 <Franciman> says
15:41:33 × stengah quits (~stengah@user/stengah) (Quit: stengah)
15:45:05 × ArctVaulMarsHMPJ quits (~pjetcetal@2.95.44.252) (Quit: EXIT)
15:45:25 ArctVaulMarsHMPJ joins (~pjetcetal@2.95.44.252)
15:45:33 × xiongxin quits (~quassel@113.116.224.79) (Read error: Connection reset by peer)
15:46:24 × ArctVaulMarsHMPJ quits (~pjetcetal@2.95.44.252) (Read error: Connection reset by peer)
15:46:40 ArctVaulMarsHMPJ joins (~pjetcetal@2.95.44.252)
15:46:45 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
15:49:35 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
15:50:39 × jespada quits (~jespada@2803:9800:9842:7a62:a1db:843b:ed19:cad6) (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:51:14 hnOsmium0001 joins (uid453710@id-453710.hampstead.irccloud.com)
15:53:25 nunggu joins (q@gateway/vpn/protonvpn/nunggu)
15:54:20 xiongxin joins (~quassel@113.116.33.28)
15:57:26 gaff joins (~gaff@49.207.211.225)
15:58:03 <jacks2> which one do you prefer? https://paste.tomsmeding.com/KFIHLugK
15:59:01 <jacks2> pattern matching for 2 vs everything in guards
15:59:17 <gaff> toRational :: Real a => a -> Rational, pi :: Floating a => a, but `toRational pi` works. how is that possible?
16:01:35 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
16:02:01 <c_wraith> gaff: it works as long as pi is used at a type that is both an instance of Real and an instance of Floating
16:02:23 <c_wraith> gaff: if you don't provide it any more information, it will default to Double, which is an instance of both
16:02:34 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds)
16:03:17 <gaff> c_wraith: but `pi` already has a type, has it not?
16:03:31 <c_wraith> > pi :: Double
16:03:33 <lambdabot> 3.141592653589793
16:03:49 <c_wraith> > pi :: Float
16:03:51 <lambdabot> 3.1415927
16:03:58 <c_wraith> pi is polymorphic.
16:04:03 <gaff> i see
16:04:38 <gaff> but this doesn't work: `fromRational pi`
16:04:43 × YoungChiefBTW quits (~youngchie@user/youngchiefbtw) (Quit: issued !quit command)
16:04:53 <c_wraith> :t fromRational
16:04:54 <lambdabot> Fractional a => Rational -> a
16:05:02 <gaff> correct
16:05:10 <c_wraith> yes. Rational doesn't have a Floating instance.
16:05:57 <gaff> but Rational does have a Fractional instance
16:06:38 <c_wraith> pi is only polymorphic over Floating instances. (It's actually part of the Floating class)
16:06:48 <gaff> ok
16:07:38 <gaff> and Floating is a subclass of Fractional
16:07:41 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:07:42 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
16:07:42 wroathe joins (~wroathe@user/wroathe)
16:08:36 <gaff> `fromRational` is in `Fractional` class
16:09:25 <c_wraith> that means all instance of Floating must also be instances of Fractional. Not the other way around.
16:09:27 <janus> hmm i am bit bummed that pi isn't infinite precision now that it is so polymorphic
16:09:34 <janus> @src pi
16:09:34 <lambdabot> Source not found. BOB says: You seem to have forgotten your passwd, enter another!
16:10:37 <hpc> it's as precise as the type you use it with
16:10:41 <hpc> > pi :: CReal
16:10:43 <lambdabot> error:
16:10:43 <lambdabot> Not in scope: type constructor or class ‘CReal’
16:10:43 <lambdabot> Perhaps you meant ‘Real’ (imported from Prelude)
16:10:52 <hpc> :( i thought that was imported
16:11:27 <gaff> c_wraith: shouldn't all instances of Floating implement the `fromRational` ethod?
16:11:50 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
16:11:53 <gaff> sorry, i mean "method"
16:12:38 × xiongxin quits (~quassel@113.116.33.28) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
16:12:43 <gaff> i suppose `pi` is just a value defined in Flaoting
16:12:47 <c_wraith> fromRational is polymorphic in the return type
16:12:48 <gaff> Floating
16:12:56 <c_wraith> not in the argument type
16:13:00 <gaff> yeah, correct
16:13:19 <c_wraith> So fromRational can return a value of any type that pi can be
16:13:41 <c_wraith> but its input must always be Rational
16:13:45 <janus> % :set -XDataKinds
16:13:45 <yahb> janus:
16:13:46 <gaff> correct
16:13:53 <janus> % :m +Data.Fixed
16:13:53 <yahb> janus:
16:14:14 <janus> % realToFrac pi :: Fixed 1000 -- i had hoped this would give me the precision of the type
16:14:14 <yahb> janus: 3.141
16:14:54 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
16:14:57 <gaff> and `pi` is not Rational ... but here is the question: pi isn't Fractional either?
16:15:10 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 252 seconds)
16:17:06 <janus> why shouldn't it be Fractional? it supports real division
16:19:35 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 264 seconds)
16:20:19 bluenode joins (~bluenode@cpc99576-brnt1-2-0-cust237.4-2.cable.virginm.net)
16:20:26 Null_A joins (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
16:20:54 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
16:21:13 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
16:21:17 <gaff> so pi is Fractional as well, because Floating is a subclass of Fractional?
16:22:14 <gaff> janus: is that what your argument is?
16:22:35 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
16:23:15 <janus> gaff: my problem is that by putting 'pi' in 'Floating', i think you can't have a way that it would work for e.g. "KnownNat n => Fixed n"
16:23:45 <janus> so in effect the name has been taken by a class that can't even faithfully represent the entity :P
16:23:46 <gaff> janus: ok, i ma talking about something else, i think
16:25:19 <gaff> c_wraith: something like `fromRational 8.6756` works just fine, because unlike pi, 8.6756 can be represented as a Rational?
16:26:14 × connrs quits (~connrs@conners.plus.com) (Read error: Connection reset by peer)
16:26:19 <c_wraith> it's not about representation
16:26:23 <janus> % fromRational 1.5 :: Fixed E0 -- it will throw away precision though...
16:26:23 <yahb> janus: 1.0
16:26:51 <c_wraith> It's just that numeric literals are more polymorphic than pi is
16:27:04 <c_wraith> :t 8.6756
16:27:05 <lambdabot> Fractional p => p
16:27:17 <c_wraith> Rational is an instance of Fractional
16:27:22 <c_wraith> :t pi
16:27:23 <lambdabot> Floating a => a
16:27:23 <gaff> c_wraith: correct, i forgot about that!
16:27:28 <c_wraith> Rational is not an instance of Floating
16:27:37 DNH joins (~DNH@2a02:8108:1100:16d8:b0eb:6d14:193d:16e9)
16:27:46 <gaff> ok, now i understand
16:28:00 × Null_A quits (~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) ()
16:28:40 <gaff> c_wraith: thanks much
16:29:16 connrs joins (~connrs@conners.plus.com)
16:29:24 gaff parts (~gaff@49.207.211.225) (Leaving...)
16:29:35 wonko joins (~wjc@62.115.229.50)
16:29:58 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
16:31:48 geekosaur joins (~geekosaur@xmonad/geekosaur)
16:36:48 jakalx joins (~jakalx@base.jakalx.net)
16:37:50 × ArctVaulMarsHMPJ quits (~pjetcetal@2.95.44.252) (Quit: EXIT)
16:37:54 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
16:38:21 gaff joins (~gaff@49.207.211.225)
16:43:59 <gaff> c_wraith: one followup question -- Floating is a subclass of Fractional, which has the `fromRational` method. shouldn't all `Floating` instances implement `fromRational`?
16:44:47 <c_wraith> yes - but remember the polymorphic side of fromRational is the return value, not the argument
16:45:12 <c_wraith> :t \x -> fromRational x `asTypeOf` pi
16:45:13 <lambdabot> Floating a => Rational -> a
16:46:21 <c_wraith> fromRational can return any type that pi can be.
16:46:33 <gaff> ok
16:47:16 <gaff> ah i see
16:48:26 <gaff> but its argument has to be Rational (not polymorphic), so pi is out of the picture
16:49:25 <c_wraith> yes
16:50:08 <gaff> quite tricky to underatnd at first, but now i see. thanks much
16:51:17 <gaff> c_wraith: also the class heirarchy names are not so obvious, at least at first glance.
16:51:32 <c_wraith> The names make no sense to me at all. I try not to think about them. :)
16:51:38 <gaff> i mean the number classes
16:51:43 <c_wraith> Yeah
16:52:02 <c_wraith> Floating, Real, RealFrac... I couldn't tell you what any of those are, specifically.
16:52:17 × zincy quits (~tom@2a00:23c8:970c:4801:f4b9:dbfb:6f14:3bca) (Read error: Connection reset by peer)
16:52:17 <c_wraith> until I look at the docs, anyway
16:52:25 <gaff> yeah
16:52:52 <c_wraith> Fortunately, those details aren't important most of the time.
16:53:08 <gaff> i suppose they prefixed `Real` to denote real numbers, as opposed to complex numbers. that's all i can say
16:54:11 <gaff> and `Real` is subdivided into integers and fractions, so that's where you get RealFrac, i suppose
16:54:28 <gaff> :)
16:54:30 <c_wraith> I rarely write code that deals with non-integral values, and when I do I can almost always get away with only using Double or Rational
16:54:40 <gaff> yeah
16:55:07 <gaff> thanks much for your help
16:55:17 <c_wraith> you're welcome
16:59:12 × mbuf quits (~Shakthi@122.173.255.77) (Quit: Leaving)
16:59:18 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
17:00:33 × gaff quits (~gaff@49.207.211.225) (Quit: Leaving...)
17:02:46 zincy joins (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684)
17:04:22 × zincy quits (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684) (Read error: Connection reset by peer)
17:06:23 × peterhil quits (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 264 seconds)
17:07:18 neurocyte0132889 joins (~neurocyte@45.128.183.213)
17:07:18 × neurocyte0132889 quits (~neurocyte@45.128.183.213) (Changing host)
17:07:18 neurocyte0132889 joins (~neurocyte@user/neurocyte)
17:07:19 enikar joins (~enikar@user/enikar)
17:08:42 × gehmehgeh quits (~user@user/gehmehgeh) (Ping timeout: 276 seconds)
17:11:06 gehmehgeh joins (~user@user/gehmehgeh)
17:12:25 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 252 seconds)
17:14:24 mestre joins (~mestre@191.177.175.57)
17:14:28 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
17:15:06 × CiaoSen quits (~Jura@p5dcc1a24.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
17:18:45 Pickchea joins (~private@user/pickchea)
17:25:11 ArctVaulMarsHMPJ joins (~pjetcetal@2.95.44.252)
17:28:53 × bluenode quits (~bluenode@cpc99576-brnt1-2-0-cust237.4-2.cable.virginm.net) (Quit: Client closed)
17:29:13 zincy joins (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684)
17:31:34 × zincy quits (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684) (Read error: Connection reset by peer)
17:33:25 machinedgod joins (~machinedg@24.105.81.50)
17:34:47 zincy joins (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684)
17:36:24 × zincy quits (~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684) (Read error: Connection reset by peer)
17:38:47 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
17:40:00 lavaman joins (~lavaman@98.38.249.169)
17:44:47 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
17:48:02 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
17:48:14 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
17:48:45 Vajb joins (~Vajb@n8vwdu04eps78g521-2.v6.elisa-mobile.fi)
17:48:58 hendursaga joins (~weechat@user/hendursaga)
17:56:11 × MQ-17J quits (~MQ-17J@8.21.10.20) (Ping timeout: 264 seconds)
18:01:12 MQ-17J joins (~MQ-17J@8.21.10.20)
18:03:45 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
18:06:10 neurocyte0132889 joins (~neurocyte@45.128.183.213)
18:06:10 × neurocyte0132889 quits (~neurocyte@45.128.183.213) (Changing host)
18:06:10 neurocyte0132889 joins (~neurocyte@user/neurocyte)
18:08:12 × hendursaga quits (~weechat@user/hendursaga) (Remote host closed the connection)
18:08:47 hendursaga joins (~weechat@user/hendursaga)
18:09:37 bontaq joins (~user@ool-45779fe5.dyn.optonline.net)
18:11:11 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 264 seconds)
18:14:16 × benin quits (~benin@183.82.25.86) (Ping timeout: 245 seconds)
18:14:51 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
18:15:46 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
18:17:33 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
18:17:55 × max22- quits (~maxime@2a01cb0883359800eb44415b9b79cba1.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
18:20:08 hiredman joins (~hiredman@frontier1.downey.family)
18:23:24 Sgeo joins (~Sgeo@user/sgeo)
18:25:55 ars23 joins (~ars23@2a02:2f09:370f:d800:c448:fe02:b238:bc04)
18:29:40 kupi joins (uid212005@id-212005.hampstead.irccloud.com)
18:29:40 tfeb joins (~tfb@88.98.95.237)
18:30:17 × ars23 quits (~ars23@2a02:2f09:370f:d800:c448:fe02:b238:bc04) (Client Quit)
18:32:36 × Vajb quits (~Vajb@n8vwdu04eps78g521-2.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
18:33:30 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
18:34:53 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
18:36:10 arjun joins (~user@user/arjun)
18:38:08 × tfeb quits (~tfb@88.98.95.237) (Quit: died)
18:39:49 × mniip quits (~mniip@libera/staff/mniip) (Ping timeout: 252 seconds)
18:40:21 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
18:40:47 mniip joins (mniip@libera/staff/mniip)
18:40:52 hendursaga joins (~weechat@user/hendursaga)
18:43:07 ubert joins (~Thunderbi@91.141.60.206.wireless.dyn.drei.com)
18:45:32 × DNH quits (~DNH@2a02:8108:1100:16d8:b0eb:6d14:193d:16e9) (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:47:47 × ubert quits (~Thunderbi@91.141.60.206.wireless.dyn.drei.com) (Ping timeout: 264 seconds)
18:48:55 × AndrewYu quits (~andrew@user/andrewyu) (Remote host closed the connection)
18:49:39 AndrewYu joins (~andrew@user/andrewyu)
18:50:27 max22- joins (~maxime@2a01cb0883359800a5cb7947071ee8e1.ipv6.abo.wanadoo.fr)
18:52:13 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
18:52:36 × arjun quits (~user@user/arjun) (Remote host closed the connection)
18:52:52 DNH joins (~DNH@2a02:8108:1100:16d8:b0eb:6d14:193d:16e9)
18:53:53 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
18:55:10 × MQ-17J quits (~MQ-17J@8.21.10.20) (Ping timeout: 268 seconds)
18:57:57 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
19:00:18 <remexre> is there a good way to benchmark GHC? I've got a not-terribly-large grammar I'm giving to Happy, and it's taking over 5 minutes to compile the resulting .hs file, and I'm not sure why
19:01:52 × frobnicator quits (~frobnicat@185-227-75-147.dsl.cambrium.nl) (Ping timeout: 252 seconds)
19:02:26 <remexre> er, benchmark's probably the wrong word; profile?
19:04:36 <geekosaur> -ddump-timings might be of interest. otherwise you'd need a ghc built profiled, which is uncommon and probably would require you to build from source
19:05:41 <geekosaur> (build ghc itself, that is)
19:05:59 slack1256 joins (~slack1256@45.4.2.52)
19:07:38 <remexre> okay, thanks; it's already hanging on Renamer/typechecker with that, so I think I've found my cuprit :)
19:07:43 <remexre> culprit*
19:10:58 × fendor quits (~fendor@178.115.59.192.wireless.dyn.drei.com) (Remote host closed the connection)
19:11:23 <geekosaur> also if it's really a small grammar, the ghc issue tracker might want a reproducible example :)
19:11:47 aegon joins (~mike@174.127.249.180)
19:13:00 <remexre> 124 lines of grammar, ~100 lines of helper functions
19:13:34 <remexre> and adding top-level type signatures doesn't help :(
19:13:43 × f-a quits (f2a@f2a.jujube.ircnow.org) (Remote host closed the connection)
19:14:15 <remexre> well, helps a bit looks like, 157800ms -> 56852.393ms
19:14:27 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
19:14:56 × slack1256 quits (~slack1256@45.4.2.52) (Ping timeout: 265 seconds)
19:15:13 <remexre> but that's will all non-parameterized nts getting one
19:18:19 econo joins (uid147250@user/econo)
19:18:56 <remexre> https://git.sr.ht/~remexre/sylvan/tree/main/item/bootstrap/Language/Sylvan/Parser.y is the parser if you want to take a look
19:19:14 fendor joins (~fendor@178.115.59.192.wireless.dyn.drei.com)
19:19:33 <jacks2> @hoogle Int -> Integer
19:19:34 <lambdabot> Test.DejaFu.SCT.Internal toId :: Coercible Id a => Int -> a
19:19:34 <lambdabot> Prelude toInteger :: Integral a => a -> Integer
19:19:34 <lambdabot> GHC.Real toInteger :: Integral a => a -> Integer
19:19:55 <jacks2> odd.. Variable not in scope: toInteger'
19:20:08 <remexre> ' ?
19:22:46 <geekosaur> yeh, that prime looks suspicious
19:22:59 <jacks2> geekosaur, mine? why?
19:23:27 <geekosaur> it's just toInteger, no prime
19:24:16 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
19:25:09 <jacks2> ok.. that is obvious :P. I asked about isPrime function several hours ago, so I'm still confused what you're talking about
19:25:19 <remexre> prime being the ' mark
19:25:27 <geekosaur> yeh, math terminology
19:25:30 <remexre> toInteger =/= toInteger'
19:25:37 <geekosaur> > let x' = 5 in x'
19:25:39 <lambdabot> 5
19:25:47 <jacks2> oh, god damn
19:25:49 <geekosaur> pronounced "eks prime"
19:26:27 f2a joins (f2a@f2a.jujube.ircnow.org)
19:27:26 f2a is now known as f-a
19:30:34 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
19:30:34 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
19:30:34 wroathe joins (~wroathe@user/wroathe)
19:35:23 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
19:36:07 AkechiShiro joins (~licht@user/akechishiro)
19:37:20 × fvr quits (uid503686@id-503686.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
19:39:05 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
19:42:31 × martin02 quits (~silas@141.84.69.76) (Ping timeout: 252 seconds)
19:43:15 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
19:45:18 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
19:47:44 frobnicator joins (~frobnicat@185-227-75-147.dsl.cambrium.nl)
19:49:27 retroid_ joins (~retro@2e41e9c8.skybroadband.com)
19:51:09 neurocyte0132889 joins (~neurocyte@45.128.183.213)
19:51:09 × neurocyte0132889 quits (~neurocyte@45.128.183.213) (Changing host)
19:51:09 neurocyte0132889 joins (~neurocyte@user/neurocyte)
19:59:05 martin02 joins (~silas@141.84.69.76)
20:05:07 × juhp quits (~juhp@128.106.188.220) (Ping timeout: 252 seconds)
20:07:52 juhp joins (~juhp@128.106.188.220)
20:08:14 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
20:09:02 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
20:09:02 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
20:09:02 wroathe joins (~wroathe@user/wroathe)
20:10:58 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
20:14:05 neurocyte0132889 joins (~neurocyte@45.128.183.213)
20:14:05 × neurocyte0132889 quits (~neurocyte@45.128.183.213) (Changing host)
20:14:05 neurocyte0132889 joins (~neurocyte@user/neurocyte)
20:14:24 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
20:15:59 × martin02 quits (~silas@141.84.69.76) (Ping timeout: 264 seconds)
20:16:14 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
20:19:05 martin02 joins (~silas@141.84.69.76)
20:19:13 × mikoto-chan quits (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 265 seconds)
20:19:53 acidjnk joins (~acidjnk@p200300d0c703cb13982ae5e8635fcd4e.dip0.t-ipconnect.de)
20:19:55 × alx741 quits (~alx741@181.196.68.37) (Ping timeout: 252 seconds)
20:23:15 jgeerds joins (~jgeerds@55d4da80.access.ecotel.net)
20:26:29 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
20:26:53 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
20:26:54 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
20:27:34 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
20:28:26 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
20:30:51 <jacks2> remind me please, how to wrap some value, say Int, in a haskell type without boxing the value? so extracting it and doing caclulations should be as fast as if I used plain Int64
20:31:37 <Hecate> jacks2: `newtype` + UNPACK + StrictData ?
20:32:17 <jacks2> is that good enough to avoid any performance hit?
20:32:21 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection)
20:32:31 <jacks2> I'd rather lose type safety if that is the case
20:32:31 pavonia joins (~user@user/siracusa)
20:32:48 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
20:32:49 alx741 joins (~alx741@186.178.108.200)
20:32:59 <Hecate> then a type alias :P
20:33:22 <geekosaur> you can also enable MagicHash and work with Int#
20:33:36 <jacks2> I need 64 bit int
20:33:58 <geekosaur> that will be 64 bit on a 64 bit platform, but if you must be certain there is also Int64#
20:34:02 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
20:34:12 <Hecate> yup'
20:34:14 <jacks2> ah ok
20:35:10 LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao)
20:41:36 <liskin> uh, I thought newtype is transparent at runtime, so newtype X = X Int should be equivalent in performance to Int; has anything changed while I wasn't looking?
20:43:29 <geekosaur> it is mostly transparent. there are some edge cases where it can't be removed fully; that's why Coercible exists
20:43:54 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Read error: No route to host)
20:44:03 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
20:44:11 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 264 seconds)
20:44:11 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 264 seconds)
20:45:07 <geekosaur> you can read the Coercible paper for details. (that said, I'd be really surprised if they came up here)
20:46:29 <hpc> there's also the general rule for performance that you write the simple thing until you can prove it's a problem
20:48:01 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
20:48:17 <geekosaur> yes, that's also true. in most cases ghc should be able to prove strictness and that it can unbox things itself
20:48:39 <geekosaur> so the fancy unboxed code is just doing by hand what ghc would do for you anyway
20:49:58 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
20:51:25 <liskin> oh, right, so the gist of it is that one might want to use coerce instead of higher-order functions like fmap and stuff as that might not always be optimised away
21:00:05 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
21:00:05 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
21:00:05 wroathe joins (~wroathe@user/wroathe)
21:04:16 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
21:04:45 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 260 seconds)
21:06:48 × fendor quits (~fendor@178.115.59.192.wireless.dyn.drei.com) (Read error: Connection reset by peer)
21:07:09 asisto joins (~asisto@host-79-44-174-49.retail.telecomitalia.it)
21:07:46 × asisto quits (~asisto@host-79-44-174-49.retail.telecomitalia.it) (Remote host closed the connection)
21:13:37 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
21:14:42 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
21:22:35 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
21:28:01 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 245 seconds)
21:29:58 × max22- quits (~maxime@2a01cb0883359800a5cb7947071ee8e1.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
21:31:09 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
21:32:09 <f-a> I forgot, how do I tell cabal to rebuild when needed when running — say — `cabal build program --enable-profiling`?
21:32:37 max22- joins (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
21:33:07 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 252 seconds)
21:33:26 <f-a> as now I get many `Perhaps you haven't installed the profiling libraries for package ‘file-embed-0.0.12.0’?` errors and I do not know how to address them
21:34:04 <geekosaur> hm, it should figure that out for itself normally
21:34:44 <f-a> unfortunately I had to install ghc from apt-get (Debian), as recent ghcs segfault on my machine; that might be it
21:35:18 <geekosaur> any packages you installed via apt/dpkg you will need to separately install the profiling packages for
21:36:00 <geekosaur> on my ubuntu system it looks like libghc-file-embed-prof is what you need
21:36:37 <f-a> makes sense
21:36:43 <f-a> thanks
21:38:28 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
21:39:28 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
21:41:18 × max22- quits (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Quit: Leaving)
21:41:46 lavaman joins (~lavaman@98.38.249.169)
21:43:47 machinedgod joins (~machinedg@24.105.81.50)
21:44:52 <jacks2> is there deleteAll?
21:45:05 unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
21:45:34 <geekosaur> in what context?
21:45:51 <jacks2> same as delete, but instead of just one it deletes all matching elements
21:45:56 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
21:45:58 <jacks2> oh, that is filter!
21:46:00 <jacks2> :P
21:46:47 × DNH quits (~DNH@2a02:8108:1100:16d8:b0eb:6d14:193d:16e9) (Ping timeout: 240 seconds)
22:00:35 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
22:01:43 × caef^ quits (~caef@70.166.66.234) (Ping timeout: 252 seconds)
22:02:04 caef^ joins (~caef@70.166.66.234)
22:03:06 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection)
22:04:05 LiaoTao joins (~LiaoTao@gateway/tor-sasl/liaotao)
22:06:07 × acidjnk quits (~acidjnk@p200300d0c703cb13982ae5e8635fcd4e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
22:07:42 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Ping timeout: 276 seconds)
22:12:02 × Psybur quits (~Psybur@mobile-166-170-34-168.mycingular.net) (Remote host closed the connection)
22:12:20 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
22:12:28 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 265 seconds)
22:14:12 Player001 joins (~Player001@user/player001)
22:14:21 × wonko quits (~wjc@62.115.229.50) (Ping timeout: 268 seconds)
22:14:47 jespada joins (~jespada@2803:9800:9842:7a62:a1db:843b:ed19:cad6)
22:14:56 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
22:14:56 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
22:14:56 wroathe joins (~wroathe@user/wroathe)
22:18:23 acidjnk joins (~acidjnk@p200300d0c703cb13596ef3e4428d3d40.dip0.t-ipconnect.de)
22:20:31 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
22:25:27 × hippoid quits (~idris@184.105.6.88) (Remote host closed the connection)
22:30:56 <Inst> question
22:31:01 <Inst> why is PYPL claiming that Haskell
22:31:03 <Inst> jumped a cliff
22:31:15 <monochrom> What is PYPL?
22:31:44 <geekosaur> and why should we care about its? their? opinion?
22:31:45 <mestre> people that use python
22:31:51 <Inst> https://pypl.github.io/PYPL.html
22:32:08 <Inst> Haskell dropped from 0.2% of new language learners to 0.0%
22:32:09 <monochrom> And why should we know? Why not ask the author?
22:32:34 <mestre> abap going storng
22:33:04 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
22:33:13 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Client Quit)
22:33:42 <geekosaur> also we seem to be getting the same number of new learners around here as usual, so I question 0.0%
22:33:45 <monochrom> And to be clear, if someone writes "I have been productive in Haskell", we wouldn't know why either, only the author knows. No?
22:34:13 <monochrom> I know why I am productive in Haskell, but I can't know about someone else.
22:34:59 <hololeap> \(a, T m) -> let (b,m') = f (a,m) in (b, T m')
22:35:08 <monochrom> Hell, I probably don't even quite know why I'm productive in Haskell.
22:35:16 × martin02 quits (~silas@141.84.69.76) (Ping timeout: 252 seconds)
22:35:35 <hololeap> if I have a lens that unwraps T, how can I use it here?
22:36:22 russruss joins (~russruss@my.russellmcc.com)
22:38:02 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
22:38:37 <c_wraith> hololeap: I think you want alongside
22:39:40 <hololeap> oh, interesting
22:40:03 <c_wraith> you can use id for the other component
22:40:33 <Inst> eh, it's a search analytics methodology
22:40:38 <hololeap> that's going to be very helpful, because I'm using optics (package) and I've been looking for more ways to combine optics, especially over tuples
22:40:40 <Inst> do you know when Haskell 20 / Haskell 2.0 is coming out?
22:40:55 <awpr> assuming it's an Iso, it seems like a relevant profunctor to use with that optic might be `newtype Second a b p c d = Second (p (a, c) (b, d))`
22:41:01 <hpc> haskell 2.0 is looooooooong in the past
22:41:23 <hpc> if it can really be called that
22:41:24 <awpr> with the right wrapping and unwrapping, I think that would lift the Iso to work on the right element of a tuple
22:41:40 <awpr> hpc: yeah we're at least 2008 versions past that
22:41:56 <hpc> we still need to catch up with python 3000 though
22:42:11 <awpr> only need 979 years
22:42:24 <hpc> we'll be on firefox 3000 by then too
22:42:30 d34df00d joins (~d34df00d@2600:1700:8c60:3a10::48)
22:42:37 <d34df00d> Hi folks!
22:42:48 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
22:42:55 <Inst> I heard a rumor that a major new release of the Haskell Report was supposed to have been in the pipeline?
22:43:06 <Inst> TBH, the irony is, I want to use Haskell for the same reason other people use Python; i.e, ease of use.
22:43:21 <d34df00d> Did anybody use nvim-hs? I'm trying to display some debugging output from my plugin written in haskell, and I fail at that.
22:43:41 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
22:43:45 <hpc> python's "ease of use" is the biggest secret success story of distro packaging ever
22:44:09 <hpc> i once tried to get a different version of python on ubuntu and after many hours ended up with something that could run the repl but not pip install
22:46:00 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
22:46:19 <arahael> hpc: i used to be a python fan but after working with it in the enterprise for a while... nup, its awful.
22:46:33 <arahael> hpc: however, for your use case, look at pyenv.
22:46:36 <hpc> pypi is also missing so much basic stuff
22:46:44 <Inst> i mean python is for private use; i.e, it's not really designed for production environments
22:46:45 <jacks2> > map (length &&& id &&& map toUpper) ["foo", "bar", "baz"]
22:46:46 <lambdabot> [(3,("foo","FOO")),(3,("bar","BAR")),(3,("baz","BAZ"))]
22:46:47 <hpc> i can go to hackage and see what things a package depends on, with version numbers
22:46:51 <hpc> click a module to get documentation
22:47:03 <jacks2> how can I get [(Int, String, String)] instead of [(Int, (String, String)]?
22:47:04 <int-e> Python's Implementation of Pain
22:47:05 <hpc> on pypi i have to download the whole damn package and read source code to figure out the same thing
22:47:11 <hpc> and if you're lucky, the docs are googleable
22:47:14 <int-e> (=pip)
22:47:26 <arahael> hpc: nevermind pypi, pip is missing a lot, and with bonus exploitability by hackers.
22:48:26 <Inst> when was the last time someone did a major production project with haskell, anyways?
22:48:27 <arahael> jacks2: i'd probably keep it simple and just "map (\(a, (b, c)) -> (a, b, c)"
22:49:46 <jacks2> well yeah, I can just do
22:49:48 <ski> > map ((\(n,(s0,s1)) -> (n,s0,s1)) . (length &&& id &&& map toUpper)) ["foo","bar","baz"]
22:49:50 <lambdabot> [(3,"foo","FOO"),(3,"bar","BAR"),(3,"baz","BAZ")]
22:49:50 <jacks2> > map (\x -> (length x, x, map toUpper x)) ["foo", "bar", "baz"]
22:49:52 <lambdabot> [(3,"foo","FOO"),(3,"bar","BAR"),(3,"baz","BAZ")]
22:50:01 <jacks2> but I was hoping there's a nifty arrow operator that does this, like ***
22:50:27 <arahael> jacks2: then i wouldnt understand your code!
22:50:57 <hpc> Inst: https://simulavr.com/
22:51:01 <ski> what're you doing with the triples ?
22:52:22 <Inst> thanks
22:52:23 <jacks2> making two way map out of it
22:52:41 <jacks2> I'll just use lambda, no big deal
22:52:49 <ski> `Map Int (Map String String)' ?
22:53:20 <jacks2> no, types were made up for the question purpose
22:53:34 <ski> what do you mean by "two way map" ?
22:53:52 <jacks2> I'll try to make a short test case in a few minutes
22:53:53 <hololeap> this is what I'm trying to do: http://sprunge.us/wqrAZF -- the constructors have lenses through OverloadedLabels and Optics.Label and I'm wondering how I can do this with optics combinators
22:54:21 <jacks2> as far as my original question goes, I'm pretty sure I did this with arrows before though. or maybe I just did a pair?
22:54:23 <jacks2> ie:
22:54:27 martin02 joins (~silas@141.84.69.76)
22:54:44 <jacks2> > map (length &&& id) ["fooo", "bar"]
22:54:45 <lambdabot> [(4,"fooo"),(3,"bar")]
22:56:16 <ski> i tend to call `(id &&&)', `graph' (and `(||| id)', `cograph')
22:59:13 peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
23:04:02 × peterhil quits (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 265 seconds)
23:10:14 × danso quits (~danso@23-233-111-52.cpe.pppoe.ca) (Quit: WeeChat 3.2)
23:14:28 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
23:17:03 wootehfoot joins (~wootehfoo@user/wootehfoot)
23:18:48 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
23:23:47 × o1lo01ol1o quits (~o1lo01ol1@bl19-157-209.dsl.telepac.pt) (Remote host closed the connection)
23:24:24 o1lo01ol1o joins (~o1lo01ol1@bl19-157-209.dsl.telepac.pt)
23:24:30 rekahsoft joins (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com)
23:24:39 × acidjnk quits (~acidjnk@p200300d0c703cb13596ef3e4428d3d40.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
23:28:45 <ManofLetters[m]> arahael: hi! I tried to message you (from Matrix), but it says you are blocking the messages
23:28:58 × o1lo01ol1o quits (~o1lo01ol1@bl19-157-209.dsl.telepac.pt) (Ping timeout: 268 seconds)
23:29:12 <ManofLetters[m]> was it you kindly interested in LambdaHack yesterday? I left some backlog, but not sure if it reached you
23:29:44 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
23:29:45 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
23:29:45 wroathe joins (~wroathe@user/wroathe)
23:32:33 × Tuplanolla quits (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.)
23:34:05 × jgeerds quits (~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 260 seconds)
23:40:35 × martin02 quits (~silas@141.84.69.76) (Ping timeout: 264 seconds)
23:40:59 hexfive joins (~eric@50.35.83.177)
23:41:16 <jacks2> what should I use for fixed length list/array?
23:41:46 <jacks2> I only have a few elements, so efficiency shouldn't matter, but I want compile-time guarantee that there are only n-elements
23:42:19 <geekosaur> Array probably
23:42:34 <jacks2> hmm, or maybe just (a, a, a, a) ?
23:42:37 <arahael> ManofLetters[m]: thanks :) i do block dm's from unregistered users. i was curious but not hugely so, it might be more for sm?
23:42:48 <arahael> ManofLetters[m]: as in, the user known as "sm" :)
23:42:53 <jacks2> or data FourList = FourList a a a a
23:43:16 × Inst quits (~Inst@2601:6c4:4080:3f80:24f8:b8f5:afa7:ac97) (Remote host closed the connection)
23:43:23 <awpr> https://hackage.haskell.org/package/short-vec jacks2, if you're comfortable with there being DataKinds involved for the length
23:43:34 Inst joins (~Inst@2601:6c4:4080:3f80:357d:a798:4766:f7a0)
23:43:47 <awpr> although if it's _always_ four and that's the only length you need, that `FourList` is good too
23:43:58 <ManofLetters[m]> arahael: oh yes, we chat with sm a lot :)
23:44:11 <ManofLetters[m]> arahael: could I ask you a favour?
23:44:27 <arahael> ManofLetters[m]: i am just about to duck out... maybe later tonight?
23:44:43 <ManofLetters[m]> sure, np, later
23:44:45 <arahael> (10:45 am here)
23:44:50 <arahael> laters!
23:44:55 <ManofLetters[m]> 1:45am here :)
23:45:01 <arahael> ha. sleep well!
23:45:16 <ManofLetters[m]> have a good day!
23:46:05 <ManofLetters[m]> BTW, does anybody know in what sense I'm unregistered? IRC-unregistered or Matrix-unregistered?
23:46:27 <arahael> ManofLetters[m]: thanks. and fyi, it's irc-unregistered.
23:46:28 <ManofLetters[m]> (this causes me to be unable to message some people)
23:46:34 <ManofLetters[m]> oh, ok, fine
23:46:44 × hexfive quits (~eric@50.35.83.177) (Quit: WeeChat 3.0.1)
23:51:33 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
23:52:22 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
23:52:54 <arahael> ManofLetters[m]: also, i deliberately block unregistered users. due to spam.
23:53:03 arahael is on his walk now! laters.
23:54:01 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
23:55:19 hexfive joins (~eric@50.35.83.177)
23:59:08 × hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection)

All times are in UTC on 2021-10-16.