Home liberachat/#haskell: Logs Calendar

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

00:01:20 × mestre quits (~mestre@191.177.175.57) (Quit: leaving)
00:07:06 × Midjak quits (~Midjak@82-65-111-221.subs.proxad.net) (Quit: This computer has gone to sleep)
00:07:21 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 265 seconds)
00:09:08 waleee joins (~waleee@h-98-128-228-119.NA.cust.bahnhof.se)
00:09:52 doyougnu joins (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net)
00:10:13 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
00:10:40 × wootehfoot quits (~wootehfoo@user/wootehfoot) (Quit: Leaving)
00:12:19 × hexfive quits (~eric@50.35.83.177) (Quit: WeeChat 3.0.1)
00:13:09 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 265 seconds)
00:14:55 martin02 joins (~silas@141.84.69.76)
00:15:57 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.3)
00:19:27 × doyougnu quits (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) (Remote host closed the connection)
00:30:30 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
00:35:56 hyiltiz joins (~quassel@31.220.5.250)
00:36:24 stiell joins (~stiell@gateway/tor-sasl/stiell)
00:39:25 × tomsmeding quits (~tomsmedin@tomsmeding.com) (Quit: ZNC 1.8.2 - https://znc.in)
00:39:55 tomsmeding joins (~tomsmedin@tomsmeding.com)
00:41:30 × tcard_ quits (~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp) (Quit: Leaving)
00:52:10 × shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection)
00:52:39 allbery_b joins (~geekosaur@xmonad/geekosaur)
00:52:39 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
00:52:42 allbery_b is now known as geekosaur
01:01:32 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b)
01:01:32 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
01:02:35 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
01:08:55 × jespada quits (~jespada@2803:9800:9842:7a62:a1db:843b:ed19:cad6) (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:17:49 × harveypwca quits (~harveypwc@2601:246:c180:a570:3828:d8:e523:3f67) (Quit: Leaving)
01:20:19 × jacks2 quits (~bc8165b6@199.204.85.195) (Quit: CGI:IRC)
01:20:42 × xsperry quits (~xs@user/xsperry) ()
01:21:16 ski deliberately does not block any PMs ..
01:21:50 <ski> (.. and deliberately have turned user mode `+i' off)
01:22:56 <Inst> I'm curious
01:23:01 <Inst> oh, maybe haskell-offtopic
01:23:15 <Inst> (are there courses on Haskell that start with Monads then work into everything else?)
01:23:35 <ski> doubtful
01:25:15 xiongxin joins (~quassel@113.116.224.79)
01:28:59 azimut joins (~azimut@gateway/tor-sasl/azimut)
01:29:18 <ski> you need to understand higher-order functions, and the basics of types, including polymorphism, and data types for non-trivial examples, to begin with. for `Monad' (the type class) you need to understand type classes & constrained polymorphism, and also higher-order quantification (being able to parameterize not only on concrete types like `Int',`Maybe Int',`Either String Int', but also on type functions
01:29:24 <ski> ("incomplete types") like `Maybe',`Either String')
01:31:56 <Inst> That looks like 2 chapters of a textbook, tbh
01:33:02 <Inst> it'd be fun for Haskell popularization because monads are considered why Haskell is for geniuses, and it's just dumping the crown jewels on someone's head on entry.
01:33:27 <geekosaur> monads are an excuse. they're also overrated
01:36:37 peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
01:36:51 <nitrix> And they taste really good.
01:37:50 <Inst> I'm just scared because I'm getting old and don't have infinite time left, and while Haskell looks great, I'm worried the language will eventually die and it won't be worth my time to learn, and Haskell apparently has a substantial learning curve.
01:38:41 <nitrix> Learning Haskell isn't particularly about learning "Haskell" per se.
01:38:47 × xff0x quits (~xff0x@2001:1a81:5288:5c00:1568:382a:23d8:c3dd) (Ping timeout: 264 seconds)
01:39:34 xff0x joins (~xff0x@2001:1a81:5288:5c00:f859:f2f3:e491:70d)
01:39:58 <Inst> it's more about a pure functional paradigm
01:40:07 <Inst> but it sounds like great fun
01:40:25 <Cajun> i dont think the functional paradigm is going anywhere any time soon. other languages are adopting more functional styles, and as it stands industry practices are to avoid mutable states where possible
01:41:11 × peterhil quits (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi) (Ping timeout: 264 seconds)
01:41:28 <nitrix> You pick up a new paradigm that lets you reason and solve problems from a different perspective (functional programming), with new tools like lazy evaluation and gain a deeper understanding of type theory and its benefits when it's executed well.
01:41:58 <Inst> i just feel a bit sad, i have a lot of time on my hands, and i'm trying to do both C++ and Haskell as first languages
01:42:25 <Inst> on the other hand, like, supposedly at various uni CS programs, they can teach 3 languages a semester
01:42:28 <Inst> my progress is just too slow
01:42:44 <nitrix> You could unlearn the "Haskell" part and still be left off with some pretty valuable things.
01:43:10 <Inst> bleh, the only nice part is that Learn Me A Haskell goes down faster than Bjarne Stroustrup's C++ intro book
01:43:39 <Cajun> personally i dont recommend haskell as a first language. its great as a second language or third, but you dont (or its just more difficult to) immediately see why the restrictions haskell places (the pure part) are any good
01:44:09 <nitrix> I would say focus on the paradigms, the concepts, the semantics, the abstractions. You get great millage from generalizations; you can improvise the last mile when necessary.
01:45:09 <Inst> https://www.snoyman.com/static/haskell-as-seen-by.png
01:46:09 <Inst> so i guess even if Haskell ends up dying off or end sup becoming unusable, I can still switch to F# or run off to Rust
01:46:27 <nitrix> Too much of C.S. is based on cargo culting. Haskell doesn't really care whether it's popular or successful.
01:48:52 <nitrix> It hasn't died since it's creation, 30 years ago. Nothing indicates that it will in the next 30 years either.
01:49:13 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
01:51:07 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
01:51:41 <sm> Inst: I understand your concern. I decided haskell or at least its principles and skills would be long-lived and that it was a better investment of time than C++
01:52:24 <sm> that's a fun graphic
01:53:00 <sm> hopefully will get an update eventually
01:53:37 <Inst> nitrix: I mean, where the hell is Haskell 2020? ;_;
01:54:13 × nunggu quits (q@gateway/vpn/protonvpn/nunggu) (Quit: WeeChat 3.3)
01:55:00 <Cajun> dont we have the haskell2021 extension in 9.2?
01:55:20 <yushyin> Cajun: GHC2021
01:55:42 <Inst> but for your community
01:55:47 <Inst> i'm sort of dumb, as in, really dumb
01:55:57 <Inst> but i'm telling my smarter friends that they should, especially if they're mediocre coders, pick up haskell
01:56:04 <Inst> as an idiot-proofing language
01:56:12 <sm> I think mentoring and support is quite important for learning haskell fast. Doing lots of a small projects and discussing them in here (eg) is one way to do it
01:56:41 <nitrix> Inst, Most of the practical issues with the language are solved by libraries in user-space. For the more hairy stuff, it happens at the compiler-level with extensions. Only when extensions have been used for a while, gathered feedback and proven themselves does it make its way back into the language.
01:57:07 <Inst> the advertisement for haskell is that it's basically a great private language
01:57:08 <nitrix> Inst, That's rather rare though. It's perfectly capable as it is.
01:57:21 <Inst> if you're not planning to become a professional developer
01:57:41 <Inst> i was about to pay someone 2k to implement a blackjack EV calculator in C++ or Java
01:57:50 <Inst> customized to a specific game implementation
01:57:56 <nitrix> Are you repeating what you heard or making a judgment call based on your inexperience with it?
01:58:08 <Inst> just repeating what i've heard
01:58:13 × xff0x quits (~xff0x@2001:1a81:5288:5c00:f859:f2f3:e491:70d) (Ping timeout: 252 seconds)
01:58:14 <Inst> i'm not saying haskell is bad for professional development
01:58:30 <nitrix> I see. That can be dangerous, lot of people are wrong.
01:58:48 <Inst> i'm saying it seems like something that's "ivy-educated python"; harder to learn, but once you get it, it's hard to screw up in it
01:59:28 <nitrix> I don't... I'm confused what your goal is. I don't think it needs a label. I don't know why you're trying to label/categorize it.
01:59:44 <Cajun> "python" and "hard to screw up" seem like alien topics :P
01:59:47 xff0x joins (~xff0x@2001:1a81:52c3:e900:4911:9a42:1c49:6483)
02:01:05 <nitrix> Just pick it up and try to do anything with it. You'll see what it's good for and what it's less good for.
02:01:07 [_] joins (~itchyjunk@user/itchyjunk/x-7353470)
02:01:28 × akspecs__ quits (~akspecs@user/akspecs) (Ping timeout: 252 seconds)
02:01:57 <sm> that is true to an extent
02:02:33 <nitrix> Ask questions if you run into something that's unfamiliar or that you don't understand. It'll let you assess what you know and what you don't know.
02:03:01 <nitrix> Then maybe you'll see the value or maybe you wont.
02:03:09 [itchyjunk] is now known as Guest8004
02:03:09 × Guest8004 quits (~itchyjunk@user/itchyjunk/x-7353470) (Killed (cadmium.libera.chat (Nickname regained by services)))
02:03:09 [_] is now known as [itchyjunk]
02:03:36 <sm> but it's complicated. Still lots of ways to screw up (your time, if not the code) :)
02:03:56 <nitrix> Decision paralysis hasn't gotten anyone anywhere.
02:04:13 <nitrix> And we're not salesman.
02:06:51 <ski> (sm : i thought <https://i.imgur.com/Xy0RoUg.jpg> was the update ?)
02:08:21 sm tries to imagine haskell dying off or becoming unusable
02:08:24 <sm> ooh, thanks
02:09:36 <sm> lol
02:11:02 <sm> compared to say lisp, haskell requires a lot of complex infrastructure for it to still be a productive working language, am I right ?
02:11:31 <sm> hackage, stackage, continually updated libs & bounds..
02:12:08 akspecs__ joins (~akspecs@136-24-181-20.cab.webpass.net)
02:12:08 × akspecs__ quits (~akspecs@136-24-181-20.cab.webpass.net) (Changing host)
02:12:08 akspecs__ joins (~akspecs@user/akspecs)
02:12:33 <sm> or if those things went offline, would we just keep running last installed ghc version and code everything we needed like a true programmer ?
02:14:29 × DigitalKiwi quits (~kiwi@2604:a880:400:d0::12fc:5001) (Quit: quite.)
02:14:37 <nitrix> You can vendor the compiler and libraries used. You can do that with any language.
02:15:14 DigitalKiwi joins (~kiwi@2604:a880:400:d0::12fc:5001)
02:15:45 peterhil joins (~peterhil@dsl-hkibng32-54fb52-57.dhcp.inet.fi)
02:15:59 <Cajun> i have wondered how lisp macros (for the very very little i know about lisp macros) compare to TH. are there any similarities?
02:16:05 <nitrix> Part of risk mitigation in any company is to run your own proxy/registry for your dependencies or commit them with your code.
02:16:46 × akspecs__ quits (~akspecs@user/akspecs) (Ping timeout: 245 seconds)
02:18:17 akspecs__ joins (~akspecs@136-24-181-20.cab.webpass.net)
02:18:17 × akspecs__ quits (~akspecs@136-24-181-20.cab.webpass.net) (Changing host)
02:18:17 akspecs__ joins (~akspecs@user/akspecs)
02:18:20 × waleee quits (~waleee@h-98-128-228-119.NA.cust.bahnhof.se) (Ping timeout: 265 seconds)
02:18:30 × unit73e quits (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291) (Remote host closed the connection)
02:20:15 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
02:23:39 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
02:26:36 markusde joins (~makrus@2604:3d08:6f80:6b00::2ba7)
02:27:09 <Inst> thanks for humoring me
02:27:53 × nitrix quits (~nitrix@user/nitrix) (Quit: Genius is one percent inspiration and ninety-nine percent perspiration)
02:27:56 <Inst> nitrix: I mean that Python's goal is to make relatively high-quality coding accessible to everyone, it spreads basic coding literacy and is highly suitable for non-professional developers
02:28:19 × alzgh quits (~alzgh@user/alzgh) (Remote host closed the connection)
02:29:08 <Inst> I see Haskell's goal as simply to be to make the most "correct" programming language, but I think a side effect is that it's creating a language that makes high-quality coding, as opposed to merely relatively high-quality, accessible to anyone willing to trudge through the concepts needed to understand haskell and make it work
02:29:30 <Inst> I see the similarity to Python being that Haskell is highly suitable for non-professional or hobbyist developers
02:29:34 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 252 seconds)
02:29:56 × APic quits (apic@apic.name) (Ping timeout: 265 seconds)
02:31:07 harovali joins (~haroldo@r167-62-172-139.dialup.adsl.anteldata.net.uy)
02:31:34 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
02:32:21 nitrix joins (~nitrix@user/nitrix)
02:33:35 <Inst> <Inst> nitrix: I mean that Python's goal is to make relatively high-quality coding accessible to everyone, it spreads basic coding literacy and is highly suitable for non-professional developers
02:33:35 <Inst> * alzgh has quit (Remote host closed the connection)
02:33:35 <Inst> <Inst> I see Haskell's goal as simply to be to make the most "correct" programming language, but I think a side effect is that it's creating a language that makes high-quality coding, as opposed to merely relatively high-quality, accessible to anyone willing to trudge through the concepts needed to understand haskell and make it work
02:33:35 <Inst> <Inst> I see the similarity to Python being that Haskell is highly suitable for non-professional or hobbyist developers
02:33:42 <vaibhavsagar[m]> Python's purpose is to be a serviceable DSL for interacting with C libraries
02:33:57 <harovali> hi there, any kind soul would help me to understand whats wrong trying to compile this code ? https://pastebin.com/cWSaa4vk
02:34:17 × xiongxin quits (~quassel@113.116.224.79) (Ping timeout: 265 seconds)
02:34:26 xiongxin_ joins (~quassel@113.116.32.200)
02:34:33 <vaibhavsagar[m]> Haskell's purpose is to exist so that functional programming researches don't have to invent their own subtly different languages when they write papers
02:35:06 <nitrix> harovali, The word deriving has to at the end of line 7 or indented on line 8.
02:35:10 <vaibhavsagar[m]> harovali: you need to indent your `deriving` clause on line 8
02:37:51 <markusde> Beginners conduit question here: My conduit has downstream type (), but it looks like runConduit wants the downstream type to be Void? is that right?
02:38:32 × alx741 quits (~alx741@186.178.108.200) (Quit: alx741)
02:38:44 <markusde> I don't see any conduit primitives that have downstream type void, all look like ()
02:39:32 <yates> is there a way to use pandoc to translate the language of a document (e.g., from Engish to Chinese) in addition to, or instead of, translating the document format?
02:39:33 <harovali> nitrix: vaibhavsagar[m]: thanks !
02:39:39 <harovali> now I get this https://pastebin.com/vYemsCrm
02:39:53 <nitrix> harovali, Deriving has different flavors. You can use deriving standalone like `deriving instance Eq Foo`, and so, without the indentation in your snippet, it thinks it's that scenario which doesn't allow for parentheses and you get a parsing error.
02:40:27 xsperry joins (~xs@user/xsperry)
02:40:33 <vaibhavsagar[m]> harovali: if you derive `Enum` automatically then you can't also provide your own manual definition
02:40:38 <harovali> nitrix: I'll learn about that !
02:40:51 <vaibhavsagar[m]> so you need to remove `Enum` from line 8
02:40:53 <nitrix> harovali, Read the error message. You have two instance (two implementations) for the interface Enum.
02:41:19 <nitrix> harovali, It gives you the two locations, line :8 and line :10.
02:41:21 <harovali> vaibhavsagar[m]: I see that yes thanks dude
02:41:33 <harovali> nitrix: yes true
02:42:25 APic joins (apic@apic.name)
02:42:28 <nitrix> You're provided the filename, then the line number, then the column number, colon-separated.
02:42:57 <yates> also, can someone point me to the definition of the AST in real Haskell code?
02:43:38 <awpr> markusde: if you have universally quantified downstream type, it can be instantiated to Void when passed to that combinator. if it expects a Void downstream type, that means it expects a conduit that cannot ever yield
02:44:14 <awpr> if the downstream type is (), then it does (or at least, could) yield () any number of times
02:45:13 <harovali> nitrix: thanks yes. I've read them, but I was (badly) convinced that both definitions were necesary
02:45:46 hololeap joins (~hololeap@user/hololeap)
02:46:14 <nitrix> harovali, `deriving` is asking for the compiler to implement the instance for you (as long as it's simple enough and based on other derivable things).
02:46:39 <harovali> nitrix: thanks for that !
02:47:32 <harovali> I wonder how I have to write a 'data' so that it is a pair of types derived from Enums
02:48:09 <harovali> data T = (P , C) doesn't compile
02:48:18 <markusde> awpr: hm- so if I have a ConduitT () () m r and I want the value m r, how might I get it?
02:48:47 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 265 seconds)
02:49:16 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
02:50:19 <awpr> that seems like a somewhat weird type to have. it'd be like an incremental procedure for computing `r` that you potentially have to poke repeatedly by providing `()` to allow it to continue, and monitor progress by receiving `()`
02:50:28 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
02:51:07 <nitrix> harovali, If you simplify the lookup lookup shenanigans you've got, you arrive at pattern matching: https://pastebin.com/FPbRr8qF
02:52:19 <nitrix> harovali, And that's also what the derived instance looks like.
02:52:49 <nitrix> harovali, You want a tuple that contains something of type P and C? Or members of your enum?
02:53:21 <awpr> like either something called `yield ()`, or some type signature overconstrained the type where it didn't need to, or something. there's probably a way to connect it to something that will eat all the `()`s and become runnable, but I suspect it wasn't meant to yield in the first place
02:53:47 <harovali> nitrix thanks
02:53:50 <nitrix> harovali, data T = (MyDataType, MyDataType) would be a tuple whose elements have to be the members of your enumeration, so Foo, Bar or Baz.
02:54:19 <harovali> nitrix, I'd like another type whichis a ordered pair of two previously defined Enums
02:54:56 <harovali> nitrix: mmm thatś how I've been writing it but doesn compile, I'll show you the code
02:55:00 <markusde> awpr: I mean I'm probably doing something wrong lol. I have a source of type ConduitT () a m () which I fuse eventually with a conduit of type ConduitT a () m r
02:55:28 <nitrix> harovali, data T = (FirstType, SecondType). That creates a type T, which is a tuple where the two elements must have the type FirstType and SecondType.
02:55:42 <harovali> nitrix: yes I see
02:56:44 <nitrix> harovali, When you work with T, it'll need to be those two things inside, all the time. You can make it more generic, like data T a b = (a, b), but I don't think that's what you want at the moment.
02:56:50 <harovali> nitrix: please see this https://pastebin.com/fuXDXPcP
02:56:54 <awpr> the type of the downstream conduit implies it outputs a stream of `()`s. something like `connect` https://hackage.haskell.org/package/conduit-1.3.4.2/docs/Data-Conduit.html#v:connect expects a sink that cannot output anything downstream
02:57:58 <nitrix> harovali, Great! So yeah, you're discovering that the syntax I used isn't legal Haskell ;)
02:58:12 <harovali> nitrix: me too !!
02:58:20 <harovali> nitrix: hehehehe
02:58:27 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds)
02:58:30 <harovali> nitrix: how Shoud that be ?
02:58:53 <markusde> awpr: Okay- I think I'm starting to see the issue now. So I just need to find a way to fold over my data until without outputting anything downstream
02:59:10 <markusde> because my fold is the last conduit anyways
02:59:40 <awpr> yeah, what's the sink / last conduit look like?
03:00:00 <nitrix> harovali, The start with `data TypeName =` is fine, you have the keyword data followed by the name of the type and the assignment, then you have to list the inhabitants (the values that will have that type).
03:00:59 <nitrix> harovali, A very simple example is `data Weekend = Saturday | Sunday`, they're separated by a | character. That's known as a sum type.
03:01:23 <markusde> awpr: right now it's a foldlC. The stage before outputs animation frames, and I need to combine them together before running the animation
03:02:09 <markusde> I want to continue accepting frames from the conduit until the audio file finishes being processed
03:02:54 <harovali> nitrix: I believe that is for "choosing" a type, but what if I want to use an 'only' but consisting of two consecutive values like in (x,y) ?
03:03:26 <nitrix> harovali, Those inhabitants can be more complex, they can be constructors that then relies on other types. For example, data Shape = Circle Float | Rectangle Int Int
03:03:33 <awpr> foldlC is polymorphic in its output type, so the problem is probably just that you wrote `()` in the type signature, and it should be a free type variable instead
03:04:44 <markusde> awpr: wow- dead on. Thank you so much!
03:04:47 <nitrix> harovali, Here, `Shape` is the type, while `Circle` and `Rectangle` are data constructors. `Rectangle` wants two arguments of type `Int` to create a `Shape`, so in your code, that could be `Rectangle 10 10`.
03:04:52 <harovali> nitrix: so , if I want a more complex value , a composed one, does it have to be a part of another type like Rectangle , but how is Rectangle defined ?
03:05:16 <nitrix> harovali, Careful. Rectangle is not a type, it's a data constructor for the type Shape.
03:05:17 Nosrep joins (~archbox@user/nosrep)
03:05:33 <harovali> nitrix: oh !! yes sure I see
03:05:40 <harovali> I'll try
03:06:06 <nitrix> harovali, With this, you have two ways of constructing a Shape, it can be a Circle or a Rectangle, and they both have a different number of arguments (and of different types too!).
03:06:42 <harovali> nitrix: yes now I remember fromthe tut , that the name of the typeand the constructor may coincide but aren't the same thing , thanks you!!
03:07:07 <nitrix> harovali, I'll let you let that sink in, but to answer your question, tuples in Haskell can play the role of types and also constructors. Unfortunately, they use the same syntax.
03:07:39 <nitrix> harovali, So (Int, Float) is a proper type, while (42, 19.9) is using the data constructor (,)
03:07:45 × markusde quits (~makrus@2604:3d08:6f80:6b00::2ba7) (Quit: Leaving)
03:08:14 <nitrix> > (,) 10 10
03:08:15 <lambdabot> (10,10)
03:08:21 <nitrix> :t (10,10)
03:08:23 <lambdabot> (Num a, Num b) => (a, b)
03:08:54 lavaman joins (~lavaman@98.38.249.169)
03:09:13 <nitrix> Well, that'd be (Int, Int), but literals in Haskell are quite generic :P
03:09:45 <harovali> nitrix: thanks for that snippet !!
03:11:19 <nitrix> harovali, I think what's confusing the most here is that (,) is used infix (in between two things), while normally all the constructors are prefix (in front of things).
03:13:16 <nitrix> harovali, data Trebejo = MkTrebejo Pieza Color
03:13:31 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
03:14:18 <nitrix> harovali, If you don't mind joining #haskell-beginners for a minute, I'll spam the bot a little to show you.
03:14:28 <harovali> nitrix: I go there
03:26:41 <hololeap> foldFixM :: (Monad m, Traversable t) => (t a -> m a) -> Fix t -> m a
03:27:27 <hololeap> what monad stack can I use here to only go n layers deep into the recursive structure, returning whatever it has accumulated when it hits the limit?
03:29:44 <ski> you'd want to have a result of type `m (Fix t)' ?
03:30:10 <hololeap> no, return type of `m a`
03:30:13 <ski> hm, or maybe `m (Either (Fix t) a)' ..
03:30:21 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 265 seconds)
03:30:35 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
03:30:35 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
03:30:35 wroathe joins (~wroathe@user/wroathe)
03:31:08 <hololeap> mostly I'm wondering what the proper monad transformer for aborting with a value would be... ExceptT? or is there something more appropriate?
03:32:13 <ski> if `t' is `Maybe', then if `n = 2' and you pass `(In . Just . In . Just . In . Just . In) Nothing', there can be no `a' to begin with, since you never reach the `Nothing'
03:33:26 <ski> `Either' and `ExceptT' is commonly fine for aborting with some result, yea
03:37:00 <ski> (fwiw, i'm not quite sure what you mean by "what monad stack can I use here to .." and "I'm wondering what the proper monad transformer for ..". monad stack or transformer, to be used *where* ? in the result type ? in the callback ?)
03:37:13 <hololeap> the `m`
03:37:34 <ski> `m' is a type variable
03:38:47 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 264 seconds)
03:38:57 <ski> so .. is having a return type of `ExceptT (Fix t) m a' ok ?
03:39:26 <ski> (type of the callback probably also needs to be changed)
03:39:48 <hololeap> @unmtl MaybeT (WriterT w (State s)) ()
03:39:49 <lambdabot> s -> (Maybe (), w, s)
03:40:31 <hololeap> % import Data.Fix
03:40:32 <yahb> hololeap:
03:46:07 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
03:46:07 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
03:46:07 wroathe joins (~wroathe@user/wroathe)
03:47:07 × retroid_ quits (~retro@2e41e9c8.skybroadband.com) (Ping timeout: 252 seconds)
03:48:07 <hololeap> % :t \f limit -> foldFixM (\m -> do { n <- Control.Monad.State.Class.get ; if n > limit then empty else do { tell (f m) ; put (n+1) } })
03:48:07 <yahb> hololeap: (Traversable t, MonadState s m, Ord s, Alternative m, MonadWriter w m, Num s) => (t () -> w) -> s -> Fix t -> m ()
03:48:20 <hololeap> something like that, I guess
03:50:18 retroid_ joins (~retro@2e41e9c8.skybroadband.com)
03:52:40 <ski> hm, so failing when you hit the limit, and otherwise log the bottom-up callback results ?
03:53:16 <ski> (with no interesting monadic result)
03:54:36 <hololeap> % :t \f limit -> foldFixM (\m -> do { n <- Control.Monad.State.Class.get ; if n > limit then empty else do { let x = f m; tell x ; put (n+1); pure x } })
03:54:37 <yahb> hololeap: ; <interactive>:1:125: error: parse error on input `;'
03:55:48 <harovali> nitrix: https://pastebin.com/hUeKFb29
03:57:12 <hololeap> % :t \f limit -> foldFixM (\m -> do { n <- Control.Monad.State.Class.get ; if n > limit then empty else let x = f m in do { tell x ; put (n+1); pure x } })
03:57:12 <yahb> hololeap: (Traversable t, MonadState s m, Ord s, Alternative m, MonadWriter a m, Num s) => (t a -> a) -> s -> Fix t -> m a
03:57:34 × Patternmaster quits (~georg@li1192-118.members.linode.com) (Remote host closed the connection)
03:57:41 <hololeap> yeah, the monad here is only to a) log some kind of result b) count the number of iterations c) abort when it hits some kind of limit
03:58:35 × xiongxin_ quits (~quassel@113.116.32.200) (Ping timeout: 264 seconds)
04:01:18 <hololeap> probably this: MaybeT (WriterT w (State Natural))
04:02:15 <nitrix> harovali, Hehe, nice.
04:03:29 <nitrix> harovali, You want either putStrLn $ show1 A Uno, or putStrLn (show1 A Uno), the ($) parenthesizes everything on its right so they're redundant.
04:03:30 <hololeap> or this: MaybeT (AccumT (Sum Natural) (Writer w))
04:04:36 <nitrix> harovali, May I suggest a new type? data Cell = Cell Columna Fila, then you can implement the instance Show Cell and use the show function normally.
04:04:53 × zaquest quits (~notzaques@5.128.210.178) (Remote host closed the connection)
04:05:15 <nitrix> harovali, The beauty in having abstractions is to be able to re-use them in generic code. If you create your own show1, it defeats the purpose a little.
04:06:51 zaquest joins (~notzaques@5.128.210.178)
04:07:01 <nitrix> harovali, Yes it's a lot of types, but they give you an algebra to express your domain. (aka Algebraic Data Types, ADT).
04:12:31 <ski> % :t \limit f ft -> (`fix` (0,ft)) \loop (n,ft@(Fix tft)) -> if n > limit then ExceptT (return (Left ft)) else do ta <- traverse (loop `curry` (n+1)) tft; ExceptT (liftM Right (f ta)) -- hm, not convinced this is actually sensible
04:12:31 <yahb> ski: (Num a, Ord a, Monad m, Traversable t) => a -> (t b -> m b) -> Fix t -> ExceptT (Fix t) m b
04:14:48 <ski> hololeap : what result do you actually want, when you hit the limit ?
04:19:01 × bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
04:19:51 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
04:20:02 xiongxin joins (~quassel@113.116.224.79)
04:22:20 Patternmaster joins (~georg@li1192-118.members.linode.com)
04:25:52 o1lo01ol1o joins (~o1lo01ol1@bl19-157-209.dsl.telepac.pt)
04:28:06 nitrix is now known as nitrix-or-treat
04:30:17 × o1lo01ol1o quits (~o1lo01ol1@bl19-157-209.dsl.telepac.pt) (Ping timeout: 265 seconds)
04:48:49 <hololeap> ski: this is it http://sprunge.us/448caB
04:49:01 × rekahsoft quits (~rekahsoft@cpe0008a20f982f-cm64777d666260.cpe.net.cable.rogers.com) (Ping timeout: 268 seconds)
04:54:13 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds)
04:57:21 <ski> hololeap : oh, that only checks the limit *after* already traversing to the leaves
04:59:27 <vaibhavsagar[m]> yates: https://github.com/ghc/ghc/blob/c9922a8e4d598f1c6a048305ca58d0ecf34d6776/compiler/Language/Haskell/Syntax/Expr.hs
05:01:26 <hololeap> *that should have been: else x <$ tell x
05:02:11 <hololeap> ski, hm I haven't tested it
05:02:38 <ski> (hm, i guess your original code (which also used `foldFixM') also had that issue)
05:03:28 <ski> (`foldFixM' does a *bottom-up* traversal. the callback is only given control, on the way back up)
05:03:35 <hololeap> so this wouldn't be counting layers, but nodes in the traversal order for t
05:04:04 <hololeap> or the reverse order? depth first search?
05:06:51 <hololeap> yeah, that makes sense. maybe I should make a version of Fix that carries the number of layers as a typenat
05:10:40 lavaman joins (~lavaman@98.38.249.169)
05:10:42 <hololeap> cata is analogous to foldr, so how do you make a left-fold version of cata?
05:11:01 <ski> mu
05:11:17 <hololeap> oh, I've seen that in the module
05:11:35 <ski>
05:11:39 <awpr> the other kind of mu, not the `Mu` type
05:11:51 × xiongxin quits (~quassel@113.116.224.79) (Ping timeout: 265 seconds)
05:11:58 <hololeap> what's "the other kind of mu"
05:12:19 <awpr> https://www.awakin.org/read/view.php?tid=583
05:12:29 <ski> "The term is often used or translated to mean that the question itself must be \"unasked\": no answer can exist in the terms provided."
05:12:30 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
05:13:25 <awpr> foldl being a tail-recursive thing that "carries along" information downwards until it reaches the leaves, doesn't naturally make sense in contexts other than lists
05:13:33 <hololeap> so the Mu in Data.Fix is just a coincidence??
05:13:43 <ski> it's another thing, yea
05:14:25 <awpr> like for a binary tree, you could imagine accumulating paths down to the leaves, but it can't just return the recursive call, since there are two of them
05:15:19 <hololeap> a binary tree probably has a Foldable instance, so you could use foldl
05:15:30 <awpr> there's exactly one root of a tree, so folding leaf-to-root makes sense, but folding root-to-leaf only makes sense when there's exactly one leaf
05:15:32 <hololeap> oh, but that's not level-aware
05:15:40 <awpr> right, that's a different axis of generalizing folds
05:15:49 <awpr> foldr of that is not cata, for example
05:16:05 <hololeap> gotcha
05:16:41 × segfaultfizzbuzz quits (~segfaultf@135-180-0-138.static.sonic.net) (Ping timeout: 265 seconds)
05:17:13 <c_wraith> It's really foldl over an in-order traversal.
05:17:20 <c_wraith> linearize it, then fold
05:19:15 <c_wraith> by the way, https://hackage.haskell.org/package/tree-traversals is an interesting package for doing tree traversals in other orders
05:23:12 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
05:27:33 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
05:27:42 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Read error: Connection reset by peer)
05:30:22 frosky joins (~froskyarr@59.41.162.152)
05:38:58 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
05:39:59 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 264 seconds)
05:40:22 mikoto-chan joins (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
05:41:34 bitmapper joins (~user@142.134.87.154)
05:43:02 lavaman joins (~lavaman@98.38.249.169)
05:45:59 × bitmapper quits (~user@142.134.87.154) (Ping timeout: 264 seconds)
05:47:36 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
05:53:05 geekosaur joins (~geekosaur@xmonad/geekosaur)
05:55:35 <hololeap> c_wraith: good find!
06:01:23 <gentauro> I have added this on the top of my module file: `{-# OPTIONS_GHC -Wall -Werror -fpackage-trust #-}`. When I :load the file in GHCi, I get this error: «Prelude: Can't be safely imported! The package (base-4.14.1.0) the module resides in isn't trusted». Which is OK
06:02:37 <gentauro> when I then add the `trust flag` like this: `{-# OPTIONS_GHC -Wall -Werror -fpackage-trust -trust=base #-}`, I get the following error: «unknown flag in {-# OPTIONS_GHC #-} pragma: -trust=base», which is not OK
06:02:55 <gentauro> anybody know how to add the `-trust=[PKG_GO_HERE]`?
06:08:28 <hololeap> gentauro: looks like it's `trust [PKG]` not `trust=[PKG]`, according to the man page for ghc
06:08:41 <hololeap> -trust
06:11:00 × wyrd quits (~wyrd@gateway/tor-sasl/wyrd) (Quit: leaving)
06:11:11 <gentauro> hololeap: similar error: «unknown flag in {-# OPTIONS_GHC #-} pragma: -trust [base]» when I write: `{-# OPTIONS_GHC -Wall -Werror -fpackage-trust "-trust [base]" #-}`
06:12:02 <gentauro> if I write without quotes, I get tihs: «unknown flag in {-# OPTIONS_GHC #-} pragma: -trust» and «unknown flag in {-# OPTIONS_GHC #-} pragma: [base]»
06:12:03 <hololeap> probably get rid of the quotes
06:12:11 <gentauro> it's like it doesn't recognize `-trust` …
06:12:19 <gentauro> could it be dissallowed?
06:13:39 <gentauro> I mean, this works perfectly when in my .cabal file:
06:13:47 <gentauro> -fpackage-trust
06:13:53 <gentauro> -trust=base
06:14:02 <gentauro> ups
06:14:03 <gentauro> ghc-options:
06:14:06 <gentauro> -fpackage-trust
06:14:10 <gentauro> -trust=base
06:15:41 lavaman joins (~lavaman@98.38.249.169)
06:17:08 <hololeap> gentauro: what about this? `import safe Prelude`
06:17:42 <hololeap> (in your imports, not the pragma)
06:18:06 benin joins (~benin@183.82.25.86)
06:18:47 <gentauro> hololeap: I don't import anything from Prelude :)
06:19:16 <gentauro> but seems "strange" that I would have to import all modules like that from `base`. That could take some time :)
06:20:11 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
06:20:51 <hololeap> you _always_ import from prelude, unless you have {-# LANGUAGE ImplicitPrelude #-}
06:23:07 <gentauro> hololeap: added `{-# LANGUAGE ImplicitPrelude #-}` and then `import safe Prelude`, but I still get: «Prelude: Can't be safely imported! The package (base-4.14.1.0) the module resides in isn't trusted.»
06:23:57 <gentauro> it seems that perhaps somebody `disabled` (or forgot) to allow `-fpackage-trust -trust=base` in `{-# OPTIONS_GHC … #-}`
06:24:56 <hololeap> https://downloads.haskell.org/ghc/latest/docs/html/users_guide/exts/rebindable_syntax.html#extension-NoImplicitPrelude
06:25:19 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:25:59 <hololeap> Prelude is imported by default
06:26:02 <hololeap> https://downloads.haskell.org/ghc/latest/docs/html/users_guide/exts/safe_haskell.html#safe-imports
06:26:28 <gentauro> hololeap: yes, I'm reading the docs https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#options-ghc-pragma
06:26:47 <hololeap> you can import Prelude (explicitly) with the safe keyword: import safe Prelude
06:27:07 <gentauro> hololeap: yes, I tried that and gives the same error (I just wrote it above)
06:27:20 <hololeap> hm ok
06:27:51 <gentauro> like I also said, perhaps somebody (disabled/forgot) to add support for `-fpackage-trust -trust=base` in `{-# OPTIONS_GHC … #-}`
06:28:05 <gentauro> because it works perfectly in the `.cabal` files :)
06:40:24 nunggu joins (q@gateway/vpn/protonvpn/nunggu)
06:42:00 × nunggu quits (q@gateway/vpn/protonvpn/nunggu) (Client Quit)
06:50:32 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
06:53:16 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
07:05:15 takuan_dozo joins (~takuan@178-116-218-225.access.telenet.be)
07:05:15 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Read error: Connection reset by peer)
07:13:11 gehmehgeh joins (~user@user/gehmehgeh)
07:13:37 × phma quits (~phma@host-67-44-208-96.hnremote.net) (Read error: Connection reset by peer)
07:14:28 phma joins (~phma@host-67-44-209-44.hnremote.net)
07:16:17 × aegon quits (~mike@174.127.249.180) (Remote host closed the connection)
07:18:44 xiongxin joins (~quassel@113.116.224.79)
07:24:59 × werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 264 seconds)
07:25:15 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
07:25:17 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b4b8:992:53b6:115b) (Remote host closed the connection)
07:30:25 × ski quits (~ski@remote12.chalmers.se) (Ping timeout: 252 seconds)
07:34:52 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Remote host closed the connection)
07:35:04 × azeem quits (~azeem@2a00:801:238:7fcb:5228:4a72:5b90:f025) (Ping timeout: 265 seconds)
07:35:06 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
07:35:40 azeem joins (~azeem@m90-129-195-27.cust.tele2.se)
07:38:20 ski joins (~ski@remote12.chalmers.se)
07:44:13 wonko joins (~wjc@62.115.229.50)
07:45:26 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:50:55 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
07:52:07 × caef^ quits (~caef@70.166.66.234) (Remote host closed the connection)
07:55:55 × tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz)
07:56:08 retro_ joins (~retro@2e41e9c8.skybroadband.com)
07:57:14 × forell quits (~forell@user/forell) (Quit: ZNC - https://znc.in)
07:59:01 × retroid_ quits (~retro@2e41e9c8.skybroadband.com) (Ping timeout: 252 seconds)
07:59:32 forell joins (~forell@user/forell)
08:02:19 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Quit: Leaving)
08:06:12 hendursa1 joins (~weechat@user/hendursaga)
08:08:06 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
08:09:36 × hendursaga quits (~weechat@user/hendursaga) (Ping timeout: 276 seconds)
08:12:30 max22- joins (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
08:16:02 Tuplanolla joins (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
08:16:49 fendor joins (~fendor@77.119.216.44.wireless.dyn.drei.com)
08:17:48 allbery_b joins (~geekosaur@xmonad/geekosaur)
08:17:48 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
08:17:51 allbery_b is now known as geekosaur
08:17:55 o1lo01ol1o joins (~o1lo01ol1@bl19-157-209.dsl.telepac.pt)
08:20:55 × hnOsmium0001 quits (uid453710@id-453710.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
08:22:46 × o1lo01ol1o quits (~o1lo01ol1@bl19-157-209.dsl.telepac.pt) (Ping timeout: 265 seconds)
08:23:49 × xiongxin quits (~quassel@113.116.224.79) (Read error: Connection reset by peer)
08:24:22 xiongxin joins (~quassel@113.116.224.79)
08:25:43 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c12e:d762:e1c6:5c95)
08:30:23 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c12e:d762:e1c6:5c95) (Ping timeout: 264 seconds)
08:32:11 acidjnk joins (~acidjnk@p200300d0c703cb97596ef3e4428d3d40.dip0.t-ipconnect.de)
08:46:45 × Inst quits (~Inst@2601:6c4:4080:3f80:357d:a798:4766:f7a0) (Remote host closed the connection)
08:47:02 Inst joins (~Inst@2601:6c4:4080:3f80:d8ab:2e91:63f7:db6e)
08:47:02 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
08:47:16 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
08:53:33 <hololeap> gentauro: When the -XSafe flag is used, the safe keyword is allowed but meaningless, as every import is treated as a safe import.
08:53:37 hololeap shrugs
08:53:52 <hololeap> it might work
08:55:39 mc47 joins (~mc47@xmonad/TheMC47)
08:59:59 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
09:00:31 × IgnatInsarov[m] quits (~kindaroma@2001:470:69fc:105::f5d9) (Quit: You have been kicked for being idle)
09:02:10 × Inst quits (~Inst@2601:6c4:4080:3f80:d8ab:2e91:63f7:db6e) (Read error: Connection reset by peer)
09:07:58 <gentauro> hololeap: tried that as well
09:08:23 <gentauro> but the PRAGMA doesn't `parse` the `-trust=base` value …
09:08:54 <gentauro> I'm giving an (online) talk (Spanish) at 19:00 CET so I will just write it's a BUG xD
09:09:11 gentauro cos it works in .cabal files, I would expect it should work for PRAGMAS as well right?
09:16:02 × azeem quits (~azeem@m90-129-195-27.cust.tele2.se) (Read error: Connection reset by peer)
09:17:15 × hendursa1 quits (~weechat@user/hendursaga) (Remote host closed the connection)
09:17:41 hendursa1 joins (~weechat@user/hendursaga)
09:20:35 <jophish> boo, ghc 9 doesn't accept my code any more
09:20:49 <jophish> `const () :: (forall a b. a -> b) -> ()`
09:21:52 <Hecate> % :t const () :: (forall a b. a -> b) -> ()
09:21:52 <yahb> Hecate: ; <interactive>:1:1: error:; * Couldn't match type `b0' with `forall a b. a -> b'; Expected: (forall a b. a -> b) -> (); Actual: b0 -> (); Cannot instantiate unification variable `b0'; with a type involving polytypes: forall a b. a -> b; * In the expression: const () :: (forall a b. a -> b) -> ()
09:21:58 <Hecate> yummy
09:22:28 <Hecate> jophish: Do you think it's intentional?
09:23:10 <tomsmeding> :t (\x -> const () x) :: (forall a b. a -> b) -> ()
09:23:11 <lambdabot> (forall a b. a -> b) -> ()
09:23:12 <jophish> Yeah, I remember seeing some simplification of the type checker along these lines go past
09:23:20 <tomsmeding> simplified subsumption is what causes this
09:23:44 <tomsmeding> I believe the majority of cases where it makes a difference are fixed by eta expansion, if not all
09:24:36 <jophish> 👍️ Thanks both!
09:25:03 <tomsmeding> before this was released, there was literally someone that went through the n most popular hackage packages and manually converted them to work with this simplified subsumption
09:25:30 <tomsmeding> I believe the only package that wasn't fixed by some form of eta expansion was some package that did wild type-level tricks and the person in question couldn't figure out what was going on :p
09:26:11 × benin quits (~benin@183.82.25.86) (Ping timeout: 264 seconds)
09:26:53 <jophish> hahah
09:27:13 <jophish> Mine didn't compile trivially with 9.0 so I guess it missed that!
09:28:09 benin joins (~benin@183.82.25.86)
09:28:55 <tomsmeding> there's only so many packages one person can manually convert before saying day's over :p
09:28:59 <jophish> oh bother, one last thing. I test that I get a specific error message from ghc (should probably reconsider this anyway). but ghc 8 and 9 report different column numbers lol
09:29:17 <tomsmeding> but yeah I may have misremembered and there may have been some other issues as well
09:29:45 <tomsmeding> hehe I'm fairly sure that's not a "public api" in the sense that they try not to change that
09:29:53 <jophish> https://github.com/expipiplus1/autoapply/blob/d72f2eee8c40be48cb4bdb5f3324d88a58cb9147/test/Types.hs#L316 this becomes column 7 for ghc 9
09:30:01 <jophish> yeah, can't really blame ghc here
09:30:12 × hendursa1 quits (~weechat@user/hendursaga) (Remote host closed the connection)
09:30:23 <tomsmeding> in fact, there's now an effort underway to overhaul ghc's internal representation of diagnostic messages, so probably in the next release lots of tiny formatting details will change anyway
09:30:38 hendursa1 joins (~weechat@user/hendursaga)
09:31:09 <tomsmeding> jophish: comment already says "7"
09:31:27 <jophish> oh, in that case it was 7 and is now 6
09:31:47 <tomsmeding> ah
09:32:42 <jophish> guess I can use `...` for doctest's arbitrary output
09:34:10 × wz1000 quits (~zubin@static.11.113.47.78.clients.your-server.de) (Ping timeout: 252 seconds)
09:34:13 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
09:35:37 <gentauro> btw, there are no way to have several modules in the same file right? (submitting for a code kata?)
09:36:07 <tomsmeding> fairly sure ghc doesn't support that, and the haskell report is ambiguous on whether it's even specified
09:37:42 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
09:37:42 jakalx joins (~jakalx@base.jakalx.net)
09:39:06 × shriekingnoise quits (~shrieking@186.137.144.80) (Quit: Quit)
09:41:35 <jophish> See https://github.com/ghc-proposals/ghc-proposals/pull/283 gentauro
09:47:11 × hendursa1 quits (~weechat@user/hendursaga) (Remote host closed the connection)
09:47:18 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
09:47:35 hendursa1 joins (~weechat@user/hendursaga)
09:49:29 <gentauro> jophish: thx
09:50:03 <jophish> haha, probably won't help you for a looong time
09:51:38 img joins (~img@user/img)
09:53:01 × bitmapper quits (uid464869@id-464869.lymington.irccloud.com) (Quit: Connection closed for inactivity)
09:59:32 <hololeap> I figured out a way to tell ghc that the role of a type (constructor) is not nominal when doing coercions
09:59:50 <hololeap> type CoerceF f = forall x y. Coercible x y => Coercible (f x) (f y) :: Constraint
10:00:17 × mikoto-chan quits (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Read error: No route to host)
10:03:44 mikoto-chan joins (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
10:05:14 × xiongxin quits (~quassel@113.116.224.79) (Ping timeout: 265 seconds)
10:07:43 <tomsmeding> wasn't there a blog post on haskell weekly recently about this trick?
10:08:13 hololeap shrugs
10:08:35 <hololeap> I didn't read it, if there was
10:09:11 <hololeap> % type CoerceF f = forall x y. Coercible x y => Coercible (f x) (f y) :: Constraint
10:09:11 <yahb> hololeap:
10:09:25 <hololeap> % thing :: CoerceF f => f (Sum Int) -> f Int ; thing = coerce
10:09:25 <yahb> hololeap:
10:09:38 <hololeap> thing [Sum 1, Sum 2, Sum 3]
10:09:44 <hololeap> % thing [Sum 1, Sum 2, Sum 3]
10:09:44 <yahb> hololeap: [1,2,3]
10:10:36 <hololeap> % thing (Just (Sum 999))
10:10:36 <yahb> hololeap: Just 999
10:10:43 <tomsmeding> ah no it was here https://discourse.haskell.org/t/describing-type-roles-as-constraints/3410
10:10:59 jgeerds joins (~jgeerds@55d4da80.access.ecotel.net)
10:15:07 zincy joins (~tom@2a00:23c8:970c:4801:d922:ea97:b63a:4161)
10:15:16 <hololeap> tomsmeding: weird that they came up with that around the same exact time I did
10:15:27 lavaman joins (~lavaman@98.38.249.169)
10:15:35 <hololeap> 100 monkeys or some ***
10:16:37 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
10:16:42 <tomsmeding> nice how that works, isn't it
10:17:07 <hololeap> I had just learned about QuantifiedConstraints
10:17:32 <hololeap> it's such a useful extension
10:17:47 × hendursa1 quits (~weechat@user/hendursaga) (Remote host closed the connection)
10:18:14 hendursa1 joins (~weechat@user/hendursaga)
10:19:18 × mikoto-chan quits (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Read error: Connection reset by peer)
10:20:19 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
10:20:48 wyrd joins (~wyrd@gateway/tor-sasl/wyrd)
10:25:00 mikoto-chan joins (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be)
10:25:07 <hololeap> % :set -XUndecidableInstances
10:25:07 <yahb> hololeap:
10:25:26 <hololeap> % deriving newtype instance (forall a. Semigroup a => Semigroup (f a)) => Semigroup (Fix f)
10:25:26 <yahb> hololeap:
10:25:42 <hololeap> % deriving newtype instance (forall a. Semigroup a => Monoid (f a)) => Monoid (Fix f)
10:25:42 <yahb> hololeap:
10:27:03 <hololeap> what I don't understand is: what does that ^ work, but this \/ doesn't?
10:27:06 <hololeap> % deriving newtype instance (forall a. Monoid a => Monoid (f a)) => Monoid (Fix f)
10:27:06 <yahb> hololeap: ; <interactive>:155:1: error:; * Could not deduce (Monoid a) arising from the superclasses of an instance declaration; from the context: forall a. Monoid a => Monoid (f a) bound by the instance declaration at <interactive>:155:1-80; or from: Semigroup a bound by a quantified context at <interactive>:1:1; Possible fix: add (Monoid a) to the context of a quantified context; * In
10:27:45 <tomsmeding> % :i Fix
10:27:45 <yahb> tomsmeding: type role Fix nominal; type Fix :: (* -> *) -> *; newtype Fix f = Fix {unFix :: f (Fix f)}; -- Defined in `Data.Fix'; instance [safe] (forall a. Semigroup a => Monoid (f a)) => Monoid (Fix f) -- Defined at <interactive>:153:1; instance [safe] (forall a. Semigroup a => Semigroup (f a)) => Semigroup (Fix f) -- Defined at <interactive>:152:1; instance Data.Functor.Classes.Eq1 f => Eq (Fix f) -- Defined
10:29:46 oxide joins (~lambda@user/oxide)
10:31:32 <tomsmeding> the error is not even when writing the instance body, it's the instance _declaration_ that ghc doesn't like
10:31:41 <tomsmeding> % instance (forall a. Monoid a => Monoid (f a)) => Monoid (Fix f) where
10:31:41 <yahb> tomsmeding: ; <interactive>:157:10: error:; * Could not deduce (Monoid a) arising from the superclasses of an instance declaration; from the context: forall a. Monoid a => Monoid (f a) bound by the instance declaration at <interactive>:157:10-63; or from: Semigroup a bound by a quantified context at <interactive>:1:1; Possible fix: add (Monoid a) to the context of a quantified context; * I
10:32:32 <hololeap> 👏
10:33:05 <tomsmeding> and it's also not specific to Fix
10:33:14 <tomsmeding> % newtype NonFix f = NonFix (f Int)
10:33:15 <yahb> tomsmeding:
10:33:21 <tomsmeding> % instance (forall a. Monoid a => Monoid (f a)) => Monoid (NonFix f) where
10:33:21 <yahb> tomsmeding: ; <interactive>:159:10: error:; * Could not deduce (Semigroup (NonFix f)) arising from the superclasses of an instance declaration; from the context: forall a. Monoid a => Monoid (f a) bound by the instance declaration at <interactive>:159:10-66; * In the instance declaration for `Monoid (NonFix f)'
10:33:36 <tomsmeding> wait error is different
10:33:37 kaiwk joins (~kai@124.78.251.64)
10:33:47 <tomsmeding> oh
10:34:21 <hololeap> % instance (forall a. Semigroup a => Monoid (f a)) => Monoid (NonFix f) where
10:34:22 <yahb> hololeap: ; <interactive>:160:10: error:; * Could not deduce (Semigroup (NonFix f)) arising from the superclasses of an instance declaration; from the context: forall a. Semigroup a => Monoid (f a) bound by the instance declaration at <interactive>:160:10-69; * In the instance declaration for `Monoid (NonFix f)'
10:34:22 <tomsmeding> % instance (forall a. Semigroup a => Semigroup (f a)) => Semigroup (NonFix f) where
10:34:22 <yahb> tomsmeding: ; <interactive>:161:10: warning: [-Wmissing-methods]; * No explicit implementation for; `<>'; * In the instance declaration for `Semigroup (NonFix f)'
10:34:34 <tomsmeding> % instance (forall a. Monoid a => Monoid (f a)) => Monoid (NonFix f) where
10:34:34 <yahb> tomsmeding: ; <interactive>:162:10: error:; * Could not deduce (Monoid a) arising from the superclasses of an instance declaration; from the context: forall a. Monoid a => Monoid (f a) bound by the instance declaration at <interactive>:162:10-66; or from: Semigroup a bound by a quantified context at <interactive>:1:1; Possible fix: add (Monoid a) to the context of a quantified context; * I
10:34:36 <tomsmeding> there we go
10:35:12 <hololeap> the probelm there is that Int isn't a semigroup
10:35:25 <tomsmeding> who cares? ghc is complaining about the instance head
10:36:01 × kaiwk quits (~kai@124.78.251.64) (Remote host closed the connection)
10:36:11 <hololeap> % newtype NomFix f = NomFix (f (Sum Int))
10:36:11 <yahb> hololeap:
10:36:36 <tomsmeding> also, Const m Int is a semigroup if m is a semigroup ;)
10:36:44 <tomsmeding> so no inherent contradiction in my NonFix
10:36:56 <tomsmeding> nomnom
10:37:33 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
10:37:34 <hololeap> % instance (forall a. Semigroup a => Semigroup (f a)) => Semigroup (NomFix f) where
10:37:34 <yahb> hololeap: ; <interactive>:164:10: warning: [-Wmissing-methods]; * No explicit implementation for; `<>'; * In the instance declaration for `Semigroup (NomFix f)'
10:37:51 dsrt^ joins (~dsrt@70.166.66.234)
10:39:28 <hololeap> % instance (forall a. Monoid a => Monoid (f a)) => Semigroup (NomFix f) where
10:39:28 <yahb> hololeap: ; <interactive>:165:10: warning: [-Wmissing-methods]; * No explicit implementation for; `<>'; * In the instance declaration for `Semigroup (NomFix f)'
10:39:45 <hololeap> % instance (forall a. Monoid a => Monoid (f a)) => Monoid (NomFix f) where
10:39:45 <yahb> hololeap: ; <interactive>:166:10: warning: [-Wmissing-methods]; * No explicit implementation for; `mempty'; * In the instance declaration for `Monoid (NomFix f)'
10:39:52 <tomsmeding> wat
10:39:58 <hololeap> lol
10:40:09 <hololeap> I have no idea
10:40:28 <tomsmeding> like, how can that even make a difference
10:40:48 <tomsmeding> % instance Semigroup Int where
10:40:48 <yahb> tomsmeding: ; <interactive>:167:10: warning: [-Wmissing-methods]; * No explicit implementation for; `<>'; * In the instance declaration for `Semigroup Int'
10:40:56 <tomsmeding> % instance (forall a. Monoid a => Monoid (f a)) => Monoid (NonFix f) where
10:40:56 <yahb> tomsmeding: ; <interactive>:168:10: error:; * Could not deduce (Monoid a) arising from the superclasses of an instance declaration; from the context: forall a. Monoid a => Monoid (f a) bound by the instance declaration at <interactive>:168:10-66; or from: Semigroup a bound by a quantified context at <interactive>:1:1; Possible fix: add (Monoid a) to the context of a quantified context; * I
10:41:01 <tomsmeding> ghc is drunk
10:41:15 <hololeap> % instance (forall a. Monoid a => Monoid (f a)) => Monoid (NomFix f) where
10:41:15 <yahb> hololeap: ; <interactive>:169:10: warning: [-Wmissing-methods]; * No explicit implementation for; `mempty'; * In the instance declaration for `Monoid (NomFix f)'
10:41:22 <hololeap> you gotta use the nomnom
10:41:33 <tomsmeding> apparently
10:41:41 <tomsmeding> must have Nom in the name, otherwise no monoids for you
10:42:34 <hololeap> nomoids
10:43:09 <tomsmeding> ah no the difference is something else
10:43:18 <tomsmeding> you gave a (Monoid =>Monoid) => Semigroup instance
10:43:22 <tomsmeding> that is the crucial difference
10:43:41 <tomsmeding> OH
10:43:51 <hololeap> % deriving newtype instance (forall a. Monoid a => Monoid (f a)) => Monoid (Fix f)
10:43:51 <yahb> hololeap: ; <interactive>:170:1: error:; * Could not deduce (Monoid a) arising from the superclasses of an instance declaration; from the context: forall a. Monoid a => Monoid (f a) bound by the instance declaration at <interactive>:170:1-80; or from: Semigroup a bound by a quantified context at <interactive>:1:1; Possible fix: add (Monoid a) to the context of a quantified context; * In
10:44:20 <tomsmeding> probably when you give an instance 'C => Monoid a', then because of 'class Semigroup a => Monoid a' ghc requires that 'C => Semigroup a'
10:45:02 <tomsmeding> but you can't build a 'Semigroup a => Semigroup (f a)' from a 'Monoid a => Monoid (f a)', because what are you going to give to the second function when given just a Semigroup a
10:45:23 <tomsmeding> % deriving newtype instance (forall a. Monoid a => Monoid (f a)) => Semigroup (Fix f)
10:45:23 <yahb> tomsmeding: ; <interactive>:171:1: error:; * Could not deduce (Monoid a) arising from a use of `<>'; from the context: forall a. Monoid a => Monoid (f a) bound by the instance declaration at <interactive>:171:1-83; or from: Semigroup a bound by a quantified context at <interactive>:1:1; Possible fix: add (Monoid a) to the context of a quantified context; * In the third argument of `coerce'
10:46:37 <tomsmeding> ah that's not going to work of course
10:46:50 <tomsmeding> oooooh
10:46:58 <tomsmeding> % deriving newtype instance (forall a. (Semigroup a, Monoid a) => Monoid (f a)) => Semigroup (Fix f) ; deriving newtype instance (forall a. (Semigroup a, Monoid a) => Monoid (f a)) => Monoid (Fix f)
10:46:59 <yahb> tomsmeding:
10:47:08 <tomsmeding> need to have both at the same time, and then both at the same time
10:47:53 <hololeap> why the monoid constraint on (f a) for semigroup?
10:48:09 td_ joins (~td@94.134.91.73)
10:48:12 <tomsmeding> no reason other than to be able to write the Monoid instance for Fix
10:48:33 <hololeap> hm, does that actually make sense, though?
10:48:34 <tomsmeding> C => Monoid (Fix f) requires that C => Semigroup (Fix f), I think, due to the superclass constraint of Monoid
10:49:29 <tomsmeding> so if you have (forall a. Monoid a => Monoid (f a)) => Monoid (Fix f), and also (forall a. Semigroup a => Semigroup (f a)) => Semigroup (Fix f), then ghc needs to somehow make a Semigroup a => Semigroup (f a) from a Monoid a => Monoid (f a)
10:49:41 <tomsmeding> and you can't do that in general
10:49:44 f-a parts (f2a@f2a.jujube.ircnow.org) ()
10:50:03 <tomsmeding> because there's no 'Monoid a' to call that "function" with
10:50:27 <tomsmeding> so you need (Semigroup a, Monoid a) on the Semigroup instance in order to write the Monoid instance
10:50:44 <tomsmeding> ah and then 'Monoid a => Monoid f a' is sufficient on the monoid instance
10:50:57 coot joins (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl)
10:51:36 <hololeap> % deriving newtype instance (forall a. (Semigroup a, Monoid a) => Monoid (f a)) => Semigroup (Fix f) ; deriving newtype instance (forall a. Monoid a => Monoid (f a)) => Monoid (Fix f)
10:51:36 <yahb> hololeap:
10:52:07 <hololeap> % deriving newtype instance (forall a. (Semigroup a, Monoid a) => Semigroup (f a)) => Semigroup (Fix f) ; deriving newtype instance (forall a. Monoid a => Monoid (f a)) => Monoid (Fix f)
10:52:07 <yahb> hololeap: ; <interactive>:174:1: error:; * Could not deduce (Monoid (f a)) arising from a use of `<>'; from the context: forall a. (Semigroup a, Monoid a) => Semigroup (f a) bound by the instance declaration at <interactive>:174:1-101; or from: Monoid a bound by a quantified context at <interactive>:1:1; * In the third argument of `coerce', namely `((<>) @(f (Fix f)))'; In the expression
10:52:39 <tomsmeding> hm you ought to be able to make a Semigroup (f a) from a Monoid (f a)
10:52:58 <tomsmeding> oh no that's not the instance head, that's defining <>
10:53:01 <tomsmeding> this is because of Fix
10:53:15 <tomsmeding> can't satisfy the 'Monoid a' constraint recursively if you only get Semigroup (f a)
10:53:43 <hololeap> right the `a` will be replaced by `Fix f`
10:53:49 <hololeap> oh, that makes sense
10:54:12 <tomsmeding> ghc not drunk afterall
10:54:27 <hololeap> generally not :)
10:55:47 <Franciman> Glasgow Haskell Cointreau
10:56:08 <tomsmeding> "the third argument of `coerce', namely `((<>) @(f (Fix f)))'"
10:56:13 <tomsmeding> what even are the first and second arguments
10:56:38 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
10:57:06 DNH joins (~DNH@2a02:8108:1100:16d8:8896:1441:fbe3:768)
10:57:32 <hololeap> maybe because coerce is so damn polymorphic and it's searching for some resolution
11:00:04 <hololeap> % deriving newtype instance (forall a. Semigroup a => Semigroup (f a)) => Semigroup (Fix f) ; deriving newtype instance (forall a. Semigroup a => Monoid (f a)) => Monoid (Fix f)
11:00:04 <yahb> hololeap:
11:00:13 <hololeap> there's also that solution
11:00:26 <tomsmeding> right, which makes sense for some f
11:00:39 <tomsmeding> kinda sad that you have to choose
11:00:39 <hololeap> monoidal-containers
11:00:53 alx741 joins (~alx741@186.178.108.200)
11:01:44 <hololeap> (Eq k, Hashable k, Semigroup a) => Semigroup (MonoidalHashMap k a)
11:01:54 <hololeap> (Eq k, Hashable k, Semigroup a) => Monoid (MonoidalHashMap k a)
11:02:06 <tomsmeding> yeah also Maybe :p
11:02:15 <hololeap> True
11:02:25 <hololeap> interesting correlation
11:02:31 <tomsmeding> actually lots of stuff
11:03:04 <hololeap> although Maybe is isomorphic to HashMap ()
11:06:26 Guest33 joins (~Guest33@175.101.107.131)
11:08:25 × Guest33 quits (~Guest33@175.101.107.131) (Client Quit)
11:10:35 xiongxin joins (~quassel@113.116.224.79)
11:11:18 rusua joins (uid124537@id-124537.uxbridge.irccloud.com)
11:12:01 AlexNoo_ joins (~AlexNoo@94.233.240.148)
11:14:16 × AlexZenon quits (~alzenon@178.34.163.33) (Ping timeout: 252 seconds)
11:14:49 × Alex_test quits (~al_test@178.34.163.33) (Ping timeout: 252 seconds)
11:15:52 × AlexNoo quits (~AlexNoo@178.34.163.33) (Ping timeout: 252 seconds)
11:19:42 AlexZenon joins (~alzenon@94.233.240.148)
11:19:52 Alex_test joins (~al_test@94.233.240.148)
11:21:43 tcard joins (~tcard@p2878075-ipngn18701hodogaya.kanagawa.ocn.ne.jp)
11:23:12 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
11:24:41 AlexNoo_ is now known as AlexNoo
11:30:06 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
11:32:27 nsilv joins (~NSilv@host-87-15-180-17.retail.telecomitalia.it)
11:35:20 <nsilv> hey guys random question, does anyone have an easily pullable ready to use nvim configuration for haskell with LSP included somewhere? I just need one for a coding interview task cause I'm running it on a new nixos instance and don't have the time to tinker with it yet haha
11:35:38 <nsilv> (I would use vscode with the Haskell plugin but it really doesn't seem to like my nixos)
11:37:17 <[exa]> nsilv: https://github.com/neovim/nvim-lspconfig ?
11:37:48 <nsilv> [exa]: would that be enough just for a barely functional setup? I'll try it
11:37:59 <[exa]> it should kinda work but it's not haskell-specific
11:38:06 <[exa]> otoh the haskell specifics should be in the HLS
11:38:23 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
11:38:49 <nsilv> I really wanted to use VSCode just for the time being even if I like nvim more but nixos gets a 404 when trying to pull the tarball T_T
11:39:37 <[exa]> why not go without ide?
11:40:12 <nsilv> exploring a codebase I don't know mostly. I guess I could just wing it with ghci and ghcid though
11:40:43 <[exa]> I live with splitscreen vi/hackage/terminal, and sometimes a bit of grep
11:40:50 Guest|66 joins (~Guest|66@212.193.94.28)
11:40:56 <[exa]> ah yes that helps
11:40:57 × Guest|66 quits (~Guest|66@212.193.94.28) (Client Quit)
11:41:37 <[exa]> unless the package has a generated haddock, which should be kinda a best way to start
11:41:40 <[exa]> :]
11:41:41 <nsilv> the problem is I don't know how to pull up ghcid in their nix setup and it's obviously sunday so I can't really ask and get a response
11:43:10 <[exa]> imo, nvim is also a bit of a problematic buildingblock, vim fans stay with vim and many nvim users migrated to the emacsy editors
11:43:52 <nsilv> idk I kinda like nvim but I might give emacs a try again, tbh I stopped using emacs cause of performance issues cause I used to run on windows with WSL2
11:45:14 <[exa]> some people here were pretty happy with spacemacs and the doom-emacs thing
11:45:33 __monty__ joins (~toonn@user/toonn)
11:45:37 <nsilv> doom was decent for me but spacemacs was abysmally slow, I should probably get a bare emacs setup going
11:46:11 <hololeap> nsilv: kate with lsp enabled is good too. nice graphical IDE, but still pretty minimal
11:46:40 <nsilv> hololeap: never tried kate
11:46:44 <bontaq> doom-emacs is my main editor and it's been pretty good to me
11:47:22 <nsilv> I'll definitely try doom again but I usually go down rabbitholes with emacs that last multiple hours hahaha
11:47:39 <nsilv> even just installing the nativecomp version scares me
11:50:42 <bontaq> that's half the fun (or risk?)
11:51:09 <nsilv> yeah but I have a coding task for a job I really want to get and I want to make a good impression and finish it on monday
11:51:11 <nsilv> D:
11:53:01 Guest32 joins (~Guest32@82.40.121.143)
11:55:32 × max22- quits (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Ping timeout: 268 seconds)
11:56:07 <hololeap> I still say try out kate. you can generate an lsp config with `haskell-language-server generate-default-config` and a hie.yaml with `gen-hie`. after that it's pretty intuitive
11:58:07 <tomsmeding> nsilv: this is a (somewhat...) cleaned up version of my config https://paste.tomsmeding.com/kNVztlGt
11:58:29 <tomsmeding> put 'source /home/nsilv/.vimrc' in your .config/nvim/init.vim
11:58:43 <tomsmeding> (possibly it also works to put that whole thing in init.vim, not tested)
11:59:18 × jgeerds quits (~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 265 seconds)
11:59:36 <tomsmeding> do this https://github.com/junegunn/vim-plug#neovim then run :PlugUpdate in nvim, then restart nvim
12:00:04 <Guest32> If I have some type-level naturals `N` defined, and a type family for type-level addition `Add :: N -> N -> N`, I sometimes need to use associativity of addition as a constraint `(Add (Add a b) c ~ Add a (Add b c)) => ...`. I know that this is always true, but is there any way to explain that to GHC?
12:00:05 <tomsmeding> lots of non-essential stuff in that config though
12:00:59 × ArctVaulMarsHMPJ quits (~pjetcetal@2.95.44.252) (Ping timeout: 264 seconds)
12:01:57 <hololeap> % :i (+)
12:01:57 <yahb> hololeap: type Num :: * -> Constraint; class Num a where; (+) :: a -> a -> a; ...; -- Defined in `GHC.Num'; infixl 6 +
12:02:18 <hololeap> % import GHC.TypeNats
12:02:18 <yahb> hololeap:
12:02:21 <hololeap> % :i (+)
12:02:21 <yahb> hololeap: type Num :: * -> Constraint; class Num a where; (+) :: a -> a -> a; ...; -- Defined in `GHC.Num'; infixl 6 +; type (+) :: Nat -> Nat -> Nat; type family (+) a b; -- Defined in `GHC.TypeNats'; infixl 6 +
12:02:39 mestre joins (~mestre@191.177.175.57)
12:03:02 <hololeap> % undefined :: Proxy (5 + 4)
12:03:02 <yahb> hololeap: Proxy
12:03:11 <hololeap> % :t undefined :: Proxy (5 + 4)
12:03:11 <yahb> hololeap: Proxy 9
12:03:35 <tomsmeding> I believe that ghc's type level nats will have the exact same problem, except that there's a ghc plugin, ghc-typelits-natnormalise, that resolves things
12:04:38 <hololeap> % :t undefined :: Proxy (5 + 4 + 3)
12:04:38 <yahb> hololeap: Proxy 12
12:04:47 <hololeap> % :t undefined :: Proxy (5 + (4 + 3))
12:04:47 <yahb> hololeap: Proxy 12
12:04:55 <hololeap> % :t undefined :: Proxy ((5 + 4) + 3)
12:04:55 <yahb> hololeap: Proxy 12
12:08:13 <tomsmeding> :set -XScopedTypeVariables -XTypeApplications -XDataKinds -XTypeOperators -XKindSignatures
12:08:16 <tomsmeding> % :set -XScopedTypeVariables -XTypeApplications -XDataKinds -XTypeOperators -XKindSignatures
12:08:16 <yahb> tomsmeding:
12:08:27 <tomsmeding> % f :: Proxy a -> Proxy b -> Proxy c -> Proxy (a + (b + c)) -> () ; f _ _ _ _ = ()
12:08:27 <yahb> tomsmeding:
12:08:35 <tomsmeding> % g :: forall (a :: Nat) (b :: Nat) (c :: Nat). Proxy a -> Proxy b -> Proxy c -> () ; g pa pb pc = f pa pb pc (Proxy @((a + b) + c))
12:08:35 <yahb> tomsmeding: ; <interactive>:186:110: error:; * Couldn't match type: (a + b) + c; with: a + (b + c); Expected: Proxy (a + (b + c)); Actual: Proxy ((a + b) + c); NB: `+' is a non-injective type family; * In the fourth argument of `f', namely `(Proxy @((a + b) + c))'; In the expression: f pa pb pc (Proxy @((a + b) + c)); In an equation for `g': g pa pb pc = f p
12:08:42 <tomsmeding> hololeap: ghc doesn't do it
12:09:13 <tomsmeding> that's what you need the ghc-typelits-natnormalise plugin for
12:09:39 <tomsmeding> Guest32: can't do it without work,
12:09:52 ArctVaulMarsHMPJ joins (~pjetcetal@2.95.44.252)
12:10:40 <tomsmeding> like, you can write 'proof :: Add a (Add b c) :~: Add (Add a b) c ; proof = unsafeCoerce Refl' and then in your function do `case proof @a @b @c of Refl -> ...`
12:10:51 <tomsmeding> for the right values of a,b,c of course
12:10:59 <tomsmeding> but not sure if you can get any better
12:12:26 <tomsmeding> (the case can be made a bit less intrusive using a pattern guard, '| Refl <- proof @a @b @c =')
12:16:52 <Guest32> I'll have a look at that approach, and see how it works. Thanks!
12:17:28 <tomsmeding> (note that the usage of unsafeCoerce means that you're literally saying to ghc "trust me this is true, and let the world burn if it isn't")
12:18:13 <tomsmeding> not that ghc has the ability to do anything so destructive, hopefully
12:20:15 <Guest32> That's fine; I'm willing to accept the consequences if it turns out that addition is non-associative :)
12:25:59 machinedgod joins (~machinedg@24.105.81.50)
12:28:30 stengah joins (~stengah@user/stengah)
12:34:21 wz1000 joins (~zubin@static.11.113.47.78.clients.your-server.de)
12:35:28 ubert joins (~Thunderbi@77.119.216.214.wireless.dyn.drei.com)
12:45:25 jespada joins (~jespada@2803:9800:9842:7a62:a1db:843b:ed19:cad6)
12:56:11 × stengah quits (~stengah@user/stengah) (Ping timeout: 268 seconds)
13:09:27 acidjnk_new joins (~acidjnk@p200300d0c703cb9754638f8907b54fd0.dip0.t-ipconnect.de)
13:13:24 × acidjnk quits (~acidjnk@p200300d0c703cb97596ef3e4428d3d40.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
13:17:46 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
13:17:54 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
13:20:11 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
13:21:05 max22- joins (~maxime@2a01cb0883359800f686a1c3d46594f3.ipv6.abo.wanadoo.fr)
13:21:19 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
13:21:29 acidjnk_new3 joins (~acidjnk@pd9e0b933.dip0.t-ipconnect.de)
13:24:57 × acidjnk_new quits (~acidjnk@p200300d0c703cb9754638f8907b54fd0.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
13:26:34 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
13:30:00 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c12e:d762:e1c6:5c95)
13:34:35 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c12e:d762:e1c6:5c95) (Ping timeout: 264 seconds)
13:47:30 × max22- quits (~maxime@2a01cb0883359800f686a1c3d46594f3.ipv6.abo.wanadoo.fr) (Ping timeout: 260 seconds)
13:49:41 azimut joins (~azimut@gateway/tor-sasl/azimut)
13:53:42 sedeki joins (~textual@user/sedeki)
13:54:50 × Guest32 quits (~Guest32@82.40.121.143) (Quit: Client closed)
13:56:54 stengah joins (~stengah@user/stengah)
13:56:58 × harovali quits (~haroldo@r167-62-172-139.dialup.adsl.anteldata.net.uy) (Remote host closed the connection)
14:00:51 × rusua quits (uid124537@id-124537.uxbridge.irccloud.com) (Quit: Connection closed for inactivity)
14:00:59 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
14:02:56 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection)
14:04:39 stiell joins (~stiell@gateway/tor-sasl/stiell)
14:05:39 max22- joins (~maxime@2a01cb08833598007c60123fcfb40865.ipv6.abo.wanadoo.fr)
14:07:31 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 252 seconds)
14:14:25 × DNH quits (~DNH@2a02:8108:1100:16d8:8896:1441:fbe3:768) (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:14:55 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
14:16:06 × sedeki quits (~textual@user/sedeki) (Quit: Textual IRC Client: www.textualapp.com)
14:24:13 douglascorrea_io joins (~douglasco@200.146.85.128.static.gvt.net.br)
14:33:00 × acidjnk_new3 quits (~acidjnk@pd9e0b933.dip0.t-ipconnect.de) (Ping timeout: 265 seconds)
14:38:24 gaff joins (~gaff@49.207.206.71)
14:38:43 zebrag joins (~chris@user/zebrag)
14:40:28 × stengah quits (~stengah@user/stengah) (Ping timeout: 252 seconds)
14:47:37 × douglascorrea_io quits (~douglasco@200.146.85.128.static.gvt.net.br) (Read error: Connection reset by peer)
14:49:35 slowButPresent joins (~slowButPr@user/slowbutpresent)
14:50:56 × gaff quits (~gaff@49.207.206.71) (Quit: Bye ...)
14:56:29 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
14:57:45 × son0p quits (~ff@181.136.122.143) (Remote host closed the connection)
14:59:28 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
15:01:10 geekosaur joins (~geekosaur@xmonad/geekosaur)
15:02:13 burnside_ joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
15:02:13 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
15:07:35 × xff0x quits (~xff0x@2001:1a81:52c3:e900:4911:9a42:1c49:6483) (Ping timeout: 264 seconds)
15:07:59 xff0x joins (~xff0x@2001:1a81:52c3:e900:560c:37be:4840:fb36)
15:09:17 notzmv joins (~zmv@user/notzmv)
15:15:16 lavaman joins (~lavaman@98.38.249.169)
15:16:00 × xiongxin quits (~quassel@113.116.224.79) (Read error: Connection reset by peer)
15:17:15 xiongxin joins (~quassel@113.116.32.200)
15:20:16 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
15:24:08 benin5 joins (~benin@183.82.25.86)
15:27:30 × azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection)
15:27:41 × benin quits (~benin@183.82.25.86) (Ping timeout: 264 seconds)
15:27:41 benin5 is now known as benin
15:27:52 azimut joins (~azimut@gateway/tor-sasl/azimut)
15:31:43 <kuribas> (Add (Add a b) c) and (Add a (Add b c)) aren't judgementally equal, no?
15:32:24 hnOsmium0001 joins (uid453710@id-453710.hampstead.irccloud.com)
15:32:56 <geekosaur> haskell knows nothing about associativity, so no
15:35:49 DNH joins (~DNH@2a02:8108:1100:16d8:8896:1441:fbe3:768)
15:36:23 <hpc> they're entirely unequal
15:36:35 <hpc> the only thing suggesting equivalence in any form is the data constructor is named "Add"
15:39:07 kupi joins (uid212005@id-212005.hampstead.irccloud.com)
15:39:12 <kuribas> yeah, it isn't even possible to prove their equality.
15:39:24 <kuribas> which you could do with peano representation.
15:40:35 × DNH quits (~DNH@2a02:8108:1100:16d8:8896:1441:fbe3:768) (Ping timeout: 264 seconds)
15:41:50 × zer0bitz quits (~zer0bitz@dsl-hkibng31-54fafc-123.dhcp.inet.fi) (Read error: Connection reset by peer)
15:43:51 × xiongxin quits (~quassel@113.116.32.200) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
15:43:58 <tomsmeding> Add in this case was a type family
15:45:09 <kuribas> tomsmeding: how is that defined?
15:48:11 retroid_ joins (~retro@2e41e9c8.skybroadband.com)
15:48:37 Psybur joins (~Psybur@mobile-166-170-34-168.mycingular.net)
15:50:55 × retro_ quits (~retro@2e41e9c8.skybroadband.com) (Ping timeout: 252 seconds)
15:53:39 <kuribas> tomsmeding: "If I have some type-level naturals `N` defined" maybe he defined his own type-level nat?
15:55:42 <Hecate> kuribas: loved your comment on reddit on the post that was asking for Haskell consultancies
15:56:00 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
15:57:09 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
15:57:36 <kuribas> Hecate: thanks :)
15:58:02 <kuribas> Not sure I was going to be downvoted or upvoted :)
16:00:17 <kuribas> Hecate: it bothers me many people think haskell is the cryptocurrency language. It isn't even particularly suited for that usecase.
16:04:18 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:04:18 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
16:04:18 wroathe joins (~wroathe@user/wroathe)
16:04:26 <c_wraith> it's better than solidity! (nearly everything is better than solidity)
16:04:30 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
16:09:28 <monochrom> Probably a side effect of the fame of IOHK.
16:11:45 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds)
16:13:45 <monochrom> What surprises me is why Python didn't take that place, given that historically Python has always taken the places of "the <current fad> language", for example machine learning.
16:14:04 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
16:18:23 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
16:20:04 <maerwald> kuribas: why?
16:22:53 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
16:25:50 × Psybur quits (~Psybur@mobile-166-170-34-168.mycingular.net) (Remote host closed the connection)
16:26:54 × mjs2600 quits (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net) (Quit: ZNC 1.8.2 - https://znc.in)
16:27:03 × Kaiepi quits (~Kaiepi@156.34.44.192) (Remote host closed the connection)
16:27:26 Kaiepi joins (~Kaiepi@156.34.44.192)
16:28:19 mjs2600 joins (~mjs2600@c-24-91-3-49.hsd1.vt.comcast.net)
16:30:59 tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net)
16:31:35 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
16:32:05 alzgh joins (~alzgh@user/alzgh)
16:40:02 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 268 seconds)
16:40:29 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c12e:d762:e1c6:5c95)
16:45:49 segfaultfizzbuzz joins (~segfaultf@135-180-0-138.static.sonic.net)
16:52:34 ub joins (~Thunderbi@77.119.216.214.wireless.dyn.drei.com)
16:56:58 <kuribas> maerwald: why what?
16:57:05 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 260 seconds)
16:57:10 <maerwald> why is Haskell not suited for cryptocurrency?
16:57:27 <kuribas> monochrom: because haskell is seemingly "more robust".
16:57:31 <kuribas> monochrom: ?
16:57:48 <kuribas> maerwald: I didn't say it's not suited.
16:58:01 <maerwald> then I don't understand your remark at all
16:58:02 <kuribas> maerwald: it's just not *more* suited than other languages.
16:58:19 <maerwald> I don't know of any language that's particularly suited for it then
16:58:20 <kuribas> for example, if you need performance, rust should be better.
16:58:29 fef joins (~thedawn@user/thedawn)
16:58:38 <kuribas> if you need correctness then idris or something dependently typed.
16:58:43 <maerwald> kuribas: you're aware that IOHK built a rust and a haskell based node?
16:58:58 <maerwald> and the rust one wasn't picked
16:59:05 <monochrom> Almost every fad so far, except web 2.0, has needed performance, too.
16:59:12 <kuribas> maerwald: I am not.
16:59:29 <maerwald> https://github.com/input-output-hk/jormungandr
16:59:58 <kuribas> maerwald: I am not interested enough to spend time into blockchain stuff.
17:00:10 × euandreh quits (~euandreh@2804:14c:33:9fe5:8d5f:78c6:cd1:4a9b) (Quit: WeeChat 3.2)
17:00:16 <maerwald> kuribas: well, then I find your remark not very enlightening
17:02:06 <maerwald> I'd argue it's hard for a language to particularly be suited for "usecase X", unless it was designed for it
17:03:00 <monochrom> I think we all agree on that.
17:03:37 <kuribas> maerwald: I don't want to be enlightening. I just want people to not take haskell is good for crypto stuff for granted.
17:03:54 <kuribas> maerwald: just because someone uses it is not proof that it is good.
17:04:17 <maerwald> well, what would be a proof then?
17:04:29 <geekosaur> do we care?
17:04:30 jgeerds joins (~jgeerds@55d4da80.access.ecotel.net)
17:04:33 <monochrom> My http://www.vex.net/~trebla/humour/tautologies.html is not enlightening at all. Just tautologies. Well, I don't know, turns out stupid humans find them enlightening.
17:04:40 euandreh joins (~euandreh@2804:14c:33:9fe5:ed38:680c:308b:2321)
17:04:55 × euandreh quits (~euandreh@2804:14c:33:9fe5:ed38:680c:308b:2321) (Client Quit)
17:05:19 euandreh joins (~euandreh@2804:14c:33:9fe5:ed38:680c:308b:2321)
17:05:35 <kuribas> maerwald: I don't know... a convincing paper clearly outlining the benefits?
17:05:41 <maerwald> a paper? :D
17:05:45 maerwald chuckles
17:06:08 <maerwald> I've seen papers about "language X is better" and they're usually a joke
17:06:41 <geekosaur> I do agree that stuffing a language into a niche is probably bad
17:07:11 <geekosaur> especially if people take it in both directions "well, then it's only good for cryptocurrencies"
17:07:19 <geekosaur> which people do because they're dumb
17:07:29 <maerwald> Well, the thing is: IOHK has enough engineering power to build a blockchain in POSIX shell with awk.
17:07:48 <maerwald> But that goes for Google, Facebook etc as well
17:08:05 <monochrom> Humans want stereotyping. It gives them simpler mental models and self-confidence. They can then say "I know" rather than "I don't know, it depends".
17:08:51 <maerwald> I'm not even sure what a language would look like that was specifically designed for blockchain
17:08:59 <maerwald> Blockchain is so complicated, no one understands it
17:09:12 <geekosaur> doesn't blockchain kinda specify one?
17:09:34 <geekosaur> with haskell here being used as the implemnentation language for it?
17:09:49 <kuribas> maerwald: "I'd argue it's hard for a language to particularly be suited for "usecase X", unless it was designed for it" <= disagree.
17:10:07 <kuribas> maerwald: haskell is quite nice for backends, but I don't think it was design with that purpose.
17:10:32 onion is now known as zzz
17:10:35 <maerwald> kuribas: what type of backends
17:10:47 <maerwald> I know it's really bad at event sourced backends
17:10:48 <monochrom> This is where "it's hard" comes in. It does not mean "never".
17:11:14 <monochrom> Then again I would phrase it as "less chance".
17:11:16 <kuribas> well, it could have been nice for UIs, if there was good UI support.
17:11:41 <zzz> what are discussing here?
17:11:47 <zzz> *we
17:11:50 <maerwald> we're just talking strangely
17:12:17 <monochrom> Is "language X is for Y" a thing?
17:12:19 <APic> *nod*
17:13:26 <monochrom> But did anyone notice the pun in my "Probably a side effect of the fame of IOHK"? :)
17:13:56 <kuribas> monochrom: well done :)
17:15:06 Pickchea joins (~private@user/pickchea)
17:18:47 <zzz> is french good for commercials? is swahili good for poems? is latin good for public announcements?
17:19:21 <monochrom> I have a better idea.
17:20:05 <zzz> i write my shopping list in mandarin. i find it is the best language for that
17:20:16 Inst joins (~Inst@2601:6c4:4080:3f80:f9d5:5879:9db5:ac95)
17:20:34 <zzz> enlgish is the best language for irc
17:20:41 <zzz> english even
17:20:51 <monochrom> One day, someone made a very good horror movie, and it's in French. Then, everyone went crazy and whenever they made more horror movies they stuck to French.
17:21:59 <maerwald> zzz: shopping list in Klingon
17:22:17 <maerwald> horror movies in korean
17:22:31 <monochrom> Clearly, Chopin Liszt is best in music notation.
17:23:17 <zzz> a 12yo girl showed me an episode of squid game this weekend. i asked her if that was supposed to be horror or comedy
17:23:37 <monochrom> Oh, about that.
17:24:20 <hpc> zzz: actually fun fact, english is not the language of irc - []` are substitutes for finnish characters (iirc)
17:24:21 <zzz> Chopin Liszt *clap*
17:24:32 <hpc> and {}~ are the upper-case variants
17:24:33 <monochrom> I went to watch The Neon Demon. The theatre had just me and two girls. The girls were giggling at every horror scene.
17:24:57 Kaipi joins (~Kaiepi@156.34.44.192)
17:24:57 <maerwald> japanese is best for giggling I think
17:24:59 <monochrom> That was enlightening. I realized there is no line between horror and comedy.
17:25:04 × Kaiepi quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
17:25:40 × jgeerds quits (~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 268 seconds)
17:25:50 <monochrom> Oh BTW after the movie I did contemplate "should I have meat ball pasta for dinner" if you have also watched the movie >:)
17:25:56 mortemeur joins (~mortemeur@pool-173-76-107-201.bstnma.fios.verizon.net)
17:26:43 <zzz> hpc: that went over my head
17:27:08 <geekosaur> it's why you can use those characters in nicks
17:27:24 <geekosaur> as far as rfc1459 is concerned they're letters, not symbols
17:27:47 DNH joins (~DNH@2a02:8108:1100:16d8:5049:49be:4147:7a85)
17:28:00 <zzz> that's interesting
17:28:00 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 260 seconds)
17:28:03 <geekosaur> from the scandinavian iso8859 variant, I forget what its number is
17:28:08 × Kaipi quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
17:28:26 Kaipi joins (~Kaiepi@156.34.44.192)
17:28:40 <geekosaur> like one of those characters maps to ø
17:28:54 <hpc> if you try changing your nick to zzz` and then try joining in another client as ZZZ~, you'll find you can't
17:28:59 <hpc> because nicks are case-insensitive
17:29:35 <zzz> isn't ~ a reserved symbol?
17:29:41 <geekosaur> not in irc
17:30:03 <geekosaur> hm, actualy ~ is not in the list
17:30:10 <geekosaur> I just got an error for using it
17:30:23 <zzz> ~ is for the admin i think
17:30:25 ^|{`-}_{ joins (trebla@shell.vex.net)
17:30:33 <^|{`-}_{> Hi, you're talking about me? :)
17:30:49 × ^|{`-}_{ quits (trebla@shell.vex.net) (Client Quit)
17:30:50 <hpc> oh, it's \ and |
17:31:01 <monochrom> That was me :)
17:31:11 <geekosaur> yes, saw that from the host :þ
17:31:14 <hpc> | is lowercase \
17:31:25 <zzz> that makes more sense
17:31:36 <hpc> as much as any of it makes sense :D
17:31:51 <geekosaur> does any of the internet make sense?
17:32:02 <hpc> occasionally arxiv makes sense
17:32:07 <monochrom> do humans make sense? >:)
17:34:35 <zzz> i love the "i use base 10" joke
17:37:39 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
17:37:51 Pickchea joins (~private@user/pickchea)
17:56:03 douglascorrea_io joins (~douglasco@200.146.85.128.static.gvt.net.br)
17:56:35 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
17:58:05 × segfaultfizzbuzz quits (~segfaultf@135-180-0-138.static.sonic.net) (Ping timeout: 265 seconds)
18:03:31 × nsilv quits (~NSilv@host-87-15-180-17.retail.telecomitalia.it) (Quit: WeeChat 2.7.1)
18:04:23 <awpr> hololeap: that CoerceF trick is also in https://hackage.haskell.org/package/attenuation, and I doubt I was the first to use it either
18:06:07 × max22- quits (~maxime@2a01cb08833598007c60123fcfb40865.ipv6.abo.wanadoo.fr) (Ping timeout: 240 seconds)
18:07:47 × DNH quits (~DNH@2a02:8108:1100:16d8:5049:49be:4147:7a85) (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:09:02 DNH joins (~DNH@2a02:8108:1100:16d8:5049:49be:4147:7a85)
18:09:51 <Hecate> < zzz> ~ is for the admin i think // It's a sigil like @ and +, but it's prepended to the nickname by the IRC server, not part of the nickname in itself
18:10:18 sedeki joins (~textual@user/sedeki)
18:11:51 <zzz> Hecate: yes, that's what i remember from when i used to run a network
18:12:09 wroathe joins (~wroathe@50-205-197-50-static.hfc.comcastbusiness.net)
18:12:09 × wroathe quits (~wroathe@50-205-197-50-static.hfc.comcastbusiness.net) (Changing host)
18:12:09 wroathe joins (~wroathe@user/wroathe)
18:12:41 jgeerds joins (~jgeerds@55d4da80.access.ecotel.net)
18:13:33 × betelgeuse quits (~betelgeus@94-225-47-8.access.telenet.be) (Quit: The Lounge - https://thelounge.chat)
18:13:44 brainfreeze joins (~brainfree@2a03:1b20:4:f011::20d)
18:15:33 <kuribas> zzz: well, I'd say french is a more poetic language than german. French: Je t'aime. German: Verdammt ich lieb dich.
18:16:14 <sedeki> liebe?
18:16:41 sedeki doesn't know German
18:17:17 <gehmehgeh> kuribas: no "verdammt" in that sentence in
18:17:38 <APic> Mu-ha-ha.
18:17:43 <APic> ♥♥♥ 😸
18:18:28 <kuribas> https://www.youtube.com/watch?v=Bk5Qm_0_0HM
18:18:31 max22- joins (~maxime@2a01cb0883359800952563b5640f70e9.ipv6.abo.wanadoo.fr)
18:18:49 <kuribas> https://www.youtube.com/watch?v=x6q0ciiqyG0
18:19:02 <[exa]> I sorted the languages once by the amount of shades between [ə:] and [ü:] that you need to recognize to understand anything at all, and French didn't score well
18:20:27 <monochrom> Oh nice, audio hamming distance :)
18:25:22 <awpr> hololeap, tomsmeding: as for the Fix issue, I think GHC gets while trying to solve the `Semigroup (Fix f)` superclass, because it selects the Semigroup instance and tries to solve its quantified context `forall a. Semigroup a => Semigroup (f a)`, then chooses to solve that via the given quantified context `forall a. Monoid a => Monoid (f a)` plus the superclass relationship, leaving it with a `Monoid a` constraint it can't solve
18:25:27 <awpr> gets confused*
18:26:18 <awpr> i.e. it could solve `forall a. Monoid a => Semigroup (f a)`, but not the more demanding `forall a. Semigroup a => Semigroup (f a)` that the `Semigroup` instance wants
18:26:53 <awpr> % deriving instance (forall a. Semigroup a => Semigroup (f a), forall a. Monoid a => Monoid (f a)) => Monoid (Fix f)
18:26:53 <yahb> awpr: ; <interactive>:187:19: error:; * Could not deduce (Semigroup (f a)); from the context: (forall a. Semigroup a => Semigroup (f a), forall a. Monoid a => Monoid (f a)); bound by a stand-alone deriving instance declaration:; forall (f :: * -> *). (forall a. Semigroup a => Semigroup (f a), forall a. Monoid a => Monoid (f a)) => Monoid (Fix f); at <interactive>:1
18:27:21 <kuribas> https://www.youtube.com/watch?v=tSaJOu7kO1g
18:27:44 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
18:27:44 <kuribas> sorry, getting too offtopic.
18:28:11 × coot quits (~coot@37.30.48.91.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
18:28:21 <awpr> huh. works on repl.it with 8.6.5 https://replit.com/@AndrewPritchard/AwfulLuckyIdentifier#main.hs
18:28:34 × kuribas quits (~user@ptr-25vy0ial9ts1i2t1r9b.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
18:33:10 × benin quits (~benin@183.82.25.86) (Ping timeout: 252 seconds)
18:33:13 Alleria joins (~textual@user/alleria)
18:37:39 shriekingnoise joins (~shrieking@186.137.144.80)
18:40:43 × burnside_ quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
18:40:50 <tomsmeding> awpr: that conclusion is kind of what I also said, isn't it?
18:40:52 × vjoki quits (~vjoki@2a00:d880:3:1::fea1:9ae) (Ping timeout: 252 seconds)
18:42:21 <tomsmeding> % deriving instance (forall a. Semigroup a => Semigroup (f a), forall a. Monoid a => Monoid (f a)) => Monoid (Fix f); deriving instance (forall a. Semigroup a => Semigroup (f a)) => Semigroup (Fix f)
18:42:22 <yahb> tomsmeding: ; <interactive>:188:19: error:; * Could not deduce (Semigroup (f a)); from the context: (forall a. Semigroup a => Semigroup (f a), forall a. Monoid a => Monoid (f a)); bound by a stand-alone deriving instance declaration:; forall (f :: * -> *). (forall a. Semigroup a => Semigroup (f a), forall a. Monoid a => Monoid (f a)) => Monoid (Fix f); at <interactive>:1
18:42:24 <tomsmeding> oh
18:42:29 <tomsmeding> oh well
18:42:36 <tomsmeding> kuribas '"If I have some type-level naturals `N` defined" maybe he defined his own type-level nat?' -> presumably, yes :p
18:42:47 <awpr> oh yeah, didn't see that part. pretty similar
18:43:06 machinedgod joins (~machinedg@24.105.81.50)
18:44:47 econo joins (uid147250@user/econo)
18:47:08 <albet70> newtype CoroutineT r m a = CoroutineT {runCoroutineT' :: ContT r (StateT [CoroutineT r m ()] m) a} is this an infinite type?
18:47:11 × mniip quits (mniip@libera/staff/mniip) (Ping timeout: 624 seconds)
18:47:13 vjoki joins (~vjoki@2a00:d880:3:1::fea1:9ae)
18:48:05 <ski> it's a recursively defined type
18:48:25 <albet70> does it have a bottom type?
18:48:46 <ski> bottom type ?
18:49:10 <ski> (no idea what you mean by that)
18:49:14 Sgeo joins (~Sgeo@user/sgeo)
18:49:54 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
18:50:36 <albet70> like Leaf a in data Tree a = Leaf a | Node (Tree a) (Tree a)
18:51:10 <albet70> so there always a value can have that type
18:51:20 <c_wraith> ContT is a function
18:51:40 <xsperry> Leaf a is a value of type Tree, not a "bottom type". there's bottom value, there's no bottom type AFAIK
18:51:55 ski . o O ( "A Poor Man's Concurrency Monad" (Functional Pearl) by Koen Claessen in 1999 at <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.39.8039> )
18:51:58 <albet70> but CoroutineT inside StateT is not clear
18:51:59 × DNH quits (~DNH@2a02:8108:1100:16d8:5049:49be:4147:7a85) (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:52:35 × vjoki quits (~vjoki@2a00:d880:3:1::fea1:9ae) (Ping timeout: 260 seconds)
18:52:49 <ski> what is not clear about it ?
18:53:10 × xff0x quits (~xff0x@2001:1a81:52c3:e900:560c:37be:4840:fb36) (Ping timeout: 260 seconds)
18:53:54 xff0x joins (~xff0x@2001:1a81:52c3:e900:6f99:de0e:9a06:26db)
18:55:08 × Kaipi quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
18:55:26 Kaipi joins (~Kaiepi@156.34.44.192)
18:55:37 <albet70> newtype C r m a = C ContT r (C r m a) a
18:55:51 python476 joins (~user@88.160.31.174)
18:56:23 <ski> @kind ContT
18:56:23 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
18:56:24 <lambdabot> k -> (k -> *) -> * -> *
18:56:51 <ski> `C r m a' has kind `*' (not `k -> *')
18:56:53 <albet70> there's no such thing like Leaf a in Tree a for C r m a
18:56:56 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
18:56:57 vjoki joins (~vjoki@2a00:d880:3:1::fea1:9ae)
18:57:06 <ski> so ?
18:57:34 zzz parts (~z@user/zero) ()
18:57:43 <ski> `return x' has type `ContT r m a', for every `x' of type `a'
18:57:49 <albet70> so not recursive, what the value looks like?
18:58:01 mniip joins (mniip@libera/staff/mniip)
18:58:05 <ski> that can act as a base case, if that's what you're worrying/wondering about
18:58:09 <albet70> Nothing has Maybe a
18:58:17 <albet70> Leaf a has Tree a
18:58:31 <ski> (`return x', in this case, is actually `ContT (\k -> k x)')
18:58:32 <awpr> the latest posted definition of the Monoid instance of Fix stopped working with GHC 9.0. still poking around to determine why.
18:58:32 DNH joins (~DNH@2a02:8108:1100:16d8:5049:49be:4147:7a85)
19:00:50 <albet70> use return x create value to recursive type is ok?
19:01:14 <geekosaur> we do it all the time in the list monad
19:01:24 <ski> or `ContT (\k -> k x)' directly, if you must
19:01:26 <geekosaur> lists being a very sinmple recursive type
19:01:37 <geekosaur> as with any recursion, you just make sure there's a base case
19:02:16 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
19:02:21 <ski> "so not recursive, what the value looks like?" -- the type is recursively defined. values of that type may or may not be recursively defined
19:03:09 × Skyfire quits (~pyon@user/pyon) (Quit: WeeChat 3.3)
19:04:09 × fef quits (~thedawn@user/thedawn) (Ping timeout: 276 seconds)
19:04:20 <ski> albet70 : perhaps another example, like `newtype Foo a = MkFoo (Maybe (a,Foo a))' might help a little ?
19:04:23 zzz joins (~z@user/zero)
19:04:54 zzz parts (~z@user/zero) ()
19:04:55 <ski> (note that this `Foo a' also has no base case (/ "non-recursive") data constructor)
19:04:58 zzz joins (~z@user/zero)
19:05:44 <albet70> why would people create this hard-to-understand type? recursive and there are three monad transformers inside
19:06:05 <ski> to implement a kind of cooperative concurrency ?
19:06:21 <albet70> MkFoo Nothing has Foo a
19:06:27 <ski> yes
19:06:57 <ski> so the base case doesn't have to be a data constructor of the recursively defined type in question
19:07:56 <albet70> without 'return x', how you use a value to express that type?
19:08:35 <ski> how about `CoroutineT (ContT (\k -> k 42))' ?
19:10:28 Merfont joins (~Kaiepi@156.34.44.192)
19:10:28 × Kaipi quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
19:11:13 <albet70> yes, it can, and it's still recursive
19:11:26 unit73e joins (~emanuel@2001:818:e8dd:7c00:32b5:c2ff:fe6b:5291)
19:11:55 <ski> what is still recursive ?
19:12:29 <albet70> k :: a -> (StateT ...) r -> (StateT ...) r
19:13:10 <albet70> that CoroutineT inside StateT
19:13:32 <ski> `CoroutineT' is recursively defined, sure
19:13:48 <ski> but `CoroutineT (ContT (\k -> k 42))' is not a recursively constructed value
19:14:11 <albet70> you're right, 42
19:15:21 <albet70> k could short circuit, so 42 could be the value?
19:15:53 × sedeki quits (~textual@user/sedeki) (Quit: Textual IRC Client: www.textualapp.com)
19:16:41 lavaman joins (~lavaman@98.38.249.169)
19:17:16 fef joins (~thedawn@user/thedawn)
19:17:37 <ski> i'm not following your question
19:17:55 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
19:18:00 <albet70> my misunderstanding
19:18:18 <ski> if `k' doesn't care about its input, then (this) argument (`42') passed to it will be ignored
19:18:26 <hololeap> @unmtl ContT r (StateT [C r m ()] m) a
19:18:26 <lambdabot> (a -> [C r m ()] -> m (r, [C r m ()])) -> [C r m ()] -> m (r, [C r m ()])
19:18:34 Kaipi joins (~Kaiepi@156.34.44.192)
19:18:38 × Merfont quits (~Kaiepi@156.34.44.192) (Remote host closed the connection)
19:18:38 <ski> lovely type
19:18:40 <hololeap> ah, my brain
19:19:15 <monochrom> In general, reductionism doesn't always improve understanding :)
19:19:42 <zzz> in general... doesn't always
19:20:02 <zzz> not wrong, though
19:20:15 <monochrom> Isn't English fun!
19:20:22 <albet70> how the people get this type out? how crazy!
19:21:18 <albet70> k's type still has CoroutineT inside, so it is still recursive
19:21:30 <monochrom> What's wrong with that?
19:21:31 <ski> "it" being ?
19:21:33 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 265 seconds)
19:22:00 <monochrom> But since it's in a list, you can always provide [] for a base case.
19:22:31 <albet70> CoroutineT (ContT (\k -> k 42))
19:22:35 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Ping timeout: 264 seconds)
19:22:52 <monochrom> Then again, why need base cases? "data X = X Int X; f = X 5 f" is pretty simple.
19:23:06 <hololeap> @unmtl Cont r m a
19:23:06 <lambdabot> err: `(m -> r) -> r' is not a type function.
19:23:12 <hololeap> @unmtl ContT r m a
19:23:12 <lambdabot> (a -> m r) -> m r
19:23:21 <albet70> yes, [] as base case
19:23:26 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 245 seconds)
19:24:05 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
19:24:16 <hololeap> @type ContT
19:24:17 <lambdabot> forall k a (m :: k -> *) (r :: k). ((a -> m r) -> m r) -> ContT r m a
19:24:28 <albet70> yes, CoroutineT (ContT (\k -> k 42)) is a value
19:24:39 × oxide quits (~lambda@user/oxide) (Quit: oxide)
19:24:52 <monochrom> which is aka Coroutine (return 42)
19:25:11 <monochrom> which is aka return 42
19:25:18 <hololeap> ContT is probably the one monad transformer I've never touched
19:25:23 × ub quits (~Thunderbi@77.119.216.214.wireless.dyn.drei.com) (Quit: ub)
19:25:42 <ski> > let base = CoroutineT (ContT (\k -> k 42)) in (runIdentity . (`evalStateT` []) . (`runContT` \_ -> StateT (\cs -> return (17,cs))) . runCoroutineT') base
19:25:44 <lambdabot> 17
19:26:27 <awpr> okay, I think the Monoid (Fix f) instance stopped working in 9.0 because of the new ambiguity check added as part of simplified subsumption. but, this style of instance is fine: `deriving newtype instance (Monoid (f (Fix f))) => Monoid (Fix f)`
19:27:15 falafel joins (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com)
19:27:18 <awpr> (when combined with the same style of Semigroup instance)
19:29:23 <hololeap> what version of GHC is yahb on?
19:29:29 nitrix-or-treat is now known as nitrix
19:30:01 <awpr> % System.Info.compilerVersion
19:30:01 <yahb> awpr: Version {versionBranch = [9,0], versionTags = []}
19:30:05 <awpr> neat
19:30:18 <hololeap> nice
19:30:38 <ski> % :!ghci --version
19:30:38 <yahb> ski: The Glorious Glasgow Haskell Compilation System, version 9.0.1
19:30:41 <yates> thank you, vaibhavsagar[m]
19:34:06 <tomsmeding> % :!ls
19:34:07 <yahb> tomsmeding: Example; Example.hi; Example.hs; Example.o; a.out; file; file.sh; file.txt; hello; test; test.txt; tmp
19:35:15 <awpr> wait is this the same one as on the FP discord?
19:35:20 <awpr> % :!cat file.sh
19:35:21 <yahb> awpr: :(){ :|:& };:; while true do sleep 1 done; while true do done
19:35:33 <awpr> yeah, looks like it is
19:35:45 Guest38 joins (~Guest38@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
19:35:47 <hololeap> % :!sh file.sh
19:35:47 <yahb> hololeap: file.sh: 1: file.sh: Syntax error: Bad function name
19:35:57 <hololeap> % :!./Example
19:36:03 <yahb> hololeap: [Timed out]
19:37:11 <hololeap> % :!rm -rf /*
19:37:18 <hololeap> ;)
19:37:51 notzmv joins (~zmv@user/notzmv)
19:38:35 × Guest38 quits (~Guest38@eth-west-pareq2-46-193-4-100.wb.wifirst.net) (Client Quit)
19:38:43 <monochrom> % 1+1
19:38:43 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
19:38:44 <yahb> monochrom: 2
19:38:49 <monochrom> OK good
19:39:05 <awpr> tbh rejecting the Monoid (Fix f) instance feels like a compiler bug. it's trying to solve `forall a. Semigroup a => Semigroup (f a)` for the underlying `mempty`, and it says it can't deduce `Semigroup (f a)` from the context `forall a. Semigroup a => Semigroup (f a)` or from `Semigroup a`
19:39:27 hendursaga joins (~weechat@user/hendursaga)
19:39:54 <awpr> unless it's refusing to select that instance because there's also a `Monoid (f a)` in context that would also provide a `Semigroup (f a)` via superclass
19:40:10 <albet70> how to print a in ContT r [] a's do notation?
19:40:23 <albet70> or could?
19:42:16 Merfont joins (~Kaiepi@156.34.44.192)
19:42:40 × Kaipi quits (~Kaiepi@156.34.44.192) (Remote host closed the connection)
19:44:28 × frosky quits (~froskyarr@59.41.162.152) (Read error: Connection reset by peer)
19:45:13 × mikoto-chan quits (~mikoto-ch@ip-83-134-2-136.dsl.scarlet.be) (Ping timeout: 252 seconds)
19:46:08 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Remote host closed the connection)
19:46:17 werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net)
19:47:57 Kaipi joins (~Kaiepi@156.34.44.192)
19:48:11 × Merfont quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
19:50:34 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c12e:d762:e1c6:5c95) (Remote host closed the connection)
19:52:26 × ubert quits (~Thunderbi@77.119.216.214.wireless.dyn.drei.com) (Ping timeout: 268 seconds)
19:55:35 × Alleria quits (~textual@user/alleria) (Ping timeout: 264 seconds)
19:56:47 × falafel quits (~falafel@2603-8000-d800-688c-c469-52c4-b20d-779e.res6.spectrum.com) (Ping timeout: 264 seconds)
19:59:22 shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net)
19:59:55 <ski> albet70 : print ?
20:02:31 <albet70> yes, print
20:03:57 × stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds)
20:04:07 × mortemeur quits (~mortemeur@pool-173-76-107-201.bstnma.fios.verizon.net) (Quit: Leaving)
20:05:32 × juhp quits (~juhp@128.106.188.220) (Ping timeout: 265 seconds)
20:06:56 <ski> print, in which sense ?
20:07:07 <ski> so I/O ?
20:07:11 <ski> s/so/do/
20:07:41 juhp joins (~juhp@128.106.188.220)
20:10:51 × alx741 quits (~alx741@186.178.108.200) (Ping timeout: 265 seconds)
20:13:40 bitmapper joins (uid464869@id-464869.lymington.irccloud.com)
20:14:42 <unit73e> Here's a new example for keyboard input: https://gitlab.com/unit73e/sdl2-examples
20:14:58 <unit73e> it's sort of like those gamepad input tests but for keyboard
20:15:15 <unit73e> the way lazyfoo handled keyboard wasn't great imo
20:15:54 <unit73e> the example uses keyboard state instead of events because it's easier to test if a key is being pressed, instead of has been pressed/released
20:16:01 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:c12e:d762:e1c6:5c95)
20:16:06 <unit73e> I'll add keyboard events later
20:16:37 stiell joins (~stiell@gateway/tor-sasl/stiell)
20:16:40 <unit73e> I don't know why events are getting only the last event either. why not process all?
20:16:51 <albet70> could IO a inside ContT r [] a
20:16:57 <unit73e> what if I press two keys simultaneously? why does only the last key count?
20:18:12 <c_wraith> albet70: a much simpler question that would resolve the real question more easily would be "Does Coroutine have a MonadIO instance?". That one is neatly answered by looking at the docs.
20:18:36 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
20:18:37 <ski> albet70 : you could have `m' be `IO', if you wanted to
20:19:14 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
20:19:40 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
20:20:01 <albet70> in other languages, we can print variable inside most function and won't affect the result type
20:20:15 <c_wraith> yes, that's a deficiency of most languages
20:20:20 <ski> perhaps you're looking for `trace' ?
20:20:32 <ski> @type Debug.Trace.trace
20:20:34 <lambdabot> String -> a -> a
20:21:16 <unit73e> albet70, that's done on purpose in haskell so that you can distinguish between side-effects or no side-effects, so you don't have unexpected results
20:21:34 eggplant_ joins (~Eggplanta@2600:1700:bef1:5e10:39a4:166a:24e9:f255)
20:21:56 <ski> "so you can reason about and refactor code more effectively"
20:22:09 <albet70> I know ContT r IO a can print a, but what if I want the [] effect too?
20:22:29 <ski> use some `ListT' thing, maybe ?
20:23:47 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:c12e:d762:e1c6:5c95) (Ping timeout: 264 seconds)
20:23:49 alx741 joins (~alx741@186.178.108.68)
20:24:16 <albet70> for example?
20:24:23 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Ping timeout: 265 seconds)
20:25:06 × Kaipi quits (~Kaiepi@156.34.44.192) (Remote host closed the connection)
20:25:12 <unit73e> I think you're just looking for `trace` do to debugging
20:25:19 <unit73e> so this: https://wiki.haskell.org/Debugging
20:25:26 Kaipi joins (~Kaiepi@156.34.44.192)
20:25:29 × hendursaga quits (~weechat@user/hendursaga) (Remote host closed the connection)
20:25:53 hendursaga joins (~weechat@user/hendursaga)
20:26:05 <unit73e> just my guess
20:27:28 Merfont joins (~Kaiepi@156.34.44.192)
20:27:28 × Kaipi quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
20:29:05 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
20:29:05 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
20:29:05 wroathe joins (~wroathe@user/wroathe)
20:32:06 lavaman joins (~lavaman@98.38.249.169)
20:32:48 × eggplant_ quits (~Eggplanta@2600:1700:bef1:5e10:39a4:166a:24e9:f255) (Remote host closed the connection)
20:33:51 × fef quits (~thedawn@user/thedawn) (Ping timeout: 276 seconds)
20:39:55 × wonko quits (~wjc@62.115.229.50) (Ping timeout: 268 seconds)
20:40:14 acidjnk_new3 joins (~acidjnk@p200300d0c703cb9754638f8907b54fd0.dip0.t-ipconnect.de)
20:40:35 Alleria joins (~textual@user/alleria)
20:42:36 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:39a4:166a:24e9:f255)
20:45:23 × Inst quits (~Inst@2601:6c4:4080:3f80:f9d5:5879:9db5:ac95) (Ping timeout: 264 seconds)
20:49:47 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
20:51:06 o1lo01ol1o joins (~o1lo01ol1@2001:8a0:6d7a:df01:5579:ced2:5960:f2d4)
20:52:53 <xerox> what could be causing this? https://pastebin.com/raw/wUui9AGU
20:54:59 × python476 quits (~user@88.160.31.174) (Ping timeout: 264 seconds)
20:55:37 × o1lo01ol1o quits (~o1lo01ol1@2001:8a0:6d7a:df01:5579:ced2:5960:f2d4) (Ping timeout: 252 seconds)
20:57:17 burnsidesLlama joins (~burnsides@dhcp168-015.wadham.ox.ac.uk)
20:58:15 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
20:59:56 × takuan_dozo quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
21:02:10 × alx741 quits (~alx741@186.178.108.68) (Ping timeout: 252 seconds)
21:02:47 × burnsidesLlama quits (~burnsides@dhcp168-015.wadham.ox.ac.uk) (Ping timeout: 264 seconds)
21:06:42 boxscape_ joins (~boxscape_@p54a3581e.dip0.t-ipconnect.de)
21:07:36 tektik joins (~said@68.33.69.0)
21:09:09 hololeap_ joins (~hololeap@user/hololeap)
21:09:36 × hololeap quits (~hololeap@user/hololeap) (Ping timeout: 276 seconds)
21:13:20 neurocyte0132889 joins (~neurocyte@212.232.92.249)
21:13:20 × neurocyte0132889 quits (~neurocyte@212.232.92.249) (Changing host)
21:13:20 neurocyte0132889 joins (~neurocyte@user/neurocyte)
21:13:24 hololeap_ is now known as hololeap
21:18:26 × DNH quits (~DNH@2a02:8108:1100:16d8:5049:49be:4147:7a85) (Ping timeout: 245 seconds)
21:19:06 × Merfont quits (~Kaiepi@156.34.44.192) (Remote host closed the connection)
21:19:25 Merfont joins (~Kaiepi@156.34.44.192)
21:19:37 aegon joins (~mike@174.127.249.180)
21:22:48 × zebrag quits (~chris@user/zebrag) (Remote host closed the connection)
21:24:24 thelounge90407 joins (5973b1ff@67.205.143.82)
21:24:53 × thelounge90407 quits (5973b1ff@67.205.143.82) (Client Quit)
21:25:29 <geekosaur> LD_LIBRARY_PATH set? (it is *not* the same as on Linux!)
21:26:49 zebrag joins (~chris@user/zebrag)
21:27:54 × hololeap quits (~hololeap@user/hololeap) (Read error: Connection reset by peer)
21:28:25 × fendor quits (~fendor@77.119.216.44.wireless.dyn.drei.com) (Remote host closed the connection)
21:28:53 × Pickchea quits (~private@user/pickchea) (Quit: Leaving)
21:30:07 pavonia joins (~user@user/siracusa)
21:32:06 × tabemann quits (~tabemann@2600:1700:7990:24e0:5901:20e0:5666:a3ee) (Remote host closed the connection)
21:32:44 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
21:33:31 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds)
21:37:07 hololeap_ joins (~hololeap@user/hololeap)
21:38:26 tabemann joins (~tabemann@2600:1700:7990:24e0:ab53:1c93:684e:f2ba)
21:39:08 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Read error: Connection reset by peer)
21:39:46 neurocyte0132889 joins (~neurocyte@212.232.92.249)
21:39:46 × neurocyte0132889 quits (~neurocyte@212.232.92.249) (Changing host)
21:39:46 neurocyte0132889 joins (~neurocyte@user/neurocyte)
21:39:52 betelgeuse joins (~betelgeus@94-225-47-8.access.telenet.be)
21:42:50 × gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving)
21:42:51 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
21:42:58 <d34df00d> Is there any extension that'd allow me to have a field with the same label but different types in different constructors of a type?
21:43:14 <d34df00d> Like data Foo = F1 { a :: String } | F2 { a :: Int }
21:43:25 cjb joins (~cjb@user/cjb)
21:43:30 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
21:45:03 alx741 joins (~alx741@186.178.108.68)
21:45:03 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
21:45:10 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
21:45:30 <zzz> OverloadedRecordFields
21:46:40 × __monty__ quits (~toonn@user/toonn) (Quit: leaving)
21:47:02 Skyfire joins (~pyon@user/pyon)
21:47:06 × max22- quits (~maxime@2a01cb0883359800952563b5640f70e9.ipv6.abo.wanadoo.fr) (Quit: Leaving)
21:47:29 <boxscape_> isn't it DuplicateRecordFields
21:47:54 <d34df00d> zzz: can't find that in the docs for 9.0.1, is it a newer one?
21:48:13 <d34df00d> boxscape_: doesn't help, ghc still complains about different types of a field in different constructors.
21:48:31 acidjnk_new joins (~acidjnk@p200300d0c703cb97b093ae7a86818c94.dip0.t-ipconnect.de)
21:49:29 <boxscape_> d34df00d hmm that seems strange because the docs specifically have that as an example https://downloads.haskell.org/ghc/latest/docs/html/users_guide/exts/duplicate_record_fields.html?highlight=duplicaterecordfields#extension-DuplicateRecordFields
21:49:50 <d34df00d> boxscape_: that's different constructors of different types.
21:49:59 <d34df00d> While in my case I have different constructors of the same type.
21:50:02 <boxscape_> ohh
21:50:03 <boxscape_> sorry
21:50:24 <awpr> since there's no way to make a field selector function for that "field", maybe -XNoFieldSelectors?
21:51:06 <boxscape_> I think NoFieldSelectors is only in 9.2
21:51:28 <d34df00d> Oh yeah.
21:51:29 <d34df00d> OverloadedRecordFields
21:51:36 <d34df00d> Dang, wrong paste.
21:51:38 <d34df00d> Unsupported extension: NoFieldSelectors
21:51:47 <boxscape_> but NoFieldSelectors also doesn't help, just tested it
21:51:57 <dsal> arm nix on m1 is almost useful… Stuff almost builds.
21:52:16 × acidjnk_new3 quits (~acidjnk@p200300d0c703cb9754638f8907b54fd0.dip0.t-ipconnect.de) (Ping timeout: 252 seconds)
21:52:50 <zzz> sorry about that. i don't know if there is one
21:52:56 <awpr> hmm, the only reason I know of for that restriction is to make it possible to assign types to field selectors. maybe it's just vestigial in the presence of NoFieldSelectors?
21:52:57 fernand joins (~fernand@179.156.35.4)
21:53:09 <boxscape_> that's quite plausible
21:53:33 <boxscape_> to be fair I'm using a ghc version from July, for all I know it might be different now
21:54:12 × pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.3)
21:55:18 <awpr> it might also cause problems for overloaded record fields, too, though, since the HasField instance(s) for that field(s) would want two different types, in violation of the fundeps
21:56:01 <boxscape_> right
21:56:40 <awpr> in fact, is there _anything_ you can do with that field name at all?
21:56:56 <awpr> maybe RecordWildCards it into existence with a particular constructor
21:56:56 <boxscape_> use it as documentation
21:57:33 <awpr> yeah, good point. although if it's just documentation, there's hopefully not much harm in renaming one of them
21:57:40 <boxscape_> yeah
22:06:28 hololeap_ is now known as hololeap
22:08:10 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 252 seconds)
22:13:23 sprout joins (~quassel@2a02:a467:ccd6:1:110c:9227:cd24:5132)
22:18:23 <zzz> /quit
22:18:45 <geekosaur> nope
22:19:55 <hpc> [sudo] Password for zzz:
22:20:08 <zzz> Hunter2
22:20:17 <hpc> :D
22:21:59 <int-e> those are some nice stars
22:24:04 × boxscape_ quits (~boxscape_@p54a3581e.dip0.t-ipconnect.de) (Quit: Connection closed)
22:24:10 × abhixec quits (~abhixec@c-67-169-139-16.hsd1.ca.comcast.net) (Ping timeout: 252 seconds)
22:24:35 × dme2_ quits (~dme2@67.205.140.199) (Ping timeout: 250 seconds)
22:27:24 Guest3676 joins (~Guest36@eth-west-pareq2-46-193-4-100.wb.wifirst.net)
22:28:13 <Guest3676> why is `maybe [] fromJust :: Maybe (Maybe [a]) -> [a]` instead of `Maybe [a] -> [a]` ?
22:28:38 <Rembane> :t fromJust
22:28:39 <lambdabot> Maybe a -> a
22:28:40 <Rembane> :t maybe
22:28:41 <lambdabot> b -> (a -> b) -> Maybe a -> b
22:29:40 <Guest3676> oh I see now you already get a before you apply the function *facepalm*
22:29:47 <Rembane> :)
22:31:46 × Tuplanolla quits (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi) (Quit: Leaving.)
22:32:00 <d34df00d> awpr: in my particular case I was playing around with Generic-based derivation of json serialization (yep, aeson does that too, but my use case wasn't covered by it).
22:32:40 <d34df00d> So I needed that field purely as a tag, like msgType :: Literal "successMessage" in one ctor and msgType :: Literal "failure" in another.
22:32:57 <zzz> :t maybe [] id
22:32:58 <lambdabot> Maybe [a] -> [a]
22:33:03 <d34df00d> It has a single dataless constructor (that only carries around a KnownSymbol constraint for the literal), so ti's almost isomorphic to ()
22:33:04 <awpr> oh, right, things based on Generic would care about the field name
22:33:30 <geekosaur> :t fromMaybe []
22:33:32 <lambdabot> Maybe [a] -> [a]
22:33:42 <awpr> I suppose you could bake some naming convention into the set of instances and strip off parts of the name
22:34:13 <d34df00d> Yea, I already started thinking about suffixing the field name with the ctor name after a tick and dropping everything after a tick when (de)serializing.
22:34:20 <d34df00d> But that looks ugly.
22:34:25 <zzz> geekosaur: i always hated fromMaybe (and even more so fromJust)
22:34:26 <d34df00d> Hence my original question :)
22:34:42 <geekosaur> fromMaybe is fine. fromJust not so much
22:34:56 <zzz> geekosaur: it seems so unnecessary
22:35:17 <zzz> also
22:35:25 <awpr> sounds like a plausible feature request for multi-typed fields to be allowed with NoFieldSelectors and no OverloadedRecordFields
22:35:50 <zzz> > (length "fromMaybe", length "maybe id")
22:35:52 <lambdabot> (9,8)
22:36:04 <Rembane> fromJust has its uses and places, but I only use it when I want things to crash.
22:37:17 <geekosaur> I care less about length than clarity. fromMaybe makes it clear I only want to provide a default. maybe sugests I want to alter the Just case as well, then all I supply for that is id?
22:37:33 <zzz> yes
22:37:51 <zzz> but that's me
22:37:58 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:39a4:166a:24e9:f255) (Remote host closed the connection)
22:38:18 <zzz> i have used folds for maps
22:38:27 corne joins (~corne@80.71.142.65.ipv4.parknet.dk)
22:38:33 <zzz> and for that i got no good excuse
22:38:35 <d34df00d> That's fine until you start using maps for folds.
22:40:55 <corne> anyone else unable to download GHC on windows? https://downloads.haskell.org/~ghc/8.10.7/ghc-8.10.7-x86_64-unknown-mingw32.tar.xz just fails for me after a while (curl exits with status 56)
22:40:57 <monochrom> I like clarity, but I also ask "how many functions do I want to remember?"
22:41:34 <Rembane> Three! S, K and I!
22:41:35 Rembane ducks
22:42:57 <corne> it might just be my firewall, just got a new router. don't know why i'd block GHC downloads though
22:42:59 <monochrom> Unpopular opinion: fromJust (m <|> pure a)
22:43:25 <geekosaur> Rembane: only two of which are required :þ
22:43:33 × mestre quits (~mestre@191.177.175.57) (Quit: Lost terminal)
22:44:22 <Rembane> geekosaur: Yeah, the third one I use because I like luxury! :)
22:45:30 <geekosaur> corne, there's a migration going on at the moment, don't know if it affects those downloads
22:46:14 <geekosaur> you could ask in #haskell-infrastructure
22:46:19 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
22:46:33 <corne> thanks, i'll try
22:46:49 <monochrom> I have finished downloading it successfully.
22:49:00 <zzz> Rembane: and you don't really need I
22:49:42 <zzz> oh sorry
22:49:44 <Rembane> zzz: :D
22:49:52 <zzz> too late
22:50:09 <Rembane> zzz: I thought for a while there that you had found a way to only use one combinator of the three. :)
22:50:39 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
22:50:40 mestre joins (~mestre@191.177.175.57)
22:51:40 corne_ joins (~corne@87-49-44-159-mobile.dk.customer.tdc.net)
22:52:18 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
22:55:35 × corne quits (~corne@80.71.142.65.ipv4.parknet.dk) (Ping timeout: 264 seconds)
22:59:23 corne__ joins (~corne@80.71.142.65.ipv4.parknet.dk)
22:59:53 <corne__> wow i think it was my firewall. tried on another network and it worked. thanks for the help :)
22:59:54 × Merfont quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
23:00:08 Merfont joins (~Kaiepi@156.34.44.192)
23:01:35 × MQ-17J quits (~MQ-17J@d192-24-122-179.try.wideopenwest.com) (Read error: Connection reset by peer)
23:02:32 MQ-17J joins (~MQ-17J@d192-24-122-179.try.wideopenwest.com)
23:03:13 × corne_ quits (~corne@87-49-44-159-mobile.dk.customer.tdc.net) (Ping timeout: 252 seconds)
23:03:28 fluffyballoon joins (~user@131.93.208.196)
23:05:27 × mestre quits (~mestre@191.177.175.57) (Quit: Lost terminal)
23:11:04 × corne__ quits (~corne@80.71.142.65.ipv4.parknet.dk) (Quit: Leaving)
23:21:03 × poljar quits (~poljar@93-139-113-226.adsl.net.t-com.hr) (Remote host closed the connection)
23:21:05 poljar1 joins (~poljar@93-139-113-226.adsl.net.t-com.hr)
23:21:57 Kaipi joins (~Kaiepi@156.34.44.192)
23:22:08 × Nosrep quits (~archbox@user/nosrep) (Quit: WeeChat 3.3)
23:22:27 × Merfont quits (~Kaiepi@156.34.44.192) (Read error: Connection reset by peer)
23:28:55 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
23:31:25 × jgeerds quits (~jgeerds@55d4da80.access.ecotel.net) (Ping timeout: 260 seconds)
23:35:26 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:39a4:166a:24e9:f255)
23:36:17 × alx741 quits (~alx741@186.178.108.68) (Ping timeout: 268 seconds)
23:38:34 machinedgod joins (~machinedg@24.105.81.50)
23:38:36 alx741 joins (~alx741@186.178.108.68)
23:44:18 × acidjnk_new quits (~acidjnk@p200300d0c703cb97b093ae7a86818c94.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
23:49:32 Merfont joins (~Kaiepi@156.34.44.192)
23:49:55 poljar joins (~poljar@93-139-113-226.adsl.net.t-com.hr)
23:50:10 × Kaipi quits (~Kaiepi@156.34.44.192) (Remote host closed the connection)
23:52:40 × fluffyballoon quits (~user@131.93.208.196) (Ping timeout: 252 seconds)
23:52:42 × poljar1 quits (~poljar@93-139-113-226.adsl.net.t-com.hr) (Ping timeout: 265 seconds)
23:55:26 × dsrt^ quits (~dsrt@70.166.66.234) (Remote host closed the connection)
23:58:14 × Merfont quits (~Kaiepi@156.34.44.192) (Remote host closed the connection)
23:59:33 son0p joins (~ff@181.136.122.143)

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