Home liberachat/#haskell: Logs Calendar

Logs on 2021-11-26 (liberachat/#haskell)

00:04:49 <Axman6> All the best Haskellers are
00:04:56 × sayola quits (~vekto@dslb-002-201-085-156.002.201.pools.vodafone-ip.de) (Ping timeout: 245 seconds)
00:05:13 <hpc> can confirm, am not an aussie :P
00:08:44 <Axman6> (Or British, obviously)
00:10:17 <hpc> reverse aussie
00:11:40 <Axman6> Where the ciminals come from
00:14:22 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
00:25:13 sayola joins (~vekto@dslb-092-072-095-186.092.072.pools.vodafone-ip.de)
00:30:25 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
00:30:25 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
00:30:25 wroathe joins (~wroathe@user/wroathe)
00:30:30 × sm2n quits (~sm2n@user/sm2n) (Ping timeout: 265 seconds)
00:30:47 sm2n joins (~sm2n@user/sm2n)
00:30:48 × DNH quits (~DNH@2a02:8108:1100:16d8:a418:17da:6b4f:5fc3) (Quit: My MacBook has gone to sleep. ZZZzzz…)
00:34:02 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Read error: Connection reset by peer)
00:35:20 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds)
00:35:22 <monochrom> dons is probably from Australia too. Certainly went to a university there.
00:35:34 <Axman6> yeah I believe so
00:35:42 × zincy_ quits (~zincy@host86-181-60-139.range86-181.btcentralplus.com) (Remote host closed the connection)
00:35:53 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
00:36:21 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
00:37:45 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:d837:dc58:2ea7:10e8) (Remote host closed the connection)
00:37:59 Skyfire joins (~pyon@user/pyon)
00:39:19 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:d837:dc58:2ea7:10e8)
00:44:24 × mreh quits (~matthew@host81-157-195-163.range81-157.btcentralplus.com) (Quit: Lost terminal)
00:44:53 DNH joins (~DNH@2a02:8108:1100:16d8:4d2d:d973:9795:262a)
00:46:43 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
00:46:43 × mmhat quits (~mmh@55d42d28.access.ecotel.net) (Read error: Connection reset by peer)
00:47:58 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
00:48:06 × acidjnk_new quits (~acidjnk@p200300d0c7271e128015eb8f81d9ba9d.dip0.t-ipconnect.de) (Ping timeout: 260 seconds)
00:49:03 <arahael> nice. so i have a chance... eventually...
00:49:10 <arahael> slim chance.
00:49:55 <jackdk> the aussie haskell meetups have been a bit quiet of late, but there's still some chatter on fp-syd
00:52:41 × betelgeuse quits (~betelgeus@94-225-47-8.access.telenet.be) (Remote host closed the connection)
00:55:34 × zava quits (~zava@ip5f5bdf0f.dynamic.kabel-deutschland.de) (Quit: WeeChat 3.3)
00:57:45 <arahael> is that on slack?
00:58:24 <arahael> unfortunately i find meetups in person difficult.
00:58:57 mvk joins (~mvk@2607:fea8:5cc1:fa00::4702)
00:59:06 × CiaoSen quits (~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
01:00:15 <EvanR> yeah accessing meetups in australia is challenging, it's an island after all
01:01:03 <arahael> i live on that island. the island is the size of the USA, though.
01:01:31 <dsal> I've been there once. I saw a wallaby
01:01:47 <arahael> but my challenge is that organising interpreters basically cost anywhere betweem $120 to $240 an hour... unless i rely on voice to text apps which are also exhausting.
01:02:16 <monochrom> Ugh it's large enough to be called a continent!
01:02:38 <arahael> it is a continent!
01:02:44 <arahael> it's an island continent.
01:02:53 <EvanR> you could also say it's the size of pluto... but not sure if that is helping or hurting
01:02:59 <monochrom> Ugh tautologically every continent is an island continent...
01:03:29 <monochrom> OK nevermind.
01:03:45 <arahael> :P
01:04:53 <EvanR> this island earth
01:05:29 <dsal> Wadler's Law question: What's the difference between syntax and lexical syntax?
01:05:42 <hpc> how frequently it's discussed
01:06:04 × ystael quits (~ystael@user/ystael) (Quit: Lost terminal)
01:06:04 <dsal> haha
01:06:04 <EvanR> in the old days people distinguished lexers and parsers
01:06:15 <EvanR> in the dark times before monads
01:06:22 <monochrom> I feel that that question will cause expoentially more arguments than just arguing over a particular language's syntax... >:)
01:06:23 <hpc> a lexer splits a string into a stream of tokens
01:06:35 <hpc> a parser turns a stream of tokens into an AST
01:06:45 × jmorris quits (uid433911@id-433911.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
01:07:00 <monochrom> We still separate Alex from Happy.
01:07:02 <dsal> I just don't quite understand what this was referring to in the 90s.
01:07:08 <dsal> Why can't Alex be Happy?
01:07:28 <EvanR> lexers allowed the use of regex
01:07:32 <EvanR> so it was cool
01:07:39 <dsal> Oh *that* syntax?
01:07:44 <monochrom> Alex thought that conquering Persia would make him happy.
01:07:51 <dsal> I used lex back in the day, but never yacc.
01:08:48 <hpc> you didn't have parser combinators, and nobody wanted to implement a parsing system that could do tokenization in a nice composable way
01:09:02 <hpc> so instead they applied the universal solution to difficult parsing problems - add another pass
01:09:03 <EvanR> i blame regex for why anyone who works in a boring coding job hates coding
01:09:22 <dsal> I avoid regex pretty hard.
01:09:27 <dsal> Possibly too hard, but I doubt it.
01:09:52 <hpc> regexes have an undesereved reputation of being difficult
01:10:12 <hpc> people can't handle backslashes apparently
01:10:13 <geekosaur> well, in the really old days, it was so lexing and parsing could fit in the same process address space
01:10:22 <hpc> (like lisp with parens :P)
01:10:30 <geekosaur> but this didn't apply to haskell; by then it was just habit
01:10:36 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
01:11:17 × machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 250 seconds)
01:11:19 <hpc> from the perspective of computational complexity, regexes are extremely simple even
01:11:36 <hpc> regexes are just a particular way of representing a finite state machine
01:11:43 <geekosaur> also, as I read this, lexical syntax meant bird tracks
01:11:44 <EvanR> great example of how humans and computers differ
01:12:15 <monochrom> I like having a tokenization stage that eliminates the difference between "f (x)" and "f(x)".
01:12:41 <EvanR> how does that work
01:12:47 <dsal> The naming argument is dumb, but the forest-for-trees part I hope got through a bit is that they're so focused on naming "things" that they completely avoid naming patterns and algorithms. Let's have big walls of code marching off to the right in case statements but start a fight if I point out that all of that is just doing "doThisOrFailTheTest", so why don't we just name that *idea* and move on.
01:12:49 <jackdk> arahael: there is a slack. I don't know if their meetups are in-person or online, they've had to do both at different stages for pandemic-related reasons
01:12:56 <EvanR> without totally parsing everything in the process
01:13:14 × DNH quits (~DNH@2a02:8108:1100:16d8:4d2d:d973:9795:262a) (Quit: Textual IRC Client: www.textualapp.com)
01:13:24 <hpc> EvanR: both can lex to ["f", "(", "x", ")"]
01:13:36 <monochrom> Not sure what you mean by "totally parsing".
01:13:44 <EvanR> only if space is always irrelevant?
01:13:49 <hpc> you don't need to balance parens or anything like that
01:14:04 <EvanR> space doesn't matter in some parts of haskell but does in others
01:14:04 <hpc> it would just as easily lex "f )x("
01:14:18 <monochrom> Tokenization has to go through all of the input, yes. But only streamingly.
01:14:25 <dsal> I like the look of `f )x(`
01:14:32 <monochrom> Tokenization does not have to be smart, no.
01:14:33 <hpc> EvanR: yeah, you'd write a specific lexer for what you need
01:14:34 <dsal> Looks neat in my font. Gonna build a parser.
01:14:40 <hpc> like you write a specific parser :P
01:14:53 <hpc> dsal: just swap the glyphs
01:15:11 <dsal> Oh yeah. Do it in the font. That's lazy thinking.
01:15:12 <hpc> make a font instead
01:15:21 × alx741 quits (~alx741@186.178.108.193) (Ping timeout: 245 seconds)
01:15:39 <monochrom> It just has to recognize token boundaries and classify tokens and report that the token stream is: identifier f, open paren, identifier x, close paren.
01:15:42 <dsal> Why even create a language if it doesn't need its own font?
01:16:10 <dsal> Are there modern lexers that can care about unicode classes?
01:16:12 <hpc> it doesn't even have to say f is an identifier
01:16:14 <geekosaur> go back to agda? :þ
01:16:22 <hpc> it just needs to know it's a lettery word of some sort
01:16:27 <EvanR> agda does not like this idea lol
01:16:28 <hpc> maybe it's a keyword
01:16:33 <monochrom> Your CFG grammar then does not have to say "whitespace*" 200 times.
01:16:36 <hpc> maybe it's not a keyword in this particular context :D
01:16:42 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
01:16:46 <monochrom> Unlike, for example, the XML grammar.
01:16:51 <dsal> Collection of different types of whitespaces.
01:17:34 <EvanR> now I'm not sure where whitespace matters or not... "a-b" "f -x"...
01:17:46 <monochrom> For better or worse, due to self-perpetuating education or otherwise, it's also intuitive.
01:17:47 <hpc> EvanR: depends on the language
01:18:01 <dsal> a-b is just another symbol in some languages.
01:18:45 <dsal> And then agda's special _ thing.
01:18:57 <dsal> One thing I've learned is that everything I know is wrong.
01:18:57 <EvanR> wut
01:19:03 <hpc> agda's operator parsing is neat, but very simple lexing-wise
01:19:14 <monochrom> Because when teaching a student the syntax of Haskell for example, I just have to say "an expression can be identifier, +, identifier". I don't have to say where there can be optional spaces. And the students alreeady knows.
01:19:20 <hpc> infix operators always have whitespace between them
01:20:23 <EvanR> 2 ^ x
01:21:05 <dsal> I was going to ask how much pain it'd be to get Haskell using λ for lambda because surely nobody uses that as a variable, then I realize I do that.
01:21:32 <geekosaur> didn't we already find a math-operator lambda instead of the Greek lowercase letter?
01:21:34 <EvanR> why not use a different color for variables
01:22:01 <dsal> I was briefly surprised that there's more than one λ
01:22:03 <monochrom> hpc: It is customary and nice for most languages for the tokenizer to right away classify identifiers vs reserved words.
01:22:34 <monochrom> However, you would be right about PL/I, in which "if if==0 then then=1 else else=if" can make sense.
01:22:35 <dsal> That's what I need. `λ λ -> λ` but with a different λ for the first λ obviously.
01:23:21 <EvanR> blue for types, red for values, or something
01:23:27 <monochrom> which is a snark way to say: ugh, please don't do that, please classify identifiers vs reserved words ASAP.
01:23:35 <hpc> > let as = [1..] in as
01:23:36 <lambdabot> [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,...
01:23:42 <hpc> i was thinking of haskell specifically
01:23:47 <hpc> "as" is a keyword
01:23:48 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
01:23:56 <monochrom> No.
01:24:18 <hpc> yes? it's part of import syntax
01:24:29 <monochrom> And yet unreserved.
01:24:38 <hpc> i didn't say reserved :P
01:24:54 <EvanR> import qualified As (as) as As
01:25:11 <monochrom> Damn you.
01:25:30 <dsal> Where does "as" go in that import?
01:25:30 <hpc> unless you want to explain in your parser that yes, import syntax uses a specific identifier in the middle of it for magical purposes
01:25:41 <hpc> EvanR: <3
01:26:08 <hpc> you're missing something though
01:26:37 <hpc> this needs data As, with constructor As
01:26:49 <dsal> import qualified "as" As (As(as)) as As
01:26:56 <arahael> jackdk: yeah. aussies seem to prefer in person or video meetings. both which i find less accessible.
01:27:04 <EvanR> well capital As is a bit weak
01:27:19 <monochrom> Oh hey "hiding" is unreserved too, let's do it!
01:27:21 <dsal> It's not bad (at being bad) if you read it aloud.
01:28:04 <dsal> import qualified "qualified" Qualified (As(qualified)) as Qualified
01:28:19 <EvanR> > let qualified = hiding; hiding = qualified; as = as in []
01:28:20 <lambdabot> []
01:28:45 <EvanR> > let import = qualified in []
01:28:46 <lambdabot> <hint>:1:5: error: parse error on input ‘import’
01:28:49 <EvanR> oooo
01:28:54 <hpc> that's a shame
01:29:08 <hpc> i really wanted "from future import __something__" to be a valid haskell expression
01:29:11 <monochrom> I guess you all prefer PI/I haha
01:29:19 <geekosaur> import pretty much has to be a reserved word for the rest to not be
01:29:46 <hpc> geekosaur: nope, you can say top-level expressions aren't allowed, and nested imports aren't allowed
01:29:58 <hpc> and in import syntax, '=' only occurs inside parens
01:30:02 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
01:30:05 <hpc> totally unambiguous!
01:30:12 <hpc> nothing could be simpler!
01:30:16 <monochrom> Yeah if there is no "=" then it's an import clause. If there is "=" then it's a definition clause.
01:30:41 <EvanR> the poor implementors of the language
01:31:16 <EvanR> when will AI be able to do that job
01:31:23 lbseale joins (~ep1ctetus@user/ep1ctetus)
01:31:44 <monochrom> The additional benefit is that now Alex and Happy cannot help you parse Haskell, so you really have to use a monad parser combinator library.
01:32:55 <janus> my dad just threw away his PL/I book :(
01:35:47 × lbseale quits (~ep1ctetus@user/ep1ctetus) (Ping timeout: 250 seconds)
01:37:34 smaris joins (~smaris@cpe-75-82-50-132.socal.res.rr.com)
01:40:09 Cajun joins (~Cajun@user/cajun)
01:42:46 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
01:42:46 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
01:42:46 wroathe joins (~wroathe@user/wroathe)
01:45:22 × dolio quits (~dolio@130.44.130.54) (Quit: ZNC 1.8.2 - https://znc.in)
01:48:31 dolio joins (~dolio@130.44.130.54)
01:52:51 × smaris quits (~smaris@cpe-75-82-50-132.socal.res.rr.com) (Ping timeout: 245 seconds)
01:54:27 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
01:58:04 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
01:58:49 alx741 joins (~alx741@186.178.109.84)
02:07:39 × JimL quits (~quassel@89-162-2-132.fiber.signal.no) (Ping timeout: 260 seconds)
02:18:14 × alx741 quits (~alx741@186.178.109.84) (Ping timeout: 260 seconds)
02:22:52 × epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
02:23:32 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
02:25:02 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
02:25:46 pfurla joins (~pfurla@2804:14d:5c81:4104:8d6b:77ca:adc:64ea)
02:26:18 <remexre> where does resource management live in fused-effects these days? sounds like they were moving it to -exceptions, but I don't see it there
02:31:03 alx741 joins (~alx741@186.178.109.84)
02:38:32 × neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 240 seconds)
02:38:57 × xff0x quits (~xff0x@2001:1a81:5377:a800:3eaf:ed99:f02b:b5f2) (Ping timeout: 268 seconds)
02:40:15 xff0x joins (~xff0x@2001:1a81:53bb:9600:6878:c21:1339:de41)
02:41:01 × burnsidesLlama quits (~burnsides@dhcp168-032.wadham.ox.ac.uk) (Remote host closed the connection)
02:41:32 burnsidesLlama joins (~burnsides@dhcp168-032.wadham.ox.ac.uk)
02:42:03 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
02:43:04 smaris joins (~smaris@cpe-75-82-50-132.socal.res.rr.com)
02:43:23 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
02:45:46 × burnsidesLlama quits (~burnsides@dhcp168-032.wadham.ox.ac.uk) (Ping timeout: 245 seconds)
02:46:42 dyeplexer joins (~dyeplexer@user/dyeplexer)
02:49:28 × zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!)
02:52:14 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
03:00:26 × EvanR quits (~evan@user/evanr) (Quit: Leaving)
03:01:35 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
03:01:36 × benin quits (~benin@183.82.179.164) (Ping timeout: 245 seconds)
03:02:02 benin joins (~benin@183.82.179.164)
03:02:51 × ubert quits (~Thunderbi@p200300ecdf0ba227e6b318fffe838f33.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
03:03:09 ubert joins (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de)
03:07:01 × zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection)
03:08:14 zaquest joins (~notzaques@5.130.79.72)
03:09:11 × curiousgay quits (~curiousga@77-120-141-90.kha.volia.net) (Quit: Leaving)
03:14:15 × ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 276 seconds)
03:19:14 myShoggoth joins (~myShoggot@97-120-85-195.ptld.qwest.net)
03:20:59 × myShoggoth quits (~myShoggot@97-120-85-195.ptld.qwest.net) (Client Quit)
03:24:12 × td_ quits (~td@94.134.91.22) (Ping timeout: 256 seconds)
03:26:09 td_ joins (~td@94.134.91.33)
03:33:49 whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com)
03:34:56 mbuf joins (~Shakthi@171.61.241.63)
03:38:49 × bollu quits (uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
03:48:34 kupi joins (uid212005@id-212005.hampstead.irccloud.com)
03:54:03 × renzhi quits (~xp@2607:fa49:6500:b100::5cef) (Ping timeout: 260 seconds)
03:54:05 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
03:54:05 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
03:54:05 wroathe joins (~wroathe@user/wroathe)
03:54:45 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
03:59:07 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
04:03:50 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
04:07:33 × pfurla quits (~pfurla@2804:14d:5c81:4104:8d6b:77ca:adc:64ea) (Quit: gone to sleep. ZZZzzz…)
04:08:12 hatchet joins (~hatchet@2601:448:4280:330:c0d:94db:7b6:5658)
04:09:16 pfurla joins (~pfurla@2804:14d:5c81:4104:8d6b:77ca:adc:64ea)
04:12:22 <hatchet> Hello everyone. I'm new to Haskell, trying to teach myself by implementing ERC20. Is there some sort of idiom for code that looks like this
04:12:23 <hatchet> ```haskell
04:12:23 <hatchet>    do
04:12:24 <hatchet>         state <- exec (mint alice 5) context state
04:12:24 <hatchet>         state <- exec (mint bob 10) context state
04:12:25 <hatchet>         state <- exec (balanceOf alice) context state
04:12:25 <hatchet>         state <- exec (balanceOf bob) context state
04:12:26 <hatchet>         return ()
04:12:26 <hatchet> ```
04:12:32 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
04:13:22 <hatchet> Ignore the code fences, I was hoping markdown syntax worked :(
04:13:32 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
04:14:30 <dsal> It works for me.
04:15:06 <hatchet> Oh, well I'm using a web irc client. I obviously don't use IRC much
04:15:15 <dsal> What is `exec`? You wouldn't restart the state every time.
04:16:05 <hatchet> It's a function that takes a partial function, a context, and a state,  returns `IO State`
04:16:15 <hatchet> `exec :: Show a => (EnvironmentInput -> ExecutionResult a) -> Context -> State -> IO State`
04:16:20 <dsal> I suspect it's not a partial function.
04:16:25 × smaris quits (~smaris@cpe-75-82-50-132.socal.res.rr.com) (Quit: WeeChat 3.3)
04:16:50 <hatchet> I wrote exec, idk, maybe I made some mistaek
04:16:52 <hatchet> mistake
04:17:11 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Ping timeout: 250 seconds)
04:17:26 <dsal> I'd want to write something like `something $ do { mint alice 5; mint bob 10; balanceOf alice, balanceOf bob }`
04:17:36 <hatchet> https://gist.github.com/encody/0c8f57b69186c7edb00788c9a8c7b63b
04:18:32 <hatchet> relevant section at the bottom
04:20:07 <dsal> There's a lot going on here.
04:20:15 <hatchet> Yeah, my first intuition was to create a list of partial functions and execute those using a fold of some sort, since they all have very similar signatures, but since they can return slightly different things the compiler got mad at me and wouldn't let me
04:20:33 <dsal> The most direct translation would be `exec (mint alice 5) context state >>= exec (mint bob 10) context >>= exec (balanceOf alice) context >>= exec (balanceOf bob) context`
04:20:56 <hatchet> I'd never written any haskell 24 hours ago lol
04:20:58 <dsal> I don't think partial function means what you think partial function means.
04:21:05 <hatchet> darn it
04:21:09 <dsal> OK, then yeah, this isn't at all how any of this should be written. heh
04:21:49 <hatchet> Partially executed function? Like where it takes 2 arguments but you only give it one and save it for later
04:21:57 <dsal> partially applied function.
04:22:05 <hatchet> yeah that
04:22:08 <dsal> A partial function is a function that is undefined for some inputs.
04:22:17 <dsal> > 3 `div` 0
04:22:18 <lambdabot> *Exception: divide by zero
04:22:26 <dsal> > head []
04:22:27 <lambdabot> *Exception: Prelude.head: empty list
04:22:33 <hatchet> Sorry my terminology is gonna be fudgy
04:22:36 <dsal> Partial functions are bad.
04:23:26 <hatchet> Anyways, I was thinking that the `>>=` operator would be useful here, just couldn't quite figure it out
04:23:44 <dsal> You might try stylish-haskell to clean things up a bit. This code's a bit hard to follow for a couple reasons. But one of them is it's not clear what you're trying to do.
04:23:53 <dsal> I think you're trying to create State monad, but that's generally not a day one thing.
04:24:26 <dsal> Oh, gist had rendered this poorly. heh
04:24:48 <dsal> It's a weird style, but it was showing up in my browser with like, no indentation.
04:25:17 <hatchet> oh weird. I'm writing in VS Code and I just installed the Haskell extension pack which apparently came with a formatter. Just using that
04:25:55 <hatchet> I'm trying to rewrite this in haskell: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol
04:26:37 × aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net)
04:26:39 <hatchet> So far the only things that actually work are the balanceOf and transfer functions
04:26:58 aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net)
04:27:01 <dsal> The formatter looks like ormolu or something. Not my favorite. I don't know why people like having one word per line.
04:27:44 <hatchet> Can't say I have much of an opinion on style yet. The only functional programming language I've used before is Ocaml, and that was only in undergrad
04:29:21 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
04:29:43 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
04:30:48 <dsal> Well. Starting from the middle won't be a super efficient strategy, but you might look into the State monad. It looks like you're approximately aiming for that.
04:32:31 <dsal> It looks like this:
04:32:31 <dsal> > flip evalState 3 $ do { modify (* 11) ; get }
04:32:33 <lambdabot> 33
04:32:44 EvanR joins (~evan@user/evanr)
04:33:21 <Axman6> hatchet: is feels very much like you want the StateT monad transformer (and probably ReaderT, so might as well go with a full RWST Context () State IO)
04:33:26 <dsal> > flip evalState 3 $ do { original <- get; modify (* 11) ; modify (+ 100); final <- get; pure (original, final) }
04:33:27 <lambdabot> (3,133)
04:34:15 <dsal> Seems like starting day one with StateT is… inefficient. heh
04:34:19 <Axman6> if you ever find yourself passing around some sort of state to update, particularly monadically, then StateT is probably going to lead to much cleaner code, and means you can't accidentally makes a new state and then forget to use it and end up using an old state
04:34:26 <Axman6> v.hard to debug
04:34:41 <Axman6> @hoogle StateT
04:34:41 <lambdabot> Control.Monad.Trans.State.Lazy newtype StateT s m a
04:34:41 <lambdabot> Control.Monad.Trans.State.Lazy StateT :: (s -> m (a, s)) -> StateT s m a
04:34:41 <lambdabot> Control.Monad.Trans.State.Strict newtype StateT s m a
04:35:33 <hatchet> Okay, this sounds like great stuff to read up on. Thus far the documentation has been... unforgiving? to someone who isn't comfortable with the syntax yet. Any pointers for slightly more friendly intros to these things?
04:35:34 <dsal> We can go full weird.
04:35:35 <dsal> > flip execState (2,4) $ do { _1 += 11; _2 *= 6 }
04:35:36 <lambdabot> (13,24)
04:35:55 <dsal> hatchet: It's really easy if you learn in a more constructive order.
04:36:03 <dsal> The documentation is pretty good once you have a foundation.
04:36:49 <dsal> But if you start learning music by grabbing some orchestral sheet music on day one, you're gonna be a bit lost.
04:37:24 <hatchet> Ok, cool. I read a bunch of this http://learnyouahaskell.com/ and watched most of these videos https://www.youtube.com/channel/UC3xdLFFsqG701QAyGJIPT1g/videos
04:38:03 <dsal> Neat, I've never seen that video set.
04:38:03 <hatchet> For now I think I want to focus more on basic syntax tho (like figuring out exactly when and how to use `>>=` like above)
04:38:20 <EvanR> call me nuts but I still think this is a good crash course https://www.haskell.org/tutorial/
04:38:23 <dsal> Yeah, that's why starting from the beginning makes things a bit easier.
04:38:35 <EvanR> i.e. A gentle introduction
04:41:07 <hatchet> the gentle introduction has come up a bunch in my ddg searches
04:41:29 <dsal> hatchet: Well, I would definitely not write that. It seems pretty weird. I think that's just StateT that you want there.
04:42:02 <dsal> I still like haskellbook.com -- but I read intro stuff all the time and always learn something new.
04:44:18 <hatchet> Thanks for all the recommendations!
04:46:25 <dsal> It's nice because it starts with nothing and then you build all the stuff you need to use. Some people think it's too slow. I keep seeing people try to go faster and getting really frustrated because they want to start on step 19.
04:47:10 <jackdk> I literally ground through the haskell book beginning-to-end and found that worked very well for me.
04:47:48 <hatchet> I did a similar thing when I learned Rust, just read through the entire book in like 3 days
04:47:49 RobotMicrowave joins (~user@2804:d41:c2b2:be00:2926:cba1:14b8:da8b)
04:48:03 <hatchet> I'll give it a shot!
04:48:16 <EvanR> reading is cool but
04:48:19 <dsal> jackdk: Yeah, especially as a quite experienced programmer, I found it helped sort of flush the unhelpful baggage.
04:48:27 × jlamothe quits (~jlamothe@198.251.61.229) (Ping timeout: 268 seconds)
04:48:32 <EvanR> pales in comparison to how much writing you will need to do xD
04:48:46 <dsal> Ha. Yeah. The Book basically has you invent everything along the way.
04:49:01 <RobotMicrowave> what book?
04:49:01 <jackdk> It then took me a while to learn how to actually structure an application... I was fortunate enough to join a project with an established codebase and learn off that
04:49:02 <EvanR> kind of like, you want to speak a language, but you just read about it a lot xD
04:49:06 <dsal> RobotMicrowave: haskellbook.com
04:49:15 <RobotMicrowave> oh no
04:50:08 <RobotMicrowave> this book big
04:50:14 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
04:50:31 <RobotMicrowave> and pricy, 60 dollars is just too much for me :(
04:50:34 <dsal> jackdk: I was mostly just building my own apps. But you see the blub bubble rise. Like, start out passing everything around and thinking these dumb ReaderT things are overkill. Then one day you get it.
04:50:54 <EvanR> ReaderT is a good one
04:50:55 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
04:51:04 <jackdk> that feeling of "ok, so that's why THEY invented THAT" is very satisfying
04:51:06 <dsal> RobotMicrowave: There are other resources. I just found that one to be quite good and was completely worth it to me.
04:51:20 <dsal> jackdk: I love doing that several months later. heh
04:51:41 <jackdk> I had a similar moment when I finally understood that lens operators were not chosen at random
04:51:43 <dsal> How often I'm like, "WTF... why would anyone ever need this?" [several months later] "Ugh, I wish I had a way to... wait a second"
04:52:38 <jackdk> It's often useful to learn what a bunch of stuff is and what it's for, but defer the details until you hit the problem that it solves
04:53:13 <RobotMicrowave> I try to learn by reading the docs, it's not very helpful, but it's very fun
04:54:19 <dsal> RobotMicrowave: Haskell docs are generally just references. You won't learn lens or recursion-schemes by reading haddock. :)
04:57:26 <RobotMicrowave> dsal: sad
04:57:27 × slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving)
04:57:57 <dsal> Good instructional material and good references are often very different.
04:57:59 <dsal> > flip execState (2,4) $ do { _1 += 11; _2 *= 6; modify (over each (^2)) }
04:58:01 <lambdabot> (169,576)
04:58:05 <dsal> wheee
04:58:49 <dsal> > flip execState (2,4) $ do { _1 += 11; _2 *= 6; modify (over each (2^)) }
04:58:50 <lambdabot> (8192,16777216)
04:59:32 <RobotMicrowave> dsal: I've learned most of my c++ with the docs and a debugger
05:00:01 <RobotMicrowave> But of couse i got some theory to back this up
05:00:23 <RobotMicrowave> by reading random articles
05:01:28 <monochrom> I doubt that there is any online free doc that teaches "concept", the latest addition to C++, properly.
05:01:32 <EvanR> random article U my alma mater
05:01:37 <dsal> hahaha
05:01:58 <hatchet> how i learned web dev fr
05:02:27 <RobotMicrowave> hatchet: web dev is a hoax, just glue things together
05:02:38 <EvanR> when haskell docs are good, they are very good
05:03:07 <RobotMicrowave> monochrom: cppreference can helpe you a lot, but it would be good to read the PR
05:04:44 <monochrom> That's what I tried. No.
05:04:51 <monochrom> Either that or I'm dense.
05:06:47 <RobotMicrowave> monochrom: I'm really dumb, so I take 2 months to understand this kind of stuff
05:07:08 <dsal> It sounds like you're just doing things inefficiently.
05:07:24 <RobotMicrowave> dsal: pretty much
05:07:50 <RobotMicrowave> this and I'm pretty dumb, like, a lot
05:07:56 <dsal> Trying to understand the universe by seeing tiny bits here and there will take a very long time and probably won't work super well.
05:08:13 <RobotMicrowave> dsal: I try my best
05:10:39 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
05:10:39 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
05:10:39 wroathe joins (~wroathe@user/wroathe)
05:14:59 RobotMicrowave parts (~user@2804:d41:c2b2:be00:2926:cba1:14b8:da8b) (ERC 5.4.1 (IRC client for GNU Emacs 27.2))
05:16:13 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
05:17:44 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
05:18:14 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Client Quit)
05:24:41 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
05:26:09 × monochrom quits (trebla@216.138.220.146) (Quit: NO CARRIER)
05:26:19 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
05:31:05 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Ping timeout: 250 seconds)
05:33:42 reumeth joins (~reumeth@user/reumeth)
05:34:42 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
05:38:29 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
05:39:25 × hatchet quits (~hatchet@2601:448:4280:330:c0d:94db:7b6:5658) (Quit: Client closed)
05:39:38 jlamothe joins (~jlamothe@198.251.61.229)
05:40:30 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
05:40:49 × reumeth quits (~reumeth@user/reumeth) (Ping timeout: 250 seconds)
05:46:52 <EvanR> if you grind through something slow and inefficiently, that may end up being valuable later on
05:47:10 <EvanR> worst case, as a red flag of what not to do xD
05:49:44 emf joins (~emf@2620:10d:c090:400::5:4c86)
05:50:55 <sm> @where htac , hatchet
05:50:55 <lambdabot> "Haskell Tutorial and Cookbook" by Mark Watson in 2017-09-04 at <https://leanpub.com/haskell-cookbook>
05:51:12 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
05:51:12 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
05:51:12 wroathe joins (~wroathe@user/wroathe)
05:53:31 <dsal> EvanR: I hit it from all angles. Had code I'd written and was using over long periods of time, started HPFFP, did some exercisms and AoC, read other books, played around with various other projects, then eventually just started doing everything all at once.
05:53:35 deadmarshal joins (~deadmarsh@95.38.116.172)
05:55:45 <EvanR> I had the benefit of doing the scheme book in school, so at least I knew what a pure function was.
05:55:57 <EvanR> the rest follows from there
05:56:10 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
05:56:47 <EvanR> there's also a bit of laziness in there, so that wasn't super alien
05:56:52 <dsal> I programmed in ocaml a couple of decades ago. Had good times there.
05:57:39 <EvanR> but haskell was definitely a step up on the tech level from anything I saw before
05:57:51 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 245 seconds)
05:58:07 <EvanR> which then opened the door to other things
06:00:26 deadmarshal joins (~deadmarsh@95.38.116.172)
06:08:34 lavaman joins (~lavaman@98.38.249.169)
06:08:41 × son0p quits (~ff@181.136.122.143) (Ping timeout: 245 seconds)
06:08:48 takuan joins (~takuan@178-116-218-225.access.telenet.be)
06:09:58 <Axman6> I wonder how hard it would be to add a transformation to hlint for foo <$> pure a <*> pure b <*> someApplicativeThing <*> pure c ==> (\x -> foo a b x c) <$> someApplicativeThing, but for arbitrary number of actions
06:14:32 monochrom joins (trebla@216.138.220.146)
06:14:52 × pfurla quits (~pfurla@2804:14d:5c81:4104:8d6b:77ca:adc:64ea) (Quit: gone to sleep. ZZZzzz…)
06:15:12 × m1dnight_ quits (~christoph@christophe.dev) (Quit: WeeChat 3.1)
06:16:44 m1dnight joins (~christoph@christophe.dev)
06:24:47 × xff0x quits (~xff0x@2001:1a81:53bb:9600:6878:c21:1339:de41) (Ping timeout: 260 seconds)
06:25:01 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
06:25:26 xff0x joins (~xff0x@2001:1a81:53bb:9600:a1e8:7445:87f2:2d40)
06:26:53 × xkuru quits (~xkuru@user/xkuru) (Read error: Connection reset by peer)
06:30:43 × EvanR quits (~evan@user/evanr) (Quit: Leaving)
06:31:01 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
06:33:03 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
06:35:47 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
06:36:49 wei2912 joins (~wei2912@116.88.103.128)
06:37:19 × wei2912 quits (~wei2912@116.88.103.128) (Client Quit)
06:37:35 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Ping timeout: 250 seconds)
06:38:01 × tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz)
06:39:56 × srk quits (~sorki@user/srk) (Ping timeout: 245 seconds)
06:40:02 × emf quits (~emf@2620:10d:c090:400::5:4c86) (Quit: emf)
06:44:36 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
06:47:47 × xff0x quits (~xff0x@2001:1a81:53bb:9600:a1e8:7445:87f2:2d40) (Ping timeout: 250 seconds)
06:48:39 xff0x joins (~xff0x@2001:1a81:53bb:9600:4dee:bd75:d531:be0)
06:50:15 × [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection)
06:50:43 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
06:57:01 × benin quits (~benin@183.82.179.164) (Ping timeout: 245 seconds)
06:58:18 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
06:59:32 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
06:59:57 benin joins (~benin@183.82.179.164)
07:09:56 × xff0x quits (~xff0x@2001:1a81:53bb:9600:4dee:bd75:d531:be0) (Ping timeout: 245 seconds)
07:10:51 xff0x joins (~xff0x@2001:1a81:53bb:9600:42f4:b800:f8f2:1c2a)
07:12:08 peeweep[m] joins (~peeweep@2001:470:69fc:105::1:39c1)
07:12:43 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
07:14:49 michalz joins (~michalz@185.246.204.37)
07:17:36 emf joins (~emf@2620:10d:c090:400::5:4c86)
07:20:25 peeweep[m] parts (~peeweep@2001:470:69fc:105::1:39c1) ()
07:21:50 jakalx parts (~jakalx@base.jakalx.net) ()
07:21:58 jakalx joins (~jakalx@base.jakalx.net)
07:23:56 × emf quits (~emf@2620:10d:c090:400::5:4c86) (Quit: emf)
07:27:37 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
07:29:08 × Teacup quits (~teacup@user/teacup) (Quit: Teacup)
07:29:32 Teacup joins (~teacup@user/teacup)
07:33:44 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
07:34:20 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 268 seconds)
07:41:51 deadmarshal joins (~deadmarsh@95.38.116.172)
07:49:35 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
07:51:56 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
07:54:14 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Ping timeout: 260 seconds)
07:54:54 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
07:55:06 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
07:55:13 <dminuoso> Axman6: Doesn't htlint just do very naive and static matching of patterns? https://github.com/ndmitchell/hlint/blob/master/data/hlint.yaml
07:56:51 <arahael> dminuoso: If it's "just do a very naive and static matching of patterns", then it's insane how good it is compared to literally every other programming language ecosystem's lint. :(
07:57:06 <dminuoso> Our opinions diverge apparently.
07:57:21 <arahael> Not neccessarily.
07:57:35 <arahael> You're assuming this is a high bar.
07:57:52 <dminuoso> That might very well be. :)
07:57:55 <earthy> it helps that haskell's semantics do not carry side effects. ;)
07:58:40 <dminuoso> I guess there's a point to that. With a (mostly) referential transparent language, you can have static refactoring rules easily
07:58:57 <dminuoso> *referentially transparent. uh
07:59:11 <dminuoso> arahael: I just dont put much faith or value in linters in the first place.
07:59:36 <earthy> dminuoso: they're *extremely* helpful in large teams
07:59:49 <dminuoso> Yeah your and my opinions diverge here as well. :)
08:00:01 <opqdonut> extremely helpful for project outcomes, or extremely helpful for placating pedants?-)
08:00:08 <arahael> I agree, they're *extremely* good for large teams, they're good at catching the low hanging fruit.
08:00:30 <arahael> Especially if the compilers are crap.
08:00:35 <earthy> project outcomes, in my experience. large teams tend to wallow in pedantic discussions if given half a chance
08:00:38 arahael glares at Kiel's GCC.
08:00:44 lortabac joins (~lortabac@2a01:e0a:541:b8f0:859e:604a:c9a4:ff01)
08:00:47 chele joins (~chele@user/chele)
08:01:01 <earthy> linters take the discussion off the table
08:01:02 <dminuoso> In my opinion they're not helpful for large teams. If I want to express some code in a way that the linter disagrees with, why should a static tool without actual Haskell expertise or problem domain knowledge tell me different?
08:01:08 <opqdonut> agreeing on conventions and checking them automatically is a great pattern, but linters are rarely up to the task. you need custom ad-hoc analysers
08:01:09 <arahael> earthy: That, too.
08:01:23 <opqdonut> things like "are all localization keys used in the source defined for all languages"
08:01:25 <arahael> dminuoso: Some teams I've worked in required MISRA-C.
08:01:29 <dminuoso> These tools appear to serve to give the impression that unskilled developers can produce "nice looking code". But the reality, good quality code cannot be reasonably described by linters.
08:01:31 <opqdonut> "are all events emitted by service X handled by service Y"
08:01:32 <earthy> opqdonut: that'd be better, yes. we also do that. ;)
08:01:48 <arahael> dminuoso: There's a reason I said low-hanging fruit.
08:01:55 <earthy> dminuoso: the trick is that *bad* patterns can be detected by linters
08:02:03 <dminuoso> arahael: To me, linters stand in the way. Too often I trigger patterns that I simply completely disagree with.
08:02:09 <earthy> just taking away the actively bad stuff is a boon.
08:02:12 <dminuoso> And in large teams you have this type of conflict more often
08:03:01 <dminuoso> earthy: A code review would catch that same stuff but in a better way.
08:03:22 <arahael> dminuoso: Code review is often a mere formality in large teams, it's insane how often review misses painfully obvious crap.
08:03:52 <dminuoso> There's your real problem then.
08:04:23 <dminuoso> A linter will not really improve that situation much. Instead, it will give all the more justification to simply click "Accept" every time.
08:04:36 <dminuoso> "Oh the linter and tests passed? Then it must be good"
08:04:41 <earthy> dminuoso: may be... but people suck at seeing these things, and can be *much* more effective when analysing whether the code fits the domain and whether it makes sense.
08:05:10 <earthy> dminuoso: that is a lack of imagination on the dev reviewing. the content of the tests are what should be under review.
08:05:16 <arahael> dminuoso: A linter that checks use-before-assign, or use-after-free is a good one, as an example, plus, unused variables, etc, all often help.
08:05:26 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
08:05:36 <earthy> arahael: granted, that's mostly in languages that basically suck for correctness. ;)
08:05:37 <arahael> dminuoso: Do you disable all your warnings with your compiler, if you don't like linters?
08:05:41 <dminuoso> arahael: Absolutely. It's just that we have these as warnings in GHC already. :)
08:05:44 <arahael> earthy: Well, yes.
08:05:49 <arahael> dminuoso: So you *do* like the linters.
08:06:05 <arahael> dminuoso: I guess you mean you don't like linters that are separate to the compiler?
08:06:41 <dminuoso> arahael: Okay so I guess you have a point there. I dont like linters that emit warnings based on stylistic or supposed idiomatic choices.
08:06:44 <arahael> dminuoso: There are some unbelievably bad compilers out there, having a linter helps massively.
08:06:52 <dminuoso> And hlint is almost all that.
08:06:59 <arahael> dminuoso: I once had to use a assembler that couldn't even implement *macros* correctly.
08:07:16 Vajb joins (~Vajb@nalkaylds2h97nzof-2.v6.elisa-mobile.fi)
08:07:27 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
08:07:29 <dminuoso> Like, hlint has generalization warnings I simply disagree with.
08:07:34 <arahael> dminuoso: And Kiel's GCC by default, if I recall correctly, doesn't even optimise at all. Which happens to be a good thing because the linting options are almost as bad.
08:07:35 <dminuoso> If I want to pick `map` over `fmap`, I might have a good reason for that.
08:07:54 <dminuoso> Or this one: - warn: {lhs: "maybe []", rhs: foldMap}
08:07:55 <arahael> dminuoso: No optimisation means less potential for undefined behaviour in practice - it becomes implementation-defined in practice instead.
08:08:00 <dminuoso> I simply completely disagree with this in any way
08:08:13 <arahael> dminuoso: I think hlint's explicitly not recommended to be an automatically-applied lint.
08:08:47 <dminuoso> arahael: The problem is, if my code provokes that linting rule, I have to write a complete separate line to squelch the linter as to not annoy everyone else.
08:08:53 <dminuoso> And this seems disapportionate to me
08:09:06 <dminuoso> And its very frustrating
08:09:37 <arahael> dminuoso: That's relatively unusual in C projects with crappy compilers. In those projects, you'd just fix the damn rule and move on. :)
08:10:01 <dminuoso> My tools should obey me, not the other way around.
08:10:49 <arahael> dminuoso: You have good tools. A good validating compiler helps. Makes a separate linting tool less important, but you still have a lint phase, it's just embedded.
08:10:58 <dminuoso> Like I pointed out earlier
08:11:01 <arahael> Right.
08:11:07 <dminuoso> 09:06:41 dminuoso | arahael: Okay so I guess you have a point there. I dont like linters that emit warnings based on stylistic or supposed idiomatic choices.
08:11:36 <dminuoso> Lets separate linters into "linting potentially erraneous code" and "linting whatever the author deems unidiomatic or stylistically wrong"
08:11:49 <dminuoso> The first I completely agree with, and GHC has a fairly decent set of warnings already
08:12:11 <dminuoso> I like it, and for languages where the implementation does not have this built in, I dont mind a separate linting software at all.
08:12:22 <arahael> I just wish haskell enabled all those by default.
08:12:25 dhouthoo joins (~dhouthoo@178-117-36-167.access.telenet.be)
08:12:36 <dminuoso> Indeed. -Wall and -Wcompat should be enabled by default
08:12:53 <dminuoso> And -fno-warn-name-shadowing
08:13:34 <arahael> Right. Oh, that's an interesting point. People seem to _hate_ name shadowing for some reason. I've not understood it.
08:13:41 <arahael> I don't really know why.
08:14:22 <dminuoso> In my opinion this is a sane default: `-Wall -Wcompat -Werror=incomplete-patterns -Wno-warn-unticked-promoted-constructors -Wno-warn-name-shadowing`
08:14:33 <arahael> I mean, I get shadowing in teh global scope is problematic, but people get unreasonably annoyed if I shadow something in a freaking 3-line scope.
08:15:35 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
08:16:52 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
08:17:54 <arahael> People in large teams basically loose all perspective.
08:18:13 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
08:18:39 <[exa]> +1 ^
08:18:42 <dminuoso> Perhaps some large teams are just badly organized.
08:18:52 <dminuoso> And no amount of tooling can realistically compensate for that
08:19:59 <[exa]> dminuoso: just curious (don't take this as me being doubtful :D ), are there any other ways to organize large teams than literally separate them into subteams?
08:20:47 <dminuoso> Im not saying they cant be organized
08:21:19 <dminuoso> It's just that perhaps too many shops that operate huge teams lack both the necessary discipline on programmers and the organizational skills by senior positions
08:24:02 × Megant quits (megant@user/megant) (Ping timeout: 240 seconds)
08:25:14 jushur joins (~human@user/jushur)
08:26:29 × michalz quits (~michalz@185.246.204.37) (Read error: No route to host)
08:27:27 michalz joins (~michalz@185.246.204.58)
08:28:15 × img quits (~img@user/img) (Quit: ZNC 1.8.2 - https://znc.in)
08:28:36 earthy nods
08:29:22 <earthy> that sounds valid. especially given that it's hard to get enough seniors to be able to organize the more junior devs
08:31:29 max22- joins (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr)
08:32:00 <arahael> Or you have too many seniors and not enough juniors.
08:34:47 img joins (~img@user/img)
08:39:39 mmhat joins (~mmh@55d426e2.access.ecotel.net)
08:41:26 × lavaman quits (~lavaman@98.38.249.169) (Read error: Connection reset by peer)
08:41:26 awschnap joins (~lavaman@98.38.249.169)
08:43:58 rkrishnan joins (~user@171.48.57.101)
08:47:50 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
08:52:30 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 260 seconds)
08:52:33 cfricke joins (~cfricke@user/cfricke)
08:57:31 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
08:58:43 machinedgod joins (~machinedg@24.105.81.50)
08:59:14 kupi joins (uid212005@id-212005.hampstead.irccloud.com)
09:06:04 Megant joins (megant@user/megant)
09:07:45 Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
09:08:07 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
09:09:07 × Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Remote host closed the connection)
09:12:01 deadmarshal joins (~deadmarsh@95.38.116.172)
09:17:38 allbery_b joins (~geekosaur@xmonad/geekosaur)
09:17:38 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b)))
09:17:41 allbery_b is now known as geekosaur
09:17:55 jumper149 joins (~jumper149@static.6.71.203.116.clients.your-server.de)
09:19:01 mc47 joins (~mc47@xmonad/TheMC47)
09:19:30 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds)
09:21:02 × mmhat quits (~mmh@55d426e2.access.ecotel.net) (Quit: WeeChat 3.3)
09:25:57 × xff0x quits (~xff0x@2001:1a81:53bb:9600:42f4:b800:f8f2:1c2a) (Ping timeout: 250 seconds)
09:27:04 xff0x joins (~xff0x@2001:1a81:53bb:9600:57:b0d1:750c:1fc)
09:31:55 acidjnk_new joins (~acidjnk@p200300d0c7271e128015eb8f81d9ba9d.dip0.t-ipconnect.de)
09:34:48 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 256 seconds)
09:37:44 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
09:38:02 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
09:38:26 × econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity)
09:38:55 srk joins (~sorki@user/srk)
09:41:09 deadmarshal joins (~deadmarsh@95.38.116.172)
09:42:41 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
09:43:21 CiaoSen joins (~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
09:43:41 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 245 seconds)
09:43:43 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:d837:dc58:2ea7:10e8) (Remote host closed the connection)
09:44:35 × CiaoSen quits (~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Client Quit)
09:45:26 gehmehgeh joins (~user@user/gehmehgeh)
09:46:10 CiaoSen joins (~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
09:49:19 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
09:49:55 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
09:54:38 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Ping timeout: 256 seconds)
09:59:52 Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915)
10:03:14 <arahael> Wow. Updating to Aeson 2.0 is a huge jump from 1.5. Finally did it for one of my repos. :D
10:03:37 <arahael> And I was able to do it mechanically whilst watching a movie so pretty happy about that.
10:06:40 × notzmv quits (~zmv@user/notzmv) (Ping timeout: 268 seconds)
10:08:07 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:09:47 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:10:19 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:11:59 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:12:16 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:12:52 jgeerds joins (~jgeerds@55d45b75.access.ecotel.net)
10:14:35 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:14:52 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:17:38 <jackdk> I do wish they published a 1.6 with the KeyMap interface and type aliases to easy that transition, but it wasn't so bad
10:18:02 neurocyte0132889 joins (~neurocyte@92.119.8.11)
10:18:02 × neurocyte0132889 quits (~neurocyte@92.119.8.11) (Changing host)
10:18:02 neurocyte0132889 joins (~neurocyte@user/neurocyte)
10:18:07 × whatsupdoc quits (uid509081@id-509081.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
10:19:50 <arahael> Right. I haven't gotten my repo fully up to speed with amazonka 2.0, but it's compiling (with all the imports and everything - just everything amazonka has been commented out such as the runAWST stuff.
10:19:58 <arahael> But the aeson is pretty decent.
10:20:09 <arahael> Next I'll have to update the amazonka bits. :)
10:20:27 <arahael> (Which I confirm compiles, I noticed in the release notes that runAWST is gone)
10:20:36 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:20:53 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:21:12 × Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer)
10:22:41 <arahael> I mean, I still have the amazon imports and all. :)
10:22:45 <jackdk> yes, thank the maker. It was never as well-behaved as other transformers
10:22:59 <arahael> I'm afraid I'm too naive to know better. :(
10:24:39 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:24:57 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:25:48 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 256 seconds)
10:28:02 × max22- quits (~maxime@lfbn-ren-1-762-224.w81-53.abo.wanadoo.fr) (Ping timeout: 240 seconds)
10:30:49 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:31:06 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:31:47 deadmarshal joins (~deadmarsh@95.38.116.172)
10:33:37 DNH joins (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd)
10:37:03 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:37:20 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:37:26 max22- joins (~maxime@2a01cb088335980072dc9c7c6d37d1a7.ipv6.abo.wanadoo.fr)
10:38:40 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:38:57 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:39:14 <Unhammer> What's the big change with 2.0?
10:40:54 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:41:37 <arahael> Unhammer: The most obvious is that Object is now a KeyMap.
10:42:03 <arahael> I noticed it when !? stopped working with them.
10:43:37 <jackdk> The KeyMap type became opaque so that the implementation could be swapped out, as someone demonstrated a working PoC DoS attack against the unordered-containers HashMap
10:43:57 <arahael> jackdk: Oh?
10:44:12 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51)
10:44:30 cosimone joins (~user@2001:b07:ae5:db26:a7aa:8027:6b4e:2fb3)
10:45:24 <jackdk> https://cs-syd.eu/posts/2021-09-11-json-vulnerability discusses the vulnerability but newer versions of aeson use the Map from containers instead so are unaffected
10:45:30 × cosimone quits (~user@2001:b07:ae5:db26:a7aa:8027:6b4e:2fb3) (Remote host closed the connection)
10:45:55 <arahael> Thanks, I'll check that out!
10:46:10 cosimone joins (~user@2001:b07:ae5:db26:a7aa:8027:6b4e:2fb3)
10:46:37 zer0bitz joins (~zer0bitz@2001:2003:f6bc:f00:75c5:c6ed:c91:17fe)
10:47:51 <arahael> Ah, interesting. Seems logical.
10:49:38 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51) (Ping timeout: 260 seconds)
10:50:53 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:52:33 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:52:52 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:54:32 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:54:51 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:56:31 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:56:50 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:58:30 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
10:58:48 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
10:59:30 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 260 seconds)
11:02:33 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
11:02:51 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
11:04:31 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
11:04:38 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
11:04:49 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
11:06:29 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
11:06:47 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
11:07:55 LiaoTao_ joins (~LiaoTao@gateway/tor-sasl/liaotao)
11:10:29 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
11:10:45 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
11:10:47 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
11:11:21 × LiaoTao quits (~LiaoTao@gateway/tor-sasl/liaotao) (Ping timeout: 276 seconds)
11:13:31 raehik1 joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net)
11:13:38 × albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection)
11:14:31 × CiaoSen quits (~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 245 seconds)
11:15:41 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:18:58 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
11:19:45 albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8)
11:20:49 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
11:23:04 kuribas joins (~user@ptr-25vy0i8ep4e11jhvxvb.18120a2.ip6.access.telenet.be)
11:25:13 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
11:25:30 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
11:26:08 royo joins (~royo@user/royo)
11:26:19 deadmarshal joins (~deadmarsh@95.38.116.172)
11:26:43 royo parts (~royo@user/royo) ()
11:29:47 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
11:33:23 <Unhammer> Oh nice
11:39:09 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
11:39:27 × chele quits (~chele@user/chele) (Remote host closed the connection)
11:40:08 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
11:41:43 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
11:42:20 × cosimone quits (~user@2001:b07:ae5:db26:a7aa:8027:6b4e:2fb3) (Read error: Connection reset by peer)
11:42:29 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
11:44:02 gehmehgeh_ joins (~user@user/gehmehgeh)
11:45:48 × gehmehgeh quits (~user@user/gehmehgeh) (Ping timeout: 276 seconds)
11:46:35 AlexNoo_ joins (~AlexNoo@178.34.162.8)
11:46:36 jinsun__ joins (~quassel@user/jinsun)
11:47:12 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
11:47:29 MidAutumnMoon65 joins (~MidAutumn@user/midautumnmoon)
11:47:37 ralu9 joins (~ralu@static.211.245.203.116.clients.your-server.de)
11:47:41 russruss0 joins (~russruss@my.russellmcc.com)
11:47:45 ellie9 joins (~ellie@user/ellie)
11:48:17 curiousgay joins (~curiousga@77-120-141-90.kha.volia.net)
11:48:18 davl_ joins (~davl@207.154.228.18)
11:48:20 cfebs_ joins (~cfebs@user/cfebs)
11:48:25 mustafa_ joins (sid502723@rockylinux/releng/mustafa)
11:48:33 deadmarshal_ joins (~deadmarsh@95.38.116.172)
11:48:34 brettgilio3 joins (~brettgili@x-node.gq)
11:48:40 sqrt2_ joins (~ben@80-108-18-7.cable.dynamic.surfer.at)
11:48:42 gabiruh_ joins (~gabiruh@vps19177.publiccloud.com.br)
11:48:43 eL_Bart0- joins (eL_Bart0@dietunichtguten.org)
11:48:44 dysfigured joins (~dfg@li490-89.members.linode.com)
11:48:48 greyrat_ joins (~greyrat@ip202.ip-51-178-215.eu)
11:48:50 m5zs7k_ joins (aquares@web10.mydevil.net)
11:48:53 madnight_ joins (~madnight@static.59.103.201.195.clients.your-server.de)
11:48:56 zopsi_ joins (zopsi@2600:3c00::f03c:91ff:fe14:551f)
11:49:09 pyook joins (~puke@user/puke)
11:49:09 × puke quits (~puke@user/puke) (Killed (mercury.libera.chat (Nickname regained by services)))
11:49:09 pyook is now known as puke
11:49:11 Techcable_ joins (~Techcable@168.235.93.147)
11:49:24 forell_ joins (~forell@host-178-216-90-220.sta.tvknaszapraca.pl)
11:49:35 aforemny_ joins (~aforemny@static.248.158.34.188.clients.your-server.de)
11:49:47 dminuoso_ joins (~dminuoso@static.88-198-218-68.clients.your-server.de)
11:49:49 wagle_ joins (~wagle@quassel.wagle.io)
11:50:11 fjmorazan_ joins (~quassel@user/fjmorazan)
11:50:22 glider_ joins (~glider@user/glider)
11:50:30 dumptruckman_ joins (~dumptruck@45-79-173-88.ip.linodeusercontent.com)
11:50:33 p3n_ joins (~p3n@217.198.124.246)
11:50:36 × ubert quits (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection)
11:50:44 sshine_ joins (~simon@hubris.eta.solutions)
11:50:46 ptrcmd_ joins (~ptrcmd@user/ptrcmd)
11:50:52 anderson_ joins (~ande@user/anderson)
11:50:53 ubert joins (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de)
11:50:56 Clint_ joins (~Clint@user/clint)
11:50:57 Hecate_ joins (~mariposa@163.172.211.189)
11:50:59 [exa]_ joins (~exa@srv3.blesmrt.net)
11:50:59 dfordivam1 joins (~dfordivam@tk2-219-19469.vs.sakura.ne.jp)
11:51:03 cjay- joins (cjay@nerdbox.nerd2nerd.org)
11:51:06 m1dnight_ joins (~christoph@christophe.dev)
11:51:10 tlax_ joins (tlax@kapsi.fi)
11:51:14 bcoppens_ joins (~bartcopp@vpn2.bartcoppens.be)
11:51:19 pie__ joins (~pie_bnc@user/pie/x-2818909)
11:51:20 × dminuoso quits (~dminuoso@user/dminuoso) (Killed (NickServ (GHOST command used by dminuoso_!~dminuoso@static.88-198-218-68.clients.your-server.de)))
11:51:20 Igloo joins (~ian@matrix.chaos.earth.li)
11:51:23 Eoco_ joins (~ian@x-160-94-179-157.acm.umn.edu)
11:51:25 ts2 joins (~ts@46.101.20.9)
11:51:48 dminuoso_ is now known as dminuoso
11:51:50 jushurr joins (~human@user/jushur)
11:52:06 × dminuoso quits (~dminuoso@static.88-198-218-68.clients.your-server.de) (Changing host)
11:52:06 dminuoso joins (~dminuoso@user/dminuoso)
11:52:33 connrs_ joins (~connrs@user/connrs)
11:54:24 mht-wtf joins (~mht@mht.wtf)
11:54:33 infinity0_ joins (~infinity0@occupy.ecodis.net)
11:54:34 × infinity0 quits (~infinity0@occupy.ecodis.net) (Killed (iridium.libera.chat (Nickname regained by services)))
11:54:34 infinity0_ is now known as infinity0
11:54:39 Square joins (~a@user/square)
11:54:57 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
11:55:08 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
11:55:20 In0perable joins (~PLAYER_1@fancydata.science)
11:55:24 Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915)
11:55:26 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
11:55:59 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
11:55:59 × connrs quits (~connrs@user/connrs) (Ping timeout: 260 seconds)
11:55:59 × Inoperable quits (~PLAYER_1@fancydata.science) (Ping timeout: 260 seconds)
11:55:59 × zopsi quits (~zopsi@irc.dir.ac) (Ping timeout: 260 seconds)
11:55:59 × forell quits (~forell@user/forell) (Ping timeout: 260 seconds)
11:55:59 × Sqaure quits (~a@user/square) (Ping timeout: 260 seconds)
11:55:59 × greyrat quits (~greyrat@ip202.ip-51-178-215.eu) (Ping timeout: 260 seconds)
11:55:59 × madnight quits (~madnight@static.59.103.201.195.clients.your-server.de) (Ping timeout: 260 seconds)
11:55:59 × dfordvm quits (~dfordivam@tk2-219-19469.vs.sakura.ne.jp) (Ping timeout: 260 seconds)
11:55:59 × ptrcmd quits (~ptrcmd@user/ptrcmd) (Ping timeout: 260 seconds)
11:55:59 connrs_ is now known as connrs
11:55:59 × sshine quits (~simon@hubris.eta.solutions) (Ping timeout: 260 seconds)
11:55:59 × p3n quits (~p3n@217.198.124.246) (Ping timeout: 260 seconds)
11:55:59 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 260 seconds)
11:55:59 × m1dnight quits (~christoph@christophe.dev) (Ping timeout: 260 seconds)
11:55:59 × wagle quits (~wagle@quassel.wagle.io) (Ping timeout: 260 seconds)
11:55:59 × cfebs quits (~cfebs@user/cfebs) (Ping timeout: 260 seconds)
11:55:59 × AlexNoo quits (~AlexNoo@178.34.162.8) (Ping timeout: 260 seconds)
11:55:59 × Clint quits (~Clint@user/clint) (Ping timeout: 260 seconds)
11:55:59 × MidAutumnMoon6 quits (~MidAutumn@user/midautumnmoon) (Ping timeout: 260 seconds)
11:55:59 × [exa] quits (exa@user/exa/x-3587197) (Ping timeout: 260 seconds)
11:55:59 × glider quits (~glider@user/glider) (Ping timeout: 260 seconds)
11:55:59 × brettgilio quits (~brettgili@x-node.gq) (Ping timeout: 260 seconds)
11:55:59 × ts1 quits (~ts@46.101.20.9) (Ping timeout: 260 seconds)
11:55:59 × mht quits (~mht@mht.wtf) (Ping timeout: 260 seconds)
11:55:59 × bcoppens quits (~bartcopp@vpn2.bartcoppens.be) (Ping timeout: 260 seconds)
11:55:59 × Eoco quits (~ian@x-160-94-179-157.acm.umn.edu) (Ping timeout: 260 seconds)
11:55:59 × Hecate quits (~mariposa@user/hecate) (Ping timeout: 260 seconds)
11:55:59 × sm[i]_ quits (~user@li229-222.members.linode.com) (Ping timeout: 260 seconds)
11:55:59 × davl quits (~davl@207.154.228.18) (Ping timeout: 260 seconds)
11:55:59 × cjay quits (cjay@nerdbox.nerd2nerd.org) (Ping timeout: 260 seconds)
11:55:59 × tlax quits (tlax@kapsi.fi) (Ping timeout: 260 seconds)
11:56:00 × Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 260 seconds)
11:56:00 × jushur quits (~human@user/jushur) (Ping timeout: 260 seconds)
11:56:00 × mbuf quits (~Shakthi@171.61.241.63) (Ping timeout: 260 seconds)
11:56:00 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 260 seconds)
11:56:00 × ralu quits (~ralu@static.211.245.203.116.clients.your-server.de) (Ping timeout: 260 seconds)
11:56:00 × jinsun quits (~quassel@user/jinsun) (Ping timeout: 260 seconds)
11:56:00 × russruss quits (~russruss@my.russellmcc.com) (Ping timeout: 260 seconds)
11:56:00 × mustafa quits (sid502723@rockylinux/releng/mustafa) (Ping timeout: 260 seconds)
11:56:00 × gabiruh quits (~gabiruh@vps19177.publiccloud.com.br) (Ping timeout: 260 seconds)
11:56:00 × fjmorazan quits (~quassel@user/fjmorazan) (Ping timeout: 260 seconds)
11:56:00 × Techcable quits (~Techcable@168.235.93.147) (Ping timeout: 260 seconds)
11:56:00 × smunix quits (~smunix@static.26.70.12.49.clients.your-server.de) (Ping timeout: 260 seconds)
11:56:00 × eL_Bart0 quits (eL_Bart0@dietunichtguten.org) (Ping timeout: 260 seconds)
11:56:00 × m5zs7k quits (aquares@web10.mydevil.net) (Ping timeout: 260 seconds)
11:56:00 × anderson quits (~ande@user/anderson) (Ping timeout: 260 seconds)
11:56:00 × aforemny quits (~aforemny@static.248.158.34.188.clients.your-server.de) (Ping timeout: 260 seconds)
11:56:00 × xsarnik quits (xsarnik@lounge.fi.muni.cz) (Ping timeout: 260 seconds)
11:56:00 × ian_ quits (~ian@matrix.chaos.earth.li) (Ping timeout: 260 seconds)
11:56:00 × dumptruckman quits (~dumptruck@45-79-173-88.ip.linodeusercontent.com) (Ping timeout: 260 seconds)
11:56:00 × micro quits (~micro@user/micro) (Ping timeout: 260 seconds)
11:56:00 × dfg quits (~dfg@user/dfg) (Ping timeout: 260 seconds)
11:56:00 × sqrt2 quits (~ben@80-108-18-7.cable.dynamic.surfer.at) (Ping timeout: 260 seconds)
11:56:00 × pie_ quits (~pie_bnc@user/pie/x-2818909) (Ping timeout: 260 seconds)
11:56:00 × platz quits (~platz@user/platz) (Ping timeout: 260 seconds)
11:56:00 × ellie quits (~ellie@user/ellie) (Ping timeout: 260 seconds)
11:56:00 xsarnik joins (xsarnik@lounge.fi.muni.cz)
11:56:00 mbuf joins (~Shakthi@171.61.241.63)
11:56:00 cfebs_ is now known as cfebs
11:56:00 sm[i]_ joins (~user@li229-222.members.linode.com)
11:56:00 russruss0 is now known as russruss
11:56:01 ralu9 is now known as ralu
11:56:01 dumptruckman_ is now known as dumptruckman
11:56:01 brettgilio3 is now known as brettgilio
11:56:01 ellie9 is now known as ellie
11:56:01 mustafa_ is now known as mustafa
11:56:02 MidAutumnMoon65 is now known as MidAutumnMoon6
11:56:02 m5zs7k_ is now known as m5zs7k
11:56:15 anderson_ is now known as anderson
11:56:17 micro joins (~micro@user/micro)
11:56:38 platz joins (~platz@40.122.118.113)
11:56:38 × platz quits (~platz@40.122.118.113) (Changing host)
11:56:38 platz joins (~platz@user/platz)
11:58:10 × deadmarshal_ quits (~deadmarsh@95.38.116.172) (Ping timeout: 256 seconds)
11:58:14 Lord_of_Life_ is now known as Lord_of_Life
11:59:38 deadmarshal joins (~deadmarsh@95.38.116.172)
11:59:49 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
12:03:42 pfurla joins (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b)
12:04:11 × pfurla quits (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b) (Client Quit)
12:06:37 mmhat joins (~mmh@55d426e2.access.ecotel.net)
12:07:45 pfurla joins (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b)
12:11:14 × Vajb quits (~Vajb@nalkaylds2h97nzof-2.v6.elisa-mobile.fi) (Read error: Connection reset by peer)
12:12:00 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
12:13:46 [exa]_ is now known as [exa]
12:13:53 × [exa] quits (~exa@srv3.blesmrt.net) (Changing host)
12:13:53 [exa] joins (~exa@user/exa/x-3587197)
12:15:56 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:16:11 × benin quits (~benin@183.82.179.164) (Ping timeout: 245 seconds)
12:19:15 notzmv joins (~zmv@user/notzmv)
12:19:44 boxscape_ joins (~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de)
12:21:06 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
12:24:11 × max22- quits (~maxime@2a01cb088335980072dc9c7c6d37d1a7.ipv6.abo.wanadoo.fr) (Ping timeout: 268 seconds)
12:26:20 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
12:28:00 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
12:28:13 benin joins (~benin@183.82.179.164)
12:28:18 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
12:29:06 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 245 seconds)
12:29:56 × pfurla quits (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b) (Quit: gone to sleep. ZZZzzz…)
12:30:41 kupi joins (uid212005@id-212005.hampstead.irccloud.com)
12:32:54 deadmarshal joins (~deadmarsh@95.38.116.172)
12:34:34 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
12:34:51 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
12:37:40 × awschnap quits (~lavaman@98.38.249.169) (Remote host closed the connection)
12:39:20 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
12:39:37 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
12:41:17 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
12:41:35 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
12:42:52 slack1256 joins (~slack1256@186.11.45.199)
12:46:21 × cfricke quits (~cfricke@user/cfricke) (Ping timeout: 250 seconds)
12:46:53 aforemny_ is now known as aforemny
12:47:39 cfricke joins (~cfricke@user/cfricke)
12:50:13 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
12:50:31 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
12:51:39 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
12:51:44 <zero> what's a case where return can be defined more optimally than pure?
12:52:17 zero is now known as yin
12:52:32 yin is now known as zzz
12:54:01 <hpc> i can't immagine there is one
12:54:26 <hpc> everything that would be in scope defining return is also in scope defining pure
12:59:10 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
12:59:27 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
13:02:08 <geekosaur> zero, afaik the only reason there's a difference is backward compatibility
13:02:16 <geekosaur> not optimality
13:02:25 [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470)
13:02:49 <dminuoso> What's the idiomatic way to provide a
13:02:52 <dminuoso> oops
13:03:04 <geekosaur> in fact there's a "monad of no return" proposal that would remove return from Monad and just use Applicative's pure
13:03:20 <dminuoso> What's the idiomatic way to provide an uninitialized CString buffer of a specified size?
13:03:39 <dminuoso> Something like `withBuf 10 $ \ptr -> ...`
13:04:24 <geekosaur> isn't this the use case for allocaBytes?
13:05:06 <dminuoso> Ohh. Yes.
13:05:14 <dminuoso> That's what I was looking for. thanks.
13:07:46 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
13:08:34 × coolnickname quits (~omg@user/coolnickname) (Ping timeout: 268 seconds)
13:09:33 narendra joins (~user@2a02:8109:b63f:ff7c::56c2)
13:10:11 AlexNoo_ is now known as AlexNoo
13:10:39 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
13:11:03 Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de)
13:11:55 coolnickname joins (~coolnickn@73.194.7.51.dyn.plus.net)
13:13:19 × deadmarshal quits (~deadmarsh@95.38.116.172) (Quit: ZNC 1.8.2 - https://znc.in)
13:13:45 deadmarshal joins (~deadmarsh@95.38.116.172)
13:18:06 <nf> :t \l f -> do a <- use l; l <~ f a :: MonadState s m => (forall f. Functor f => (a -> f a) -> s -> f s) -> (a -> m a) -> m ()
13:18:07 <lambdabot> error:
13:18:07 <lambdabot> • Couldn't match type ‘Const a s’ with ‘Identity s’
13:18:07 <lambdabot> Expected type: ASetter s s a b
13:18:18 <nf> why doesn't this typecheck?
13:18:39 <nf> i don't know how to say more explicitly that i want l to be polymorphic in f
13:19:00 <nf> (a workaround is to use cloneLens l but i'd like to understand why that is needed)
13:19:31 <dminuoso> % :t use
13:19:31 <yahb> dminuoso: MonadState s m => Getting a s a -> m a
13:19:33 <dminuoso> % :i Getting
13:19:33 <yahb> dminuoso: type Getting :: * -> * -> * -> *; type Getting r s a = (a -> Const r a) -> s -> Const r s; -- Defined in `Control.Lens.Getter'
13:19:39 <dminuoso> % :t (<~)
13:19:39 <yahb> dminuoso: MonadState s m => ASetter s s a b -> m b -> m ()
13:19:42 <dminuoso> % :i ASetter
13:19:42 <yahb> dminuoso: type ASetter :: * -> * -> * -> * -> *; type ASetter s t a b = (a -> Identity b) -> s -> Identity t; -- Defined in `Control.Lens.Setter'
13:20:10 <dminuoso> nf: The problem has nothing to do with f, but the consumption of it.
13:20:25 <nf> i mean f the functor, not f the second argument
13:20:28 <dminuoso> Ah
13:21:02 <dminuoso> Mm this is actually curious
13:21:13 <nf> it seems to me that forall f. Functor f => (a -> f a) -> s -> f s should unify with both ASetter and Getting
13:21:40 <nf> then again i have no idea how rank-n types work in ghc
13:21:43 <dminuoso> Im idly wondering whether this has to do with simplified subsumption
13:22:14 <hpc> :t let foo :: MonadState s m => (forall f. Functor f => (a -> f a) -> s -> f s) -> (a -> m a) -> m (); foo = \l f -> do a <- use l; l <~ f a in foo
13:22:15 <lambdabot> MonadState s m => (forall (f :: * -> *). Functor f => (a -> f a) -> s -> f s) -> (a -> m a) -> m ()
13:22:15 × deadmarshal quits (~deadmarsh@95.38.116.172) (Quit: ZNC 1.8.2 - https://znc.in)
13:22:24 <hpc> it's a syntax issue
13:22:24 <nf> o_o
13:22:32 <nf> lol
13:22:33 <hpc> your type signature is applying to a, or f a, or something
13:22:35 <hpc> not to the whole lambda
13:22:50 <nf> ...oh my god
13:22:54 <nf> thanks.
13:22:58 <hpc> :D
13:23:04 <dminuoso> Oh hah
13:23:20 nf writes 100 times "i will never assume the precedence of :: again"
13:23:21 dminuoso still prefers `optics`
13:23:30 deadmarshal joins (~deadmarsh@95.38.116.172)
13:23:53 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
13:24:00 <hpc> nf: yeah, i have been burned by that enough times that any use of inline "::" without parens is instantly suspect
13:24:10 jonathanx_ joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
13:25:04 <nf> and now for a follow-up question: what magic set of extensions do i have to turn on to make ghc infer a type for foo?
13:25:18 <dminuoso> nf: DoesNotExist
13:25:19 <nf> :t let foo = \l f -> do a <- use l; l <~ f a in foo
13:25:20 <lambdabot> error:
13:25:20 <lambdabot> • Couldn't match type ‘Const t1 s1’ with ‘Identity s1’
13:25:20 <lambdabot> Expected type: ASetter s1 s1 t1 b1
13:25:21 <hpc> iirc higher-rank types can't be inferred
13:25:27 <nf> not even rank 2?
13:25:38 <dminuoso> rank 2 can, but I dont think that algorithm has been implemented in GHC
13:25:43 <dminuoso> IIRC
13:25:46 <nf> ok
13:25:56 <hpc> there used to be two extensions
13:26:00 <hpc> Rank2Types and RankNTypes
13:26:15 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds)
13:26:22 <hpc> but that was aaaaaages ago and i hadn't ever needed to use them
13:26:35 <hpc> maybe the inference algorithm used to exist?
13:27:12 <nf> https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/rank_polymorphism.html#type-inference
13:27:22 <nf> apparently not doable without annotating
13:27:34 bsdbandit joins (~bwell@users.757.org)
13:27:56 <dminuoso> nf: Yeah for arbitrary rank that is true
13:28:15 <dminuoso> This is also worth a skim https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/putting.pdf
13:28:19 <nf> yeah i saw that
13:28:32 × jushurr quits (~human@user/jushur) (Quit: payload updated)
13:29:33 <geekosaur> the inference algo never existed. ages ago ghc only supported rank-2 types; eventually that was extended to rank-N
13:29:57 <dminuoso> Also, rank 2 type inference decideability really depends on language features I think
13:30:05 <geekosaur> iirc adding rank-2 inference has been considered and they decided it was a lot of complexity for somnething that would rarely if ever be used
13:30:07 <dminuoso> So perhaps interaction with other extensions rendered that impossible
13:30:37 <nf> geekosaur: a reasonable choice
13:31:10 <hpc> i wonder if it would lead to confusing type errors along the lines of instance Num b => Num (a -> b) and such
13:31:27 <dminuoso> Realistically you should document the type signature anyway.
13:31:50 <dminuoso> So lack of inference just means you have to think for yourself rather than asking GHC `f :: _`
13:32:05 <dminuoso> Also: If you used `optics` this problem wouldn't appear. :P
13:32:21 nf is now reading https://hackage.haskell.org/package/optics-0.4/docs/Optics.html
13:32:25 <dminuoso> Since that brings everything back to rank1.
13:33:05 <dminuoso> (Or rather, the higher rank stuff is hidden behind newtypes)
13:33:46 <nf> i don't think i'm mature enough for optics yet. i haven't grown out of my "LENSES COMPOSE LIKE FUNCTIONS THIS IS SO COOL!!!11" phase
13:34:27 lavaman joins (~lavaman@98.38.249.169)
13:34:41 <dminuoso> optics do too!
13:34:53 <dminuoso> It's just hidden behind an operator :p
13:34:55 <nf> yes but not transparently
13:34:58 <dminuoso> heh
13:35:17 <hpc> what you need is a healthy dose of spring framework :D
13:35:27 <dminuoso> This sort of mathematical beauty and symmetry of lens/optics always amazes me.
13:36:55 <dminuoso> nf: Here's a selling point then: optics use a uniform profunctor representation, giving you more beauty inside! :p
13:37:06 <dminuoso> With lens its a mix of VL, mixed and profunctor stuff. :p
13:37:25 slowButPresent joins (~slowButPr@user/slowbutpresent)
13:37:27 <nf> if only i wasn't so superficial
13:37:48 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
13:39:28 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
13:39:41 Hecate_ is now known as Hecate
13:41:12 <boxscape_> is there a better way to write `f <=< pure g <=< h`?
13:41:23 × jgeerds quits (~jgeerds@55d45b75.access.ecotel.net) (Ping timeout: 250 seconds)
13:41:48 <boxscape_> oh
13:41:52 <boxscape_> it's just `f . g <=< h`
13:42:59 <lortabac> regarding rank-n types, you can have full inference if you only allow them hidden in a data-type (as we currently do for existentials)
13:43:00 pfurla joins (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b)
13:43:36 <lortabac> which IMO is a good compromise, but it's not what GHC decided to do
13:47:53 jinsun__ is now known as jinsun
13:51:18 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
13:53:52 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
13:54:27 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Remote host closed the connection)
13:55:03 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
13:56:43 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
13:57:02 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
13:58:42 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
13:59:01 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
14:00:37 arjun joins (~user@user/arjun)
14:02:45 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
14:02:46 × jonathanx_ quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Read error: Connection reset by peer)
14:03:04 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
14:04:03 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
14:04:26 smorgasbord joins (buggy@thunix.net)
14:04:55 × smorgasbord quits (buggy@thunix.net) (Changing host)
14:04:55 smorgasbord joins (buggy@user/smorgasbord)
14:05:15 reumeth joins (~reumeth@user/reumeth)
14:05:32 <smorgasbord> hello! I wanted to know if there was anyway of pattern matching a Data constructor using a wildcard, and using the exact same match later?
14:06:10 <smorgasbord> considering that I have something like Data Foo = Bar int | Baz char
14:07:12 <smorgasbord> anyway I can do something like `hello (WC x) = WC 10`
14:07:38 <dminuoso> Of course.
14:07:41 <dminuoso> Exactly like that.
14:08:01 <dminuoso> You're not really "reusing the exact same match", you're just building the same data constructor back again.
14:08:02 <boxscape_> ...but not if WC is supposed to match both `Bar` and `Baz`
14:08:06 <dminuoso> Ah.
14:08:24 <dminuoso> You read the pseudocode better than me I guess
14:08:38 <smorgasbord> I get an error when I do it exactly like that
14:08:41 <dminuoso> smorgasbord: What would that even do if the data constructor was `Baz`?
14:08:42 <kuribas> 10 is not a char ...
14:08:48 <dminuoso> smorgasbord: You can't construct `Baz 10`
14:08:53 <kuribas> maybe he wants a Functor?
14:08:57 <smorgasbord> dminuoso: it would have given an error :P (Not the best example)
14:09:13 <hpc> maybe you want @?
14:09:16 <smorgasbord> WC is indeed supposed to match both
14:09:20 <hpc> @let data Foo = Bar Int | Baz Char
14:09:20 <lambdabot> Defined.
14:09:30 <dminuoso> smorgasbord: If you have something like `data F a = F a | G a`, you can write a Functor implementation and use `fmap`
14:09:30 <hpc> @let f x@(Bar n) = (n, x)
14:09:31 × pfurla quits (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b) (Quit: gone to sleep. ZZZzzz…)
14:09:31 <lambdabot> Defined.
14:09:35 <hpc> > f (Bar 10)
14:09:36 <lambdabot> error:
14:09:36 <lambdabot> Ambiguous occurrence ‘f’
14:09:36 <lambdabot> It could refer to
14:09:37 × alx741 quits (~alx741@186.178.109.84) (Quit: alx741)
14:09:39 <hpc> ugh
14:09:48 <hpc> @let foo x@(Bar n) = (n, x)
14:09:49 <lambdabot> Defined.
14:09:52 <hpc> > foo (Bar 10)
14:09:53 <lambdabot> error:
14:09:53 <lambdabot> • No instance for (Show Foo)
14:09:53 <lambdabot> arising from a use of ‘show_M8911773327894737618’
14:10:01 <hpc> you get the idea
14:10:19 <smorgasbord> hpc: I'm really sorry, but I don't :(
14:10:33 <dminuoso> hpc: It wouldn't match both though
14:10:45 <smorgasbord> x@() gives me access to the whole datum
14:10:45 <dminuoso> smorgasbord: consider this:
14:10:52 <smorgasbord> and Bar only is a specific constructor
14:11:02 alx741 joins (~alx741@186.178.109.84)
14:11:03 <dminuoso> % data OneOf a = This a | That a
14:11:04 <yahb> dminuoso:
14:11:07 <smorgasbord> I want access tothe constructor I don't know a priori
14:11:14 <smorgasbord> I only know the arity of the contructor
14:11:27 <dminuoso> % instance Functor OneOf where fmap f (This a) = This (f a); fmap f (That a) = That (f a)
14:11:28 <yahb> dminuoso:
14:11:47 <dminuoso> % fmap (+1) (This 10)
14:11:47 <yahb> dminuoso: ; <interactive>:11:1: error:; * No instance for (Show (OneOf Integer)) arising from a use of `print'; * In a stmt of an interactive GHCi command: print it
14:11:49 <kuribas> smorgasbord: short answer: you cannot.
14:11:56 <dminuoso> % data OneOf a = This a | That a deriving Show
14:11:56 <yahb> dminuoso:
14:11:59 <dminuoso> % instance Functor OneOf where fmap f (This a) = This (f a); fmap f (That a) = That (f a)
14:11:59 <yahb> dminuoso:
14:12:02 <dminuoso> % fmap (+1) (This 10)
14:12:03 <yahb> dminuoso: This 11
14:12:05 <dminuoso> % fmap (+1) (That 10)
14:12:05 <yahb> dminuoso: That 11
14:12:13 <kuribas> smorgasbord: larger answer, you can with some hack but shouldn't.
14:12:15 <dminuoso> % "foo" <$ This 10
14:12:15 <yahb> dminuoso: This "foo"
14:12:19 <dminuoso> % "foo" <$ That [1,2,3]
14:12:19 <yahb> dminuoso: That "foo"
14:12:22 <dminuoso> smorgasbord: ^- this perhaps?
14:14:33 × acidjnk_new quits (~acidjnk@p200300d0c7271e128015eb8f81d9ba9d.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
14:16:23 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
14:16:41 <smorgasbord> I don't understand what you've written dminuoso
14:16:54 <smorgasbord> what is the `<$` operator supposed to do?
14:18:12 <dminuoso> smorgasbord: That's just fmap with a constant value.
14:18:29 <dminuoso> % fmap (const "foo") This [1,2,3]
14:18:29 <yahb> dminuoso: "foo"
14:18:33 <dminuoso> Uh
14:18:37 <dminuoso> % fmap (const "foo") (This [1,2,3])
14:18:37 <yahb> dminuoso: This "foo"
14:21:34 slac59793 joins (~slack1256@181.43.229.27)
14:21:57 arjun parts (~user@user/arjun) (ERC 5.4.1 (IRC client for GNU Emacs 29.0.50))
14:23:32 × slack1256 quits (~slack1256@186.11.45.199) (Ping timeout: 240 seconds)
14:27:49 × justache quits (~justache@user/justache) (Read error: Connection reset by peer)
14:27:49 <smorgasbord> ah I missed the line in dminuoso's code about the functor
14:28:07 <smorgasbord> I think I will have to understand functors then, another person I had asked about this also suggested the same
14:28:12 <smorgasbord> thank you!
14:28:40 <dminuoso> smorgasbord: In simple terms, any data type where you can "map over its values" in a sensible fashion is called a functor.
14:28:44 justache joins (~justache@user/justache)
14:29:07 <dminuoso> So for instance, we can map over the values of a list and modify them
14:29:16 <dminuoso> % fmap (+1) [1,2,3,4]
14:29:16 <yahb> dminuoso: [2,3,4,5]
14:29:39 <smorgasbord> right, this looks like a normal map that I'm familiar with from other languages
14:29:43 <dminuoso> Yup.
14:29:48 <dminuoso> We just have an implied law
14:30:22 <dminuoso> Which we can think of as saying "fmap may not change the structure of the thing", for instance fmap on list is not allowed to change the element order, or drop elements
14:31:07 <smorgasbord> so in a tree like structure, I can't replace elements with fmap?
14:31:12 <xsperry> smorgasbord, unlike a normal map it can be used on a lot more than just lists or collections
14:31:36 max22- joins (~maxime@2a01cb0883359800917d653070f119e8.ipv6.abo.wanadoo.fr)
14:31:38 <smorgasbord> that could be a problem (an x-y problem) because I want to use this to make changes to a tree like structure with a lot of different constructors
14:32:11 <boxscape_> Tree-like structures are very often Functors
14:32:27 <boxscape_> so you can typically replace elements in a tree with fmap
14:32:29 <geekosaur> but if you want to make changes you may want Traversable instead
14:32:40 <geekosaur> depending on the changes
14:32:55 <xsperry> > fmap (*10) $ M.fromList [("one", 1), ("two", 2)]
14:32:57 <lambdabot> fromList [("one",10),("two",20)]
14:33:17 lbseale joins (~ep1ctetus@user/ep1ctetus)
14:34:03 kennyd joins (~bc8165b6@217.29.117.252)
14:34:22 lavaman joins (~lavaman@98.38.249.169)
14:35:00 <smorgasbord> I actually am trying to simplify expressions in an implementation of Montague's intensional logic. So what I was trying to do, was take lambda expressions in the language when applied, which look like `Appl (Lmbd (LVar 'x') <body-of-l-expr>) y`, where y will replace every instance of (LVar 'x') in the expression.
14:35:24 <smorgasbord> I basically wanted to take this syntax tree and return <body-of-expr-with-y-replaxing-x>
14:36:28 <smorgasbord> The recursive procedure needed me to deconstruct to act on the args of the constructor, but there are a lot of constructors, so I did not want to write the recursive call manually for each constructor
14:37:14 <mniip> this is a monadic pattern actually
14:37:20 × bliminse quits (~bliminse@host86-188-36-178.range86-188.btcentralplus.com) (Quit: leaving)
14:37:37 <smorgasbord> I am new to haskell and scared of the word 'monad' xD
14:37:44 <mniip> do be
14:38:44 <mniip> saying that doesn't actually save you from writing out every constructor though
14:38:57 justsomeguy joins (~justsomeg@user/justsomeguy)
14:39:08 <mniip> I don't think the deriving mechanism is strong enough
14:39:24 <justsomeguy> b/c
14:39:27 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 260 seconds)
14:39:41 <smorgasbord> where should I start if I want to solve this with the monadic approach?
14:39:50 <smorgasbord> should I learn about monads in general or something specific?
14:39:54 <mniip> although, if this is a lambda calculus, you have to be careful with your descent
14:40:06 <mniip> because you can hit a lambda that shadows the identifier you're currently substituting
14:40:26 <mniip> so it's not a straightforward tree traversal
14:40:28 cosimone joins (~user@2001:b07:ae5:db26:a7aa:8027:6b4e:2fb3)
14:40:36 <smorgasbord> mniip: you're right, I had not considered that earlier. Thank you for that!
14:41:05 × kennyd quits (~bc8165b6@217.29.117.252) (Quit: http://www.okay.uz/ (Ping timeout))
14:41:08 <mniip> this is definitely not a "general monads" type situation no, rather a fairly niche application of them
14:41:41 bliminse joins (~bliminse@host86-188-36-178.range86-188.btcentralplus.com)
14:42:03 <mniip> @let data Expr v = Var v | App v v deriving (Functor, Show)
14:42:04 <lambdabot> Defined.
14:43:19 <mniip> @let instance Monad Expr where { return = Var; Var v >>= h = h v; App f x >>= h = App (f >>= h) (x >>= h) }; instance Applicative Expr where { pure = return; (<*>) = ap }
14:43:19 <lambdabot> .L.hs:156:16: error:
14:43:19 <lambdabot> Ambiguous occurrence ‘Expr’
14:43:19 <lambdabot> It could refer to
14:43:24 <mniip> uh oh
14:43:29 <mniip> but yeah basically this
14:44:16 <smorgasbord> well looks fairly complicated for the me right now. I will do it manually for the moment and try to come back to rewrite it later. thanks for the help everyone!
14:44:44 × Katarushisu quits (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Quit: The Lounge - https://thelounge.chat)
14:45:23 Katarushisu joins (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net)
14:48:06 × Katarushisu quits (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net) (Client Quit)
14:48:13 mcgroin joins (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr)
14:48:43 eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net)
14:48:52 × coolnickname quits (~coolnickn@73.194.7.51.dyn.plus.net) (Quit: ZNC 1.8.1 - https://znc.in)
14:49:17 Katarushisu joins (~Katarushi@cpc147334-finc20-2-0-cust27.4-2.cable.virginm.net)
14:49:54 coolnickname joins (~coolnickn@73.194.7.51.dyn.plus.net)
14:50:57 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
14:53:27 × eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds)
14:55:29 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
15:02:24 kennyd joins (~bc8165b6@217.29.117.252)
15:07:41 ph88_ joins (~ph88@2a02:8109:9e00:71d0:15f2:638c:7ed7:4999)
15:11:32 deadmarshal joins (~deadmarsh@95.38.116.172)
15:11:51 × ph88^ quits (~ph88@2a02:8109:9e00:71d0:6dfb:d68d:ebe:207) (Ping timeout: 264 seconds)
15:12:02 × narendra quits (~user@2a02:8109:b63f:ff7c::56c2) (Ping timeout: 240 seconds)
15:13:25 narendra joins (~user@2a02:8109:b63f:ff7c::56c2)
15:16:09 × mcgroin quits (~mcgroin@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Quit: WeeChat 3.3)
15:18:54 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
15:19:06 × Kaiepi quits (~Kaiepi@156.34.44.192) (Ping timeout: 245 seconds)
15:23:48 pfurla joins (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b)
15:24:40 × alx741 quits (~alx741@186.178.109.84) (Ping timeout: 265 seconds)
15:25:24 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
15:27:46 <maralorn> Does hackage enforce that uploaded versions are increasing?
15:28:32 × narendra quits (~user@2a02:8109:b63f:ff7c::56c2) (Ping timeout: 240 seconds)
15:28:42 <maralorn> I need to backport a fix to an older version of my lib in a setting where I can‘t yet use a newer version of the lib because of dependency clashes.
15:30:06 × lbseale quits (~ep1ctetus@user/ep1ctetus) (Quit: Leaving)
15:30:32 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
15:30:33 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
15:30:33 wroathe joins (~wroathe@user/wroathe)
15:32:22 <hpc> you can add patch releases for previous versions, yes
15:33:40 × boxscape_ quits (~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de) (Quit: Connection closed)
15:35:21 × pfurla quits (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b) (Quit: gone to sleep. ZZZzzz…)
15:35:57 × coolnickname quits (~coolnickn@73.194.7.51.dyn.plus.net) (Ping timeout: 268 seconds)
15:37:12 alx741 joins (~alx741@181.196.69.161)
15:40:25 × kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity)
15:42:20 <maerwald> if you couldn't, then that would be a disaster for PVP :D
15:42:30 <maerwald> since the only reason of having PVP is backporting patches
15:44:32 × alx741 quits (~alx741@181.196.69.161) (Ping timeout: 240 seconds)
15:44:53 <kennyd> how come haskell doesn't have built-in fixed sized arrays? even C has them
15:45:22 <kennyd> or unsigned integral types.. seems like it would be in haskell spirit to make these restrictions at compile time
15:46:01 EvanR joins (~evan@user/evanr)
15:46:30 <hpc> Word ~ Int, Word64 ~ Int64, and Natural ~ Integer
15:47:09 <hpc> and C doesn't really have fixed size arrays
15:47:26 <hpc> it has pointers to memory that's been allocated up to a fixed length :P
15:47:33 <maerwald> I think it does
15:47:59 <maerwald> it's just when you pass an array to a function it degrades to a pointer
15:48:07 <hpc> the size doesn't show up in the type of it, either
15:48:36 <kennyd> hpc, no, C has real fixed size arrays. and you can maintain the size of the array in function declaration. it just isn't common to do so
15:48:54 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
15:49:16 <kennyd> int func(int (*)[10]) <- you can only pass a pointer to array of 10 ints
15:49:17 <EvanR> pass by pointer degradation
15:50:47 <kennyd> and func knows the size pointer points to, at compile time
15:50:54 <kennyd> size of the array pointer points to*
15:51:57 <hpc> https://paste.tomsmeding.com/uygLC9YK compiled for me
15:52:14 <kennyd> hpc, that is not what I wrote
15:52:43 <kennyd> int arg[10] is an int pointer in this context. int (*arg)[10] is a pointer to an array of 10 ints
15:52:51 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
15:52:52 <maerwald> hpc: you get compile time warnings with real arrays in C
15:53:03 <maerwald> in the initializer and in the accessing
15:53:17 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
15:53:43 <lortabac> kennyd: Haskell has arrays, but they are less useful than in other languages, since they either require mutability or copying
15:53:59 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3)
15:54:02 <hpc> warnings don't count :P
15:54:16 <maerwald> hpc: you can turn them into errors
15:54:22 <kennyd> well C standard doesn't distinguish between a warning and compile error. it just talks about diagnostics
15:54:56 <lortabac> kennyd: the common use case for arrays is when you have values that you read frequently and modify seldom
15:55:03 <kennyd> lortabac, I think immutable arrays are still useful. I'm just a bit puzzled why we need third party libraries to restrict the size
15:55:44 <hpc> arrays are part of base
15:55:49 <maerwald> it would have been nice though if passing arrays to functions doesn't degrade them to pointers
15:56:18 <lortabac> kennyd: what do you mean by third party libraries?
15:56:19 <maerwald> that makes little sense to me... sure, cast them to a pointer if you want to do something unsafe
15:56:25 <kennyd> hpc which ones? I see half a dozen array/vector libraries on hackage
15:56:47 <maerwald> well, haskells 'array' package is... let's say "special"
15:56:59 <lortabac> :)
15:57:11 <hpc> argh, misread hoogle
15:57:14 <hpc> https://hoogle.haskell.org/?hoogle=Array
15:57:14 alx741 joins (~alx741@186.178.108.213)
15:57:21 <hpc> (second item)
15:57:23 <maerwald> if you manage to use it in real world code without swearing, I'll buy you a beer
15:57:49 burnsidesLlama joins (~burnsides@dhcp168-025.wadham.ox.ac.uk)
15:58:05 <hpc> i guess you can use GHC.Arr if you want to code like a pirate
15:58:08 <lortabac> maybe we should reformulate kennyd's question as "why does Data.Array suck?"
15:58:09 × ubert quits (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection)
15:58:29 ubert joins (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de)
15:58:35 <hpc> also there's https://hackage.haskell.org/package/vector
15:59:09 <hpc> Data.Array sucks because it's too generic
15:59:30 <maerwald> lortabac: because someone wrote it that way
15:59:37 <hpc> being able to index an array by Ordering isn't worth the tuple nonsense and off-by-one errors
16:00:12 <maerwald> it's very common for programmers to only think about properties and care nothing about ergonomics
16:00:23 <maerwald> that's how we got nix too
16:00:35 <hpc> > array (LT, GT) [(LT, 1), (EQ, 2), (GT, 3)]
16:00:37 <lambdabot> array (LT,GT) [(LT,1),(EQ,2),(GT,3)]
16:01:20 <hpc> > @let wat = array (LT, GT) [(LT, 1), (EQ, 2), (GT, 3)]
16:01:21 <lambdabot> <hint>:1:1: error: parse error on input ‘@’
16:01:27 <hpc> @let wat = array (LT, GT) [(LT, 1), (EQ, 2), (GT, 3)]
16:01:28 <lambdabot> Defined.
16:01:39 <hpc> > wat ! (compare "yes" "no")
16:01:40 <lambdabot> 3
16:01:48 <lortabac> kennyd: regarding the ability to check the size at compile-time, it's certainly doable, but it takes you quickly to singletons territory, which is not something everybody is willing to endure :)
16:01:48 <hpc> features!
16:01:49 <hololeap> kennyd: use vector-sized. it keeps the size of the array at the type level, and it's well used and well maintained
16:02:24 <lortabac> it's definitely not within "simple Haskell"
16:03:24 <hpc> vector-sized also has such neat definitions as https://hackage.haskell.org/package/vector-sized-1.5.0/docs/Data-Vector-Sized.html#v:-43--43-
16:03:32 <hpc> try writing that one in C
16:03:41 <kennyd> hololeap, ok. for context, I'm building a toy chess engine as a practice
16:04:26 <lortabac> these type-level tricks are good as long as all the sizes can be determined statically
16:04:36 <hololeap> yeah vector-sized would be perfect for that. I built a toy game of life board with it
16:05:06 <EvanR> for a toy chess engine you may be served by making a "8 of something" packed data type
16:05:17 <hololeap> there is also that option
16:05:31 <EvanR> since it's only 8
16:05:35 <lortabac> once you start serializing or reading arrays of unknown size from a database you start suffering
16:05:38 <hpc> you can also do away with the arrays entirely, and use bit masks
16:05:53 <hpc> there are 64 squares on a chessboard, and guess what type has 64 booleans packed into it
16:06:00 <EvanR> lol
16:06:01 <hpc> stockfish uses that extensively
16:06:24 <EvanR> if only the CPU came with a chess instruction
16:06:49 <EvanR> wait... microcode xD
16:06:51 <maerwald> how does bool help on a chess board... "there's a piece on the square"?
16:06:53 <hpc> EvanR: it's on intel's roadmap right after the http-post-xml-to-facebook instruction
16:07:28 <EvanR> use several words one for each piece-mask
16:07:30 <hpc> maerwald: what squares are attacked, what squares are defended, where pieces can move next turn, etc
16:07:31 × Neuromancer quits (~Neuromanc@user/neuromancer) (Read error: Connection reset by peer)
16:07:39 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
16:07:51 <hpc> you just have lots and lots of masks, for their own specific purpose
16:08:06 <maerwald> I bet that code is easy to follow
16:08:10 <hpc> the actual board state, you do very little with
16:08:19 <hpc> it is, in fact
16:08:20 Kaiepi joins (~Kaiepi@156.34.44.192)
16:08:46 <hpc> although i was messing with stockfish before they added the NN
16:08:51 <hpc> so maybe it's slightly messier now
16:09:16 slack1256 joins (~slack1256@191.126.227.86)
16:11:43 × slac59793 quits (~slack1256@181.43.229.27) (Ping timeout: 268 seconds)
16:11:55 Feuermagier_ joins (~Feuermagi@154.28.188.22)
16:12:26 × lortabac quits (~lortabac@2a01:e0a:541:b8f0:859e:604a:c9a4:ff01) (Quit: WeeChat 2.8)
16:14:31 × Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 245 seconds)
16:14:35 <hololeap> wait, why isn't there a (Comonad w1, Comonad w2) => instance Comonad (Compose w1 w2)
16:14:56 <hololeap> comonads don't compose either?
16:15:04 <hololeap> I would think they would
16:15:09 <EvanR> why would they
16:15:40 <hololeap> well, extract certainly would. I haven't thought too hard about duplicate and the laws
16:15:51 <mniip> well?
16:15:57 <mniip> the same thing happens with monads?
16:16:06 × dsrt^ quits (~dsrt@68.101.58.90) (Remote host closed the connection)
16:16:37 <EvanR> maybe you want to invent comonad transformers xD
16:16:52 <hololeap> that's true
16:17:50 × pavonia quits (~user@user/siracusa) (Quit: Bye!)
16:24:29 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
16:24:29 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
16:24:29 wroathe joins (~wroathe@user/wroathe)
16:24:40 × alx741 quits (~alx741@186.178.108.213) (Ping timeout: 268 seconds)
16:25:39 × DNH quits (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd) (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:28:57 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51)
16:29:37 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds)
16:31:36 Carras joins (~carras@202.184.44.217)
16:33:32 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 240 seconds)
16:34:13 DNH joins (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd)
16:35:21 × Carras quits (~carras@202.184.44.217) (Client Quit)
16:38:05 _ht joins (~quassel@82-169-194-8.biz.kpn.net)
16:38:44 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51) (Remote host closed the connection)
16:39:06 alx741 joins (~alx741@186.178.109.194)
16:40:47 tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net)
16:45:19 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
16:46:18 deadmarshal joins (~deadmarsh@95.38.116.172)
16:47:45 × cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3)
16:49:55 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
16:49:56 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Ping timeout: 245 seconds)
16:51:36 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
16:52:28 <janus> hmm a haskell webbrowser from Hallgren and co from 1994 is on the HN frontpage :O
16:53:44 <[itchyjunk]> Are there "objects" in haskell like in Java? for example, String is an object there
16:54:39 × cosimone quits (~user@2001:b07:ae5:db26:a7aa:8027:6b4e:2fb3) (Ping timeout: 250 seconds)
16:54:58 <janus> [itchyjunk]: no but you can define functions that all take the same record as the first parameter and return a modified record
16:55:00 <yushyin> (a closure over a mutable state could be seen as an object :P)
16:55:57 <janus> [itchyjunk]: with that pattern, `obj.method(arg0, arg1)` would be written `method obj arg0 arg1` but it would be pure of course
16:56:21 <janus> [itchyjunk]: you can put it in a monad and it starts looking impure
16:56:40 × Cajun quits (~Cajun@user/cajun) (Quit: Client closed)
16:56:40 <[itchyjunk]> ah, idk monads yet. but the rest makes sense
16:58:05 <sm> a haskell web browser from 1994 - nice
16:58:33 <janus> the web is something else now, that part is the least interesting :P
16:59:05 <janus> fudgets are more interesting though. i always wanted to know, how do fudgets compare to other streaming libraries and UI paradigms?
16:59:34 dsrt^ joins (~dsrt@68.101.58.90)
17:00:09 <EvanR> after your first "object" of that kind you make... you will quickly become tired of the boilerplate and wonder if someone invented an entire field of computer science to streamline it xD
17:01:38 <[itchyjunk]> so a string is of type String. but string is also of type list of characters?
17:01:47 <[itchyjunk]> so String = [char] ?
17:02:04 <[itchyjunk]> at least i thought i saw the type String somewhere
17:03:06 <janus> it's just an alias, you can replace every String with [Char] and it would still compile
17:03:12 <yushyin> [itchyjunk]: String is just a type synonym of [Char]
17:03:16 <[itchyjunk]> ah great
17:03:36 <janus> it's not great! it's horrible!
17:04:18 <[itchyjunk]> so `"Hello friend" -> ["Hello", "friend"]` is `f :: [Char] -> [[]]` ?
17:04:33 <[itchyjunk]> i was gonna say `[[Char]]` but that might imply single char?
17:04:35 <janus> [] is not a valid type
17:04:38 <[itchyjunk]> wait not, maybe that is correct
17:04:41 <monochrom> No. ['H', 'e', 'l', 'l', 'o', ' ', 'f', ...]
17:04:42 <[itchyjunk]> oh..
17:04:46 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 268 seconds)
17:04:58 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
17:05:32 × mbuf quits (~Shakthi@171.61.241.63) (Quit: Leaving)
17:05:42 <[itchyjunk]> no i want `["hello","friend"]` and am trying to figure out the signature. so `f :: [Char] ->[[Char]]` ? a list containing lists of characters
17:05:53 <monochrom> Although, upon seeing [Char], one could not logically imagine "like ["Hello", "friedn"]"
17:06:05 <[itchyjunk]> [['H',..,'o']['F',..,'d']]
17:06:18 <monochrom> I mean, it is not like Unicode has code points for English words...
17:06:37 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
17:07:19 <janus> yes ["Hello","friend"] is the same as [['H',...,'o'],['F',...,'d']]
17:07:21 <janus> those are values
17:07:26 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 245 seconds)
17:07:54 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
17:08:01 <janus> the function that splits by space is indeed String -> [String] which is the same type as [Char] -> [[Char]]
17:08:21 <janus> :t words
17:08:22 <lambdabot> String -> [String]
17:08:22 <[itchyjunk]> ah okay, so that's the signature i want
17:10:48 <janus> just like String is an alias for [Char] on the type level, you can see "hi" as an alias for ['h','i']
17:10:56 ptrcmd_ is now known as ptrmcd
17:10:57 <EvanR> maybe [itchyjunk] is confused about the difference between String and Char
17:10:59 ptrmcd is now known as ptrcmd
17:11:05 <[itchyjunk]> I think i get it now
17:11:06 <EvanR> many languages do not know the difference
17:11:13 <[itchyjunk]> String is just [Char]
17:11:19 <monochrom> But Java has a difference.
17:11:20 <EvanR> yeah but Char
17:11:33 <EvanR> isn't just a string of length 1 xD
17:11:38 <[itchyjunk]> aka String is a fake sugar syntax
17:11:54 <[itchyjunk]> hmm idk how Char gets implemented, true
17:12:04 <[itchyjunk]> but there is primitive types in Java and char is that..
17:12:06 × kjak quits (~kjak@pool-108-45-56-21.washdc.fios.verizon.net) (Ping timeout: 256 seconds)
17:12:06 <EvanR> it's like a number
17:12:08 <EvanR> atomic
17:12:11 <[itchyjunk]> internally, it's some unicode uumber
17:12:14 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
17:12:20 <[itchyjunk]> 67 = A or somesuch
17:12:26 <EvanR> yeah basically
17:12:39 <EvanR> so a string is a list of that
17:12:43 slac78719 joins (~slack1256@191.126.227.81)
17:12:45 <monochrom> Same for our Char.
17:12:48 <[itchyjunk]> i think now, A and a smiley emojy are the same because of unicode
17:13:00 <[itchyjunk]> encoded the same way that is
17:13:22 <monochrom> Well, "same" for now. There is more to support laziness.
17:13:27 <[itchyjunk]> so use can have irc nicknames with emojies in ircd's that support unicode
17:13:28 <EvanR> > "A😀"
17:13:30 <lambdabot> "A\128512"
17:13:44 <[itchyjunk]> 6 digit number?
17:13:47 <dsal> Is there an easy way to like, download hackage source (latest or something)? I wanted to do a quick survey.
17:13:56 <[itchyjunk]> we went from 3 digit numbers to 6 digit already? damn..
17:14:02 <janus> both char and strings are 'atomic' in both java and haskell, no? you can't mutate a java string (keeping its identity) without fancy tricks
17:14:09 <EvanR> it's up to 21 bits I think
17:14:15 <[itchyjunk]> String is an object in java
17:14:15 <dsal> In particular, I'm curious how ByteString is imported.
17:14:21 <[itchyjunk]> char is primitive type
17:14:23 slack7679 joins (~slack1256@181.42.49.169)
17:14:38 <EvanR> by "atomic" I mean you can subdivide it into smaller data
17:14:46 <EvanR> can't*
17:15:13 <janus> ah i interpreted it as immutable somehow, oops
17:15:14 × slack1256 quits (~slack1256@191.126.227.86) (Ping timeout: 268 seconds)
17:16:06 <EvanR> good to know that about strings in java though xD
17:16:12 <EvanR> why am I learning so much about java in here
17:16:12 <monochrom> Atomic weapon/fuel keeps decaying. Clearly mutable. And mutant-causing too, in superhero comics.
17:16:35 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
17:16:43 <[itchyjunk]> you use '' for chars right?
17:16:55 <janus> right check this out
17:17:00 <janus> :t 'A'
17:17:00 <lambdabot> Char
17:17:01 <[itchyjunk]> if x /= ' ' makes sense? to check if x is same as space
17:17:06 <[itchyjunk]> ah
17:17:26 × slac78719 quits (~slack1256@191.126.227.81) (Ping timeout: 260 seconds)
17:17:43 <janus> [itchyjunk]: do you know how to use ghci?
17:18:07 <[itchyjunk]> yes, i am :l my functions into ghci and running them that way for everything currently
17:18:16 <[itchyjunk]> well i know how to run ghci.. xD
17:18:20 <[itchyjunk]> not sure what counts as usage
17:18:24 <janus> dsal: isn't it just github.com/haskell/hackage-server ? or what are you referring to when you say hackage?
17:19:01 <janus> [itchyjunk]: ah great. ok, so in ghci you can use ":t" to query the type of something like i did in this chat
17:19:22 <geekosaur> dsal, I think there are some hackage packages for that
17:19:37 <[itchyjunk]> right, i did use :t for functions but didn't think about using it for data types :D
17:20:04 <EvanR> [itchyjunk], in ghci do putStrLn "A😀"
17:20:10 <EvanR> fun times
17:20:11 <dsal> janus: The actual packages -- I want to survey.
17:20:24 <dsal> geekosaur: I found a sort of howto guide with a bunch of steps I might be able to reproduce.
17:20:41 <[itchyjunk]> https://bpa.st/VYGA
17:21:04 <EvanR> you didn't put quotes
17:21:08 <[itchyjunk]> ah..
17:21:17 <janus> apropos i am trying to write a stackage not-solver for cabal, where do cabal devs hang out?
17:21:54 <maerwald> janus: what is a stackage not-solver?
17:22:05 <[itchyjunk]> lexical error in string/character literal at end of input
17:22:15 <[itchyjunk]> ah nm
17:22:32 <janus> maerwald: cabal has a "solver" configuration flag which currently has one option "modular". the modular solver was written to replace the top-down solver 10 years ago
17:22:37 <geekosaur> https://hackage.haskell.org/package/hackage-mirror
17:22:37 <geekosaur> #hackage I think?
17:22:37 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
17:22:39 <[itchyjunk]> "A😀" :: [Char] heh interesting
17:22:46 <EvanR> ikr
17:22:53 <dsal> There are currently 123453 package*versions in hackage.
17:23:30 <janus> maerwald: since stackage doesn't need solving anything it's not really a solver. so i can't call it "stackage solver" since it isn't actually solving anything. but i put it such that it goes in the "solver" config space option, where you used to put top-down or modular, and where you can now only put modular
17:23:50 <maerwald> janus: you mean freeze files?
17:23:56 <maerwald> that already exists
17:24:13 <EvanR> [itchyjunk], ord :: Char -> Int from Data.Char gives you the number for the char, very handy
17:24:18 geekosaur joins (~geekosaur@xmonad/geekosaur)
17:24:19 <maerwald> and that's likely how the stackage support will be implemented
17:24:30 <janus> maerwald: but freeze files are not in the same syntax as build.yaml
17:24:51 <maerwald> janus: you can convert that easily
17:24:52 <janus> maerwald: and freeze files are project specific, they can't meaningfully be shared across projects right?
17:25:03 <maerwald> janus: there's a ticket for remote freeze files
17:25:08 <hololeap> dsal: you know you want to upload 3 more
17:25:10 × burnsidesLlama quits (~burnsides@dhcp168-025.wadham.ox.ac.uk) (Remote host closed the connection)
17:25:27 <maerwald> janus: I suggest you read the topic about the hackage support, probably all your questions will be answered there
17:25:39 <janus> maerwald: where is that?
17:25:57 <dsal> hololeap: Yeah, that's almost distracting me...
17:26:02 <maerwald> janus: https://github.com/haskell/cabal/issues/7556
17:26:11 <hololeap> haha
17:29:24 jstolarek joins (~jstolarek@137.220.120.162)
17:29:58 <janus> [itchyjunk]: beware, just because it looks the same, it could be different:
17:30:02 <janus> > putStrLn "\xe9"
17:30:04 <lambdabot> <IO ()>
17:30:11 <janus> % putStrLn "\xe9"
17:30:11 <yahb> janus: é
17:30:19 <janus> % putStrLn "\x65\x301"
17:30:19 <yahb> janus: é
17:30:49 SSCC joins (~SSCC@59-102-95-229.tpgi.com.au)
17:30:58 boxscape_ joins (~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de)
17:31:08 <edwardk> hololeap: you can look into Day u v -- for two comonads u and v. that at least composes
17:31:23 slice joins (~slice@user/slice)
17:33:14 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
17:33:14 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
17:33:15 wroathe joins (~wroathe@user/wroathe)
17:33:25 <hololeap> oh no... kan-extensions... XD
17:34:39 <[itchyjunk]> Oh ohh, ,i've confused myself
17:34:46 <hololeap> edwardk: where would you recommend I look into that?
17:34:46 [itchyjunk] takes a short break in hopes of unconfusing self
17:35:27 lbseale joins (~ep1ctetus@user/ep1ctetus)
17:35:40 <janus> maerwald: ok very cool, i hadn't internalized that it's coming in cabal 3.8
17:36:39 <edwardk> hololeap:phil freeman wrote it up at one point: https://blog.functorial.com/posts/2016-08-08-Comonad-And-Day-Convolution.html
17:37:18 <hololeap> cool, thanks. that might get me one step closer to penetrating that library
17:39:14 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51)
17:39:18 <janus> the beginning of the read still says cabal 3.10 but that was moved ahead, i guess...
17:39:25 <edwardk> re: comonads not composing, its the same problem as with monads. you wind up needing to take FG -> FGFG to write duplicate but two arbitrary comonads just give you what you need to get FFGG by duplicating each part. Then you have no way to distribute them to get FGFG
17:40:27 <edwardk> for monads OTOH, join needs to take FGFG -> FG, and sure you could use the join of each monad if you had FFGG -> FG -- but you lack a distributive law in general to get FGFG -> FFGG to apply that latter step
17:40:40 <edwardk> so you get stuck in the middle in both cases.
17:41:00 <hololeap> gotcha
17:42:10 <boxscape_> so then... is there some dual to Day that lets you compose any two monads?
17:42:20 <EvanR> stupid question, why does composing comonads require you to do FG -> FGFG
17:42:25 <hololeap> Night
17:42:50 <boxscape_> hololeap I suppose I could have thought of that myself..
17:43:03 <edwardk> a subset of the monad/comonad transformers come from taking comonads/monads that _do_ have such a distributive law. e.g. you can write f (e -> a) -> e -> f a. and that distributive law is the basis of ReaderT
17:43:04 <hololeap> boxscape_: I was joking :p
17:43:15 <boxscape_> https://hackage.haskell.org/package/functor-combinators-0.4.1.0/docs/Data-Functor-Combinator.html#t:Night
17:43:20 <edwardk> (e, f a) -> f (e, a) -- gives you the building block for WriterT, etc.
17:43:41 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51) (Ping timeout: 245 seconds)
17:43:51 <hololeap> EvanR: because duplicate on `W1 (W2 a)` would mean getting `W1 (W2 (W1 (W2 a)))` if that makes sense
17:44:01 <EvanR> oh right
17:44:08 <edwardk> EvanR: consider the type signature for 'duplicate' for Compose f g where f and g are comonads, under the assumption you are writing ... hololeap got it
17:44:47 <EvanR> and now I see the monad version
17:44:57 <EvanR> and all that that entails (mtl)
17:45:40 <boxscape_> (no idea though if the Night I linked lets you compose Monads, from the description I'd guess not)
17:46:33 <hololeap> FunctorBy Night -- sounds like the setup to a movie
17:46:56 <EvanR> wait... Night is real?
17:46:59 <dminuoso> smorgasbord: With fmap on a tree like structure you cant change the shape of the tree, but you can universally map and replace each element.
17:47:39 <dminuoso> smorgasbord: We can concisely express this law as `fmap id = id`, which means if you fmap with the identity function, it must give you the same thing back. It cant change the structure, drop elements, reorder them, etc.
17:48:59 <EvanR> ah it's not dual to Day
17:49:06 <EvanR> unfortunately xD
17:49:09 × bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds)
17:49:18 <edwardk> boxscape_: there's a fancy phrase tarmo uustalu likes to use saying 'the dual of substitution is redecoration' -- it is the thing that finally gave me the "right" reference frame for thinking about comonads in haskell. that you are basically taking some 'view of a structure and computing local answers (w a -> b) before you apply them at every possible 'location' in w, and reassemble the structure: w a -> w b... out of those little
17:49:18 <edwardk> tiles. whats telling to me is the comonad doesn't change 'shape' in the process it has just as many 'b's as it had 'a's. which is weird compared to the usual monad story, where >>='ing lists can change the number of elements in the list. the comonadic operations redecorate the structure, but they don't change it.
17:49:31 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
17:49:54 <edwardk> the day convolution of two comonads, is more about convolving two different comonads notion of shape and location, and making something that has a 'location' for the product of that notion.
17:50:13 <edwardk> that works really well when not reshaping things
17:51:01 bitdex joins (~bitdex@gateway/tor-sasl/bitdex)
17:52:02 <boxscape_> hm, interesting
17:54:03 × benin quits (~benin@183.82.179.164) (Quit: The Lounge - https://thelounge.chat)
17:54:04 <edwardk> now if you want to get fancy, a better frame for thinking about comonads is maybe to dip over and look at comonads in Poly, and show they are in 1:1 correspondence with categories, and then poke at the day convolution story above and see how it compares with product categories
17:54:54 benin joins (~benin@183.82.179.164)
17:56:39 <hololeap> if f and g are both distributive and comonads, does that mean you could get an automatic comonad instance for the composition?
17:57:02 <hololeap> or maybe only one of them has to be distributive?
17:57:06 <edwardk> Distributive is a very strong class
17:57:24 <hololeap> true, not many functors are distributive
17:57:46 <edwardk> Distributive f is saying f ~ (->) e for some e.
17:57:59 <hololeap> oh, I guess this goes back to the relationship between adjunctions and comonads
17:58:00 <edwardk> so now you're reinventing Traced
17:58:23 <dminuoso> edwardk: (Jokingly) But Distributive is not very strong. It doesn't even have Strong as a superclass.
17:58:39 <edwardk> for something to be both Distributive _and_ a Comonad you wind up with a monoid on that 'e'
17:58:41 Jeanne-Kamikaze joins (~Jeanne-Ka@static-198-54-131-107.cust.tzulo.com)
17:58:47 <edwardk> dminuoso: *headdesk*
17:59:27 <hololeap> edwardk: I've been meaning to ask you, where did you get the terms that you use in your profunctors library? is there a good reference for all those concepts somewhere?
17:59:47 <edwardk> hololeap: in the head version of distributive (which builds on hkd), distributive becomes a bit stronger, able to provide all the implied instances you'd expect if you need it to, and it can recover that monoid.
18:00:03 <dminuoso> hololeap: ncatlab.org? :p
18:00:25 <edwardk> some i plucked out of thin air, pastro and street wrote a paper on tambara modules, i abused some vocabulary there
18:00:26 <dminuoso> edwardk's prime hobby is turning that wiki into hackage.
18:00:44 <dminuoso> And I mean this non-jokingly.
18:01:34 burnsidesLlama joins (~burnsides@dhcp168-025.wadham.ox.ac.uk)
18:01:39 <hololeap> edwardk: ok, what about subprofunctor?
18:01:43 <hololeap> what does that mean?
18:01:44 <dsal> This survey of Data.ByteString imports is interesting. I was told not to use `BS` because it's supposed to be `SB` which sounds like... the other one. Turns out, most imports use `B`, followed closely by `BS`. `SB` is in the list with nearly three times the occurrence of `QtahDBS`.
18:02:07 × geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection)
18:02:37 <dminuoso> dsal: I have never seen SB before.
18:02:47 <dminuoso> What is the S trying to imply? Strict?
18:02:53 <dminuoso> Would you also have LB then?
18:03:25 × ubert quits (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection)
18:03:33 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds)
18:03:34 <dsal> Yes.
18:03:48 ubert joins (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de)
18:03:53 dminuoso uses BS and BSL
18:04:06 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
18:04:13 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
18:04:15 <dsal> I've not got everything downloaded yet, but it's approximately 3240:102 BS:SB right now.
18:04:22 <maerwald> SB is for ShortByteString, no?
18:04:33 <dminuoso> I use SBS for ShortByteString
18:04:59 <dsal> Who knows. There are a lot of these things that are just "this is the standard way to do this" declarations that I can't find any evidence for other than this one guy thinks he's a standards body.
18:05:22 × chomwitt quits (~chomwitt@94.69.34.153) (Ping timeout: 256 seconds)
18:05:50 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
18:05:52 <dsal> It's possibly a language barrier, but I'm quite certain he thinks he's smarter than everyone.
18:05:59 Lycurgus joins (~juan@98.4.112.204)
18:06:11 <EvanR> wait... BS is BS now?
18:06:14 geekosaur joins (~geekosaur@xmonad/geekosaur)
18:06:23 <hololeap> haha way to go dsal, I'm sure the look on his face will be priceless when you hand him the survey :p
18:06:33 <EvanR> is haskell going to be associated with satanism too
18:06:37 × ubert quits (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection)
18:06:48 <dsal> In one of the lens discussions, I was trying to understand what the actual argument was and it was "People think I don't like lens because I don't understand it. I do understand it and it's a bad idea." It's like... OK, but that wasn't the question.
18:06:59 ubert joins (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de)
18:07:07 × burnsidesLlama quits (~burnsides@dhcp168-025.wadham.ox.ac.uk) (Ping timeout: 260 seconds)
18:07:12 <dsal> "People think I don't understand linear algebra. I wrote a book on it!" OK, but I wasn't asking you about linear algebra.
18:07:46 <hololeap> that says something that people still don't think he understands it after writing a book on it
18:07:50 <dsal> hololeap: I honestly don't think he cares. He's pretty sure everyone's wrong about things and his way is the only path to enlightenment.
18:08:10 <edwardk> hololeap: https://en.wikipedia.org/wiki/Subfunctor
18:09:03 <hololeap> edwardk: oh, that's all you meant :p
18:09:12 <dsal> In the end, it's 127 for SB and 23 for QtahDBS. Maybe I should start using QtahDBS
18:09:41 <hololeap> definitely QtahDBS
18:09:48 <EvanR> I guess it's inevitable. Once there are actual haskell jobs, there must necessarily be stupid haskell jobs xD
18:10:44 <dsal> Also in use (in order of frequency): B, S, P, D, C, L, A, F, K, X, J, E and surprisingly last, B'
18:10:49 × benin quits (~benin@183.82.179.164) (Quit: The Lounge - https://thelounge.chat)
18:11:31 cosimone joins (~user@2001:b07:ae5:db26:a7aa:8027:6b4e:2fb3)
18:11:38 <dsal> (actually, X, J, E, and B' are all the same frequency, so it's not necessarily last, just sorted higher)
18:11:51 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
18:13:58 benin joins (~benin@183.82.179.164)
18:17:30 lavaman joins (~lavaman@98.38.249.169)
18:17:42 × benin quits (~benin@183.82.179.164) (Client Quit)
18:18:33 <[itchyjunk]> for `f :: [Char] -> [[Char]]`, `f [] = [[]]` makes sense right?
18:18:53 <dsal> Why not `f [] = []` ?
18:19:02 <dsal> Not enough context to know which one is better.
18:19:20 <[itchyjunk]> isn't it expecting [[]] ?
18:19:24 <[itchyjunk]> due to the signature
18:19:30 <geekosaur> the outer list could be empty
18:19:40 <monochrom> > [] :: [[Char]]
18:19:41 <lambdabot> []
18:19:43 <monochrom> is legal
18:19:48 <monochrom> > [] :: [[[[[Char]]]]]
18:19:49 <lambdabot> []
18:19:51 <monochrom> is too
18:19:52 <geekosaur> with [[]] the outer list has one item, the inner one is empty
18:20:07 <[itchyjunk]> oh
18:20:22 <dsal> And thus zero was invented.
18:20:33 <monochrom> But [[]] is not wrong either. Depends on what you want f to do.
18:20:45 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
18:20:46 <geekosaur> which is what dsal said
18:20:49 <dsal> What the `f` do you want?
18:20:54 <geekosaur> heh
18:20:55 <monochrom> haha
18:20:57 <[itchyjunk]> lol
18:22:21 jakalx joins (~jakalx@base.jakalx.net)
18:23:02 jgeerds joins (~jgeerds@55d45b75.access.ecotel.net)
18:23:34 <monochrom> This is why I don't say "makes sense" very often. What does it even mean?
18:24:05 <[itchyjunk]> yes it's doesn't make sense to say that
18:24:08 <monochrom> type checks? the right thing to do? understandable? sympathizable?
18:24:18 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds)
18:24:29 <tom__> Does it not mean "I understand what you said"?
18:24:51 <monochrom> See that's the point. Sometimes yes, sometimes something else.
18:25:32 <monochrom> "I understand what you are saying" so it makes sense, but "but you are wrong there" so it doesn't make sense, too.
18:25:44 <tom__> Natural language huh
18:25:53 <monochrom> natural languages die die die
18:26:21 <tom__> haha
18:27:33 econo joins (uid147250@user/econo)
18:28:15 <tom__> Is there a data structure which would model the positions of players at a table who are either active or inactive. Obviously a single list works but separate data structures for inactives and actives would simplify game logic and validation.
18:29:03 × Jing quits (~hedgehog@115.207.50.95) (Read error: Connection reset by peer)
18:29:03 <tom__> I'm looking for two data structures that share ordering but are parameterized by different types.
18:30:43 <dsal> tom__: It means I think I understand something that I think you said and I want you to think that your idea is right even though I probably don't know what you're talking about.
18:30:54 <monochrom> haha
18:31:26 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Quit: WeeChat 3.3)
18:31:45 <dsal> tom__: You can convert the full set to the subset pretty easily, right?
18:31:50 <tom__> haha
18:32:00 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
18:32:30 <dsal> Here are the results from my very important survey: https://usercontent.irccloud-cdn.com/file/hKXNfFFF/bytestring.png
18:32:36 <tom__> dsal: Yeah just a simple filter on the list right
18:33:01 <dsal> Yeah, once you have functions that give you the things you think you need a structure for, you don't need to think about the structure anymore.
18:33:17 <tom__> Makes sense
18:33:22 <dsal> haha
18:33:24 <tom__> :D
18:33:36 <monochrom> "what have I done???!!!"
18:34:05 × lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection)
18:34:06 <tom__> Okay so just a single list/vector then
18:34:13 <[itchyjunk]> how do you do nothing?
18:34:20 <monochrom> Cannot.
18:34:21 <[itchyjunk]> if blah then blah else do nothing
18:34:22 <zzz> dsal makes census
18:34:24 <[itchyjunk]> hmm
18:34:47 <geekosaur> well. "do nothing" can make sense in certain contexts. at some point you'll have to show code
18:34:53 <geekosaur> @where paste
18:34:53 <lambdabot> Help us help you: please paste full code, input and/or output at e.g. https://paste.tomsmeding.com
18:35:00 <monochrom> But ask yourself why you need that "nothing". The reason will lead to a solution.
18:35:19 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
18:35:50 <dsal> There's that zero again.
18:36:25 <dsal> I want to add 1 if this is greater than three, but I don't want to add anything otherwise and this is making me add something.
18:36:35 <tom__> Why do we need validation when everything can be correct by construction
18:36:53 <tom__> Assume no parsing
18:36:56 <dsal> Not everything can be, but some people really like making things hard and unsafe.
18:37:05 <geekosaur> because you can't always be correct by construction in Haskell.
18:37:23 dsal totally isn't talking about really annoying things on a project today
18:37:24 <monochrom> I consider validation to be part of parsing.
18:37:29 <geekosaur> at some point that starts to require fancies like dependent types, where you have to carry around a proof that it's correct
18:37:54 <tom__> Yeah
18:38:01 <monochrom> Well, OK, I don't always. I am OK with type-checking after parsing, for example.
18:38:02 <geekosaur> or yes, parsing, or other cases where something comes from "outside" and you don't get to assume correctness
18:38:06 <geekosaur> or even sanity
18:38:07 <tom__> Validation is part of parsing interesting
18:39:10 <tom__> So should I strive for correct by construction only when the tools needed to do so are minimalistic - ADTs usually
18:39:13 <monochrom> But most people's idea of "validation" is trivial conditions like "the age field must be non-negative" so why don't you check that during parsing already.
18:39:35 <dsal> The lexi-lambda post makes an argument to sort of separate these concepts. A parser will reject invalid data. A validator will just tell you if your data is valid. It's good to avoid the latter.
18:39:36 <tom__> Yeah
18:39:50 <monochrom> I strive for correct-by-construction iff pragmatic.
18:40:02 <dsal> yeah. You can go overboard and make it harder.
18:40:09 <tom__> Liquid haskell
18:40:15 <tom__> For my crud app
18:40:16 <dsal> I have this image I got from an old war archive. https://usercontent.irccloud-cdn.com/file/EzyJmco3/error.png
18:40:17 <xerox> (i strive for correct-by-construction) iff pragmatic
18:40:25 × jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Remote host closed the connection)
18:40:32 × rkrishnan quits (~user@171.48.57.101) (Ping timeout: 240 seconds)
18:40:40 × dyeplexer quits (~dyeplexer@user/dyeplexer) (Remote host closed the connection)
18:40:44 jonathanx joins (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se)
18:40:49 <[itchyjunk]> say `f :: a -> a`, does `[f]` imply [a] then?
18:40:53 <tom__> I am going to confuse people at work with iff
18:41:02 <tom__> Stop misspelling if!
18:41:15 <dsal> [itchyjunk]: f is id. I'm not sure what you're asking though.
18:41:25 <dsal> tom__: I had someone correct one of my PRs before submitting it while I was asleep.
18:41:40 <[itchyjunk]> hmm
18:41:47 <tom__> Correct in what way?
18:41:52 <dsal> s/iff/if/
18:41:57 <tom__> haha
18:42:05 <monochrom> What is "`[f]` imply [a]"?
18:42:24 <[itchyjunk]> i want to make a list out of what f returns
18:42:49 <monochrom> and?
18:43:09 <dsal> like, `[f x]`?
18:43:10 <zzz> [itchyjunk]: rememeber that there' an implicit forall a. in your a -> a, so f = id is the only solution
18:43:25 × lbseale quits (~ep1ctetus@user/ep1ctetus) (Ping timeout: 250 seconds)
18:44:31 <dsal> "make a list out of what f returns" is kind of a weird way to think about things. Do you just want a list of one item? That's [x]. If you want more than one thing, then where do they come from?
18:44:42 <EvanR> correct by construction crud apps? UrWeb?
18:44:51 <monochrom> See, programming is a special case of explaining yourself clearly, as opposed to intuitively.
18:45:24 <[itchyjunk]> hmmm
18:45:33 <[itchyjunk]> the [[Char]] is throwing me off honestly
18:45:45 <EvanR> imagine it says [String] then
18:45:46 <dsal> Unless you're programming in perl, where you can pretty much just type anything and the runtime will say "make sense"
18:45:59 <monochrom> :)
18:46:01 <zzz> monochrom: programming is a way to find out that what your exaplanation was wrong to begin with
18:46:03 <tom__> haha
18:46:13 <EvanR> or imagine that [[a]] is a list of rows of a
18:46:19 <EvanR> or columns
18:46:27 <zzz> s/what//
18:46:29 <geekosaur> rubber duck explaining?
18:46:51 <dsal> The other way to think of it is to just not think of lists of lists and only think in one dimension, get that done, and then think of that whole dimension as one thing and move on to the next dimension.
18:46:53 <EvanR> [[[a]]] is a list of layers of that xD
18:46:59 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
18:47:22 <[itchyjunk]> ill think about it somemore before showing my code but basically
18:47:24 <dsal> If you have a `a -> b` you don't need to think of a `[a] -> [b]` because that's already there.
18:47:51 <[itchyjunk]> f "ab cd" ["a","b","c","d"], but what i want is ["ab","cd"]
18:47:54 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
18:47:57 <[itchyjunk]> so i think i am in somewhat of a right track
18:48:03 <[itchyjunk]> just the details need to be worked out
18:48:11 <dsal> > unwords "ab cd"
18:48:12 <lambdabot> error:
18:48:12 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
18:48:12 <lambdabot> • Couldn't match type ‘Char’ with ‘[Char]’
18:48:12 <lambdabot> Expected type: [String]
18:48:16 <dsal> damnit
18:48:18 <zzz> ahah
18:48:19 <dsal> > words "ab cd"
18:48:21 <lambdabot> ["ab","cd"]
18:48:28 <EvanR> ununwords
18:48:31 <dsal> @src words
18:48:31 <lambdabot> words s = case dropWhile isSpace s of
18:48:31 <lambdabot> "" -> []
18:48:31 <lambdabot> s' -> w : words s'' where (w, s'') = break isSpace s'
18:48:34 <[itchyjunk]> yes something like that
18:48:37 <dsal> ok, that's probably not helpful.
18:48:48 <zzz> wth
18:49:09 <monochrom> I think it's helpful. Sometimes you didn't know that you have to code like that.
18:49:18 <monochrom> or even that you can.
18:49:27 <zzz> but why
18:49:32 <dsal> Yeah, just ignore `break` I think the shape is helpful.
18:49:47 <zzz> @src break
18:49:48 <lambdabot> break p = span (not . p)
18:49:53 <dsal> obviously
18:50:23 <[itchyjunk]> my approach is a bit err odd
18:50:24 <[itchyjunk]> https://bpa.st/BSQA
18:50:30 <[itchyjunk]> ignore g, was using that to test things
18:51:01 <dsal> [itchyjunk]: Yeah, you're just putting everything in its own list, which you knew already.
18:51:17 <[itchyjunk]> right
18:51:32 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Ping timeout: 240 seconds)
18:51:32 × FragByte quits (~christian@user/fragbyte) (Ping timeout: 265 seconds)
18:51:47 <dsal> But if you want to group things together while they're not spaces, then you keep adding to that first list while it's not a space, then ignore spaces, then recurse.
18:52:05 <monochrom> You are asking yourself, how to ensure f "hi there" = ["hi", "there"].
18:52:19 <[itchyjunk]> thats what i was attempting to do, x: f xs does the keep going part
18:52:22 <monochrom> And by the induction hypothesis, f "i there" = ["i", "there"]
18:52:39 <[itchyjunk]> but [x: f xs] wasn't doing what i thought it might do
18:52:45 <monochrom> So your job is to start with ["i", "there"] and build ["hi", "there"]
18:53:02 <geekosaur> (x : f xs) ?
18:53:05 FragByte joins (~christian@user/fragbyte)
18:53:12 × Jeanne-Kamikaze quits (~Jeanne-Ka@static-198-54-131-107.cust.tzulo.com) (Quit: Leaving)
18:53:27 <geekosaur> > 'a' : []
18:53:28 <lambdabot> "a"
18:53:36 <geekosaur> > ['a' : []]
18:53:37 <lambdabot> ["a"]
18:53:39 <monochrom> (Also note how nicely I have avoided framing it as "change" :) )
18:54:07 <[itchyjunk]> oh i'll try to use this hint geekosaur just gave
18:56:51 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
18:57:10 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
18:57:20 × kennyd quits (~bc8165b6@217.29.117.252) (Quit: http://www.okay.uz/)
18:57:27 jakalx parts (~jakalx@base.jakalx.net) (Error from remote client)
18:59:27 × boxscape_ quits (~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de) (Ping timeout: 250 seconds)
19:01:19 × max22- quits (~maxime@2a01cb0883359800917d653070f119e8.ipv6.abo.wanadoo.fr) (Ping timeout: 268 seconds)
19:02:37 <[itchyjunk]> if i have `f (x:xs) = [x:f xs]` with f (' ':xs) = [], i know it should fully work but for "ab cd", it should be ["a":"b cd"] then ["ab":" cd"] then it encounters " " and it should be [ab:[]] = ["ab"] ?
19:02:47 <[itchyjunk]> shouldn't fully work*
19:03:36 <monochrom> No.
19:03:49 <monochrom> The whole thing. No.
19:03:55 <zzz> i there any difference (perf wise) between `| null x = ([],[])` and `| null x = (x,x)` ?
19:03:58 jakalx joins (~jakalx@base.jakalx.net)
19:04:09 <monochrom> No difference.
19:04:51 <monochrom> GHC-generated code has a static flyweight [] so saying "x" and saying "[]" both get compiled to the same [] flyweight.
19:04:55 deadmarshal joins (~deadmarsh@95.38.116.172)
19:05:07 <monochrom> Similarly for Nothing and other nullary data constructors.
19:05:19 <zzz> nice
19:05:55 <zzz> so i can think of it as just pointers to some "nullary value" in memory?
19:06:08 <monochrom> Yeah, x already points to the same reused [].
19:06:35 <monochrom> It's also a statically created [], no heap pressure.
19:07:47 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:08:02 <zzz> and just out of curiosity, are all nullary constructors the same?
19:08:10 <monochrom> Ah, that one is a no.
19:08:21 <monochrom> [] and Nothing are at different addresses.
19:08:22 burnsidesLlama joins (~burnsides@dhcp168-025.wadham.ox.ac.uk)
19:08:41 <zzz> couldn't they be at the same address?
19:08:59 <monochrom> I think there is no harm, but GHC didn't do it.
19:09:11 bollu joins (uid233390@id-233390.helmsley.irccloud.com)
19:09:13 <zzz> nice curisioty
19:09:24 <monochrom> Probably easier to debug in some sense.
19:10:33 × xsperry quits (~xs@user/xsperry) ()
19:10:46 × jgeerds quits (~jgeerds@55d45b75.access.ecotel.net) (Ping timeout: 245 seconds)
19:11:21 {Franciman} is now known as Franciman
19:13:16 × xff0x quits (~xff0x@2001:1a81:53bb:9600:57:b0d1:750c:1fc) (Ping timeout: 245 seconds)
19:14:21 xff0x joins (~xff0x@2001:1a81:53bb:9600:5031:992:22e6:cca9)
19:15:40 <hololeap> type ThisWord = [Char]
19:15:45 <hololeap> type Remainder = [Char]
19:15:59 <hololeap> stringToWordAndRemainder :: [Char] -> (ThisWord, Remainder) -- it might help you to write this first, [itchyjunk]
19:16:16 xsperry joins (~xs@user/xsperry)
19:16:48 <[itchyjunk]> hmm i manage to "this word" -> ["this word"]
19:17:09 <[itchyjunk]> but i'll try that first
19:17:56 <zzz> > (:[]) "this word"
19:17:57 <lambdabot> ["this word"]
19:18:20 <zzz> yu have unlocked the angry monkey
19:18:52 zzz (:[])
19:19:04 <monochrom> It is not angry.
19:19:11 <EvanR> it eats 1 thing and becomes full
19:19:14 <monochrom> Maybe it is robotic.
19:19:18 <EvanR> hungry monkey
19:19:18 <zzz> i dont remember
19:19:28 <geekosaur> robot monkey is how we used to refer to it
19:19:32 <EvanR> > (:[]) 'a'
19:19:34 <lambdabot> "a"
19:19:38 <EvanR> > (:[]) 1
19:19:40 <lambdabot> [1]
19:19:45 <maerwald> I think it's a lovely monkey with big beautiful lips
19:19:53 <maerwald> but that's just my imagination
19:20:19 <EvanR> :t (:[]) (:[]) -- it can be a cannibal monkey
19:20:20 <lambdabot> [a -> [a]]
19:20:31 <monochrom> You project your persona to everything. If you see a ____ monkey, you are the one who is ____
19:20:38 <EvanR> oof
19:20:44 <monochrom> Yes I think of myself as robotic, too.
19:20:52 MrNobody_0000000 joins (~MrNobody@user/mrnobody-0000000/x-9129771)
19:20:56 zzz is angry
19:21:15 <MrNobody_0000000> hello guys
19:21:17 <EvanR> you just called me a cannibal
19:21:19 <maerwald> well, thank you for the compliment
19:21:28 <zzz> GET OUT
19:21:30 <MrNobody_0000000> I'm having a little difficulty understanding the ||| operator
19:21:36 <MrNobody_0000000> I'm reading my xmonad config
19:21:41 <geekosaur> which one?
19:21:44 <geekosaur> ah
19:21:54 <geekosaur> it's not the one you'll find in the standard library
19:22:08 <MrNobody_0000000> is it specific to xmonad?
19:22:19 <[itchyjunk]> i just wrote a function that maps "hello world" to "hello world" it seems
19:22:20 <[itchyjunk]> hmm
19:22:58 <monochrom> Yes, you wrote foldr (:) [] but with your own recursion.
19:22:58 <geekosaur> https://hackage.haskell.org/package/xmonad-0.17.0/docs/XMonad-Layout.html#v:-124--124--124-
19:23:22 <geekosaur> but there's also one in Control.Arrow that does something completely different
19:24:22 <MrNobody_0000000> tiled ||| Mirror tiled ||| noBorders Full
19:24:26 <MrNobody_0000000> that's an example
19:24:45 <[itchyjunk]> i think the way i am approaching this is producing [h [e [ l [ l [o]]]]] or somesuch
19:25:47 <hololeap> [itchyjunk]: did you try writing that function I mentioned? (it doesn't need that long of a name :p)
19:25:58 <[itchyjunk]> that's the one i am working on
19:26:12 hiruji` joins (~hiruji@pool-100-4-208-71.albyny.fios.verizon.net)
19:26:13 <[itchyjunk]> just a tiny bit i need to figure out
19:26:30 <[itchyjunk]> https://bpa.st/EN3Q
19:26:32 <geekosaur> MrNobody_0000000, this is a shortcut for writing something like (Choose CL tiled (Choose CL (Mirror tiled) Full))
19:26:37 <[itchyjunk]> h is supposed to be the one you mentioned
19:26:45 × hiruji quits (~hiruji@user/hiruji) (Ping timeout: 250 seconds)
19:26:49 <[itchyjunk]> i just have an issue with `then x : h xs` part
19:26:52 <MrNobody_0000000> thanks I'll look it up
19:27:04 <geekosaur> this is somewhat annoying to write out so we use the ||| shortcut
19:27:10 <[itchyjunk]> i think the `else [xs]` does what i want
19:27:17 <hololeap> so with input "these are some words" it should return ("these", "are some words")
19:27:21 <geekosaur> I pointed to ||| earlier, Choose is just above it and CL just below
19:27:21 <EvanR> if you go by the types then [h [e [l [l [o]]]]] is very unlikely to happen
19:27:44 <monochrom> This doesn't escape from what I said.
19:27:45 <[itchyjunk]> oh like that?
19:28:04 <[itchyjunk]> i could do h (x:' ':y) = (x,y)
19:28:05 <[itchyjunk]> no?
19:28:27 <hololeap> no, you can't split a list like that, but it shouldn't be too hard to figure out
19:28:28 <MrNobody_0000000> so is choose comparable to an enumeration
19:28:44 <[itchyjunk]> ah, let me think for a few more minutes then
19:28:44 <monochrom> You want h "hi there" = ("hi", "there"). The induction hypothesis says you can assume h "i there" = ("i", "there"). So now you have to bridge that to ("hi", "there").
19:28:50 <EvanR> see you keep thinking : is joining two lists
19:28:53 <EvanR> that's ++
19:29:00 <[itchyjunk]> oh
19:29:01 <EvanR> and we don't have a pattern for that (for lists)
19:29:01 <monochrom> As long as you ignore this line of thought, you will get nowhere.
19:29:42 <geekosaur> MrNobody_0000000, it's a switch. every time you press mod-space, a CL turns into a CR, which causes the corresponding Choose to switch from the left layout to the right
19:29:58 <geekosaur> (Choose is itself a "layout" for this purpose)
19:30:03 <monochrom> Especially if you are still thinking of a for-loop, as opposed to this simple non-tail recursion.
19:30:19 <hololeap> [itchyjunk]: you'll have three cases for that function: for an empty list, for a list starting with a space character, and a list starting with any other character
19:30:25 <geekosaur> if all the switches are CR, the layout resets such that all the CRs become CLs and you cycle back to the beginning
19:30:30 <[itchyjunk]> is this signature correct? `h :: [Char] -> ([Char], [Char])
19:30:35 <monochrom> Yes.
19:30:35 <hololeap> yes
19:30:44 <MrNobody_0000000> wow I really need to forget about C lol
19:30:54 <geekosaur> btw you might want to move to #xmonad, it's quieter there
19:31:13 <MrNobody_0000000> I'll check it out
19:31:27 <MrNobody_0000000> Maybe I'll come back here when I know a bit more about haskell
19:31:33 <MrNobody_0000000> it's a process haha
19:31:59 <geekosaur> well, this is less about Haskell than about how we implemented layouts
19:32:10 <geekosaur> they're a combination of function and data
19:32:31 <EvanR> forget about C, learn haskell, realize there's a C API xD
19:32:35 <MrNobody_0000000> are you a developer of xmonad?
19:32:39 <geekosaur> CLR is data that's stored in the Choose "layout", saying whether it haas curently chosen left or right. Initially they all choose left
19:32:42 <geekosaur> yes
19:33:04 <MrNobody_0000000> wow it's an honor
19:33:30 <sm> how would you write a file strictly ? so that you can read it right afterward and be sure of seeing all the new content ?
19:33:42 <monochrom> writeFile already does.
19:33:56 <monochrom> vanilla Prelude writeFile
19:34:21 <MrNobody_0000000> thanks for the help
19:34:42 <geekosaur> no problem
19:34:56 pfurla joins (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b)
19:35:12 zincy_ joins (~zincy@2a00:23c8:970c:4801:4cc1:c671:40b5:6186)
19:35:30 lavaman joins (~lavaman@98.38.249.169)
19:35:57 × zincy_ quits (~zincy@2a00:23c8:970c:4801:4cc1:c671:40b5:6186) (Remote host closed the connection)
19:35:57 <monochrom> Or if you are already using a Handle, then hClose does it.
19:36:17 <maerwald> sm: on windows? :)
19:36:22 zincy_ joins (~zincy@2a00:23c8:970c:4801:4cc1:c671:40b5:6186)
19:36:24 <monochrom> Or if you are already using withFile, then waiting for it to return does it.
19:37:33 <sm> thanks! On all platforms. Good to know writeFile does, I am currently using hPutStr and for that I should close the handle. Great.
19:37:51 <monochrom> or flush buffer if you can't close yet.
19:38:09 × zincy_ quits (~zincy@2a00:23c8:970c:4801:4cc1:c671:40b5:6186) (Remote host closed the connection)
19:38:09 <maerwald> I don't know if vanilla writeFile will work this way on windows
19:38:18 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
19:38:19 <maerwald> I'd probably use Win32 api
19:38:22 × hiruji` quits (~hiruji@pool-100-4-208-71.albyny.fios.verizon.net) (Ping timeout: 260 seconds)
19:38:43 × xsperry quits (~xs@user/xsperry) ()
19:39:08 <monochrom> What would be a possible problem?
19:39:29 <maerwald> how writeFile interacts with Win32
19:39:40 <maerwald> and whether it allows reads during writes
19:40:09 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 268 seconds)
19:40:16 <EvanR> what is this windows FUD
19:40:24 <monochrom> Um it's sequentially writeFile (which ends with a close) and only after that a readFile.
19:40:36 <maerwald> ah
19:41:01 <maerwald> I thought it's like using a file as a pipe
19:41:03 narendraj9 joins (~user@2a02:8109:b63f:ff7c::57b2)
19:41:14 <monochrom> I'm OK if you say "hPutStr then hFlush then try to read but with a different Handle"
19:42:07 <EvanR> on the same thread?
19:42:24 × Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt)
19:42:57 <monochrom> Well, Windows has pretty paranoid file locking, so as long as you're coming from a different Handle...
19:43:02 cosimone` joins (~user@93-47-228-243.ip115.fastwebnet.it)
19:46:02 × cosimone quits (~user@2001:b07:ae5:db26:a7aa:8027:6b4e:2fb3) (Ping timeout: 240 seconds)
19:46:29 <geekosaur> iirc there is a problem that Handles aren't GCd immediateloy so an immediate readFile may find the write Handle still there?
19:48:25 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
19:48:31 <monochrom> iirc writeFile is not lazy, unlike readFile, it has a very deterministic and determined hClose.
19:48:44 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
19:48:56 <monochrom> I mean, as far as "iirc" is concerning.
19:49:02 <monochrom> s/concerning/concerned/
19:49:18 max22- joins (~maxime@2a01cb0883359800b686e733ae8fbdbc.ipv6.abo.wanadoo.fr)
19:49:50 <EvanR> so writeFile is a good driver of a big lazy thing to be written
19:49:58 <monochrom> Yes.
19:50:34 hiruji joins (~hiruji@user/hiruji)
19:50:50 <monochrom> even putStr is, despite often you don't see the writing.
19:50:58 <monochrom> But that's buffering not laziness.
19:51:26 <monochrom> What would "lazy writing" mean? "Don't write until the human peek-a-poo"?
19:51:40 <EvanR> ask Writer xD
19:53:41 <hololeap> isn't that how quantum mumbo jumbo works? the universe doesn't write to file until I observe it? :)
19:54:16 <monochrom> At that level IIRC all physicists agree that the Copenhagen interpretation doesn't apply.
19:54:52 hiruji` joins (~hiruji@2606:6080:1001:10:3c5b:63ff:df18:8486)
19:54:53 <sm> with RecordWildCards, why am I seeing You cannot use `..' in a record update ? I have seen that done lots
19:55:02 × hiruji quits (~hiruji@user/hiruji) (Ping timeout: 240 seconds)
19:55:19 <jle`> sm: i've seen it a lot in creating records
19:55:32 <jle`> but i'm not sure it would really make sense in a record update
19:55:43 <jle`> since it's implying that you're updating all of the fields anyway
19:55:49 <sm> I'm trying to use it with Data.Default - return def{..}
19:55:51 <jle`> so you might as well create a new record right?
19:55:58 whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com)
19:56:12 <jle`> sm: yeah i'm saying that def{..} would overwrite all of the fields anyway
19:56:22 <jle`> so it would use none of 'def''s fields
19:56:38 <sm> yes, I just want to minimise typing
19:57:14 <monochrom> Are you sure you were not seeing other people doing "Ctor{..}" as opposed to "varname{..}"?
19:57:18 × narendraj9 quits (~user@2a02:8109:b63f:ff7c::57b2) (Remote host closed the connection)
19:57:26 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
19:57:37 <hololeap> jle`: why did you do this to us? https://hackage.haskell.org/package/functor-combinators-0.4.1.0/docs/Data-Functor-Combinator.html#t:Night
19:57:41 <sm> that must be it I guess monochrom
19:57:55 <jle`> i guess it technically "makes sense" to implement, but it's probably sufficiently silly in its function that it's more likely to be done by mistake maybe
19:58:06 <jle`> hololeap: :)
19:58:08 <jle`> it's been useful to me
19:58:10 <jle`> :3
19:58:13 <hololeap> is that not supposed to be the dual of Day?
19:58:22 <sm> my idea was to update a default value (smart constructor) so I wouldn't have to set every field
19:58:34 <jle`> hololeap: ah yes, if that's what you are talking about
19:58:38 <jle`> hololeap: it's the dual of invariant Day
19:58:44 <jle`> sm: that would set every field though
19:58:49 <jle`> what you wrote
19:59:06 <monochrom> I prefer Knight, if it comes downs to pun.
19:59:14 son0p joins (~ff@181.136.122.143)
19:59:17 <hololeap> oh, ok. it came up in a earlier discussion. "what's the dual of Day? Night?" ... somebody hoogles...
19:59:29 <geekosaur> there's a ghc issue about this that concluded it didn't really make sense
19:59:33 <jle`> monochrom: ah that's a better one i think
19:59:40 <jle`> since both Day and Knight are names in that context
19:59:40 <geekosaur> (.. in record updates)
19:59:42 <jle`> darn
20:00:34 <monochrom> Just bump the major major version :)
20:00:36 <sm> NamedFieldPuns seems to work better. return def{field2,field5}
20:00:48 <jle`> that one actually makes sense, yeah
20:00:51 <hololeap> (oh it does actually say that in the docs)
20:01:07 <jle`> sm: because def{..} would be equivalent to def{field1,field2,field3,field4,field5} etc.
20:01:26 <jle`> with namedfieldpuns you can pick which fields you want overwritten
20:01:46 <janus> that's one thing i like about GHC2021, it has NamedFieldPuns but not RecordWildCards
20:02:08 <sm> yes. I know def is not loved because it can be harder to read, I'm just trying it in this script since I'm tired of writing both a long data def and then a long smart constructor
20:02:13 <janus> i saw a pattern in our code base where we have fun A{..} = B{..} though
20:02:24 <janus> i dunno if i approve of that though :O
20:02:28 <jle`> sm: the issue isn't really with def though, i think
20:02:46 <geekosaur> just with bindings vs. constructors
20:03:02 <jle`> but i guess you're saying that the original constructor is not exported, but just all the fields?
20:03:24 chomwitt joins (~chomwitt@94.69.34.153)
20:03:35 × DNH quits (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd) (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:04:09 pavonia joins (~user@user/siracusa)
20:04:12 <jle`> sm: you're basically using to avoid the equivalent MyLongNameConstructor{..}, right?
20:04:52 <jle`> janus: heh, that one can be fun :) if you have types that are just equivalent to others but missing fields, like intermediate data types
20:05:07 × juhp quits (~juhp@128.106.188.82) (Ping timeout: 250 seconds)
20:06:16 <janus> thing is, our development environment relies on ripgrep... so unless you have HLS understanding RecordWildCards, there is at least that disadvantage
20:06:22 <janus> but i guess it's not really a giant problem
20:06:47 juhp joins (~juhp@128.106.188.82)
20:07:07 <jle`> tooling is a big issue with a lot of haskell usage patterns, yeah
20:07:25 <jle`> but if you rg for fields then you'll at least get the final use sites, right heh
20:07:51 <nf> monad-dijkstra rules
20:07:54 <janus> with NamedFieldPuns, if you're supposed to copy all fields over with that pattern, the compiler wouldn't know that... with RecordWildCards it could theoretically warn that you have a field in scope that isn't used
20:08:07 <nf> i just solved an old AoC puzzle with it and i really like it https://github.com/ncfavier/aoc/blob/main/src/2015/Day22.hs
20:08:07 <janus> though i think there isn't currently a warning for that
20:09:03 × ubert quits (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection)
20:09:21 ubert joins (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de)
20:09:23 <jle`> janus: ah yeah, the lack of warning is something that does bother me
20:09:28 <jle`> there's only a warning if *none* are used
20:09:42 <jle`> maybe in general it's best to replace recordwildcards with namedfieldpuns when you are refactoring
20:09:44 <janus> but i think we should definitely have a warning like that. then RecordWildCards would have a use case where it is superior to NamedFieldPuns
20:10:01 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
20:10:14 <jle`> a warning might not make sense because it's sort of one of the "points" of recordwildcards, i don't think most people use it intending to use all of the fields
20:10:18 <jle`> unless maybe they should
20:10:43 <janus> exactly. the warning would be optional, i am not saying it should be in -Wall or anything
20:12:40 <sm> jle`: yes I'm avoiding that, but more important avoiding having to set all the fields
20:13:04 × ubert quits (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection)
20:13:22 ubert joins (~Thunderbi@p200300ecdf0ba285e6b318fffe838f33.dip0.t-ipconnect.de)
20:13:50 × SSCC quits (~SSCC@59-102-95-229.tpgi.com.au) (Quit: Client closed)
20:13:53 <jle`> sm: yeah, my point is that a hypothetical def{..} would set all of the fields
20:14:12 <jle`> since {..} in a binding position is equivalent to {field1,field2,field3,field4...all fields}
20:14:28 <jle`> no matter what is already in scope
20:15:21 <jle`> so if there was a def{..}, it would ignore all of the information in def and just overwrite it with whatever is in scope, and if the field isn't in scope, it'd be set to undefined
20:18:06 <sm> agreed, thank you
20:19:46 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
20:20:03 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
20:20:31 <dminuoso> I wish we had a split extension that just provided the construction via Constructor{..} :(
20:20:31 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
20:21:01 <dminuoso> But without the unhygeniec macro of Constructor{..} pattern matching
20:21:34 <dminuoso> Ive become very fond of it parsers and all kinds of other ApplicativeDo core
20:22:49 <janus> dminuoso: if you had a warning that triggered when you used it to match, wouldn't that do? no need for a new extension :P
20:23:30 <janus> there are already warnings in -Weverything that are too extreme, may as well add another one :P
20:23:43 <dminuoso> No, I dont care for code that can secretly, without display, introduce identifiers
20:23:57 <dminuoso> It's bad enough that I use optics TH helpers like makeLenses already.
20:24:11 <janus> well if you had a warning and you turn on -Werror you will effectively not have that code
20:24:19 <dminuoso> That's not true.
20:24:30 <janus> why not?
20:24:39 <[itchyjunk]> is `where var1 = f n && var 2 = g n` valid syntax?
20:25:03 <dminuoso> [itchyjunk]: No. What is that supposed to denote?
20:25:13 <dminuoso> janus: Not sure what to tell you beyond what I just wrote
20:25:27 Sgeo joins (~Sgeo@user/sgeo)
20:25:31 <dminuoso> Or wait
20:25:46 <dminuoso> I think I misunderstood. You mean the warning would fire whenever used as a pattern match?
20:26:03 <[itchyjunk]> i need to assign 2 valiables var1 and var2 where var1 needs to hold output of f and var2 of g so a function h can return (var1,var2)
20:26:05 <janus> dminuoso: yes exactly. i am just saying you don't necessarily need a "split extension" to achieve what you want
20:26:08 <dminuoso> Don't see that getting into GHC, a warning that would warn on a *feature* itself.
20:26:25 <dminuoso> yet-another-extension seems far more likely and in line with GHC has been doing
20:26:47 <geekosaur> where {var1 = f n; var2 = g n}
20:26:48 <janus> dminuoso: i suspect there is less bureaucracy around adding warnings than adding extensions since the ghc proposal process got started
20:26:57 <[itchyjunk]> oh i see, thanks
20:27:05 <[itchyjunk]> turns out i can directly (f n, g n) as well :x
20:27:10 <geekosaur> and you don't need the braces if you use indentation
20:27:19 <geekosaur> yes
20:27:51 <geekosaur> (although if the real `f n` is long I'll still do assignments just to keep stuff from wrapping)
20:27:57 <dminuoso> janus: Honestly, I think you have to take the proposal and extension path
20:28:04 <geekosaur> s/assignments/bindings/
20:28:07 <[itchyjunk]> hololeap, i managed to solve the exercise but i had to start from scratch and write 2 helper functions for it :<
20:28:07 <[itchyjunk]> https://bpa.st/OM6Q
20:28:24 <dminuoso> There's just no precedence so far, I think
20:28:50 <[itchyjunk]> h "a b cd" gives me ("a","b cd")
20:29:04 <dminuoso> janus: And Im still not sure a warning would suffice.
20:29:30 <dminuoso> If I look at some source code and see RecordWildCards, I now have to be wary whether or not this could indicate use of unhygenic macros.
20:29:42 <dminuoso> Whether or not they are used cannot necessarily be seen inside that same source file
20:29:56 <dminuoso> Because now I have to figure out whether the build process sets that warning (and perhaps even promotes it to an error)
20:30:09 <dminuoso> It seems too orthogonal
20:31:00 <janus> but with language extensions, it also doesn't seem super straightforward to figure out if it is enabled or not
20:31:14 <dminuoso> If I dont see RecordWildCards, it's not being used?
20:31:35 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 265 seconds)
20:31:42 <hololeap> [itchyjunk]: nice! that's exactly how I did it :)
20:31:42 wagle_ is now known as wagle
20:31:55 <janus> well you have to look in the compiler flags, the cabal files, the package.yaml, however it works in nix, and the top of the file
20:31:58 <hololeap> well, not quite, because I didn't reverse it
20:32:17 <hololeap> but the layout is exactly the same
20:32:51 × hiruji` quits (~hiruji@2606:6080:1001:10:3c5b:63ff:df18:8486) (Ping timeout: 245 seconds)
20:33:21 <dminuoso> janus: Id have to think about it for a while
20:33:32 DNH joins (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd)
20:34:04 <dminuoso> It doesn't come across as evidently wrong, but it doesn't feel right. If you ever propose this in a GHC issue or on the mailing list, let me know.
20:34:13 <dminuoso> I'll definitely spend some thought on it
20:34:26 dminuoso has to go take care of some personal business now
20:34:29 hiruji joins (~hiruji@user/hiruji)
20:34:32 <monochrom> [itchyjunk]: There is not going to be any progress until you accept that h needs to be recursive on itself.
20:34:34 <janus> dminuoso: i made this argument because i saw someone on the GHC proposals repo commenting that something didn't need to be an extension
20:34:49 <janus> don't know which thread it was now...
20:35:56 <hololeap> [itchyjunk]: yeah h needs to be recursive on itself
20:36:10 <monochrom> [itchyjunk]: Err nevermind, I misread.
20:36:46 <dsal> [itchyjunk]: Names are pretty good. `f` is often called `dropWhile` and `g` is `takeWhile` (though each with a predicate)
20:37:27 <dsal> Actually, I might be confused. Lunch was good, though.
20:37:54 <dsal> Yeah, it looks like `f` is `takeWhile`
20:38:06 <dsal> > takeWhile (/= ' ') "some list of strings"
20:38:08 <lambdabot> "some"
20:38:36 <tomsmeding> > span (/= ' ') "some list of strings"
20:38:37 <lambdabot> ("some"," list of strings")
20:40:40 jmorris joins (uid433911@id-433911.hampstead.irccloud.com)
20:41:43 <dsal> I think DIYing them is a great exercise. I also rant about long names. But… short names can be hard, too. Not a bad idea to encode a bit of intent into a toplevel identifier.
20:41:50 × hiruji quits (~hiruji@user/hiruji) (Ping timeout: 268 seconds)
20:42:29 hiruji joins (~hiruji@user/hiruji)
20:42:37 × hiruji quits (~hiruji@user/hiruji) (Remote host closed the connection)
20:42:38 <monochrom> For the best of both worlds, use unguessable acronyms. >:)
20:44:02 <dsal> > let gsaw = foldr (\x o -> if x == ' ' then [] else x:o) [] in gsaw "take the first word from a list of words"
20:44:04 <lambdabot> "take"
20:45:11 <hololeap> [itchyjunk]: I'll just share with you what I did, although it doesn't reverse anything: http://sprunge.us/CWxlk1
20:46:52 hiruji joins (~hiruji@user/hiruji)
20:47:11 boxscape_ joins (~boxscape_@p4ff0bb6c.dip0.t-ipconnect.de)
20:48:19 Sgeo_ joins (~Sgeo@user/sgeo)
20:48:40 yauhsien joins (~yauhsien@61-231-63-167.dynamic-ip.hinet.net)
20:50:46 × Sgeo quits (~Sgeo@user/sgeo) (Ping timeout: 245 seconds)
20:51:59 mc47 joins (~mc47@xmonad/TheMC47)
20:52:51 × yauhsien quits (~yauhsien@61-231-63-167.dynamic-ip.hinet.net) (Ping timeout: 245 seconds)
20:54:22 × Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer)
20:54:27 <energizer> how does operator precedence of `backtick` infix functions work?
20:54:31 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
20:55:09 <[exa]> you can assign them normal priorities
20:55:16 <monochrom> Just like all infix operators. Default to infixl 9. Can use e.g. infixr 4 `foo` to non-default.
20:55:23 <[exa]> by default they are something like ...yeah monochrom finished that. :D
20:55:36 <xerox> energizer: «If no fixity declaration is given for ` op ` then it defaults to highest precedence and left associativity (see Section 4.4.2).»
20:56:15 × brettgilio quits (~brettgili@x-node.gq) (Ping timeout: 250 seconds)
20:57:04 <hololeap> although there are other things that take higher precedence...
20:57:28 <hololeap> namely function application and records
20:57:35 xsperry joins (~xs@user/xsperry)
20:58:15 <monochrom> \∩/ function application at 10, record at 11. "crank it up to 11"
20:58:28 <energizer> ok
20:59:16 <hololeap> I wish what is in the backticks could be an expression
20:59:26 <yushyin> records are very metal it seems \m/
20:59:42 <monochrom> Yeah, although then the fixity declaration business becomes untractible.
20:59:55 <hololeap> that's fair
21:00:00 <monochrom> infixr 4 `(.) . (.)`
21:00:33 <hpc> ghc needs a language extension to replace `` with $()
21:00:37 <hpc> you know, for best practice
21:00:42 Midjak joins (~Midjak@may53-1-78-226-116-92.fbx.proxad.net)
21:01:04 <hololeap> bwahaha
21:01:11 <monochrom> f $(fmap) g $ x
21:01:16 <hololeap> for nesting
21:01:24 <monochrom> In fact, let me make it worse.
21:01:27 <monochrom> f $(fmap) g $ (x)
21:02:33 <tomsmeding> and then template haskell can go cry in a corner?
21:02:38 tomsmeding would approve
21:03:04 <energizer> what is the issue with fixity?
21:03:05 <boxscape_> % A {a = 3} {b = "foo"} {c = True}
21:03:06 <yahb> boxscape_: A {a = 3, b = "foo", c = True}
21:03:11 <boxscape_> hm I never tried chaining record updates before
21:03:20 <energizer> for infix expressions
21:03:23 <hpc> i like it
21:03:40 <hpc> it's even only a little bit longer
21:03:45 <hpc> one character per field
21:03:52 <boxscape_> yeah
21:04:18 <energizer> i mean what is this problem <monochrom> Yeah, although then the fixity declaration business becomes untractible.
21:04:19 <geekosaur> energizer, you can declare a fixity for infix functions like `fmap`. declaring a fixity for an expression is kinda badly defined
21:04:56 <hpc> downside though, having to explain to new people that (A 3) is a function and (A {a = 3}) has all the other fields left undefined
21:05:07 <boxscape_> % 0 &foldl subtract$ [1..5] -- hololeap sometimes you can get away with combining $ and & instead of `` as an expression
21:05:08 <yahb> boxscape_: 3
21:05:11 <monochrom> That was hypothetical on supporting `arbitrary expression here like (.) . (.)`
21:05:19 <xerox> O_O
21:05:37 <boxscape_> hpc you also have to turn off -Wmissing-fields
21:06:04 <hpc> boxscape_: only if you look at warnings :P
21:06:15 jgeerds joins (~jgeerds@55d45b75.access.ecotel.net)
21:06:21 <boxscape_> yeah but if you don't turn off the warning in yahb, it *only* shows you the warning :P
21:06:24 <tomsmeding> can also technically not work if you do a type-changing record update where multiple fields share the same type (so you need to change them in parallel)
21:06:27 <monochrom> A {a = 3} {b = "foo"} is a special case of let x = A{a=3) in x{b="foo"}
21:07:01 <monochrom> "Clearly", both A{a=3} and x{b="foo"} are legal and have well-understood semantics.
21:07:19 <monochrom> Now apply the cut lemma.
21:07:34 <tomsmeding> or consider record update to be a postfix operator
21:07:50 <tomsmeding> hey, haskell has postfix operators after all! In fact, an infinitude of them
21:07:52 <boxscape_> I think it's not obvious that the fixity works out, i.e. A{a=3}{b="foo"} could be parsed as A({a=3}{b="foo"}). Wouldn't be very useful, but possible
21:08:36 <monochrom> I don't have an objection to that.
21:09:31 × alx741 quits (~alx741@186.178.109.194) (Ping timeout: 245 seconds)
21:09:57 <monochrom> (g y){b="foo"} is also OK but needs those parentheses.
21:10:19 <hololeap> xerox: what I was referring to would be something like: [1,2,3] `zipWith (+)` [4,5,6]
21:10:26 <hololeap> which you can't do
21:10:30 alx741 joins (~alx741@181.196.69.248)
21:10:37 <boxscape_> % [1,2,3] &zipWith (+)$ [4,5,6]
21:10:37 <yahb> boxscape_: [5,7,9]
21:10:43 <monochrom> I miss "xs `liftA2 op` ys" a lot.
21:10:47 <hololeap> you can only put a function name in the backticks
21:10:49 <xerox> first time I ever seen that, neat
21:11:03 <monochrom> Ugh haha that's evil and helpful.
21:11:13 <boxscape_> there's a hackage package that allows you to do [i|xs `op` ys|], but it's broken
21:11:22 × _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection)
21:11:29 <dsal> Instead of using ``, you just have use the & and $ forms of parens.
21:11:38 deadmarshal joins (~deadmarsh@95.38.116.172)
21:11:47 <boxscape_> (specifically for liftA2)
21:11:52 <xerox> > [2,3] &liftA2 (*)$ [5,7]
21:11:53 <lambdabot> [10,14,15,21]
21:12:26 <monochrom> xs & f & cross $ g $ ys
21:12:52 <xerox> > [2,3] &(\x y -> (+) <$> x <*> y)$ [5,7]
21:12:53 <lambdabot> [7,9,8,10]
21:13:50 <hololeap> dsal: you should start doing that at work
21:14:14 × pfurla quits (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b) (Quit: gone to sleep. ZZZzzz…)
21:14:42 <hpc> and then change your font so & is ( and $ is )
21:15:06 <dsal> hololeap: I was just thinking I shouldn't do any work without that
21:15:21 kjak joins (~kjak@pool-108-45-56-21.washdc.fios.verizon.net)
21:15:52 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
21:15:53 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host)
21:15:53 wroathe joins (~wroathe@user/wroathe)
21:16:21 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
21:17:31 × DNH quits (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd) (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:17:43 Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi)
21:18:44 <boxscape_> Is there a hackage package that uses the GHC API to take in Haskell source code and produce template haskell? (If not I'm thinking about writing it)
21:18:57 × bollu quits (uid233390@id-233390.helmsley.irccloud.com) (Quit: Connection closed for inactivity)
21:19:07 <boxscape_> s/template haskell/a template haskell AST
21:19:25 <boxscape_> I know there is a package that does it for haskell-src-exts
21:19:31 <boxscape_> but using the GHC API seems more robust
21:19:52 <boxscape_> (that package being haskell-src-meta)
21:20:17 betelgeuse joins (~betelgeus@94-225-47-8.access.telenet.be)
21:20:33 <geekosaur> iirc there is not and it's hard enough to do that people use haskell-src-meta instead
21:20:55 <geekosaur> also ghc api's ast changes too often
21:21:19 <boxscape_> hmm but shouldn't the GHC API essentially already have the functionality to do that, since it must have that somewhere to take the string inside of [| |] and produce a template haskell AST?
21:22:20 <dsal> I downloaded all of (the latest version of each package of) hackage today. AMA. Also, apparently my backups have been broken for a week, so now I'm backing them all up again.
21:22:34 pfurla joins (~pfurla@2804:14d:5c81:4104:9c86:91d6:b6fa:287b)
21:23:25 <dsal> boxscape_: Isn't that Q? It does something similar.
21:23:38 <sm> dsal: which is the best package ?
21:23:59 <dsal> Though I've never actually been able to use that stuff directly. I always use to get started and then just write out myown TH stuff.
21:24:00 <hololeap> are there any noop packages?
21:24:17 <hololeap> like, just a .cabal file
21:24:25 <boxscape_> dsal right basically I'm thinking I should be able to take the code that is used for Q and provide a convenient API to it
21:24:30 <dsal> sm: Looks like hledger-1.23.tar.gz is as easy as 1,2,3.
21:24:55 <sm> hooray ! :-)
21:24:58 <dsal> hololeap: yeah
21:25:07 <dsal> Well, and a Setup.hs
21:25:21 <hololeap> lol I'm really not surprised :p
21:25:34 <dsal> e.g., bools-0.1.1.tar.gz
21:25:34 <sm> when is the HF going to do something about Setup.hs, eh ??
21:25:34 <hpc> https://hackage.haskell.org/package/acme-one-0.0.2/src/
21:25:50 <hpc> hololeap: ^
21:25:56 <dsal> That's way more complicated than bools
21:26:00 sm thinks of HF as the County Council now
21:26:13 <dsal> https://hackage.haskell.org/package/bools-0.1.1/src/
21:26:19 <hololeap> rofl
21:26:24 <hololeap> hpc
21:26:31 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
21:26:56 <boxscape_> so acme-one is the identity element for package dependencies, interesting
21:27:45 <dsal> The biggest package is liquidhaskell-0.8.10.7
21:28:07 <dsal> Followed by sugarhaskell-0.1 if you prefer a solid
21:28:07 <boxscape_> what is the package with the longest name
21:28:27 <hpc> probably some web framework subpackage
21:28:47 <dsal> Just kind of eyeing it, phonetic-languages-simplified-generalized-examples-array-0.13.1.0
21:28:52 <boxscape_> nice
21:29:43 <hololeap> lol I _knew_ it would be one by that guy
21:29:55 <hololeap> looks like phonetic-languages-simplified-generalized-examples-common is longer
21:30:10 <dsal> phonetic-languages-simplified-generalized-properties-array
21:30:36 <hpc> what's the most deeply nested module name?
21:30:44 <hpc> module A.B.C.D.etc
21:30:52 <dsal> Oooh. Hmm...
21:31:03 × reumeth quits (~reumeth@user/reumeth) (Ping timeout: 260 seconds)
21:31:23 DNH joins (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd)
21:32:40 <tomsmeding> https://hackage.haskell.org/package/liquidhaskell-0.8.10.7/src/TODO.EASY.md
21:32:46 <EvanR> sugar haskell + liquid haskell = solution?
21:33:02 <tomsmeding> see the last todo item, doesn't sound very easy by that description
21:33:03 <EvanR> haskell
21:33:29 <dsal> The longest is Network.Google.Resource.Healthcare.Projects.Locations.DataSets.DicomStores.Studies.Series.Instances.Frames.RetrieveRendered
21:33:37 <dsal> But I'm not sure that's the most deeply nested.
21:33:40 <dsal> Just using shell hackery right now.
21:33:44 <hololeap> O_O
21:33:46 <hpc> jinkies
21:34:03 <EvanR> haskell for healthcare
21:34:14 <EvanR> the next killer app
21:34:33 <dsal> lol
21:34:54 <boxscape_> healthkell
21:35:27 acidjnk_new joins (~acidjnk@p200300d0c7271e35059025bf8f5e09b5.dip0.t-ipconnect.de)
21:35:29 <EvanR> 😱
21:35:39 <janus> dminuoso: apropos RecordWildCards. not how Eisenberg is arguing for a new warning and a new way to have warnings in part of a module: https://github.com/ghc-proposals/ghc-proposals/pull/436
21:35:44 <janus> *note
21:36:20 <janus> jle`: Also apropos what we talked about
21:37:17 <janus> I really don't like the original proposal but what Eisenberg suggests sounds fine to me. Though I mostly care about the new warning, not the selective warnings bit.
21:37:25 <dsal> The most deeply nested outside of those Google APIs is Network.API.Telegram.Bot.Object.Update.Message.Content.Poll.Option
21:37:44 <dsal> And if we're looking for something that's not a dumb REST API, I think we have Data.Number.ER.RnToRm.UnitDom.Base.Tests.Properties.Ring
21:38:45 <hololeap> that sounds like a Henning Thielemann package
21:39:24 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
21:39:43 <sm> boxscape_: lol instant classic project name there
21:39:54 <boxscape_> yeah
21:40:19 <sm> you should register that, I'd like to see it built :)
21:40:29 <boxscape_> I don't know what it would do though :/
21:40:44 <tomsmeding> specifically for people with a lisp?
21:40:48 <janus> what about crowd-sourcing prostate cancer survival duration
21:41:00 <boxscape_> from healthkell to healskell in just 3 weeks
21:41:10 <janus> people upload their test results, system correlates with other people, tell you have long you have to live and whether your doctor is a crank
21:41:46 <janus> if people stop logging on it means they died
21:42:07 <tomsmeding> dsal: is sugarhaskell also the package with the most non-haskell files
21:42:13 <boxscape_> I foresee false positives
21:42:18 <hololeap> I don't think it has to do anything, computers + "health" = $$$
21:42:36 <boxscape_> I'll just copy acme-one then
21:43:02 × jumper149 quits (~jumper149@static.6.71.203.116.clients.your-server.de) (Quit: WeeChat 3.3)
21:43:16 <tomsmeding> boxscape_: I'd take acme-zero, at least then you're sure it doesn't do anything
21:43:23 <dsal> tomsmeding: I've not actually looked inside any of these, but like... it's a bunch of java?
21:43:43 <dsal> Things I didn't expect to find in hackage: compiled class files in a junit directory.
21:44:02 <dsal> It was packaged on my birthday, though, so there's that.
21:45:00 <tomsmeding> dsal: yeah I look sugarhaskell up on hackage, saw just one module, was puzzled, clicked [browse], saw META-INF, jar files, $class files, and was even more puzzled
21:45:41 <tomsmeding> also acme-zero has two versions
21:45:50 <tomsmeding> first version was not good enough
21:46:15 <dsal> Hard to get it right on the first upload.
21:46:22 hololeap makes a package that comes bundled with a debian ISO to run an executable
21:46:58 <dsal> I worked at a place where a contractor basically did that.
21:47:02 × slack7679 quits (~slack1256@181.42.49.169) (Ping timeout: 240 seconds)
21:47:18 <Rembane_> Sounds like Docker but more.
21:47:22 <dsal> Checked in an ISO for the thing you needed to run his code. It very much a "Sir, this is a Wendy's" moment.
21:48:08 <Rembane_> Putting it in code repository is... yeah...
21:48:50 <janus> how would you store your smalltalk images? github seems like a good option
21:49:11 tromp joins (~textual@dhcp-077-249-230-040.chello.nl)
21:51:41 <dsal> Smalltalk seems pretty neat for "my computer" but I never really figured out how to usefully move code in and out.
21:51:54 <tomsmeding> dsal: in the same vein, I guess: how many different file extensions can you find
21:52:02 <sm> janus: squeak/pharo have some tools for that
21:52:47 <janus> sm: epicea? that looks like good old `.changes`. i think people use git now somehow?
21:53:02 <sm> yes, there are tools for it
21:53:43 <sm> also of course many native smalltalk alternatives, monticello and envy are two IIRC
21:54:38 × zer0bitz quits (~zer0bitz@2001:2003:f6bc:f00:75c5:c6ed:c91:17fe) (Read error: Connection reset by peer)
21:54:56 <sm> https://github.com/hpi-swa/Squot seems to be one
21:55:30 <janus> oh my , that certainly looks exotic! thanks
21:55:41 <sm> wow you nerdsniped me there. We could use more smalltalk in here, but I suppose it is off topic.. np
21:55:53 <EvanR> more LambdaMOO obviously
21:56:47 xkuru joins (~xkuru@user/xkuru)
21:57:04 × DNH quits (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd) (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:57:24 <dsal> λ> exts = Set.fromList (takeExtension <$> files)
21:57:24 <dsal> λ> length exts
21:57:25 <dsal> 1301
21:57:38 <tomsmeding> that's a lot
21:58:12 <dsal> One of them is ""
21:58:13 <tomsmeding> wanted to say, anything interesting, but that's quite the large collection to go through
21:58:14 <dsal> So just 1300
21:58:15 <boxscape_> what is `length files`?
21:58:24 <dsal> 381164
21:58:27 <boxscape_> I see
21:58:55 <tomsmeding> in what position in the frequency ranking is .class
21:59:02 <dsal> No obvious bitcoin wallets.
21:59:53 × slice quits (~slice@user/slice) (Quit: zzz)
22:01:40 <dsal> class is 22164. I need to flip this map around or something to get distributions.
22:01:52 <boxscape_> just write `flip files`
22:04:00 <tomsmeding> dsal: ordering = sortBy (comparing snd) $ map ((,) <$> head <*> length) $ groupBy ((==) `on` fst) $ sortBy (comparing fst) $ map (\f -> (takeExtension f, f)) files
22:04:15 <tomsmeding> imports Data.Ord, Data.Function, Data.List
22:04:32 <tomsmeding> oh perhaps a reverse in front
22:04:47 <dsal> This would be easier if my ghci worked
22:05:03 <tomsmeding> and the resulting list has a filename component but that's just the first occurrence, which is uninteresting
22:05:14 <tomsmeding> dsal: many things are easier if ghci works
22:06:00 <tomsmeding> replace the 'head' with 'fst . head' in order to get rid of the filename
22:06:18 <zzz> is Data.Set.fromList more efficient than Data.Foldable.fromList?
22:06:24 <hololeap> tomsmeding: what about walking into Mordor. is that easier?
22:06:25 <dsal> The thing I was doing gave me the top 10: [(193776,".hs"),(23899,""),(22164,".class"),(17742,".cabal"),(12902,".md"),(7919,".h"),(6153,".c"),(5231,".yaml"),(5082,".txt"),(4382,".svg")]
22:06:51 <tomsmeding> zzz: Data.Foldable doesn't have a fromList?
22:06:55 <dsal> "" is at least partially directories... I got rid of the ones that didn't end in /
22:07:22 CiaoSen joins (~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
22:07:49 <tomsmeding> hololeap: probably. At least you have an excuse if someone asks you why you haven't actually walked into Mordor yet -- laziness bit you
22:08:49 <tomsmeding> dsal: Are those numbers the first occurrence in a list of all files sorted by extension ordered on extension prevalence?
22:08:54 <tomsmeding> that's an... interesting metric
22:09:19 <tomsmeding> oh they are occurrence counts
22:09:23 <tomsmeding> that makes so much more sense
22:09:51 tomsmeding somehow thought that was the bottom 10, and tried to rationalise the numbers from there
22:10:53 <dsal> I started with m = Map.fromListWith (<>) [(takeExtension f, Sum 1) | f <- files]
22:10:57 <dsal> And then just flipped it.
22:11:02 <dsal> The files list is the output of tar tf
22:11:33 <tomsmeding> that's quite a bit neater than my monster of an expression
22:11:51 <dsal> Anything I try to edit in GHCI turns into garbage if I do anything other than append.
22:11:58 <tomsmeding> I guess I re-implemented Map.fromListWith (<>)
22:12:08 <dsal> Yeah, I and I reimplemented +
22:12:13 <tomsmeding> :D
22:12:22 <dsal> I had grander ideas when I started.
22:12:35 <EvanR> rate my format style https://paste.tomsmeding.com/ab9Tfx0x
22:12:39 <dsal> By the time I got to `Sum 1` there was no turning back.
22:12:50 <EvanR> just kidding, give me a tip on how to make it look like not shit
22:13:12 <dsal> lonely comma
22:13:30 <tomsmeding> EvanR: put the definitions in a where block, use RecordWildCards and write defaultMini {..}
22:13:44 <tomsmeding> except that uses RecordWildCards which is bad
22:14:15 <geekosaur> didnt we determine binding {..} doesn't work anyway?
22:14:17 <dsal> No, apparently RecordWildCards is good, but where is bad. You should do the same thing in let first and then just {..} it all away.
22:14:33 <geekosaur> I should say `binding {..}`
22:15:06 <dsal> The Standard™ on this project is `let someTypeNameField1 = 1; someTypeNameField2 = 2 in SomeType{..}`
22:16:47 × CiaoSen quits (~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 268 seconds)
22:17:11 <tomsmeding> EvanR: honestly I'd just write https://paste.tomsmeding.com/ynvT5pJY
22:18:50 <EvanR> alright
22:19:07 <EvanR> i had a where clause then was mad that I had to come up with alternate names
22:19:32 × Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 240 seconds)
22:19:57 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51)
22:20:21 × waleee quits (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd) (Ping timeout: 245 seconds)
22:20:43 <boxscape_> (I imagine it's apparent from the conversation so far but to be clear, you don't need alternate names for a where clause https://paste.tomsmeding.com/4Zf5CJVJ )
22:21:05 <EvanR> ok I didn't grok the wildcards suggestion earlier
22:21:34 <tomsmeding> boxscape_: doesn't that give shadowing warnings?
22:21:40 <tomsmeding> though my suggestion did the same thing
22:22:15 <boxscape_> erm don't you not get shadowing warnings for fields if NamedFieldPuns or RecordWildCards is enabled? I could be wrong
22:22:22 waleee joins (~waleee@2001:9b0:216:8200:d457:9189:7843:1dbd)
22:22:29 <EvanR> ok this is NamedFieldPuns
22:22:39 <boxscape_> yeah
22:22:51 <EvanR> it would save me from needing a lambdacase, but ... the puns are weird
22:23:07 <EvanR> but maybe its cool
22:23:17 tomsmeding doesn't like puns
22:23:26 <tomsmeding> well, not in programming languages
22:23:39 <dsal> I don't understand this word "pun"
22:23:43 <monochrom> You will hate this:
22:23:53 <monochrom> @quote monochrom faster.than
22:23:53 <lambdabot> monochrom says: einstein's theory implies that haskell cannot be faster than c
22:23:55 <tomsmeding> dsal: shadowing
22:24:06 <dsal> But why "pun" ?
22:24:15 <tomsmeding> monochrom: that's not a pun in a programming language, but I hate it nevertheless
22:24:25 <geekosaur> because the same name is being used in two ways
22:24:28 <EvanR> pun, the same words means different things
22:24:31 <xerox> From Middle English ponnen, ponen, punen, from Old English punian, pūnian (“to pound, beat, bray, bruise, crush, grind”), from Proto-Germanic *punōną (“to break to pieces, pulverize”). See pound. As a kind of word play, from the notion of "beating" the words into place.
22:24:32 <dsal> Ooh. I get it.
22:24:52 <tomsmeding> ooh ą
22:25:11 <Rembane_> It's like hack inverse
22:25:14 <monochrom> I thought typographers beat the words into place.
22:25:22 <monochrom> or typesetters
22:25:33 <EvanR> I was trying to wipe the dirt off my monitor near tomsmeding's ą
22:25:41 <monochrom> hahaha
22:25:42 dsal too
22:26:31 <EvanR> didn't see it in the xerox output
22:27:59 × tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…)
22:28:14 <monochrom> I think I see what you did there
22:28:32 DNH joins (~DNH@2a02:8108:1100:16d8:6057:883c:398d:9dbd)
22:30:46 × michalz quits (~michalz@185.246.204.58) (Remote host closed the connection)
22:32:53 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
22:33:32 × deadmarshal quits (~deadmarsh@95.38.116.172) (Ping timeout: 240 seconds)
22:33:45 × Flonk quits (~Flonk@vps-zap441517-1.zap-srv.com) (Quit: Ping timeout (120 seconds))
22:34:47 zincy_ joins (~zincy@2a00:23c8:970c:4801:4cc1:c671:40b5:6186)
22:34:49 Flonk joins (~Flonk@vps-zap441517-1.zap-srv.com)
22:36:10 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
22:37:51 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
22:38:05 <sm> successful hack: to get around my distaste for changelog editing, I made a tool that accepts an edit for just the oldest unedited pending item. Strangely, it works. Toil averted!
22:38:09 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
22:38:12 × kuribas quits (~user@ptr-25vy0i8ep4e11jhvxvb.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3))
22:38:21 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51) (Remote host closed the connection)
22:39:23 <dsal> I wrote a tool while back that would generate changelogs from git tags with fancy little charts and stuff saying who contributed to each release.
22:39:30 <dsal> So I just needed to write stuff in my tags.
22:39:50 <dsal> ChangeLog files are weird to me because it's another place that you have to write the same stuff, but inside the thing that's taking the changes.
22:40:17 <[itchyjunk]> hmm
22:40:21 <arahael> dsal: To me, changelogs are more stakeholder focused.
22:40:56 <arahael> (Which matters when your stakeholders aren't developers)
22:41:10 <dsal> Sure, but I can put that same information in my tag.
22:41:14 <dsal> And then just make the changelog on the fly.
22:41:20 × Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: This computer has gone to sleep)
22:41:27 <dsal> Except you can't do that when the changelog is checked in. So you have to copy and paste or something.
22:42:12 <sm> dsal: nice. I generate them from commit messages (but they still need editing, hence another tool)
22:42:28 × gehmehgeh_ quits (~user@user/gehmehgeh) (Quit: Leaving)
22:42:46 <EvanR> the changelog changelog
22:43:19 <dsal> Apparently I wrote this in python: https://github.com/dustin/bindir/blob/master/git-htmlchangelog
22:43:21 <arahael> dsal: Yeah, that wors as well.
22:43:24 <arahael> *works as well.
22:43:52 <dsal> And it doesn't work because you need things that probably don't exist anymore.
22:44:27 <dsal> I have no idea how to deal with python packages. Guess I'll just not do that.
22:45:12 <dsal> Here's an old example of what that would do: http://dustin.github.io/java-memcached-client/changelog.html
22:46:57 namkeleser joins (~namkelese@101.175.102.188)
22:47:21 <EvanR> dang... your boss can easily tell who to fire, nice
22:47:26 × dschrempf quits (~dominik@070-207.dynamic.dsl.fonira.net) (Quit: WeeChat 3.3)
22:47:49 <EvanR> "it has come to my attention that you are not a very big piece of the pie"
22:47:58 × burnsidesLlama quits (~burnsides@dhcp168-025.wadham.ox.ac.uk) (Remote host closed the connection)
22:49:02 <dsal> I had this cool realtime view of all of our repositories that did something like that. It was pretty neat. I made the most hideous conflation of a pie chart and a bar chart with a stream chart of changes over time.
22:50:30 <sm> ooh, pretty
22:50:46 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
22:51:00 <sm> what are the pie charts.. number of lines changed ?
22:51:17 <dsal> Just commits
22:51:23 <dsal> shortlog in pacman form
22:52:51 <dsal> Here's a tiny screenshot of the "realtime" thing I'd built a while back: http://dustin.sallings.org/images/gerrit-small.png
22:53:16 <dsal> It was fun to watch.
22:53:38 <dsal> That was for our code review system. Could see all the people doing all the things
22:54:44 <dsal> Wish that were still running and/or I had a readable screenshot. The weird chart in the bottom right was a combination of people, projects, activity levels, and something else.
22:56:43 <tabemann> I hate project management tools
22:57:25 <dsal> Oh, I do. It was project specific, showing how many different people were participating on it and how many changes went in to each project. https://usercontent.irccloud-cdn.com/file/0Jbdncx5/gerrit.png
22:57:29 slice joins (~slice@user/slice)
22:57:54 <[itchyjunk]> where { (x,xs) = h s} makes sense right? h s returns a tuple (a,b)
22:57:55 <dsal> I really like *implicit* project management tools. I'm writing code. Doing good commits, etc... Let everything observe that and communicate stuff instead of making me do extra work to tell you again what I've done.
22:58:25 <dsal> [itchyjunk]: Ask the compiler if it makes sense.
22:58:50 <dsal> (but you probably don't need {} unless you're trying to shove a bunch of stuff onto a line)
22:59:15 × wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds)
22:59:27 <arahael> Hmm, a bit of newbie help... I've got this error: Data Constructor not in scope: Discover :: Amazonka.Auth.Credentials
22:59:33 <arahael> How do I find out where that is, so that I can import it?
22:59:49 <monochrom> [itchyjunk]: Yes. It is very useful.
22:59:52 <arahael> I've tried searching hoogle, but I think Amazonka 2.0 isn't in stackage yet, so it isn't in hoogle.
23:00:54 <dsal> arahael: I believe it's Network.AWS
23:01:20 <arahael> dsal: Curious - I happen to know it's in Amazonka, but how do we find that out?
23:01:23 <dsal> Oh yeah, it's Credentials, exported from Network.AWS
23:01:45 <geekosaur> make sure you didn't do something like import Network.AWS (Credentials)
23:01:54 <sm> dsal: awesome
23:01:56 <geekosaur> without the trailing (..) to get its constructors
23:02:08 <arahael> I mean, "import Amazonka" works. I guess Amazonka might be doing a re-export.
23:02:22 <dsal> I wasn't even aware of Amazonka as a module.
23:02:44 <arahael> It's not a re-export.
23:02:53 <arahael> https://github.com/brendanhay/amazonka/blob/main/lib/amazonka/src/Amazonka/Auth.hs#L258
23:03:19 <arahael> I guess the method I should use when looking for "Foo.Bar.Baz" is to do a github search instead for "Foo.Bar"?
23:03:22 <dsal> Amazonka has a lot of rexports.
23:03:33 <arahael> dsal: That's the actual type.
23:03:40 <dsal> Sure, but that's not how I got it.
23:04:06 <dsal> Unless… did they move everything since the last 2.0 I tried?
23:05:05 MironZ joins (~MironZ@nat-infra.ehlab.uk)
23:05:09 <dsal> Amazonka exports Credentials it imports from Amazonka.Auth
23:05:51 <arahael> So I guess Network.AWS must be re-exporting the Amazonka one.
23:06:17 <geekosaur> mm, that error says it's coming from Amazonka.Auth
23:06:27 <geekosaur> how are you importing Amazonka?
23:06:43 deadmarshal joins (~deadmarsh@95.38.228.146)
23:06:55 <arahael> "import Amazonka".
23:07:05 <geekosaur> no list? that seems odd then
23:07:06 <arahael> Or rather, I am now. :)
23:07:13 <geekosaur> oh
23:07:25 <arahael> geekosaur: The question was more: "How do I know that I need to do an Import Amazonka"?
23:07:45 <arahael> geekosaur: As opposed to "Import Amazonka.Bazooka".
23:07:45 × jstolarek quits (~jstolarek@137.220.120.162) (Ping timeout: 250 seconds)
23:07:58 <arahael> Or even as dsal thought, "import Network.AWS".
23:08:00 <geekosaur> I would look at the type it listed and start drilling down
23:08:09 <arahael> geekosaur: Yeah, how would you find that type? :D
23:08:10 <geekosaur> Amazonka, then Amazonka.Auth
23:08:17 <geekosaur> it's in the error message
23:08:26 <geekosaur> "Data Constructor not in scope: Discover :: Amazonka.Auth.Credentials"
23:08:32 × lemonsnicks quits (~lemonsnic@cpc159519-perr18-2-0-cust114.19-1.cable.virginm.net) (Ping timeout: 240 seconds)
23:09:05 <arahael> geekosaur: Right, so I've since suggested that maybe the method I need is to chop that last term off, and search for "Amazonka.Auth".
23:09:22 lemonsnicks joins (~lemonsnic@cpc159519-perr18-2-0-cust114.19-1.cable.virginm.net)
23:09:23 <arahael> (Otherwise github will yield zero results)
23:09:26 <geekosaur> I'd start from thre other end though, specifically to check for reexports
23:09:39 <arahael> geekosaur: You'd search for "Amazonka"?
23:09:43 <geekosaur> yes
23:09:50 <arahael> That's a lot of github results.
23:09:57 <geekosaur> on the assumption that it'd be reexporting the right module already
23:10:14 <geekosaur> also I would not simply search github, I would search the source since I'm already targeted
23:10:34 <arahael> Ah, "try it and see", import Amazonka, recomiple, if it fails, try "import Amazonka.Auth"?
23:10:41 <geekosaur> you presumably know where you got amazonka 2.0 from so look in Amazonka.hs then Amazonka/Auth.hs
23:10:46 × deadmarshal quits (~deadmarsh@95.38.228.146) (Ping timeout: 245 seconds)
23:11:00 <arahael> Ah, I see, so actually read the source.
23:11:07 <dsal> I think there are good uses for re-exports and bad uses. Just sticking everything everywhere so you can import whatever you want and it'll probably work *seems* kind of bad.
23:11:23 <dsal> arahael: heh, that's what I was just doing. Reading source.
23:11:31 × FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection)
23:11:35 <arahael> dsal: Now, for the next example... Variable not in scope: getRegion :: ASetter Env a3 a4 Region
23:11:50 <geekosaur> it seems weird to do a full github search when you have the source code already
23:11:51 FinnElija joins (~finn_elij@user/finn-elija/x-0085643)
23:11:53 <dsal> This environment parser reexports stuff like <=< and optional, so all this code was using Env.<=< and Env.optional which I thought were somehow special.
23:12:07 <dsal> arahael: welcome to 2.0
23:12:12 <arahael> dsal: :)
23:12:24 <arahael> geekosaur: Well, no, I constrain it to the specific repo, of course. :)
23:12:39 <geekosaur> even so.
23:13:11 <geekosaur> the error tells you exactly where to start searching, so start searching there instead of poking the whole project
23:13:20 <dsal> arahael: newEnv Discover <&> set (field @"envRegion") r
23:14:57 × obfusk quits (~quassel@a82-161-150-56.adsl.xs4all.nl) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
23:15:02 <arahael> dsal: I'm trying to figure out how I would find out that particular incantation, but thanks for that, that also helps. :D
23:15:40 <dsal> It's generic lens now. So you have to like, know the name of the field.
23:15:45 <dsal> The compiler will tell you when you're wrong.
23:16:02 <dsal> So just keep guessing strings until you're right, or find the object and see what fields exist on it and try to guess based on those.
23:16:04 [itchyjunk] riphair
23:16:55 <arahael> dsal: I've loaded this into ghci: newEnv Discover <&> set _ NorthVirginia -- That does get me the ASetter Env b a0 Region ... Oh, wait, GTG - back in a moment...
23:16:58 <arahael> Visitor.
23:18:18 <[itchyjunk]> omg, i knew i had the signature wrong
23:18:27 <[itchyjunk]> i removed the signature line and it compiled
23:18:56 <geekosaur> now ask it for the correct signature
23:19:01 <geekosaur> foo :: _
23:19:16 <[itchyjunk]> and now that i :t myFunc, *facepalm*
23:19:46 <dsal> arahael: Yeah, the setter is (field @"[field name]") -- I don't think you're going to get a lens hole working there, though I think there might be another module with more explicit things.
23:20:06 burnsidesLlama joins (~burnsides@dhcp168-025.wadham.ox.ac.uk)
23:20:28 lavaman joins (~lavaman@98.38.249.169)
23:22:16 × takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection)
23:22:28 <[itchyjunk]> I have a convoluted question about this : https://bpa.st/6Q4Q
23:22:47 <[itchyjunk]> my function `i` does what i want but i have to manually compose it with h
23:22:54 <[itchyjunk]> is `j` the best solution to it?
23:23:03 <[itchyjunk]> j "this is a test"
23:23:03 <[itchyjunk]> ["this","is","a","test"]
23:23:09 <[itchyjunk]> j does what i was intending it to do
23:24:32 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds)
23:25:01 × namkeleser quits (~namkelese@101.175.102.188) (Quit: Client closed)
23:25:05 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 250 seconds)
23:26:51 × mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection)
23:29:03 <[exa]> [itchyjunk]: so `f` and `g` are take/drop word, h is "one word and rest", i iterates that, right?
23:29:17 namkeleser joins (~namkelese@101.175.102.188)
23:29:30 × hololeap quits (~hololeap@user/hololeap) (Excess Flood)
23:30:28 <[itchyjunk]> yes i think so
23:30:36 <[exa]> [itchyjunk]: anyway, normally I'd go with `h s = f s:h (g s)`, generating a list of words, which kinda captures the recursion you have there right in the data
23:30:45 <[itchyjunk]> f gets the first word, g gets everything but the first word
23:30:55 hololeap joins (~hololeap@user/hololeap)
23:31:11 <[itchyjunk]> hmm
23:31:44 <[exa]> you might notice that you will have either [] or (head:rest) instead of ([],[]) and (head,rest), which may be a bit more convenient
23:31:54 × max22- quits (~maxime@2a01cb0883359800b686e733ae8fbdbc.ipv6.abo.wanadoo.fr) (Remote host closed the connection)
23:31:56 lbseale joins (~ep1ctetus@user/ep1ctetus)
23:32:01 × AlexNoo quits (~AlexNoo@178.34.162.8) (Ping timeout: 245 seconds)
23:32:01 × Alex_test quits (~al_test@178.34.162.8) (Ping timeout: 245 seconds)
23:32:08 <[exa]> e.g. you can distinguish between empty word on beginning vs no word on beginning
23:32:26 × AlexZenon quits (~alzenon@178.34.162.8) (Ping timeout: 245 seconds)
23:32:28 Tuplanolla joins (~Tuplanoll@91-159-69-50.elisa-laajakaista.fi)
23:33:03 × qwedfg quits (~qwedfg@user/qwedfg) (Quit: ZNC - https://znc.in)
23:34:29 obfusk joins (~quassel@a82-161-150-56.adsl.xs4all.nl)
23:34:30 × cosimone` quits (~user@93-47-228-243.ip115.fastwebnet.it) (Ping timeout: 268 seconds)
23:34:55 qwedfg joins (~qwedfg@user/qwedfg)
23:35:15 × dhouthoo quits (~dhouthoo@178-117-36-167.access.telenet.be) (Quit: WeeChat 3.3)
23:37:39 × zincy_ quits (~zincy@2a00:23c8:970c:4801:4cc1:c671:40b5:6186) (Remote host closed the connection)
23:37:39 × betelgeuse quits (~betelgeus@94-225-47-8.access.telenet.be) (Read error: Connection reset by peer)
23:38:21 <[itchyjunk]> hmm
23:38:26 CiaoSen joins (~Jura@p200300c9570204002a3a4dfffe84dbd5.dip0.t-ipconnect.de)
23:38:52 eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51)
23:40:53 emf joins (~emf@2620:10d:c090:400::5:acc4)
23:42:21 × emf quits (~emf@2620:10d:c090:400::5:acc4) (Client Quit)
23:43:22 × eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:852c:89ad:25b7:fe51) (Ping timeout: 260 seconds)
23:45:17 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
23:45:19 <[itchyjunk]> I forgot how to reverse list. the one i am writing compiles but gives me a "Non exhaustive pattern"
23:45:21 <[itchyjunk]> https://bpa.st/SEZA
23:45:35 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
23:45:36 <[itchyjunk]> i went through an example [1, 2, 3] and i don't see where it goes wrong
23:46:28 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Remote host closed the connection)
23:46:39 <[itchyjunk]> last [1] = 1 and init [1] = [] so reverseList (init [1]) = reverseList [] = []
23:46:45 hskpractice joins (~hskpracti@94-255-217-215.cust.bredband2.com)
23:48:19 <arahael> dsal: Back. Ok, so basically once I see "ASetter", I should assume "lens", but then how do I know what teh field name should be?
23:48:47 <arahael> (Also: Why the @string?)
23:49:49 <arahael> dsal: Hmm, using that syntax it says it's illegal, this is using new extensions I'm not familiar with!
23:49:58 pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655)
23:50:59 × hskpractice quits (~hskpracti@94-255-217-215.cust.bredband2.com) (Ping timeout: 256 seconds)
23:51:50 <dsal> arahael: That's generic lens.
23:52:06 <dsal> DataKinds and TypeApplications
23:52:29 <arahael> dsal: I've already got Control.Lens imported. Ah, ok, I'll just enable those extensions then.
23:53:16 <arahael> dsal: Somehow feel that I didn't need those extensions before with simple lens stuff.
23:53:24 <dsal> No, this is generic lens.
23:53:36 <dsal> the generic-lens package
23:53:43 <dsal> @hackage generic-lens
23:53:43 <lambdabot> https://hackage.haskell.org/package/generic-lens
23:53:57 <arahael> Oh!
23:54:01 × namkeleser quits (~namkelese@101.175.102.188) (Quit: Client closed)
23:54:04 <dsal> field is import Data.Generics.Product (field)
23:54:39 <dsal> Instead of TH generating everything you might possibly do at compile time, we just add generics and sort it out when you need it.
23:55:05 <arahael> Nice.
23:55:50 <dsal> [itchyjunk]: I think you have a typo in that code you pasted.
23:55:59 <dsal> Or something... it shouldn't compile
23:56:28 <arahael> Ok, seems I need to sort out the versions for generic-lens, will do that later in the arvo.
23:56:37 <arahael> dsal: Thanks for your guidance :)
23:56:48 <dsal> Yeah, I went through all this on a couple of projects. :)
23:57:03 <dsal> Glad that time was more useful than just me playing around.
23:57:42 × MrNobody_0000000 quits (~MrNobody@user/mrnobody-0000000/x-9129771) (Ping timeout: 276 seconds)
23:57:43 <arahael> Heh. This has taught me a LOT about the haskell package ecosystem, most of it seems quite reasonable, particularly considering 9.2.1 isn't even a "recommended version" yet.
23:58:14 <dsal> This is me converting my s3up project to amazonka2: import Data.Generics.Product (field)
23:58:16 <dsal> damnit
23:58:22 <dsal> https://github.com/dustin/s3up/commit/796f65cc2cc6bb92b1127f35d122972908b7f888
23:59:44 <arahael> Nice. I'm trying to abandon stackage, these days, but that looks helpful! Somehow generic-lens doesn't build for me, but it's probably due to some package conflict or yet another arch-specific bug.

All times are in UTC on 2021-11-26.