2021/10/16

2021-10-16 00:02:36 +0200ec(~ec@gateway/tor-sasl/ec) (Quit: ec)
2021-10-16 00:02:44 +0200hippoid(~idris@184.105.6.88) (Quit: Lost terminal)
2021-10-16 00:08:40 +0200mestre(~mestre@191.177.175.57)
2021-10-16 00:09:23 +0200wonko(~wjc@62.115.229.50) (Ping timeout: 264 seconds)
2021-10-16 00:09:28 +0200doyougnu(~user@c-73-25-202-122.hsd1.or.comcast.net) (Ping timeout: 252 seconds)
2021-10-16 00:10:03 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 00:10:03 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 00:10:03 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 00:10:57 +0200Player001(~Player001@user/player001) (Quit: Quitting)
2021-10-16 00:11:30 +0200slack1256(~slack1256@45.4.2.52) (Ping timeout: 265 seconds)
2021-10-16 00:14:58 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-16 00:16:34 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Quit: WeeChat 3.3)
2021-10-16 00:17:04 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 00:18:54 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2021-10-16 00:25:13 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 00:25:14 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 00:25:14 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 00:26:23 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) (Remote host closed the connection)
2021-10-16 00:28:26 +0200hexfive(~eric@50.35.83.177)
2021-10-16 00:28:29 +0200hexfive(~eric@50.35.83.177) (Client Quit)
2021-10-16 00:33:59 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-16 00:37:05 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 00:41:03 +0200zebrag(~chris@user/zebrag)
2021-10-16 00:41:06 +0200Skyfire(~pyon@user/pyon) (Quit: WeeChat 3.3)
2021-10-16 00:42:53 +0200mestre(~mestre@191.177.175.57) (Quit: Lost terminal)
2021-10-16 00:43:45 +0200michalz(~michalz@185.246.204.93) (Remote host closed the connection)
2021-10-16 00:46:08 +0200douglascorrea_io(~douglasco@200.146.85.128.static.gvt.net.br) (Quit: Leaving)
2021-10-16 00:46:29 +0200douglascorrea(~douglasco@200.146.85.128.static.gvt.net.br)
2021-10-16 00:47:23 +0200douglascorrea(~douglasco@200.146.85.128.static.gvt.net.br) (Remote host closed the connection)
2021-10-16 00:47:34 +0200Player001(~Player001@user/player001)
2021-10-16 00:48:01 +0200douglascorrea_io(~douglasco@200.146.85.128.static.gvt.net.br)
2021-10-16 00:50:13 +0200ubert1(~Thunderbi@178.165.181.201.wireless.dyn.drei.com) (Ping timeout: 252 seconds)
2021-10-16 00:52:51 +0200douglascorrea_io(~douglasco@200.146.85.128.static.gvt.net.br) (Client Quit)
2021-10-16 00:53:22 +0200 <phaazon> is there anyone know who knows how to implement a rank-2 type that introduces constraints on the records, not on the type itself? I basically need to create a data type for which fields are associated types in a typeclass, but I don’t want to constrain the whole type; instead, I would prefer constraining the type with a « universal typeclass » that can introduce the constraint on each
2021-10-16 00:53:24 +0200 <phaazon> field; any idea?
2021-10-16 00:53:36 +0200douglascorrea_io(~douglasco@200.146.85.128.static.gvt.net.br)
2021-10-16 00:54:06 +0200douglascorrea_io(~douglasco@200.146.85.128.static.gvt.net.br) (Client Quit)
2021-10-16 00:54:37 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
2021-10-16 00:54:50 +0200gzj(~GZJ0X@199.193.127.89.16clouds.com)
2021-10-16 00:54:51 +0200 <phaazon> the idea is that the class Backend b t has an associated data BackendRepr b t, and that thing needs to be used inside another data type, so I basically want something like data Collection b = forall t. Backend b t => Collection { … }
2021-10-16 00:54:59 +0200 <phaazon> actually, maybe that works
2021-10-16 00:55:07 +0200douglascorrea_io(~douglasco@200.146.85.128.static.gvt.net.br)
2021-10-16 00:57:40 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 00:58:42 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 00:59:36 +0200 <phaazon> I will draft a gist to explain a bit more the problem
2021-10-16 01:01:31 +0200 <phaazon> https://gist.github.com/phaazon/0c7489d231a9472b4012a05e2c8dcba6
2021-10-16 01:01:59 +0200 <phaazon> I want to be able to change the newCollection value so that I can remove the list of Backend b _, and replace with a rank-2 constraint
2021-10-16 01:02:05 +0200 <phaazon> I’m not even sure whether this is possible
2021-10-16 01:04:14 +0200 <phaazon> maybe a GADT
2021-10-16 01:10:55 +0200mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2021-10-16 01:14:20 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-10-16 01:15:01 +0200 <phaazon> ooooh, maybe QuantifiedConstraints
2021-10-16 01:15:31 +0200 <phaazon> oh yes it works with that
2021-10-16 01:16:18 +0200 <phaazon> yeah, it was that…
2021-10-16 01:16:43 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.3)
2021-10-16 01:16:57 +0200 <awpr> assuming you wrote `(forall x. Backend b x) => Collection b`, you might not be able to call it, depending on how the instances are written
2021-10-16 01:17:00 +0200Skyfire(~pyon@user/pyon)
2021-10-16 01:17:51 +0200 <phaazon> awpr: how so?
2021-10-16 01:18:12 +0200 <awpr> it'd only work with instances like `instance ... => Backend MyType a` where `a` is just a type variable
2021-10-16 01:18:32 +0200 <phaazon> so it’s not really rank-2?
2021-10-16 01:19:40 +0200fvr(uid503686@id-503686.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-16 01:19:43 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 01:19:43 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 01:19:43 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 01:20:01 +0200 <awpr> not quite sure what you mean, but the constraint `forall x. Backend b x` means "there is a single instance head that satisfies `Backend b x` for any `x`"
2021-10-16 01:20:44 +0200Tuplanolla(~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
2021-10-16 01:21:01 +0200DNH(~DNH@2a02:8108:1100:16d8:547f:5c76:6b1:9692) (Quit: Textual IRC Client: www.textualapp.com)
2021-10-16 01:21:02 +0200jgeerds(~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 268 seconds)
2021-10-16 01:21:32 +0200 <phaazon> hm, I’m actually blocked even before trying that
2021-10-16 01:21:41 +0200 <phaazon> I have a weird issue with implementing the data family
2021-10-16 01:23:12 +0200 <phaazon> nevermind it’s just me being dumb
2021-10-16 01:27:54 +0200yates(~user@fv-nc-f7af8b91e1-234237-1.tingfiber.com)
2021-10-16 01:27:56 +0200 <phaazon> awpr: yeah, that doesn’t work indeed
2021-10-16 01:28:02 +0200 <yates> how do you exit ghci?
2021-10-16 01:28:07 +0200 <phaazon> I need to provide the constraint, not depend on it
2021-10-16 01:28:09 +0200 <phaazon> yates: :q
2021-10-16 01:28:10 +0200 <yates> quit and exit won't do it.
2021-10-16 01:29:26 +0200 <yates> phaazon: ty
2021-10-16 01:29:47 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-16 01:30:06 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 01:31:30 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 260 seconds)
2021-10-16 01:33:11 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-10-16 01:34:38 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
2021-10-16 01:35:03 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 01:37:37 +0200 <phaazon> hm, with an existential I don’t seem to make it either…
2021-10-16 01:40:35 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-10-16 01:40:43 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 01:41:25 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 01:45:16 +0200cheater(~Username@user/cheater) (Ping timeout: 265 seconds)
2021-10-16 01:45:23 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-16 01:45:41 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 01:46:13 +0200libertyprime(~libertypr@118.149.76.0)
2021-10-16 01:46:14 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-10-16 01:47:35 +0200 <libertyprime> Hey guys. I have a quick question about refactoring a simple bit of haskell. Here I have a function, listOf https://github.com/semiosis/ilambda/blob/master/hs/src/Main.hs#L48
2021-10-16 01:48:06 +0200 <libertyprime> Rather than having listOfUpdate, which updates the list, I would like to combine listOf and listOfUpdate into a single function, but in a particular way
2021-10-16 01:48:51 +0200 <libertyprime> when I'm in ghci, I'd like to be able to specify somehow to the function that I want it to update, and so use penau instead of pena
2021-10-16 01:49:44 +0200 <libertyprime> in another language i'd introduce some global state that the function checks for
2021-10-16 01:50:10 +0200 <libertyprime> but i'm wondering how best to do this with haskell. im too noob to know what to do
2021-10-16 01:51:15 +0200 <libertyprime> what i would 'like' to be able to do is prefix with another function like 'upd $ listOf 5 "worst football teams"', that would look nice. something as elegant as that
2021-10-16 01:54:55 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 01:57:22 +0200 <libertyprime> ah, but that isn't even right. forget my silly 'upd $' thought. haskell would compute the list first surely. perhaps what i need is a type on the end of listOf ... :: UpdatedList
2021-10-16 01:57:54 +0200 <libertyprime> I have no idea how to implement that though or if it would even print in ghci. i guess i'd have to derive Show? for that type
2021-10-16 01:57:56 +0200acidjnk_new3(~acidjnk@p200300d0c703cb999d5eb9ee05a422b5.dip0.t-ipconnect.de) (Ping timeout: 246 seconds)
2021-10-16 02:01:50 +0200hololeap_hololeap
2021-10-16 02:09:17 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-16 02:09:22 +0200gzj(~GZJ0X@199.193.127.89.16clouds.com) (Ping timeout: 252 seconds)
2021-10-16 02:10:31 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
2021-10-16 02:10:45 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-10-16 02:13:58 +0200acidjnk_new3(~acidjnk@p200300d0c703cb13046e85210638d6ab.dip0.t-ipconnect.de)
2021-10-16 02:15:16 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
2021-10-16 02:17:31 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 02:18:34 +0200machinedgod(~machinedg@24.105.81.50)
2021-10-16 02:28:05 +0200cheater(~Username@user/cheater)
2021-10-16 02:29:15 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
2021-10-16 02:32:10 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 02:37:13 +0200jonatan(~nate@h85-8-60-194.cust.a3fiber.se)
2021-10-16 02:37:58 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
2021-10-16 02:38:15 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 02:40:02 +0200nitrix(~nitrix@user/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
2021-10-16 02:45:23 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-16 02:45:29 +0200idris(~idris@184.105.6.88)
2021-10-16 02:45:40 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 02:46:11 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-16 02:46:59 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-10-16 02:47:10 +0200 <idris> >
2021-10-16 02:47:12 +0200 <lambdabot> <no location info>: error: not an expression: ‘’
2021-10-16 02:47:18 +0200idrishippoid
2021-10-16 02:47:37 +0200 <hippoid> > newtype Pair a b = Pair {first::a, second::b }
2021-10-16 02:47:39 +0200 <lambdabot> <hint>:1:1: error: parse error on input ‘newtype’
2021-10-16 02:47:56 +0200 <monochrom> You have two problems.
2021-10-16 02:48:05 +0200 <hippoid> I only wanted to show the one problem
2021-10-16 02:48:17 +0200 <monochrom> 1st problem: Use @let for declarations
2021-10-16 02:48:29 +0200 <hippoid> @let newtype Pair a b = Pair {first::a, second::b }
2021-10-16 02:48:29 +0200 <lambdabot> Parse failed: newtype declaration constructor must have exactly one parameter.
2021-10-16 02:48:35 +0200 <monochrom> 2nd problem: Use "data" if you want 2 or more fields.
2021-10-16 02:48:54 +0200 <hippoid> why is newtype limited to just 1 field?
2021-10-16 02:49:24 +0200 <monochrom> Because it has a semantic difference from "data". The semantics of newtype makes sense for 1 field only (and 1 ctor only).
2021-10-16 02:51:35 +0200 <hippoid> what is it about newtype semantics that only makes sense for it to have 1 field?
2021-10-16 02:52:05 +0200 <hippoid> maybe it's about avoiding it becoming a product type
2021-10-16 02:52:44 +0200 <monochrom> "newtype T = MkT S" means: After compiling to low level code and type erasure, I want T and S to be indistinguishable.
2021-10-16 02:53:20 +0200haritz(~hrtz@user/haritz) (Quit: ZNC 1.7.2+deb3 - https://znc.in)
2021-10-16 02:53:50 +0200 <hippoid> i can buy that
2021-10-16 02:55:28 +0200 <monochrom> Have you been following a good Haskell book? All the good ones explain this.
2021-10-16 02:55:35 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-16 02:55:52 +0200MQ-17J(~MQ-17J@8.6.144.117)
2021-10-16 02:55:54 +0200 <monochrom> Even the poor ones have to say something along that line if they dare to bring up "newtype" at all.
2021-10-16 02:55:58 +0200 <hippoid> @let newtype T s = MkT s
2021-10-16 02:55:59 +0200 <lambdabot> Defined.
2021-10-16 02:56:22 +0200 <Inst> hum, weird
2021-10-16 02:56:42 +0200 <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.
2021-10-16 02:56:57 +0200Guest26(~Guest26@50.25.34.71)
2021-10-16 02:57:00 +0200 <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
2021-10-16 02:57:13 +0200 <Inst> to just have int main() consist of nothing but function calls
2021-10-16 02:57:31 +0200 <Inst> since you guys are functional programming paradigm, is it bad form in function-land?
2021-10-16 02:57:40 +0200 <monochrom> No.
2021-10-16 02:57:53 +0200 <Inst> they had a misunderstanding
2021-10-16 02:57:54 +0200 <monochrom> And what more should be in main anyway?
2021-10-16 02:57:55 +0200Guest26(~Guest26@50.25.34.71) (Client Quit)
2021-10-16 02:58:00 +0200Tuplanolla(~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.)
2021-10-16 02:58:10 +0200 <awpr> what else should it consist of? operators and literals?
2021-10-16 02:58:17 +0200 <monochrom> And why should I put extra things there for the sake of putting extra things there?
2021-10-16 02:58:19 +0200 <awpr> oh, that's what monochrom just said
2021-10-16 02:58:27 +0200 <monochrom> :)
2021-10-16 02:58:30 +0200 <awpr> oh I know, comments!
2021-10-16 02:58:32 +0200 <hippoid> monochrom: the book did mention it... but after the point I was at.
2021-10-16 02:58:38 +0200 <hippoid> monochrom: what's your course?
2021-10-16 02:58:53 +0200 <monochrom> http://www.cs.utoronto.ca/~trebla/CSCC24-2021-Summer/
2021-10-16 02:59:00 +0200 <hippoid> thanks
2021-10-16 03:00:17 +0200 <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.
2021-10-16 03:01:01 +0200 <monochrom> Someone on the library mailing list was suggesting to deprecate "read" because it is an oh-so-partial function.
2021-10-16 03:01:39 +0200 <monochrom> So someone here (different person) polled our opinion here.
2021-10-16 03:02:11 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 264 seconds)
2021-10-16 03:02:32 +0200 <monochrom> I explained that I use it all the time, but with just cause: "x <- read <$> some digits" in parsers.
2021-10-16 03:03:17 +0200 <monochrom> So suppose the madman's wish came true, read were banned, and I had to write "x <- fromJust . readMaybe <$> some digits"
2021-10-16 03:03:35 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com)
2021-10-16 03:03:35 +0200dibblego(~dibblego@122-199-1-30.ip4.superloop.com) (Changing host)
2021-10-16 03:03:35 +0200dibblego(~dibblego@haskell/developer/dibblego)
2021-10-16 03:03:47 +0200 <monochrom> That would be what I call "using total functions for the sake of using total functions".
2021-10-16 03:03:50 +0200haritz(~hrtz@62.3.70.206)
2021-10-16 03:03:51 +0200haritz(~hrtz@62.3.70.206) (Changing host)
2021-10-16 03:03:51 +0200haritz(~hrtz@user/haritz)
2021-10-16 03:04:30 +0200 <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.
2021-10-16 03:04:40 +0200lbseale(~lbseale@user/ep1ctetus) (Read error: Connection reset by peer)
2021-10-16 03:05:02 +0200 <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"?
2021-10-16 03:05:20 +0200 <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.
2021-10-16 03:05:26 +0200azimut_(~azimut@gateway/tor-sasl/azimut)
2021-10-16 03:06:05 +0200 <geekosaur> by any chance do you have some specific code they were commenting on?
2021-10-16 03:06:18 +0200 <monochrom> Even that can have just cause in a minority of cases.
2021-10-16 03:06:39 +0200 <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.
2021-10-16 03:06:42 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds)
2021-10-16 03:06:55 +0200 <monochrom> For example "just in this version for now for simplicity. next version will be more interesting."
2021-10-16 03:07:20 +0200harveypwca(~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67)
2021-10-16 03:07:35 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 264 seconds)
2021-10-16 03:08:55 +0200 <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
2021-10-16 03:09:04 +0200retro_(~retro@2e41e9c8.skybroadband.com) (Quit: Connection error?!)
2021-10-16 03:11:01 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
2021-10-16 03:11:50 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 03:16:57 +0200azimut_(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2021-10-16 03:18:01 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2021-10-16 03:18:23 +0200douglascorrea_io(~douglasco@200.146.85.128.static.gvt.net.br) (Ping timeout: 264 seconds)
2021-10-16 03:21:28 +0200acidjnk_new3(~acidjnk@p200300d0c703cb13046e85210638d6ab.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2021-10-16 03:22:35 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 264 seconds)
2021-10-16 03:24:13 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-16 03:24:43 +0200xiongxin(~quassel@113.116.224.79)
2021-10-16 03:27:28 +0200dsrt^(~dsrt@70.166.66.234) (Ping timeout: 252 seconds)
2021-10-16 03:29:19 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 03:30:08 +0200abrantesasf(~abrantesa@187.36.170.211)
2021-10-16 03:35:58 +0200stiell(~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
2021-10-16 03:36:38 +0200stiell(~stiell@gateway/tor-sasl/stiell)
2021-10-16 03:38:51 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 265 seconds)
2021-10-16 03:42:43 +0200hiredman(~hiredman@frontier1.downey.family) (Ping timeout: 265 seconds)
2021-10-16 03:45:59 +0200MQ-17J(~MQ-17J@8.6.144.117) (Ping timeout: 264 seconds)
2021-10-16 03:46:15 +0200 <unit73e> ugh... now gitlab is trying to convince people to use 'main' instead of 'master'
2021-10-16 03:46:17 +0200 <unit73e> why?
2021-10-16 03:46:38 +0200 <unit73e> anyway here's my new set of SDL2 examples: https://gitlab.com/unit73e/sdl2-examples
2021-10-16 03:46:48 +0200 <unit73e> It's lazyfoo free
2021-10-16 03:47:22 +0200 <unit73e> it's WIP. so far shows a window and draws some primitives.
2021-10-16 03:49:12 +0200 <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
2021-10-16 03:49:28 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 252 seconds)
2021-10-16 03:49:36 +0200 <unit73e> a game dev shouldn't have to know those details
2021-10-16 03:49:45 +0200 <unit73e> imo
2021-10-16 03:50:13 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 03:51:08 +0200 <unit73e> all a game dev should care is game logic, now what each cycle does
2021-10-16 03:53:26 +0200 <unit73e> next example will be keyboard events and then proper movement, not lazyfoo choppy version
2021-10-16 03:55:31 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-16 03:56:49 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-10-16 03:59:07 +0200xff0x(~xff0x@2001:1a81:524d:6800:54c0:a41d:5321:6f97) (Ping timeout: 240 seconds)
2021-10-16 03:59:15 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 03:59:15 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 03:59:15 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 04:00:03 +0200sander(~sander@user/sander) (Quit: So long! :))
2021-10-16 04:00:50 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 04:01:23 +0200xff0x(~xff0x@2001:1a81:5288:5c00:50e4:894e:ef2c:4e1c)
2021-10-16 04:01:25 +0200sander(~sander@user/sander)
2021-10-16 04:03:23 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 264 seconds)
2021-10-16 04:03:59 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-10-16 04:05:38 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 04:06:27 +0200eruditass_(uid248673@id-248673.uxbridge.irccloud.com) (Ping timeout: 240 seconds)
2021-10-16 04:06:34 +0200ysh(sid6017@id-6017.ilkley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:34 +0200degraafk(sid71464@id-71464.lymington.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:34 +0200kristjansson_(sid126207@id-126207.tinside.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:34 +0200glowcoil(sid3405@id-3405.tinside.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:34 +0200typetetris(sid275937@id-275937.tinside.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:34 +0200_0x47(sid508683@id-508683.tinside.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200pjlsergeant(sid143467@id-143467.hampstead.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200cbarrett(sid192934@id-192934.helmsley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200gaze___(sid387101@id-387101.helmsley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200alinab(sid468903@id-468903.helmsley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200carter(sid14827@id-14827.helmsley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200idnar(sid12240@debian/mithrandi) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200Pent(sid313808@id-313808.lymington.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200ephemient(uid407513@id-407513.lymington.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200hamishmack(sid389057@id-389057.hampstead.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:40 +0200rune(sid21167@id-21167.ilkley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:06:46 +0200agander_m(sid407952@id-407952.tinside.irccloud.com) (Ping timeout: 245 seconds)
2021-10-16 04:06:46 +0200hubvu(sid495858@user/hubvu) (Ping timeout: 245 seconds)
2021-10-16 04:06:46 +0200taktoa[c](sid282096@id-282096.tinside.irccloud.com) (Ping timeout: 245 seconds)
2021-10-16 04:06:46 +0200bbhoss(sid18216@id-18216.tinside.irccloud.com) (Ping timeout: 245 seconds)
2021-10-16 04:06:55 +0200pepeiborra(sid443799@id-443799.ilkley.irccloud.com) (Ping timeout: 268 seconds)
2021-10-16 04:06:55 +0200caasih(sid13241@2a03:5180:f:3::33b9) (Ping timeout: 268 seconds)
2021-10-16 04:06:55 +0200tnks(sid412124@2a03:5180:f:1::6:49dc) (Ping timeout: 268 seconds)
2021-10-16 04:06:55 +0200ProofTechnique(sid79547@2a03:5180:f:3::1:36bb) (Ping timeout: 268 seconds)
2021-10-16 04:06:55 +0200davetapley(sid666@2a03:5180:f:5::29a) (Ping timeout: 268 seconds)
2021-10-16 04:06:55 +0200whez(sid470288@2a03:5180:f:2::7:2d10) (Ping timeout: 268 seconds)
2021-10-16 04:06:55 +0200SethTisue__(sid14912@2a03:5180:f:3::3a40) (Ping timeout: 268 seconds)
2021-10-16 04:06:55 +0200mrianbloom(sid350277@id-350277.ilkley.irccloud.com) (Ping timeout: 268 seconds)
2021-10-16 04:07:02 +0200awpr(uid446117@id-446117.lymington.irccloud.com) (Ping timeout: 265 seconds)
2021-10-16 04:07:07 +0200NemesisD(sid24071@id-24071.lymington.irccloud.com) (Ping timeout: 240 seconds)
2021-10-16 04:07:13 +0200hook54321(sid149355@user/hook54321) (Ping timeout: 252 seconds)
2021-10-16 04:07:13 +0200lightandlight(sid135476@id-135476.helmsley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:07:23 +0200sa1(sid7690@id-7690.ilkley.irccloud.com) (Ping timeout: 250 seconds)
2021-10-16 04:07:23 +0200cln(sid336875@id-336875.ilkley.irccloud.com) (Ping timeout: 250 seconds)
2021-10-16 04:07:23 +0200stevenxl(sid133530@id-133530.uxbridge.irccloud.com) (Ping timeout: 250 seconds)
2021-10-16 04:07:26 +0200obviyus_(sid415299@id-415299.uxbridge.irccloud.com) (Ping timeout: 246 seconds)
2021-10-16 04:07:26 +0200jakesyl_(sid56879@id-56879.hampstead.irccloud.com) (Ping timeout: 246 seconds)
2021-10-16 04:07:32 +0200scav(sid309693@2a03:5180:f:1::4:b9bd) (Ping timeout: 268 seconds)
2021-10-16 04:07:35 +0200bitmapper(uid464869@id-464869.lymington.irccloud.com) (Ping timeout: 264 seconds)
2021-10-16 04:07:40 +0200hnOsmium0001(uid453710@id-453710.hampstead.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:07:40 +0200Adeon(sid418992@id-418992.lymington.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:07:46 +0200evertedsphere(sid434122@id-434122.hampstead.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:07:50 +0200epolanski(uid312403@id-312403.helmsley.irccloud.com) (Ping timeout: 260 seconds)
2021-10-16 04:08:08 +0200bw(sid2730@user/betawaffle) (Ping timeout: 246 seconds)
2021-10-16 04:08:13 +0200gmc(sid58314@id-58314.ilkley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:08:13 +0200hongminhee(sid295@id-295.tinside.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:08:13 +0200jackdk(sid373013@cssa/jackdk) (Ping timeout: 252 seconds)
2021-10-16 04:08:19 +0200JSharp(sid4580@id-4580.lymington.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:08:19 +0200systemfault(sid267009@id-267009.uxbridge.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:08:19 +0200integral(sid296274@user/integral) (Ping timeout: 252 seconds)
2021-10-16 04:08:19 +0200NiKaN(sid385034@id-385034.helmsley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:08:19 +0200bjs(sid190364@user/bjs) (Ping timeout: 252 seconds)
2021-10-16 04:08:19 +0200angerman(sid209936@id-209936.ilkley.irccloud.com) (Ping timeout: 252 seconds)
2021-10-16 04:08:25 +0200econo(uid147250@user/econo) (Ping timeout: 260 seconds)
2021-10-16 04:08:33 +0200SrPx_(sid108780@id-108780.uxbridge.irccloud.com) (Ping timeout: 268 seconds)
2021-10-16 04:08:33 +0200truckasaurus(sid457088@id-457088.helmsley.irccloud.com) (Ping timeout: 268 seconds)
2021-10-16 04:08:33 +0200Adeon(sid418992@lymington.irccloud.com)
2021-10-16 04:08:33 +0200meinside(uid24933@id-24933.helmsley.irccloud.com) (Ping timeout: 268 seconds)
2021-10-16 04:08:33 +0200bbhoss(sid18216@tinside.irccloud.com)
2021-10-16 04:08:46 +0200nrr_(sid20938@2a03:5180:f:2::51ca) (Ping timeout: 268 seconds)
2021-10-16 04:08:46 +0200vito(sid1962@user/vito) (Ping timeout: 268 seconds)
2021-10-16 04:08:46 +0200rubin55(sid175221@id-175221.hampstead.irccloud.com) (Ping timeout: 268 seconds)
2021-10-16 04:09:03 +0200evertedsphere(sid434122@hampstead.irccloud.com)
2021-10-16 04:09:04 +0200rubin55(sid175221@hampstead.irccloud.com)
2021-10-16 04:09:06 +0200hubvu(sid495858@user/hubvu)
2021-10-16 04:09:13 +0200econo(uid147250@user/econo)
2021-10-16 04:09:18 +0200bitmapper(uid464869@lymington.irccloud.com)
2021-10-16 04:09:18 +0200bjs(sid190364@user/bjs)
2021-10-16 04:09:19 +0200meinside(uid24933@helmsley.irccloud.com)
2021-10-16 04:09:20 +0200nrr_(sid20938@lymington.irccloud.com)
2021-10-16 04:09:21 +0200scav(sid309693@helmsley.irccloud.com)
2021-10-16 04:09:21 +0200systemfault(sid267009@uxbridge.irccloud.com)
2021-10-16 04:09:22 +0200SrPx_(sid108780@uxbridge.irccloud.com)
2021-10-16 04:09:23 +0200vito(sid1962@user/vito)
2021-10-16 04:09:27 +0200JSharp(sid4580@lymington.irccloud.com)
2021-10-16 04:09:29 +0200stevenxl(sid133530@uxbridge.irccloud.com)
2021-10-16 04:09:29 +0200bw(sid2730@user/betawaffle)
2021-10-16 04:09:36 +0200truckasaurus(sid457088@helmsley.irccloud.com)
2021-10-16 04:09:43 +0200gmc(sid58314@ilkley.irccloud.com)
2021-10-16 04:09:43 +0200lightandlight(sid135476@helmsley.irccloud.com)
2021-10-16 04:09:43 +0200NiKaN(sid385034@helmsley.irccloud.com)
2021-10-16 04:09:45 +0200angerman(sid209936@ilkley.irccloud.com)
2021-10-16 04:10:13 +0200hnOsmium0001(uid453710@hampstead.irccloud.com)
2021-10-16 04:10:18 +0200pjlsergeant(sid143467@hampstead.irccloud.com)
2021-10-16 04:10:22 +0200jackdk(sid373013@cssa/jackdk)
2021-10-16 04:10:22 +0200taktoa[c](sid282096@tinside.irccloud.com)
2021-10-16 04:10:22 +0200glowcoil(sid3405@tinside.irccloud.com)
2021-10-16 04:10:30 +0200NemesisD(sid24071@lymington.irccloud.com)
2021-10-16 04:10:31 +0200cln(sid336875@ilkley.irccloud.com)
2021-10-16 04:10:31 +0200integral(sid296274@user/integral)
2021-10-16 04:10:33 +0200cbarrett(sid192934@helmsley.irccloud.com)
2021-10-16 04:10:33 +0200epolanski(uid312403@helmsley.irccloud.com)
2021-10-16 04:10:33 +0200Pent(sid313808@lymington.irccloud.com)
2021-10-16 04:10:44 +0200jakesyl_(sid56879@hampstead.irccloud.com)
2021-10-16 04:11:02 +0200obviyus_(sid415299@uxbridge.irccloud.com)
2021-10-16 04:11:06 +0200sa1(sid7690@ilkley.irccloud.com)
2021-10-16 04:11:07 +0200hongminhee(sid295@tinside.irccloud.com)
2021-10-16 04:11:34 +0200agander_m(sid407952@tinside.irccloud.com)
2021-10-16 04:11:34 +0200eruditass_(uid248673@uxbridge.irccloud.com)
2021-10-16 04:11:43 +0200hook54321(sid149355@user/hook54321)
2021-10-16 04:11:49 +0200libertyprime(~libertypr@118.149.76.0) (Quit: leaving)
2021-10-16 04:13:40 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-16 04:14:08 +0200eruditass_(uid248673@uxbridge.irccloud.com) (Client Quit)
2021-10-16 04:16:30 +0200eruditass(uid248673@uxbridge.irccloud.com)
2021-10-16 04:22:20 +0200typetetris(sid275937@tinside.irccloud.com)
2021-10-16 04:22:22 +0200degraafk(sid71464@lymington.irccloud.com)
2021-10-16 04:22:24 +0200ysh(sid6017@ilkley.irccloud.com)
2021-10-16 04:22:27 +0200_0x47(sid508683@tinside.irccloud.com)
2021-10-16 04:23:01 +0200gaze___(sid387101@helmsley.irccloud.com)
2021-10-16 04:23:01 +0200pepeiborra(sid443799@ilkley.irccloud.com)
2021-10-16 04:23:01 +0200ephemient(uid407513@lymington.irccloud.com)
2021-10-16 04:23:02 +0200SethTisue__(sid14912@ilkley.irccloud.com)
2021-10-16 04:23:04 +0200alinab(sid468903@helmsley.irccloud.com)
2021-10-16 04:23:05 +0200rune(sid21167@ilkley.irccloud.com)
2021-10-16 04:23:06 +0200davetapley(sid666@uxbridge.irccloud.com)
2021-10-16 04:23:09 +0200idnar(sid12240@debian/mithrandi)
2021-10-16 04:23:30 +0200awpr(uid446117@lymington.irccloud.com)
2021-10-16 04:23:45 +0200kristjansson_(sid126207@tinside.irccloud.com)
2021-10-16 04:23:52 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Leaving)
2021-10-16 04:24:14 +0200jespada(~jespada@2803:9800:9842:7a62:c52b:2a1d:b7c2:2b5a) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-10-16 04:24:14 +0200tnks(sid412124@helmsley.irccloud.com)
2021-10-16 04:24:20 +0200hamishmack(sid389057@hampstead.irccloud.com)
2021-10-16 04:24:22 +0200caasih(sid13241@ilkley.irccloud.com)
2021-10-16 04:24:23 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
2021-10-16 04:24:24 +0200ProofTechnique(sid79547@ilkley.irccloud.com)
2021-10-16 04:24:25 +0200whez(sid470288@lymington.irccloud.com)
2021-10-16 04:24:35 +0200carter(sid14827@helmsley.irccloud.com)
2021-10-16 04:25:57 +0200mrianbloom(sid350277@ilkley.irccloud.com)
2021-10-16 04:29:22 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 04:29:22 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 04:29:22 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 04:42:19 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
2021-10-16 04:43:09 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 04:43:47 +0200epolanski(uid312403@helmsley.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-16 04:44:12 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Ping timeout: 276 seconds)
2021-10-16 04:44:23 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-16 04:47:49 +0200td_(~td@muedsl-82-207-238-175.citykom.de) (Ping timeout: 252 seconds)
2021-10-16 04:49:26 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 265 seconds)
2021-10-16 04:50:51 +0200nuh^(~nuh@70.166.66.234)
2021-10-16 04:51:05 +0200FinnElija(~finn_elij@user/finn-elija/x-0085643)
2021-10-16 04:52:45 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-10-16 04:54:25 +0200 <sm> unit73e: +1 for making examples. But did you know about https://github.com/haskell-game/sdl2/tree/master/examples ?
2021-10-16 04:54:52 +0200 <unit73e> sm, yes I do know. in fact mine are based on those.
2021-10-16 04:55:04 +0200 <sm> I see, what's the difference ?
2021-10-16 04:55:57 +0200 <sm> better than lazyfoo in various ways ?
2021-10-16 04:56:07 +0200 <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.
2021-10-16 04:56:11 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 265 seconds)
2021-10-16 04:56:16 +0200 <unit73e> lazyfoo examples are good to start
2021-10-16 04:57:05 +0200 <unit73e> but it gets bad when you get to moving objects for example
2021-10-16 04:57:58 +0200 <unit73e> lazyfoo ended up using the crappiest way of moving an object... just move N pixels with you press the key, without repetition
2021-10-16 04:58:35 +0200 <unit73e> also apparently he rather developers not make ports or share code in any repository
2021-10-16 04:59:00 +0200 <unit73e> I was making a complete port of lazyfoo btw
2021-10-16 04:59:51 +0200MQ-17J(~MQ-17J@8.21.10.20)
2021-10-16 05:00:08 +0200 <unit73e> so my idea is to make something similar but better suited for real life games
2021-10-16 05:00:09 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-16 05:00:31 +0200 <unit73e> nobody uses choppy movement in games. most games have acceleration and max velocity
2021-10-16 05:01:10 +0200 <unit73e> also I get to do shared libraries while with lazyfoo everything was self-contained
2021-10-16 05:02:14 +0200 <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.
2021-10-16 05:03:36 +0200 <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.
2021-10-16 05:06:49 +0200flu(~flu@86.121.5.30)
2021-10-16 05:07:15 +0200 <monochrom> BTW, github is also defaulting to "main".
2021-10-16 05:07:24 +0200 <unit73e> ugh...
2021-10-16 05:07:33 +0200 <unit73e> the wokes complained?
2021-10-16 05:07:44 +0200 <monochrom> I don't know!
2021-10-16 05:08:09 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 05:08:21 +0200 <unit73e> I bet it had something to do with master/slave dilemma that nobody cares...
2021-10-16 05:09:03 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection)
2021-10-16 05:09:11 +0200 <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
2021-10-16 05:09:11 +0200 <unit73e> microsoft is a big fan of wasting time changing words
2021-10-16 05:09:38 +0200fluorangeFlu
2021-10-16 05:09:42 +0200 <unit73e> because they're "offensive" to a loud minority, but that's just my opinion
2021-10-16 05:09:59 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
2021-10-16 05:10:15 +0200 <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.
2021-10-16 05:10:31 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2021-10-16 05:10:33 +0200 <unit73e> I don't really care either way, I just find it annoying
2021-10-16 05:11:15 +0200 <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
2021-10-16 05:11:51 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 05:12:41 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 05:12:59 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
2021-10-16 05:13:32 +0200zebrag(~chris@user/zebrag) (Quit: Konversation terminated!)
2021-10-16 05:13:33 +0200abrantesasf(~abrantesa@187.36.170.211) (Remote host closed the connection)
2021-10-16 05:14:42 +0200 <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.
2021-10-16 05:15:23 +0200 <unit73e> big corpos are all in it to see who's has the biggest virtue points :\
2021-10-16 05:17:13 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
2021-10-16 05:21:25 +0200obviyus_(sid415299@uxbridge.irccloud.com) (Changing host)
2021-10-16 05:21:25 +0200obviyus_(sid415299@user/obviyus)
2021-10-16 05:22:28 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net) (Quit: WeeChat 2.8)
2021-10-16 05:22:49 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 05:24:00 +0200MQ-17J(~MQ-17J@8.21.10.20) (Ping timeout: 268 seconds)
2021-10-16 05:28:53 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net) (Quit: WeeChat 2.8)
2021-10-16 05:31:14 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 05:31:40 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 05:31:55 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
2021-10-16 05:32:47 +0200phma(~phma@host-67-44-208-96.hnremote.net) (Read error: Connection reset by peer)
2021-10-16 05:33:14 +0200phma(~phma@host-67-44-208-96.hnremote.net)
2021-10-16 05:33:53 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net) (Client Quit)
2021-10-16 05:34:08 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 05:34:50 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net) (Client Quit)
2021-10-16 05:35:16 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 05:35:40 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 252 seconds)
2021-10-16 05:36:48 +0200 <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.
2021-10-16 05:39:30 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 05:41:41 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection)
2021-10-16 05:41:54 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 05:44:02 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Ping timeout: 265 seconds)
2021-10-16 05:46:22 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 05:51:08 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-10-16 05:53:05 +0200alzgh(~alzgh@user/alzgh) (Remote host closed the connection)
2021-10-16 05:53:51 +0200alzgh(~alzgh@user/alzgh)
2021-10-16 05:56:08 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net) (Remote host closed the connection)
2021-10-16 05:56:08 +0200alzgh(~alzgh@user/alzgh) (Remote host closed the connection)
2021-10-16 05:56:26 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 05:57:11 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net) (Client Quit)
2021-10-16 05:57:13 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 05:57:32 +0200hughjfchen(~hughjfche@vmi556545.contaboserver.net)
2021-10-16 05:58:26 +0200alzgh(~alzgh@user/alzgh)
2021-10-16 05:58:52 +0200alzgh(~alzgh@user/alzgh) (Remote host closed the connection)
2021-10-16 05:59:56 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 06:01:14 +0200alzgh(~alzgh@user/alzgh)
2021-10-16 06:06:36 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 06:07:26 +0200 <dsal> :t unless
2021-10-16 06:07:27 +0200 <lambdabot> Applicative f => Bool -> f () -> f ()
2021-10-16 06:07:31 +0200 <dsal> Does anyone find this confusing?
2021-10-16 06:09:13 +0200 <unit73e> dsal, not really. what makes it confusing?
2021-10-16 06:09:39 +0200 <dsal> No idea. Just reading some hlint rules someone wrote up. Apparently `unless` is really confusing and you should use `when` instead.
2021-10-16 06:11:21 +0200 <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.
2021-10-16 06:12:54 +0200 <unit73e> for `either` I kind of get it
2021-10-16 06:13:22 +0200 <unit73e> because the opposite of `right` should be `wrong` lol
2021-10-16 06:13:37 +0200 <unit73e> but that would look stupid
2021-10-16 06:13:58 +0200 <unit73e> so left/right it is
2021-10-16 06:14:39 +0200 <dsal> Sometimes `either` is the perfect tool.
2021-10-16 06:14:43 +0200 <dsal> :t either fail pure
2021-10-16 06:14:44 +0200 <lambdabot> MonadFail m => Either String a -> m a
2021-10-16 06:15:09 +0200 <unit73e> yes but the confusion is what to put on `left` and on `right`
2021-10-16 06:15:18 +0200 <unit73e> we know `right` is for the correct path
2021-10-16 06:15:22 +0200 <unit73e> but that's just a convention
2021-10-16 06:15:36 +0200 <unit73e> it could be reversed
2021-10-16 06:16:17 +0200 <sm> dsal, working with some new haskellers ?
2021-10-16 06:16:26 +0200 <unit73e> for `unless`, I don't get it. It's just flipped `when`, so `do ... unless ...`.
2021-10-16 06:16:31 +0200 <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`
2021-10-16 06:17:02 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2021-10-16 06:17:09 +0200 <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.
2021-10-16 06:17:19 +0200 <unit73e> lmao
2021-10-16 06:17:22 +0200 <unit73e> good luck with that
2021-10-16 06:17:27 +0200 <sm> ah, that is more complicated :)
2021-10-16 06:17:41 +0200 <sm> I sympathise with both of you
2021-10-16 06:18:05 +0200 <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.
2021-10-16 06:18:08 +0200 <unit73e> how about just learn the language?
2021-10-16 06:18:22 +0200 <sm> maybe one of the style guides out there can be used, to avoid arguments ?
2021-10-16 06:18:24 +0200 <dsal> I mean, there *is* excessively confusing.
2021-10-16 06:18:49 +0200 <dsal> I'm not sure anybody else's style guide would suffice.
2021-10-16 06:18:54 +0200 <unit73e> I have a better idea. instead of just blindly using `either` and `unless`, read what it does first.
2021-10-16 06:18:59 +0200 <sm> it's a place to start
2021-10-16 06:19:01 +0200 <unit73e> just saying lol
2021-10-16 06:19:16 +0200 <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.
2021-10-16 06:19:26 +0200 <dsal> But, TBH, ormolu slows me down a few times a day.
2021-10-16 06:19:45 +0200 <dsal> unit73e: hlint prevents commits.
2021-10-16 06:19:51 +0200 <unit73e> oof
2021-10-16 06:20:28 +0200 <unit73e> you're getting yourself into a can of worms about to be openned
2021-10-16 06:21:14 +0200 <unit73e> but if it's not your call I wouldn't bother much
2021-10-16 06:21:48 +0200 <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.
2021-10-16 06:22:18 +0200 <unit73e> I'm stilll trying to figure how `do ... unless ...` is confusing. reads like normal english.
2021-10-16 06:23:10 +0200 <unit73e> I guess because it's a negative? not a positive?
2021-10-16 06:24:20 +0200 <dsal> Yeah, I guess I'll ask. I have the same issue. `when (not . isGood) $ x` seems more confusing to me.
2021-10-16 06:24:21 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2021-10-16 06:25:04 +0200 <tapas> `let bad = not . isGood`
2021-10-16 06:25:08 +0200 <tapas> `when bad x`
2021-10-16 06:25:19 +0200 <unit73e> lol unless is just more readable
2021-10-16 06:25:43 +0200 <tapas> `unless (not . bad) x`
2021-10-16 06:25:49 +0200 <awpr> how to abide by that rule: `when't = when . not` and then just use that
2021-10-16 06:26:17 +0200 <tapas> `unlessn't f = unless (not . f)`
2021-10-16 06:27:38 +0200 <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.
2021-10-16 06:27:48 +0200 <dsal> Use a non-declarative language if that confuses you.
2021-10-16 06:28:03 +0200 <dsal> I tend to write the thing I want and then fill in the details later, leaving the high level thing first.
2021-10-16 06:29:14 +0200 <unit73e> that's just bad advice
2021-10-16 06:29:31 +0200 <unit73e> not using `where`
2021-10-16 06:29:41 +0200 <unit73e> I favor where to let tbh
2021-10-16 06:30:07 +0200 <unit73e> I don't really care about particularities of the main code, so where hides htat
2021-10-16 06:30:19 +0200 <unit73e> let doesn't. it's noise.
2021-10-16 06:30:57 +0200 <unit73e> that newbie is probably used to imperative languages
2021-10-16 06:30:58 +0200 <dsal> Yeah, that's kind of how I see it. People have weird views of readability.
2021-10-16 06:31:57 +0200 <unit73e> in C it was (maybe still is) good pratice to declare everything first
2021-10-16 06:32:05 +0200 <unit73e> I always found it silly
2021-10-16 06:32:45 +0200 <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.
2021-10-16 06:33:37 +0200 <unit73e> yup that's Java style
2021-10-16 06:33:41 +0200 <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.
2021-10-16 06:33:57 +0200 <unit73e> even Scala got rid of that verbose nonsense
2021-10-16 06:34:22 +0200 <unit73e> and Scala is just Java 2.0
2021-10-16 06:34:40 +0200 <unit73e> well Java is already 2.X but you get the point
2021-10-16 06:34:47 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-10-16 06:35:06 +0200 <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.
2021-10-16 06:35:34 +0200 <unit73e> that's useful in Java because there's not much composition going on
2021-10-16 06:35:58 +0200 <unit73e> but in haskell you're always using generic functions
2021-10-16 06:36:06 +0200 <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.
2021-10-16 06:36:31 +0200 <unit73e> I only do that for examples
2021-10-16 06:36:40 +0200 <unit73e> like my SDL examples project lol
2021-10-16 06:36:55 +0200 <unit73e> call it "renderer" instead of "r"
2021-10-16 06:37:08 +0200 <unit73e> it doesn't really make much of a difference for simple examples
2021-10-16 06:37:17 +0200 <dsal> Yeah, there are times where it's illustrative.
2021-10-16 06:37:41 +0200xiongxin(~quassel@113.116.224.79) (Ping timeout: 265 seconds)
2021-10-16 06:39:03 +0200 <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.
2021-10-16 06:39:28 +0200machinedgod(~machinedg@24.105.81.50)
2021-10-16 06:40:12 +0200Player001(~Player001@user/player001) (Quit: Quitting)
2021-10-16 06:42:36 +0200 <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.
2021-10-16 06:44:10 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Ping timeout: 268 seconds)
2021-10-16 06:45:39 +0200 <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
2021-10-16 06:45:52 +0200 <clever> because the env vars go on the stack before main(), and change the alignment of the stack
2021-10-16 06:46:06 +0200 <monochrom> haha yikes
2021-10-16 06:46:48 +0200 <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.
2021-10-16 06:47:46 +0200 <awpr> `base` picked up the coercion-composition stuff from lens? presumably a version specialized to (->)?
2021-10-16 06:47:50 +0200 <dsal> > foldMap (\x -> (Sum x, Sum 1)) [13..185] -- I do stuff like this which technically isn't `sum` but does the same thing.
2021-10-16 06:47:52 +0200 <lambdabot> (Sum {getSum = 17127},Sum {getSum = 173})
2021-10-16 06:48:22 +0200 <monochrom> A general form of Wadler's law applies. Most people pay most attention to the most superficial, simplistic things.
2021-10-16 06:49:18 +0200 <monochrom> "Don't use short names." "Don't use a language that doesn't use {}". Simple enough for bird brains.
2021-10-16 06:49:43 +0200 <monochrom> "Do what's right for the particular situation." Too hard.
2021-10-16 06:49:50 +0200 <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
2021-10-16 06:50:14 +0200 <awpr> it's Go with layout
2021-10-16 06:50:52 +0200 <awpr> (sensationalized for entertainment purposes)
2021-10-16 06:51:11 +0200 <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.
2021-10-16 06:51:36 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
2021-10-16 06:52:06 +0200 <monochrom> That may be solvable by monad morphisms. Learned it last night. :)
2021-10-16 06:52:08 +0200 <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...
2021-10-16 06:52:31 +0200 <monochrom> https://hackage.haskell.org/package/mmorph-1.2.0/docs/Control-Monad-Morph.html
2021-10-16 06:53:18 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2021-10-16 06:53:51 +0200 <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.
2021-10-16 06:56:32 +0200 <monochrom> Hey maybe next April 1 I should post my idea of simple haskell and get them to link to my post.
2021-10-16 06:56:50 +0200 <monochrom> It's simply going to be "I don't teach newtype or do-notation to my students". >:)
2021-10-16 06:56:51 +0200 <dolio> Why do you care about "simple haskell"?
2021-10-16 06:57:36 +0200 <monochrom> But it's written in Snoyman style >:)
2021-10-16 06:58:02 +0200lavaman(~lavaman@98.38.249.169) (Read error: Connection reset by peer)
2021-10-16 06:58:16 +0200 <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.
2021-10-16 06:58:29 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 06:58:44 +0200 <dolio> Yeah, but the thing you're talking about is some branded thing. Why do you care about that specifically?
2021-10-16 06:59:00 +0200 <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.
2021-10-16 06:59:03 +0200 <monochrom> I think more like annoyed that it exists? :)
2021-10-16 06:59:17 +0200 <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.
2021-10-16 07:00:12 +0200 <monochrom> The first time I taught this course I used do-notation. I got reliable feedback that skipping do-notation is better.
2021-10-16 07:00:42 +0200 <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.
2021-10-16 07:00:57 +0200 <monochrom> do-notation is easier for newbies who expect to cargo-cult, no doubt.
2021-10-16 07:00:59 +0200xff0x(~xff0x@2001:1a81:5288:5c00:50e4:894e:ef2c:4e1c) (Ping timeout: 264 seconds)
2021-10-16 07:01:40 +0200xff0x(~xff0x@2001:1a81:5288:5c00:1568:382a:23d8:c3dd)
2021-10-16 07:02:03 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 268 seconds)
2021-10-16 07:02:08 +0200 <dsal> do notation is *really* confusing when trying to understand list or maybe monads. It's easy to understand those without it.
2021-10-16 07:02:15 +0200segfaultfizzbuzz(~segfaultf@135-180-0-138.static.sonic.net) (Ping timeout: 260 seconds)
2021-10-16 07:02:20 +0200 <monochrom> But my students did not expect to cargo-cult. They expect me to make sense.
2021-10-16 07:02:48 +0200 <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.
2021-10-16 07:04:25 +0200 <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.
2021-10-16 07:04:33 +0200 <dsal> ("code being too generic is bad")
2021-10-16 07:06:57 +0200 <monochrom> Oh yeah I don't teach type aliases either haha.
2021-10-16 07:07:29 +0200 <dsal> type aliases seem kind of harmful.
2021-10-16 07:07:58 +0200 <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
2021-10-16 07:08:25 +0200 <dsal> NamedFieldPuns is banned according to this list, but RecordWildCards is used in places where it's far easier, safer, and clearer not to.
2021-10-16 07:09:40 +0200 <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.
2021-10-16 07:09:41 +0200 <monochrom> Is that the same list that says "use longer names"?
2021-10-16 07:09:53 +0200 <dsal> I don't think hlint itself allows that.
2021-10-16 07:10:11 +0200 <dsal> hlint feature request: All symbol names must be complete sentences.
2021-10-16 07:10:24 +0200 <monochrom> Because oddly enough "use more names" is a logical prerequisite for "use longer names", no?
2021-10-16 07:10:32 +0200slowButPresent(~slowButPr@user/slowbutpresent) (Quit: leaving)
2021-10-16 07:10:36 +0200lavaman(~lavaman@98.38.249.169) (Remote host closed the connection)
2021-10-16 07:10:48 +0200 <dsal> Function names must all be valid German words.
2021-10-16 07:12:33 +0200 <monochrom> Oh yeah I don't teach ($) either. When explaining the equivalence between <*> and liftA2, I write liftA2 (\f x -> f x).
2021-10-16 07:13:54 +0200 <monochrom> And I am still looking for a nice way to write Applicative laws with liftA2 rather than <*>. So that I can omit <*> too.
2021-10-16 07:14:21 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2021-10-16 07:14:47 +0200azimut(~azimut@gateway/tor-sasl/azimut)
2021-10-16 07:15:46 +0200stengah(~stengah@user/stengah)
2021-10-16 07:16:24 +0200 <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'
2021-10-16 07:16:29 +0200 <monochrom> Actually not just a nice way. A practical way, too.
2021-10-16 07:17:16 +0200 <monochrom> Because at some point I explain that we care about identity laws and associative laws because they justify a lot of refactorings.
2021-10-16 07:17:54 +0200 <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?
2021-10-16 07:18:18 +0200 <monochrom> Well, currently, both versions of Applicative laws make the proof very long and also very artificial.
2021-10-16 07:18:22 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-10-16 07:18:48 +0200 <monochrom> Unlike monad laws. The monad laws are actually way better in this case.
2021-10-16 07:18:49 +0200 <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.
2021-10-16 07:19:12 +0200 <monochrom> (Proofs that are both short and obvious.)
2021-10-16 07:19:31 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 07:20:33 +0200 <ski> dsal : ugh, yea .. not a fan of bringing names into scope implicitly (or the reverse, implicitly using names in scope)
2021-10-16 07:21:12 +0200 <dolio> The unit laws don't seem bad.
2021-10-16 07:21:56 +0200 <dolio> And associative laws seem like they're going to be messy anyway.
2021-10-16 07:22:19 +0200 <dsal> ski++
2021-10-16 07:22:26 +0200skitwitches
2021-10-16 07:23:32 +0200 <dsal> succ ski
2021-10-16 07:23:53 +0200 <ski> preferable, i guess
2021-10-16 07:24:14 +0200 <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.
2021-10-16 07:25:53 +0200ski. 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)' )
2021-10-16 07:25:57 +0200azimut(~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
2021-10-16 07:26:07 +0200 <ski> change detector ?
2021-10-16 07:26:21 +0200 <dsal> Yeah, so like, if you add a new field to Thing, this code should break.
2021-10-16 07:26:22 +0200abhixec(~abhixec@c-67-169-139-16.hsd1.ca.comcast.net)
2021-10-16 07:26:39 +0200 <ski> oh
2021-10-16 07:27:04 +0200 <dsal> That's marginally preferable to "this code should work correctly" but not enough that I lost all those arguments yet.
2021-10-16 07:28:12 +0200 <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.
2021-10-16 07:31:19 +0200 <monochrom> This is why my simple (pun intended) model of the human brain is: memoizing random generator.
2021-10-16 07:31:30 +0200takuan(~takuan@178-116-218-225.access.telenet.be)
2021-10-16 07:31:44 +0200 <monochrom> First randomly generate an opinion. Then remember to stick to it.
2021-10-16 07:32:06 +0200 <dsal> It also spreads.
2021-10-16 07:32:21 +0200 <monochrom> So suppose you want to opine on 100 functions in the standard library.
2021-10-16 07:32:35 +0200ski. o O ( oracles & forcing )
2021-10-16 07:33:08 +0200 <monochrom> Easy! For each function, randomly generate an opinion. Done! Now you also prove yourself to have no consistency.
2021-10-16 07:33:12 +0200 <ski> you flip a coin to determine whether to keep or to drop, and then invent reasons why ?
2021-10-16 07:33:21 +0200 <monochrom> Yeah!
2021-10-16 07:35:03 +0200 <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").
2021-10-16 07:36:33 +0200nitrix(~nitrix@user/nitrix)
2021-10-16 07:37:12 +0200ski. 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> )
2021-10-16 07:37:44 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
2021-10-16 07:38:08 +0200 <ski> monochrom : hm .. perhaps one of those is as a reaction to the other
2021-10-16 07:38:21 +0200 <monochrom> I once wrote a memoizing random generator using unsafeInterleaveIO and posted on lpaste :) :(
2021-10-16 07:39:42 +0200 <dolio> That's how some of Bouwer's counterexamples work.
2021-10-16 07:39:44 +0200 <ski> istr hearing QuickCheck for Erlang used memoizing random generator, to generate a random function
2021-10-16 07:40:14 +0200 <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.
2021-10-16 07:41:32 +0200ski. o O ( Fudget oracles tell the user the outcome of a concurrency scheduling decision )
2021-10-16 07:41:47 +0200 <ski> dolio : elaborate ?
2021-10-16 07:42:13 +0200wyrd(~wyrd@gateway/tor-sasl/wyrd) (Remote host closed the connection)
2021-10-16 07:43:21 +0200 <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.
2021-10-16 07:43:48 +0200 <dolio> Then when people ask you about individual bits, you always tell them 0, and remember the indexes they asked about.
2021-10-16 07:44:31 +0200 <dolio> But, if they try to claim all bits are 0, you decide that an index they haven't asked about yet is 1.
2021-10-16 07:44:38 +0200 <ski> hm, is that related to Kreisel's no-counterexample-interpretation ?
2021-10-16 07:44:44 +0200 <monochrom> Adversary arguments :)
2021-10-16 07:45:30 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
2021-10-16 07:46:53 +0200 <dolio> Maybe. I'm not familiar with that.
2021-10-16 07:48:20 +0200 <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).
2021-10-16 07:48:28 +0200 <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'
2021-10-16 07:49:03 +0200 <ski> s/want/wait/
2021-10-16 07:49:39 +0200 <monochrom> The adversary thinks up non-matching elements for your n-1 queries.
2021-10-16 07:50:34 +0200 <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.
2021-10-16 07:51:02 +0200 <monochrom> If your algorithm returns False, the adversary claims that the spot you didn't ask about has the element.
2021-10-16 07:52:31 +0200 <monochrom> One more use case for unsafeInterleaveIO! :)
2021-10-16 07:54:04 +0200 <dolio> Yeah. I think basically Brouwer doesn't think that infinite sequences need to be limited to some pre-defined describable procedure.
2021-10-16 07:54:23 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 264 seconds)
2021-10-16 07:55:07 +0200 <dolio> That's obviously a pathological example concocted for that particular principle.
2021-10-16 07:56:45 +0200xiongxin(~quassel@113.116.224.79)
2021-10-16 07:57:25 +0200 <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 ...
2021-10-16 08:00:01 +0200orangeFlu(~flu@86.121.5.30) (Ping timeout: 268 seconds)
2021-10-16 08:00:16 +0200orangeFlu(flu@gateway/vpn/protonvpn/orangeflu)
2021-10-16 08:01:32 +0200 <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.
2021-10-16 08:01:52 +0200 <dolio> Oops, I duplicated a word.
2021-10-16 08:02:07 +0200 <ski> "computable" vs. "algorithmic"
2021-10-16 08:02:58 +0200 <ski> no need to assume a Cauchy sequence is algorithmic, to be able to compute with it, it's a superfluous assumption
2021-10-16 08:03:26 +0200 <dolio> Right. You can run algorithms on data that is not generated by an algorithm.
2021-10-16 08:03:57 +0200 <dolio> Even if it's merely because you don't know the algorithm.
2021-10-16 08:04:07 +0200 <ski> iirc Escardó talks a little bit about that, in his thesis
2021-10-16 08:04:39 +0200 <ski> (and the difference it makes for the topology, depending on whether you assume external data is algorithmic, or not)
2021-10-16 08:07:12 +0200 <ski> i suppose induction vs. coinduction, introduction vs. elimination, finitary vs. infinitary, is related
2021-10-16 08:07:50 +0200 <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.
2021-10-16 08:08:20 +0200 <dolio> In that context "computable" means by an algorithm.
2021-10-16 08:09:52 +0200 <ski> mm
2021-10-16 08:09:56 +0200 <dolio> And there's a modality #A that picks out just the computable stuff.
2021-10-16 08:09:59 +0200stengah(~stengah@user/stengah) (Ping timeout: 264 seconds)
2021-10-16 08:10:03 +0200 <ski> the objects involve some function or relation ?
2021-10-16 08:10:44 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection)
2021-10-16 08:11:10 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 08:11:11 +0200orangeFlu(flu@gateway/vpn/protonvpn/orangeflu) (Ping timeout: 264 seconds)
2021-10-16 08:11:57 +0200kayprish(~kayprish@46.240.130.158)
2021-10-16 08:11:59 +0200kayprish(~kayprish@46.240.130.158) (Remote host closed the connection)
2021-10-16 08:12:55 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2021-10-16 08:15:14 +0200Maxdamantus(~Maxdamant@user/maxdamantus) (Quit: Lost terminal)
2021-10-16 08:15:41 +0200Maxdamantus(~Maxdamant@user/maxdamantus)
2021-10-16 08:16:03 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
2021-10-16 08:16:14 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Client Quit)
2021-10-16 08:16:17 +0200xiongxin(~quassel@113.116.224.79) (Ping timeout: 265 seconds)
2021-10-16 08:16:27 +0200xiongxin_(~quassel@113.116.33.28)
2021-10-16 08:16:47 +0200 <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.
2021-10-16 08:17:20 +0200nitrix(~nitrix@user/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
2021-10-16 08:18:24 +0200 <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.
2021-10-16 08:18:55 +0200 <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
2021-10-16 08:18:58 +0200 <dolio> Because the points `f : 1 → B^A` are computable.
2021-10-16 08:19:14 +0200skinods
2021-10-16 08:21:36 +0200 <dolio> I guess 1 is probably not a "separator".
2021-10-16 08:24:03 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 08:24:03 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 08:24:03 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 08:24:03 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-10-16 08:24:14 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
2021-10-16 08:24:19 +0200MQ-17J(~MQ-17J@8.21.10.20)
2021-10-16 08:27:52 +0200Maxdamantus(~Maxdamant@user/maxdamantus) (Read error: error:1408F10B:SSL routines:ssl3_get_record:wrong version number)
2021-10-16 08:28:55 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-16 08:29:08 +0200Maxdamantus(~Maxdamant@user/maxdamantus)
2021-10-16 08:30:22 +0200 <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 ?
2021-10-16 08:30:34 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 08:31:18 +0200 <dolio> Hmm. Maybe.
2021-10-16 08:32:42 +0200 <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)
2021-10-16 08:33:31 +0200 <dolio> Are you talking about this? https://www.youtube.com/watch?v=XqywV-wkKSE
2021-10-16 08:34:02 +0200 <ski> hm, that might've been it !
2021-10-16 08:35:00 +0200enicar(~enikar@user/enikar) (Quit: WeeChat 2.8)
2021-10-16 08:36:00 +0200enikar(~enikar@user/enikar)
2021-10-16 08:38:09 +0200fvr(uid503686@id-503686.uxbridge.irccloud.com)
2021-10-16 08:45:18 +0200nitrix(~nitrix@user/nitrix)
2021-10-16 08:46:48 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 08:48:10 +0200slowtyper(~slowtyper@user/slowtyper) (Ping timeout: 252 seconds)
2021-10-16 08:48:15 +0200slowtype-(~slowtyper@46.12.91.253.dsl.dyn.forthnet.gr)
2021-10-16 08:51:23 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
2021-10-16 08:53:01 +0200euandreh(~euandreh@2804:14c:33:9fe5:11fc:225b:3e1b:f83b) (Ping timeout: 245 seconds)
2021-10-16 08:54:12 +0200euandreh(~euandreh@2804:14c:33:9fe5:8d5f:78c6:cd1:4a9b)
2021-10-16 08:57:29 +0200 <hololeap> @hoogle (e -> m a) -> ExceptT e m a -> m a
2021-10-16 08:57:30 +0200 <lambdabot> No results found
2021-10-16 08:59:49 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
2021-10-16 09:01:13 +0200 <ski> @type \h e -> either h return =<< runExceptT e
2021-10-16 09:01:14 +0200 <lambdabot> Monad m => (a -> m b) -> ExceptT a m b -> m b
2021-10-16 09:04:48 +0200 <hololeap> % :t \f -> either f pure <=< runExceptT
2021-10-16 09:04:49 +0200 <yahb> hololeap: Monad m => (a -> m c) -> ExceptT a m c -> m c
2021-10-16 09:05:13 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-10-16 09:05:19 +0200 <hololeap> yeah, i'm a little surprised this isn't in the ExceptT module
2021-10-16 09:07:42 +0200 <ski> @hoogle (e -> m b) -> (a -> m b) -> (ExceptT e m a -> m b)
2021-10-16 09:07:43 +0200 <lambdabot> Control.Error.Util exceptT :: Monad m => (a -> m c) -> (b -> m c) -> ExceptT a m b -> m c
2021-10-16 09:08:04 +0200 <ski> @hoogle Exception e => (e -> IO b) -> (a -> IO b) -> (IO a -> IO b)
2021-10-16 09:08:05 +0200 <lambdabot> No results found
2021-10-16 09:09:16 +0200gehmehgeh(~user@user/gehmehgeh)
2021-10-16 09:09:31 +0200falafel(~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com)
2021-10-16 09:11:22 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 09:11:29 +0200max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
2021-10-16 09:16:13 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-10-16 09:27:26 +0200hnOsmium0001(uid453710@hampstead.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-16 09:36:13 +0200kuribas(~user@ptr-25vy0ial9ts1i2t1r9b.18120a2.ip6.access.telenet.be)
2021-10-16 09:39:13 +0200wonko(~wjc@62.115.229.50)
2021-10-16 09:43:58 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 09:46:21 +0200cfricke(~cfricke@user/cfricke)
2021-10-16 09:49:29 +0200mbuf(~Shakthi@122.173.255.77)
2021-10-16 09:49:52 +0200 <tomsmeding> maerwald: I made some bad drawings https://tomsmeding.com/f/ghcup-logo/index.html
2021-10-16 09:50:02 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2021-10-16 09:53:55 +0200 <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.
2021-10-16 09:54:06 +0200 <kuribas> It also looks hard to make robust and type safe.
2021-10-16 09:54:14 +0200arjun(~user@user/arjun)
2021-10-16 09:54:59 +0200 <kuribas> Because if you want to be type-safe, those datastructures need to describe the types as well as the logic.
2021-10-16 09:58:11 +0200stengah(~stengah@user/stengah)
2021-10-16 09:58:39 +0200 <kuribas> I suppose you need GADTs then.
2021-10-16 10:00:14 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-16 10:04:04 +0200 <tomsmeding> kuribas: the predicate "can model this real-world concept in the Haskell type system" has some very non-intuitive structure
2021-10-16 10:04:34 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 252 seconds)
2021-10-16 10:04:34 +0200 <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
2021-10-16 10:04:59 +0200 <kuribas> But what if you try to push as much as possible in value level?
2021-10-16 10:05:11 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Ping timeout: 264 seconds)
2021-10-16 10:05:24 +0200 <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
2021-10-16 10:05:55 +0200bitmapper(uid464869@lymington.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-16 10:06:03 +0200 <tomsmeding> like, only simple type tags, preferably no type variables of kind other than Type
2021-10-16 10:06:27 +0200 <kuribas> For example, using higher kinded types to map the meta information to actual runtime information.
2021-10-16 10:06:31 +0200hendursa1(~weechat@user/hendursaga)
2021-10-16 10:06:50 +0200 <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
2021-10-16 10:07:26 +0200 <tomsmeding> but this is philosophising, I think you can't say anything much more concrete without having a case in front of you
2021-10-16 10:07:55 +0200 <tomsmeding> kuribas: that sounds cool but I frankly have no idea what you mean with that, concretely :p
2021-10-16 10:07:56 +0200 <kuribas> for example: describing a data model declaratively, then generating queries to fetch the model from the database.
2021-10-16 10:08:03 +0200LiaoTao(~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection)
2021-10-16 10:08:05 +0200 <tomsmeding> hm
2021-10-16 10:08:18 +0200 <kuribas> Assuming the data model has pointers to which tables are relevant etc...
2021-10-16 10:08:24 +0200LiaoTao(~LiaoTao@gateway/tor-sasl/liaotao)
2021-10-16 10:08:27 +0200 <tomsmeding> that sounds quite possible
2021-10-16 10:08:39 +0200 <kuribas> But the question is of course, does this have an advantage over simply making a separate module with curstom queries.
2021-10-16 10:08:56 +0200 <tomsmeding> also sounds like the type-indexedness of GADTs only helps for correctness here; plain ADTs would work fine if all programmers are diligent
2021-10-16 10:09:12 +0200hendursaga(~weechat@user/hendursaga) (Ping timeout: 276 seconds)
2021-10-16 10:09:14 +0200 <tomsmeding> (which is a precarious assumption :p )
2021-10-16 10:10:09 +0200 <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
2021-10-16 10:10:26 +0200 <kuribas> indeed
2021-10-16 10:11:04 +0200 <kuribas> And I find the ability to compose queries makes this not that painful.
2021-10-16 10:11:41 +0200 <kuribas> As you can extract common patterns, and make flexible queries corresponding to the requirements.
2021-10-16 10:12:24 +0200 <tomsmeding> I mean, don't get me wrong, not too long ago I willingly wrote and used a data type with 8 type parameters
2021-10-16 10:12:45 +0200 <kuribas> hehe
2021-10-16 10:13:22 +0200 <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/
2021-10-16 10:13:41 +0200 <tomsmeding> may or may not have been a bad use of my time
2021-10-16 10:13:54 +0200 <tomsmeding> kuribas: yes indeed
2021-10-16 10:14:17 +0200 <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
2021-10-16 10:14:50 +0200 <tomsmeding> the composability of the data-driven version is cool but ultimately more suited to more PL-theoretic environments like compilers, I think
2021-10-16 10:14:57 +0200 <tomsmeding> (which is :( )
2021-10-16 10:16:00 +0200 <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.
2021-10-16 10:18:09 +0200aegon(~mike@174.127.249.180) (Remote host closed the connection)
2021-10-16 10:21:47 +0200tzh(~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
2021-10-16 10:22:06 +0200_ht(~quassel@82-169-194-8.biz.kpn.net)
2021-10-16 10:24:52 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 10:24:52 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 10:24:52 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 10:25:58 +0200acidjnk(~acidjnk@p200300d0c703cb13982ae5e8635fcd4e.dip0.t-ipconnect.de)
2021-10-16 10:26:50 +0200nuh^(~nuh@70.166.66.234) (Remote host closed the connection)
2021-10-16 10:30:29 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 268 seconds)
2021-10-16 10:39:50 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
2021-10-16 10:40:39 +0200arjun(~user@user/arjun) (ERC (IRC client for Emacs 28.0.50))
2021-10-16 10:43:35 +0200stengah(~stengah@user/stengah) (Ping timeout: 264 seconds)
2021-10-16 10:43:35 +0200wonko(~wjc@62.115.229.50) (Ping timeout: 264 seconds)
2021-10-16 10:44:41 +0200jushur(~human@user/jushur)
2021-10-16 10:49:35 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
2021-10-16 10:53:44 +0200Arsen(~arsen@managarm/dev/Arsen) (Quit: Quit.)
2021-10-16 10:54:27 +0200Arsen(~arsen@managarm/dev/Arsen)
2021-10-16 10:56:51 +0200emliunix(~emliunix@101.88.126.148)
2021-10-16 11:00:23 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 11:00:59 +0200Tuplanolla(~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
2021-10-16 11:04:03 +0200hrnz(~ethical@vegan.im.it) (Quit: das ist mir zu bld hier; bb)
2021-10-16 11:04:18 +0200hrnz(~ethical@vegan.im.it)
2021-10-16 11:07:35 +0200falafel(~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com) (Ping timeout: 264 seconds)
2021-10-16 11:08:11 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 264 seconds)
2021-10-16 11:10:47 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 11:13:57 +0200fendor(~fendor@178.115.59.192.wireless.dyn.drei.com)
2021-10-16 11:14:33 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2021-10-16 11:21:03 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt)
2021-10-16 11:23:29 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 265 seconds)
2021-10-16 11:23:45 +0200stengah(~stengah@user/stengah)
2021-10-16 11:25:13 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 11:25:48 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Client Quit)
2021-10-16 11:29:13 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-16 11:35:20 +0200hendursa1(~weechat@user/hendursaga) (Remote host closed the connection)
2021-10-16 11:37:51 +0200Sgeo(~Sgeo@user/sgeo) (Read error: Connection reset by peer)
2021-10-16 11:38:49 +0200 <sm> what could explain this: an error call in my program can be caught, an error call in a lib can not be ?
2021-10-16 11:38:53 +0200smsent a haskell code block: https://libera.ems.host/_matrix/media/r0/download/libera.chat/ce943f8bb2ade3235929801a0bf419b437d7…
2021-10-16 11:39:31 +0200mc47(~mc47@xmonad/TheMC47)
2021-10-16 11:40:17 +0200 <sm> displaySize code: https://hub.darcs.net/ffaf/ansi-terminal-game/browse/src/Terminal/Game/Layer/Object/IO.hs#120
2021-10-16 11:40:37 +0200slowtype-(~slowtyper@46.12.91.253.dsl.dyn.forthnet.gr) (Quit: ZNC 1.8.2 - https://znc.in)
2021-10-16 11:40:53 +0200slowtyper(~slowtyper@user/slowtyper)
2021-10-16 11:42:15 +0200hendursa1(~weechat@user/hendursaga)
2021-10-16 11:42:29 +0200 <tomsmeding> sm: laziness
2021-10-16 11:42:41 +0200 <tomsmeding> displaySize returns a pair of thunks, one of which contains the error call
2021-10-16 11:42:52 +0200 <tomsmeding> evaluating the tuple is fine, and 'catch' only does WHNF
2021-10-16 11:43:06 +0200 <tomsmeding> 'print' then forces the error
2021-10-16 11:43:13 +0200 <tomsmeding> (or at least that's what I think is happening)
2021-10-16 11:43:39 +0200 <sm> urgh.. that makes sense, thank you
2021-10-16 11:44:00 +0200 <sm> stupid tuples..
2021-10-16 11:44:14 +0200 <tomsmeding> throwing an asynchronous exception when getting TERM fails is bad though IMO
2021-10-16 11:44:24 +0200 <tomsmeding> were it an IO exception, it would've been fine :p
2021-10-16 11:44:27 +0200o1lo01ol1o(~o1lo01ol1@bl13-86-242.dsl.telepac.pt) (Remote host closed the connection)
2021-10-16 11:44:37 +0200caef^(~caef@70.166.66.234)
2021-10-16 11:45:19 +0200 <stengah> hey guys new here
2021-10-16 11:45:30 +0200 <sm> agreed. An ErrorCall is not an IOException I guess.
2021-10-16 11:45:30 +0200 <stengah> I learned basics
2021-10-16 11:45:39 +0200 <stengah> how learn more?
2021-10-16 11:45:45 +0200 <stengah> how to learn more?
2021-10-16 11:46:00 +0200 <stengah> how to become pro like you guys?
2021-10-16 11:47:00 +0200smwonders how to force it to fully evaluate
2021-10-16 11:47:10 +0200 <tomsmeding> sm: the point with throwIO is that it's sequenced in the IO monad, so you're guaranteed to get the exception
2021-10-16 11:47:16 +0200 <oak-> Write some more code and solve practical real world problems :)
2021-10-16 11:47:24 +0200 <tomsmeding> sm: length (show result) `seq` restofyourcode
2021-10-16 11:48:41 +0200 <stengah> Also I don't need I understand monad
2021-10-16 11:49:00 +0200 <stengah> oak- : what practical real world problems you solved?
2021-10-16 11:49:10 +0200 <stengah> do you also know PL theory?
2021-10-16 11:50:05 +0200 <sm> tomsmeding: that's not quite it, but I'll get there
2021-10-16 11:50:41 +0200 <kuribas> stengah: how much do you know now? What is your goal?
2021-10-16 11:51:29 +0200 <stengah> My goal for now is to learn enough to write compilers
2021-10-16 11:51:35 +0200 <stengah> getting into PL theory
2021-10-16 11:51:50 +0200 <tomsmeding> sm: okay better guess: print =<< (displaySize >>= \sz -> length (show sz) `seq` return sz) `catch` \(_::SomeException) -> return (0,0)
2021-10-16 11:52:07 +0200 <tomsmeding> (clearly that length . show thing should be deepseq but less deps and stuff)
2021-10-16 11:52:25 +0200 <stengah> I've read the book by hutton
2021-10-16 11:52:31 +0200 <stengah> and gentle introduction to haskell
2021-10-16 11:52:48 +0200 <stengah> also wrote some small programs
2021-10-16 11:53:07 +0200hendursa1(~weechat@user/hendursaga) (Remote host closed the connection)
2021-10-16 11:53:33 +0200 <sm> tomsmeding: nice! thanks for the example
2021-10-16 11:53:51 +0200hendursa1(~weechat@user/hendursaga)
2021-10-16 12:00:31 +0200 <tomsmeding> stengah: what's "small programs"?
2021-10-16 12:03:23 +0200 <stengah> let's say code with less than 200 lines
2021-10-16 12:03:51 +0200xff0x(~xff0x@2001:1a81:5288:5c00:1568:382a:23d8:c3dd) (Ping timeout: 245 seconds)
2021-10-16 12:04:03 +0200 <stengah> programs that does nothing significant
2021-10-16 12:06:10 +0200 <stengah> or worthy
2021-10-16 12:06:30 +0200bluenode(~bluenode@cpc99576-brnt1-2-0-cust237.4-2.cable.virginm.net)
2021-10-16 12:06:37 +0200 <bluenode> hello folks
2021-10-16 12:06:52 +0200 <bluenode> simple question; why won't this compile?
2021-10-16 12:06:53 +0200 <bluenode> fullString = concat (intersperse " " ["hello","there","folks"])
2021-10-16 12:06:53 +0200 <bluenode> let toPrint = ["a", "da"]
2021-10-16 12:06:54 +0200 <bluenode> main = print toPrint
2021-10-16 12:07:25 +0200 <tomsmeding> stengah: written a mandelbrot renderer yet?
2021-10-16 12:07:36 +0200 <stengah> nope
2021-10-16 12:07:40 +0200 <tomsmeding> just writing ascii art to output is fine :p
2021-10-16 12:07:42 +0200 <tomsmeding> do that
2021-10-16 12:07:53 +0200 <tomsmeding> far less than 200 lines but always nice
2021-10-16 12:08:09 +0200hendursa1(~weechat@user/hendursaga) (Ping timeout: 276 seconds)
2021-10-16 12:08:18 +0200 <stengah> Okay
2021-10-16 12:08:38 +0200 <stengah> starting right now
2021-10-16 12:08:53 +0200hendursa1(~weechat@user/hendursaga)
2021-10-16 12:09:50 +0200 <tomsmeding> stengah: then write a calculator that takes input in https://en.wikipedia.org/wiki/Reverse_Polish_notation
2021-10-16 12:10:13 +0200 <tomsmeding> slightly more advanced is making that accept normal infix notation
2021-10-16 12:11:01 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 12:11:56 +0200 <stengah> ok
2021-10-16 12:12:04 +0200 <stengah> will do both
2021-10-16 12:12:27 +0200 <stengah> bluenode: try each line in ghci
2021-10-16 12:12:29 +0200pretty_dumm_guy(trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
2021-10-16 12:13:24 +0200 <sm> bluenode: if only we had some kind of automatic analysis tool.. :)
2021-10-16 12:13:30 +0200 <tomsmeding> stengah: also write interpreters for whatever language you like
2021-10-16 12:13:36 +0200 <tomsmeding> start with brainfuck perhaps
2021-10-16 12:14:09 +0200 <tomsmeding> then try to optimise the brainfuck before you execute it :p
2021-10-16 12:14:29 +0200 <stengah> and how do you understand monad?
2021-10-16 12:14:38 +0200 <bluenode> sm: if the compiler's error message was helpful then i wouldnt be asking here ;)
2021-10-16 12:14:41 +0200 <stengah> is there a particular way to look into it?
2021-10-16 12:14:43 +0200 <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?
2021-10-16 12:15:17 +0200 <tomsmeding> stengah: Monad is an abstraction that generalises _many_ different things. Most monad tutorials or descriptions give intuition for just one kind of monad.
2021-10-16 12:15:17 +0200 <stengah> main = do print toPrint
2021-10-16 12:15:20 +0200 <stengah> try this
2021-10-16 12:15:20 +0200 <xsperry> bluenode ghci (roughly) pretends to be in IO block, where let works
2021-10-16 12:15:32 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
2021-10-16 12:15:45 +0200 <tomsmeding> stengah: I understood it by not understanding it and then working with them too often
2021-10-16 12:15:54 +0200 <tomsmeding> also implement Monad instances for lots of types
2021-10-16 12:16:37 +0200 <stengah> tomsmeding: so you just get familiar with the laws
2021-10-16 12:16:53 +0200 <tomsmeding> yes, by playing with monads
2021-10-16 12:17:02 +0200slowtyper(~slowtyper@user/slowtyper) (Quit: ZNC 1.8.2 - https://znc.in)
2021-10-16 12:17:09 +0200 <sm> bluenode: I hear you. We can take a look.
2021-10-16 12:17:09 +0200 <sm> @where paste
2021-10-16 12:17:10 +0200 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
2021-10-16 12:17:10 +0200 <tomsmeding> not by reading a book (I never learned programming by reading from a book, but I know other people like to work differently)
2021-10-16 12:17:20 +0200slowtyper(~slowtyper@user/slowtyper)
2021-10-16 12:17:30 +0200 <stengah> I've read lots of books
2021-10-16 12:17:48 +0200 <sm> (but I guess you figured it out)
2021-10-16 12:17:51 +0200 <tomsmeding> stengah: which means you need to get writing instead of reading :)
2021-10-16 12:17:52 +0200 <stengah> but always found myself stuck when doing thinhs
2021-10-16 12:18:06 +0200 <tomsmeding> stengah: which means that you haven't been doing things often enough ;)
2021-10-16 12:18:07 +0200 <stengah> s/thinhs/code
2021-10-16 12:18:13 +0200 <stengah> yeah!
2021-10-16 12:18:16 +0200 <tomsmeding> so do more things!
2021-10-16 12:18:42 +0200 <stengah> I shall do things from now on :)
2021-10-16 12:18:50 +0200 <tomsmeding> (sounds like I'm making a joke now but I really am not, practice makes perfect, especially in haskell)
2021-10-16 12:20:25 +0200 <sm> +1
2021-10-16 12:21:15 +0200 <stengah> I am going to do things
2021-10-16 12:21:18 +0200 <stengah> starting now
2021-10-16 12:21:26 +0200 <stengah> brb
2021-10-16 12:21:27 +0200 <sm> be warned, it can also make you crazy. There sure is a lot to trip you up in haskell.
2021-10-16 12:21:34 +0200 <bluenode> can confirm.
2021-10-16 12:22:02 +0200smwas going along fine for ages and suddenly it's dragons at every turn
2021-10-16 12:23:30 +0200 <stengah> I have you guys for that.
2021-10-16 12:23:43 +0200 <stengah> those who came before me
2021-10-16 12:23:46 +0200 <stengah> :)
2021-10-16 12:24:40 +0200 <bluenode> i find writing basic scripts to be more practical than ghci to help me learn haskell
2021-10-16 12:24:57 +0200 <maerwald> tomsmeding: do you think so?
2021-10-16 12:25:03 +0200 <maerwald> I'm not sure actually
2021-10-16 12:25:33 +0200 <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?
2021-10-16 12:25:52 +0200 <maerwald> debugger? :D
2021-10-16 12:29:13 +0200ubert(~Thunderbi@178.165.199.151.wireless.dyn.drei.com)
2021-10-16 12:29:18 +0200 <tomsmeding> maerwald: that practice is especially important with haskell you mean?
2021-10-16 12:29:41 +0200jacks2(~bc8165b6@199.204.85.195)
2021-10-16 12:29:47 +0200 <tomsmeding> I'm saying that mostly in contrast with learning something new in the imperative world if you know a bit of imperative programming
2021-10-16 12:29:58 +0200 <tomsmeding> you're not going to get the functional programming mindset without _doing_ it
2021-10-16 12:30:12 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.)
2021-10-16 12:30:18 +0200 <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
2021-10-16 12:30:32 +0200 <tomsmeding> you do have a point there
2021-10-16 12:30:40 +0200 <maerwald> so I think it's more exposure to other programmers
2021-10-16 12:30:41 +0200 <tomsmeding> but to get there you need to have done practice already
2021-10-16 12:30:43 +0200 <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 ?
2021-10-16 12:31:00 +0200 <tomsmeding> maerwald: OP said that they'd read two (!) books on haskell and written some <200 line programs
2021-10-16 12:31:08 +0200 <tomsmeding> to me that sounds like an off-balance scale
2021-10-16 12:31:22 +0200 <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
2021-10-16 12:31:24 +0200 <tomsmeding> once you've righted that balance, you can start thinking about learning more good things
2021-10-16 12:31:25 +0200o1lo01ol1o(~o1lo01ol1@107.127.31.33)
2021-10-16 12:31:48 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2021-10-16 12:32:02 +0200 <maerwald> practice just makes you faster/more efficient in what you naturally are good at
2021-10-16 12:32:10 +0200DNH(~DNH@2a02:8108:1100:16d8:11c6:13b4:148f:aabf)
2021-10-16 12:32:21 +0200 <tomsmeding> and you need some baseline of efficiency in order to effectively build on the knowledge
2021-10-16 12:32:34 +0200 <tomsmeding> you're right that practice won't make perfect, that was the wrong phrase perhaps
2021-10-16 12:32:53 +0200 <tomsmeding> but with too little practice you're not going to get good either
2021-10-16 12:34:11 +0200 <bluenode> speaking of which
2021-10-16 12:34:13 +0200 <jacks2> where theme is something like this: withTheme theme action = do setTheme and update global reference..; check for nested calls; `finally` restore default theme
2021-10-16 12:34:14 +0200 <bluenode> why won't this compile
2021-10-16 12:34:17 +0200 <bluenode> myList = ["foo", "bar"]
2021-10-16 12:34:17 +0200 <bluenode> "hello" : myList
2021-10-16 12:34:26 +0200 <jacks2> +call action
2021-10-16 12:34:28 +0200 <bluenode> (in a script, not in ghci)
2021-10-16 12:35:06 +0200xiongxin_(~quassel@113.116.33.28) (Ping timeout: 245 seconds)
2021-10-16 12:35:07 +0200 <xsperry> : is wrong syntax for that. you already defined myList in previous line, type was inferred, and you can't change it
2021-10-16 12:35:41 +0200 <bluenode> xsperry: ok so how am i supposed to do it?
2021-10-16 12:36:16 +0200 <bluenode> and why is it wrong syntax if it's in the docs https://wiki.haskell.org/How_to_work_on_lists
2021-10-16 12:36:19 +0200xff0x(~xff0x@2001:1a81:5288:5c00:1568:382a:23d8:c3dd)
2021-10-16 12:36:26 +0200 <xsperry> myList = ["foo", "bar"] :: [Type]
2021-10-16 12:36:50 +0200 <xsperry> oh, you are using (:)
2021-10-16 12:37:05 +0200 <xsperry> see the type of (:)
2021-10-16 12:37:14 +0200 <xsperry> :t (:)
2021-10-16 12:37:16 +0200 <lambdabot> a -> [a] -> [a]
2021-10-16 12:37:22 +0200chexum(~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection)
2021-10-16 12:37:41 +0200chexum(~quassel@gateway/tor-sasl/chexum)
2021-10-16 12:37:48 +0200 <xsperry> what is the type of myList?
2021-10-16 12:38:07 +0200 <bluenode> [String]
2021-10-16 12:38:21 +0200 <xsperry> that doesn't type check. first argument is a, second [a]
2021-10-16 12:38:39 +0200 <bluenode> why does it work on ghci??
2021-10-16 12:38:46 +0200 <stengah> tomsmeding: I never thought about balance between reading books and _doing_ it
2021-10-16 12:38:47 +0200 <xsperry> I doubt it does
2021-10-16 12:39:09 +0200 <stengah> I thank you for pointing me.
2021-10-16 12:39:10 +0200 <bluenode> xsperry: it does, try it for yourself
2021-10-16 12:39:28 +0200 <jacks2> bluenode what is the error
2021-10-16 12:39:44 +0200 <bluenode> jacks2: Parse error: module header, import declaration or top-level declaration expected.typecheck
2021-10-16 12:40:01 +0200 <jacks2> you can't put arbitrary code at top level
2021-10-16 12:40:38 +0200 <phaazon> I realize that the problem I tried to fix yesterday is probably unsound, but I would like to be sure
2021-10-16 12:40:40 +0200 <jacks2> top-level = outside of functions
2021-10-16 12:41:04 +0200 <bluenode> jacks2: but i can do plenty of things at the top-level; i can define that list, print elements in it, etc.
2021-10-16 12:41:34 +0200 <jacks2> but you can't do naked "hello" : mylist
2021-10-16 12:41:46 +0200 <jacks2> what would that even accomplish
2021-10-16 12:42:05 +0200 <bluenode> i am just trying to append a new element to a list
2021-10-16 12:42:24 +0200 <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"
2021-10-16 12:42:32 +0200 <jacks2> so assign it to a top-level variable
2021-10-16 12:42:47 +0200 <bluenode> so lists are immutable in scripts but NOT in ghci?
2021-10-16 12:42:47 +0200 <tomsmeding> writing '"hello" : myList' is like writing '1 + 2' -- it doesn't actually modify anything, it just computes a value
2021-10-16 12:42:49 +0200 <jacks2> newList = "hello" : myList
2021-10-16 12:43:01 +0200 <tomsmeding> bluenode: lists are also immutable in ghci
2021-10-16 12:43:13 +0200 <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;
2021-10-16 12:43:15 +0200 <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
2021-10-16 12:43:16 +0200 <bluenode> tomsmedding: why does this work:
2021-10-16 12:43:17 +0200 <bluenode> Prelude> myList = ["foo", "bar"]
2021-10-16 12:43:17 +0200 <bluenode> Prelude> "hello" : myList
2021-10-16 12:43:18 +0200 <bluenode> ["hello","foo","bar"]
2021-10-16 12:43:23 +0200 <jacks2> yes (:) doesn't mutate original list. there's no way to mutate it
2021-10-16 12:43:25 +0200 <tomsmeding> > 1 + 2
2021-10-16 12:43:26 +0200 <lambdabot> 3
2021-10-16 12:43:33 +0200 <tomsmeding> bluenode: evaluating an expression gives a value :)
2021-10-16 12:43:39 +0200 <phaazon> I guess the thing I want is really a rank-N constraint but I have no idea how to do that
2021-10-16 12:43:41 +0200 <tomsmeding> bluenode: try typing "myList" after that
2021-10-16 12:43:44 +0200 <tomsmeding> it didn't change
2021-10-16 12:44:59 +0200 <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) => …
2021-10-16 12:45:10 +0200 <phaazon> I want foo :: ExistsBackend b => …
2021-10-16 12:45:36 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 12:46:10 +0200 <bluenode> tomsmeding jacks2: so to the expression result being unused produces a "import declaration or top-level declaration expected" error.
2021-10-16 12:46:18 +0200 <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?
2021-10-16 12:46:22 +0200 <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
2021-10-16 12:46:34 +0200 <kuribas> phaazon: can't you use a type family?
2021-10-16 12:46:40 +0200 <phaazon> tomsmeding: the user code, mainly
2021-10-16 12:46:43 +0200 <tomsmeding> bluenode: because writing an expression that does nothing at the top level is useless, haskell disallows it
2021-10-16 12:46:46 +0200 <phaazon> it’s like « this backend can do that with this T »
2021-10-16 12:46:47 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
2021-10-16 12:47:04 +0200 <phaazon> imagine like the backend is a database, and the second variable is whether it knows how to handle a given type row
2021-10-16 12:47:17 +0200 <bluenode> tomsmeding: i get it now. but you gotta admit that the compilation error message was misleading
2021-10-16 12:47:18 +0200 <jacks2> bluenode, result being unused it not a problem, using code that isn't valid at top-level, at top-level, is
2021-10-16 12:47:20 +0200 <phaazon> I « could » move that to the abstraction, but then all backends would be required to implement all the same types
2021-10-16 12:47:25 +0200pavonia(~user@user/siracusa) (Quit: Bye!)
2021-10-16 12:47:27 +0200 <phaazon> so it would mean leveling by the bottom, or having runtime checks
2021-10-16 12:47:29 +0200 <sm> bluenode: printing things as you go is helpful, and especially master Debug.Trace
2021-10-16 12:47:30 +0200 <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
2021-10-16 12:47:34 +0200 <phaazon> kuribas: I tried with that, I failed
2021-10-16 12:47:54 +0200 <phaazon> tomsmeding: I showed example where you have several values
2021-10-16 12:47:54 +0200 <tomsmeding> if the caller of 'foo' needs to decide, they need a way to express their decision
2021-10-16 12:48:05 +0200 <phaazon> i.e. this:
2021-10-16 12:48:15 +0200 <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) => …
2021-10-16 12:48:33 +0200 <phaazon> maybe that problem is unsound and there is no solution
2021-10-16 12:48:38 +0200 <tomsmeding> 'foo :: forall t b. Backend b t => ...'; then use 'foo @Int' or 'foo @Bool' in user code?
2021-10-16 12:48:47 +0200 <phaazon> I thought QuantifiedConstrain was a solution but awpr showed me yesterday it won’t work
2021-10-16 12:48:56 +0200 <phaazon> QuantifiedConstraint*
2021-10-16 12:48:56 +0200 <tomsmeding> (not sure if this solves your problem, but the reason why it doesn't helps me understand what the problem is)
2021-10-16 12:49:12 +0200 <tomsmeding> also yeah you can have '(forall t. Backend b t) =>', but that's forall, not exists
2021-10-16 12:49:25 +0200 <phaazon> yeah, that’s QuantifiedConstraint, it won’t help
2021-10-16 12:49:30 +0200 <phaazon> maybe the problem is that I’m designing this wrong
2021-10-16 12:50:08 +0200 <kuribas> phaazon: I find it hard to understand what you are solving?
2021-10-16 12:50:10 +0200 <jacks2> bluenode, what is legal at top-level: imports, type and value declarations, module clause, pragmas
2021-10-16 12:50:15 +0200 <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)
2021-10-16 12:50:19 +0200 <kuribas> phaazon: maybe some example code could be helpful.
2021-10-16 12:50:45 +0200 <phaazon> I have this as a Rust example, if you want
2021-10-16 12:51:04 +0200 <phaazon> I thought that if I can’t solve that in Haskell, I won’t be able to solve it in Rust :D
2021-10-16 12:51:45 +0200 <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
2021-10-16 12:52:05 +0200 <phaazon> when the user wants to abstract other the backends, they can’t assume the backend implements the types they want
2021-10-16 12:52:26 +0200 <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.
2021-10-16 12:52:40 +0200 <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)
2021-10-16 12:53:10 +0200 <kuribas> phaazon: so you want to move the supported types somewhere else?
2021-10-16 12:53:14 +0200 <tomsmeding> oh wait you want ghc to infer the necessary Int/Bool values automatically?
2021-10-16 12:53:15 +0200 <phaazon> tomsmeding: there’s no fundep between b and t
2021-10-16 12:53:19 +0200 <phaazon> kuribas: yes
2021-10-16 12:53:22 +0200 <phaazon> I want them to be rank-N
2021-10-16 12:53:26 +0200 <phaazon> tomsmeding: yes
2021-10-16 12:53:33 +0200 <tomsmeding> ghc won't do that
2021-10-16 12:53:38 +0200 <tomsmeding> at least, not with this setup
2021-10-16 12:54:01 +0200 <tomsmeding> if you want to let ghc do type inference, you should just not give the function a type signature
2021-10-16 12:54:06 +0200 <tomsmeding> otherwise it won't
2021-10-16 12:54:07 +0200 <phaazon> instead of (Backend b Int, Backend b Bool), I want (exists t. Backend b t) => UniversalBackend b
2021-10-16 12:54:12 +0200 <phaazon> something like that
2021-10-16 12:54:37 +0200 <tomsmeding> where ghc decides, based on the function body of 'foo', what the constraints of 'foo' need to actually be?
2021-10-16 12:54:48 +0200 <phaazon> argh, I thought it was somehow possible to introduce that kind of existential quantification
2021-10-16 12:54:57 +0200 <phaazon> tomsmeding: it has to look at the content
2021-10-16 12:55:01 +0200 <phaazon> a bit like what you would do with rank-2
2021-10-16 12:55:02 +0200 <kuribas> phaazon: those constraints look very reasonable to me.
2021-10-16 12:55:06 +0200 <tomsmeding> the content of _what_ exactly?
2021-10-16 12:55:13 +0200 <tomsmeding> of an argument? of foo?
2021-10-16 12:55:15 +0200 <phaazon> tomsmeding: the right side of the expression
2021-10-16 12:55:21 +0200 <tomsmeding> right
2021-10-16 12:55:22 +0200 <phaazon> i.e. where you use « b »
2021-10-16 12:55:23 +0200 <tomsmeding> that's impossible
2021-10-16 12:55:25 +0200 <phaazon> like in rank-2
2021-10-16 12:55:27 +0200 <phaazon> oh :(
2021-10-16 12:55:33 +0200 <tomsmeding> rank-2 is something differnt
2021-10-16 12:55:34 +0200 <kuribas> phaazon: rank-N is a forall right? But in your case you want to limit the types.
2021-10-16 12:55:47 +0200 <phaazon> it’s not that different to me
2021-10-16 12:55:50 +0200 <tomsmeding> rank-2 is allowing a polymorphic function as argument to a function
2021-10-16 12:55:59 +0200 <tomsmeding> (an _explicitly_ polymorphic one)
2021-10-16 12:56:11 +0200 <kuribas> phaazon: also, rank-N is not inferred.
2021-10-16 12:56:38 +0200 <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
2021-10-16 12:56:46 +0200 <tomsmeding> it's like foo :: (forall t. Backend b t) => ...
2021-10-16 12:56:47 +0200 <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
2021-10-16 12:56:57 +0200 <phaazon> so I thought it would be possible to do the same with type inference on the constraints
2021-10-16 12:57:13 +0200 <phaazon> that sentence wasn’t very English, I hope you got what I meant :D
2021-10-16 12:57:17 +0200 <tomsmeding> you can write something like that using rank-N types and quantifiedconstraints, but ghc won't _infer_ it
2021-10-16 12:57:23 +0200 <kuribas> phaazon: or do you want to have a set of types which are supported by all backends?
2021-10-16 12:57:39 +0200 <tomsmeding> s/something like that/precisely that
2021-10-16 12:57:39 +0200 <phaazon> kuribas: so that’s the « leveling by the bottom » thing
2021-10-16 12:57:39 +0200 <kuribas> phaazon: you could use a constraint type synonym.
2021-10-16 12:57:42 +0200 <phaazon> and no, I don’t want that
2021-10-16 12:57:48 +0200 <phaazon> right now, this is what it looks like in real code:
2021-10-16 12:58:19 +0200 <phaazon> https://github.com/phaazon/luminance-rs/blob/master/examples/common/src/polymorphic_hello_world.rs…
2021-10-16 12:58:30 +0200 <phaazon> (it’s Rust, but you should be able to see the problem quickly even without knowing Rust :D)
2021-10-16 12:58:51 +0200 <phaazon> for every usage in the user client, I need to add another constraint here
2021-10-16 12:58:54 +0200 <phaazon> it’s… really annoying
2021-10-16 12:58:57 +0200 <tomsmeding> well that trick you can do with type classes too
2021-10-16 12:58:59 +0200 <phaazon> hence why I wanted some kind of rank-N
2021-10-16 12:59:13 +0200 <phaazon> tomsmeding: what do you mean?
2021-10-16 12:59:21 +0200 <tomsmeding> rank-N gives you more freedom in specifying types and constraints; it doesn't do anything with ghc's inference
2021-10-16 12:59:28 +0200 <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
2021-10-16 12:59:47 +0200 <phaazon> I don’t want to restrict all backends to implement the same types
2021-10-16 12:59:50 +0200 <phaazon> it would be obviously easier
2021-10-16 13:00:04 +0200 <phaazon> but it would have huge impcat
2021-10-16 13:00:06 +0200 <tomsmeding> class (Pipeline Dim2 a, RenderGate a, TessBackend () () () Interleaved a, ...) => Luminance a; instance (Pipeline Dim2 a, RenderGate a, TessBackend () () () Interleaved a, ...) => Luminance a
2021-10-16 13:00:14 +0200 <tomsmeding> now Luminance is a synonym of those things
2021-10-16 13:00:18 +0200 <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.
2021-10-16 13:00:23 +0200 <tomsmeding> which is what you're doing here in rust, right?
2021-10-16 13:00:29 +0200 <phaazon> tomsmeding: that’s what I do in Rust too
2021-10-16 13:00:35 +0200 <phaazon> but I still need to annotate the « user » types here
2021-10-16 13:00:37 +0200 <phaazon> so that’s not universal
2021-10-16 13:00:42 +0200 <phaazon> yes it is
2021-10-16 13:00:42 +0200 <tomsmeding> yeah I was saying, you can do this same thing with type classes :p
2021-10-16 13:00:45 +0200 <tomsmeding> doesn't solve anything yet
2021-10-16 13:00:51 +0200 <phaazon> https://github.com/phaazon/luminance-rs/blob/master/examples/common/src/polymorphic_hello_world.rs… here
2021-10-16 13:01:30 +0200 <tomsmeding> you'll have to manually annotate what second-type-parameter-of-Backend's the function 'foo' requires
2021-10-16 13:01:39 +0200 <phaazon> so there is no solution to this problem :(
2021-10-16 13:02:00 +0200 <tomsmeding> as I understand it, not really no
2021-10-16 13:02:07 +0200 <kuribas> phaazon: the type has to have all the constraints of the function.
2021-10-16 13:02:10 +0200 <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
2021-10-16 13:02:24 +0200 <tomsmeding> but what is the _problem_? That you don't want to write out all the constraints because verbosity?
2021-10-16 13:02:29 +0200 <tomsmeding> like, I accept that as a problem :p
2021-10-16 13:02:34 +0200 <phaazon> tomsmeding: yes
2021-10-16 13:02:39 +0200 <phaazon> that’s the problem
2021-10-16 13:02:47 +0200 <kuribas> phaazon: make a big constraint type synonym with common constraints?
2021-10-16 13:02:56 +0200 <phaazon> that’s not possible
2021-10-16 13:02:58 +0200 <tomsmeding> AFAIK that's impossible to solve in this particular case
2021-10-16 13:03:04 +0200 <phaazon> for instance, in the example I showed, Vertex is a user type
2021-10-16 13:03:04 +0200 <Franciman> hi phaazon long time no see
2021-10-16 13:03:06 +0200 <tomsmeding> aside from kuribas's last suggestion right now
2021-10-16 13:03:08 +0200 <Franciman> everything alright?
2021-10-16 13:03:09 +0200 <phaazon> and there is no « default Vertex »
2021-10-16 13:03:23 +0200 <phaazon> hi Franciman! yeah I’ve been lurking here for ~10 years :D
2021-10-16 13:03:27 +0200 <phaazon> yeah all good, what about you?
2021-10-16 13:03:34 +0200 <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
2021-10-16 13:03:56 +0200Hanicef(~gustaf@81-229-9-108-no92.tbcn.telia.com)
2021-10-16 13:03:57 +0200 <phaazon> tomsmeding: kuribas yeah, thanks for your hindsight, it’s been two days I’ve been trying to find a solution
2021-10-16 13:04:05 +0200 <phaazon> I found « one » but then I can’t write the instances
2021-10-16 13:04:08 +0200 <phaazon> so it’s not usable
2021-10-16 13:04:09 +0200 <bluenode> jacks2: (y) i didnt know about that channel, ill go lurk there
2021-10-16 13:05:01 +0200xiongxin(~quassel@113.116.32.200)
2021-10-16 13:06:12 +0200 <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)"
2021-10-16 13:06:14 +0200 <tomsmeding> if that helps
2021-10-16 13:07:01 +0200 <phaazon> well I thought about that but it’s a lot of work for no real improvement
2021-10-16 13:07:15 +0200 <phaazon> I thought ghc could find a way to infer the constraint for me
2021-10-16 13:07:19 +0200 <phaazon> given the user code
2021-10-16 13:07:29 +0200 <tomsmeding> it can, right? if you don't give a type signature
2021-10-16 13:07:30 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Quit: Laa shay'a waqi'un moutlaq bale kouloun moumkine)
2021-10-16 13:08:02 +0200 <kuribas> phaazon: haskell is often verbose on the type level, that's just how it is.
2021-10-16 13:08:09 +0200 <kuribas> phaazon: type synonyms can often help there.
2021-10-16 13:08:23 +0200 <phaazon> sure, the problem is the same in Rust
2021-10-16 13:08:35 +0200 <phaazon> my « super trait » allows to use SuperTrait instead of the whole list of constraints
2021-10-16 13:08:40 +0200 <phaazon> but yet, if the user adds a new usage
2021-10-16 13:08:44 +0200 <phaazon> like with a new Vertex type for instance
2021-10-16 13:08:49 +0200 <phaazon> they will have to add another constraint to the list
2021-10-16 13:08:59 +0200 <kuribas> phaazon: the user can make his own type synonym.
2021-10-16 13:09:11 +0200 <phaazon> yes, which is currently what people do if they require polymorphic code
2021-10-16 13:09:16 +0200 <phaazon> and they complained about that
2021-10-16 13:09:34 +0200 <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
2021-10-16 13:10:14 +0200 <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…
2021-10-16 13:10:21 +0200 <phaazon> for this last use case, there is no issue
2021-10-16 13:10:36 +0200 <phaazon> but for the case where people want the backend explicitely stated as a type variable…
2021-10-16 13:10:38 +0200 <phaazon> :(
2021-10-16 13:10:42 +0200 <kuribas> phaazon: or... you could not track the backend in the type system, and just throw an exception.
2021-10-16 13:10:47 +0200frosky(~froskyarr@66.90.88.140)
2021-10-16 13:10:54 +0200 <phaazon> how do you track it?
2021-10-16 13:10:56 +0200 <phaazon> at runtime?
2021-10-16 13:11:14 +0200 <kuribas> yes
2021-10-16 13:11:23 +0200 <phaazon> that’s not okay to me, the whole purpose of all of this is to make it safer at compile-time
2021-10-16 13:11:25 +0200 <kuribas> then the backend is just a record of maybe functions.
2021-10-16 13:11:36 +0200 <phaazon> yeah, nah :D
2021-10-16 13:11:37 +0200benin(~benin@183.82.25.86)
2021-10-16 13:11:43 +0200frosky(~froskyarr@66.90.88.140) (Client Quit)
2021-10-16 13:11:50 +0200o1lo01ol1o(~o1lo01ol1@107.127.31.33) (Ping timeout: 268 seconds)
2021-10-16 13:11:51 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2021-10-16 13:11:58 +0200 <kuribas> phaazon: or group the functionality in features.
2021-10-16 13:12:10 +0200 <kuribas> you cannot have type-safety and not tracking stuff in types.
2021-10-16 13:12:13 +0200 <phaazon> maybe I will end up forcing backends to implement the same types
2021-10-16 13:12:16 +0200frosky(~froskyarr@66.90.88.140)
2021-10-16 13:12:18 +0200 <phaazon> and « whatever » :
2021-10-16 13:12:20 +0200 <phaazon> :D
2021-10-16 13:12:39 +0200 <phaazon> kuribas: oh it would be tracked, but at the expression level, not at the head level
2021-10-16 13:12:43 +0200 <phaazon> I guess I’m dreaming
2021-10-16 13:13:12 +0200 <kuribas> phaazon: if you want *proof* that the backend supports it, it means you track at type level.
2021-10-16 13:13:58 +0200 <phaazon> yeah, hence why I have so many constraints right now :D
2021-10-16 13:14:53 +0200 <kuribas> group the constraints in features, then there has to be only a constraint per feature.
2021-10-16 13:14:58 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2021-10-16 13:16:21 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 245 seconds)
2021-10-16 13:16:22 +0200Lord_of_Life_Lord_of_Life
2021-10-16 13:16:25 +0200 <phaazon> I don’t see how it’s doable
2021-10-16 13:17:19 +0200 <phaazon> thanks for the hindsight :) maybe I will end up restricting types in the user package and pray for no backend supporting more :D
2021-10-16 13:17:53 +0200 <kuribas> Or at least, make some feature mandatory, then there don't have to be constraints for those.
2021-10-16 13:18:20 +0200cfricke(~cfricke@user/cfricke) (Quit: WeeChat 3.3)
2021-10-16 13:20:11 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
2021-10-16 13:20:11 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
2021-10-16 13:22:30 +0200Lord_of_Life_(~Lord@user/lord-of-life/x-2819915)
2021-10-16 13:23:07 +0200 <kuribas> phaazon: so only constraints for features that are possibly not supported by the backend.
2021-10-16 13:23:11 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds)
2021-10-16 13:24:03 +0200bluenode(~bluenode@cpc99576-brnt1-2-0-cust237.4-2.cable.virginm.net) (Quit: Client closed)
2021-10-16 13:25:00 +0200xiongxin(~quassel@113.116.32.200) (Ping timeout: 268 seconds)
2021-10-16 13:25:20 +0200Lord_of_Life_Lord_of_Life
2021-10-16 13:26:50 +0200xiongxin(~quassel@113.116.224.79)
2021-10-16 13:29:23 +0200__monty__(~toonn@user/toonn)
2021-10-16 13:32:46 +0200enikar(~enikar@user/enikar) (Quit: WeeChat 3.0)
2021-10-16 13:35:11 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915) (Ping timeout: 264 seconds)
2021-10-16 13:45:06 +0200stengah(~stengah@user/stengah) (Ping timeout: 265 seconds)
2021-10-16 13:46:38 +0200OscarZ(~oscarz@95.175.104.139) (Quit: Leaving)
2021-10-16 13:46:49 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 252 seconds)
2021-10-16 13:52:38 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-16 13:53:33 +0200dschrempf(~dominik@070-207.dynamic.dsl.fonira.net)
2021-10-16 13:56:33 +0200max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Ping timeout: 265 seconds)
2021-10-16 13:56:40 +0200stengah(~stengah@user/stengah)
2021-10-16 13:57:34 +0200econo(uid147250@user/econo) (Quit: Connection closed for inactivity)
2021-10-16 13:58:31 +0200stengah(~stengah@user/stengah) (Client Quit)
2021-10-16 14:10:46 +0200Midjak(~Midjak@82-65-111-221.subs.proxad.net)
2021-10-16 14:11:48 +0200 <Midjak> Hi there
2021-10-16 14:12:23 +0200 <yushyin> hi Midjak
2021-10-16 14:13:50 +0200 <Midjak> I am a beginner is this channel ok for newbie question ? Or is there some channel for beginners ?
2021-10-16 14:15:04 +0200 <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
2021-10-16 14:16:30 +0200 <Midjak> Nice! Thank you yushyin
2021-10-16 14:18:23 +0200dschrempf(~dominik@070-207.dynamic.dsl.fonira.net) (Ping timeout: 264 seconds)
2021-10-16 14:20:14 +0200xiongxin(~quassel@113.116.224.79) (Ping timeout: 265 seconds)
2021-10-16 14:23:32 +0200stengah(~stengah@user/stengah)
2021-10-16 14:29:04 +0200mestre(~mestre@191.177.175.57)
2021-10-16 14:29:39 +0200stengah(~stengah@user/stengah) (Quit: stengah)
2021-10-16 14:30:56 +0200dschrempf(~dominik@070-207.dynamic.dsl.fonira.net)
2021-10-16 14:32:03 +0200mestre(~mestre@191.177.175.57) (Client Quit)
2021-10-16 14:32:18 +0200mestre(~mestre@191.177.175.57)
2021-10-16 14:39:11 +0200slowButPresent(~slowButPr@user/slowbutpresent)
2021-10-16 14:40:16 +0200dschrempf(~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
2021-10-16 14:41:42 +0200kritzefitz(~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-10-16 14:42:27 +0200zer0bitz(~zer0bitz@dsl-hkibng31-54fafc-123.dhcp.inet.fi)
2021-10-16 14:44:57 +0200mestre(~mestre@191.177.175.57) (Quit: leaving)
2021-10-16 14:49:35 +0200ubert(~Thunderbi@178.165.199.151.wireless.dyn.drei.com) (Ping timeout: 264 seconds)
2021-10-16 14:51:23 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Ping timeout: 264 seconds)
2021-10-16 14:55:55 +0200Vajb(~Vajb@n8vwdu04eps78g521-2.v6.elisa-mobile.fi)
2021-10-16 14:58:58 +0200geekosaur(~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
2021-10-16 15:00:56 +0200geekosaur(~geekosaur@xmonad/geekosaur)
2021-10-16 15:01:47 +0200 <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
2021-10-16 15:02:44 +0200 <Midjak> I am looking on the internet. Any idea ?
2021-10-16 15:04:08 +0200Midjaklooking this https://gitlab.haskell.org/ghc/ghc/-/issues/18592
2021-10-16 15:04:15 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 15:04:38 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-16 15:06:21 +0200kritzefitz(~kritzefit@212.86.56.80)
2021-10-16 15:07:08 +0200frosky(~froskyarr@66.90.88.140) (Remote host closed the connection)
2021-10-16 15:07:17 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
2021-10-16 15:07:30 +0200frosky(~froskyarr@59.41.160.121)
2021-10-16 15:08:26 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
2021-10-16 15:08:51 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Ping timeout: 245 seconds)
2021-10-16 15:09:30 +0200 <sm> Midjak: it sounds like using a newer GHC version might fix it
2021-10-16 15:09:42 +0200 <Midjak> yes sm
2021-10-16 15:09:42 +0200 <sm> add --resolver=lts-18, eg
2021-10-16 15:10:10 +0200 <Midjak> what does it means sm ?
2021-10-16 15:11:04 +0200 <Midjak> I am looking what GHC version I have
2021-10-16 15:11:27 +0200 <Midjak> I know I am on the stable release.
2021-10-16 15:11:36 +0200 <sm> resolver means snapshot, it tells stack which set of packages and which GHC version to use
2021-10-16 15:11:53 +0200CiaoSen(~Jura@p5dcc1a24.dip0.t-ipconnect.de)
2021-10-16 15:11:54 +0200 <Midjak> ok thank you sm
2021-10-16 15:12:35 +0200 <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
2021-10-16 15:12:59 +0200 <Midjak> ok I am going to upgrade this
2021-10-16 15:13:28 +0200 <Midjak> in fact I have made a default installation but I think 8.8.4 is related to a previous install
2021-10-16 15:13:42 +0200 <Midjak> just now, the default install
2021-10-16 15:15:36 +0200jess(~jess@libera/staff/jess) (Quit: Lost terminal)
2021-10-16 15:16:05 +0200jess(~jess@libera/staff/jess)
2021-10-16 15:16:10 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 15:16:35 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 15:16:56 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Ping timeout: 265 seconds)
2021-10-16 15:17:46 +0200xiongxin(~quassel@113.116.33.28)
2021-10-16 15:19:24 +0200 <Midjak> it works with the proper resolver. thank you sm
2021-10-16 15:19:28 +0200sprout(~quassel@2a02:a467:ccd6:1:c9db:6eeb:465b:b3e9) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2021-10-16 15:20:07 +0200 <sm> no problem Midjak
2021-10-16 15:23:25 +0200max22-(~maxime@2a01cb0883359800eb44415b9b79cba1.ipv6.abo.wanadoo.fr)
2021-10-16 15:23:26 +0200machinedgod(~machinedg@24.105.81.50)
2021-10-16 15:23:40 +0200kritzefitz(~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-10-16 15:24:08 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2021-10-16 15:24:08 +0200kritzefitz(~kritzefit@212.86.56.80)
2021-10-16 15:24:51 +0200Guest21(~Guest21@94.228.150.252)
2021-10-16 15:25:45 +0200hololeap(~hololeap@user/hololeap) (Ping timeout: 276 seconds)
2021-10-16 15:25:54 +0200Glassy(~Glassy@user/glassy)
2021-10-16 15:26:52 +0200hololeap(~hololeap@user/hololeap)
2021-10-16 15:28:18 +0200 <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.
2021-10-16 15:28:21 +0200jespada(~jespada@2803:9800:9842:7a62:a1db:843b:ed19:cad6)
2021-10-16 15:28:31 +0200 <Glassy> i think it returns a reference actually not a mutable vector
2021-10-16 15:28:49 +0200 <sm> what does :t say it is in GHCI ?
2021-10-16 15:29:16 +0200 <Glassy> i've actually never included a package in ghci, let me learn how to do that
2021-10-16 15:29:31 +0200 <sm> ghci -package vector, might work
2021-10-16 15:29:35 +0200fendor(~fendor@178.115.59.192.wireless.dyn.drei.com) (Remote host closed the connection)
2021-10-16 15:29:58 +0200 <Glassy> cannot satisfy, i guess i need to make a stack project
2021-10-16 15:30:10 +0200 <sm> stack ghci --package vector, then
2021-10-16 15:30:46 +0200fendor(~fendor@178.115.59.192.wireless.dyn.drei.com)
2021-10-16 15:37:39 +0200betelgeuse(~betelgeus@94-225-47-8.access.telenet.be)
2021-10-16 15:37:46 +0200 <Glassy> the command finished, `new 5
2021-10-16 15:37:47 +0200 <Glassy> :: (primitive-0.7.2.0:Control.Monad.Primitive.PrimMonad m,
2021-10-16 15:37:47 +0200 <Glassy> Unbox a) =>
2021-10-16 15:37:48 +0200 <Glassy> m (MVector
2021-10-16 15:37:48 +0200 <Glassy> (primitive-0.7.2.0:Control.Monad.Primitive.PrimState m) a)
2021-10-16 15:37:49 +0200 <Glassy> `
2021-10-16 15:39:23 +0200stengah(~stengah@user/stengah)
2021-10-16 15:40:27 +0200 <hpc> that looks like ST s (STVector s a)?
2021-10-16 15:40:51 +0200 <hpc> or, MVcetor
2021-10-16 15:41:48 +0200 <Glassy> what exactly is primstate/
2021-10-16 15:43:04 +0200 <Glassy> it kind of looks like some sort of type family?
2021-10-16 15:43:10 +0200 <hpc> it's a type family, yeah
2021-10-16 15:43:15 +0200 <hpc> for ST, it does https://hackage.haskell.org/package/primitive-0.7.2.0/docs/src/Control.Monad.Primitive.html#line-213
2021-10-16 15:43:29 +0200 <hpc> so (PrimState (ST s)) ~ s
2021-10-16 15:45:27 +0200 <Glassy> thank you
2021-10-16 15:46:50 +0200kritzefitz(~kritzefit@212.86.56.80) (Remote host closed the connection)
2021-10-16 15:46:57 +0200kritzefitz(~kritzefit@212.86.56.80)
2021-10-16 15:48:41 +0200Vajb(~Vajb@n8vwdu04eps78g521-2.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
2021-10-16 15:49:27 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-10-16 15:50:17 +0200 <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?
2021-10-16 15:50:34 +0200 <Glassy> this is with `:set -XRankNTypes` and `:set -XScopedTypeVariables` in GHCi
2021-10-16 15:51:09 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
2021-10-16 15:53:04 +0200Glassy(~Glassy@user/glassy) (Quit: Client closed)
2021-10-16 15:53:15 +0200Glassy(~Glassy@user/glassy)
2021-10-16 15:53:57 +0200 <hpc> weird rank n stuff?
2021-10-16 15:54:12 +0200 <hpc> for the longest time even ($) didn't work quite right with it
2021-10-16 15:54:30 +0200 <Glassy> is ($) type level?
2021-10-16 15:54:38 +0200 <hpc> :t ($)
2021-10-16 15:54:40 +0200 <lambdabot> (a -> b) -> a -> b
2021-10-16 15:54:47 +0200 <Glassy> oh i was wondering if you promoted it or something
2021-10-16 15:54:52 +0200 <Glassy> oh you just mean normal application
2021-10-16 15:54:56 +0200 <hpc> yeah
2021-10-16 15:55:21 +0200 <hpc> like you couldn't do runST $ do ..., because ($) breaks the forall s
2021-10-16 15:55:45 +0200 <Glassy> rankN is a really old extension though i think
2021-10-16 15:56:22 +0200 <ski> hm, i think a pattern signature is before generalization ?
2021-10-16 15:56:38 +0200 <ski> try `let y :: ...; y = ...' instead ?
2021-10-16 15:59:06 +0200 <Glassy> yeah it works `f x = 2 where y :: (forall s. ST s (STVector s Int)); y = new 2
2021-10-16 15:59:06 +0200 <Glassy> `
2021-10-16 15:59:11 +0200 <Glassy> also with where is fine
2021-10-16 15:59:53 +0200 <Glassy> kinda strange but i guess i'll just put my type signature on the line above or to the right
2021-10-16 16:01:15 +0200 <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)'
2021-10-16 16:01:20 +0200[itchyjunk](~itchyjunk@user/itchyjunk/x-7353470)
2021-10-16 16:01:54 +0200Guest21(~Guest21@94.228.150.252) ()
2021-10-16 16:02:34 +0200 <Glassy> is it because my type is too polymorphic?
2021-10-16 16:02:47 +0200 <Glassy> like if i actually knew the state `s` it would work (not that I do)?
2021-10-16 16:03:02 +0200 <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,
2021-10-16 16:03:08 +0200 <ski> generalization only happens *after* this check
2021-10-16 16:03:26 +0200 <ski> none of the types here are polymorphic, they're all monomorphic
2021-10-16 16:04:34 +0200 <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)
2021-10-16 16:04:56 +0200 <Glassy> why does the forall type get converted?
2021-10-16 16:05:02 +0200 <ski> converted, how ?
2021-10-16 16:05:20 +0200frosky(~froskyarr@59.41.160.121) (Read error: Connection reset by peer)
2021-10-16 16:05:23 +0200 <Glassy> so my `forall s. ST s (STVector s Int)' becomes 'ST _s (STVector _s Int)'?
2021-10-16 16:05:36 +0200 <ski> that's polymorphic instantiation
2021-10-16 16:06:19 +0200 <ski> every time (apart from `PolymorphicComponents'/`Rank2Types'/`RankNTypes') you use a polymorphic value, that happens
2021-10-16 16:06:44 +0200 <Glassy> is this like giving it an `s` to substitute?
2021-10-16 16:07:13 +0200 <Glassy> sorry i've studied analysis but not lambda calculus so i haven't heard of polymorphic instantiation before
2021-10-16 16:07:30 +0200 <Glassy> maybe i need to go read a book?
2021-10-16 16:07:39 +0200 <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')
2021-10-16 16:08:03 +0200 <Glassy> okay yup sure
2021-10-16 16:08:12 +0200 <ski> let's take `reverse', or `take'
2021-10-16 16:08:33 +0200 <ski> take :: Int -> [Integer] -> [Integer]
2021-10-16 16:08:41 +0200 <ski> is one valid signature for `take'
2021-10-16 16:08:43 +0200acidjnk(~acidjnk@p200300d0c703cb13982ae5e8635fcd4e.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
2021-10-16 16:08:43 +0200 <ski> another one is
2021-10-16 16:09:02 +0200 <ski> take :: Int -> [(Bool,Integer,IO String)] -> [(Bool,Integer,IO String)]
2021-10-16 16:09:25 +0200 <ski> `take' has infinitely many types (hence "poly"-"morphic", "many" "shapes")
2021-10-16 16:09:29 +0200 <Glassy> yup sure
2021-10-16 16:09:30 +0200 <ski> but they're all of the pattern
2021-10-16 16:09:37 +0200 <ski> take :: Int -> [a] -> [a]
2021-10-16 16:09:47 +0200 <ski> where `a' is any type. has to be the same type in both places
2021-10-16 16:10:08 +0200 <ski> however, taking one step back, the actual type of `take' is
2021-10-16 16:10:17 +0200 <ski> take :: forall a. Int -> [a] -> [a]
2021-10-16 16:11:26 +0200 <ski> Haskell allows one to omit the explicit `forall', commonly (but not always). but conceptually, it's still there, for `take'
2021-10-16 16:12:37 +0200 <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..'
2021-10-16 16:12:57 +0200 <ski> `take' is a polymorphic value that, once specialized, becomes a function
2021-10-16 16:13:27 +0200 <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
2021-10-16 16:14:25 +0200 <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
2021-10-16 16:14:37 +0200 <Glassy> alright
2021-10-16 16:15:33 +0200 <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]'
2021-10-16 16:16:16 +0200 <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?
2021-10-16 16:16:24 +0200 <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
2021-10-16 16:16:33 +0200 <Glassy> type application?
2021-10-16 16:16:35 +0200stilgart(~Christoph@chezlefab.net)
2021-10-16 16:16:38 +0200 <ski> yea
2021-10-16 16:17:06 +0200 <Glassy> yup i've used it for when things the type checker can't figure out the right type
2021-10-16 16:17:07 +0200 <ski> DMR isn't really that similar to this, no
2021-10-16 16:17:16 +0200 <Glassy> DMR?
2021-10-16 16:17:24 +0200 <ski> Dreaded Monomorphism Restriction
2021-10-16 16:17:43 +0200 <Glassy> lololol never heard of it like that
2021-10-16 16:17:47 +0200 <Glassy> i thought it made your code speedy
2021-10-16 16:18:59 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
2021-10-16 16:20:12 +0200 <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
2021-10-16 16:21:06 +0200 <ski> anyway, please don't think that `Int -> [a] -> [a]' is "short for" `forall a. Int -> [a] -> [a]'. it is not
2021-10-16 16:21:33 +0200 <Glassy> oh so is it a hack?
2021-10-16 16:21:50 +0200 <ski> `take :: Int -> [a] -> [a]' is (usually) "short for" `take :: forall a. Int -> [a] -> [a]'. this is different
2021-10-16 16:21:58 +0200 <ski> this only happens "directly after a `::'"
2021-10-16 16:22:44 +0200 <ski> being able to write `take :: Int -> [a] -> [a]' is nothing deep. it's just a handy (and sometimes confusing) abbreviation
2021-10-16 16:23:09 +0200 <jacks2> ski, how is it difference? I'm looking at both types, and I can't see any difference
2021-10-16 16:23:13 +0200 <jacks2> different*
2021-10-16 16:23:52 +0200 <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
2021-10-16 16:24:33 +0200 <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
2021-10-16 16:25:14 +0200 <ski> "insertion of implicit `forall'" *only* happens directly after a `::' !
2021-10-16 16:25:33 +0200 <Glassy> oh so is this like the compiler saying that's what we think you meant?
2021-10-16 16:25:38 +0200 <ski> it's not the type `Int -> [a] -> [a]' which means `forall a. Int -> [a] -> [a]'
2021-10-16 16:25:39 +0200 <Glassy> i know some languages require explicit forall
2021-10-16 16:26:23 +0200 <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')
2021-10-16 16:26:50 +0200 <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. ?
2021-10-16 16:27:17 +0200 <Glassy> maybe this is lazy haha
2021-10-16 16:27:37 +0200 <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
2021-10-16 16:27:51 +0200 <Glassy> okay yup cool
2021-10-16 16:27:53 +0200 <ski> "oh so is this like the compiler saying that's what we think you meant?" -- exactly
2021-10-16 16:28:02 +0200 <Glassy> so how does this relate to the specialisation and generalisation?
2021-10-16 16:28:10 +0200 <Glassy> in my where pattern
2021-10-16 16:29:20 +0200 <ski> Glassy : in `data Bar a = ..a..', the `Bar a' part binds the tyvar `a'. in `take :: forall a. ..a..', the `forall' binds `a'
2021-10-16 16:29:44 +0200 <Glassy> sure
2021-10-16 16:30:27 +0200 <Glassy> but i meant where does the specialization happen in `y :: (forall s. ST s (STVector s Int)) = new 2`
2021-10-16 16:30:28 +0200 <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
2021-10-16 16:30:50 +0200 <Glassy> is this because `new 2` finds itself a nice thing to put for `s`?
2021-10-16 16:31:15 +0200 <Glassy> and it doesn't get regeneralized?
2021-10-16 16:33:02 +0200 <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)
2021-10-16 16:33:14 +0200Psybur(~Psybur@mobile-166-170-34-168.mycingular.net)
2021-10-16 16:33:43 +0200 <ski> er, actually, `forall s a. Int -> ST s (STVector s a)'
2021-10-16 16:34:45 +0200 <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'
2021-10-16 16:35:59 +0200 <ski> we "know" that `a' will end up being chosen as `Int' (or at least, that's our intent) .. but what about `s' ?
2021-10-16 16:36:56 +0200 <Glassy> what the compiler likes?
2021-10-16 16:37:20 +0200 <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'
2021-10-16 16:38:10 +0200 <Glassy> alright
2021-10-16 16:38:20 +0200 <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)'
2021-10-16 16:38:56 +0200 <ski> then this is applied to `2', which must have type `Int'. and the resulting application has type `ST _s (STVector _s _a)'
2021-10-16 16:39:32 +0200xiongxin(~quassel@113.116.33.28) (Read error: Connection reset by peer)
2021-10-16 16:39:47 +0200 <Glassy> is this where _a = Int?
2021-10-16 16:39:55 +0200 <Glassy> or is it still a place holder?
2021-10-16 16:39:57 +0200xiongxin(~quassel@113.116.224.79)
2021-10-16 16:40:12 +0200 <ski> let's say we're currently considering
2021-10-16 16:40:20 +0200 <ski> y :: forall s. ST s (STVector s Int)
2021-10-16 16:40:22 +0200 <ski> y = new 2
2021-10-16 16:41:05 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-16 16:42:05 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
2021-10-16 16:42:06 +0200 <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
2021-10-16 16:42:53 +0200 <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)')
2021-10-16 16:42:59 +0200 <ski> Glassy : following, so far ?
2021-10-16 16:43:02 +0200 <Glassy> huh
2021-10-16 16:43:10 +0200 <Glassy> so they both are given place holders
2021-10-16 16:43:13 +0200 <Glassy> and the placeholders match up
2021-10-16 16:43:20 +0200 <Glassy> or can match up
2021-10-16 16:44:19 +0200 <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)
2021-10-16 16:46:33 +0200 <Glassy> actually i think it might help if i come back another time. just because i think i'm jumping too far ahead
2021-10-16 16:47:04 +0200 <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
2021-10-16 16:47:12 +0200 <Glassy> though thanks for the help :)
2021-10-16 16:47:13 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 252 seconds)
2021-10-16 16:47:18 +0200 <Glassy> just i got to go back to basics i think
2021-10-16 16:47:50 +0200 <ski> ok. i was thinking perhaps we could consider say `totalLength rows = sum (map length rows)', as an example of inferring types
2021-10-16 16:49:07 +0200 <Glassy> umm maybe another time sorry :( just i also got to go outside
2021-10-16 16:49:30 +0200 <Glassy> anyway have a nice day /wave
2021-10-16 16:49:38 +0200Glassy(~Glassy@user/glassy) ()
2021-10-16 16:50:15 +0200 <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
2021-10-16 16:50:21 +0200 <ski> ok
2021-10-16 16:50:34 +0200 <ski> jacks2 : did it become clear ?
2021-10-16 16:52:00 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 16:52:00 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 16:52:00 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 16:53:53 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
2021-10-16 17:01:00 +0200DNH(~DNH@2a02:8108:1100:16d8:11c6:13b4:148f:aabf) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-10-16 17:01:38 +0200o1lo01ol1o(~o1lo01ol1@bl19-157-209.dsl.telepac.pt)
2021-10-16 17:06:28 +0200waleee(~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 252 seconds)
2021-10-16 17:09:57 +0200 <stengah> :t words
2021-10-16 17:09:58 +0200 <lambdabot> String -> [String]
2021-10-16 17:11:58 +0200Hanicef(~gustaf@81-229-9-108-no92.tbcn.telia.com) (Quit: leaving)
2021-10-16 17:12:16 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-10-16 17:13:10 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-16 17:17:01 +0200f-a(f2a@f2a.jujube.ircnow.org)
2021-10-16 17:17:47 +0200 <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
2021-10-16 17:18:04 +0200 <f-a> What blocks `Identity` from having its MonadThrow instance?
2021-10-16 17:22:52 +0200 <janus> f-a: IdentityT does have MonadThrow, hmm, dunno what to conclude from that
2021-10-16 17:23:19 +0200 <f-a> yeah that is what puzzled me
2021-10-16 17:23:33 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-16 17:24:23 +0200 <hpc> (IdentityT m) has an instance because m can be MonadThrow
2021-10-16 17:24:41 +0200 <hpc> and then when when throwM with the (IdentityT m) it defers to m's instance
2021-10-16 17:26:24 +0200segfaultfizzbuzz(~segfaultf@135-180-0-138.static.sonic.net)
2021-10-16 17:27:26 +0200 <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
2021-10-16 17:27:52 +0200talismanick(~talismani@76.78.246.30) (Ping timeout: 252 seconds)
2021-10-16 17:29:06 +0200 <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
2021-10-16 17:29:07 +0200 <geekosaur> Identity *is* the "unit" there
2021-10-16 17:29:12 +0200 <jacks2> prime number checker*
2021-10-16 17:30:03 +0200 <f-a> jacks2: why not checking it with https://hackage.haskell.org/package/primes-0.2.1.0/docs/Data-Numbers-Primes.html
2021-10-16 17:30:35 +0200 <jacks2> it is a homework assignment
2021-10-16 17:30:38 +0200 <f-a> and yup, it is quite slow
2021-10-16 17:30:45 +0200 <jacks2> it is valid, though?
2021-10-16 17:31:14 +0200 <ski> yes
2021-10-16 17:31:34 +0200 <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
2021-10-16 17:32:58 +0200 <ski> `if ... then False else ...' is `not (...) && ...'
2021-10-16 17:33:47 +0200 <f-a> running your assignment through `hlint` will make your tutor happy, too
2021-10-16 17:34:30 +0200 <ski> `hlint' is opinionated
2021-10-16 17:35:23 +0200 <Franciman> tbf 80% of the time i don't like hlint
2021-10-16 17:35:33 +0200 <ski> (it often gives suggestions i don't care for)
2021-10-16 17:35:34 +0200 <Franciman> what hlint
2021-10-16 17:35:36 +0200 <Franciman> says
2021-10-16 17:41:33 +0200stengah(~stengah@user/stengah) (Quit: stengah)
2021-10-16 17:45:05 +0200ArctVaulMarsHMPJ(~pjetcetal@2.95.44.252) (Quit: EXIT)
2021-10-16 17:45:25 +0200ArctVaulMarsHMPJ(~pjetcetal@2.95.44.252)
2021-10-16 17:45:33 +0200xiongxin(~quassel@113.116.224.79) (Read error: Connection reset by peer)
2021-10-16 17:46:24 +0200ArctVaulMarsHMPJ(~pjetcetal@2.95.44.252) (Read error: Connection reset by peer)
2021-10-16 17:46:40 +0200ArctVaulMarsHMPJ(~pjetcetal@2.95.44.252)
2021-10-16 17:46:45 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 17:49:35 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
2021-10-16 17:50:39 +0200jespada(~jespada@2803:9800:9842:7a62:a1db:843b:ed19:cad6) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-10-16 17:51:14 +0200hnOsmium0001(uid453710@id-453710.hampstead.irccloud.com)
2021-10-16 17:53:25 +0200nunggu(q@gateway/vpn/protonvpn/nunggu)
2021-10-16 17:54:20 +0200xiongxin(~quassel@113.116.33.28)
2021-10-16 17:57:26 +0200gaff(~gaff@49.207.211.225)
2021-10-16 17:58:03 +0200 <jacks2> which one do you prefer? https://paste.tomsmeding.com/KFIHLugK
2021-10-16 17:59:01 +0200 <jacks2> pattern matching for 2 vs everything in guards
2021-10-16 17:59:17 +0200 <gaff> toRational :: Real a => a -> Rational, pi :: Floating a => a, but `toRational pi` works. how is that possible?
2021-10-16 18:01:35 +0200jakalx(~jakalx@base.jakalx.net) (Error from remote client)
2021-10-16 18:02:01 +0200 <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
2021-10-16 18:02:23 +0200 <c_wraith> gaff: if you don't provide it any more information, it will default to Double, which is an instance of both
2021-10-16 18:02:34 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 252 seconds)
2021-10-16 18:03:17 +0200 <gaff> c_wraith: but `pi` already has a type, has it not?
2021-10-16 18:03:31 +0200 <c_wraith> > pi :: Double
2021-10-16 18:03:33 +0200 <lambdabot> 3.141592653589793
2021-10-16 18:03:49 +0200 <c_wraith> > pi :: Float
2021-10-16 18:03:51 +0200 <lambdabot> 3.1415927
2021-10-16 18:03:58 +0200 <c_wraith> pi is polymorphic.
2021-10-16 18:04:03 +0200 <gaff> i see
2021-10-16 18:04:38 +0200 <gaff> but this doesn't work: `fromRational pi`
2021-10-16 18:04:43 +0200YoungChiefBTW(~youngchie@user/youngchiefbtw) (Quit: issued !quit command)
2021-10-16 18:04:53 +0200 <c_wraith> :t fromRational
2021-10-16 18:04:54 +0200 <lambdabot> Fractional a => Rational -> a
2021-10-16 18:05:02 +0200 <gaff> correct
2021-10-16 18:05:10 +0200 <c_wraith> yes. Rational doesn't have a Floating instance.
2021-10-16 18:05:57 +0200 <gaff> but Rational does have a Fractional instance
2021-10-16 18:06:38 +0200 <c_wraith> pi is only polymorphic over Floating instances. (It's actually part of the Floating class)
2021-10-16 18:06:48 +0200 <gaff> ok
2021-10-16 18:07:38 +0200 <gaff> and Floating is a subclass of Fractional
2021-10-16 18:07:41 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 18:07:42 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 18:07:42 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 18:08:36 +0200 <gaff> `fromRational` is in `Fractional` class
2021-10-16 18:09:25 +0200 <c_wraith> that means all instance of Floating must also be instances of Fractional. Not the other way around.
2021-10-16 18:09:27 +0200 <janus> hmm i am bit bummed that pi isn't infinite precision now that it is so polymorphic
2021-10-16 18:09:34 +0200 <janus> @src pi
2021-10-16 18:09:34 +0200 <lambdabot> Source not found. BOB says: You seem to have forgotten your passwd, enter another!
2021-10-16 18:10:37 +0200 <hpc> it's as precise as the type you use it with
2021-10-16 18:10:41 +0200 <hpc> > pi :: CReal
2021-10-16 18:10:43 +0200 <lambdabot> error:
2021-10-16 18:10:43 +0200 <lambdabot> Not in scope: type constructor or class ‘CReal’
2021-10-16 18:10:43 +0200 <lambdabot> Perhaps you meant ‘Real’ (imported from Prelude)
2021-10-16 18:10:52 +0200 <hpc> :( i thought that was imported
2021-10-16 18:11:27 +0200 <gaff> c_wraith: shouldn't all instances of Floating implement the `fromRational` ethod?
2021-10-16 18:11:50 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-16 18:11:53 +0200 <gaff> sorry, i mean "method"
2021-10-16 18:12:38 +0200xiongxin(~quassel@113.116.33.28) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
2021-10-16 18:12:43 +0200 <gaff> i suppose `pi` is just a value defined in Flaoting
2021-10-16 18:12:47 +0200 <c_wraith> fromRational is polymorphic in the return type
2021-10-16 18:12:48 +0200 <gaff> Floating
2021-10-16 18:12:56 +0200 <c_wraith> not in the argument type
2021-10-16 18:13:00 +0200 <gaff> yeah, correct
2021-10-16 18:13:19 +0200 <c_wraith> So fromRational can return a value of any type that pi can be
2021-10-16 18:13:41 +0200 <c_wraith> but its input must always be Rational
2021-10-16 18:13:45 +0200 <janus> % :set -XDataKinds
2021-10-16 18:13:45 +0200 <yahb> janus:
2021-10-16 18:13:46 +0200 <gaff> correct
2021-10-16 18:13:53 +0200 <janus> % :m +Data.Fixed
2021-10-16 18:13:53 +0200 <yahb> janus:
2021-10-16 18:14:14 +0200 <janus> % realToFrac pi :: Fixed 1000 -- i had hoped this would give me the precision of the type
2021-10-16 18:14:14 +0200 <yahb> janus: 3.141
2021-10-16 18:14:54 +0200bitmapper(uid464869@id-464869.lymington.irccloud.com)
2021-10-16 18:14:57 +0200 <gaff> and `pi` is not Rational ... but here is the question: pi isn't Fractional either?
2021-10-16 18:15:10 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 252 seconds)
2021-10-16 18:17:06 +0200 <janus> why shouldn't it be Fractional? it supports real division
2021-10-16 18:19:35 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 264 seconds)
2021-10-16 18:20:19 +0200bluenode(~bluenode@cpc99576-brnt1-2-0-cust237.4-2.cable.virginm.net)
2021-10-16 18:20:26 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a)
2021-10-16 18:20:54 +0200Lord_of_Life(~Lord@user/lord-of-life/x-2819915)
2021-10-16 18:21:13 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
2021-10-16 18:21:17 +0200 <gaff> so pi is Fractional as well, because Floating is a subclass of Fractional?
2021-10-16 18:22:14 +0200 <gaff> janus: is that what your argument is?
2021-10-16 18:22:35 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 264 seconds)
2021-10-16 18:23:15 +0200 <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"
2021-10-16 18:23:45 +0200 <janus> so in effect the name has been taken by a class that can't even faithfully represent the entity :P
2021-10-16 18:23:46 +0200 <gaff> janus: ok, i ma talking about something else, i think
2021-10-16 18:25:19 +0200 <gaff> c_wraith: something like `fromRational 8.6756` works just fine, because unlike pi, 8.6756 can be represented as a Rational?
2021-10-16 18:26:14 +0200connrs(~connrs@conners.plus.com) (Read error: Connection reset by peer)
2021-10-16 18:26:19 +0200 <c_wraith> it's not about representation
2021-10-16 18:26:23 +0200 <janus> % fromRational 1.5 :: Fixed E0 -- it will throw away precision though...
2021-10-16 18:26:23 +0200 <yahb> janus: 1.0
2021-10-16 18:26:51 +0200 <c_wraith> It's just that numeric literals are more polymorphic than pi is
2021-10-16 18:27:04 +0200 <c_wraith> :t 8.6756
2021-10-16 18:27:05 +0200 <lambdabot> Fractional p => p
2021-10-16 18:27:17 +0200 <c_wraith> Rational is an instance of Fractional
2021-10-16 18:27:22 +0200 <c_wraith> :t pi
2021-10-16 18:27:23 +0200 <lambdabot> Floating a => a
2021-10-16 18:27:23 +0200 <gaff> c_wraith: correct, i forgot about that!
2021-10-16 18:27:28 +0200 <c_wraith> Rational is not an instance of Floating
2021-10-16 18:27:37 +0200DNH(~DNH@2a02:8108:1100:16d8:b0eb:6d14:193d:16e9)
2021-10-16 18:27:46 +0200 <gaff> ok, now i understand
2021-10-16 18:28:00 +0200Null_A(~null_a@2601:645:8700:2290:3dbf:d4aa:b1ba:f84a) ()
2021-10-16 18:28:40 +0200 <gaff> c_wraith: thanks much
2021-10-16 18:29:16 +0200connrs(~connrs@conners.plus.com)
2021-10-16 18:29:24 +0200gaff(~gaff@49.207.211.225) (Leaving...)
2021-10-16 18:29:35 +0200wonko(~wjc@62.115.229.50)
2021-10-16 18:29:58 +0200geekosaur(~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
2021-10-16 18:31:48 +0200geekosaur(~geekosaur@xmonad/geekosaur)
2021-10-16 18:36:48 +0200jakalx(~jakalx@base.jakalx.net)
2021-10-16 18:37:50 +0200ArctVaulMarsHMPJ(~pjetcetal@2.95.44.252) (Quit: EXIT)
2021-10-16 18:37:54 +0200tzh(~tzh@c-24-21-73-154.hsd1.or.comcast.net)
2021-10-16 18:38:21 +0200gaff(~gaff@49.207.211.225)
2021-10-16 18:43:59 +0200 <gaff> c_wraith: one followup question -- Floating is a subclass of Fractional, which has the `fromRational` method. shouldn't all `Floating` instances implement `fromRational`?
2021-10-16 18:44:47 +0200 <c_wraith> yes - but remember the polymorphic side of fromRational is the return value, not the argument
2021-10-16 18:45:12 +0200 <c_wraith> :t \x -> fromRational x `asTypeOf` pi
2021-10-16 18:45:13 +0200 <lambdabot> Floating a => Rational -> a
2021-10-16 18:46:21 +0200 <c_wraith> fromRational can return any type that pi can be.
2021-10-16 18:46:33 +0200 <gaff> ok
2021-10-16 18:47:16 +0200 <gaff> ah i see
2021-10-16 18:48:26 +0200 <gaff> but its argument has to be Rational (not polymorphic), so pi is out of the picture
2021-10-16 18:49:25 +0200 <c_wraith> yes
2021-10-16 18:50:08 +0200 <gaff> quite tricky to underatnd at first, but now i see. thanks much
2021-10-16 18:51:17 +0200 <gaff> c_wraith: also the class heirarchy names are not so obvious, at least at first glance.
2021-10-16 18:51:32 +0200 <c_wraith> The names make no sense to me at all. I try not to think about them. :)
2021-10-16 18:51:38 +0200 <gaff> i mean the number classes
2021-10-16 18:51:43 +0200 <c_wraith> Yeah
2021-10-16 18:52:02 +0200 <c_wraith> Floating, Real, RealFrac... I couldn't tell you what any of those are, specifically.
2021-10-16 18:52:17 +0200zincy(~tom@2a00:23c8:970c:4801:f4b9:dbfb:6f14:3bca) (Read error: Connection reset by peer)
2021-10-16 18:52:17 +0200 <c_wraith> until I look at the docs, anyway
2021-10-16 18:52:25 +0200 <gaff> yeah
2021-10-16 18:52:52 +0200 <c_wraith> Fortunately, those details aren't important most of the time.
2021-10-16 18:53:08 +0200 <gaff> i suppose they prefixed `Real` to denote real numbers, as opposed to complex numbers. that's all i can say
2021-10-16 18:54:11 +0200 <gaff> and `Real` is subdivided into integers and fractions, so that's where you get RealFrac, i suppose
2021-10-16 18:54:28 +0200 <gaff> :)
2021-10-16 18:54:30 +0200 <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
2021-10-16 18:54:40 +0200 <gaff> yeah
2021-10-16 18:55:07 +0200 <gaff> thanks much for your help
2021-10-16 18:55:17 +0200 <c_wraith> you're welcome
2021-10-16 18:59:12 +0200mbuf(~Shakthi@122.173.255.77) (Quit: Leaving)
2021-10-16 18:59:18 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-10-16 19:00:33 +0200gaff(~gaff@49.207.211.225) (Quit: Leaving...)
2021-10-16 19:02:46 +0200zincy(~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684)
2021-10-16 19:04:22 +0200zincy(~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684) (Read error: Connection reset by peer)
2021-10-16 19:06:23 +0200peterhil(~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 264 seconds)
2021-10-16 19:07:18 +0200neurocyte0132889(~neurocyte@45.128.183.213)
2021-10-16 19:07:18 +0200neurocyte0132889(~neurocyte@45.128.183.213) (Changing host)
2021-10-16 19:07:18 +0200neurocyte0132889(~neurocyte@user/neurocyte)
2021-10-16 19:07:19 +0200enikar(~enikar@user/enikar)
2021-10-16 19:08:42 +0200gehmehgeh(~user@user/gehmehgeh) (Ping timeout: 276 seconds)
2021-10-16 19:11:06 +0200gehmehgeh(~user@user/gehmehgeh)
2021-10-16 19:12:25 +0200neurocyte0132889(~neurocyte@user/neurocyte) (Ping timeout: 252 seconds)
2021-10-16 19:14:24 +0200mestre(~mestre@191.177.175.57)
2021-10-16 19:14:28 +0200waleee(~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
2021-10-16 19:15:06 +0200CiaoSen(~Jura@p5dcc1a24.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
2021-10-16 19:18:45 +0200Pickchea(~private@user/pickchea)
2021-10-16 19:25:11 +0200ArctVaulMarsHMPJ(~pjetcetal@2.95.44.252)
2021-10-16 19:28:53 +0200bluenode(~bluenode@cpc99576-brnt1-2-0-cust237.4-2.cable.virginm.net) (Quit: Client closed)
2021-10-16 19:29:13 +0200zincy(~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684)
2021-10-16 19:31:34 +0200zincy(~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684) (Read error: Connection reset by peer)
2021-10-16 19:33:25 +0200machinedgod(~machinedg@24.105.81.50)
2021-10-16 19:34:47 +0200zincy(~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684)
2021-10-16 19:36:24 +0200zincy(~tom@2a00:23c8:970c:4801:5b6a:e81b:79dc:f684) (Read error: Connection reset by peer)
2021-10-16 19:38:47 +0200werneta(~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
2021-10-16 19:40:00 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 19:44:47 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
2021-10-16 19:48:02 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
2021-10-16 19:48:14 +0200hendursa1(~weechat@user/hendursaga) (Quit: hendursa1)
2021-10-16 19:48:45 +0200Vajb(~Vajb@n8vwdu04eps78g521-2.v6.elisa-mobile.fi)
2021-10-16 19:48:58 +0200hendursaga(~weechat@user/hendursaga)
2021-10-16 19:56:11 +0200MQ-17J(~MQ-17J@8.21.10.20) (Ping timeout: 264 seconds)
2021-10-16 20:01:12 +0200MQ-17J(~MQ-17J@8.21.10.20)
2021-10-16 20:03:45 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
2021-10-16 20:06:10 +0200neurocyte0132889(~neurocyte@45.128.183.213)
2021-10-16 20:06:10 +0200neurocyte0132889(~neurocyte@45.128.183.213) (Changing host)
2021-10-16 20:06:10 +0200neurocyte0132889(~neurocyte@user/neurocyte)
2021-10-16 20:08:12 +0200hendursaga(~weechat@user/hendursaga) (Remote host closed the connection)
2021-10-16 20:08:47 +0200hendursaga(~weechat@user/hendursaga)
2021-10-16 20:09:37 +0200bontaq(~user@ool-45779fe5.dyn.optonline.net)
2021-10-16 20:11:11 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 264 seconds)
2021-10-16 20:14:16 +0200benin(~benin@183.82.25.86) (Ping timeout: 245 seconds)
2021-10-16 20:14:51 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Quit: = "")
2021-10-16 20:15:46 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2021-10-16 20:17:33 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 20:17:55 +0200max22-(~maxime@2a01cb0883359800eb44415b9b79cba1.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
2021-10-16 20:20:08 +0200hiredman(~hiredman@frontier1.downey.family)
2021-10-16 20:23:24 +0200Sgeo(~Sgeo@user/sgeo)
2021-10-16 20:25:55 +0200ars23(~ars23@2a02:2f09:370f:d800:c448:fe02:b238:bc04)
2021-10-16 20:29:40 +0200kupi(uid212005@id-212005.hampstead.irccloud.com)
2021-10-16 20:29:40 +0200tfeb(~tfb@88.98.95.237)
2021-10-16 20:30:17 +0200ars23(~ars23@2a02:2f09:370f:d800:c448:fe02:b238:bc04) (Client Quit)
2021-10-16 20:32:36 +0200Vajb(~Vajb@n8vwdu04eps78g521-2.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
2021-10-16 20:33:30 +0200Vajb(~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
2021-10-16 20:34:53 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2021-10-16 20:36:10 +0200arjun(~user@user/arjun)
2021-10-16 20:38:08 +0200tfeb(~tfb@88.98.95.237) (Quit: died)
2021-10-16 20:39:49 +0200mniip(~mniip@libera/staff/mniip) (Ping timeout: 252 seconds)
2021-10-16 20:40:21 +0200hendursaga(~weechat@user/hendursaga) (Ping timeout: 276 seconds)
2021-10-16 20:40:47 +0200mniip(mniip@libera/staff/mniip)
2021-10-16 20:40:52 +0200hendursaga(~weechat@user/hendursaga)
2021-10-16 20:43:07 +0200ubert(~Thunderbi@91.141.60.206.wireless.dyn.drei.com)
2021-10-16 20:45:32 +0200DNH(~DNH@2a02:8108:1100:16d8:b0eb:6d14:193d:16e9) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2021-10-16 20:47:47 +0200ubert(~Thunderbi@91.141.60.206.wireless.dyn.drei.com) (Ping timeout: 264 seconds)
2021-10-16 20:48:55 +0200AndrewYu(~andrew@user/andrewyu) (Remote host closed the connection)
2021-10-16 20:49:39 +0200AndrewYu(~andrew@user/andrewyu)
2021-10-16 20:50:27 +0200max22-(~maxime@2a01cb0883359800a5cb7947071ee8e1.ipv6.abo.wanadoo.fr)
2021-10-16 20:52:13 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
2021-10-16 20:52:36 +0200arjun(~user@user/arjun) (Remote host closed the connection)
2021-10-16 20:52:52 +0200DNH(~DNH@2a02:8108:1100:16d8:b0eb:6d14:193d:16e9)
2021-10-16 20:53:53 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
2021-10-16 20:55:10 +0200MQ-17J(~MQ-17J@8.21.10.20) (Ping timeout: 268 seconds)
2021-10-16 20:57:57 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 21:00:18 +0200 <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
2021-10-16 21:01:52 +0200frobnicator(~frobnicat@185-227-75-147.dsl.cambrium.nl) (Ping timeout: 252 seconds)
2021-10-16 21:02:26 +0200 <remexre> er, benchmark's probably the wrong word; profile?
2021-10-16 21:04:36 +0200 <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
2021-10-16 21:05:41 +0200 <geekosaur> (build ghc itself, that is)
2021-10-16 21:05:59 +0200slack1256(~slack1256@45.4.2.52)
2021-10-16 21:07:38 +0200 <remexre> okay, thanks; it's already hanging on Renamer/typechecker with that, so I think I've found my cuprit :)
2021-10-16 21:07:43 +0200 <remexre> culprit*
2021-10-16 21:10:58 +0200fendor(~fendor@178.115.59.192.wireless.dyn.drei.com) (Remote host closed the connection)
2021-10-16 21:11:23 +0200 <geekosaur> also if it's really a small grammar, the ghc issue tracker might want a reproducible example :)
2021-10-16 21:11:47 +0200aegon(~mike@174.127.249.180)
2021-10-16 21:13:00 +0200 <remexre> 124 lines of grammar, ~100 lines of helper functions
2021-10-16 21:13:34 +0200 <remexre> and adding top-level type signatures doesn't help :(
2021-10-16 21:13:43 +0200f-a(f2a@f2a.jujube.ircnow.org) (Remote host closed the connection)
2021-10-16 21:14:15 +0200 <remexre> well, helps a bit looks like, 157800ms -> 56852.393ms
2021-10-16 21:14:27 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-10-16 21:14:56 +0200slack1256(~slack1256@45.4.2.52) (Ping timeout: 265 seconds)
2021-10-16 21:15:13 +0200 <remexre> but that's will all non-parameterized nts getting one
2021-10-16 21:18:19 +0200econo(uid147250@user/econo)
2021-10-16 21:18:56 +0200 <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
2021-10-16 21:19:14 +0200fendor(~fendor@178.115.59.192.wireless.dyn.drei.com)
2021-10-16 21:19:33 +0200 <jacks2> @hoogle Int -> Integer
2021-10-16 21:19:34 +0200 <lambdabot> Test.DejaFu.SCT.Internal toId :: Coercible Id a => Int -> a
2021-10-16 21:19:34 +0200 <lambdabot> Prelude toInteger :: Integral a => a -> Integer
2021-10-16 21:19:34 +0200 <lambdabot> GHC.Real toInteger :: Integral a => a -> Integer
2021-10-16 21:19:55 +0200 <jacks2> odd.. Variable not in scope: toInteger'
2021-10-16 21:20:08 +0200 <remexre> ' ?
2021-10-16 21:22:46 +0200 <geekosaur> yeh, that prime looks suspicious
2021-10-16 21:22:59 +0200 <jacks2> geekosaur, mine? why?
2021-10-16 21:23:27 +0200 <geekosaur> it's just toInteger, no prime
2021-10-16 21:24:16 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
2021-10-16 21:25:09 +0200 <jacks2> ok.. that is obvious :P. I asked about isPrime function several hours ago, so I'm still confused what you're talking about
2021-10-16 21:25:19 +0200 <remexre> prime being the ' mark
2021-10-16 21:25:27 +0200 <geekosaur> yeh, math terminology
2021-10-16 21:25:30 +0200 <remexre> toInteger =/= toInteger'
2021-10-16 21:25:37 +0200 <geekosaur> > let x' = 5 in x'
2021-10-16 21:25:39 +0200 <lambdabot> 5
2021-10-16 21:25:47 +0200 <jacks2> oh, god damn
2021-10-16 21:25:49 +0200 <geekosaur> pronounced "eks prime"
2021-10-16 21:26:27 +0200f2a(f2a@f2a.jujube.ircnow.org)
2021-10-16 21:27:26 +0200f2af-a
2021-10-16 21:30:34 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 21:30:34 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 21:30:34 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 21:35:23 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 265 seconds)
2021-10-16 21:36:07 +0200AkechiShiro(~licht@user/akechishiro)
2021-10-16 21:37:20 +0200fvr(uid503686@id-503686.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-16 21:39:05 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
2021-10-16 21:42:31 +0200martin02(~silas@141.84.69.76) (Ping timeout: 252 seconds)
2021-10-16 21:43:15 +0200neurocyte0132889(~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
2021-10-16 21:45:18 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-16 21:47:44 +0200frobnicator(~frobnicat@185-227-75-147.dsl.cambrium.nl)
2021-10-16 21:49:27 +0200retroid_(~retro@2e41e9c8.skybroadband.com)
2021-10-16 21:51:09 +0200neurocyte0132889(~neurocyte@45.128.183.213)
2021-10-16 21:51:09 +0200neurocyte0132889(~neurocyte@45.128.183.213) (Changing host)
2021-10-16 21:51:09 +0200neurocyte0132889(~neurocyte@user/neurocyte)
2021-10-16 21:59:05 +0200martin02(~silas@141.84.69.76)
2021-10-16 22:05:07 +0200juhp(~juhp@128.106.188.220) (Ping timeout: 252 seconds)
2021-10-16 22:07:52 +0200juhp(~juhp@128.106.188.220)
2021-10-16 22:08:14 +0200Pickchea(~private@user/pickchea) (Quit: Leaving)
2021-10-16 22:09:02 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 22:09:02 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 22:09:02 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 22:10:58 +0200neurocyte0132889(~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat)
2021-10-16 22:14:05 +0200neurocyte0132889(~neurocyte@45.128.183.213)
2021-10-16 22:14:05 +0200neurocyte0132889(~neurocyte@45.128.183.213) (Changing host)
2021-10-16 22:14:05 +0200neurocyte0132889(~neurocyte@user/neurocyte)
2021-10-16 22:14:24 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
2021-10-16 22:15:59 +0200martin02(~silas@141.84.69.76) (Ping timeout: 264 seconds)
2021-10-16 22:16:14 +0200_ht(~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
2021-10-16 22:19:05 +0200martin02(~silas@141.84.69.76)
2021-10-16 22:19:13 +0200mikoto-chan(~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 265 seconds)
2021-10-16 22:19:53 +0200acidjnk(~acidjnk@p200300d0c703cb13982ae5e8635fcd4e.dip0.t-ipconnect.de)
2021-10-16 22:19:55 +0200alx741(~alx741@181.196.68.37) (Ping timeout: 252 seconds)
2021-10-16 22:23:15 +0200jgeerds(~jgeerds@55d4da80.access.ecotel.net)
2021-10-16 22:26:29 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-10-16 22:26:53 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 22:26:54 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
2021-10-16 22:27:34 +0200MQ-17J(~MQ-17J@d192-24-122-179.try.wideopenwest.com)
2021-10-16 22:28:26 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-16 22:30:51 +0200 <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
2021-10-16 22:31:37 +0200 <Hecate> jacks2: `newtype` + UNPACK + StrictData ?
2021-10-16 22:32:17 +0200 <jacks2> is that good enough to avoid any performance hit?
2021-10-16 22:32:21 +0200LiaoTao(~LiaoTao@gateway/tor-sasl/liaotao) (Remote host closed the connection)
2021-10-16 22:32:31 +0200 <jacks2> I'd rather lose type safety if that is the case
2021-10-16 22:32:31 +0200pavonia(~user@user/siracusa)
2021-10-16 22:32:48 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
2021-10-16 22:32:49 +0200alx741(~alx741@186.178.108.200)
2021-10-16 22:32:59 +0200 <Hecate> then a type alias :P
2021-10-16 22:33:22 +0200 <geekosaur> you can also enable MagicHash and work with Int#
2021-10-16 22:33:36 +0200 <jacks2> I need 64 bit int
2021-10-16 22:33:58 +0200 <geekosaur> that will be 64 bit on a 64 bit platform, but if you must be certain there is also Int64#
2021-10-16 22:34:02 +0200coot(~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
2021-10-16 22:34:12 +0200 <Hecate> yup'
2021-10-16 22:34:14 +0200 <jacks2> ah ok
2021-10-16 22:35:10 +0200LiaoTao(~LiaoTao@gateway/tor-sasl/liaotao)
2021-10-16 22:41:36 +0200 <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?
2021-10-16 22:43:29 +0200 <geekosaur> it is mostly transparent. there are some edge cases where it can't be removed fully; that's why Coercible exists
2021-10-16 22:43:54 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Read error: No route to host)
2021-10-16 22:44:03 +0200bitdex(~bitdex@gateway/tor-sasl/bitdex)
2021-10-16 22:44:11 +0200neurocyte0132889(~neurocyte@user/neurocyte) (Ping timeout: 264 seconds)
2021-10-16 22:44:11 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 264 seconds)
2021-10-16 22:45:07 +0200 <geekosaur> you can read the Coercible paper for details. (that said, I'd be really surprised if they came up here)
2021-10-16 22:46:29 +0200 <hpc> there's also the general rule for performance that you write the simple thing until you can prove it's a problem
2021-10-16 22:48:01 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-10-16 22:48:17 +0200 <geekosaur> yes, that's also true. in most cases ghc should be able to prove strictness and that it can unbox things itself
2021-10-16 22:48:39 +0200 <geekosaur> so the fancy unboxed code is just doing by hand what ghc would do for you anyway
2021-10-16 22:49:58 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
2021-10-16 22:51:25 +0200 <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
2021-10-16 23:00:05 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2021-10-16 23:00:05 +0200wroathe(~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
2021-10-16 23:00:05 +0200wroathe(~wroathe@user/wroathe)
2021-10-16 23:04:16 +0200wroathe(~wroathe@user/wroathe) (Ping timeout: 245 seconds)
2021-10-16 23:04:45 +0200Gurkenglas(~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 260 seconds)
2021-10-16 23:06:48 +0200fendor(~fendor@178.115.59.192.wireless.dyn.drei.com) (Read error: Connection reset by peer)
2021-10-16 23:07:09 +0200asisto(~asisto@host-79-44-174-49.retail.telecomitalia.it)
2021-10-16 23:07:46 +0200asisto(~asisto@host-79-44-174-49.retail.telecomitalia.it) (Remote host closed the connection)
2021-10-16 23:13:37 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
2021-10-16 23:14:42 +0200wyrd(~wyrd@gateway/tor-sasl/wyrd)
2021-10-16 23:22:35 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
2021-10-16 23:28:01 +0200raehik(~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 245 seconds)
2021-10-16 23:29:58 +0200max22-(~maxime@2a01cb0883359800a5cb7947071ee8e1.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
2021-10-16 23:31:09 +0200eggplantade(~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
2021-10-16 23:32:09 +0200 <f-a> I forgot, how do I tell cabal to rebuild when needed when running — say — `cabal build program --enable-profiling`?
2021-10-16 23:32:37 +0200max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
2021-10-16 23:33:07 +0200machinedgod(~machinedg@24.105.81.50) (Ping timeout: 252 seconds)
2021-10-16 23:33:26 +0200 <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
2021-10-16 23:34:04 +0200 <geekosaur> hm, it should figure that out for itself normally
2021-10-16 23:34:44 +0200 <f-a> unfortunately I had to install ghc from apt-get (Debian), as recent ghcs segfault on my machine; that might be it
2021-10-16 23:35:18 +0200 <geekosaur> any packages you installed via apt/dpkg you will need to separately install the profiling packages for
2021-10-16 23:36:00 +0200 <geekosaur> on my ubuntu system it looks like libghc-file-embed-prof is what you need
2021-10-16 23:36:37 +0200 <f-a> makes sense
2021-10-16 23:36:43 +0200 <f-a> thanks
2021-10-16 23:38:28 +0200mc47(~mc47@xmonad/TheMC47) (Remote host closed the connection)
2021-10-16 23:39:28 +0200kupi(uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
2021-10-16 23:41:18 +0200max22-(~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Quit: Leaving)
2021-10-16 23:41:46 +0200lavaman(~lavaman@98.38.249.169)
2021-10-16 23:43:47 +0200machinedgod(~machinedg@24.105.81.50)
2021-10-16 23:44:52 +0200 <jacks2> is there deleteAll?
2021-10-16 23:45:05 +0200unit73e(~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
2021-10-16 23:45:34 +0200 <geekosaur> in what context?
2021-10-16 23:45:51 +0200 <jacks2> same as delete, but instead of just one it deletes all matching elements
2021-10-16 23:45:56 +0200lavaman(~lavaman@98.38.249.169) (Ping timeout: 245 seconds)
2021-10-16 23:45:58 +0200 <jacks2> oh, that is filter!
2021-10-16 23:46:00 +0200 <jacks2> :P
2021-10-16 23:46:47 +0200DNH(~DNH@2a02:8108:1100:16d8:b0eb:6d14:193d:16e9) (Ping timeout: 240 seconds)