Home freenode/#haskell: Logs Calendar

Logs on 2021-02-20 (freenode/#haskell)

00:00:10 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
00:01:03 kam1 joins (~kam1@5.126.205.103)
00:02:54 × Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa)
00:03:03 Sonderblade joins (~helloman@94.191.136.141.mobile.tre.se)
00:03:26 × thc202 quits (~thc202@unaffiliated/thc202) (Ping timeout: 240 seconds)
00:04:02 <hololeap> @djinn ((a,b) -> (c,d)) -> (a -> c, b -> d)
00:04:02 <lambdabot> -- f cannot be realized.
00:04:56 <hololeap> @djinn ((a,b) -> (c,d)) -> (a -> c) -> (b -> d)
00:04:56 <lambdabot> -- f cannot be realized.
00:04:58 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
00:06:01 <hololeap> @djinn a -> a
00:06:01 <lambdabot> f a = a
00:06:23 <ski> @djinn (i0 -> (o0,i1 -> o1)) -> ((i0,i1) -> (o0,o1))
00:06:24 <lambdabot> f a (b, c) =
00:06:24 <lambdabot> case a b of
00:06:24 <lambdabot> (d, e) -> (d, e c)
00:06:59 <ski> @djinn ((a,b) -> (c,d)) -> (a -> b -> c,a -> b -> d)
00:06:59 <lambdabot> f a =
00:06:59 <lambdabot> (\ b c ->
00:06:59 <lambdabot> case a (b, c) of
00:06:59 <lambdabot> (d, _) -> d,
00:06:59 <lambdabot> \ e f ->
00:07:01 <lambdabot> case a (e, f) of
00:07:03 <lambdabot> (_, g) -> g)
00:07:21 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
00:07:57 <hololeap> hm, right
00:09:09 × average quits (uid473595@gateway/web/irccloud.com/x-indydqfvltwedbgv) (Quit: Connection closed for inactivity)
00:09:48 <hololeap> i'm not pro enough for the profunctors
00:10:09 <ski> ?
00:10:13 <whataday> how to implement "goto" with callCC?
00:10:53 <ski> you won't be able to do forward `goto', exactly
00:11:54 <ski> but you can make an action which when executed will give you back a "label" referring to the current point of execution, that you could later jump back to
00:12:16 <whataday> ski goto inside callCC is ok?
00:12:54 <whataday> how to do that? jump back to last label?
00:13:03 × fendor quits (~fendor@91.141.3.79.wireless.dyn.drei.com) (Remote host closed the connection)
00:13:36 <ski> define `newLabel :: Cont o (Label o)' and `jumpLabel :: Label o -> Cont o a'
00:13:41 <ski> (and `Label' too, of course)
00:14:10 <hololeap> @djinn (a -> b, c -> d) -> (a,c) -> (b,d)
00:14:10 <lambdabot> f (a, b) (c, d) = (a c, b d)
00:14:18 <ski> or, if you prefer, `newLabel :: a -> Cont o (Label o a,a) and `jumpLabel :: Label o a -> a -> Cont o b'
00:14:25 <hololeap> so this isn't one half of an isomorphism, i take it
00:14:36 <ski> correct
00:14:58 <ski> the `b' result may generally depend on both the `a' and the `c' input, so you won't be able to reverse that
00:14:59 jlixier joins (c036de8c@192.54.222.140)
00:16:15 jlixier parts (c036de8c@192.54.222.140) ()
00:16:29 <hololeap> is it one half of an adjunction, though...
00:16:41 <whataday> more specific?
00:16:47 <whataday> a simple code?
00:17:59 <ski> i wouldn't want to spoil the fun of figuring it out
00:18:21 <hololeap> adjunction on bifunctors?
00:18:24 deviantfero joins (~deviantfe@190.150.27.58)
00:18:37 <ski> the label thing
00:19:01 <ski> i'm not sure what kind of adjunction you had in mind
00:19:45 <whataday> ski is it related to fixed point?
00:19:49 <hololeap> i'm not either. i'm just trying to get an intuition for what these kinds of morphisms look like in the opposite category
00:20:13 <ski> whataday : perhaps to some degree
00:20:28 <ski> which morphisms ?
00:20:34 <hololeap> of course it might help if i figured out what category i'm in :p
00:21:02 <hololeap> ski: i don't even know anymore... i'm playing around with... something
00:21:24 minoru_shiraeesh joins (~shiraeesh@5.101.59.186)
00:21:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
00:22:36 × deviantfero quits (~deviantfe@190.150.27.58) (Ping timeout: 240 seconds)
00:24:52 <ski> perhaps ⌜f : bᵃ × dᶜ ⟶ (b × d)⁽ᵃ˟ᶜ⁾⌝ is your morphism. or perhaps given morphisms ⌜g : a ⟶ b⌝ and ⌜h : c ⟶ d⌝, you had producing ⌜g × h : a × c ⟶ b × d⌝ in mind
00:25:09 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 264 seconds)
00:25:14 <ski> or perhaps something else, entirely .. i can't really know, since you haven't given enough detail/context
00:26:54 <hololeap> ski: well, i made a Bidistributive class for fun and made an instance for (,) just to see if it worked
00:27:09 × acarrico quits (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net) (Ping timeout: 260 seconds)
00:27:27 <hololeap> and then i made `cobitraverse cobitraverse :: (Functor f, Bidistributive g) => (f a -> b) -> (f c -> d) -> f (g a c) -> g b d`
00:27:38 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
00:27:45 <hololeap> oops, only one cobitraverse is supposed to be there :p
00:29:02 <hololeap> and then i was like, could i make a function with this signature: `(Functor f, Bidistributive g) => g (f a -> b) (f c -> d) -> f (g a c) -> g b d`
00:29:35 <hololeap> and i ended up standing alone in some field 20 miles away with a faraway look on my face
00:32:14 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 265 seconds)
00:35:12 ski idly ponders cobits
00:36:57 × DataComputist quits (~lumeng@50.43.26.251) (Ping timeout: 246 seconds)
00:36:57 × clog quits (~nef@bespin.org) (Ping timeout: 260 seconds)
00:38:11 da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:b8ec:2ccc:b56e:5cb:43cd)
00:40:41 DataComputist joins (~lumeng@50.43.26.251)
00:41:15 alx741 joins (~alx741@181.196.68.69)
00:41:48 <hololeap> ski: could you explain what's going on with your "equation" ⌜f : bᵃ × dᶜ ⟶ (b × d)⁽ᵃ˟ᶜ⁾⌝, why it holds, and why the reverse doesn't hold?
00:42:30 <ski> i merely rewrote (one reading of it) in categorical notation
00:42:34 <ski> ("categorial" ?)
00:43:05 <ski> ⌜bᵃ⌝ is common notation in math for the set/type of functions from ⌜a⌝ to ⌜b⌝
00:43:16 × Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Ping timeout: 240 seconds)
00:44:17 epicte7us joins (~epictetus@ip72-194-215-136.sb.sd.cox.net)
00:44:25 <ski> and ⌜T × U⌝ is the cartesian product of ⌜T⌝ and ⌜U⌝, consisting of all pairs ⌜(x,y)⌝, where ⌜x⌝ is an inhabitant of ⌜T⌝ and ⌜y⌝ of ⌜U⌝
00:44:44 <hololeap> so why didn't you write it ⌜(b × d)⁽ᵃ˟ᶜ⁾ ^ (bᵃ × dᶜ)⌝ ?
00:45:21 <ski> because the whole thing is a morphism, not thought of as an element/inhabitant of an exponential object (the ⌜bᵃ⌝ things)
00:45:54 <ski> category theory is a *first*-order theory of functions (with function composition, rather than function application, as primitive)
00:47:16 <ski> in category theory proper you don't speak of "elements" or "inhabitants" of objects. e.g. ⌜g : bᵃ⌝ makes no sense. but ⌜g : a ⟶ b⌝ does
00:47:34 × ep1ctetus quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Ping timeout: 258 seconds)
00:47:42 <ski> the arrow ⌜⟶⌝ combines two objects, but the result is not itself an object
00:48:09 <ski> so you can't nest the arrow ⌜⟶⌝. however, you *can* nest the exponential ⌜bᵃ⌝ notation
00:48:33 carlomagno joins (~cararell@148.87.23.5)
00:48:37 xrinzler parts (~hydrogen@197.185.106.5) ("WeeChat 3.0")
00:48:40 <hololeap> i remember reading about this but didn't really understand it. there's some tight coupling between morphisms, hom-sets, and exponential objects but i wouldn't be able to explain the differences between them
00:48:54 <ski> and every statement with ⌜:⌝ is followed by one object (the domain/source), an arrow, and another object (the codomain/target)
00:49:09 × carlomagno1 quits (~cararell@148.87.23.5) (Ping timeout: 264 seconds)
00:49:33 <ski> exponential objects can be used to simulate "higher-order morphisms". but exponentials are not guaranteed to exist in every category
00:49:53 <hololeap> something about closed cartesian categories, right?
00:50:08 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
00:50:21 <ski> yes, cartesian closed categories are the ones that have exponential objects, for every pair of objects in the category
00:50:54 <ski> however, in some circumstances, it makes sense to use something that's similar to, but not exactly exponentials, as an "Ersatz"
00:50:58 <hololeap> even if there are no morphisms between those two objects?
00:51:02 <ski> (see "monoidal closed")
00:51:10 <ski> yes, sure
00:53:02 <ski> e.g. in ⌜Set⌝, there's no morphism from ⌜1⌝ (the singleton set, the set of empty tuples, the terminal/final object) to ⌜0⌝ (the empty set, the initial object). however, the object ⌜0¹⌝ still exists (and happens to be isomorphic to / in bijection with ⌜0⌝)
00:53:23 <ski> (you could take any inhabited set in place of ⌜1⌝, in fact)
00:55:22 <hololeap> so what is the relationship between exponential objects and hom-sets?
00:56:39 <ski> hom-sets are sets. exponential objects are objects in the category in question
00:56:44 lmw joins (95e040cf@gateway/web/thelounge/ip.149.224.64.207)
00:57:47 <ski> if the category is concrete, meaning that one can interpret its objects as sets (via an "underlying/forgetful fucntor"), then the underlying set of the exponential object may coincide with the hom-set
00:58:25 × Neuromancer quits (~Neuromanc@unaffiliated/neuromancer) (Ping timeout: 240 seconds)
00:59:54 <hololeap> is there a hom-set for every pair of objects in a small category?
01:00:05 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds)
01:00:28 <ski> yes
01:00:45 × stree quits (~stree@68.36.8.116) (Ping timeout: 265 seconds)
01:00:56 <ski> (even in a locally small category .. being the definition of "locally small")
01:01:20 <hololeap> so then there isn't necessarily a relationship between exponential objects and hom-sets, but they have parallel definitions (in those categories at least)
01:01:40 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
01:01:44 <ski> i think sometimes exponentials are known as "internal homs"
01:02:27 pfurla_ joins (~pfurla@64.145.79.75)
01:02:36 × minoru_shiraeesh quits (~shiraeesh@5.101.59.186) (Ping timeout: 240 seconds)
01:02:57 <hololeap> i wish i had learned category theory in grade-school :)
01:04:20 <ski> "Conceptual Mathematics: a first introduction to categories" by Lawvere and Schanuel is a quite slow-paced book, with kindergarten-style problems, and quotes from conversations in class about the concepts
01:04:45 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Ping timeout: 240 seconds)
01:04:58 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
01:05:48 <ski> (it probably helps a little bit if you've at least seen say groups or monoids at some point, but it doesn't really require such background knowledge)
01:07:37 × lambda-11235 quits (~lambda-11@2600:1700:7c70:4600::3f) (Ping timeout: 260 seconds)
01:07:44 conal joins (~conal@64.71.133.70)
01:08:16 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
01:08:17 × Tops2 quits (~Tobias@dyndsl-095-033-095-228.ewe-ip-backbone.de) (Read error: Connection reset by peer)
01:08:36 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
01:08:47 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
01:09:55 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 272 seconds)
01:11:21 <hololeap> cool, i will check it out at some point
01:11:24 × Alleria_ quits (~AllahuAkb@2603-7000-3040-0000-5c29-b877-8573-3a70.res6.spectrum.com) (Ping timeout: 240 seconds)
01:11:26 × whataday quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:12:33 whataday joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:13:18 stree joins (~stree@68.36.8.116)
01:13:38 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
01:13:48 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 265 seconds)
01:14:39 <ski> (more specifically, what may help is some familiarity with algebraic/equational reasoning, especially with not only having unknowns and indeterminates stand for numbers, but also for possibly more or less arbitrary things, and similarly having symbols like ⌜+⌝,⌜⋅⌝ possibly stand for other things than the usual familiar numeric addition and multiplication (say on integers, rational numbers, or real
01:14:45 <ski> numbers). having some basic familarity with functions should also help ..)
01:15:35 Alleria_ joins (~AllahuAkb@2603-7000-3040-0000-e45d-b815-1770-2199.res6.spectrum.com)
01:16:58 × da39a3ee5e6b4b0d quits (~da39a3ee5@2403:6200:8876:b8ec:2ccc:b56e:5cb:43cd) (Quit: My MacBook has gone to sleep. ZZZzzz…)
01:17:22 <karasu1[m]> Groups and rings will help me understand Haskell?
01:17:50 <ski> nah, not really
01:17:52 <monochrom> No.
01:18:07 <ski> @where prerequisite
01:18:07 <lambdabot> "Prerequisite for Learning Haskell" <http://www.vex.net/~trebla/haskell/prerequisite.xhtml>
01:18:11 pfurla joins (~pfurla@ool-182ed2e2.dyn.optonline.net)
01:18:49 <ski> karasu1[m] : i was talking about that book above (which was not for learning Haskell, but for learning category theory)
01:19:06 <ski> (and no, you don't need to learn CT in order to learn, or make effective use of, Haskell)
01:19:56 × pfurla_ quits (~pfurla@64.145.79.75) (Ping timeout: 240 seconds)
01:20:29 <karasu1[m]> CT?
01:20:40 <karasu1[m]> Combinatorics?
01:21:03 <ski> Category Theory
01:21:46 ski . o O ( Karatsuba )
01:21:48 <karasu1[m]> But category is the part of mathematics that monoids are part of right?
01:21:58 <ski> no, not really
01:22:07 <karasu1[m]> OK
01:22:30 <ski> monoids, along with groups, rings, &c. are usually lumped in under the label "abstract algebra"
01:22:44 <karasu1[m]> Will it not help you at all?
01:22:55 <monochrom> No.
01:23:04 <monochrom> Learning Haskell will help you understand Haskell.
01:23:15 <monochrom> Why are you still looking for distraction?
01:23:22 <ski> then, "universal algebra" is a way to make this more uniform and general, focusing on what's the common features of monoids,groups,&c.
01:23:36 <ski> and then, category theory can be seen as generalizing that even further ..
01:23:43 <karasu1[m]> "Why are you still looking for distraction?" I need to pick electives in college..
01:23:56 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
01:24:17 <ski> if you're interested in math, you may (or may not) enjoy learning CT (or abstract algebra, for that matter). it's not directly relevant to Haskell, for the most part, though
01:24:26 <monochrom> This is not a career counselling channel.
01:24:50 Mike69 joins (ae330882@c-174-51-8-130.hsd1.co.comcast.net)
01:25:32 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
01:25:53 <hololeap> it might understand what the hell edwardk is talking about in his libraries
01:26:15 <hololeap> *help understand
01:26:51 <hololeap> *help you understand
01:28:18 ddellaco_ joins (~ddellacos@86.106.143.33)
01:29:13 apache8080 joins (~rishi@wsip-70-168-153-252.oc.oc.cox.net)
01:29:21 <karasu1[m]> I know it's not a career counselling channel. That is why I asked it in relation to Haskell
01:29:45 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds)
01:29:56 <karasu1[m]> There is a good amount of math that is relevant to Haskell
01:30:11 <karasu1[m]> I was wondering if CT was one of them
01:30:13 <karasu1[m]> That's all
01:30:40 <Mike69> Would this be the appropriate forum to inquire about how to install ghcup on Mac OS?
01:30:47 rajivr joins (uid269651@gateway/web/irccloud.com/x-ybcsyjusnyktvefi)
01:30:52 <monochrom> relevant yes. help understand no.
01:31:11 <monochrom> Understanding Haskell helps learning CT. You've got the direction wrong.
01:31:15 <glguy> Mike69: sure
01:31:49 <karasu1[m]> monochrom: OK
01:32:00 <glguy> The thing that helps understanding Haskell most is writing Haskell code
01:34:04 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
01:34:10 <karasu1[m]> I just thought it was related to Haskell
01:34:11 <karasu1[m]> So I asked
01:34:11 <karasu1[m]> I don't really see what's so wrong with that.
01:34:57 <Mike69> Thanks glguy, when I input the terminal line command to download ghc I got a build fail error and it recommended I look at build logs but I couldn't find what the issue was. Is there an alternative way to d/l this package?
01:35:50 <hololeap> not especially relevant, but i thought this was a neat article: https://bartoszmilewski.com/2021/02/16/functorio/
01:36:28 <ski> hololeap : hehe :p
01:37:09 <glguy> Mike69: https://www.haskell.org/ghcup/ mentions "If you don't like curl | sh, see other installation methods."
01:37:29 <glguy> but it might be worth just putting the output you got on a pastebin and seeing if someone can help with that
01:37:56 × borne quits (~fritjof@200116b8640b4400a9b5d4f34e3c7d10.dip.versatel-1u1.de) (Ping timeout: 240 seconds)
01:38:10 × m0rphism1 quits (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de) (Ping timeout: 265 seconds)
01:38:18 ski . o O ( `makedRedScienceAssembler :: (GreenCircuit,Gear,IronPlate) -> ((CopperPlate,Gear) -> RedScience)' )
01:38:21 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds)
01:38:29 <Mike69> [ ghc-configure ] not found (too old?)
01:38:29 <Mike69> [ ghc-configure ] checking for gcc... gcc
01:38:30 <Mike69> [ ghc-configure ] checking whether the C compiler works... no
01:38:30 <Mike69> [ ghc-configure ] configure: error: in `/private/var/folders/mm/6xmqb11d7j51...
01:38:31 <Mike69> [ ghc-configure ] configure: error: C compiler cannot create executables
01:38:31 <Mike69> [ ghc-configure ] See `config.log' for more details
01:38:32 <Mike69> [ Error ] Build failed with NonZeroExit 77 "./configure" ["--prefix=/Users/mike/.ghcup/ghc/8.10.4"]
01:38:32 <Mike69>     Check the logs at "/Users/mike/.ghcup/logs" and the build directory "/var/folders/mm/6xmqb11d7j51rwgyys43_lfr0000gn/T/ghcup-Gkf6oF" for more clues.
01:38:33 <Mike69>     Make sure to clean up "/var/folders/mm/6xmqb11d7j51rwgyys43_lfr0000gn/T/ghcup-Gkf6oF" afterwards.
01:38:33 <Mike69> "_eghcup --cache install ghc recommended" failed!
01:38:34 guest218 joins (~user@49.5.6.87)
01:39:03 <ski> Mike69 : please don't paste many lines all at the same time into the channel
01:39:03 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 272 seconds)
01:39:06 borne joins (~fritjof@2a06:8782:ffbb:1337:cedc:600c:1368:e6dd)
01:39:27 <Mike69> No problem? How should I post lengthier content?
01:39:27 × apache8080 quits (~rishi@wsip-70-168-153-252.oc.oc.cox.net) (Quit: WeeChat 1.9.1)
01:39:33 <ski> @where paste
01:39:33 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
01:40:07 <ski> (you were likely just one or two lines away from being booted off the network by Sigyn, by doing the above)
01:40:09 apache8080 joins (~rishi@wsip-70-168-153-252.oc.oc.cox.net)
01:40:50 × amerigo quits (uid331857@gateway/web/irccloud.com/x-vhvftduashcjswei) (Quit: Connection closed for inactivity)
01:40:53 <Mike69> I apologize, first time on this forum
01:41:28 <glguy> Mike69: you'll need a working C compiler, so that's worth fixing first. Do you already have xcode commandline tools installed? xcode-select --install
01:41:47 <ski> no worry. just informing you that it's a problem (it can be a bit disruptive to the channel flow), and also that you might get kicked off, if you do that
01:42:16 <Mike69> Let me check glguy, I know I have a c++ compiler
01:44:21 <Mike69> I did not, after d/l those command line tools can I rerun the curl terminal command to reinstall?
01:44:33 <glguy> Sure, worth a try
01:44:47 × loli quits (~loli@024-171-017-003.res.spectrum.com) (Quit: WeeChat 3.0)
01:44:57 wei2912 joins (~wei2912@unaffiliated/wei2912)
01:45:08 ezrakilty joins (~ezrakilty@97-113-55-149.tukw.qwest.net)
01:45:16 loli joins (~loli@024-171-017-003.res.spectrum.com)
01:45:36 <Mike69> I apologize for the low level questions everyone. Its my first time working with the terminal
01:45:51 <glguy> It's fine.
01:46:40 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
01:49:15 <Mike69> That worked! Thanks for the insight glguy
01:51:07 <nshepperd2> huh, this is weird. a trivial gloss program using playIO that does nothing maxes out the cpu doing callback_simulate_idle when its window is minimized/not visible
01:51:30 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 265 seconds)
01:51:34 l8star joins (~l8star@business-90-187-113-149.pool2.vodafone-ip.de)
01:53:18 <nshepperd2> but then it doesn't when i have a compositor (`picom`) running so maybe this is some incomprehensible interaction with the fact that my window manager is i3
01:54:23 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
01:56:16 × lmw quits (95e040cf@gateway/web/thelounge/ip.149.224.64.207) (Quit: The Lounge - https://thelounge.chat)
01:58:23 × chenshen quits (~chenshen@2620:10d:c090:400::5:1a91) (Read error: Connection reset by peer)
01:59:12 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
02:00:08 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
02:00:09 <guest218> ski: newLabel :: Cont o (Label o); jumpLabel :: Label o -> Cont o a; I don't get it how it can jump in callCC?
02:01:26 <guest218> what's the trick?
02:02:12 × elliott__ quits (~elliott@pool-108-51-101-42.washdc.fios.verizon.net) (Quit: WeeChat 3.0)
02:04:04 <ski> hint : `jumpLabel' needs to use `callCC'
02:04:16 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 240 seconds)
02:04:56 × ph88^ quits (~ph88@2a02:8109:9e00:7e5c:1d07:66bc:d1dc:63b4) (Remote host closed the connection)
02:05:23 <monochrom> Eh? I thought newLabel is the one that needs callCC.
02:05:24 ph88^ joins (~ph88@2a02:8109:9e00:7e5c:1d07:66bc:d1dc:63b4)
02:06:28 <guest218> ski: callCC \e1 -> do { ... let jumpLable = callCC \e2 -> .. }?
02:06:52 <guest218> no
02:07:15 <guest218> jumpLable <- callCC \e2 -> .. ?
02:07:31 <guest218> no
02:08:50 <ski> er .. sorry. `newLabel', yes
02:09:14 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
02:09:24 × oisdk quits (~oisdk@2001:bb6:3329:d100:e4fd:fcea:33f:6b51) (Quit: oisdk)
02:10:47 × ddellaco_ quits (~ddellacos@86.106.143.33) (Remote host closed the connection)
02:10:53 oisdk joins (~oisdk@2001:bb6:3329:d100:e4fd:fcea:33f:6b51)
02:11:19 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 265 seconds)
02:11:59 <ski> something like `evalCont (do (loop,i) <- newLabel 1; unless (i >= 1000) (jumpLabel loop (2*i)); return i)' ought to evaluate to `1024'
02:12:00 <guest218> newLabel = cont (\ar -> ar (a:: Label o)) :: Cont o (Label o)
02:13:09 × xff0x quits (~xff0x@2001:1a81:524a:900:7a5:9afc:4d34:2f96) (Ping timeout: 272 seconds)
02:13:25 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 240 seconds)
02:14:10 <guest218> ski: newLable :: Cont r a, what `newLabel l` means? you mean `runCont newLabel l`?
02:14:16 × apache8080 quits (~rishi@wsip-70-168-153-252.oc.oc.cox.net) (Ping timeout: 240 seconds)
02:14:47 xff0x joins (~xff0x@2001:1a81:5288:8c00:80f0:a117:da1e:30a9)
02:16:01 nshepperd2 just fixes it by patching gloss to not set the idle callback at all. problem solved
02:16:52 <nshepperd2> nope, that didn't work
02:17:15 × landonf1 quits (~landonf@195.140.213.38) (Remote host closed the connection)
02:18:06 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
02:19:09 <ski> guest218 : that's a `1', not an `l'
02:20:35 <guest218> number one or character L ?
02:20:53 <guest218> the font show them same here
02:20:59 × epicte7us quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Read error: Connection reset by peer)
02:22:40 <ski> the former
02:22:58 <guest218> ski: but newLabel :: Cont o (Label o); what `newLabel 1` does?
02:22:59 pavonia is now known as pavonia^\_^\
02:23:14 <guest218> wait
02:23:23 <guest218> newLabel = callCC ...
02:23:29 <guest218> no
02:23:59 <guest218> callCC return Cont r a either
02:24:30 drbean joins (~drbean@TC210-63-209-155.static.apol.com.tw)
02:24:39 <guest218> ski: I don't get it, why this Cont r a can take a parameter without runCont?
02:24:49 <ski> <ski> or, if you prefer, `newLabel :: a -> Cont o (Label o a,a) and `jumpLabel :: Label o a -> a -> Cont o b'
02:25:42 jeremyb joins (~jeremyb@217.146.82.202)
02:26:21 × Mike69 quits (ae330882@c-174-51-8-130.hsd1.co.comcast.net) (Quit: Connection closed)
02:26:25 <guest218> wait a sec, (loop, i) <- newLabel 1; this newLabel will exit earlier, that assign 1 to i is later
02:27:05 <guest218> ski: so `loop something` will assign 1 to i?
02:28:11 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
02:29:37 <guest218> the `loop` capture what actions after it and before call it?
02:30:11 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
02:32:16 <ski> no assignment
02:33:29 × geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 256 seconds)
02:33:35 apache8080 joins (~rishi@wsip-70-168-153-252.oc.oc.cox.net)
02:33:35 <ski> it will at first bind `i' to `1'. later, when `jumpLabel loop (2*i)' is executed, it will jump back, making the previous invocation of `jumpLabel i' (which is only invoked once) exit again, this time binding `i' to the previous value of `2*i'
02:35:12 Lord_of_Life_ joins (~Lord@unaffiliated/lord-of-life/x-0885362)
02:36:03 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 272 seconds)
02:36:05 × Lord_of_Life quits (~Lord@unaffiliated/lord-of-life/x-0885362) (Ping timeout: 240 seconds)
02:36:34 Lord_of_Life_ is now known as Lord_of_Life
02:37:47 <guest218> loop :: Label o
02:38:46 <ski> loop :: Label o Integer
02:39:10 <ski> (meaning that you pass an `Integer' to `jumpLabel', when you jump to it, causing `i' to be bound to that `Integer')
02:39:20 <ski> (it's a "`goto' with argument")
02:40:29 <guest218> but newLabel :: Cont o (Label o); jumpLabel :: Label o -> Cont o a;
02:41:06 <guest218> Label o and Label o Integer are not conflict?
02:41:20 <ski> <ski> <ski> or, if you prefer, `newLabel :: a -> Cont o (Label o a,a) and `jumpLabel :: Label o a -> a -> Cont o b'
02:41:29 <ski> i was using this latter version, in that example
02:42:17 <guest218> this do notation make it harder to understand ...
02:43:24 × ezrakilty quits (~ezrakilty@97-113-55-149.tukw.qwest.net) (Remote host closed the connection)
02:43:41 <guest218> x <- Cont r a and let x = a and Cont r a in do-notation
02:44:25 deviantfero joins (~deviantfe@190.150.27.58)
02:45:18 <ski> perhaps you mean that in `x <- act', if `act :: Cont r a', then `x :: a'
02:46:50 <guest218> yes, in a Cont r a do-notaion, every line should have type Cont r a, right?
02:47:43 <guest218> but some assignment lines like x <- (act :: Cont r a) or let x = a :: a
02:47:48 <guest218> are also ok
02:48:08 <guest218> more confused
02:48:27 <ski> for a single `do'-expression, every command belonging to it should have an action of type `m a', where the `a' may differ between different commands, but the `m' should be the same
02:48:56 <ski> in your case, `m' would be `Cont r' .. which means that the commands have to share the same `r'
02:49:50 <ski> (`let' commands in `do' don't involve actions belonging to the `do'-expression, so they're irrelevant here)
02:50:47 × Narinas quits (~Narinas@189.223.59.23.dsl.dyn.telnor.net) (Read error: Connection reset by peer)
02:51:04 Narinas joins (~Narinas@189.223.59.23.dsl.dyn.telnor.net)
02:51:06 <guest218> ski: in Maybe do-notation, let x = 3; 3 <- Just 3; and Just 3; aren't same?
02:51:22 <guest218> or 3 <- return 3
02:51:33 <ski> i can't parse the question
02:51:56 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
02:52:04 <ski> `3 <- return 3' and `3 <- Just 3' would be the same, if `Maybe's the monad
02:52:06 × alx741 quits (~alx741@181.196.68.69) (Quit: alx741)
02:52:17 <ski> > [Just 3,return 3]
02:52:19 <lambdabot> [Just 3,Just 3]
02:53:00 <guest218> x :: Maybe Int; x = do { let x = 3; y <- Just 3; Just 3; z <- return 3 }
02:53:02 <ski> and `3 <- return 3' is a no-op command
02:53:18 inkbottle is now known as zebrag
02:53:42 <guest218> those four lines are not doing same thing?
02:53:53 <ski> that's not a valid `do', since the last command isn't a plain expression
02:54:17 <ski> since `x' is unused, `let x = 3' there is also a no-op
02:54:52 <ski> as is `Just 3' and `y <- Just 3' and `z <- return 3' (since `y' and `z' are unused, too)
02:56:08 Benzi-Junior joins (~BenziJuni@88-149-67-143.du.xdsl.is)
02:58:42 × gentauro quits (~gentauro@unaffiliated/gentauro) (Read error: Connection reset by peer)
02:59:49 gentauro joins (~gentauro@unaffiliated/gentauro)
03:00:26 <ephemient> if you think about the desugaring, do { let x = 3; y <- Just 3; Just 3; z <- return 3 } means let x = 3 in Just 3 >>= \y -> Just 3 >> return 3 >>= \z ->
03:00:27 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
03:01:13 <ephemient> can't end an expression with \z ->, can't end a do-block with a z <- line either
03:01:58 lambda-11235 joins (~lambda-11@2600:1700:7c70:4600:7c17:5065:9ac7:7003)
03:02:41 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
03:03:02 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
03:04:10 <ski> @undo do { let {x = 3}; y <- Just 3; Just 3; z <- return 3; somethingElse }
03:04:10 <lambdabot> let { x = 3} in Just 3 >>= \ y -> Just 3 >> return 3 >>= \ z -> somethingElse
03:06:42 <guest218> @undo do { (loop,i) <- newLabel 1; unless (i >= 1000) (jumpLabel loop (2*i)); return i }
03:06:42 <lambdabot> newLabel 1 >>= \ (loop, i) -> unless (i >= 1000) (jumpLabel loop (2 * i)) >> return i
03:08:57 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 264 seconds)
03:10:29 × Lowl3v3l quits (~Lowl3v3l@dslb-002-203-233-121.002.203.pools.vodafone-ip.de) (Ping timeout: 265 seconds)
03:14:23 <guest218> newLabel :: a -> Cont o (Label o a,a); jumpLabel :: Label o a -> a -> Cont o b
03:14:56 <guest218> newLabel 1 :: Cont o (Label o Int, Int)
03:15:30 <guest218> jumpLabel loop (2*i) :: Cont o b
03:16:26 <guest218> what's the magic can make jumpLabel loop (2*i) jump to newLabel 1 line?
03:16:45 × apache8080 quits (~rishi@wsip-70-168-153-252.oc.oc.cox.net) (Ping timeout: 240 seconds)
03:19:34 da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:b8ec:2ccc:b56e:5cb:43cd)
03:19:36 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
03:19:44 × Sheilong quits (uid293653@gateway/web/irccloud.com/x-rkfjjfjswoaocqaj) (Quit: Connection closed for inactivity)
03:21:33 × stree quits (~stree@68.36.8.116) (Ping timeout: 264 seconds)
03:23:32 × borne quits (~fritjof@2a06:8782:ffbb:1337:cedc:600c:1368:e6dd) (Ping timeout: 260 seconds)
03:24:37 apache8080 joins (~rishi@wsip-70-168-153-252.oc.oc.cox.net)
03:24:48 FinnElija joins (~finn_elij@gateway/tor-sasl/finnelija/x-67402716)
03:24:48 finn_elija is now known as Guest50728
03:24:48 FinnElija is now known as finn_elija
03:25:09 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
03:28:53 × Guest50728 quits (~finn_elij@gateway/tor-sasl/finnelija/x-67402716) (Ping timeout: 268 seconds)
03:31:40 × Wuzzy quits (~Wuzzy@p5790eb2a.dip0.t-ipconnect.de) (Quit: Wuzzy)
03:34:33 stree joins (~stree@68.36.8.116)
03:34:44 <ski> @let evalCont :: Cont o o -> o; evalCont = (`runCont` id)
03:34:45 <lambdabot> Defined.
03:35:01 borne joins (~fritjof@2a06:8782:ffbb:1337:cedc:600c:1368:e6dd)
03:35:04 <ski> @let evalContT :: Applicative i => ContT o i o -> i o; evalContT = (`runContT` pure)
03:35:06 <lambdabot> Defined.
03:35:24 <ski> > evalCont (do { (loop,i) <- newLabel 1; unless (i >= 1000) (jumpLabel loop (2*i)); return i })
03:35:26 <lambdabot> 1024
03:35:51 <ski> @type newLabel
03:35:52 <lambdabot> a -> Cont o (Label o a, a)
03:35:57 <ski> @type jumpLabel
03:35:58 <lambdabot> Label o a -> a -> Cont o b
03:36:05 <ski> @type newLabel_
03:36:06 <lambdabot> Cont o (Label_ o)
03:36:16 <ski> @type jumpLabel_
03:36:17 <lambdabot> Label_ o -> Cont o b
03:36:24 <ski> @type newLabelT
03:36:25 <lambdabot> forall k a (o :: k) (f :: k -> *). a -> ContT o f (LabelT o f a, a)
03:36:30 <ski> %c.
03:37:24 <ski> oh, curious .. `ContT' is polymorphic
03:39:52 × oisdk quits (~oisdk@2001:bb6:3329:d100:e4fd:fcea:33f:6b51) (Quit: oisdk)
03:41:56 <edwardk> woot, this unlifted thing is actually starting to work
03:42:09 <edwardk> now i just need to make a gajillion unlifted Monad, etc. classes
03:42:33 <ski> unlifted what ?
03:42:42 <edwardk> i can now instantiate basically any typeclass i want at basically any TYPE r for any runtime rep i want, with pretty graceful fallback to GHC standard classes
03:42:47 <edwardk> github.com/ekmett/unlifted
03:42:47 × borne quits (~fritjof@2a06:8782:ffbb:1337:cedc:600c:1368:e6dd) (Ping timeout: 260 seconds)
03:43:26 <edwardk> when you go to say generalize Num a to allow NUM (a :: TYPE r) you run into a hurdle which is that you can't supply default definitions, because levity polymorphism doesn't work in negative position...
03:43:29 <edwardk> but you can fix that
03:43:43 <edwardk> by making a class off the representation type itself that supplies the defaults
03:43:49 <edwardk> then I use backpack to fill in those instances
03:43:52 <edwardk> and then carry on
03:44:09 <edwardk> The end result is I can have Eq Int#, Num Float#, etc.
03:44:19 toorevitimirp joins (~tooreviti@117.182.181.253)
03:44:42 <edwardk> and i've figured out how to make a viable enough form of list, maybe, etc. that i can get Show/Read, etc. working with a bit more effort
03:45:12 <edwardk> ghc 9.2 should start allowing me unlifted data types, so this is my attempt to figure out how a world that works uniformly over lifted and unlifted data could look
03:45:27 <ski> hm, can you elaborate on "levity polymorphism doesn't work in negative position" ?
03:45:55 <edwardk> say you go to define id :: forall r (a :: TYPE r). a -> a; id x = x; GHC won't let you do that
03:46:05 <edwardk> r there could be 'LiftedRep like you are used to.
03:46:18 <ski> specifically because `a' is used in negative position ?
03:46:45 <edwardk> r there could be 'TupleRep '[ 'IntRep, 'LiftedRep] whatever.
03:46:48 <edwardk> yeah
03:46:58 <edwardk> it actually allows us to be levity polymorphic in the final result
03:47:00 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
03:47:06 <edwardk> so i came up with a hack
03:47:08 <edwardk> i can make
03:47:13 <edwardk> type Lev a = (()~()) => a
03:47:21 <edwardk> and THAT can be levity polymorphic
03:47:31 <edwardk> type Lev (a :: TYPE r) = (()~()) => a
03:47:48 <edwardk> is internally a function in core, it takes a proof of ()~() and returns a value. so we're positive, right?
03:47:48 <ski> hm, i thought levity-polymorphic `error' only worked because it doesn't actually return a value
03:47:56 <edwardk> but it lives in kind Type, not TYPE r
03:49:00 <edwardk> the actions ghc takes to get the STG stack into the right configuration, arguments might get passed in different registers, etc. but that is all call-side.
03:49:26 <edwardk> one problem i had was for instance that i couldn't define Monoid at first
03:49:31 <edwardk> because it contains a naked 'a'
03:49:35 <edwardk> mempty :: a
03:49:46 <edwardk> similarly Bounded minBound, maxBound... pi elsewhere, etc.
03:49:50 <ski> you replace every `a' by `Lev a' ?
03:49:54 <edwardk> but by returning Lev a i can
03:50:17 <edwardk> ONLY for minBound, maxBound, pi, and a couple of limited situations where i want to work polymorphically over all kinds without a custom class
03:50:26 <edwardk> but i still have to manually hack in defaults
03:50:56 × xff0x quits (~xff0x@2001:1a81:5288:8c00:80f0:a117:da1e:30a9) (Ping timeout: 240 seconds)
03:50:58 <edwardk> so i exploit the fact that a -> a -> a is a Type, regardless of the runtime rep (a :: TYPE r) has
03:51:01 <ski> "without a custom class" -- i thought you already said you did custom versions of all the classes ?
03:51:05 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 240 seconds)
03:51:08 <edwardk> let me explain
03:51:31 <edwardk> https://github.com/ekmett/unlifted/blob/main/core/Unlifted/Internal/Class.hs#L34
03:51:32 <edwardk> look at Eq
03:51:55 <edwardk> I can't put default definitions in there. because those definitions would be forced to manipulate arguments of unknown-at-the-time you wrote the instance kind.
03:52:01 xff0x joins (~xff0x@2001:1a81:5288:8c00:e78d:bbe2:6a38:a9e6)
03:52:10 <edwardk> but i can make EqRep which knows r supply those definitions.
03:52:28 <edwardk> so here i have one instance for 'LiftedRep which delegates to Prelude.Eq
03:52:31 <edwardk> so far so good?
03:52:57 <edwardk> but when i go to do this for say 'IntRep, i need another instance. which means supplying a ton of boilerplate instances that all look the same
03:53:09 <edwardk> but in theory the set of reps is open. after all TupleRep takes a list
03:53:23 <edwardk> so i use backpack to generate the EqRep, etc. instances.
03:53:41 <edwardk> https://github.com/ekmett/unlifted/blob/main/def/Def.hs#L24
03:53:46 <ski> hm, what are instances of `EqRep' ?
03:53:48 <edwardk> Rep there is an arbitrary RuntimeRep
03:54:07 <edwardk> I have EqRep 'IntRep, EqRep 'FloatRep, EqRep 'WordRep, etc.
03:54:19 <ski> but not 'LiftedRep ?
03:54:30 <edwardk> those get generated by mixins stanzas
03:54:30 <edwardk> https://github.com/ekmett/unlifted/blob/main/unlifted.cabal#L73
03:54:39 × DTZUZU quits (~DTZUZU@205.ip-149-56-132.net) (Read error: Connection reset by peer)
03:54:41 <edwardk> 'LiftedRep is supplied in the .Class module. the others are supplied by the mixin
03:54:51 <edwardk> or rather, i could supply it in .Class
03:55:07 <edwardk> i guess i don't bother, because it won't get used as all the definitions for kind TYPE 'LiftedRep delegate to Prelude
03:55:14 <edwardk> rather than use the default definitions in the class
03:55:26 × theDon quits (~td@muedsl-82-207-238-165.citykom.de) (Ping timeout: 240 seconds)
03:55:26 <ski> ah, `Rep' is a module parameter
03:55:28 DTZUZU joins (~DTZUZU@205.ip-149-56-132.net)
03:55:55 <edwardk> so to compare with (==) if you don't supply (==) it delegates to not (x /= y) by way of EqRep for the kind you're in. since that code knows the representation it can pass around values x and y at will.
03:56:24 <edwardk> so i can make, say newtype Age# = Age# Int# -- and define `instance Num Age#` and it just works using UnliftedNewtypes
03:56:47 <edwardk> similarly instances can hang off Char# because it has TYPE 'WordRep
03:57:06 <edwardk> and with this i can write (==) for things like Array#, etc.
03:57:30 theDon joins (~td@94.134.91.113)
03:57:34 <edwardk> when i go to do Show we run into a headache, which is that list is monomorphically tied to Type -> Tyope
03:57:37 <edwardk> er Type -> Type
03:57:50 <edwardk> so i generalize it, by making a type family List :: TYPE r -> Type
03:58:02 <edwardk> and then i have some test code for handling overloaded lists with that
03:58:07 <edwardk> using rebindable syntax
03:58:10 <edwardk> i have to get that integrated
03:58:19 <edwardk> but i just got the whole thing compiling end to end and was excited
03:58:35 <edwardk> end result is you can use [ 1#, 2#, 3# ] -- just fine
03:58:35 <ski> hm, just wondering how you're handling that overloading, yes
03:58:36 × s00pcan quits (~chris@107.181.165.217) (Ping timeout: 240 seconds)
03:58:52 <edwardk> IfThenElse uses Lev to provide both appropriate laziness and dispatch off a single definition
03:59:07 <ski> `OverloadedLists' ?
03:59:20 <edwardk> https://github.com/ekmett/unlifted/blob/main/core/Unlifted/Internal/Syntax.hs#L20
03:59:21 <edwardk> yeah
03:59:42 <edwardk> RebindableSyntax so it dispatches to whatever fromListN I have in scop
03:59:58 <edwardk> and the one i have in scope will be sufficiently generalized
04:00:14 <ski> hm, so you're effectively thunking the unboxed parameters with `Lev'
04:00:25 <edwardk> yeah, they become by-name there
04:00:31 ski nods
04:00:36 <edwardk> and automatically lowered when you go to use them without the ()~() constraint
04:00:48 <edwardk> which is why if there can be magically lazy but invisible to users
04:00:49 s00pcan joins (~chris@075-133-056-178.res.spectrum.com)
04:01:09 <edwardk> my issue was i wanted just the numeric bits of rebindablesyntax, but you can't opt out of the parts you don't want
04:01:14 <edwardk> which prompted the invention of Lev
04:01:18 <edwardk> but that also fixed Monoid, Bounded, etc.
04:01:32 <edwardk> and allowed me to write a runtimerep polymorphic const, id, etc.
04:01:44 <ski> why just the numeric bits ?
04:01:49 <edwardk> did it first?
04:01:53 <edwardk> doesn't need lists
04:02:08 <edwardk> just got list/maybe, so now i can do Show, Read, etc.
04:02:45 <edwardk> i've been off playing around with linear-haskell in another project, might try to see how polymorphic i could make things here too, but the two don't mesh perfectly
04:03:03 <edwardk> trying to shake that out so i can know what to ask for when i talk to the compiler folks
04:03:44 <edwardk> spend a couple hours fighting with ways to make lists/maybes actually get complete pragmas
04:03:54 <edwardk> still don't have good docs, as haddock can't find the backpacked mixins
04:03:55 <dolio> You can write a list that gets instantiated to unboxed ints? I was expecting it would still need to be one of the pointer reps.
04:03:59 <edwardk> so it misses most of the instances
04:04:14 <edwardk> dolio: there is a custom data type for each Rep
04:04:19 <ski> dolio : special-cased for each representation
04:04:21 <edwardk> built by backpack for me
04:04:25 <dolio> Oh, okay.
04:05:05 <edwardk> i'll be able to make LiftedRep and UnliftedRep share a backing implementation once we get them into a common (BoxedRep l) type in 9.2
04:05:23 × toorevitimirp quits (~tooreviti@117.182.181.253) (Remote host closed the connection)
04:05:30 <dolio> Yeah, okay. That makes more sense.
04:05:36 × vicfred quits (vicfred@gateway/vpn/mullvad/vicfred) (Quit: Leaving)
04:05:37 <dolio> And might actually not be terrible to use.
04:05:46 <edwardk> and i'll be able to make the List :: TYPE r -> TYPE (BoxedRep l) -- in the end so i can have lifted and unlifted lists.
04:05:50 toorevitimirp joins (~tooreviti@117.182.181.253)
04:06:04 <edwardk> mutatis mutandis Maybe
04:06:10 <edwardk> but that needs ghc 9.2 unlifted data types
04:06:25 <ski> the list itself can be unboxed ?
04:06:31 <edwardk> unlifted, not unboxed
04:06:43 <ski> right, ok
04:06:52 <dolio> What are the ML people going to whine about then. :þ
04:07:03 <edwardk> the Maybe# is unboxed. Maybe would get lifted and unlifted versions for arguments of any rep.
04:07:26 <edwardk> newtype Maybe# a = Maybe# (# (##) | a #)
04:07:37 ski nods
04:07:37 <edwardk> is a newtype wrapper around an unboxed sum
04:07:53 <dolio> Are they doing sum unpacking at some point?
04:07:57 ski would still like unboxed sums, in the sense that the continuations are unboxed ..
04:07:58 <edwardk> the Maybe version needs me to be able to create new terms of kind 'UnliftedRep, and thats going into ghc 9.2
04:08:14 <edwardk> ski: my goal is to have all 3 forms of Maybe
04:08:20 <edwardk> lifted, unlifted, unboxed
04:08:44 <ski> (iow, not what's called `UnboxedSums' in GHC)
04:08:45 <edwardk> right now you have to import a module that supplies the pattern synonyms for your runtimerep
04:08:55 <edwardk> ski: ah
04:09:36 × quinn_ quits (~quinn@c-73-223-224-163.hsd1.ca.comcast.net) (Quit: ZNC 1.8.1 - https://znc.in)
04:09:40 <edwardk> right now i just have the choice between lifted, and the ghc style unboxed sums, where it turns it into an Int# tag and an 'a' that often points to some valid-but-harmless heap object
04:10:12 ski nods
04:10:18 vicfred joins (~vicfred@unaffiliated/vicfred)
04:10:37 <edwardk> dolio: the whole time i was writing this i was saying 'shut up bob' in my head over and over ;)
04:11:04 <ski> what was Harper saying ?
04:11:17 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
04:11:34 <edwardk> oh just his general rants over haskell laziness lifting -> results. metaphorical bob in this case, not like he's said anything new on the topic lately
04:12:01 <ski> ic
04:12:18 <ski> (i haven't really seen much if any of that conversation, i think)
04:12:23 <edwardk> anyhow i was just pretty happy this worked
04:12:29 <edwardk> i was fairly pessimistic going in
04:12:37 <ski> it seems nifty, yes :)
04:12:50 <edwardk> it required something like 3 little miracles to fully function
04:12:57 <dolio> The only real thing about types in ML that you can't mimic in Haskell is having the default calling convention for them be strict.
04:13:13 <karasu1[m]> If ephemient is present, I would like to thank them for the `type Map k v = k -> Maybe v; empty _ = Nothing; insert k v m k' | k == k' = Just v | otherwise = m k'; lookup k m = m k` example yesterday (I think Axman6 presented a similar example as well). I think I understand it.
04:13:14 <dolio> So, I think all his complaints can be boiled down to that.
04:13:15 <karasu1[m]> My question is: are there similar exercises I can do to get a better understanding of treating functions as first class values to implement things and do things?
04:13:21 <karasu1[m]> I thought this was fun
04:13:34 <dolio> Aside from that it's ignorance of what you can write in Haskell at best.
04:13:44 <edwardk> karasu1[m]: nice!
04:14:03 <karasu1[m]> I am wondering if some blogs/textbook chapters somewhere go over this kind of thing in detail
04:14:20 <ephemient> karasu1[m]: you can implement `delete :: k -> Map k v -> Map k v` now, right?
04:14:21 <karasu1[m]> Or just have more exercises to try
04:14:40 <karasu1[m]> Yeah
04:15:09 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Quit: Leaving)
04:15:19 quinn joins (~quinn@c-73-223-224-163.hsd1.ca.comcast.net)
04:15:21 <edwardk> karasu1[m]: one thing worth noting is that the Map you have there is a little more lenient than the implementation we have to implement in haskell with search trees. after all your Map k v can be checked with (==), and can allow you to give back `const (Just 12)` to make a map with _all_ the values set. But on the other hand, unlike `Map` in haskell, your map doesn't let you enumerate all the set keys.
04:15:25 <karasu1[m]> remove k m k' = if k' = k then Nothing else m k'
04:15:27 <karasu1[m]> or similar
04:15:38 <karasu1[m]> s/remove/delete
04:15:39 <ski> karasu1[m] : perhaps you could try writing a one-pass `normalizeTree :: Fractional a => Tree a -> Tree a', that subtracts the global average from each quantity
04:15:52 <edwardk> you get to use Eq and can talk about infinitely large maps, but the asymptotics are worse and you can't enumerate keys.
04:16:10 <edwardk> ski: that's a great way to throw someone into the deepend ;)
04:16:24 <dolio> Yeah, there are several disadvantages to functions-as-maps.
04:16:28 <ski> karasu1[m] : or you could write `labelTree :: Tree a -> Tree (Integer,a)', labelling elements by integers, counting up from `0' .. possibly using `State' after the first direct version
04:16:45 <ephemient> absolutely don't use functions-as-maps for any real purpose, but it's a fun exercise
04:16:55 <dolio> Deleted/overwritten values will never be garbage collected.
04:17:02 Volt_ joins (~Volt_@2379590666.vpn.umich.net)
04:17:10 <ephemient> yeah, trying out other data structures is something you can explore
04:17:25 <edwardk> My interpretation of ski: "you should try swallowing this sword, folding yourself into a pretzel, and setting yourself on fire with this gasoline while wearing a flame retardant suit. i saw someone do it on Cirque du Soleil once, it should be fine."
04:18:05 ski grins
04:18:12 <karasu1[m]> I have no idea what normalizing a tree means, but basically subtract the average of all the values from all the values?
04:18:30 <karasu1[m]> Means we would have to traverse all the values I guess
04:18:35 <karasu1[m]> Maybe some foldr logic?
04:18:35 <ski> karasu1[m] : "normalize" as it making the mean/average of all the values be zero
04:18:47 × l8star quits (~l8star@business-90-187-113-149.pool2.vodafone-ip.de) (Ping timeout: 258 seconds)
04:18:49 <ski> (by subtracting the mean)
04:19:41 <ski> karasu1[m] : yep, i think you've got it
04:19:47 <ski> the catch is the "one-pass" part
04:20:21 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 264 seconds)
04:20:33 <edwardk> to be fair, the repmin problem which shows how to do the one-pass thing was a fairly novel result when it was first done, so its not necessarily fair to expect someone with a limited grasp of haskell to leap right to the correct solution
04:20:38 <karasu1[m]> one pass reeks of accumulative recursion
04:20:46 <ski> (even if you don't do it by "treating functions as first class values", it can be a nice thing to ponder)
04:20:55 <edwardk> karasu1[m]: the secret is to exploit laziness
04:20:57 <mniip> what does "one" mean
04:20:59 <mniip> :P
04:21:17 <ski> edwardk : well, it ought to be more well-known
04:21:30 <edwardk> i agree
04:21:51 <ski> mniip : there is some question about that, yes :p
04:21:53 <edwardk> its just an awfully big ask to expect someone to find it who hasn't got a good grasp of evaluation in haskell let alone laziness
04:22:32 <ski> what can i say .. it was just the first thing that came to mind :]
04:23:57 <ephemient> well, if you can figure out how to do it for [a], you can do it for Tree a
04:24:19 <ski> (hrm, the other day i was looking for "the" paper the highlighted connection of attribute grammars to laziness, but couldn't find it .. anyone would happen to know the title ior author(s) ?)
04:26:41 <karasu1[m]> Yeah, I don't think I can figure it out... But I'm guessing this is a famous result lol
04:27:10 <karasu1[m]> List comprehension?
04:27:15 <karasu1[m]> for [a]
04:27:27 <karasu1[m]> idk
04:28:07 carlomagno1 joins (~cararell@148.87.23.5)
04:28:09 × apache8080 quits (~rishi@wsip-70-168-153-252.oc.oc.cox.net) (Ping timeout: 272 seconds)
04:28:11 <ski> you know how to write recursive functions over lists, yes ?
04:28:39 apache8080 joins (~rishi@wsip-70-168-153-252.oc.oc.cox.net)
04:28:52 <karasu1[m]> The base case of empty list and recursive case of non-empty list right? And then foldr/foldl abstracts that
04:29:32 <ski> (`foldr', but) yes
04:29:48 <karasu1[m]> `foldr'??
04:29:57 × carlomagno quits (~cararell@148.87.23.5) (Ping timeout: 264 seconds)
04:30:19 <karasu1[m]> But yes, that seems like the usual pattern. Sometimes the base case is where there's one element
04:30:32 <ski> % :t foldr @[]
04:30:32 <yahb> ski: (a -> b -> b) -> b -> [a] -> b
04:30:50 <ski> @src foldr
04:30:50 <lambdabot> foldr f z [] = z
04:30:50 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
04:31:00 <karasu1[m]> Yes, I mentioned foldr right, was there something wrong with my description?
04:31:00 <ski> `foldr' is more general than `foldl'
04:31:07 <karasu1[m]> ?
04:31:18 <ski> (you can implement `foldl' in terms of `foldr', but not the other way around)
04:31:53 crestfallen joins (~jvw@135-180-46-152.fiber.dynamic.sonic.net)
04:31:57 <karasu1[m]> They both work equally well over lists though, right? (except don't use `foldl` on infinite lists)
04:33:08 <karasu1[m]> Does the pattern help me do the normalize-list thing though... well, if I tried to do it, the recursive case would be: subtract the average from the rest of the list
04:33:10 <ski> > foldr const "oops" ("a":"bc":undefined)
04:33:12 <lambdabot> "a"
04:33:12 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
04:33:12 <ski> > foldl (flip const) "oops" ("a":"bc":undefined)
04:33:14 <lambdabot> "*Exception: Prelude.undefined
04:33:18 <karasu1[m]> But we don't know the average yet
04:33:47 <karasu1[m]> the base case is just []
04:33:54 <karasu1[m]> for empty lists
04:34:04 <ski> "But we don't know the average yet" -- yes .. the crux of the matter
04:34:44 <karasu1[m]> Well, you said one pass.. Does mapping a composition of two functions at once count as one pass?
04:34:50 <karasu1[m]> Those functions would have to interact somehow
04:35:20 <karasu1[m]> idk...
04:37:44 <karasu1[m]> Not sure how you represent this in Haskell, but map (elem -) to all the elements
04:38:05 <karasu1[m]> So it becomes a list of functions that take one argument, and subtract that argument to get an `a`
04:38:30 <karasu1[m]> Then compute the average..... and map it back....
04:38:36 <karasu1[m]> But I guess that's two pass
04:38:51 × slack1256 quits (~slack1256@dvc-186-186-101-190.movil.vtr.net) (Remote host closed the connection)
04:38:57 <karasu1[m]> We only do one computation though, right? Since Haskell is lazy..
04:39:20 <karasu1[m]> So I guess technically it's one pass..? (probably this is not the answer you were looking for though..)
04:43:45 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 264 seconds)
04:44:21 <karasu1[m]> We would need some sort of mechanism to notify the elements in the list immediately when the foldr has been finished
04:44:35 <karasu1[m]> Once that "notification" is sent out, subtract the average..
04:44:47 <karasu1[m]> Yeah, no idea..
04:45:04 <dolio> Can you write something that subtracts something from every element of the list and also computes the average of the original elements in one pass?
04:46:01 <karasu1[m]> Sure
04:49:14 bobbytab1es is now known as bobbytables
04:51:43 <edwardk> i'm sad. i'd hoped i could get ghci to just print if i overloaded show, and a custom printer
04:51:45 <edwardk> GHCi can't bind a variable of unlifted type: it :: GHC.Prim.Int#
04:52:08 <edwardk> alas ghci gets confused when the thing you've set via -interactive-print expects something of kind other than Type
04:54:36 <ski> karasu1[m] : while taking a short walk, it occured to me that you could try writing `flatten :: Tree a -> [a]'
04:54:52 <karasu1[m]> dolio: https://paste.tomsmeding.com/YMeIPWHb
04:55:01 <ski> edwardk : and if you disable `it' ?
04:55:54 <karasu1[m]> wait I messed up
04:56:08 <karasu1[m]> So it should subtract a certain number from x each time in x:f xs
04:56:10 conal joins (~conal@64.71.133.70)
04:56:20 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
04:56:24 <karasu1[m]> We can just add that as another argument
04:56:53 <dolio> Right.
04:56:53 <edwardk> i don't know how 'it' works in ghci, other than automatically binding to the last result
04:57:23 <karasu1[m]> https://paste.tomsmeding.com/xfCFKpyZ
04:57:33 <karasu1[m]> So I changed it to (x -):f xs
04:57:38 × polyphem quits (~p0lyph3m@2a02:810d:640:776c:76d7:55f6:f85b:c889) (Ping timeout: 264 seconds)
04:57:39 <dolio> You should accumulate the length, too, though. Otherwise that is an extra pass.
04:57:44 <karasu1[m]> So now it gives a list of partially applied functions
04:57:55 <karasu1[m]> yea, i will accumulate length too
04:57:58 <karasu1[m]> 1 sec
04:58:02 <ski> edwardk : i mean `-fno-it'
04:59:17 <ski> karasu1[m] : you're not computing `accumSum' properly
04:59:43 <ski> (your recursive call is off. type checker should complain)
04:59:45 <dolio> Wow, I didn't know that flag existed.
04:59:57 × zebrag quits (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr) (Quit: Konversation terminated!)
05:00:02 ski saw it the other day, while browsing the user guide
05:00:08 <karasu1[m]> https://paste.tomsmeding.com/dh9avdyX
05:00:12 <karasu1[m]> It now accumulates length
05:00:22 <karasu1[m]> wait.. i'll check ghci
05:00:26 <karasu1[m]> hmm
05:00:27 <ski> nah, it doesn't properly compute `len', either
05:00:30 <edwardk> ghci> 3# + 5 ==> 8
05:00:32 <edwardk> that works
05:00:44 <ski> you'll probably need to call `f' in a `where'
05:01:01 <ski> (`let'-`in' or even `case'-`of' would also work ..)
05:01:21 <ski> edwardk : at `Int#' ?
05:01:22 <edwardk> so now i just need to make a custom pretty printing module that works polykindedly and advise users to use -fno-it -interactive-print print
05:01:24 <edwardk> yeah
05:02:11 <karasu1[m]> wait wdym by `f` in a `where`?
05:02:12 <karasu1[m]> https://paste.tomsmeding.com/1X9mCXPl
05:02:15 <karasu1[m]> Like that?
05:02:28 <ski> so how does `5' there work. i guess `fromInteger' is in your version of `Num' ?
05:02:32 zebrag joins (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr)
05:02:41 <ski> nah
05:03:08 <ski> karasu1[m] : even seen how `splitAt', or `span'/`break'/`partition' can be defined ?
05:03:24 <ski> or `halve :: [a] -> ([a],[a])'
05:03:39 forgottenone joins (~forgotten@176.42.28.68)
05:04:17 <ski> (`halve [0 .. 8]' is `([0,2,4,6,8],[1,3,5,7])', e.g.)
05:04:19 × zebrag quits (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr) (Client Quit)
05:04:54 <ski> if not .. writing one of these yourself might be an interesting simple exercise
05:04:54 × conal quits (~conal@64.71.133.70) (Read error: Connection reset by peer)
05:05:30 <ski> > span even [2,8,5,7,1,4]
05:05:31 <lambdabot> ([2,8],[5,7,1,4])
05:05:37 <ski> > break odd [2,8,5,7,1,4]
05:05:38 <lambdabot> ([2,8],[5,7,1,4])
05:05:45 <ski> > partition even [2,8,5,7,1,4]
05:05:47 <lambdabot> ([2,8,4],[5,7,1])
05:06:02 <ski> > splitAt 4 [2,8,5,7,1,4]
05:06:04 <lambdabot> ([2,8,5,7],[1,4])
05:07:31 <ski> (karasu1[m] : i mean .. you *could* define `f' in a `where' local to the defining equation of `accumList',`accumSum',`len' like that .. but that's not what i meant)
05:08:36 conal joins (~conal@64.71.133.70)
05:11:14 <karasu1[m]> Yeah trying to do that
05:11:20 <karasu1[m]> But I don't know the correct let syntax
05:11:35 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds)
05:11:52 <karasu1[m]> `(x -) : let (acLis, _, _) = f xs in acLis`
05:11:54 <karasu1[m]> Like that?
05:11:57 <karasu1[m]> idk
05:12:05 <karasu1[m]> getting error from GHCi
05:12:28 <edwardk> ghci> 1# + 3# ==> 4 ghci> "hello" ==> "hello"
05:12:34 <edwardk> ski: works a treat
05:13:20 <ski> great ! :)
05:14:23 <ski> karasu1[m] : something like that might work
05:16:29 <karasu1[m]> https://paste.tomsmeding.com/a78ycJhy
05:16:32 <karasu1[m]> GHC is happy
05:16:36 <karasu1[m]> Compiles
05:17:22 <ski> yes, that's what i meant by calling recursively in a `where'
05:18:11 <karasu1[m]> dolio: Was this what you were looking for btw?
05:18:25 <ski> `sum' and `l' are unused
05:19:07 × Volt_ quits (~Volt_@2379590666.vpn.umich.net) (Quit: )
05:19:40 <ski> (you could check this, by replacing `f (xs, 0, 0)' by `f (xs,undefined,undefined)', and still have the code work)
05:20:05 <karasu1[m]> You're right, yes
05:20:07 <karasu1[m]> https://paste.tomsmeding.com/hYXM0OmK
05:20:15 <karasu1[m]> Took some inspiration from quicksort..
05:20:27 <ski> ooh .. now you're computing something else
05:20:32 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
05:20:34 <karasu1[m]> y....
05:20:55 <ski> although, i suppose as you're calling `f', `sum' and `l' are always `0', so it doesn't matter
05:21:09 Saukk joins (~Saukk@83-148-239-3.dynamic.lounea.fi)
05:21:14 <ski> (but it's an unnecessary useless complication)
05:21:42 <ski> you should make up your mind. either compute direct style, or use an accumulator
05:21:51 <ski> not try to do both at the same time
05:22:13 <ski> (this applies to the summing; and, separately, also to the counting)
05:23:49 <dolio> karasu1[m]: Why is the result a list of functions?
05:28:20 <karasu1[m]> ski: https://paste.tomsmeding.com/Cum2piyC
05:28:35 rdivyanshu joins (uid322626@gateway/web/irccloud.com/x-dlrzsvchbzzkhuyx)
05:29:37 <ski> now, where's the "something" in "subtracts something from every element of the list" ?
05:29:57 × Tario quits (~Tario@201.192.165.173) (Ping timeout: 264 seconds)
05:29:57 <karasu1[m]> dolio: The result is a list of functions since I was trying to fulfill "Can you write something that subtracts something from every element of the list and also computes the average of the original elements in one pass?"
05:30:14 <karasu1[m]> I thought that meant a partially applied subtraction
05:30:21 <karasu1[m]> The "something" would come in later I guess
05:30:33 <ski> well, it could
05:30:35 <karasu1[m]> That's what I understood from the specification
05:30:37 <dolio> No, I mean it subtracts some particular thing from every element of the list.
05:30:38 <ski> or it could be a present parameter
05:30:52 <dolio> The same thing from every element.
05:30:55 <ski> ("some particular thing" -- the *same* particular thing)
05:31:36 × apache8080 quits (~rishi@wsip-70-168-153-252.oc.oc.cox.net) (Ping timeout: 240 seconds)
05:34:36 <karasu1[m]> like a map?
05:34:40 <karasu1[m]> (subtract 4)
05:34:50 <ski> a map ?
05:34:57 <karasu1[m]> map (subtract 4) [x]
05:35:10 <ski> that's the same as `[subtract 4 x]'
05:35:29 <ski> > map (subtract 4) [x] :: [Expr]
05:35:31 <lambdabot> [x - 4]
05:35:42 <karasu1[m]> yes
05:35:56 <karasu1[m]> map (subtract 4) [a, b, c, d, e, f, ....]
05:36:02 <karasu1[m]> Works for a general map
05:36:09 <karasu1[m]> of n length lists
05:36:09 <ski> well, `map' does a traversal of the list
05:36:27 <ski> (how else would it get to every element ?)
05:36:44 <karasu1[m]> yeah...
05:37:34 <karasu1[m]> (laziness... (the panacea of the functional programming world...))
05:37:45 <karasu1[m]> (joking ..)
05:38:32 <ski> (laziness isn't really involved, at this point)
05:39:04 <karasu1[m]> Well, I know how to give you a list of functions that when given some elements, will give you back the difference AND also the average of the original list in one pass
05:39:16 <karasu1[m]> I don't think I can do better lol..
05:39:34 <swarmcollective> > head (map (subtract 4) [1..10])
05:39:35 <lambdabot> -3
05:39:44 <ski> what if you'd pass `f' some number that you wanted to subtract from each element ?
05:39:47 <swarmcollective> ^^ lazy, right?
05:39:57 <ski> yup, swarmcollective
05:40:46 <ski> (focus for the moment on how `f' would handle that, rather than on which element to pass to `f')
05:41:07 <karasu1[m]> Sure, we can add an argument to f
05:41:09 <karasu1[m]> Let's say k
05:41:20 <karasu1[m]> then we would have (x - k) : restLis
05:41:26 <karasu1[m]> But it's still a list of functions right?
05:41:30 <karasu1[m]> same thing?
05:41:57 <ski> no
05:42:04 <ski> `x - k' there would be a number, not a function
05:42:52 <swarmcollective> Or would it be a function that evaluates to a number when requested?
05:43:01 <swarmcollective> Not that it matters, I think.
05:43:09 × stree quits (~stree@68.36.8.116) (Ping timeout: 264 seconds)
05:43:21 <swarmcollective> It is effectively a number.
05:43:36 <ski> "a function that evaluates to a number when requested" -- all functions in Haskell takes exactly one argument as input
05:44:11 <ephemient> a thunk which evaluates to a number == a number in Haskell
05:44:42 <ski> yes ("thunk" is an implementation detail/issue)
05:45:10 nbloomf joins (~nbloomf@2600:1700:ad14:3020:4d24:b159:43b:6694)
05:47:22 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
05:48:08 <karasu1[m]> But when we call f, we cannot pass it k
05:48:10 <karasu1[m]> We don't know k yet
05:48:19 <karasu1[m]> So it would still be a partially applied list
05:48:25 <karasu1[m]> x - k is a function
05:48:27 <karasu1[m]> That takes k
05:48:49 <ephemient> \k -> x - k is a function
05:49:00 <karasu1[m]> yes
05:49:04 <karasu1[m]> I agree..
05:49:10 <ski> "But when we call f, we cannot pass it k" -- are you talking about initial call, or recursive call ?
05:49:30 <karasu1[m]> Both
05:49:36 <karasu1[m]> At neither of those points do we know k
05:49:50 <ski> well, `f' gets `k' as argument. so can easily pass it on to recursive call, no ?
05:50:22 ania123 joins (5e89ad7c@94.137.173.124)
05:50:29 <dolio> Why don't you know k?
05:50:36 <dolio> What if I pick 5?
05:50:42 <dolio> I can feed that in.
05:51:11 <ski> `k' was, so far, just to be some particular number that we wanted to subtract from every element
05:51:36 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 240 seconds)
05:53:09 × crestfallen quits (~jvw@135-180-46-152.fiber.dynamic.sonic.net) (Quit: Lost terminal)
05:54:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
05:54:29 <karasu1[m]> https://paste.tomsmeding.com/UCbWHxGm
05:54:32 <karasu1[m]> Alright
05:54:33 <karasu1[m]> 5
05:54:51 <karasu1[m]> But if we didn't pass in 5, we would still get a list of k at the end
05:54:56 <karasu1[m]> list of [a -> a]
05:54:57 <karasu1[m]> i mean
05:55:06 × tmciver quits (~tmciver@cpe-172-101-40-226.maine.res.rr.com) (Ping timeout: 246 seconds)
05:55:09 <dolio> No, you wouldn't.
05:55:47 <dolio> The whole thing would be a function, there wouldn't be functions in the list.
05:55:55 stree joins (~stree@68.36.8.116)
05:56:07 × thunderrd quits (~thunderrd@183.182.113.172) (Remote host closed the connection)
05:57:14 tmciver joins (~tmciver@cpe-172-101-40-226.maine.res.rr.com)
05:58:46 <ski> karasu1[m] : now, what if you pass in the average, instead of `5' ?
06:00:10 <ski> (btw, `Fractional a' presupposes `Num a', so you don't need to state the latter as an explicit constraint)
06:03:03 × monochrom quits (trebla@216.138.220.146) (Quit: NO CARRIER)
06:03:27 <swarmcollective> Wow, that looks strange, but it works. :)
06:03:46 × machinedgod quits (~machinedg@135-23-192-217.cpe.pppoe.ca) (Ping timeout: 256 seconds)
06:04:16 <karasu1[m]> Attempt 1: https://paste.tomsmeding.com/jIovyTOr
06:04:34 apache8080 joins (~rishi@wsip-70-168-153-252.oc.oc.cox.net)
06:04:46 <ski> you didn't define `average' ?
06:04:53 <karasu1[m]> https://paste.tomsmeding.com/WzfsefgP
06:04:56 <karasu1[m]> Because I don't know average
06:04:59 <karasu1[m]> Attempt 2^
06:05:11 <ski> average is sum divides by count
06:05:14 <karasu1[m]> Attempt 2 fails because the pattern matching on functions doesn't work..
06:05:40 <ski> try defining `average' ?
06:06:15 × pavonia^\_^\ quits (~user@unaffiliated/siracusa) (Quit: Bye!)
06:06:34 <karasu1[m]> https://paste.tomsmeding.com/caGvS2Tx
06:06:53 <karasu1[m]> it works......
06:06:55 <karasu1[m]> mother of god..
06:07:13 <karasu1[m]> IDK what's happening though so oh well..
06:07:58 <dolio> Maybe you shouldn't have been thinking about what's happening, just trying to define the thing.
06:08:14 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 272 seconds)
06:08:15 <swarmcollective> It seems like magic, but I suppose it is able to compute accumSum and len, then apply that value as K. Pretty cool.
06:09:16 <ski> karasu1[m] : this is called "tying-the-knot" :)
06:09:25 <swarmcollective> Still a single traversal, but the thunk it builds could get large with a large list? Or am I missing something?
06:09:57 <ski> it only builds a single subtraction, for each list element
06:09:58 <dolio> You don't need to build thunks.
06:10:27 <dolio> For sum and length, that is. Those would get big if they're lazy.
06:11:03 <ski> yea, for efficiency, you should probably force those as you go (which means switching to accumulating style, for them)
06:12:03 <desophos> is there a conventional way to go about writing unit tests for functions that don't otherwise need to be exposed in the module's exports? i understand that one approach is to only test the exported functions, but i have a lot of intermediate functions and i'd like to make sure they work correctly
06:12:19 <ski> karasu1[m] : anyway .. an alternative is to, instead of having `f' take `k' as a parameter, you could "make the returned list take `k' as a parameter". that is, you write `\k -> x - k : ...'
06:12:26 <dolio> Well, you don't need to accumulate to fix that aspect. You just need to case on the recursive result and demand the numbers.
06:12:49 <swarmcollective> desophos, have you considered doctest?
06:12:58 monochrom joins (trebla@216.138.220.146)
06:13:06 <ski> desophos : make an `.Internal' module, export everything. import it into `.Test' (or whatever). also import it into your main module, and reexport the things you want to expose
06:13:20 <ephemient> :t \xs -> let (ys, (Sum total, Sum count)) = runWriter (traverse f xs); mean = total / fromIntegral count; f x = x - mean <$ tell (Sum x, Sum 1) in ys
06:13:21 <swarmcollective> doctest also provides nice examples for future you (and others)
06:13:21 <lambdabot> (Traversable t, Fractional b) => t b -> t b
06:13:32 <ski> dolio, true
06:13:40 <desophos> i haven't seen doctest, i'll look it up
06:14:33 <ephemient> @hackage doctest
06:14:33 <lambdabot> https://hackage.haskell.org/package/doctest
06:14:52 <dolio> Accumulating makes it tough for building the list, or trees if you're doing that.
06:15:20 <ephemient> I think the only real gripe I have is that you end up having to add QuickCheck as a library dependency if you want to write more complex properties
06:15:41 <desophos> what would that look like, ski?
06:15:58 Neuromancer joins (~Neuromanc@unaffiliated/neuromancer)
06:16:03 <desophos> oh, i'm already well down the QuickCheck rabbit hole
06:16:40 × da39a3ee5e6b4b0d quits (~da39a3ee5@2403:6200:8876:b8ec:2ccc:b56e:5cb:43cd) (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:17:38 <desophos> for the Internal module, would i just export everything from all my modules except Main, where i would reexport the functions i want exported??
06:17:47 <desophos> oops, didn't mean two ? there :P
06:18:03 <karasu1[m]> dolio: Wait what do you mean by "You just need to case on the recursive result and demand the numbers."?
06:18:13 <karasu1[m]> I'm not sure what that looks like.
06:18:15 × Saukk quits (~Saukk@83-148-239-3.dynamic.lounea.fi) (Remote host closed the connection)
06:19:04 <dolio> I don't think you should worry about that right now.
06:19:43 <dolio> But matching in the where clause is slightly different than using a `case ... of ...`
06:20:54 <ephemient> I don't suppose Monoid (,) is strict, is it.
06:22:01 <ephemient> > fst $ ((), First Nothing) <> ((), undefined)
06:22:04 <lambdabot> ()
06:22:11 <ephemient> nope
06:24:30 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
06:25:25 <koz_> There is a strict pair in a bunch of places though.
06:25:30 <koz_> So you could use one of those?
06:27:39 × urodna quits (~urodna@unaffiliated/urodna) (Quit: urodna)
06:28:09 × apache8080 quits (~rishi@wsip-70-168-153-252.oc.oc.cox.net) (Ping timeout: 264 seconds)
06:29:05 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
06:33:46 × electricityZZZZ quits (~electrici@108-216-157-17.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 265 seconds)
06:38:53 jedws joins (~jedws@101.184.202.248)
06:40:49 <ski> hm, saw some blag (i think ?) talking about `Selective' in here, semi-recently .. but now i can't find it :/
06:41:27 <ski> (i think it had some pretty pics with graphs/trees)
06:44:33 × kam1 quits (~kam1@5.126.205.103) (Read error: Connection reset by peer)
06:45:29 Varis joins (~Tadas@unaffiliated/varis)
06:46:37 kam1 joins (~kam1@5.126.205.103)
06:46:58 × jedws quits (~jedws@101.184.202.248) (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:48:54 <edwardk> ghci> fmap (<> "world") $ just "hello" ===> Just "helloworld" ghci> fmap (+1) $ just 12# ===> Just 13 -- now i can handle Functor
06:49:21 <ski> why the `just' ?
06:49:38 <edwardk> just is polykinded. i can't make the pattern synonym do that at present
06:49:50 <ski> oic
06:50:15 <edwardk> there is a mono-runtime-rep pattern in Unlifted.Rep.Int, but its not quite so convenient
06:50:27 <edwardk> as you need to use it at each kind in turn
06:50:38 <ski> hmm .. pattern-synonyms can't be parameterized by values .. but they can be parameterized by constraints, right ?
06:52:14 × jeremyb quits (~jeremyb@217.146.82.202) (Remote host closed the connection)
06:53:09 <edwardk> yeah, the issue is i have to use a view pattern to run the pattern guts, and it generates more surrounding functon-style code
06:53:35 × kam1 quits (~kam1@5.126.205.103) (Ping timeout: 265 seconds)
06:53:37 <edwardk> e.g. i typically use something like pattern Foo a <- (isAFoo -> Just a) where Foo a = mkFoo a
06:53:51 <ski> yes
06:53:56 <edwardk> but i have to fully apply Foo a = mkFoo a
06:54:12 <edwardk> and that won't work when a is levity polymorphic
06:54:20 <edwardk> if i could write Foo = mkFoo there i'd be closer
06:54:22 <ski> hm
06:54:29 <edwardk> isAFoo is also problematic but not as problematic
06:54:34 <ski> i wonder if that's just an accidental limitation
06:54:36 <edwardk> was hoping i could use Lev a -> Maybe a
06:55:29 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:4d24:b159:43b:6694) (Quit: My MacBook has gone to sleep. ZZZzzz…)
06:56:47 <edwardk> this is actually a reasonable case for class associated pattern synonyms
06:56:59 <edwardk> if i could supply the pattern synonym definition completely in the instance? this would be solved
06:57:27 <edwardk> at each runtime rep i know everything i need to not be levity polymorphic
06:57:54 thunderrd joins (~thunderrd@183.182.113.172)
06:58:45 <ski> hm, makes sense
06:59:29 <MarcelineVQ> and then we can call them modules instead? :>
06:59:58 <ski> hehe, i was just having some thoughts in that direction :p
07:01:16 × kupi quits (uid212005@gateway/web/irccloud.com/x-gmmufsknzrjevvnk) (Quit: Connection closed for inactivity)
07:01:22 geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr)
07:01:49 <MarcelineVQ> modules in the sense of agda or some other sufficiently powerful module system that is
07:04:08 <ski> Lolli modules are interesting. they're dynamically assumed (and can be parameterized)
07:05:18 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
07:07:30 × proteusguy quits (~proteusgu@cm-58-10-155-179.revip7.asianet.co.th) (Remote host closed the connection)
07:10:34 lep_ is now known as lep-delete
07:10:37 × MidAutumnHotaru quits (~MidAutumn@unaffiliated/midautumnhotaru) (Quit: Quit 啾)
07:10:38 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 256 seconds)
07:12:14 MidAutumnHotaru joins (~MidAutumn@unaffiliated/midautumnhotaru)
07:19:56 × geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 240 seconds)
07:21:02 kam1 joins (~kam1@83.123.186.200)
07:27:03 × Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection)
07:28:13 raym joins (~ray@45.64.220.142)
07:29:36 × cole-h quits (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net) (Ping timeout: 240 seconds)
07:44:40 × meck quits (~meck@li1809-18.members.linode.com) (Quit: ZNC 1.8.2 - https://znc.in)
07:46:36 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
07:48:09 × heatsink quits (~heatsink@2600:1700:bef1:5e10:897b:89fa:77f1:998c) (Remote host closed the connection)
07:48:36 × vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving)
07:49:03 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
07:50:20 meck joins (~meck@li1809-18.members.linode.com)
07:50:39 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
07:51:07 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
07:52:05 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 272 seconds)
07:57:18 × suraj quits (uid487353@gateway/web/irccloud.com/x-vayhhcpqeujgyqoy) (Quit: Connection closed for inactivity)
08:04:08 × cantstanya quits (~chatting@gateway/tor-sasl/cantstanya) (Remote host closed the connection)
08:04:09 × stree quits (~stree@68.36.8.116) (Ping timeout: 264 seconds)
08:05:12 acidjnk_new joins (~acidjnk@p200300d0c7390972b9ca7ed3a5659a38.dip0.t-ipconnect.de)
08:06:42 bayashi joins (~bayashi@185.204.1.185)
08:07:04 cantstanya joins (~chatting@gateway/tor-sasl/cantstanya)
08:07:48 sheepfleece joins (~sheep@46.53.253.85)
08:10:13 × tzh_ quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
08:11:32 ubert joins (~Thunderbi@p200300ecdf25d94be6b318fffe838f33.dip0.t-ipconnect.de)
08:16:06 danvet joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa)
08:17:11 stree joins (~stree@68.36.8.116)
08:25:09 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds)
08:26:10 × lambda-11235 quits (~lambda-11@2600:1700:7c70:4600:7c17:5065:9ac7:7003) (Quit: Bye)
08:29:10 Varis joins (~Tadas@unaffiliated/varis)
08:31:09 × drbean quits (~drbean@TC210-63-209-155.static.apol.com.tw) (Ping timeout: 264 seconds)
08:35:17 eta_ joins (~eta@2600:1700:42c0:1368:ad7c:f84f:a62d:bc24)
08:35:19 nhs joins (~nhs@c-24-20-87-79.hsd1.or.comcast.net)
08:35:56 average joins (uid473595@gateway/web/irccloud.com/x-tvekuqggzzxphzcd)
08:36:22 rayyyy joins (~nanoz@gateway/tor-sasl/nanoz)
08:36:49 × eta_ quits (~eta@2600:1700:42c0:1368:ad7c:f84f:a62d:bc24) (Client Quit)
08:37:15 × ania123 quits (5e89ad7c@94.137.173.124) (Quit: Connection closed)
08:37:57 Tuplanolla joins (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi)
08:38:33 nut joins (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
08:40:07 × nhs quits (~nhs@c-24-20-87-79.hsd1.or.comcast.net) (Ping timeout: 256 seconds)
08:40:13 × carldd11 quits (~carldd@90-224-49-113-no56.tbcn.telia.com) (Ping timeout: 258 seconds)
08:47:24 × refusenick quits (~user@2601:644:8502:d700::eeeb) (Ping timeout: 240 seconds)
08:48:01 × kam1 quits (~kam1@83.123.186.200) (Read error: Connection reset by peer)
08:48:54 heatsink joins (~heatsink@2600:1700:bef1:5e10:897b:89fa:77f1:998c)
08:49:50 × sheepfleece quits (~sheep@46.53.253.85) (Remote host closed the connection)
08:52:30 sheepfleece joins (~sheep@46.53.253.85)
08:53:26 frozenErebus joins (~frozenEre@94.128.219.166)
08:54:02 × heatsink quits (~heatsink@2600:1700:bef1:5e10:897b:89fa:77f1:998c) (Ping timeout: 264 seconds)
08:55:28 × desophos quits (~desophos@2601:249:1680:a570:dc9b:7a29:1314:79e3) (Read error: Connection reset by peer)
08:56:17 carldd11 joins (~carldd@90-224-49-113-no56.tbcn.telia.com)
08:56:21 × Narinas quits (~Narinas@189.223.59.23.dsl.dyn.telnor.net) (Read error: Connection reset by peer)
08:56:35 Narinas joins (~Narinas@189.223.59.23.dsl.dyn.telnor.net)
08:57:11 hekkaidekapus{ joins (~tchouri@gateway/tor-sasl/hekkaidekapus)
08:57:19 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
08:57:20 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
08:57:32 × sheepfleece quits (~sheep@46.53.253.85) (Remote host closed the connection)
08:58:38 sheepfleece joins (~sheep@46.53.253.85)
08:59:25 × hekkaidekapus_ quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 268 seconds)
08:59:56 × Narinas quits (~Narinas@189.223.59.23.dsl.dyn.telnor.net) (Read error: Connection reset by peer)
09:00:04 × howdoi quits (uid224@gateway/web/irccloud.com/x-ijfgnxevsuazdmff) (Quit: Connection closed for inactivity)
09:00:12 × cnmne[m] quits (cnmnematri@gateway/shell/matrix.org/x-vwjvxvmnxyimiajk) (Quit: Idle for 30+ days)
09:00:21 × otulp quits (~otulp@ti0187q162-6639.bb.online.no) (Quit: *POOF*)
09:01:13 Narinas joins (~Narinas@189.223.59.23.dsl.dyn.telnor.net)
09:06:04 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
09:08:33 polyrain joins (~polyrain@124.177.21.171)
09:10:17 hendursa1 joins (~weechat@gateway/tor-sasl/hendursaga)
09:10:33 meff[m]1 joins (meffsunado@gateway/shell/matrix.org/x-xlarclvljsmhctte)
09:10:52 × hendursa1 quits (~weechat@gateway/tor-sasl/hendursaga) (Remote host closed the connection)
09:11:08 × hendursaga quits (~weechat@gateway/tor-sasl/hendursaga) (Ping timeout: 268 seconds)
09:11:20 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 265 seconds)
09:13:09 geowiesnot joins (~user@87-89-181-157.abo.bbox.fr)
09:13:53 hendursa1 joins (~weechat@gateway/tor-sasl/hendursaga)
09:13:57 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
09:15:10 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
09:20:00 × sheepfleece quits (~sheep@46.53.253.85) (Remote host closed the connection)
09:20:27 × lemmih quits (~lemmih@2406:3003:2072:44:863c:2213:5a0d:4443) (Remote host closed the connection)
09:21:20 kam1 joins (~kam1@83.123.186.200)
09:23:24 sheepfleece joins (~sheep@46.53.253.85)
09:24:12 × kam1 quits (~kam1@83.123.186.200) (Read error: Connection reset by peer)
09:24:25 kam1 joins (~kam1@5.126.205.103)
09:24:28 × Narinas quits (~Narinas@189.223.59.23.dsl.dyn.telnor.net) (Read error: Connection reset by peer)
09:25:11 <Squarism> Damnit, all cheap trains are gone. You guys made of money?
09:25:19 Narinas joins (~Narinas@189.223.59.23.dsl.dyn.telnor.net)
09:28:05 mastarija joins (~mastarija@93-136-104-186.adsl.net.t-com.hr)
09:29:14 <Rembane> Squarism: Are you buying a train?
09:29:29 <Uniaika> these are expensive, to be sure
09:29:37 <Squarism> ops, sorry wrong channel
09:29:50 <Rembane> Squarism: I still want to know what you are going to do with a train. :)
09:30:03 <Squarism> Rembane, familiar with 18xx?
09:30:21 <Rembane> Squarism: Vaguely, is it a board game?
09:30:25 <Squarism> yeah
09:30:28 × kam1 quits (~kam1@5.126.205.103) (Read error: Connection reset by peer)
09:30:34 coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl)
09:30:38 <[exa]> can we pls have haskell for urban transit?
09:30:41 × coot quits (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) (Remote host closed the connection)
09:30:57 coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl)
09:31:03 <Rembane> [exa]: Then I would arrive just when I'm needed all the time!
09:31:07 <Rembane> Squarism: Sweet!
09:31:09 kam1 joins (~kam1@5.126.205.103)
09:31:12 <[exa]> :D
09:32:24 <[exa]> can't wait for all the new bad analogies; applicatives are wagons
09:32:48 <Rembane> Railway programming here we go!
09:34:50 ski . o O ( "CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A." by Henry G. Baker in 1994-02-04 at <https://web.archive.org/web/20190202232914/http://home.pipeline.com/~hbaker1/CheneyMTA.html> )
09:35:06 × Narinas quits (~Narinas@189.223.59.23.dsl.dyn.telnor.net) (Read error: Connection reset by peer)
09:35:22 gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh)
09:35:26 Narinas joins (~Narinas@189.223.59.23.dsl.dyn.telnor.net)
09:37:15 <[exa]> ski: wow cool. :]
09:37:38 Lowl3v3l joins (~Lowl3v3l@dslb-002-203-233-121.002.203.pools.vodafone-ip.de)
09:38:10 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
09:42:05 × kam1 quits (~kam1@5.126.205.103) (Ping timeout: 240 seconds)
09:42:23 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
09:43:50 fendor joins (~fendor@91.141.3.212.wireless.dyn.drei.com)
09:47:51 × geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 246 seconds)
09:50:07 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
09:54:57 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Ping timeout: 260 seconds)
09:56:38 tby joins (~tby@193.234.28.91)
09:58:26 × [tby] quits (~tby@193.234.28.91) (Ping timeout: 240 seconds)
10:02:41 × guest218 quits (~user@49.5.6.87) (Quit: ERC (IRC client for Emacs 27.1))
10:03:52 kam1 joins (~kam1@83.123.186.200)
10:06:01 pera joins (~pera@unaffiliated/pera)
10:06:26 da39a3ee5e6b4b0d joins (~da39a3ee5@2403:6200:8876:b8ec:2ccc:b56e:5cb:43cd)
10:07:46 × Sgeo quits (~Sgeo@ool-18b98aa4.dyn.optonline.net) (Read error: Connection reset by peer)
10:10:20 × rayyyy quits (~nanoz@gateway/tor-sasl/nanoz) (Ping timeout: 268 seconds)
10:12:09 m0rphism1 joins (~m0rphism@HSI-KBW-085-216-104-059.hsi.kabelbw.de)
10:13:19 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 272 seconds)
10:13:49 saitamaplus joins (uid272474@gateway/web/irccloud.com/x-dfxujuraamaironk)
10:15:25 × wei2912 quits (~wei2912@unaffiliated/wei2912) (Remote host closed the connection)
10:15:45 × p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Quit: p-core)
10:16:07 p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515)
10:16:30 × datajerk quits (~datajerk@sense.net) (Ping timeout: 272 seconds)
10:19:01 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds)
10:20:30 mikoto-chan joins (~anass@213.177.155.250)
10:20:37 datajerk joins (~datajerk@sense.net)
10:21:53 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
10:25:46 × stree quits (~stree@68.36.8.116) (Ping timeout: 265 seconds)
10:26:42 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
10:29:21 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 264 seconds)
10:29:53 mananamenos joins (~mananamen@37.red-88-27-26.staticip.rima-tde.net)
10:30:57 × hnOsmium0001 quits (uid453710@gateway/web/irccloud.com/x-pylvhrkwkzdorvyp) (Quit: Connection closed for inactivity)
10:32:04 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
10:37:57 Saukk joins (~Saukk@83-148-239-3.dynamic.lounea.fi)
10:38:15 stree joins (~stree@68.36.8.116)
10:38:36 × mananamenos quits (~mananamen@37.red-88-27-26.staticip.rima-tde.net) (Ping timeout: 240 seconds)
10:39:13 frozenErebus joins (~frozenEre@94.128.219.166)
10:41:46 × deviantfero quits (~deviantfe@190.150.27.58) (Read error: Connection reset by peer)
10:43:10 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 265 seconds)
10:43:37 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
10:45:11 × st8less quits (~st8less@2603:a060:11fd:0:234b:a57f:e8a1:52cc) (Quit: WeeChat 2.9)
10:46:16 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 240 seconds)
10:48:25 × Philonous quits (~Philonous@unaffiliated/philonous) (Ping timeout: 268 seconds)
10:49:09 × kam1 quits (~kam1@83.123.186.200) (Ping timeout: 264 seconds)
10:50:51 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
10:52:33 rayyyy joins (~nanoz@gateway/tor-sasl/nanoz)
10:52:40 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
10:54:11 proteusguy joins (~proteusgu@cm-58-10-208-13.revip7.asianet.co.th)
10:55:08 Franciman joins (~francesco@host-82-49-79-189.retail.telecomitalia.it)
10:55:37 × Yumasi quits (~guillaume@2a01:e0a:5cb:4430:cd02:9531:2c88:7cb8) (Ping timeout: 260 seconds)
10:55:47 usr25 joins (~J@80.31.32.99)
10:55:50 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Ping timeout: 264 seconds)
10:57:30 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 246 seconds)
10:58:00 frozenErebus joins (~frozenEre@94.128.219.166)
11:00:19 sord937 joins (~sord937@gateway/tor-sasl/sord937)
11:03:06 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 246 seconds)
11:08:28 × coot quits (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
11:08:56 coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl)
11:11:52 × sord937 quits (~sord937@gateway/tor-sasl/sord937) (Quit: sord937)
11:12:41 × sheepfleece quits (~sheep@46.53.253.85) (Quit: Lost terminal)
11:13:23 __monty__ joins (~toonn@unaffiliated/toonn)
11:14:07 × coot quits (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) (Ping timeout: 272 seconds)
11:14:48 Philonous joins (~Philonous@unaffiliated/philonous)
11:14:55 frozenErebus joins (~frozenEre@94.128.219.166)
11:19:33 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 246 seconds)
11:22:03 × p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Quit: p-core)
11:22:20 p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515)
11:24:45 son0p joins (~son0p@181.58.39.182)
11:27:09 mirrorbird joins (~psutcliff@2a00:801:44d:603d:d116:d5a1:4a2f:a08f)
11:27:15 × unlink2 quits (~unlink2@p200300ebcf241100fcf67590445edc70.dip0.t-ipconnect.de) (Remote host closed the connection)
11:27:44 sheepfleece joins (~sheep@46.53.253.85)
11:29:34 unlink2 joins (~unlink2@p200300ebcf241100fcf67590445edc70.dip0.t-ipconnect.de)
11:29:57 × Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
11:31:54 frozenErebus joins (~frozenEre@94.128.219.166)
11:32:00 Kaiepi joins (~Kaiepi@47.54.252.148)
11:33:30 Kaeipi joins (~Kaiepi@47.54.252.148)
11:33:45 × Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
11:34:08 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 256 seconds)
11:36:42 × Saukk quits (~Saukk@83-148-239-3.dynamic.lounea.fi) (Remote host closed the connection)
11:37:31 × olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Remote host closed the connection)
11:37:34 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 272 seconds)
11:39:27 × pera quits (~pera@unaffiliated/pera) (Ping timeout: 272 seconds)
11:39:27 Wuzzy joins (~Wuzzy@p5790eb2a.dip0.t-ipconnect.de)
11:43:32 ClaudiusMaximus joins (~claude@191.123.199.146.dyn.plus.net)
11:43:32 × ClaudiusMaximus quits (~claude@191.123.199.146.dyn.plus.net) (Changing host)
11:43:32 ClaudiusMaximus joins (~claude@unaffiliated/claudiusmaximus)
11:44:29 hexagenic joins (~mattias@2001:2002:51e0:74c9:5098:c4b6:1b73:7815)
11:47:10 <mikoto-chan> Is it possible to write wrappers for Javascript libraries in Haskell?
11:49:33 add^_ parts (~add@tutu.vovoid.net) ()
11:51:28 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
11:54:12 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
11:56:26 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Ping timeout: 264 seconds)
11:58:48 mouseghost joins (~draco@87-206-9-185.dynamic.chello.pl)
11:58:48 × mouseghost quits (~draco@87-206-9-185.dynamic.chello.pl) (Changing host)
11:58:48 mouseghost joins (~draco@wikipedia/desperek)
11:59:21 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds)
11:59:37 frozenErebus joins (~frozenEre@94.128.219.166)
12:02:27 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:02:42 × berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 260 seconds)
12:03:31 berberman joins (~berberman@unaffiliated/berberman)
12:04:20 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
12:08:05 <[exa]> mikoto-chan: the answer is "yes", but the question is so generic that I'm likely answering a different interpretation.
12:08:22 <[exa]> mikoto-chan: what precisely you want to do?
12:08:51 Pickchea joins (~private@unaffiliated/pickchea)
12:09:27 × miklcct quits (quasselcor@2001:19f0:7001:5ad:5400:2ff:feb6:50d7) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
12:09:41 miklcct joins (quasselcor@2001:19f0:7001:5ad:5400:2ff:feb6:50d7)
12:10:04 × Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
12:10:18 Kaeipi joins (~Kaiepi@47.54.252.148)
12:13:02 <mikoto-chan> [exa]: I want to write a Matrix client but there is no library for Haskell
12:15:02 <merijn> The solution would be to make one, then? :p
12:15:33 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 264 seconds)
12:18:35 × mikoto-chan quits (~anass@213.177.155.250) (Quit: mikoto-chan)
12:19:40 × forell quits (~forell@unaffiliated/forell) (Quit: ZNC - https://znc.in)
12:20:45 frozenErebus joins (~frozenEre@94.128.219.166)
12:21:01 forell joins (~forell@unaffiliated/forell)
12:21:36 mikoto-chan joins (~anass@213.177.155.250)
12:23:13 × berberman quits (~berberman@unaffiliated/berberman) (Read error: Connection timed out)
12:23:38 berberman joins (~berberman@unaffiliated/berberman)
12:24:10 × mikoto-chan quits (~anass@213.177.155.250) (Client Quit)
12:24:35 mikoto-chan joins (~anass@213.177.155.250)
12:24:59 <__monty__> mikoto-chan: If it's a separate process you can talk to it should be fine. If it's just a library then C FFI is probably the easiest way/least cumbersome.
12:26:21 × Pickchea quits (~private@unaffiliated/pickchea) (Ping timeout: 264 seconds)
12:27:24 × nut quits (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 256 seconds)
12:27:58 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
12:28:39 × mikoto-chan quits (~anass@213.177.155.250) (Client Quit)
12:33:19 geekosaur joins (ac3a537e@172.58.83.126)
12:34:29 Pickchea joins (~private@unaffiliated/pickchea)
12:35:49 pera joins (~pera@unaffiliated/pera)
12:40:05 mputz joins (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de)
12:42:46 <maerwald> I'd pick the language with the best libraries
12:43:29 nut joins (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
12:46:10 × rdivyanshu quits (uid322626@gateway/web/irccloud.com/x-dlrzsvchbzzkhuyx) (Quit: Connection closed for inactivity)
12:46:40 × stree quits (~stree@68.36.8.116) (Ping timeout: 256 seconds)
12:47:06 <merijn> maerwald: So...none of them? ;)
12:47:41 <maerwald> python
12:48:07 <maerwald> https://matrix.org/sdks/
12:48:50 <maerwald> the rust one also seems active
12:49:01 × danvet quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 272 seconds)
12:50:46 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 265 seconds)
12:52:31 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
12:53:03 × mputz quits (~Thunderbi@dslb-088-064-063-125.088.064.pools.vodafone-ip.de) (Quit: mputz)
12:53:08 × sheepfleece quits (~sheep@46.53.253.85) (Quit: Lost terminal)
12:56:38 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
12:57:03 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Ping timeout: 258 seconds)
12:58:56 stree joins (~stree@68.36.8.116)
12:59:55 × rayyyy quits (~nanoz@gateway/tor-sasl/nanoz) (Ping timeout: 268 seconds)
13:01:16 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
13:01:28 drbean joins (~drbean@TC210-63-209-205.static.apol.com.tw)
13:04:47 × nut quits (~user@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 265 seconds)
13:05:56 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 256 seconds)
13:06:01 × hexagenic quits (~mattias@2001:2002:51e0:74c9:5098:c4b6:1b73:7815) (Quit: WeeChat 1.9.1)
13:06:22 elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de)
13:06:26 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
13:07:01 × Rudd0 quits (~Rudd0@185.189.115.108) (Remote host closed the connection)
13:07:27 × son0p quits (~son0p@181.58.39.182) (Quit: leaving)
13:13:32 shad0w_ joins (a0ca24f4@160.202.36.244)
13:13:50 sheepfleece joins (~sheep@46.53.253.85)
13:14:09 clog joins (~nef@bespin.org)
13:14:14 <shad0w_> Hi all. how do i traverse and update a Map, and then return the updated Map as the final result ?
13:15:01 <shad0w_> i have a string, that i now traverse. parse it to see if it's a key in a map and if it is in there, update the key, if it is not, LEFT x.
13:15:34 <shad0w_> traverse however accumulates the MAP updates and returns [Maps]
13:15:48 <shad0w_> is there a way to do this without using the state monad ?
13:15:50 son0p joins (~son0p@181.136.122.143)
13:15:55 × sheepfleece quits (~sheep@46.53.253.85) (Client Quit)
13:16:02 Sheilong joins (uid293653@gateway/web/irccloud.com/x-mhgdpyndfuhwydwb)
13:16:15 sheepfleece joins (~sheep@46.53.253.85)
13:16:15 × raym quits (~ray@45.64.220.142) (Quit: leaving)
13:16:21 × da39a3ee5e6b4b0d quits (~da39a3ee5@2403:6200:8876:b8ec:2ccc:b56e:5cb:43cd) (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:16:36 <merijn> Sounds like fold?
13:16:38 × sheepfleece quits (~sheep@46.53.253.85) (Client Quit)
13:16:44 <merijn> :t foldr
13:16:45 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
13:16:48 polyphem joins (~p0lyph3m@2a02:810d:640:776c:76d7:55f6:f85b:c889)
13:16:53 × mirrorbird quits (~psutcliff@2a00:801:44d:603d:d116:d5a1:4a2f:a08f) (Ping timeout: 272 seconds)
13:16:57 sheepfleece joins (~sheep@46.53.253.85)
13:16:59 × sheepfleece quits (~sheep@46.53.253.85) (Client Quit)
13:17:10 <shad0w_> is there a fold with effects ?
13:17:20 <merijn> What effect would you need?
13:17:28 <shad0w_> reading
13:17:30 <merijn> You just wanted to update a Map, no?
13:18:10 <merijn> :t foldr `asAppliedTo` (undefined :: Char -> Map Char Int -> Map Char Int) -- or something like that
13:18:11 <lambdabot> error:
13:18:11 <lambdabot> Not in scope: type constructor or class ‘Map’
13:18:11 <lambdabot> Perhaps you meant ‘M.Map’ (imported from Data.Map)
13:18:16 <merijn> aww
13:18:27 <merijn> :t foldr `asAppliedTo` (undefined :: Char -> M.Map Char Int -> M.Map Char Int) -- or something like that
13:18:28 <lambdabot> Foldable t => (Char -> M.Map Char Int -> M.Map Char Int) -> M.Map Char Int -> t Char -> M.Map Char Int
13:18:35 <shad0w_> i have a type that has values A, C, G, T
13:18:58 <shad0w_> and i need to traverse the string. see if the char i have is a valid A or C or G or T
13:19:07 <shad0w_> if it is, update the MAP
13:19:23 <shad0w_> i've been told, this can be done in one pass.
13:19:37 jmo` joins (~user@h-162-127.A785.priv.bahnhof.se)
13:19:38 <shad0w_> can it ?
13:19:45 <tomsmeding> sure, with a fold
13:19:55 mirrorbird joins (~psutcliff@2a00:801:44d:603d:d116:d5a1:4a2f:a08f)
13:19:56 <tomsmeding> what merijn said :)
13:20:09 <tomsmeding> whwat's the type of your map?
13:20:21 <shad0w_> Map Nucleotide Int
13:20:30 <tomsmeding> oh counting how many occur?
13:20:42 <shad0w_> where Nucleotide type has values A, C, G or T
13:21:01 <shad0w_> input is a string, where values can be any char.
13:21:03 <tomsmeding> multiple ways to do this (merijn hop hop with your monoids), but a fold could work just fine
13:21:26 <shad0w_> i can see i need to `read` it first
13:22:10 <shad0w_> and the map `fromList [(A, 0), (C, 0), (G, 0), (T,0)]`
13:22:22 <tomsmeding> foldl' (\m c -> case readMaybe [c] of Just n -> Map.insertWith (+) n 1 m ; Nothing -> m) Map.empty yourString
13:22:36 <tomsmeding> where foldl' is from Data.List and readMaybe is from Text.Read
13:22:46 <tomsmeding> assuming your Nucleotide has the right Read instance
13:22:53 jamm_ joins (~jamm@unaffiliated/jamm)
13:23:06 <shad0w_> it's derived. so should be ?
13:23:14 <merijn> tomsmeding: That silently drops wrong values, though
13:23:19 <merijn> Not sure if that's the goal
13:23:23 <shad0w_> no
13:23:23 <tomsmeding> which is what shad0w_ needed, right?
13:23:34 <tomsmeding> oh
13:23:39 <shad0w_> if it's an invalid value. LEFT value
13:23:39 <merijn> tomsmeding: I think they want early bail out
13:23:46 <shad0w_> else. RIGHT updatedMap
13:23:52 <merijn> Which is only marginally more complex
13:23:54 <tomsmeding> oh I see
13:24:00 <merijn> But you probably want foldr in the case
13:24:05 <shad0w_> yea. sorry. if i didn't communicate that clearly
13:24:34 <shad0w_> `nucleotideCounts :: String -> Either String (Map Nucleotide Int)`
13:24:42 <shad0w_> is the typeSig of the fn
13:24:58 <tomsmeding> :t foldl' (\e c -> e >>= \m -> case readMaybe [c] of Just n -> Right (Map.insertWith (+) n 1 m) ; Nothing -> Left ("Invalid nucleotide: " ++ [c])) (Right Map.empty) yourString
13:24:59 <lambdabot> error:
13:24:59 <lambdabot> Not in scope: ‘Map.insertWith’
13:24:59 <lambdabot> Perhaps you meant one of these:
13:25:14 <tomsmeding> :t \yourString -> foldl' (\e c -> e >>= \m -> case readMaybe [c] of Just n -> Right (M.insertWith (+) n 1 m) ; Nothing -> Left ("Invalid nucleotide: " ++ [c])) (Right M.empty) yourString
13:25:16 <lambdabot> error:
13:25:16 <lambdabot> Variable not in scope: readMaybe :: [Char] -> Maybe k
13:25:24 <tomsmeding> % import Text.Read
13:25:25 <yahb> tomsmeding:
13:25:30 <tomsmeding> % :t \yourString -> foldl' (\e c -> e >>= \m -> case readMaybe [c] of Just n -> Right (M.insertWith (+) n 1 m) ; Nothing -> Left ("Invalid nucleotide: " ++ [c])) (Right M.empty) yourString
13:25:30 <yahb> tomsmeding: (Foldable t, Read k, Ord k, Num a) => t Char -> Either [Char] (M.Map k a)
13:25:40 <tomsmeding> that, perhaps
13:26:04 <tomsmeding> merijn: why would foldr be better?
13:26:26 <shad0w_> is there a monadic fold ?
13:26:42 <tomsmeding> fair point lol
13:26:42 <tomsmeding> e
13:27:22 <tomsmeding> :') okay that's a joke plugin I wrote once, referencing the old intel logo https://i.pinimg.com/originals/f2/b1/d4/f2b1d423df70bb135fe9df1bac0df8db.png
13:28:06 <merijn> tomsmeding: Early bailout
13:28:20 <merijn> tomsmeding: With foldl' you'd have to walk the entire sequence after an error
13:28:21 × tby quits (~tby@193.234.28.91) (Changing host)
13:28:21 tby joins (~tby@unaffiliated/tby)
13:28:33 <merijn> tomsmeding: foldr can just stop on the first error
13:28:38 <tomsmeding> very good point
13:28:52 <tomsmeding> % :t \yourString -> foldM (\m c -> case readMaybe [c] of Just n -> Right (M.insertWith (+) n 1 m) ; Nothing -> Left ("Invalid nucleotide: " ++ [c])) M.empty yourString
13:28:52 <yahb> tomsmeding: (Foldable t, Read k, Ord k, Num a) => t Char -> Either [Char] (M.Map k a)
13:29:00 <tomsmeding> that uses foldM, but is still a left fold
13:29:03 <merijn> Which might be a problem if you have a few GB of DNA or something ;)
13:29:27 <merijn> tomsmeding: I think the monad will short-circuit that fold anyway
13:29:43 <merijn> tomsmeding: Easily tested via infinite sequence with an error at the beginning ;)
13:30:13 <merijn> Also, probably wanna use Data.Map.Strict for that
13:30:48 × usr25 quits (~J@80.31.32.99) (Ping timeout: 246 seconds)
13:30:53 <tomsmeding> ah yes the foldM short-circuits
13:31:17 <tomsmeding> assuming that you write it properly, as follows:
13:31:24 <tomsmeding> % :t \yourString -> foldM (\m c -> case readMaybe [c] of Just n -> Right (M.insertWith (+) n 1 m) ; Nothing -> Left ("Invalid nucleotide: " ++ [c])) M.empty yourString
13:31:25 <yahb> tomsmeding: (Foldable t, Read k, Ord k, Num a) => t Char -> Either [Char] (M.Map k a)
13:31:35 <tomsmeding> crap no not that one
13:32:07 rayyyy joins (~nanoz@gateway/tor-sasl/nanoz)
13:32:50 <tomsmeding> no it is the right one, my brain doesn't work for some reason
13:33:01 <tomsmeding> that last version uses a monadic fold shad0w_ and nicely short-circuits
13:33:24 mananamenos joins (~mananamen@37.red-88-27-26.staticip.rima-tde.net)
13:33:50 × vgtw quits (~vgtw@gateway/tor-sasl/vgtw) (Ping timeout: 268 seconds)
13:34:26 vgtw joins (~vgtw@gateway/tor-sasl/vgtw)
13:35:14 × mrchampion quits (~mrchampio@38.18.109.23) (Ping timeout: 265 seconds)
13:36:06 × mananamenos quits (~mananamen@37.red-88-27-26.staticip.rima-tde.net) (Remote host closed the connection)
13:38:44 mrchampion joins (~mrchampio@38.18.109.23)
13:38:59 BlackCap1oder joins (~blackcap@46.46.197.67)
13:39:21 BlackCap1oder parts (~blackcap@46.46.197.67) ()
13:42:57 otulp joins (~otulp@ti0187q162-6639.bb.online.no)
13:44:13 × xelxebar quits (~xelxebar@gateway/tor-sasl/xelxebar) (Remote host closed the connection)
13:44:31 xelxebar joins (~xelxebar@gateway/tor-sasl/xelxebar)
13:48:39 <shad0w_> tomsmeding: yea, thanks for the clues. i ended up on a thing that seems like a derivative of what you just showed me
13:49:29 <shad0w_> my question is, how does it know that a Left value needs to be returned as is?
13:50:04 <shad0w_> i can see the analog to a Nothing vs Just something
13:50:05 × ukari quits (~ukari@unaffiliated/ukari) (Remote host closed the connection)
13:50:06 <tomsmeding> instead of processing the rest of the string, you mean?
13:50:10 Tario joins (~Tario@201.192.165.173)
13:50:11 <shad0w_> yes
13:50:19 <shad0w_> like. where is this logic defined ?
13:50:28 × otulp quits (~otulp@ti0187q162-6639.bb.online.no) (Quit: *POOF*)
13:50:36 <shad0w_> Instance Monad Either ?
13:50:37 ukari joins (~ukari@unaffiliated/ukari)
13:50:40 <tomsmeding> yeah
13:50:50 <tomsmeding> https://hackage.haskell.org/package/base-4.14.0.0/docs/src/Data.Either.html#line-155
13:50:50 Deide joins (~Deide@217.155.19.23)
13:50:57 <tomsmeding> note the case for Left
13:51:11 × drbean quits (~drbean@TC210-63-209-205.static.apol.com.tw) (Ping timeout: 265 seconds)
13:51:59 ArConan joins (0d4c7021@13.76.112.33)
13:52:59 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
13:53:06 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 272 seconds)
13:55:12 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Remote host closed the connection)
13:58:14 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Ping timeout: 264 seconds)
13:58:38 × polyrain quits (~polyrain@124.177.21.171) (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:59:33 jollygood2 joins (~bc8134e3@217.29.117.252)
13:59:55 <jollygood2> hi. wasn't there a maybe equivalent for lists?
13:59:57 <jollygood2> :t maybe
13:59:58 <lambdabot> b -> (a -> b) -> Maybe a -> b
13:59:58 <shad0w_> thanks guys merijn: tomsmeding:
14:00:59 <jollygood2> @hoogle b -> ([a] -> b) -> [a] -> b
14:01:00 <lambdabot> Language.Fixpoint.Misc applyNonNull :: b -> ([a] -> b) -> [a] -> b
14:01:00 <lambdabot> Debian.Debianize.Prelude foldEmpty :: r -> ([a] -> r) -> [a] -> r
14:01:00 <lambdabot> Data.Foldable.Safe defaulting :: Foldable f => b -> (f a -> b) -> f a -> b
14:01:04 <mastarija> Has anyone worked with hsc2hs before? I'm trying to create bindings for my little C helper library. I did this once long time ago, but now I can't remember how to do it anymore.
14:01:34 <mastarija> Here's my source : https://github.com/mastarija/screenshot
14:01:53 <mastarija> Basically, hsc2hs is throwing a bunch of errors but they don't make any sense
14:02:01 × shad0w_ quits (a0ca24f4@160.202.36.244) (Quit: Connection closed)
14:02:49 <mastarija> Here is the compilation output: https://pastebin.com/XP97jEGf
14:04:05 <merijn> mastarija: tbh, if your C library isn't too big I would recommend not bothering with hsc2hs
14:04:30 <merijn> mastarija: Do you need to modify C structs from within Haskell?
14:04:31 <mastarija> merijn, it isn't, but I had some trouble calculating offsets / paddings and what not
14:04:49 × hongminhee quits (~dahlia@207.148.91.209) (Ping timeout: 256 seconds)
14:04:53 <mastarija> merijn, I just need to read them in and copy data to more haskelly data structures
14:05:44 <merijn> mastarija: Looks like your C code is using a Screen type that's not in scope/included in your hsc
14:06:07 <mastarija> I thought so too, but it's declared in WinShot.c
14:06:11 <mastarija> which is included
14:06:20 <merijn> mastarija: tbh, my main recommendation would be to simply "not do that" if at all possible, but I understand that it might not always be :p
14:06:41 <merijn> (not do that, is reading struct values in Haskell, rather just writing C accessors and calling those)
14:06:43 <mastarija> I'm not sure if I'm maybe including C files incorrectly in my cabal
14:07:19 <merijn> oh
14:07:30 <mastarija> merijn, not sure what you mean, my plan is to create a ScreenShot struct from C and martial it to Haskell for further inspection
14:07:59 <merijn> include-dirs "cs" and "css/WinShot.h" looks questionable, let me check what I do in my code
14:08:40 <merijn> mastarija: What I meant is that if you have a C function "int getScreenX(struct Screen *ptr);" that you can call, then you never need to marshall the struct on the Haskell side
14:09:00 <merijn> Are you using v2-build?
14:09:09 <mastarija> yep
14:09:33 × Pickchea quits (~private@unaffiliated/pickchea) (Ping timeout: 265 seconds)
14:09:49 <mastarija> merijn, I'm using cabal 3 without prefixed commands
14:10:01 <merijn> mastarija: Ok, so couple of things in your cabal file:
14:10:14 <merijn> include file shouldn't include the directory/path if you use include-dirs
14:10:16 carlomagno joins (~cararell@148.87.23.12)
14:10:31 <merijn> Cabal will *already* point to that directory, so you end up looking for css/css/WinShot.h
14:10:38 × Feuermagier quits (~Feuermagi@2a02:2488:4211:3400:246e:bf09:8453:9d6) (Remote host closed the connection)
14:10:47 nbloomf joins (~nbloomf@2600:1700:ad14:3020:887c:d5ad:2339:cbda)
14:11:35 pfurla_ joins (~pfurla@ool-182ed2e2.dyn.optonline.net)
14:12:08 <mastarija> merijn, hmm.. I've tried it now (and before as well) but it changes nothing :(
14:12:11 <merijn> I seem to have C and header files as extra-source-files, but I'm not 100% that's needed
14:12:19 <mastarija> Gonna check
14:13:22 × carlomagno1 quits (~cararell@148.87.23.5) (Ping timeout: 256 seconds)
14:13:25 <mastarija> merijn, doesn't seem to have helped
14:13:36 × pfurla quits (~pfurla@ool-182ed2e2.dyn.optonline.net) (Ping timeout: 240 seconds)
14:13:46 <mastarija> I think extras are just there to check for a file presence
14:14:09 <merijn> They control what gets include in the tarball build by sdist
14:14:43 <mastarija> merijn, can I take a peek at your cabal?
14:16:28 <merijn> mastarija: eh, it's rather big and full of unrelated things, though :p https://github.com/merijn/Belewitte/blob/master/benchmark-analysis/benchmark-analysis.cabal
14:17:06 <mastarija> merijn, maybe I learn something new :D
14:17:58 urodna joins (~urodna@unaffiliated/urodna)
14:18:02 <merijn> I'm trying to figure out if your mistake isn't simply having "Screen" in your hsc file, instead of "struct Screen"
14:18:17 <merijn> But I can't really find a good intro to hsc syntax
14:18:36 <merijn> I mean, the compiler error certainly seems to imply a missing "struct"
14:19:43 <merijn> mastarija: I have some similar code for terminal windows and I just went the lazy route, tbh: https://github.com/merijn/posix-pty/blob/master/cbits/pty_size.c
14:20:17 <merijn> mastarija: And then wrapping manually on the haskell side: https://github.com/merijn/posix-pty/blob/master/System/Posix/Pty.hs#L189-L192
14:20:34 <merijn> Which just by-passes the entire hsc problem :p
14:21:16 <merijn> And that way I don't have to deal with awkwardly documented tools :p
14:21:24 <mastarija> XD
14:21:31 kam1 joins (~kam1@83.123.186.200)
14:21:48 <merijn> Anyway, try what happens if you struct "struct Screen" in .hsc instead of "Screen"
14:22:29 <merijn> Alteratively, add "typedef struct Screen Screen;" to your header
14:23:24 <mastarija> OOOOHHH!!!
14:23:28 <mastarija> merijn, struct
14:23:30 <mastarija> that's right
14:23:33 <mastarija> forgot about that
14:24:21 × jmo` quits (~user@h-162-127.A785.priv.bahnhof.se) (Ping timeout: 246 seconds)
14:24:21 × hendursa1 quits (~weechat@gateway/tor-sasl/hendursaga) (Quit: hendursa1)
14:24:26 <mastarija> merijn, holly shi*, it compiles XD
14:24:27 danvet joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa)
14:24:27 × ubert quits (~Thunderbi@p200300ecdf25d94be6b318fffe838f33.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
14:24:32 <mastarija> I'm an idiot
14:24:40 hendursaga joins (~weechat@gateway/tor-sasl/hendursaga)
14:25:57 <merijn> And my title of debugging god remains in tact!
14:26:18 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:887c:d5ad:2339:cbda) (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:26:21 <mastarija> it sure does XD
14:27:35 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
14:30:19 × kam1 quits (~kam1@83.123.186.200) (Ping timeout: 256 seconds)
14:32:16 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Ping timeout: 265 seconds)
14:34:24 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
14:34:36 × pera quits (~pera@unaffiliated/pera) (Ping timeout: 240 seconds)
14:34:53 × Wuzzy quits (~Wuzzy@p5790eb2a.dip0.t-ipconnect.de) (Ping timeout: 272 seconds)
14:36:07 × Natch quits (~natch@c-b471e255.014-297-73746f25.bbcust.telenor.se) (Remote host closed the connection)
14:37:34 alanz_ is now known as alanz
14:41:29 Natch joins (~Natch@c-b471e255.014-297-73746f25.bbcust.telenor.se)
14:43:19 ph88_ joins (~ph88@2a02:8109:9e00:7e5c:f5fc:c65e:8298:c839)
14:47:05 × son0p quits (~son0p@181.136.122.143) (Ping timeout: 240 seconds)
14:47:27 × ph88^ quits (~ph88@2a02:8109:9e00:7e5c:1d07:66bc:d1dc:63b4) (Ping timeout: 272 seconds)
14:48:02 × dh_ quits (dh@bsd.ee) (Quit: "Fhtagn-Nagh Yog Sothoth")
14:48:15 dh joins (dh@bsd.ee)
14:49:32 timCF joins (~i.tkachuk@m91-129-99-43.cust.tele2.ee)
14:51:05 minoru_shiraeesh joins (~shiraeesh@5.101.59.18)
14:52:24 Pickchea joins (~private@unaffiliated/pickchea)
14:54:17 vicfred joins (~vicfred@unaffiliated/vicfred)
14:54:36 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Remote host closed the connection)
14:54:40 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
14:54:48 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
14:57:24 × minoru_shiraeesh quits (~shiraeesh@5.101.59.18) (Ping timeout: 265 seconds)
14:58:15 <timCF> Hello! Can anybody recommend good educational resources about implementing simple compiler in haskell? Without too complex examples, just for educational purposes. I'm thinking about writing small haskell DSL with will contain small amount of composable combinators representing typed shell expressions, which can compile to shell text files.
14:59:05 × elliott_ quits (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
14:59:18 × geekosaur quits (ac3a537e@172.58.83.126) (Quit: Connection closed)
14:59:20 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 265 seconds)
14:59:27 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Ping timeout: 260 seconds)
15:00:00 <merijn> timCF: Two books come to mind
15:00:12 <merijn> timCF: Types and Programming Languages by Benjamin Pierce
15:00:15 <merijn> @where tapl
15:00:15 <lambdabot> "Types and Programming Languages" by Benjamin C. Pierce in 2002-02-01 at <https://www.cis.upenn.edu/~bcpierce/tapl/>
15:00:46 <merijn> timCF: Which covers basically anything from "here is a simple untyped lambda calculus" up to "more than you will ever need to know" when it comes to type systems
15:01:24 <merijn> The 2nd book is Andrew Appel's "Modern Compiler Implementation in X" which covers, well, modern compiler implementation
15:01:43 <merijn> You'll probably want to get the ML version of that book (rather than the C or Java versions)
15:01:54 <timCF> Thanks, merijn
15:02:14 elliott_ joins (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net)
15:02:17 <merijn> timCF: TaPL's examples are in Ocaml, but only fairly basic ocaml, anyone with even basic Haskell knowledge should be able to read things with very little effort
15:03:21 <merijn> Same (presumably, I haven't read it) goes for ML in Appel's book. Since ML is fairly similar to Haskell (or rather, Haskell is fairly similar to ML :p)
15:03:45 minoru_shiraeesh joins (~shiraeesh@5.101.59.18)
15:03:49 <merijn> Which is why I'd recommend the ML version over the C/Java version, it'll be closer to the sorta thing you'd do in Haskell
15:04:27 dunj3 joins (~dunj3@p200300f61714a6752268fca81a1a85c0.dip0.t-ipconnect.de)
15:06:42 × stree quits (~stree@68.36.8.116) (Ping timeout: 246 seconds)
15:07:19 <timCF> merijn: yeah, definitely! At least easier to read examples. I don't think my idea itself is very practical, but at least it seems very rewarding to implement couple of combinators and get valid workign shell file as compiler output. And I think haskell is expressive enough to let me write AST (in form of haskell ADTs inside some custom monad) instead of parsing source files. This way I can omit lexer and
15:07:25 <timCF> parser, write AST directly and focus on only fun parts
15:10:28 <merijn> timCF: Once you learn how to make a compiler, you soon realise that almost every problem is a compiler problem ;)
15:11:14 raym joins (~ray@45.64.220.142)
15:11:19 <merijn> timCF: tbh, writing a proper parser isn't *that* painful, it depends a bit on the grammar, but if you're inventing a language from scratch, just change your grammar to be easier :p
15:11:53 × Franciman quits (~francesco@host-82-49-79-189.retail.telecomitalia.it) (Quit: Leaving)
15:13:42 × hexfive quits (~hexfive@50.35.83.177) (Quit: i must go. my people need me.)
15:20:15 stree joins (~stree@68.36.8.116)
15:20:45 ep1ctetus joins (~epictetus@ip72-194-215-136.sb.sd.cox.net)
15:22:03 × minoru_shiraeesh quits (~shiraeesh@5.101.59.18) (Ping timeout: 265 seconds)
15:22:59 × DavidEichmann quits (~david@234.109.45.217.dyn.plus.net) (Remote host closed the connection)
15:24:08 × toorevitimirp quits (~tooreviti@117.182.181.253) (Remote host closed the connection)
15:24:20 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
15:26:05 nbloomf joins (~nbloomf@2600:1700:ad14:3020:887c:d5ad:2339:cbda)
15:26:20 <GreyFaceNoSpace> sorry for the noob question, but where can i find the implementation for the Data.Tree module?
15:26:29 <GreyFaceNoSpace> how can i view the code
15:26:34 <GreyFaceNoSpace> i am new to haskell
15:26:40 × Philonous quits (~Philonous@unaffiliated/philonous) (Quit: ZNC - http://znc.in)
15:27:04 × jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection)
15:27:19 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
15:28:01 <merijn> @hoogle Data.Tree
15:28:02 <lambdabot> Data.Graph data Tree a
15:28:02 <lambdabot> module Data.Tree
15:28:02 <lambdabot> Data.Tree data Tree a
15:28:05 oisdk joins (~oisdk@2001:bb6:3329:d100:e4fd:fcea:33f:6b51)
15:28:06 <merijn> eh..
15:28:13 <merijn> That wasn't useful :p
15:28:17 <merijn> @hackage containers
15:28:17 <lambdabot> https://hackage.haskell.org/package/containers
15:28:24 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Ping timeout: 246 seconds)
15:28:39 <merijn> GreyFaceNoSpace: It's in the containers package, the module documentation has a "source" link that takes you to the source code
15:28:56 <GreyFaceNoSpace> oooh
15:28:59 <GreyFaceNoSpace> ty so much
15:29:19 <merijn> Should also be a link to the repository on the package page
15:29:26 <tomsmeding> merijn: any idea why command-line hoogle, and apparently also @hoogle, doesn't show which _package_ a module is from?
15:29:40 <merijn> brevity?
15:29:51 <tomsmeding> you search for a name, signature, whatever, and find that it's in module A.B.C
15:29:52 <GreyFaceNoSpace> is there command for ghc that can show me the information of a function/data type?
15:29:57 <GreyFaceNoSpace> i only know of :t
15:30:02 <tomsmeding> okay fine, but that tells me nothing if I don't know what package it's in :p
15:30:04 × s00pcan quits (~chris@075-133-056-178.res.spectrum.com) (Remote host closed the connection)
15:30:07 <tomsmeding> GreyFaceNoSpace: :i
15:30:08 <merijn> GreyFaceNoSpace: In ghci you can use ":info" (or ":i")
15:30:15 <merijn> % :i []
15:30:16 <yahb> merijn: type [] :: * -> *; data [] a = [] | a : [a]; -- Defined in `GHC.Types'; instance Alternative [] -- Defined in `GHC.Base'; instance Applicative [] -- Defined in `GHC.Base'; instance Eq a => Eq [a] -- Defined in `GHC.Classes'; instance Functor [] -- Defined in `GHC.Base'; instance Monad [] -- Defined in `GHC.Base'; instance MonadPlus [] -- Defined in `GHC.Base'; instance Monoid [a] -- Defined in `GHC.Base
15:30:19 <GreyFaceNoSpace> alright thanks guys
15:30:45 <merijn> GreyFaceNoSpace: You can also create a local/commandline version of Hoogle
15:31:03 <merijn> Or GreyFaceNoSpace Or just use the web version: https://hoogle.haskell.org/
15:31:14 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
15:31:36 minoru_shiraeesh joins (~shiraeesh@5.101.59.18)
15:33:03 <GreyFaceNoSpace> thank u
15:33:23 <ArConan> sorry for the noob question,what mean of `hoogle`?
15:34:02 <ArConan> is it mean documation?
15:34:08 <ArConan> or only a name?
15:36:43 <merijn> ArConan: A reference to google :p
15:36:52 <merijn> but for haskell, hence the 'h'
15:37:08 <ArConan> ah
15:38:26 rdivyanshu joins (uid322626@gateway/web/irccloud.com/x-bjhpxmgmskwpfmhe)
15:38:52 <merijn> We used to have Hayoo (as reference to yahoo) too
15:39:09 <ArConan> haha
15:40:01 <merijn> Seems that's been down for over a year, though
15:41:12 <tomsmeding> someone needs to make ooyah
15:41:18 <xsperry> @hoogle (a -> b) -> [a] -> [b]
15:41:19 <lambdabot> Prelude map :: (a -> b) -> [a] -> [b]
15:41:19 <lambdabot> Data.List map :: (a -> b) -> [a] -> [b]
15:41:19 <lambdabot> GHC.Base map :: (a -> b) -> [a] -> [b]
15:41:22 acarrico joins (~acarrico@dhcp-68-142-39-249.greenmountainaccess.net)
15:41:51 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
15:43:46 machinedgod joins (~machinedg@135-23-192-217.cpe.pppoe.ca)
15:44:16 electricityZZZZ joins (~electrici@108-216-157-17.lightspeed.sntcca.sbcglobal.net)
15:45:15 × minoru_shiraeesh quits (~shiraeesh@5.101.59.18) (Ping timeout: 265 seconds)
15:46:26 × acidjnk_new quits (~acidjnk@p200300d0c7390972b9ca7ed3a5659a38.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
15:48:36 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
15:48:42 frozenErebus joins (~frozenEre@94.128.219.166)
15:50:13 × ArConan quits (0d4c7021@13.76.112.33) (Quit: Connection closed)
15:51:35 tromp_ joins (~tromp@dhcp-077-249-230-040.chello.nl)
15:53:05 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 240 seconds)
15:55:13 × danvet quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 272 seconds)
15:55:53 × mnrmnaugh quits (~mnrmnaugh@unaffiliated/mnrmnaugh) (Ping timeout: 265 seconds)
15:56:11 × danso quits (~dan@d67-193-121-2.home3.cgocable.net) (Read error: Connection reset by peer)
15:56:27 × tromp_ quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 256 seconds)
15:57:52 renzhi joins (~renzhi@modemcable070.17-177-173.mc.videotron.ca)
15:57:56 danso joins (~dan@2001:1970:52e7:d000:96b8:6dff:feb3:c009)
15:59:28 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:887c:d5ad:2339:cbda) (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:00:25 Rudd0 joins (~Rudd0@185.189.115.103)
16:00:47 × ericsagn1 quits (~ericsagne@2405:6580:0:5100:33f6:9077:f7e2:df6e) (Ping timeout: 246 seconds)
16:04:43 raichoo joins (~raichoo@dslb-178-001-021-051.178.001.pools.vodafone-ip.de)
16:04:45 × Pickchea quits (~private@unaffiliated/pickchea) (Ping timeout: 240 seconds)
16:05:10 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
16:05:56 enikar joins (~enikar@2001:41d0:2:8673::42)
16:09:10 mnrmnaugh joins (~mnrmnaugh@unaffiliated/mnrmnaugh)
16:10:09 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 264 seconds)
16:12:28 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
16:13:24 ericsagn1 joins (~ericsagne@2405:6580:0:5100:86fb:42bc:1428:8130)
16:14:51 × Raito_Bezarius quits (~Raito@unaffiliated/raito-bezarius/x-8764578) (Ping timeout: 272 seconds)
16:18:02 theelous3 joins (~theelous3@unaffiliated/theelous3)
16:21:16 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
16:21:27 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
16:22:03 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
16:22:27 × HarveyPwca quits (~HarveyPwc@c-98-220-98-201.hsd1.il.comcast.net) (Quit: Leaving)
16:25:50 × xff0x quits (~xff0x@2001:1a81:5288:8c00:e78d:bbe2:6a38:a9e6) (Ping timeout: 264 seconds)
16:25:50 pavonia^\_^\ joins (~user@unaffiliated/siracusa)
16:27:18 xff0x joins (xff0x@gateway/vpn/mullvad/xff0x)
16:28:04 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
16:29:21 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:29:33 idhugo joins (~idhugo@80-62-117-97-mobile.dk.customer.tdc.net)
16:32:36 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Remote host closed the connection)
16:32:57 Wuzzy joins (~Wuzzy@p5b0df3df.dip0.t-ipconnect.de)
16:33:54 × idhugo quits (~idhugo@80-62-117-97-mobile.dk.customer.tdc.net) (Ping timeout: 256 seconds)
16:34:22 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
16:35:02 minoru_shiraeesh joins (~shiraeesh@5.101.59.18)
16:35:13 raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
16:35:56 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
16:37:56 <GreyFaceNoSpace> sorry guys. another question. I have multiple type synonyms that are all Integers. Is there a way to define all of them at once? right now it looks like this:https://pastebin.com/d3HzEF5x
16:38:10 <GreyFaceNoSpace> is there some other way to write it?
16:38:23 <merijn> tbh, I recommend *not* doing that
16:38:31 <GreyFaceNoSpace> what would you recommend?
16:38:39 <GreyFaceNoSpace> i am still learning
16:38:48 StoneToad joins (~StoneToad@104-192-232-18.ppp.storm.ca)
16:38:50 <GreyFaceNoSpace> advice is greatly appreciated
16:39:21 <merijn> The problem is that you see types like "ExecutionTime -> DeadLine -> IO ()" or whatever, but then you don't know what any of them are, especially when some people have like 5 layers of type synonyms
16:39:23 <glguy> GreyFaceNoSpace, type synonyms aren't good as documentation. Haddock comments are where that kind of information would go. If you need to keep these different Integers distinct from each other and from Integer itself, then you'll need newtypes
16:39:44 <merijn> GreyFaceNoSpace: I recommend either just using Integer *or* using newtypes (if you want type safety)
16:40:04 ymherklotz joins (~user@2a00:23c7:e28c:6001:5460:47fb:6d9:8e42)
16:40:20 × raichoo quits (~raichoo@dslb-178-001-021-051.178.001.pools.vodafone-ip.de) (Quit: leaving)
16:40:34 <merijn> Personally I use type synonyms only rarely and when I do it's usually more to abbreviate really long types, rather than a "meaningful" name
16:40:43 <GreyFaceNoSpace> i see
16:40:57 × eyenx quits (~eyenxeyen@unaffiliated/eye/x-1653358) (Remote host closed the connection)
16:41:15 <GreyFaceNoSpace> my problem with newtype is the fact that i need to use a constructor. But you are right. it's more type safe
16:41:24 <dmj`> type Foo, Bar :: Int would be cool syntax sugar
16:42:05 <glguy> GreyFaceNoSpace, The benefit of newtype is that you need to use a constructor
16:42:19 <GreyFaceNoSpace> dmj`, oh thanks. i was looking for that syntactic sugar. But i guess newtype would be safer as others have suggested
16:42:23 <merijn> GreyFaceNoSpace: They problem with the type synonyms is that if you have "time :: ExecutionTime", "deadLine :: DeadLine" and "foo :: ExecutionTime -> DeadLine -> Foo" and you call it as "foo deadLine time" you get no error
16:42:25 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 240 seconds)
16:42:30 <glguy> That's where you express that you're changing from Integer to/from the other type
16:42:35 <merijn> Despite the argument being reversed
16:42:51 Philonous joins (~Philonous@unaffiliated/philonous)
16:43:02 <merijn> GreyFaceNoSpace: That sugar doesn't exist, dmj` was just saying it'd be cool if it did
16:43:13 <dmj`> ^
16:43:22 <GreyFaceNoSpace> i see
16:43:32 × ep1ctetus quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Ping timeout: 256 seconds)
16:43:43 <merijn> GreyFaceNoSpace: tbh, the bigger the codebase I work on gets, the more I think newtyping everything is *great*
16:43:49 <GreyFaceNoSpace> merijn, thank u for the thorough explanation. i understand what u guys mean now
16:43:57 raichoo joins (~raichoo@dslb-178-001-021-051.178.001.pools.vodafone-ip.de)
16:44:16 <GreyFaceNoSpace> merijn, yeah it makes sense
16:44:44 <GreyFaceNoSpace> merijn, i was trying to implement some scheduling algorithms as practice
16:44:51 <merijn> GreyFaceNoSpace: I end up having a bunch of stuff like: https://github.com/merijn/Belewitte/blob/master/benchmark-analysis/src/Types.hs#L45-L59 now
16:45:22 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
16:45:23 <merijn> GreyFaceNoSpace: At first it feels a bit boiler-platey, but once code gets back and you need to refactor you end up realising past you was a genius for newtyping everything!
16:45:33 <merijn> s/gets back/gets big/
16:45:40 <GreyFaceNoSpace> merijn, haha
16:46:05 <merijn> Just change a newtype somewhere and follow the type errors to fix things
16:46:30 <GreyFaceNoSpace> yes you convinced me. newtype is superior haha
16:47:36 Franciman joins (~francesco@host-82-49-79-189.retail.telecomitalia.it)
16:48:06 <StoneToad> note that wont' save you (that much) if you unwrap the type in the function args and then just have bare base types in the function body
16:48:54 conal joins (~conal@64.71.133.70)
16:49:57 [tby] joins (~tby@193.234.28.91)
16:49:57 <GreyFaceNoSpace> ok
16:50:03 <merijn> StoneToad: Well, the advantage is "who needs to know the structure of this type" I have lots of code between my commandline parsing and the logic using the "contents" of my newtypes and the newtypes mean that when I change them I only need to touch the commandline code and the place where they're used, with all intermediate code unchanged
16:50:51 × tby quits (~tby@unaffiliated/tby) (Ping timeout: 256 seconds)
16:52:10 <GreyFaceNoSpace> i'll start working on IO now. i am currently using the haskell wiki to understand things. is there a better resource?
16:52:46 <StoneToad> I like https://www.fpcomplete.com/haskell/
16:53:30 eyenx joins (~eyenxeyen@unaffiliated/eye/x-1653358)
16:53:46 <StoneToad> mostly because the library recommendations are solid, trying to figure out what's actually a well used library on hackage is hard
16:54:00 <GreyFaceNoSpace> thank u for the recommendation
16:54:08 <GreyFaceNoSpace> i'll check it out
16:55:44 <GreyFaceNoSpace> i had an fp course at uni. and it just taught the absolute basicas of functional programming. no monads, no concurrency, no vectors
16:56:00 <GreyFaceNoSpace> very basic IO functions
16:56:20 <StoneToad> merijn: indeed, I think actually the main issue in the "tagged is not a newtype" article I read was actually that they were doing unwrapping in the argument list instead of unwrapping in the code itself more then an actually difference between tagged and a 'real' newtype
16:56:51 <dmj`> StoneToad: whatever Bryan O'Sullivan is author of is pretty good, at least for industry haskell
16:56:59 <dmj`> GreyFaceNoSpace: ^
16:59:23 <StoneToad> ah yea, forgot about real world haskell
16:59:25 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
16:59:28 <dmj`> GreyFaceNoSpace: If you had IO in uni, you had monads ;)
17:04:02 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 265 seconds)
17:06:48 geekosaur joins (82650c7a@130.101.12.122)
17:08:16 × xff0x quits (xff0x@gateway/vpn/mullvad/xff0x) (Ping timeout: 240 seconds)
17:08:56 frozenErebus joins (~frozenEre@94.128.219.166)
17:09:30 <GreyFaceNoSpace> dmj`, honestly. it wasn't an fp course now that i think about it. it was mainly a verfication course. we would write haskell functions and prove their correctness
17:10:30 xff0x joins (~xff0x@2001:1a81:5288:8c00:e78d:bbe2:6a38:a9e6)
17:16:23 × ymherklotz quits (~user@2a00:23c7:e28c:6001:5460:47fb:6d9:8e42) (Remote host closed the connection)
17:16:34 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Remote host closed the connection)
17:17:09 ymherklotz joins (~user@2a00:23c7:e28c:6001:5460:47fb:6d9:8e42)
17:17:49 × Franciman quits (~francesco@host-82-49-79-189.retail.telecomitalia.it) (Quit: Leaving)
17:18:27 × johnw quits (~johnw@haskell/developer/johnw) (Remote host closed the connection)
17:22:07 × kfm quits (~weechat@static.173.83.99.88.clients.your-server.de) (Quit: ciao kakao)
17:24:02 kmein joins (~weechat@static.173.83.99.88.clients.your-server.de)
17:24:33 × mastarija quits (~mastarija@93-136-104-186.adsl.net.t-com.hr) (Ping timeout: 264 seconds)
17:26:44 × timCF quits (~i.tkachuk@m91-129-99-43.cust.tele2.ee) (Quit: leaving)
17:26:54 Pickchea joins (~private@unaffiliated/pickchea)
17:27:37 jamm_ joins (~jamm@unaffiliated/jamm)
17:27:50 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
17:27:56 × stree quits (~stree@68.36.8.116) (Ping timeout: 240 seconds)
17:28:16 × bitmapper quits (uid464869@gateway/web/irccloud.com/x-wcndcgrnyuvjynus) (Quit: Connection closed for inactivity)
17:29:24 nbloomf joins (~nbloomf@2600:1700:ad14:3020:c91e:36e2:8f54:8f55)
17:31:35 × jluttine quits (~jluttine@85-23-95-149.bb.dnainternet.fi) (Ping timeout: 265 seconds)
17:31:54 × jamm_ quits (~jamm@unaffiliated/jamm) (Ping timeout: 258 seconds)
17:32:44 danvet joins (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa)
17:33:54 hnOsmium0001 joins (uid453710@gateway/web/irccloud.com/x-tzqvxzijqucxtwmt)
17:35:46 crazazy joins (~crazazy@213-73-154-216.cable.dynamic.v4.ziggo.nl)
17:37:45 conal joins (~conal@64.71.133.70)
17:40:29 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
17:41:40 h2017 joins (~h2017@bras-base-clbaon0201w-grc-32-142-114-145-140.dsl.bell.ca)
17:41:42 <h2017> hi
17:41:47 stree joins (~stree@68.36.8.116)
17:41:56 × Kaeipi quits (~Kaiepi@47.54.252.148) (Ping timeout: 240 seconds)
17:43:17 Kaiepi joins (~Kaiepi@47.54.252.148)
17:43:29 <h2017> i have a situation where i can't decide between maybeT and exceptT (roughly). With maybeT i get to use mzero and msum on that layer, but i would have to collect error messages using a writer or writing to IO. what should i do?
17:44:25 mastarija joins (~mastarija@93-136-104-186.adsl.net.t-com.hr)
17:44:35 <h2017> i mean on fail i'll have to write out an error message before running mzero, which is OK but i don't get the advantage of being to catch error like you can with exceptT
17:45:13 <h2017> but monadplus is more logical than semi-group summing exceptT
17:45:27 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
17:45:44 <h2017> I can't see a right or a wrong
17:46:33 <monochrom> So ExceptT?
17:47:01 <h2017> ExceptT doesn't have monadPlus though
17:47:27 <monochrom> That's because it has Alternative.
17:47:32 davros_ joins (~davros@host86-184-190-159.range86-184.btcentralplus.com)
17:49:25 <h2017> how does that work. how is empty defined?
17:50:18 × davros quits (~davros@host86-184-190-159.range86-184.btcentralplus.com) (Ping timeout: 258 seconds)
17:50:30 <monochrom> That's for you to find out.
17:50:54 jluttine joins (~jluttine@85-23-95-149.bb.dnainternet.fi)
17:50:56 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Ping timeout: 240 seconds)
17:51:36 <monochrom> And it has MonadPlus too.
17:52:43 <h2017> ok i see it here. so the definition also requires that e be a monoid for this to work.
17:52:46 <h2017> i get it
17:52:53 rkk95 joins (41bf0bfc@065-191-011-252.inf.spectrum.com)
17:53:15 <rkk95> Has anyone setup VSCode with Haskell Language Server, I'm noticing the extensions actually not installing it
17:53:36 × rajivr quits (uid269651@gateway/web/irccloud.com/x-ybcsyjusnyktvefi) (Quit: Connection closed for inactivity)
17:53:48 <monochrom> See how 5 minutes of due dilegence can be saved by 30 minutes of struggling with a dilemma that doesn't really exist.
17:54:09 <h2017> monochrom, yes i'm guilty this time
17:54:33 × minoru_shiraeesh quits (~shiraeesh@5.101.59.18) (Ping timeout: 264 seconds)
17:54:39 <merijn> monochrom: Days of work can safe literal hours of thinking!
17:55:53 <monochrom> That one, I think more often it's the other way round.
17:56:58 <monochrom> Just look at the recent example of karasu1[m] who spend days over-philosophizing instead of hours over actual coding.
17:57:25 <monochrom> And average. That one is years of over-philosophizing.
17:59:06 <h2017> i am the kind of guy who likes to think about things rather than read the book
17:59:11 <h2017> sometimes that backfires
18:00:39 <h2017> i sm busy coding something up fwiw. i'm trying to deal with the errors in the most local way. now i see that excepT is the way to go, except that i'm combining it witha bunch of other monads into a bigger monad, and I'll implement MonadError
18:00:46 <h2017> logical way i meant
18:01:14 pera joins (~pera@unaffiliated/pera)
18:01:58 <h2017> thinking about things instead of reading has the advantage that when you do read about the solution to your problem, the learning is near-instant I find. it's like your brain was waiting for the answer by that time
18:02:41 × renzhi quits (~renzhi@modemcable070.17-177-173.mc.videotron.ca) (Quit: WeeChat 2.3)
18:03:34 crazazy parts (~crazazy@213-73-154-216.cable.dynamic.v4.ziggo.nl) ()
18:05:21 × Jesin quits (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) (Quit: Leaving)
18:06:57 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 246 seconds)
18:07:12 Jesin joins (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net)
18:07:31 × Jesin quits (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) (Remote host closed the connection)
18:08:21 × ClaudiusMaximus quits (~claude@unaffiliated/claudiusmaximus) (Quit: ->)
18:08:39 Jesin joins (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net)
18:09:36 × oisdk quits (~oisdk@2001:bb6:3329:d100:e4fd:fcea:33f:6b51) (Quit: oisdk)
18:11:05 × poscat quits (~poscat@123.116.67.131) (Ping timeout: 240 seconds)
18:11:06 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
18:11:45 Tario joins (~Tario@201.192.165.173)
18:12:30 × raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds)
18:14:43 Raito_Bezarius joins (~Raito@unaffiliated/raito-bezarius/x-8764578)
18:14:57 × raym quits (~ray@45.64.220.142) (Ping timeout: 264 seconds)
18:15:03 geowiesnot joins (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr)
18:19:13 son0p joins (~son0p@181.136.122.143)
18:19:20 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
18:20:00 <merijn> h2017: tbh, you know what the best answer is?
18:20:25 <merijn> h2017: To setup your code so that the ExceptT part isn't part of the public interface anywhere so you can rip it out relatively easy later
18:20:46 <h2017> yes that's what's going to happen
18:20:50 <monochrom> I think that's why they're generalizing to MonadError.
18:21:04 <merijn> I dislike MonadError, tbh
18:21:28 <merijn> In fact, I dislike every single typeclass in mtl
18:21:40 <merijn> They should *never* be part of your public API
18:22:04 <monochrom> which MonadError? :)
18:22:31 <merijn> monochrom: What do you mean "which"?
18:22:57 <monochrom> OK let me check that there are really two.
18:23:38 <merijn> monochrom: If there's two, I dislike both >.>
18:23:47 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 256 seconds)
18:23:47 <h2017> i will be implementing MonadError but there are smart constructors for the monad (for more than one reason) so you can't play with the wiring
18:23:57 <swarmcollective> rkk95, are you setting up your machine directly, or using Haskell from within a container? If you use a container, you can automate the setup with a .devcontainer.
18:24:01 <h2017> if users of the API could play with the wiring they could actually break the logic
18:24:11 <rkk95> @swam
18:24:11 lambdabot smacks about with a large trout
18:24:27 <rkk95> swarmcollective I'm setting up on my machine directly using Stack
18:25:05 <monochrom> OK there is just one.
18:25:15 <swarmcollective> rkk95, using a devcontainer allows you to try different versions of haskell + hls without reinstalling. https://github.com/calledtoconstruct/haskell-hls-devcontainer/
18:25:27 <h2017> part of the monad stack is a state monad and only certain state transitions are allowed. that's why operations are only available through smart constructors
18:25:41 <swarmcollective> However, I understand not wanting to give up the performance of on-hardware setup.
18:25:42 <h2017> i assume that this is standard practice
18:26:03 <rkk95> I dont need multiple versions do I? I get the error after I install Haskell extension : ghcide executable missing, please make sure it is installed, see https://github.com/digital-asset/ghcide. , when I try stack install ghcide I get dependeny errors
18:26:06 <monochrom> Oh snap, I didn't think of "swam".
18:26:14 <merijn> rkk95: You might
18:26:44 <merijn> rkk95: ghcide is using GHC as a library, which means the version of GHC used by ghcide must match the version you use for your code
18:27:51 <merijn> rkk95: ghcide is not on stackage, so... ;)
18:29:59 <rkk95> @merjin, ah yeah I installed from the binary here just now git clone https://github.com/digital-asset/ghcide.git
18:29:59 <lambdabot> Unknown command, try @list
18:30:24 × mupf quits (~micha@v22017094964653601.ultrasrv.de) (Ping timeout: 246 seconds)
18:32:30 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
18:32:42 bitmapper joins (uid464869@gateway/web/irccloud.com/x-adcpijikdquvbocl)
18:35:22 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:c91e:36e2:8f54:8f55) (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:37:25 × hiroaki quits (~hiroaki@ip4d166d67.dynamic.kabel-deutschland.de) (Ping timeout: 240 seconds)
18:37:27 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Ping timeout: 272 seconds)
18:38:26 × Jesin quits (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net) (Quit: Leaving)
18:39:54 × p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Read error: Connection reset by peer)
18:40:12 p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515)
18:40:17 Jesin joins (~Jesin@pool-72-66-101-18.washdc.fios.verizon.net)
18:40:23 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
18:42:00 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
18:44:27 shatriff joins (~vitaliish@protective.remission.volia.net)
18:45:03 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 265 seconds)
18:45:33 × StoneToad quits (~StoneToad@104-192-232-18.ppp.storm.ca) (Ping timeout: 264 seconds)
18:46:03 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
18:46:31 HarveyPwca joins (~HarveyPwc@2601:246:c180:a570:29df:3b00:ad0e:3a06)
18:46:32 knupfer joins (~Thunderbi@200116b82c888a0020b0b75f38b0f162.dip.versatel-1u1.de)
18:46:53 Sgeo joins (~Sgeo@ool-18b98aa4.dyn.optonline.net)
18:48:19 × gawen_ quits (~gawen@movzbl.root.sx) (Quit: cya)
18:48:40 gawen joins (~gawen@movzbl.root.sx)
18:48:48 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
18:53:36 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
18:55:29 × justsomeguy quits (~justsomeg@unaffiliated/--/x-3805311) (Quit: WeeChat 3.0)
18:55:31 × rkk95 quits (41bf0bfc@065-191-011-252.inf.spectrum.com) (Quit: Connection closed)
18:57:08 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
18:57:22 × geekosaur quits (82650c7a@130.101.12.122) (Ping timeout: 240 seconds)
18:57:33 mupf joins (~micha@v22017094964653601.ultrasrv.de)
18:57:42 × mastarija quits (~mastarija@93-136-104-186.adsl.net.t-com.hr) (Ping timeout: 246 seconds)
19:01:36 × geowiesnot quits (~user@i15-les02-ix2-87-89-181-157.sfr.lns.abo.bbox.fr) (Ping timeout: 240 seconds)
19:03:27 berberman_ joins (~berberman@unaffiliated/berberman)
19:04:06 × mouseghost quits (~draco@wikipedia/desperek) (Quit: mew wew)
19:04:41 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 272 seconds)
19:04:50 × berberman quits (~berberman@unaffiliated/berberman) (Ping timeout: 264 seconds)
19:06:50 × hexo quits (~hexo@gateway/tor-sasl/hexo) (Ping timeout: 268 seconds)
19:07:16 <Tordek_> https://paste.tomsmeding.com/raiSYlqR could I get a hand with types? I'm writing myself into a corner and I'm not understanding how to continue
19:07:57 <tomsmeding> Tordek_: what's not working?
19:08:00 Tordek_ is now known as Tordek
19:08:05 <merijn> Tordek_: Eh, type of "processor" on line 5 does not look right :p
19:08:15 hexo joins (~hexo@gateway/tor-sasl/hexo)
19:08:16 <merijn> I *highly* doubt it accepts *any* type
19:08:45 × DataComputist quits (~lumeng@50.43.26.251) (Ping timeout: 240 seconds)
19:08:54 <Tordek> the thing is, "devices" are meant to be non-terminating coroutines
19:09:03 <tomsmeding> Tordek: also: the '=' on line 12 should probably be a '->'
19:09:30 <Tordek> yeah, this is pseudocode trying to understand what I'm doing more than real haskell
19:10:21 <tomsmeding> I find it hard trying to help with types if you don't have a concrete implementation :p
19:10:49 × bayashi quits (~bayashi@185.204.1.185) (Remote host closed the connection)
19:11:03 <Tordek> the idea is that every time the device "ticks" it emits an action and waits for a new state (after which it emits a new action and so on)
19:11:05 <tomsmeding> type problems are often fairly subtle, and subtle in a way you're usually not going to find out without actually putting it through the compiler
19:11:20 <merijn> tomsmeding: hah, don't let pigworker hear you :p
19:11:27 × thunderrd quits (~thunderrd@183.182.113.172) (Ping timeout: 272 seconds)
19:11:35 <tomsmeding> someone who likes paper-coding?
19:11:41 <tomsmeding> Knuth-style
19:11:42 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
19:12:00 <merijn> tomsmeding: His entire thesis is about "why do we have to write an entire program *first* before the compiler can begin to help us?" :p
19:12:19 <tomsmeding> does that contradict my claims? :p
19:12:28 <tomsmeding> 'undefined' is your friend
19:12:34 <merijn> tomsmeding: _ is your friend
19:12:45 × raichoo quits (~raichoo@dslb-178-001-021-051.178.001.pools.vodafone-ip.de) (Quit: leaving)
19:12:46 <merijn> undefined is that shady bastard who ruins your day unexpectedly
19:13:05 <koz_> Yeah, basically this.
19:13:10 <koz_> Use typed holes, not 'undefined'.
19:13:23 frozenErebus joins (~frozenEre@94.128.219.166)
19:13:28 <tomsmeding> I... agree, but I found typed holes unwieldy in the past, not sure why
19:13:34 DataComputist joins (~lumeng@50.43.26.251)
19:13:41 <merijn> Use typed holes or you'll make merijn sad for investing weeks of his life to make using typed holes convenient!
19:13:47 <tomsmeding> I'll try using them for a while again
19:13:57 <tomsmeding> sorry :p
19:14:00 <koz_> tomsmeding: I use them all the time, both at Real Job For Real Money and not.
19:14:05 <koz_> They are excellent.
19:14:27 <merijn> koz_: The problem is that 70% of people seem to be unaware of -fdefer-typed-holes
19:15:27 <merijn> "but I can run code with undefined..." 'you can run code with types holes too, dammit! >.<'
19:16:09 <Tordek> https://paste.tomsmeding.com/OYQEIha2 this version has valid syntax at least...
19:16:29 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 256 seconds)
19:16:45 <tomsmeding> merijn: look at the glorious undefined
19:17:02 <Tordek> so, my issue is in trying to define `tick`,
19:17:52 hiroaki joins (~hiroaki@ip4d166d67.dynamic.kabel-deutschland.de)
19:19:22 <tomsmeding> what is the trouble?
19:19:23 zebrag joins (~inkbottle@aaubervilliers-654-1-4-36.w83-200.abo.wanadoo.fr)
19:20:21 × zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving)
19:21:31 ddellacosta joins (~ddellacos@86.106.143.241)
19:21:47 <Tordek> I don't get why the type is `tick :: BusAction -> Device BusState`; should I be adding an extra alternative to Device, like... Device t = Device BusAction (BusState -> Device t) | Response t?
19:22:14 <tomsmeding> well, the type is that because you're using it like that :p
19:22:34 <tomsmeding> but you're also using do-notation, which is kind of strange here
19:22:39 <tomsmeding> because Device is not a Monad
19:22:50 <tomsmeding> maybe that's part of the problem?
19:22:59 geekosaur joins (82650c7a@130.101.12.122)
19:23:12 <Tordek> well, it's not _yet_ because I can't figure out the types, so herein lies the crux of the problem, yes
19:24:32 × klardotsh quits (~klardotsh@c-71-231-242-112.hsd1.wa.comcast.net) (Quit: WeeChat 3.0.1)
19:24:44 <tomsmeding> I see
19:25:10 × hekkaidekapus{ quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Remote host closed the connection)
19:25:39 <tomsmeding> Tordek: I suggest trying to not use Device as a monad first
19:25:44 hekkaidekapus{ joins (~tchouri@gateway/tor-sasl/hekkaidekapus)
19:26:03 <tomsmeding> after you've written the code, you can always still try to figure out if there is something you can abstract into a monad
19:26:38 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)
19:26:52 <tomsmeding> to begin with, given the type signature for 'processor', it should, given a ProcessorState, be able to produce a BusAction
19:27:14 <tomsmeding> if then further given a BusState, it can return a new BusAction, and so forth
19:27:31 torax joins (~torax@178.239.168.171)
19:27:41 <tomsmeding> Tordek: reading your code, I assume your first BusAction is 'Read oaddr'?
19:27:48 conal joins (~conal@64.71.133.70)
19:27:56 <Tordek> yes
19:28:18 boxscape joins (4ff0baf3@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.243)
19:28:25 × rayyyy quits (~nanoz@gateway/tor-sasl/nanoz) (Ping timeout: 268 seconds)
19:28:45 <tomsmeding> Tordek: I've changed your code a bit to this: https://paste.tomsmeding.com/mOFYbCVg
19:29:07 <tomsmeding> I've just directly written that first Read as a Device value, as you can see; the second half of 'processor' is still as you wrote it
19:29:32 <tomsmeding> (also I did some minor styling)
19:29:34 zaquest joins (~notzaques@5.128.210.178)
19:29:55 <tomsmeding> and added a 'value' field to BusState which I guess was missing?
19:30:26 <tomsmeding> perhaps you can take this further and try to write the whole of 'processor' explicitly?
19:33:44 <tomsmeding> also I'm not sure if Device can be made a Monad at all; to be able to implement pure = return you have to conjure up a BusAction (perhaps Skip?), but to implement <*> from Applicative you have two bus actions that need to be merged somehow
19:34:11 <Tordek> https://paste.tomsmeding.com/xodHLX3D here's a non-monad-using version
19:35:01 oisdk joins (~oisdk@2001:bb6:3329:d100:3d8b:3b0b:d75b:3a22)
19:35:19 <tomsmeding> Tordek: you ignore the BusState after a Write?
19:35:51 <Tordek> it depends on the device, but in this case, yes
19:36:24 × ddellacosta quits (~ddellacos@86.106.143.241) (Remote host closed the connection)
19:37:01 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Remote host closed the connection)
19:37:19 <Tordek> ah, to be clear, this is modeling an microprocessor/bus on an electronic system. the processor would set/unset lines on the bus, and that state is propagated to other devices
19:38:00 × rdivyanshu quits (uid322626@gateway/web/irccloud.com/x-bjhpxmgmskwpfmhe) (Quit: Connection closed for inactivity)
19:38:03 <tomsmeding> I figured as much, but I don't know all too much about that domain :)
19:38:15 <Tordek> "Read" means "Set the address to <address> and the read line high", which would cause a different device to read that address line and set a value onto the bus
19:38:32 <tomsmeding> right
19:40:37 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
19:40:50 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
19:41:33 fosterite joins (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23)
19:43:24 <Tordek> https://paste.tomsmeding.com/xodHLX3D this version, the latest I linked, seems to be what I want; there's only 2 issues remaining: 1. it's indented AF and it's ugly
19:43:39 <Tordek> 2. I'll probably need to weave in IO at some point
19:43:52 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
19:44:05 × Digit quits (~user@fsf/member/digit) (Ping timeout: 240 seconds)
19:45:31 Franciman joins (~francesco@host-82-49-79-189.retail.telecomitalia.it)
19:45:53 <Tordek> thanks, btw!
19:49:55 × stree quits (~stree@68.36.8.116) (Ping timeout: 256 seconds)
19:53:30 Guest77289 joins (89dc78de@137.220.120.222)
19:56:09 topos is now known as tapas
20:00:07 × jchia1 quits (~jchia@58.41.30.202) (Ping timeout: 256 seconds)
20:03:10 stree joins (~stree@68.36.8.116)
20:03:32 <tomsmeding> Tordek: I agree the indentation is ugly; if you wish to sin you may have success using the NondecreasingIndentation language extension :p
20:04:11 × boxscape quits (4ff0baf3@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.243) (Quit: Connection closed)
20:04:22 boxscape joins (4ff0baf3@gateway/web/cgi-irc/kiwiirc.com/ip.79.240.186.243)
20:05:16 × petersen quits (~petersen@redhat/juhp) (Ping timeout: 256 seconds)
20:07:20 petersen joins (~petersen@redhat/juhp)
20:11:35 × Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
20:13:18 × fr33domlover quits (~fr33domlo@fsf/member/fr33domlover) (Ping timeout: 260 seconds)
20:13:21 Kaiepi joins (~Kaiepi@47.54.252.148)
20:14:23 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
20:14:24 roconnor joins (~roconnor@host-104-157-194-235.dyn.295.ca)
20:15:03 <roconnor> Hi, who / where can I petition to have new logict upper bounds installed on https://hackage.haskell.org/package/unification-fd-0.10.0.1 ?
20:16:14 fr33domlover joins (~fr33domlo@fsf/member/fr33domlover)
20:17:15 × jollygood2 quits (~bc8134e3@217.29.117.252) (Quit: http://www.okay.uz/ (Session timeout))
20:17:35 nbloomf joins (~nbloomf@2600:1700:ad14:3020:c91e:36e2:8f54:8f55)
20:20:15 × geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed)
20:20:32 geekosaur joins (82650c7a@130.101.12.122)
20:20:46 acidjnk_new joins (~acidjnk@p200300d0c7390972b9ca7ed3a5659a38.dip0.t-ipconnect.de)
20:22:20 × tomku quits (~tomku@unaffiliated/tomku) (Quit: Lost terminal)
20:22:42 <maerwald> roconnor: https://github.com/haskell-infra/hackage-trustees
20:22:55 coot joins (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl)
20:25:05 × Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection)
20:27:46 usr25 joins (~J@80.31.32.99)
20:28:28 <roconnor> thanks that's helpful.
20:29:08 Tario joins (~Tario@201.192.165.173)
20:29:39 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Remote host closed the connection)
20:34:33 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
20:36:23 × ukari quits (~ukari@unaffiliated/ukari) (Remote host closed the connection)
20:37:37 ukari joins (~ukari@unaffiliated/ukari)
20:43:14 × o1lo01ol1o quits (~o1lo01ol1@bl11-140-216.dsl.telepac.pt) (Remote host closed the connection)
20:43:45 × elliott_ quits (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net) (Ping timeout: 264 seconds)
20:44:14 o1lo01ol1o joins (~o1lo01ol1@bl11-140-216.dsl.telepac.pt)
20:44:52 tomku joins (~tomku@unaffiliated/tomku)
20:45:56 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 240 seconds)
20:47:18 × Pickchea quits (~private@unaffiliated/pickchea) (Quit: Leaving)
20:48:32 × roconnor quits (~roconnor@host-104-157-194-235.dyn.295.ca) (Remote host closed the connection)
20:48:58 roconnor joins (~roconnor@host-104-157-194-235.dyn.295.ca)
20:49:41 × roconnor quits (~roconnor@host-104-157-194-235.dyn.295.ca) (Remote host closed the connection)
20:51:33 kw joins (d4662d5d@212.102.45.93)
20:52:26 × tomku quits (~tomku@unaffiliated/tomku) (Quit: Lost terminal)
20:53:25 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 240 seconds)
20:54:06 × ukari quits (~ukari@unaffiliated/ukari) (Remote host closed the connection)
20:54:45 ukari joins (~ukari@unaffiliated/ukari)
20:55:59 frozenErebus joins (~frozenEre@94.128.219.166)
20:56:44 elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de)
21:00:02 tomku joins (~tomku@unaffiliated/tomku)
21:00:42 × tomku quits (~tomku@unaffiliated/tomku) (Client Quit)
21:01:42 <karasu1[m]> It seems that monochrom referenced my name earlier today, saying that I "spend days over-philosophizing instead of actual coding". This is not actually the case.
21:01:48 <karasu1[m]> Yesterday, monochrom made the remark that "This is not a career counselling channel". I never claimed it was a career counselling channel.
21:01:52 <karasu1[m]> All I was asking for is the relationship between category theory (which was part of the the discussion earlier), and Haskell.
21:01:55 <karasu1[m]> I mentioned college, since monochrom specifically asked me why I was interested in knowing this relationship between these two domains
21:01:59 <karasu1[m]> Can someone explain to me what I have done wrong here? All I wanted to know was the relationship between Haskell and a field of mathematics.
21:02:04 <karasu1[m]> monochrom seems to be needlessly categorizing that as over-philosophizing, or trying to justify why my question is not welcome in #haskell ("This is not a career counselling channel")
21:02:08 <karasu1[m]> What did I do here that was so wrong? I just feel needlessly attacked merely for having interest in another domain, and I don't feel any of this was at all necessary.
21:03:56 × knupfer quits (~Thunderbi@200116b82c888a0020b0b75f38b0f162.dip.versatel-1u1.de) (Ping timeout: 240 seconds)
21:07:44 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
21:07:49 <xsperry> karasu1[m], I don't think you did anything wrong. monochrom can be cranky at times
21:08:21 cur8or joins (~cur8or@72canterbury.cybersmart.co.za)
21:10:26 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
21:15:02 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 260 seconds)
21:17:55 × coot quits (~coot@37.30.55.141.nat.umts.dynamic.t-mobile.pl) (Quit: coot)
21:18:56 × Franciman quits (~francesco@host-82-49-79-189.retail.telecomitalia.it) (Quit: Leaving)
21:20:08 <karasu1[m]> I myself am new to #haskell, but I do think that this kind of attitude would be off putting (at the least) to many newcomers
21:20:12 Kaeipi joins (~Kaiepi@47.54.252.148)
21:20:17 × Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
21:21:27 <merijn> karasu1[m]: The simple answer on the relationship between Haskell and category theory can be summarised as "there is none"
21:22:06 <kw> merjin: That's pretty glib.
21:22:07 × Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
21:22:12 <merijn> Slightly longer version: "some names were copied from there for certain abstractions, but those names have essentially zero useful relation to their CT counterpart"
21:22:23 <merijn> kw: It's also true
21:22:30 <MarcelineVQ> idk about glib, you can model CT in haskell but you can model CT in BASIC too
21:22:49 <merijn> I don't know how this "Haskell is based on category theory" meme started doing the rounds on the internet, but it's *objectively* not true
21:23:21 <merijn> Like, we have a lot of literature on *exactly* the kinda things Haskell was based on...
21:23:23 Kaeipi joins (~Kaiepi@47.54.252.148)
21:23:29 <karasu1[m]> LOL, thanks for the answer.. that makes sense
21:23:33 <kw> I think it might be fair to say that there are folks who try to express concepts from category theory in Haskell.
21:23:41 <merijn> kw: Sure
21:23:44 <kw> Perhaps more than in many other languages.
21:23:46 <karasu1[m]> Yeah
21:23:55 <merijn> kw: But that is *very* different from "the language is based on category theory"
21:23:59 <karasu1[m]> I know that most people on #haskell are not like this though
21:24:00 × Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
21:24:11 <karasu1[m]> So I will continue to ask questions..
21:24:11 <kw> merjin: agree.
21:24:51 <monochrom> xsperry: Sure I'm always cranky. But did you conclude "I don't think you did anything wrong" under knowledge of the actual conversations?
21:24:52 <dolio> Saying that it was merely names that were copied with no meaningful relation to the original concept is also wrong.
21:24:54 <merijn> karasu1[m]: To be more specific, Haskell is pretty much entirely based on type theory and lambda calculus, and to be *even more* specific, the theory underlying GHC is mostly "System F_omega"
21:24:57 <kw> But I do think that many of those people have played an important role in the evolution of Haskell.
21:25:25 <xsperry> monochrom, I witnessed first (I think it was first) conversation
21:25:35 <monochrom> Here is a sample: http://www.vex.net/~trebla/tmp/k.txt
21:25:39 <kw> At least the Haskell package ecosystem, if not the language itself.
21:25:45 <merijn> dolio: Not meaningful in the sense that "you can't do category theory using the standard typeclasses" and "you can't easily generalise from CT to Haskell either"
21:26:01 <monochrom> I invite you to dig up more to see what I judge as help-vampiring. That's what's wrong.
21:26:14 <monochrom> Help-vampiring and fog-style monologuing.
21:26:24 <merijn> dolio: You will not become better at Haskell from knowing CT, nor will you get better at CT from knowing Haskell. That's not to say it can't be interesting/whatever
21:26:51 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
21:27:04 <merijn> (I guess there's a tiny niche of people who do get better at Haskell, from CT, but by the time you reach that point you are good enough at Haskell to not need to ask how to get better, like edwardk :p)
21:27:21 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:c91e:36e2:8f54:8f55) (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:27:25 <karasu1[m]> I just asked a simple question.
21:27:39 <karasu1[m]> This is help vampiring?
21:27:52 <kw> karasu1[m]: I think you accidentally pressed a sore point.
21:28:00 <swarmcollective> karasul[m], questions are fine, just be sure to make them thoughtful and appreciate both the answer and the person giving the answer.
21:28:20 <monochrom> I'm sorry but "does X, Y, Z help understand Haskell?" and then "because I need to pick elective for college" looks more like career counselling than haskell help.
21:28:46 <karasu1[m]> You specifically asked me why I was interested in Category theory
21:28:49 <karasu1[m]> That was my answer
21:29:02 <monochrom> You're lying. Look at the log.
21:29:15 <karasu1[m]> "Why are you still looking for distraction?"
21:29:19 <sm[m]> how can you accurately call :main with a multi-word argument in GHCI ? (equivalent to $ myprog 'arg one')
21:29:20 <karasu1[m]> You said that
21:29:27 <karasu1[m]> That was my answer
21:29:51 <merijn> sm[m]: Use ":main <args>"
21:29:54 <karasu1[m]> I wouldn't have brought up college or my own life unless you had asked "Why are you still looking for a distraction"
21:30:14 <dolio> I'm not really convinced that's true. I think if more people knew what the concepts in category theory were used for, it'd help clear up their ideas of the roles they play in Haskell. Instead you get lots of either wrong explanations or 'just don't think about it,' non-explanations.
21:30:33 Kaiepi joins (~Kaiepi@47.54.252.148)
21:30:43 <sm[m]> merijn: do you mean " :main 'arg one' " ? It doesn't work
21:30:48 geowiesnot joins (~user@87-89-181-157.abo.bbox.fr)
21:30:53 <dolio> Which helps you not waste time thinking about Haskell incorrectly.
21:31:19 <merijn> sm[m]: Eh...I'm not sure what the quoting rules (if any) are in ghci
21:31:26 nbloomf joins (~nbloomf@2600:1700:ad14:3020:c91e:36e2:8f54:8f55)
21:31:30 <karasu1[m]> monochrom: When you say "Why are you still looking for a distraction?", I took that to mean "You specifically asked me why I was interested in Category theory"
21:31:30 <karasu1[m]> I'm not lying at all
21:31:30 <karasu1[m]> That was the reasonable conclusion from that question
21:31:50 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 260 seconds)
21:31:57 <karasu1[m]> Look at the log
21:31:58 <sm[m]> it strips quotes, and I haven't found a workaround yet
21:32:34 <geekosaur> sm[m], double quotes seemed to work here
21:32:36 <merijn> dolio: Which explanations are you thinking about, then? Because I've gone ~6 chapters into CT books and all that gets your is functors which is absolutely marginal in terms of learning Haskell
21:32:52 <merijn> sm[m]: You can always use "withArgs xs main" :p
21:33:14 × fosterite quits (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23) (Remote host closed the connection)
21:33:19 jollygood2 joins (~bc8134e3@217.29.117.252)
21:33:34 fosterite joins (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23)
21:33:39 <karasu1[m]> Anyway monochrom , I hope that you at least see why your comments make me feel unwelcomed and attacked
21:34:02 × fosterite quits (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23) (Remote host closed the connection)
21:34:03 <sm[m]> geekosaur: you're right! merijn: also true. Thanks both
21:34:19 <karasu1[m]> Again, I do realize that most people in this channel are not like this, so I will continue to ask questions
21:34:22 fosterite joins (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23)
21:34:37 <karasu1[m]> dolio: Thank you for the help yesterday regarding the normalize list one pass thing
21:34:46 <edwardk> merijn: i do think that without category theory, the haskell i wrote would be ... boring, and i wouldn't have any real reason to write in it over any other language. the arrays are clunky, syntax for doing mutable things is hard to use...
21:34:49 × fosterite quits (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23) (Remote host closed the connection)
21:34:54 <karasu1[m]> And ski as well, if ski is here
21:35:00 <karasu1[m]> thanks.
21:35:05 <edwardk> i'd have... concurrent exception safety and masking
21:35:11 fosterite joins (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23)
21:35:12 <edwardk> and uh... STM
21:35:13 <dolio> For example, I think a lot of people burn time trying to 'explain' monads. But in category theory they are used to talk about algebra mostly, which is exactly what they're doing in Haskell.
21:35:18 knupfer joins (~Thunderbi@mue-88-130-61-090.dsl.tropolys.de)
21:35:36 × fosterite quits (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23) (Remote host closed the connection)
21:35:43 <dolio> No BS about 'containers' or 'sequencing' or ....
21:35:45 tomku joins (~tomku@unaffiliated/tomku)
21:35:50 <merijn> edwardk: A convenient FFI and expressive language :p
21:36:14 <edwardk> expressive language maybe. convenient ffi? have you actually used any other language? =)
21:36:15 fosterite joins (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23)
21:36:17 <dolio> That also explains why algebraic effects are useful for many of the same things.
21:36:18 <swarmcollective> merijn, thank you for spelling that out. "You will not become better at Haskell from knowing CT, nor will you get better at CT from knowing Haskell" I recently asked my father some questions about CT (as he was a Mathematics Prof) and at the end of the conversation, he said "You are using terms from Mathematics, but not in a way that makes sense in Mathematics" LOL
21:36:30 <edwardk> to bind another library i use 3 fricking ffi approaches and still can't handle c++ right
21:36:31 <merijn> dolio: tbh, I never even got to monads in the CT books, because adjuncts and stuff are like halfway into the book which is far more painful then I've managed to get through
21:36:47 <merijn> edwardk: Oh, but that doesn't count
21:36:57 <merijn> edwardk: C++ is entirely shite to call from any language that is not C++
21:37:04 <geekosaur> "handles C++ right" this is a thing?
21:37:20 <merijn> In fact, I would go as far as saying there's literally no language with a proper C++ FFI
21:37:25 <merijn> What would that even mean
21:37:34 <ski> yw, karasu1[m]
21:37:44 alx741 joins (~alx741@181.196.68.69)
21:37:48 <merijn> edwardk: And what languages have you used where the FFI is as pleasant or better than Haskell?
21:38:05 <merijn> I could always use more languages in my repertoire :p
21:38:11 <dolio> Because algebraic effects are Lawvere theories, which are well known to be connected to monads.
21:38:16 <maerwald> merijn: python
21:38:16 <ski> swarmcollective : perhaps part of that would just be different backgrounds
21:38:28 <edwardk> geekosaur: i can kinda sort of limp by by using a mixture of hsc2hs to grab constants from macros if there is a c api, using inline-c-cpp to bind custom snippets to puppet the api and using the haskell ffi bits to grab finalizers and the last few things the other 2 approaches don't do
21:38:30 <merijn> maerwald: Python's FFI is *far* more painful then Haskell
21:38:57 <merijn> edwardk: Sure, but that applies to literally any other language and C++ too :p
21:39:00 <edwardk> my code becomes a rats nest of c programs running to _print_ haskell programs, template haskell code gen, and 2 tiers of libraries for annoying technical reasons
21:39:14 <edwardk> merijn: i'm just saying i had better experiences 20 years ago using python and SWIG
21:39:34 <edwardk> or perl's inline c package
21:39:38 <geekosaur> swig abstracts away a lot of pain in any language
21:39:48 <edwardk> both of which were pretty damn good
21:39:51 <ski> edwardk : sounds like grovelling
21:40:01 <edwardk> haskell _can_ ffi. it isn't good at it
21:40:12 <edwardk> groveling?
21:40:14 <ski> (the generating programs at run-time, in order to grab FFI constants thing)
21:41:21 <merijn> edwardk: Doing the same things in python takes me considerably more code and dealing with python's insane interpreter >.>
21:41:27 × fosterite quits (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23) (Ping timeout: 258 seconds)
21:41:28 <edwardk> and to boot, hsc2hs is sstill hs_c_2hs, because we haven't bothered to flip the order in which arguments are passed to it, so we can';t overload it to to c++.
21:41:50 <edwardk> that's literally what it takes
21:41:59 <merijn> edwardk: tbh, you can't currently have a sane hsc2hs at the moment anyway
21:42:11 <edwardk> ok, so i should what, stop?
21:42:11 <merijn> edwardk: And I disagree with "that's all it takes"
21:42:37 <edwardk> i mean that is all it takes for me to be able to bind go glslang, which i really just can't do with haskell today
21:42:38 <dolio> edwardk: Probably. :)
21:42:40 <edwardk> not efficiently
21:42:46 <maerwald> c2hs is also great, especially when it fails to parse your C files :p
21:42:51 <edwardk> that was what stopped me from my coding binge this summer
21:42:52 <merijn> edwardk: I'm not saying that, but things aren't that simple. inline C++ and hsc2hs need a way to explicitly pass in the toolchains
21:43:02 <merijn> maerwald: c2hs is explicitly *not* intended for automated use
21:43:07 × ymherklotz quits (~user@2a00:23c7:e28c:6001:5460:47fb:6d9:8e42) (Ping timeout: 260 seconds)
21:43:16 <edwardk> was realizing i was really going to have to write a custom binding to libclang, because there was no pure c header available _and_ a bunch of constants i had to capture
21:43:17 <maerwald> merijn: tell that to hackage
21:43:19 <merijn> maerwald: It's intended to create scaffolding for manual fixing up, which it says in the docs
21:43:38 <merijn> maerwald: Sure, people do stupid stuff all the time
21:43:45 <edwardk> i figure i gave it a good go for about a month before walking away
21:43:55 <edwardk> so i'm a bit salty about our 'good ffi' =)
21:43:58 <merijn> edwardk: There's a half-arsed CXX configuration in ghc currently, and I made a ticket to make it more explicit
21:44:10 <ephemient> karasu1[m]: I'm not a good educator, so I hope my attempts here haven't been dissuading you from asking questions. however, I will say that *at times* you don't appear to be a good learner either - revisiting the same points without taking others' replies - which does bother people
21:44:20 × geekosaur quits (82650c7a@130.101.12.122) (Quit: Connection closed)
21:44:26 <merijn> edwardk: But until the entire toolchain (including cabal) allows passing in explicit C++ toolchains, C++ FFI is fundamentally doomed
21:44:50 <merijn> edwardk: And in my defense I was talking about *C* FFI when I said good FFI
21:45:04 <karasu1[m]> ephemient: can you give me an example? I will try to learn from this then
21:45:06 <edwardk> my current hope for c++ ffi is to ... do almost everything at template haskell time, which has its own special brand of crazy
21:45:15 <dolio> karasu1[m]: If you want a possibly more constructive version of monochrom's grumping, I'd say you should read leading questions people give you more closely. For instance, I asked you to write a function that subtracted a value from everything in a list, and you had some false starts because you kept thinking about what that value was going to be.
21:45:18 <edwardk> because it literally forces me to use two libraries inside the package
21:45:27 <dolio> But I didn't ask you about that. I just asked you to write the function, not call it with anything.
21:45:28 <edwardk> otherwise template-haskell fails to link the external libraries i need
21:45:37 <merijn> edwardk: I mean, to have any form of sensible C++ FFI you need a stable ABI for C++, which just doesn't exist
21:45:41 <edwardk> so i have to set up with template haskell in package one dependencies i can use in package 2
21:45:54 <merijn> Not to mention that you can't mix C++ code compiled with different stdlib's either
21:45:58 <edwardk> merijn: that is an excuse not a solution
21:46:05 <merijn> All of which is to blame on C++, not Haskell
21:46:18 × alx741 quits (~alx741@181.196.68.69) (Ping timeout: 260 seconds)
21:46:19 <ephemient> Itanium C++ ABI is mostly standard
21:46:23 <ephemient> ... except where it isn't
21:46:26 <merijn> edwardk: Sure, because I don't see any solution that does not involve "manually hard coding all special cases"
21:46:27 <edwardk> c++ exists, complaining about that fact won't make it go away, and won't make things you have to interop with stop being written in it.
21:46:41 <karasu1[m]> dolio: Yes, I understand. It had to do with my presumption that we had to know the value before we actually subtracted the value. That's where Haskell's special sauce comes in though I guess, so I didn't know.
21:46:43 <kw> Unfortunately, blaming C++ for being C++ will get you nowhere :9
21:46:43 <merijn> edwardk: Right, but nothing else but C++ can interface with it either
21:46:47 justsomeguy joins (~justsomeg@unaffiliated/--/x-3805311)
21:46:50 × tomku quits (~tomku@unaffiliated/tomku) (Quit: Lost terminal)
21:47:14 <maerwald> merijn: yeah, and make sure you actually use *capi* and not ccall :D
21:47:16 <maerwald> such great ffi
21:47:25 <karasu1[m]> I am not a smart person LOL..
21:47:34 <karasu1[m]> But I will try to get better at learning.
21:47:35 <maerwald> or get random header bugs
21:47:38 <merijn> edwardk: Which, sure, isn't solution, but short of someone ponying up a few million to pay for handling all the special cases I don't see it happen
21:47:47 <maerwald> such as https://git.io/Jt9II
21:48:08 <edwardk> i have a greater apetite for just 'cutting and pasting whole chunks of an api and reimplementing it, but the current story is nuts.
21:49:07 edwardk stares nervously at his unlifted library which is large chunks of base re-implemented or the linear-primitive code he wrote just before that...
21:49:34 <edwardk> and the c++ tensor library that he wrote that totally isn't just a clone of everyone else's ETL'd tensoring approach..
21:49:38 gratadewey1 joins (~gratadewe@tmo-121-215.customers.d1-online.com)
21:50:00 × ambiso9 quits (~ambiso@209.182.239.205) (Quit: The Lounge - https://thelounge.chat)
21:50:14 <edwardk> anyways, my next approach will be to say screw it and just use libclang
21:50:34 <maerwald> merijn: and that code almost made it into unix package
21:50:35 <edwardk> and then at TH-time run it, walk through the structures, spew out the code i need and be done.
21:51:10 ambiso9 joins (~ambiso@209.182.239.205)
21:51:33 <edwardk> on the plus side i almost have all of the numeric hierarchy done in 'unlifted'
21:51:43 <edwardk> switching to happier topics =)
21:52:03 <dolio> Not even C++ can interface with C++, no? It's only particular compilers that are compatible.
21:52:05 <karasu1[m]> ephemient: I do want to make it clear that I read everyones' replies when it relates to my question. Sometimes I fixate on one or two replies at a time though, and reply based on those, so it might seem as though I have ignored everyone else, but this is not my intention.. Unfortunately with the IRC problem I don't think I can solve this problem though..
21:52:14 viluon joins (uid453725@gateway/web/irccloud.com/x-xtfekalitxpxoctj)
21:52:15 <jollygood2> how come main isn't main :: [String] -> IO Int? then we wouldn't need things like :main or withArgs
21:52:30 <karasu1[m]> IRC (not problem lol)
21:52:38 <dolio> jollygood2: But you wouldn't be able to do withArgs. :)
21:52:38 <merijn> dolio: The only compatible compilers are "the exact same version", other versions of the same compiler *may* work if you're lucky
21:52:49 <dolio> Right.
21:52:52 <merijn> dolio: And if you use a different stdlib implementation everything is hell
21:52:53 <edwardk> jollygood2: because then you don't have t run your entire program in a reader monad just to pass around some arguments you could gather at literally any point
21:52:59 <jollygood2> dolio, sure you would? just call main with list of arguments
21:53:32 ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta)
21:54:03 swarmcollective thinks out loud "Isn't `std` in stdlib supposed to mean standard..." (facepalm)
21:54:14 <edwardk> swarmcollective: =P
21:54:15 <merijn> swarmcollective: The API is standard
21:54:22 <merijn> swarmcollective: The implementation and internals are not
21:54:42 <maerwald> swarmcollective: yeah, we need better tests xD
21:54:46 <merijn> swarmcollective: And since C++ doesn't have standardised ABI that defines how specific APIs are compiled
21:55:01 × Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection)
21:55:54 <merijn> swarmcollective: std::vector from LLVM stdlib is implemented *differently* from the one in g++'s stdlib. They have the same public API, but their internals aren't the same, so if you pass a std::vector from one to functions from the other you'll get segfaults, random memory corruption, etc.
21:56:53 <davros_> i dont even think rust can interface nicely to c++ (haven't checked if they made any progress with that)
21:56:58 <merijn> (speaking from experience)
21:57:01 <monochrom> "The nice thing about standards is there are so many to choose from."
21:57:32 <merijn> davros_: Even D, which advertises a C++ FFI is only partially compatible with C++ code, so you better hope you don't need anything it doesn't cover
21:58:01 <dolio> Couldn't that happen with C? Like, two different compilers might disagree on various sizes and whatnot.
21:58:12 <merijn> dolio: In theory, yes
21:58:14 <dolio> Of course there's lots more to disagree about in C++.
21:58:25 <merijn> dolio: In practice every C compiler adheres to the platform ABI specified by the OS
21:58:32 <monochrom> The C world has consensus on, for example, "x86-64 ABI"
21:58:32 <dolio> Oh okay.
21:58:35 <merijn> dolio: But such an ABI doesn't exist for C++
21:59:07 <merijn> dolio: Incidentally, this is why you cannot pass/return structs by value between C code from different compilers (or haskell's C FFI)
21:59:15 <monochrom> The C++ world? What ABI? They have *.h files instead.
21:59:20 <merijn> Because the ABI doesn't specify what that should look like
21:59:28 <dolio> Okay, makes sense.
21:59:59 <swarmcollective> <sarcasm>All this incompatability makes we think we should make another language that doesn't have this problem.</sarcasm>
22:00:23 <monochrom> I don't even think they have agreed on a universal name-mangling algorithm.
22:00:42 alx741 joins (~alx741@186.178.109.47)
22:00:46 <ski> @quote mangler
22:00:46 <lambdabot> Pseudonym says: All hail the Evil Mangler!
22:00:47 × son0p quits (~son0p@181.136.122.143) (Quit: leaving)
22:00:58 <merijn> monochrom: They do not
22:01:02 tomku joins (~tomku@unaffiliated/tomku)
22:01:08 <merijn> monochrom: Once again, speaking from experience >..
22:01:46 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 265 seconds)
22:01:55 <merijn> the evil mangler was a Haskell thing, though :p
22:02:04 <ski> well, Perl, technically
22:02:13 <merijn> Which is slowly becoming ancient Haskell lore :p
22:02:24 <merijn> ski: Perl implementation, but *for* Haskell
22:02:37 × gratadewey1 quits (~gratadewe@tmo-121-215.customers.d1-online.com) (Quit: Leaving)
22:03:37 <ephemient> Go uses its own ABI instead of the platform's ABI, at least for calling convention...
22:04:02 <merijn> ephemient: So does GHC :p
22:04:17 <ski> merijn : yes, i know :P
22:04:30 <ephemient> C++ name mangling is pretty well standardized, that's part of the Itanium C++ ABI that both GCC and Clang follow (at least on Linux and macos). Windows is different but also standard
22:04:35 <monochrom> I feel like the C++ people have given up. Even though there are a lot of C++ users, there are not enough of them to need a common ABI. I mean, look at Scheme or Lisp too, what do you need ABIs for? :)
22:04:36 <merijn> ski: I mean that I would consider that "a Haskell thing" :p
22:05:12 <ski> sure, i was just jesting :p
22:05:35 <ephemient> it's true that "data structures" like strings and vectors aren't part of the C++ ABI though, and exporting those will lead to suffering
22:06:40 <ephemient> merijn: it's fairer for GHC because we don't pretend to be a C-like language, IMO
22:06:50 <monochrom> Hey, LLVM knows GHC calling convention. That's a start...
22:07:17 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
22:08:26 × __monty__ quits (~toonn@unaffiliated/toonn) (Quit: leaving)
22:09:22 <davros_> c++ libraries usually need a lot of compile-time code generation
22:09:44 ski . o O ( <https://common-lisp.net/project/cffi/manual/html_node/The-Groveller.html> )
22:09:51 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Remote host closed the connection)
22:09:54 fosterite joins (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23)
22:10:23 <davros_> passing types liike std::vector around.. problematic
22:10:30 heatsink joins (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507)
22:10:56 × stree quits (~stree@68.36.8.116) (Ping timeout: 240 seconds)
22:13:16 <karasu1[m]> monochrom: Do you wish to apologize for attacking me and made me feel unwelcome? Or are you planning to continue?
22:13:34 <monochrom> I did not attack you. At most I complained.
22:13:49 <monochrom> Are you ready to apologize for wrong accusations towards me?
22:13:56 <karasu1[m]> What wrong accusations?
22:14:07 <karasu1[m]> I felt attacked
22:14:10 <karasu1[m]> I felt unwelcome
22:14:26 <karasu1[m]> I'm not lying here
22:14:48 × heatsink quits (~heatsink@2600:1700:bef1:5e10:2c3b:7c69:7266:b507) (Ping timeout: 258 seconds)
22:14:56 × fosterite quits (~fosterite@2600:6c46:7800:fecf:fc10:290f:3ec0:2a23) (Ping timeout: 240 seconds)
22:14:58 ymherklotz joins (~user@2a00:23c7:e28c:6001:5460:47fb:6d9:8e42)
22:14:59 <karasu1[m]> I still don't feel that comfortable here to be honest
22:15:08 18WABPWT7 joins (~Feuermagi@2a02:2488:4211:3400:246e:bf09:8453:9d6)
22:15:08 17SABVONV joins (~Feuermagi@213.178.26.41)
22:15:13 <Uniaika> uh-oh
22:15:34 elliott_ joins (~elliott_@pool-108-51-101-42.washdc.fios.verizon.net)
22:15:49 × p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Quit: p-core)
22:16:00 <karasu1[m]> monochrom: So you refuse to apologize? And you plan to continue I take it then?
22:16:10 p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515)
22:16:54 × 18WABPWT7 quits (~Feuermagi@2a02:2488:4211:3400:246e:bf09:8453:9d6) (Client Quit)
22:17:06 × 17SABVONV quits (~Feuermagi@213.178.26.41) (Client Quit)
22:17:19 Feuermagier joins (~Feuermagi@2a02:2488:4211:3400:246e:bf09:8453:9d6)
22:17:22 <swarmcollective> Wow. :\
22:19:21 edwardk looks up, sees drama.
22:19:30 <edwardk> karasu1[m]: chill out
22:20:59 <karasu1[m]> I really don't feel comfortable here if monochrom does not see why their actions made me feel attacked and unwelcome, and especially if monochrom is planning to continue doing the same thing again
22:21:05 <karasu1[m]> That is how I honestly feel
22:21:40 <edwardk> right now i don't have a whole lot of context. all i have is you here, a relative newcomer chatting at a mile a minute, and starting to demand apologies.
22:22:23 <edwardk> i'm happy to move this discussion into #haskell-ops. this _isn't_ the place for this drama.
22:23:27 × ymherklotz quits (~user@2a00:23c7:e28c:6001:5460:47fb:6d9:8e42) (Ping timeout: 272 seconds)
22:24:35 × nbloomf quits (~nbloomf@2600:1700:ad14:3020:c91e:36e2:8f54:8f55) (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:24:36 stree joins (~stree@68.36.8.116)
22:29:12 _bo joins (~bo@178.150.122.153)
22:31:16 × bo__ quits (~bo@178.150.122.153) (Ping timeout: 240 seconds)
22:32:06 <sm[m]> karasu1: monochrom is sometimes rude and you made your point well and got some good responses. After that it's usually best to let things settle and/or just carry on with on-topic chat
22:32:07 sheepfleece joins (~sheep@46.53.253.85)
22:32:15 × sheepfleece quits (~sheep@46.53.253.85) (Client Quit)
22:32:30 ep1ctetus joins (~epictetus@ip72-194-215-136.sb.sd.cox.net)
22:32:35 <merijn> sm[m]: The discussion has moved to -ops
22:35:18 × elfets quits (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) (Ping timeout: 260 seconds)
22:36:16 <maerwald> ontopic: cabal-3.4.0.0 is out
22:36:31 × cur8or quits (~cur8or@72canterbury.cybersmart.co.za) (Ping timeout: 256 seconds)
22:37:30 × usr25 quits (~J@80.31.32.99) (Quit: Bye)
22:38:05 <monochrom> !!!
22:38:35 <monochrom> So finally the doc version and the program version match with each other :)
22:39:04 <maerwald> ppl have been using the RCs in production anyway
22:39:18 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
22:40:01 <wz1000> great, I can finally use `cabal list-bin` to replace the horrific `PATH="${PATH/$HOME\/.local\/bin:/}" cabal new-exec --verbose=0 --offline sh -- -c 'which myexecutable'` in all my scripts
22:40:15 <merijn> wz1000: High-five!
22:40:19 <merijn> wz1000: Join the club ;)
22:40:33 <merijn> wz1000: Although you could have used cabal-plan for that :p
22:41:23 <merijn> wz1000: Also, isn't your version just "cabal v2-run"?
22:41:26 <maerwald> still weird that you have to prefix exe:
22:41:33 <maerwald> like there are bins for a lib target
22:42:01 <merijn> maerwald: You don't have to prefix exe: ?
22:42:07 <maerwald> you have to
22:42:17 <wz1000> merijn: in my experience new-run tends to be slow, probably because its trying to check if things are up to date
22:42:25 <maerwald> https://paste.tomsmeding.com/AueG5K2S
22:42:42 <merijn> maerwald: Works without exe: for me in 3.2
22:42:59 <merijn> maerwald: Oh, you have the same name library and executable
22:43:03 <maerwald> yeah
22:43:04 <sm[m]> congrats, cabal devs!
22:43:07 cur8or joins (~cur8or@72canterbury.cybersmart.co.za)
22:43:12 theodorc is now known as teddyc
22:43:26 × xff0x quits (~xff0x@2001:1a81:5288:8c00:e78d:bbe2:6a38:a9e6) (Ping timeout: 240 seconds)
22:44:27 frozenErebus joins (~frozenEre@94.128.219.166)
22:44:45 xff0x joins (~xff0x@2001:1a81:5288:8c00:b017:dd71:5231:84a2)
22:45:08 Tario joins (~Tario@201.192.165.173)
22:45:50 <maerwald> --help is still a useless piece of *** :p
22:46:10 <merijn> "patches welcome" >.>
22:46:44 <maerwald> that would be a lot of work (the research, not the patch)
22:46:50 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
22:47:44 <merijn> maerwald: Somebody's gotta do it!
22:47:49 ahaqi joins (~ahaqi@194.35.233.73)
22:47:59 <merijn> maerwald: And you're certainly unreasonable enough to finish out of stubborness!
22:48:03 <maerwald> I can still blame my injury for not providing PRs
22:48:52 maerwald opens a beer
22:49:20 jksafjkal joins (56032b47@cpc68308-cdif16-2-0-cust838.5-1.cable.virginm.net)
22:49:39 jedws joins (~jedws@101.184.202.248)
22:49:46 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 260 seconds)
22:52:31 × ahaqi quits (~ahaqi@194.35.233.73) (Quit: Leaving)
22:55:03 × forgottenone quits (~forgotten@176.42.28.68) (Quit: Konversation terminated!)
22:55:19 <monochrom> maerwald, how come --help is a useless piece of ****? Some examples?
22:55:39 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
22:56:53 × alx741 quits (~alx741@186.178.109.47) (Quit: alx741)
22:57:10 <sclv> one problem i can think of is that with v2 it tends to list all the flags and not just the command-relevant flags
22:57:27 <sclv> so there's just way too much in there, and its hard to find what you're looking for unless you already know what to grep for
22:57:34 <dolio> It also doesn't take terminal width into account.
22:57:39 <sclv> and there's flags for different commands that _look_ like they might work, but they don't
22:58:01 <sclv> dolio: but all my terminals are like 500 chars wide so i dont notice :-P
22:58:07 <merijn> sclv: It does only list command relevant flags
22:58:10 <sclv> also i habitually pipe help into less
22:58:17 × danvet quits (~Daniel@2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa) (Ping timeout: 272 seconds)
22:58:23 <merijn> sclv: But "cabal --help v2-build" and "cabal v2-build --help" are not considered the same
22:58:37 <merijn> Whether they should be is another discussion
22:58:50 <monochrom> That one I got used to and stopped questioning.
22:59:07 <merijn> dolio: Reliable and cross-platform terminal width querying is a cursed problem, though :p
22:59:19 <sclv> build --help iirc will still give flags that really build ignores and only work with configure iirc
22:59:54 <dolio> merijn: That doesn't sound like a good excuse.
22:59:55 <monochrom> I sometimes use less, sometimes don't but just take advantge that I set my terminal scroll buffer to be 10000 lines or something.
22:59:57 × ep1ctetus quits (~epictetus@ip72-194-215-136.sb.sd.cox.net) (Ping timeout: 264 seconds)
22:59:59 <merijn> sclv: Could be, but hard to know for sure
23:00:03 <dolio> Not that it's a serious problem.
23:00:28 <merijn> dolio: ANything is a good excuse if you're not getting paid to work on something :p
23:00:34 × fendor quits (~fendor@91.141.3.212.wireless.dyn.drei.com) (Remote host closed the connection)
23:00:39 <sclv> merijn: i only know because i've run into it. also like configure --help lists -j which is a build only option etc. basically all the v2 commands list all the v2 options i think :-/
23:00:50 <monochrom> command-(ir)relevant flags, I think the intention is still command-relevant flags but maybe there are a few bugs lying around.
23:00:58 <dolio> I mean, if you don't want to figure out the terminal width somehow, it could just be formatted at fewer than 100+ characters wide.
23:01:04 polyrain joins (~polyrain@2001:8003:e4d8:4101:d1d2:4fc1:88fa:56)
23:01:07 <merijn> sclv: For sure not all of them
23:01:14 <dolio> Something more like 70.
23:01:16 <merijn> sclv: Because v2-build doens't list --repl-options :)
23:01:41 <merijn> dolio: It is less wide than 100 here, though?
23:01:57 <dolio> Well, whatever it is, it's consistently wider than I run most terminals.
23:01:58 <merijn> It linewraps before the end of my terminal at least
23:02:00 <sclv> true enough, but its still got a big mess. anyway that's my really only gripe with --help
23:02:47 <monochrom> But, most flags for configure are now relevant to build, run, exec, install too because the semantics of configure has changed (it just saves flags to cabal.project.local) and you don't require you to "configure", you can specify config at the build command etc.
23:03:18 frozenErebus joins (~frozenEre@94.128.219.166)
23:03:41 Tario joins (~Tario@201.192.165.173)
23:03:44 <monochrom> Actually, that could use some clarification by v1- and v2- prefixes
23:04:13 <monochrom> But, most flags for v1-configure are now relevant to v2-build, v2-run, v2-exec, v2-install too because the semantics of configure has changed (it just saves flags to cabal.project.local) and you don't require you to "v2-configure", you can specify config at the v2-build command etc.
23:05:40 <monochrom> v2-configure -j also just saves the equiv of -j to cabal.project.local so you don't have to repeat it when you v2-build. This is why -j can be legit for v2-configure.
23:06:12 <merijn> -j *is* legit for v2-configure
23:06:17 <monochrom> It's a paradigm change from v1 to v2. It's why I think that most flags are justified and relevant.
23:06:18 <merijn> In fact, I use it in my build system
23:06:52 <monochrom> s/change/shift/ # more idiomatic
23:07:05 <merijn> sclv: ^^ I glossed over that in your comment, -j is totally valid in configure
23:07:15 <dolio> It's also wide just because it's not using space efficiently, because a couple flags are super long, so you get a big blank space in the middle.
23:07:31 <monochrom> I think I did find a few flags that's effectless. But I chalk it up as bugs. And they're few.
23:07:36 <merijn> sclv: "cabal configure -jN" ends up adding "jobs: N" to your cabal.project.local
23:07:53 <sclv> ok, well shows what i know :-P
23:07:56 × frozenErebus quits (~frozenEre@94.128.219.166) (Ping timeout: 240 seconds)
23:08:35 <merijn> I run "cabal configure -j24" in my makefile to ensure any following cabal build calls are fast :p
23:08:36 × knupfer quits (~Thunderbi@mue-88-130-61-090.dsl.tropolys.de) (Ping timeout: 240 seconds)
23:09:37 <monochrom> [deep bass movie trailer voice] "You unlearned C when you learned Haskell. Now you have to unlearn v1 when you learn v2." >:)
23:10:10 <monochrom> You have much RAM too? That's the real bottleneck usually...
23:10:23 <merijn> monochrom: 192 GB in the cluster headnode ;)
23:10:54 <monochrom> OK you'll do fine.
23:11:02 <monochrom> I mean that's epic.
23:11:15 <merijn> monochrom: I once nearly OOmed the machine using Chart >.>
23:11:20 × Deide quits (~Deide@217.155.19.23) (Quit: Seeee yaaaa)
23:11:46 <merijn> Pro-tip: Chart-cairo does *not* deal well with trying to plot scatter plots involving a few billion points >.>
23:12:04 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Remote host closed the connection)
23:12:52 × gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Quit: Leaving)
23:14:27 <dolio> Although strictly speaking, the right hand column could benefit from being wider if the long flag didn't take up so much space on the left hand. But I think it would really just be better not beinig a table.
23:14:57 fosterite joins (~fosterite@2600:6c46:7800:fecf:8018:3f0e:7ad8:4be9)
23:15:39 usr25 joins (~usr25@unaffiliated/usr25)
23:16:09 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds)
23:17:24 × Tario quits (~Tario@201.192.165.173) (Ping timeout: 246 seconds)
23:20:56 × mirrorbird quits (~psutcliff@2a00:801:44d:603d:d116:d5a1:4a2f:a08f) (Quit: Leaving)
23:24:16 × pera quits (~pera@unaffiliated/pera) (Ping timeout: 240 seconds)
23:24:26 <monochrom> Is Chart written in Haskell? That may be why...
23:24:49 <merijn> monochrom: It is, then again, matplotlib doesn't act any more graceful
23:26:37 × dunj3 quits (~dunj3@p200300f61714a6752268fca81a1a85c0.dip0.t-ipconnect.de) (Remote host closed the connection)
23:27:24 × ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Remote host closed the connection)
23:28:23 ep1ctetus joins (~epictetus@ip72-194-215-136.sb.sd.cox.net)
23:28:45 <Tordek> so, I have this: https://paste.tomsmeding.com/xodHLX3D; 2 questions: 1. can a "Device" monad be extracted so that instead of "Device (Write 1) (\busState -> foo" I can do "busState <- tick (Write 1)"?
23:29:46 <Tordek> and 2: some Devices would need IO, is there an easy way to convert "BusState -> Device" into "BusState-> IO Device"?
23:30:01 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
23:30:40 olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber)
23:31:51 tromp joins (~tromp@dhcp-077-249-230-040.chello.nl)
23:32:14 <monochrom> My finger memory is broken. I tried to type "chmod", I kept typing "ghcmod".
23:33:40 <dolio> The true danger of using IDE tools.
23:34:06 <monochrom> No, I never used ghcmod.
23:34:13 Tario joins (~Tario@200.119.185.160)
23:34:39 <monochrom> Instead, I always used ghc, and my brain decided "you typed 'ch', surely you mean 'ghc', let me correct that for you..."
23:34:53 <monochrom> So, the true danger of not using IDE tools haha.
23:35:25 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds)
23:35:57 <MarcelineVQ> ghroot
23:36:41 <ski> (i've noticed i've typoed "typo" as "type", at times)
23:36:54 × tromp quits (~tromp@dhcp-077-249-230-040.chello.nl) (Ping timeout: 260 seconds)
23:36:58 <monochrom> dependent typo \∩/
23:37:16 <ski> that would be the other way around :)
23:37:27 <divVerent> I am ghroot
23:38:06 <divVerent> Typoing the word "typo" is worthy of a Haskell programmer
23:40:02 bbear joins (~znc@21212.s.t4vps.eu)
23:41:16 <bbear> Hello, can you help me ? http://pastie.org/p/4gxzEMMmV01kkmWJCO2Rjn
23:42:10 <ski> apply the suggested fix
23:42:19 <hyiltiz> bbear: it seems it is saying it clearly
23:42:39 <hyiltiz> i.e. you are saying u can always Prelude.+ anything (anything <=> forall.a)
23:42:48 <bbear> I don't understand context
23:42:58 <hyiltiz> but you actually wanted to make sure it is at least a number
23:43:01 <ski> you have an explicit type signature for `sum0', yes ?
23:43:05 × loli quits (~loli@024-171-017-003.res.spectrum.com) (Quit: WeeChat 3.0)
23:43:08 <monochrom> "context" means listing out the type classes you need
23:43:14 <bbear> I have sum0 :: [a] -> a
23:43:30 <hyiltiz> tell it that a is a number
23:43:37 <bbear> Prelude.Num a
23:43:39 <bbear> ha yes
23:43:39 <hyiltiz> [Int] -> Int should work
23:43:52 <hyiltiz> or give the context properly
23:43:59 <bbear> I did sum0 :: Prelude.Num a => [a] -> a
23:44:01 <bbear> it worked
23:44:03 <ski> bbear : that signature promises to work for *all* types `a'. but your implementation only works when `a' is a numeric type (since it uses `0' and `+' for that type)
23:44:04 <hyiltiz> yup :p
23:44:11 <bbear> thanks
23:44:29 <hyiltiz> now generalize that code for monoids :D
23:44:37 <ski> by adding that type class constraint to the signature, you're only promising to work for all types `a', that happen to be instances of `Prelude.Num'
23:45:41 <bbear> sum0 :: (Prelude.Num a, Prelude.Foldable t) => t a -> a ?
23:45:44 Mrbuck joins (~Mrbuck@gateway/tor-sasl/mrbuck)
23:46:00 <ski> no, that's not what hyiltiz had in mind
23:46:32 <ski> > getSum (mconcat [Sum n | n <- [2,3,5,7]])
23:46:34 <lambdabot> 17
23:46:48 <bbear> sorry I have to sleep
23:46:56 <bbear> will be back for monoids
23:47:15 ski . o O ( "Monoids? In my programming language?" )
23:47:18 loli joins (~loli@024-171-017-003.res.spectrum.com)
23:47:19 <Mrbuck> No please practise without sleeping
23:47:55 <monochrom> Yeah monoid is a long story for another day.
23:48:09 × polyrain quits (~polyrain@2001:8003:e4d8:4101:d1d2:4fc1:88fa:56) (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:49:05 <ski> @quote associate.with
23:49:05 <lambdabot> cmccann says: < cmccann> shachaf: nobody will associate with someone who breaks the monoid laws! < shachaf> cmccann: That's why I go by a secret identity.
23:50:26 × acidjnk_new quits (~acidjnk@p200300d0c7390972b9ca7ed3a5659a38.dip0.t-ipconnect.de) (Ping timeout: 240 seconds)
23:51:28 <monochrom> hahaha
23:56:47 Kaiepi joins (~Kaiepi@47.54.252.148)
23:57:04 slack1256 joins (~slack1256@dvc-186-186-101-190.movil.vtr.net)
23:58:56 × Tario quits (~Tario@200.119.185.160) (Read error: Connection reset by peer)
23:59:39 alx741 joins (~alx741@186.178.109.47)
23:59:46 Tario joins (~Tario@201.192.165.173)

All times are in UTC on 2021-02-20.