2022-12-03 00:00:13 +0100 | <davean> | To show that there was more than a 2x spread |
2022-12-03 00:00:14 +0100 | <monochrom> | Ugh wolfram alpha refuses to compute integrate x^2 dx from 0 to (us macdonalds salary) |
2022-12-03 00:00:45 +0100 | <davean> | fieldbuck_: From europe I'm taking it? :) |
2022-12-03 00:00:52 +0100 | <fieldbuck_> | yes! |
2022-12-03 00:01:01 +0100 | werneta | (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 268 seconds) |
2022-12-03 00:01:30 +0100 | <monochrom> | ooooohhhhhh I see, "us macdonalds salary" is not referentially transparent! That's why. |
2022-12-03 00:02:01 +0100 | <davean> | fieldbuck_: well the EU fits in a corner of the US :-p |
2022-12-03 00:02:32 +0100 | <monochrom> | Ugh next you're saying "US is America, Canada is North America"... |
2022-12-03 00:02:53 +0100 | <davean> | monochrom: nah, but France is North America |
2022-12-03 00:03:00 +0100 | <monochrom> | haha |
2022-12-03 00:03:09 +0100 | <davean> | it is! |
2022-12-03 00:03:13 +0100 | <davean> | And south america! |
2022-12-03 00:03:32 +0100 | <EvanR> | I live in south america |
2022-12-03 00:03:35 +0100 | <monochrom> | rock-paper-scissor geography |
2022-12-03 00:03:37 +0100 | <EvanR> | i.e. louisiana |
2022-12-03 00:03:40 +0100 | <davean> | EvanR: Do you live in France? |
2022-12-03 00:03:52 +0100 | <davean> | Ah damn I didn't get it in fast enough |
2022-12-03 00:04:05 +0100 | <fieldbuck_> | i mean a nurse and a junior dev might earn somewhat same money here and if you are wery experienced and senior maybe you could earn 2x that much |
2022-12-03 00:04:09 +0100 | <EvanR> | like many other places used to be technically france |
2022-12-03 00:04:18 +0100 | <fieldbuck_> | but anything more than that you would have to be really special |
2022-12-03 00:05:02 +0100 | <davean> | fieldbuck_: I know US developers making between 80k and something like 1.5M personally. |
2022-12-03 00:05:19 +0100 | <davean> | At the higher end its a little harder to say how much they make exactly. |
2022-12-03 00:05:43 +0100 | <davean> | I've known US developers making 40k |
2022-12-03 00:06:01 +0100 | <fieldbuck_> | hmm but according to google nurse avg salary is about 80k so it would be 6.6k a month |
2022-12-03 00:06:15 +0100 | tomokojun | (~tomokojun@37.19.221.160) (Read error: Connection reset by peer) |
2022-12-03 00:06:27 +0100 | <davean> | fieldbuck_: So why do you care? That might help more |
2022-12-03 00:06:42 +0100 | <mauke> | wait, why is fieldbuck_ back? weren't they k-lined? |
2022-12-03 00:06:43 +0100 | tomokojun | (~tomokojun@37.19.221.160) |
2022-12-03 00:07:02 +0100 | <fieldbuck_> | ? i mean i don't really care and i am not arguing anything but i am just curious |
2022-12-03 00:10:40 +0100 | <davean> | fieldbuck_: well you're asking a question and you keep acting like these salaries are fungible, you're asking for a reason but you are not at all looking at how much money a person actually gets or what the spending power is |
2022-12-03 00:11:17 +0100 | werneta | (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
2022-12-03 00:13:26 +0100 | <fieldbuck_> | i know i know! but what i really wanted to know how much money does a junior software dev make than a mcd burger flipper or a walmart cashier! |
2022-12-03 00:13:45 +0100 | <fieldbuck_> | sry if im a bit unclear but i have drank quite few beers already |
2022-12-03 00:15:55 +0100 | <davean> | That entirely depends on location |
2022-12-03 00:16:11 +0100 | <davean> | Thats not a question for which there is anything like a consistent answer across the US |
2022-12-03 00:16:12 +0100 | <rubin55> | i was a burger-flipper in '93ish? I made 3.23 guilders an hour.. it was a great motivator to do better in life later on |
2022-12-03 00:16:14 +0100 | Guest60 | (~Guest60@101.98.118.246) |
2022-12-03 00:16:49 +0100 | <rubin55> | no idea what they do nowadays, but i'd imagine ~1000ish eur monthly net? |
2022-12-03 00:17:22 +0100 | <fieldbuck_> | after rent? |
2022-12-03 00:17:31 +0100 | <rubin55> | nurse is quite a bit higher at least over here |
2022-12-03 00:17:51 +0100 | <rubin55> | after rent..? no, net salary, after tax |
2022-12-03 00:19:07 +0100 | chele | (~chele@user/chele) (Remote host closed the connection) |
2022-12-03 00:19:26 +0100 | <rubin55> | nurse here would be between about ~2000ish and ~3000ish net monthly |
2022-12-03 00:19:52 +0100 | seydar | (~seydar@154-27-113-252.starry-inc.net) (Quit: leaving) |
2022-12-03 00:20:39 +0100 | <rubin55> | junior dev ~2500ish net i would say; senior dev depends on employment vs contracting |
2022-12-03 00:20:44 +0100 | seydar | (~seydar@154-27-113-252.starry-inc.net) |
2022-12-03 00:21:17 +0100 | <seydar> | here's my submission for day 2 of AoC -- I'd love some feedback, particularly on how to best organize the whole rock-beats-scissors part: https://paste.tomsmeding.com/rj3bob9U |
2022-12-03 00:21:20 +0100 | michalz | (~michalz@185.246.204.93) (Remote host closed the connection) |
2022-12-03 00:21:22 +0100 | wroathe | (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
2022-12-03 00:21:59 +0100 | <rubin55> | and depends a lot on the field too, languages, backend/frontend, years of experience, contacts, how well one can present ones'self |
2022-12-03 00:23:09 +0100 | <fieldbuck_> | ok ok uh what well i mean what have been told to me is that even a junior google dev earns something like 400k/year |
2022-12-03 00:23:28 +0100 | <fieldbuck_> | but it might erroneous information |
2022-12-03 00:23:31 +0100 | gqplox | (~textual@2a02:c7c:941d:fd00:84dc:e5:8d89:ecd6) |
2022-12-03 00:23:46 +0100 | <gqplox> | yo yo what's up guys |
2022-12-03 00:23:51 +0100 | <davean> | fieldbuck_: I have known a Junior dev who made $350k at google, sure |
2022-12-03 00:24:03 +0100 | <davean> | location, expertise, etc matter. |
2022-12-03 00:24:16 +0100 | <geekosaur> | the big four (google amazon microsoft apple) are a different story entirely, yes |
2022-12-03 00:24:39 +0100 | <davean> | geekosaur: Nah, you can get equal salary a lot of places. |
2022-12-03 00:24:45 +0100 | <geekosaur> | it's also a great way to get burnout |
2022-12-03 00:24:46 +0100 | <davean> | They just are in the higher class |
2022-12-03 00:25:42 +0100 | <monochrom> | IMO the interesting question is how much money I could save per month by WFH in Cuba receiving Dubai-level income. >:) |
2022-12-03 00:26:42 +0100 | <fieldbuck_> | i make nothing because i am still a newbie! |
2022-12-03 00:27:28 +0100 | <davean> | monochrom: I care about my current quality of life at least a little. Need to deal with the time value of happiness since one might die at any point. |
2022-12-03 00:27:39 +0100 | <monochrom> | But I guess you'll say "but it still depends on whether you buy cigars" |
2022-12-03 00:27:43 +0100 | acidjnk | (~acidjnk@p200300d6e7137a65e1a901d19b642858.dip0.t-ipconnect.de) (Ping timeout: 252 seconds) |
2022-12-03 00:28:12 +0100 | <davean> | No, because thats optional :-p |
2022-12-03 00:28:22 +0100 | <davean> | taxes and base susistence sorta aren't |
2022-12-03 00:28:27 +0100 | <fieldbuck_> | i don't think that cuba would be the best choice but in some eastern european countries you would live like a king! |
2022-12-03 00:29:02 +0100 | <rubin55> | I always found it strange how much difference there is in income between contracting and regular employment in europe, and have also observed how that's a little different in the US |
2022-12-03 00:29:07 +0100 | <gqplox> | is ok it if i post my advent of code here for critique? |
2022-12-03 00:29:18 +0100 | <monochrom> | Yes. |
2022-12-03 00:29:22 +0100 | Xeroine | (~Xeroine@user/xeroine) (Ping timeout: 252 seconds) |
2022-12-03 00:29:25 +0100 | <gqplox> | http://sprunge.us/x2vF74 |
2022-12-03 00:29:35 +0100 | <gqplox> | spoiler ^ |
2022-12-03 00:29:41 +0100 | <gqplox> | i did the opposite of code golf haha |
2022-12-03 00:29:42 +0100 | Xeroine | (~Xeroine@user/xeroine) |
2022-12-03 00:30:01 +0100 | <seydar> | gqplox: i'm looking for critique of mine as well https://paste.tomsmeding.com/rj3bob9U |
2022-12-03 00:30:21 +0100 | <gqplox> | oh cool |
2022-12-03 00:30:48 +0100 | <gqplox> | (mine is for part 1 btw) |
2022-12-03 00:30:53 +0100 | <seydar> | gqplox: oh boy. now I'm seeing how I should've done it |
2022-12-03 00:30:56 +0100 | <gqplox> | i see you have done both |
2022-12-03 00:31:23 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
2022-12-03 00:32:10 +0100 | <gqplox> | oh cool i didn't know about the at sing |
2022-12-03 00:32:11 +0100 | <seydar> | gqplox: yeah, but your code is more haskellish |
2022-12-03 00:32:14 +0100 | <gqplox> | sign* for lists |
2022-12-03 00:32:31 +0100 | <seydar> | i didn't know there was automatic ordering for data |
2022-12-03 00:32:44 +0100 | <geekosaur> | it's not just for lists, it lets you capture any pattern while also matching subpatterns within |
2022-12-03 00:32:45 +0100 | <davean> | seydar: deriving is great! |
2022-12-03 00:33:06 +0100 | beteigeuze | (~Thunderbi@bl14-81-220.dsl.telepac.pt) (Remote host closed the connection) |
2022-12-03 00:33:39 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-03 00:33:56 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Remote host closed the connection) |
2022-12-03 00:34:00 +0100 | <seydar> | gqplox: ahhh you made it as succ with a special case! smart |
2022-12-03 00:34:22 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2022-12-03 00:35:09 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Max SendQ exceeded) |
2022-12-03 00:35:26 +0100 | <gqplox> | thank you :) |
2022-12-03 00:35:40 +0100 | <gqplox> | im waiting to see what some of the haskell pros here have lol |
2022-12-03 00:35:49 +0100 | <gqplox> | some map fold one liner or something crazy |
2022-12-03 00:36:37 +0100 | <seydar> | hm. no way to get around the 6 lines defining characters to shapes and their relationships though |
2022-12-03 00:37:39 +0100 | <davean> | seydar: I mean you can make a map |
2022-12-03 00:37:44 +0100 | <gqplox> | yeah Im not sure about that, I guess you could do some math tricks using ord perhaps? |
2022-12-03 00:37:44 +0100 | <davean> | or a key-value list |
2022-12-03 00:38:00 +0100 | <davean> | Don't need lines for a replacement mapping |
2022-12-03 00:40:06 +0100 | <mauke> | main = interact ((++ "\n") . show . sum . map score . lines); score [ord -> c1, ' ', ord -> c2] = (c2 - c1 + 2) `mod` 3 * 3 + c2 - ord 'W' |
2022-12-03 00:40:09 +0100 | <mauke> | ^ my solution |
2022-12-03 00:40:25 +0100 | <mauke> | only in reality it is on two lines and with more type signatures |
2022-12-03 00:40:43 +0100 | <gqplox> | hahaha, and there it is |
2022-12-03 00:41:18 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) (Remote host closed the connection) |
2022-12-03 00:41:43 +0100 | fieldbuck_ | (~fieldbuck@mobile-access-d51ce0-248.dhcp.inet.fi) () |
2022-12-03 00:42:37 +0100 | <mauke> | part 2 has: score [ord -> c1, ' ', ord -> c2] = (c2 - ord 'X') * 3 + (c1 + c2 + 2) `mod` 3 + 1 |
2022-12-03 00:43:56 +0100 | kadobanana | (~mud@user/kadoban) (Ping timeout: 265 seconds) |
2022-12-03 00:44:17 +0100 | <seydar> | mauke: wait what's going on in score [ord -> c1...] as the function definition |
2022-12-03 00:44:27 +0100 | <c_wraith> | those are view patterns |
2022-12-03 00:44:30 +0100 | <mauke> | {-# LANGUAGE ViewPatterns #-} |
2022-12-03 00:44:35 +0100 | <seydar> | it looks like you're describing a function as an argument |
2022-12-03 00:45:00 +0100 | <mauke> | "bind c1 to the value, but first pipe it through ord" |
2022-12-03 00:45:03 +0100 | <c_wraith> | seydar: https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/view_patterns.html |
2022-12-03 00:45:04 +0100 | <seydar> | view patterns, huh. sounds like some perl carryover |
2022-12-03 00:45:52 +0100 | gmg | (~user@user/gehmehgeh) (Quit: Leaving) |
2022-12-03 00:45:54 +0100 | <c_wraith> | in general, the ghc user guide is fantastic. Not to be missed for your questions about stuff GHC does. |
2022-12-03 00:46:25 +0100 | <Guest60> | Hi, I'm new to using arrows and wondering if they're a good tool for mapping Eithers? |
2022-12-03 00:46:29 +0100 | <seydar> | this is like the lovechild of APL and perl |
2022-12-03 00:46:30 +0100 | Topsi | (~Topsi@dyndsl-031-150-076-205.ewe-ip-backbone.de) |
2022-12-03 00:47:15 +0100 | <seydar> | oh wait now that i've read more than 2 sentences on the page, these seem pretty cool |
2022-12-03 00:47:19 +0100 | <monochrom> | Yes. |
2022-12-03 00:47:46 +0100 | <c_wraith> | Guest60: they work, but Bifunctor is probably an easier abstraction in general. |
2022-12-03 00:48:11 +0100 | <c_wraith> | and Data.Bifunctor has been in base for a while now |
2022-12-03 00:48:38 +0100 | <c_wraith> | Arrow has a lot of weird stuff. |
2022-12-03 00:49:16 +0100 | <Guest60> | In my particular case I have a sum type for success and error and I want to convert an either into the success or error. So you would use bifunctor for this? |
2022-12-03 00:49:34 +0100 | <c_wraith> | sure |
2022-12-03 00:49:36 +0100 | <c_wraith> | :t bimap |
2022-12-03 00:49:37 +0100 | <lambdabot> | Bifunctor p => (a -> b) -> (c -> d) -> p a c -> p b d |
2022-12-03 00:50:03 +0100 | <c_wraith> | so like... bimap mkError mkSuccess |
2022-12-03 00:50:10 +0100 | neightchan | (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
2022-12-03 00:50:10 +0100 | <mauke> | my first idea for doing the AoC exercise was to generate a score lookup table for all possible lines |
2022-12-03 00:50:37 +0100 | <mauke> | I kept spotting patterns I could use to generate the table more succinctly |
2022-12-03 00:51:01 +0100 | <mauke> | until I was down to a single calculation, which I then inlined and scrapped the table |
2022-12-03 00:51:05 +0100 | <c_wraith> | Guest60: oh, nevermind. actually, I'd just use either |
2022-12-03 00:51:11 +0100 | <c_wraith> | :t either -- Guest60 |
2022-12-03 00:51:12 +0100 | <lambdabot> | (a -> c) -> (b -> c) -> Either a b -> c |
2022-12-03 00:51:26 +0100 | <c_wraith> | Becuase you want to *replace* the Either with your own type |
2022-12-03 00:51:57 +0100 | <Guest60> | ah yeah, I looked at that one. It's better because either maps to a c as opposed to a p of b d? |
2022-12-03 00:52:02 +0100 | <c_wraith> | exactly |
2022-12-03 00:52:10 +0100 | <Guest60> | Because b and d are summed to c, might as well use either |
2022-12-03 00:52:36 +0100 | <mauke> | :t either ?mkError ?mkSuccess |
2022-12-03 00:52:37 +0100 | <lambdabot> | (?mkError::a -> c, ?mkSuccess::b -> c) => Either a b -> c |
2022-12-03 00:53:26 +0100 | kadobanana | (~mud@user/kadoban) |
2022-12-03 00:59:58 +0100 | <seydar> | i took inspiration from gqplox and redid it to use shapes, but it's now longer and uglier than ever. am i missing something? https://paste.tomsmeding.com/NK1A9M7g |
2022-12-03 01:01:12 +0100 | <mauke> | don't need splitOn " "; can just use words instead |
2022-12-03 01:01:37 +0100 | <mauke> | repeated 'us ==' is redundant and could be replaced by pattern matching |
2022-12-03 01:02:52 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
2022-12-03 01:04:04 +0100 | <mauke> | getMove is arithmetible |
2022-12-03 01:05:17 +0100 | <mauke> | getMove (them, us) = (them, toEnum ((fromEnum them + fromEnum us - 1) `mod` 3)) |
2022-12-03 01:06:16 +0100 | <seydar> | ah good move |
2022-12-03 01:08:03 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 255 seconds) |
2022-12-03 01:08:16 +0100 | <mauke> | scoreOutcome (them, us) = (fromEnum us - fromEnum them + 1) `mod` 3 * 3 |
2022-12-03 01:08:55 +0100 | sammelweis | (~quassel@mobile-107-92-122-90.mycingular.net) |
2022-12-03 01:09:50 +0100 | <segfaultfizzbuzz> | geekosaur: ah interesting i didn't know about setting, thanks |
2022-12-03 01:09:53 +0100 | <mauke> | that (... + 1) `mod` 3 thing basically encodes the betterShape relationship |
2022-12-03 01:11:18 +0100 | <Guest60> | If you have a type `a b` is it implied with `Show (a b)` that `b` has the `Show` typeclass? |
2022-12-03 01:11:26 +0100 | <c_wraith> | no |
2022-12-03 01:12:19 +0100 | <c_wraith> | However, you can have something like Show (Foo a) where the Show instance for Foo looks like instance Show a => Show (Foo a) .... |
2022-12-03 01:12:26 +0100 | <mauke> | data Proxy b = Proxy; instance Show (Proxy b) where { show Proxy = "Proxy" } |
2022-12-03 01:12:46 +0100 | <c_wraith> | If you have a case like that, ghc will infer the transitive dependency |
2022-12-03 01:12:49 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds) |
2022-12-03 01:13:15 +0100 | <Guest60> | Ah yep, I was confused about a "Rendudant constraint" warning on the show implementation but its because I already specified the constraint on `b` in the instance declaration. Doh |
2022-12-03 01:13:31 +0100 | <Guest60> | Hence the inference |
2022-12-03 01:13:33 +0100 | accord | (uid568320@id-568320.hampstead.irccloud.com) |
2022-12-03 01:14:09 +0100 | <mauke> | .oO( because of the implication ) |
2022-12-03 01:15:00 +0100 | <gqplox> | okay seydar i've done part two |
2022-12-03 01:15:29 +0100 | <gqplox> | http://sprunge.us/i6pvj9 |
2022-12-03 01:16:03 +0100 | <seydar> | mauke: thank you thank you |
2022-12-03 01:16:14 +0100 | <gqplox> | i did some reading on data classes today that's probably why i used them so much haha |
2022-12-03 01:16:58 +0100 | <seydar> | gqplox: ugh your code is so much better than mine. mine is still 58 lines |
2022-12-03 01:17:55 +0100 | <seydar> | the win lose draw datatype is much cleaner than i thought it would be |
2022-12-03 01:17:58 +0100 | <gqplox> | well your code solves both cases i wrote two separate programs so total yours has fewer lines ;) |
2022-12-03 01:18:10 +0100 | <seydar> | and it solves the problem of treating all letters as moves |
2022-12-03 01:18:12 +0100 | <gqplox> | but i didn't really try to code golf i was trying to use data types |
2022-12-03 01:18:35 +0100 | <mauke> | parseShape :: Char -> Shape; parseShape c = toEnum (fromEnum c - fromEnum 'A') |
2022-12-03 01:18:52 +0100 | <gqplox> | i learnt about the record syntax its quite cool how you can change it |
2022-12-03 01:19:14 +0100 | <gqplox> | like getName p = name p if i make the data with record |
2022-12-03 01:19:45 +0100 | <dsal> | gqplox: I wouldn't model a thing that can only have two items as a list. |
2022-12-03 01:20:14 +0100 | <gqplox> | yeah I agree |
2022-12-03 01:20:19 +0100 | <gqplox> | for the [[String]] in solve? |
2022-12-03 01:20:43 +0100 | <gqplox> | I did it because it was easy to parse the input with the map words $ lines but im sure there is a better way |
2022-12-03 01:21:32 +0100 | <dsal> | You could still parse it that way if you wanted to, but that doesn't need to escape the parser. |
2022-12-03 01:21:54 +0100 | <gqplox> | sorry what do you mean by that? |
2022-12-03 01:22:29 +0100 | <dsal> | > let p s = case words s of [a,b] -> Just (a,b); _ -> Nothing in (p "a b", p "a b c") |
2022-12-03 01:22:31 +0100 | <lambdabot> | (Just ("a","b"),Nothing) |
2022-12-03 01:22:34 +0100 | <mauke> | case words s of [a, b] -> (a, b); _ -> error ("Well, I certainly wasn't expecting this: " ++ show s) |
2022-12-03 01:22:35 +0100 | <gqplox> | and what would you suggest? have it as a [[(String, String)]? |
2022-12-03 01:22:47 +0100 | <dsal> | They're not strings either, though. |
2022-12-03 01:23:02 +0100 | <dsal> | > let p s = case words s of [[a],[b]] -> Just (a,b); _ -> Nothing in (p "a b", p "a b c", p "a bee") |
2022-12-03 01:23:04 +0100 | <lambdabot> | (Just ('a','b'),Nothing,Nothing) |
2022-12-03 01:24:02 +0100 | <mauke> | in my version I didn't even bother with 'words'. I just match the whole line against [a, ' ', b] :-) |
2022-12-03 01:24:41 +0100 | <mauke> | means it will abort on any malformed input, but at that point there is no good way to proceed anyway, so :shrug: |
2022-12-03 01:25:10 +0100 | <dsal> | I used megaparsec because I like to spend more time than necessary. |
2022-12-03 01:25:47 +0100 | <dsal> | > let p s = case s of [a, ' ', b] -> Just (a,b); _ -> Nothing in (p "a b", p "a b c", p "a bee") |
2022-12-03 01:25:48 +0100 | <lambdabot> | (Just ('a','b'),Nothing,Nothing) |
2022-12-03 01:26:51 +0100 | <gqplox> | would you mind sending over the complete program mauke or dsal please? |
2022-12-03 01:27:07 +0100 | <dsal> | Based on yours? |
2022-12-03 01:27:21 +0100 | sammelweis | (~quassel@mobile-107-92-122-90.mycingular.net) (Ping timeout: 268 seconds) |
2022-12-03 01:27:29 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 01:27:29 +0100 | <gqplox> | if that wouldn't be too much troubled that'd be great, using your method of parsing |
2022-12-03 01:27:52 +0100 | <dsal> | Sec. |
2022-12-03 01:28:06 +0100 | <dsal> | Oh, I'm using megaparsec. Unless you're wanting to learn megaparsec, don't do that. :) |
2022-12-03 01:28:47 +0100 | <dsal> | hmm... yours is already partial. |
2022-12-03 01:28:50 +0100 | <gqplox> | Oh right, yeah I only have the stdlib (prelude?) |
2022-12-03 01:28:53 +0100 | <dsal> | So I'll lean into that a sec. |
2022-12-03 01:29:13 +0100 | <mauke> | my full code: https://paste.tomsmeding.com/u5htAZuJ |
2022-12-03 01:29:50 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-03 01:29:58 +0100 | <mauke> | parsing is done with 'lines' and the pattern match in 'score' for each line |
2022-12-03 01:30:48 +0100 | money | polo |
2022-12-03 01:31:08 +0100 | <gqplox> | oh cool |
2022-12-03 01:31:22 +0100 | <gqplox> | what does ord -> c1 do? |
2022-12-03 01:31:27 +0100 | <mauke> | that's a view pattern |
2022-12-03 01:31:37 +0100 | <dsal> | :t ord |
2022-12-03 01:31:38 +0100 | <lambdabot> | Char -> Int |
2022-12-03 01:31:48 +0100 | <mauke> | it says: take the incoming value, pipe it through the 'ord' function, then pattern match the result against 'c1' |
2022-12-03 01:32:15 +0100 | <gqplox> | oh right nice |
2022-12-03 01:32:30 +0100 | <mauke> | in my version, Shape has been replaced by its Enum instance (i.e. instead of Rock | Paper | Scissors I have 0 | 1 | 2) |
2022-12-03 01:32:34 +0100 | <gqplox> | so it saves you having to write ord c1 each time or doing where c1 = ord? |
2022-12-03 01:32:38 +0100 | <mauke> | right |
2022-12-03 01:33:06 +0100 | <mauke> | also, "parsing" the characters is done with fromEnum (which is ord for Chars) |
2022-12-03 01:34:04 +0100 | <gqplox> | oh cool |
2022-12-03 01:34:07 +0100 | seydar | (~seydar@154-27-113-252.starry-inc.net) (Quit: leaving) |
2022-12-03 01:34:07 +0100 | <gqplox> | yeah that makes sense |
2022-12-03 01:34:16 +0100 | <mauke> | so: shapeFromChar c = toEnum (fromEnum c - fromEnum 'A') |
2022-12-03 01:34:37 +0100 | <mauke> | only I don't have the outer toEnum because I never actually use the Shape values |
2022-12-03 01:34:46 +0100 | <dsal> | This is minimal changes to yours. https://www.irccloud.com/pastebin/dUC7zGuy/day2.hs |
2022-12-03 01:34:56 +0100 | <mauke> | and I was too lazy to type fromEnum, so I used ord instead |
2022-12-03 01:34:59 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
2022-12-03 01:35:02 +0100 | <dsal> | I'd avoid partial here, though. |
2022-12-03 01:36:00 +0100 | <mauke> | also I never actually need to subtract ord 'A' because it is merged with the rest of the calculation |
2022-12-03 01:36:35 +0100 | <mauke> | > (-1) `mod` 3 |
2022-12-03 01:36:36 +0100 | <lambdabot> | 2 |
2022-12-03 01:36:38 +0100 | <mauke> | good |
2022-12-03 01:37:37 +0100 | <dsal> | Here's a variation of yours that doesn't have partial functions. https://www.irccloud.com/pastebin/jLoy9DIF/total.hs |
2022-12-03 01:38:58 +0100 | <mauke> | I think that's strictly worse than the partial version |
2022-12-03 01:39:04 +0100 | <dsal> | Why's that? |
2022-12-03 01:39:15 +0100 | <mauke> | it silently produces wrong results for malformed input |
2022-12-03 01:39:22 +0100 | <mauke> | my version just crashes |
2022-12-03 01:39:33 +0100 | <dsal> | It returns 0 which I guess is silently wrong. |
2022-12-03 01:39:51 +0100 | <mauke> | yeah, it pretends it has a sensible answer when it really doesn't |
2022-12-03 01:39:59 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 255 seconds) |
2022-12-03 01:40:05 +0100 | <EvanR> | if you never pass in a bad input to a partial function, it's not partial xD |
2022-12-03 01:40:07 +0100 | <dsal> | In practice, I'd push the Maybe all the way down. |
2022-12-03 01:40:27 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 01:40:52 +0100 | <dsal> | So `part2 = fmap solve . traverse parse . lines <$> readFile "input/day2"` |
2022-12-03 01:41:00 +0100 | <dsal> | In any case, partial functions just hurt later. |
2022-12-03 01:41:49 +0100 | <mauke> | you could argue that in some cases the partial function is still better |
2022-12-03 01:42:37 +0100 | <mauke> | specifically, if something goes wrong, the partial function will crash with a useful error message that tells you which part of the program couldn't proceed as expected |
2022-12-03 01:42:53 +0100 | <mauke> | with the Maybe version you just end up with Nothing |
2022-12-03 01:42:57 +0100 | <mauke> | and no idea what went wrong |
2022-12-03 01:43:27 +0100 | <dsal> | Well, I guess you could use either, then. https://www.irccloud.com/pastebin/FRqgV2Qn/either.hs |
2022-12-03 01:43:52 +0100 | <dsal> | I can't argue that crashing is good, though. Crashing means I have angry customers. |
2022-12-03 01:44:08 +0100 | <mauke> | why? |
2022-12-03 01:44:21 +0100 | <geekosaur> | AoC is a different story there, I think |
2022-12-03 01:44:50 +0100 | <mauke> | "crashing" is implicitly bounded by process structure |
2022-12-03 01:44:57 +0100 | <mauke> | don't put all your eggs in one process :-) |
2022-12-03 01:45:35 +0100 | <dsal> | Well, I don't use erlang at work right now and microservices are almost always a bad idea. |
2022-12-03 01:46:25 +0100 | <dsal> | This is where using megaparsec is pretty nice, though. It's quite clear about where and how the input doesn't match my assumptions. |
2022-12-03 01:47:02 +0100 | <gqplox> | Thank you very mcuh dsal |
2022-12-03 01:47:15 +0100 | <gqplox> | the parse is way nicery |
2022-12-03 01:47:19 +0100 | <gqplox> | nicer |
2022-12-03 01:47:28 +0100 | <gqplox> | uncurry is very cool too |
2022-12-03 01:47:51 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
2022-12-03 01:48:47 +0100 | <dsal> | Apparently there's some controversy around partial functions, but it's not *super* controversial to say "partial functions are bad and should be avoided" |
2022-12-03 01:49:14 +0100 | <dsal> | It's not uncommon that Maybe loses some information you want later, but sometimes it's just not possible to get anything useful from it. |
2022-12-03 01:49:51 +0100 | <gqplox> | right, I guess in this example it's ok since the input is guaranteed to be good but for actual code you should avoid partial functions? |
2022-12-03 01:50:34 +0100 | <dsal> | A lot of aoc is practice for me, and I don't want to practice making runtime errors. :) |
2022-12-03 01:50:36 +0100 | <gqplox> | so the parse you wrote works properly for a bad case but I guess in my parseShape/Outcome I could've also done parseShape _ = error "can't parse" |
2022-12-03 01:50:41 +0100 | <dsal> | Depends on what you want to get out of it. |
2022-12-03 01:51:14 +0100 | <gqplox> | what do you mean maybe loses some information you want later? |
2022-12-03 01:51:39 +0100 | <dsal> | In the Either example, if something doesn't work, it tells you what didn't work. In the Maybe example, it just tells you it didn't work. |
2022-12-03 01:52:08 +0100 | <gqplox> | Oh cool I didn't even see you posted that |
2022-12-03 01:52:09 +0100 | <dsal> | So if you mangle your input and include a line or character that you're not expecting, it's the difference between `Nothing` and `Left "can't parse outcome 'W'"` |
2022-12-03 01:52:15 +0100 | <gqplox> | Yeah that's much more robust |
2022-12-03 01:52:16 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-03 01:52:30 +0100 | <gqplox> | Cool |
2022-12-03 01:53:03 +0100 | <dsal> | I don't bother most of the time. |
2022-12-03 01:53:10 +0100 | <mauke> | it all depends on context |
2022-12-03 01:53:30 +0100 | tremon | (~tremon@83-84-18-241.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in) |
2022-12-03 01:53:33 +0100 | <hpc> | there's a context-free grammar joke in there somewhere :D |
2022-12-03 01:53:54 +0100 | <mauke> | partial functions should be avoided if there's something sensible you can do instead |
2022-12-03 01:54:09 +0100 | <mauke> | but you should not hide failures just to keep the program going |
2022-12-03 01:54:12 +0100 | <mauke> | that way lies PHP |
2022-12-03 01:54:15 +0100 | <gqplox> | I think i'll head to bed now. thanks for taking the time to show me what you meant by the parsing, I understand now :) cya guys |
2022-12-03 01:54:36 +0100 | <hpc> | there's always something sensible to do, as well imo |
2022-12-03 01:55:00 +0100 | <mauke> | yes, it just depends on how much effort you're willing to put in |
2022-12-03 01:57:09 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
2022-12-03 01:59:10 +0100 | mvk | (~mvk@2607:fea8:5ce3:8500::efb) |
2022-12-03 01:59:17 +0100 | mvk | (~mvk@2607:fea8:5ce3:8500::efb) (Client Quit) |
2022-12-03 01:59:36 +0100 | <dsal> | In this case, the program is defined for the specified inputs. When inputs don't meet specification, returning `Nothing` is sensible. While a toy executable you're running for yourself might be acceptable to crash with a bad pattern match error, people ship libraries that do this. `Nothing` is a better user experience than "this program crashes and I can't do anything about it." |
2022-12-03 02:00:43 +0100 | <dsal> | I think I experienced something like that last time I tried to use regex for whatever reason. It's partial on the input it's matching. My program was crashing on data I was reading over the network if it happened to have the right sequence of bytes. |
2022-12-03 02:01:00 +0100 | <mauke> | that's a good point |
2022-12-03 02:01:11 +0100 | <mauke> | libraries aren't allowed to crash the main program |
2022-12-03 02:01:14 +0100 | <mauke> | that's illegal |
2022-12-03 02:03:30 +0100 | Buliarous | (~gypsydang@46.232.210.139) |
2022-12-03 02:04:12 +0100 | Guest60 | (~Guest60@101.98.118.246) (Quit: Client closed) |
2022-12-03 02:05:48 +0100 | <gqplox> | print $ solve $ map parse $ lines input |
2022-12-03 02:05:48 +0100 | <gqplox> | (print . solve . map parse . lines) input |
2022-12-03 02:05:56 +0100 | <gqplox> | which is preferred? |
2022-12-03 02:08:11 +0100 | <mauke> | print . solve . map parse . lines $ input -- compromise :-) |
2022-12-03 02:08:17 +0100 | <dsal> | Yeah, I'd go with that ^ |
2022-12-03 02:08:36 +0100 | <dsal> | I do the second one sometimes. I don't like throwing $ all over the place, though. My code's cheap. |
2022-12-03 02:08:49 +0100 | <gqplox> | ahh nice |
2022-12-03 02:08:53 +0100 | <gqplox> | i don't know why i didn't think of that |
2022-12-03 02:09:25 +0100 | <dsal> | Though I'd probably not mix the print and other stuff just because it makes things harder to test. |
2022-12-03 02:09:47 +0100 | <dsal> | I don't have main on these, though. My actual execution is `unit_part2 = assertEqual "" 10349 =<< part2` |
2022-12-03 02:09:54 +0100 | <mauke> | the . version has the advantage that you can extract subexpressions (and make e.g. `map parse . lines` its own function) |
2022-12-03 02:10:08 +0100 | <mauke> | `map parse $ lines` is just an error |
2022-12-03 02:10:16 +0100 | Topsi | (~Topsi@dyndsl-031-150-076-205.ewe-ip-backbone.de) (Read error: Connection reset by peer) |
2022-12-03 02:10:27 +0100 | <gqplox> | oh right nice that's a good point |
2022-12-03 02:11:24 +0100 | <gqplox> | also it might be trivial but generally which way to order functions? |
2022-12-03 02:11:37 +0100 | <dsal> | total ordering of functions is the best |
2022-12-03 02:11:40 +0100 | <gqplox> | like in here for example, http://sprunge.us/npXAnG. is it good to keep main at the top |
2022-12-03 02:11:52 +0100 | <gqplox> | oh i meant positions oops |
2022-12-03 02:11:55 +0100 | <dsal> | I've always done main at the bottom, but it doesn't matter unless you use TH |
2022-12-03 02:12:05 +0100 | <gqplox> | TH? |
2022-12-03 02:12:28 +0100 | <dsal> | TemplateHaskell |
2022-12-03 02:12:45 +0100 | <dsal> | It breaks the file into chunks with boundaries defined by TH expressions and you can't refer to stuff in The Future |
2022-12-03 02:13:10 +0100 | <geekosaur> | because it runs code at compile time, so it hasn't seen the rest of the file yet |
2022-12-03 02:14:38 +0100 | <dsal> | > let options = zip "abc" [1..] <> zip "xyz" [1..] in lookup 'y' options |
2022-12-03 02:14:40 +0100 | <lambdabot> | Just 2 |
2022-12-03 02:17:16 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.) |
2022-12-03 02:17:31 +0100 | gqplox | (~textual@2a02:c7c:941d:fd00:84dc:e5:8d89:ecd6) (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
2022-12-03 02:18:05 +0100 | <dsal> | > let options = zip "abc" [1..] <> zip "xyz" [1..]; lu x = maybe (Left $ "wtf is " <> show x) Right (lookup x options) in lu 'y' |
2022-12-03 02:18:07 +0100 | <lambdabot> | Right 2 |
2022-12-03 02:18:21 +0100 | <dsal> | > let options = zip "abc" [1..] <> zip "xyz" [1..]; lu x = maybe (Left $ "wtf is " <> show x) Right (lookup x options) in lu 'w' |
2022-12-03 02:18:22 +0100 | <lambdabot> | Left "wtf is 'w'" |
2022-12-03 02:20:28 +0100 | <dsal> | > let options = zip "abc" [minBound..] <> zip "xyz" [minBound..]; lu x = maybe (Left $ "wtf is " <> show x) Right (lookup x options) in lu 'y' :: Either String Shape |
2022-12-03 02:20:29 +0100 | <lambdabot> | Right Paper |
2022-12-03 02:20:30 +0100 | gqplox | (~textual@2a02:c7c:941d:fd00:84dc:e5:8d89:ecd6) |
2022-12-03 02:20:54 +0100 | fieldbuck_ | (~fieldbuck@mobile-access-c1d2a3-227.dhcp.inet.fi) |
2022-12-03 02:21:02 +0100 | <fieldbuck_> | i am so angry because you don't live in midwest |
2022-12-03 02:21:25 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 260 seconds) |
2022-12-03 02:21:37 +0100 | <tomokojun> | what is lambdabot doing? |
2022-12-03 02:22:06 +0100 | <fieldbuck_> | he is being a donald trump supporter |
2022-12-03 02:22:22 +0100 | <dsal> | tomokojun: gqplox Has a partial pattern matching function for parsing characters to shapes. I'm just making a list and using lookup. |
2022-12-03 02:22:51 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds) |
2022-12-03 02:23:08 +0100 | <dsal> | > let options = zip "abc" [minBound..] <> zip "xyz" [minBound..]; lu x = lookup x options in lu 'y' :: Maybe Shape |
2022-12-03 02:23:10 +0100 | <lambdabot> | Just Paper |
2022-12-03 02:23:15 +0100 | <dsal> | Bit easier without the Either. |
2022-12-03 02:23:54 +0100 | <fieldbuck_> | that pattern matching would be much easier to write in c or c++' |
2022-12-03 02:24:10 +0100 | <dsal> | > let options = foldMap (\xs -> zip xs [minBound..]) ["abc", "xyz"]; lu x = lookup x options in lu 'y' :: Maybe Shape -- this is a little nicer |
2022-12-03 02:24:12 +0100 | <lambdabot> | Just Paper |
2022-12-03 02:24:45 +0100 | ChanServ | +o geekosaur |
2022-12-03 02:24:46 +0100 | <dsal> | > let options = foldMap (flip zip [minBound..]) ["abc", "xyz"]; lu x = lookup x options in lu 'y' :: Maybe Shape -- this is a little nicer |
2022-12-03 02:24:47 +0100 | <lambdabot> | Just Paper |
2022-12-03 02:25:09 +0100 | <dsal> | gqplox is supposed to be asleep and not seeing this anyway. |
2022-12-03 02:25:13 +0100 | <fieldbuck_> | EVEN CSHARP HAS MAYBE KEYWORD |
2022-12-03 02:25:23 +0100 | geekosaur | +b *!*@mobile-access-c1d2a3-227.dhcp.inet.fi |
2022-12-03 02:25:23 +0100 | fieldbuck_ | geekosaur (fieldbuck_) |
2022-12-03 02:26:01 +0100 | geekosaur | -o geekosaur |
2022-12-03 02:26:53 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
2022-12-03 02:28:51 +0100 | Guest60 | (~Guest60@101.98.118.246) |
2022-12-03 02:28:59 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) |
2022-12-03 02:28:59 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
2022-12-03 02:28:59 +0100 | wroathe | (~wroathe@user/wroathe) |
2022-12-03 02:29:01 +0100 | <Guest60> | Suppose I have a decoder for format A and a decoder for format B, and both decoders return Eithers; how can I compose these decoders so that upon failure, the 2nd decoder will be tried? |
2022-12-03 02:29:13 +0100 | <geekosaur> | <|> |
2022-12-03 02:30:48 +0100 | <Guest60> | Oh wow, that's extremely simple. |
2022-12-03 02:31:01 +0100 | <geekosaur> | more generally, asum takes a list of such and returns the first successful result |
2022-12-03 02:32:46 +0100 | gqplox | (~textual@2a02:c7c:941d:fd00:84dc:e5:8d89:ecd6) (Quit: Textual IRC Client: www.textualapp.com) |
2022-12-03 02:33:19 +0100 | <Guest60> | very handy, How is <|> expressed for Either? |
2022-12-03 02:33:52 +0100 | <geekosaur> | > Left "oops" <|> Right 5 |
2022-12-03 02:33:54 +0100 | <lambdabot> | Right 5 |
2022-12-03 02:34:05 +0100 | <geekosaur> | otherwise I don't understand the question |
2022-12-03 02:34:43 +0100 | <geekosaur> | `<|>` works for anything with an Alternative instance, including `Either String` |
2022-12-03 02:35:28 +0100 | <Guest60> | Sorry, looking at the Applicative instance, it doesn't seem like it requires a <|> definition. And looking at the Data.Either package it doesn't explicitly implement the Alternative typeclass. So I'm wondering how that all fits together. |
2022-12-03 02:35:53 +0100 | ChanServ | +o litharge |
2022-12-03 02:35:53 +0100 | litharge | -bo *!*@mobile-access-c1d2a3-227.dhcp.inet.fi litharge |
2022-12-03 02:36:24 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
2022-12-03 02:37:46 +0100 | <dsal> | Hmm... Either lost some power in the past. I wonder if that's part of it. |
2022-12-03 02:41:08 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds) |
2022-12-03 02:41:35 +0100 | <geekosaur> | actually I don't see anything Either-related for Alternative. so I'm not sure how that worked either |
2022-12-03 02:41:41 +0100 | <geekosaur> | :t (<|>) |
2022-12-03 02:41:42 +0100 | <lambdabot> | Alternative f => f a -> f a -> f a |
2022-12-03 02:42:00 +0100 | <dsal> | Oh, I guess that's not a thing. https://stackoverflow.com/questions/44472008/why-is-there-no-alternative-instance-for-either-but-a… |
2022-12-03 02:42:11 +0100 | <dsal> | This is something I always expect to be there and then am surprised when I can't find it. |
2022-12-03 02:42:20 +0100 | tabaqui | (~root@88.231.62.215) (Quit: WeeChat 3.7.1) |
2022-12-03 02:42:55 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-03 02:43:56 +0100 | <dsal> | Oh, `Alternative` has `empty` |
2022-12-03 02:44:34 +0100 | <geekosaur> | yeh |
2022-12-03 02:44:56 +0100 | <geekosaur> | I thought it required a monoid anyway but that's at the wrong level for this |
2022-12-03 02:45:36 +0100 | <dsal> | So, there's Alt. |
2022-12-03 02:45:40 +0100 | <dsal> | :t <!> |
2022-12-03 02:45:41 +0100 | <lambdabot> | error: parse error on input ‘<!>’ |
2022-12-03 02:45:44 +0100 | <dsal> | :t (<!>) |
2022-12-03 02:45:45 +0100 | <lambdabot> | error: |
2022-12-03 02:45:45 +0100 | <lambdabot> | • Variable not in scope: <!> |
2022-12-03 02:45:45 +0100 | <lambdabot> | • Perhaps you meant one of these: |
2022-12-03 02:45:49 +0100 | <dsal> | lerrn |
2022-12-03 02:46:07 +0100 | <dsal> | Oh, that's semigroupoids? Why did I think I had that in base. |
2022-12-03 02:46:22 +0100 | <geekosaur> | people have a lot of wishful thinking about that 🙂 |
2022-12-03 02:46:42 +0100 | <dsal> | Well, if you bring in semigroupoids, you get Alt which is defined for Either and will then do the above out of the box. |
2022-12-03 02:48:04 +0100 | <Guest60> | Interesting, just had a read of the post. I think I kind of understand it, an empty either doesn't make sense but I also don't fully understand why alternative is defined in terms of empty. |
2022-12-03 02:48:40 +0100 | <dsal> | Sometimes there's no alternative. |
2022-12-03 02:49:09 +0100 | <geekosaur> | also, it's in part intended for parsers (hence `some` and `many`) and you need a null parser sometimes |
2022-12-03 02:49:49 +0100 | <dsal> | That's why it makes sense for Alt to be in semigroupoids because Alternative is kind of like Monoid where Alt is like Semigroup. |
2022-12-03 02:50:46 +0100 | <Guest60> | okay that makes sense. How would you implement the alt logic using base? |
2022-12-03 02:52:16 +0100 | <dsal> | https://hackage.haskell.org/package/semigroupoids-5.3.7/docs/src/Data.Functor.Alt.html#line-188 |
2022-12-03 02:52:37 +0100 | <dsal> | You could just write that function and call it <!> and you'd be done. |
2022-12-03 02:54:43 +0100 | <Guest60> | seems obvious when you look at it haha, thanks |
2022-12-03 02:59:25 +0100 | <EvanR> | :t empty |
2022-12-03 02:59:26 +0100 | <lambdabot> | Alternative f => f a |
2022-12-03 03:00:43 +0100 | <dsal> | > empty :: Either String Int |
2022-12-03 03:00:45 +0100 | <lambdabot> | Left "" |
2022-12-03 03:00:55 +0100 | <dsal> | You could write an Alternative for `Either String` |
2022-12-03 03:01:26 +0100 | <dsal> | > empty :: Either Shape Int |
2022-12-03 03:01:27 +0100 | <lambdabot> | error: |
2022-12-03 03:01:27 +0100 | <lambdabot> | • No instance for (Control.Monad.Trans.Error.Error Shape) |
2022-12-03 03:01:27 +0100 | <lambdabot> | arising from a use of ‘empty’ |
2022-12-03 03:01:41 +0100 | <dsal> | oooh. There's a clue. |
2022-12-03 03:01:45 +0100 | <dsal> | > empty :: Either Int Int |
2022-12-03 03:01:46 +0100 | <lambdabot> | error: |
2022-12-03 03:01:46 +0100 | <lambdabot> | • No instance for (Control.Monad.Trans.Error.Error Int) |
2022-12-03 03:01:46 +0100 | <lambdabot> | arising from a use of ‘empty’ |
2022-12-03 03:01:59 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-12-03 03:02:45 +0100 | <dsal> | Yeah, that orphans the Alternative instance. It's deprecated and another thing I want sometimes. |
2022-12-03 03:02:46 +0100 | <EvanR> | Alternative might be more widely applicable if it didn't have empty |
2022-12-03 03:03:15 +0100 | <dsal> | Yeah, that's basically wherefore Alt. |
2022-12-03 03:03:23 +0100 | <dsal> | It seems to have taken people a while to figure out that smaller is better. |
2022-12-03 03:04:06 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2022-12-03 03:05:49 +0100 | <dsal> | I don't even know how to think about `some` and `many` most of the time |
2022-12-03 03:05:53 +0100 | <dsal> | > some :: Maybe Int |
2022-12-03 03:05:54 +0100 | <lambdabot> | error: |
2022-12-03 03:05:54 +0100 | <lambdabot> | • Couldn't match expected type ‘Maybe Int’ |
2022-12-03 03:05:54 +0100 | <lambdabot> | with actual type ‘f0 a0 -> f0 [a0]’ |
2022-12-03 03:06:35 +0100 | <dsal> | > some (Just 1) :: Maybe [Int] |
2022-12-03 03:06:37 +0100 | <lambdabot> | *Exception: <<loop>> |
2022-12-03 03:07:24 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
2022-12-03 03:08:20 +0100 | tinwood | (~tinwood@canonical/tinwood) (Remote host closed the connection) |
2022-12-03 03:10:46 +0100 | <pavonia> | What do you do with the Advent of Code leaderboard code in the topic? |
2022-12-03 03:10:51 +0100 | razetime | (~quassel@49.207.211.219) |
2022-12-03 03:11:20 +0100 | tinwood | (~tinwood@general.default.akavanagh.uk0.bigv.io) |
2022-12-03 03:11:20 +0100 | tinwood | (~tinwood@general.default.akavanagh.uk0.bigv.io) (Changing host) |
2022-12-03 03:11:20 +0100 | tinwood | (~tinwood@canonical/tinwood) |
2022-12-03 03:11:31 +0100 | <dsal> | paste it into https://adventofcode.com/2022/leaderboard/private |
2022-12-03 03:11:41 +0100 | <EvanR> | if you click Leaderboard then Private Leaderboard, you get a box to paste it into |
2022-12-03 03:12:58 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
2022-12-03 03:13:29 +0100 | <pavonia> | I'm redirected to https://adventofcode.com/2022/leaderboard when clicking on that link |
2022-12-03 03:13:54 +0100 | <pavonia> | And I don't see any prvate link or similar on that page |
2022-12-03 03:14:08 +0100 | <dsal> | Are you logged in? |
2022-12-03 03:14:34 +0100 | <pavonia> | No |
2022-12-03 03:15:03 +0100 | <pavonia> | Can't you access them without being registered? |
2022-12-03 03:15:20 +0100 | <geekosaur> | presumably that's what "private" means |
2022-12-03 03:15:47 +0100 | <EvanR> | if you're not logged in, how does it know who to add to the leaderboard |
2022-12-03 03:16:08 +0100 | <EvanR> | dsal, Alternative makes complete sense now that I read this SO answer on the subject https://stackoverflow.com/questions/13080606/confused-by-the-meaning-of-the-alternative-type-class… |
2022-12-03 03:17:09 +0100 | <pavonia> | geekosaur: I see |
2022-12-03 03:23:36 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
2022-12-03 03:25:44 +0100 | <dsal> | EvanR: that's a lot of good reading. Making some sense. I still don't know how to make sense of some and many yet, though. |
2022-12-03 03:25:53 +0100 | <EvanR> | I was joking |
2022-12-03 03:26:26 +0100 | <EvanR> | it's 10 pages of algebra with 3 instances of assertions that "it's useful" |
2022-12-03 03:26:34 +0100 | <EvanR> | without much to back it up |
2022-12-03 03:31:45 +0100 | ddellacosta | (~ddellacos@89.45.224.153) |
2022-12-03 03:31:55 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 268 seconds) |
2022-12-03 03:34:30 +0100 | <EvanR> | many (randomRIO (0,1) >>= \x -> case x of 0 -> putChar 'a'; 1 -> empty) |
2022-12-03 03:34:48 +0100 | <EvanR> | aaaaaaaaaa[(),(),(),(),(),(),(),(),(),()] -- winner winner chicken dinner |
2022-12-03 03:36:14 +0100 | <EvanR> | many (Just 'a'), using the same logic, never ends and never yields anything sooner than that |
2022-12-03 03:36:49 +0100 | <geekosaur> | right |
2022-12-03 03:37:08 +0100 | <geekosaur> | I mentioned earlier that they make the most sense in the context of parsers |
2022-12-03 03:38:08 +0100 | <EvanR> | s/never ends/never fails, so never ends/ |
2022-12-03 03:38:13 +0100 | <geekosaur> | `many` keeps doing <|> until the parser fails, `some` requires it to succeed at least once before failing |
2022-12-03 03:38:27 +0100 | <geekosaur> | er, kinda the opposite of <|> I guess |
2022-12-03 03:38:41 +0100 | <geekosaur> | and collects the successes |
2022-12-03 03:41:37 +0100 | <EvanR> | but... IO is clearly collecting the successes and would return an infinite list if you let it. Why doesn't Just 'a'... |
2022-12-03 03:42:41 +0100 | <EvanR> | is there something wrong with this theory of collecting the successes |
2022-12-03 03:42:46 +0100 | <geekosaur> | its instance doesn't know when it would fail (throw an exception, iirc) |
2022-12-03 03:42:57 +0100 | <geekosaur> | Just 'a' will never fail |
2022-12-03 03:43:38 +0100 | razetime | (~quassel@49.207.211.219) (Ping timeout: 268 seconds) |
2022-12-03 03:43:55 +0100 | <geekosaur> | I don't know what the implementation is that causes it to <<loop>> though |
2022-12-03 03:44:04 +0100 | <EvanR> | oh, my IO is not returning an infinite list after all, if it doesn't ever fail |
2022-12-03 03:44:47 +0100 | <dsal> | geekosaur: ohh. The fails part is the part that I wasn't thinking of. So basically it must be required for Maybe but it can't do anything useful. |
2022-12-03 03:44:48 +0100 | <EvanR> | IO and Maybe aren't very lazy |
2022-12-03 03:45:03 +0100 | <EvanR> | here |
2022-12-03 03:45:35 +0100 | <EvanR> | the full list is only available upon failure |
2022-12-03 03:45:49 +0100 | <EvanR> | the beginning of the list even |
2022-12-03 03:46:22 +0100 | <dsal> | It just seems weird to me that it must not be useful. |
2022-12-03 03:46:44 +0100 | <geekosaur[m]> | > empty:: IO () |
2022-12-03 03:46:45 +0100 | <lambdabot> | <IO ()> |
2022-12-03 03:46:59 +0100 | <geekosaur[m]> | Oh right |
2022-12-03 03:47:27 +0100 | <EvanR> | user error (mzero) |
2022-12-03 03:58:18 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
2022-12-03 04:00:05 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-03 04:00:33 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-03 04:01:21 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 04:02:15 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-03 04:07:09 +0100 | haritz | (~hrtz@user/haritz) (Remote host closed the connection) |
2022-12-03 04:07:19 +0100 | <Guest60> | Is there any way I can remove the lambda from this expression? `\a -> return $ f t a` |
2022-12-03 04:08:01 +0100 | <davean> | pure . f t |
2022-12-03 04:09:56 +0100 | <EvanR> | note in your question, f t is some function g, so you could rewrite \a -> return (f t a) as \x -> h (g x), which is just h . g |
2022-12-03 04:10:25 +0100 | <Guest60> | The answer is always clear but then getting to it can be tough for me. Is it just experience in refactoring expressions and understanding the types that gets you to the answer? |
2022-12-03 04:10:47 +0100 | haritz | (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) |
2022-12-03 04:10:47 +0100 | haritz | (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host) |
2022-12-03 04:10:47 +0100 | haritz | (~hrtz@user/haritz) |
2022-12-03 04:10:48 +0100 | <Guest60> | Thanks EvanR, that factorisation clears it up a bit |
2022-12-03 04:10:53 +0100 | <davean> | Its knowing what is going on |
2022-12-03 04:11:22 +0100 | <davean> | There are only one argument functions. |
2022-12-03 04:13:04 +0100 | kadobanana | (~mud@user/kadoban) (Ping timeout: 260 seconds) |
2022-12-03 04:13:20 +0100 | <Guest60> | Another questions, what's the difference between <$> and <&>? They appear to have their arguments swapped, is it just for convenience or are they different? |
2022-12-03 04:14:20 +0100 | <davean> | Read the docs |
2022-12-03 04:14:31 +0100 | <davean> | What does it say? |
2022-12-03 04:15:09 +0100 | <Guest60> | oh right my bad |
2022-12-03 04:16:16 +0100 | <Guest60> | going back to the previous question. You used pure over return. Is it generally preferred to work in terms of the looser typeclass when possible? I.e. Applicative over Monad? |
2022-12-03 04:16:39 +0100 | <EvanR> | logically yes, culturally maybe not |
2022-12-03 04:16:48 +0100 | <davean> | yes, return is just a restricted version of pure, its legacy. Theres no reason for it to exist anymore. |
2022-12-03 04:17:18 +0100 | <EvanR> | it's like meters vs feet, there's no reason for feet to exist |
2022-12-03 04:17:52 +0100 | <davean> | and like pure and return, feet are defined in terms of meters |
2022-12-03 04:18:01 +0100 | <Guest60> | So logically, yes, you might as well express something more generally, but culturally no, if it helps express code intention then be specific? |
2022-12-03 04:18:21 +0100 | <EvanR> | return is still used in a lot of tutorials and makes it clear we're talking monads right now |
2022-12-03 04:18:28 +0100 | <davean> | It would shock me to find someone who thoguht return made anything clearer |
2022-12-03 04:18:45 +0100 | <davean> | EvanR: I think that is only because they haven't been updated.\ |
2022-12-03 04:20:00 +0100 | <Guest60> | Or as an example, while yards is expressed in meters, you would express the length of an American football field in yards because of the context domain? |
2022-12-03 04:20:09 +0100 | <EvanR> | sometimes I think changing random code that uses return into pure is too aggressive |
2022-12-03 04:20:28 +0100 | <EvanR> | like if you barged into someone elses project and changed all their indentation |
2022-12-03 04:20:45 +0100 | money | (~money@pool-100-11-18-203.phlapa.fios.verizon.net) |
2022-12-03 04:20:51 +0100 | money | Guest9300 |
2022-12-03 04:21:06 +0100 | <EvanR> | truth is people have to know pure and return both |
2022-12-03 04:21:38 +0100 | <davean> | have to know, because we haven't reduced the legacy, but using return makes your code clearly worse |
2022-12-03 04:21:53 +0100 | <EvanR> | does it |
2022-12-03 04:22:03 +0100 | <EvanR> | is there some kind of performance thing |
2022-12-03 04:22:05 +0100 | <davean> | yes |
2022-12-03 04:22:20 +0100 | <davean> | That monad constraint isn't free. It must be coherent with Applicative but it adds requirements. |
2022-12-03 04:22:25 +0100 | Guest9300 | (~money@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host) |
2022-12-03 04:22:25 +0100 | Guest9300 | (~money@user/polo) |
2022-12-03 04:22:36 +0100 | <davean> | requirements that can't be useful to pure |
2022-12-03 04:22:40 +0100 | <EvanR> | well if you're doing applicative only code yeah you would use pure |
2022-12-03 04:22:42 +0100 | Guest9300 | money |
2022-12-03 04:22:54 +0100 | <davean> | when you use return you force code up to monad |
2022-12-03 04:23:16 +0100 | <davean> | A lot of monadic code can be applicative if you stop using reutrn |
2022-12-03 04:23:20 +0100 | <EvanR> | I figured the question was about monadic code, should you go find and replace all the returns in do notation with pure "just because" |
2022-12-03 04:23:29 +0100 | <davean> | And, improtantly, regions of it can be applicative |
2022-12-03 04:23:31 +0100 | <EvanR> | (ignoring ApplicativeDo for a second) |
2022-12-03 04:23:40 +0100 | <davean> | EvanR: Theres no such thing. |
2022-12-03 04:23:49 +0100 | <davean> | EvanR: you're carrying the extra constraint *on that line of code* |
2022-12-03 04:23:49 +0100 | <EvanR> | there's no such what |
2022-12-03 04:24:03 +0100 | <davean> | the use of pure couldn't have required Monad |
2022-12-03 04:24:13 +0100 | <davean> | Other code might, but THAT piece couldn't |
2022-12-03 04:24:16 +0100 | <davean> | and that MATTERS |
2022-12-03 04:24:25 +0100 | <EvanR> | if changing 1 return to pure drops a monad constraint everywhere, it's applicative code |
2022-12-03 04:24:45 +0100 | <davean> | It ALWAYS drops the Monad constraint *on that usage* |
2022-12-03 04:25:00 +0100 | <EvanR> | changing 1 return to pure in the middle of a arcane request handler in a transformer stack can't drop a monad constraint, I'm guessing |
2022-12-03 04:25:09 +0100 | <davean> | Incorrect |
2022-12-03 04:25:13 +0100 | <davean> | Completely incorrect |
2022-12-03 04:25:29 +0100 | <EvanR> | ghc deals in "lines of code" now? xD |
2022-12-03 04:25:35 +0100 | <davean> | GHC deals with functions |
2022-12-03 04:25:41 +0100 | <davean> | and that function call changes |
2022-12-03 04:26:15 +0100 | <davean> | It doesn't have this concept of a larger context you're putting on it |
2022-12-03 04:26:19 +0100 | <EvanR> | are you saying using a Monad instance has different performance from using Applicative instance |
2022-12-03 04:26:27 +0100 | <davean> | Absolutely |
2022-12-03 04:26:28 +0100 | <EvanR> | like, when using return / pure |
2022-12-03 04:27:11 +0100 | <davean> | Applicative isn't ordered. |
2022-12-03 04:27:24 +0100 | <EvanR> | the results of pure aren't ordered either |
2022-12-03 04:27:32 +0100 | <EvanR> | or return |
2022-12-03 04:27:49 +0100 | <davean> | How it is allowed to be combined with other code is. |
2022-12-03 04:28:26 +0100 | <davean> | EvanR: So there are things like https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/applicative_do.html |
2022-12-03 04:29:08 +0100 | <davean> | That might be illustrative |
2022-12-03 04:29:14 +0100 | <EvanR> | so if you have a bunch of monadic code, you think changing one of the returns to pure is going to matter |
2022-12-03 04:29:28 +0100 | <davean> | it can |
2022-12-03 04:29:29 +0100 | <EvanR> | actual monad code, not ApplicativeDo |
2022-12-03 04:30:06 +0100 | kadobanana | (~mud@user/kadoban) |
2022-12-03 04:30:25 +0100 | <davean> | It depends on the code, but there is no sensible reason to use return and it can hurt regularly. |
2022-12-03 04:30:46 +0100 | <davean> | How it relates to exactly one other thing matters |
2022-12-03 04:30:46 +0100 | gentauro | (~gentauro@user/gentauro) (Read error: Connection reset by peer) |
2022-12-03 04:30:59 +0100 | accord | (uid568320@id-568320.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-03 04:30:59 +0100 | <davean> | The overall picture isn't particularly relivent |
2022-12-03 04:31:13 +0100 | <davean> | EACH INTERACTION is where things operate at |
2022-12-03 04:31:26 +0100 | <davean> | Sure, the entire function might be monadic, but half of it might not be |
2022-12-03 04:31:32 +0100 | <EvanR> | it kind of sounds like old javascript where changing the spelling of variables might matter to performance, and so your boss demands you change the spelling xD |
2022-12-03 04:32:06 +0100 | <davean> | EvanR: They're different constraints, but you can know the constraint doesn't matter |
2022-12-03 04:32:12 +0100 | <davean> | return was a complete mistake |
2022-12-03 04:32:15 +0100 | <EvanR> | i.e. since return should = pure, why isn't the compiler exploiting that |
2022-12-03 04:32:37 +0100 | <davean> | EvanR: should doesn't mean it does |
2022-12-03 04:32:48 +0100 | <davean> | Thats why MonadOfNoreturn |
2022-12-03 04:33:02 +0100 | rcharles | (~user@pool-71-166-43-226.bltmmd.fios.verizon.net) |
2022-12-03 04:33:21 +0100 | <davean> | https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return |
2022-12-03 04:33:23 +0100 | <EvanR> | it makes sense as a cultural movement |
2022-12-03 04:33:41 +0100 | <EvanR> | one day we might see return go bye bye |
2022-12-03 04:34:06 +0100 | <davean> | No, it makes sense from a correctness and optimization standpoint |
2022-12-03 04:34:08 +0100 | nattiestnate | (~nate@202.138.250.46) |
2022-12-03 04:35:55 +0100 | <EvanR> | now return is incorrect too? xD |
2022-12-03 04:36:11 +0100 | nattiestnate | (~nate@202.138.250.46) (Client Quit) |
2022-12-03 04:36:13 +0100 | finn_elija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 04:36:13 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
2022-12-03 04:36:13 +0100 | finn_elija | FinnElija |
2022-12-03 04:36:17 +0100 | gentauro | (~gentauro@user/gentauro) |
2022-12-03 04:36:19 +0100 | <davean> | Yes, its exist can only be to allow incorrect code |
2022-12-03 04:37:00 +0100 | <davean> | Thats the problem with it and why we lose a lot when it is used |
2022-12-03 04:37:02 +0100 | <EvanR> | can we rename the Monad class in the process of dropping return, it would be too hard to explain what it has to do with monads in category theory |
2022-12-03 04:37:23 +0100 | <davean> | Oh? |
2022-12-03 04:37:28 +0100 | <EvanR> | which exist in isolation from Applicative |
2022-12-03 04:38:35 +0100 | <EvanR> | yeah, monad is a functor with these two natural transformations. join and return, and we never had join in the class and return used to exist, don't worry about why it's not there anymore, Monads! |
2022-12-03 04:38:36 +0100 | <davean> | but Monad hasn't changed. |
2022-12-03 04:39:06 +0100 | <davean> | Monad includes Applicative |
2022-12-03 04:39:30 +0100 | <EvanR> | you never hear about applicative functor when reading intro material about monads (CT) |
2022-12-03 04:39:54 +0100 | <davean> | Sure, because that break out isn't a CT relivent thing. But the Haskell Monad class still ahs everything it ever had. |
2022-12-03 04:40:12 +0100 | <EvanR> | oh ok |
2022-12-03 04:40:32 +0100 | <davean> | Well in CT I think they're lax monoidal functors? |
2022-12-03 04:40:35 +0100 | <davean> | IIRC |
2022-12-03 04:40:49 +0100 | <EvanR> | correction, the Monad class would be missing return |
2022-12-03 04:40:52 +0100 | <davean> | I'd have to double check. |
2022-12-03 04:40:56 +0100 | <davean> | No, it wouldn't! |
2022-12-03 04:41:01 +0100 | <davean> | it wouldn't be missign return |
2022-12-03 04:41:17 +0100 | <EvanR> | which proposal are we talking about now |
2022-12-03 04:41:23 +0100 | <davean> | MonadOfNoReturn |
2022-12-03 04:41:37 +0100 | <EvanR> | it says right there under proposal return would be removed |
2022-12-03 04:42:08 +0100 | <davean> | Monad REQUIRES Applicative, and Applicative has pure so we get to have a function 'return :: Monad m => a -> m a', 'return = pure' and now its actually correct. |
2022-12-03 04:42:21 +0100 | <davean> | FROM THE TYPE CLASS, Monad would still have return. |
2022-12-03 04:42:45 +0100 | king_gs | (~Thunderbi@2806:103e:29:94a4:81e0:429b:22ec:cf13) |
2022-12-03 04:42:48 +0100 | <davean> | and now return would actually be correct. |
2022-12-03 04:42:50 +0100 | <maerwald[m]> | Monad requires applicative? |
2022-12-03 04:42:58 +0100 | <EvanR> | now a days yeah |
2022-12-03 04:43:01 +0100 | <maerwald[m]> | Isn't that against the spec, |
2022-12-03 04:43:19 +0100 | <davean> | class Applicative m => Monad m where |
2022-12-03 04:43:55 +0100 | <EvanR> | why not define return, in that proposal, to have type Applicative m => a -> m a |
2022-12-03 04:44:04 +0100 | <maerwald[m]> | https://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1270006.3 |
2022-12-03 04:44:10 +0100 | <maerwald[m]> | Yes, it's against the spec |
2022-12-03 04:44:20 +0100 | rcharles | (~user@pool-71-166-43-226.bltmmd.fios.verizon.net) (Ping timeout: 260 seconds) |
2022-12-03 04:44:33 +0100 | <EvanR> | wait, nevermind that |
2022-12-03 04:44:44 +0100 | <davean> | EvanR: Oh you can have it as that yes :) |
2022-12-03 04:44:51 +0100 | <maerwald[m]> | And so is monad of no return |
2022-12-03 04:45:11 +0100 | <maerwald[m]> | Not that anyone cares about the spec anymore |
2022-12-03 04:45:12 +0100 | <davean> | maerwald[m]: Thats why we update thing. Or depricate them |
2022-12-03 04:45:13 +0100 | <EvanR> | we have a history of proposals which break things |
2022-12-03 04:45:26 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-03 04:45:34 +0100 | <EvanR> | creative destruction |
2022-12-03 04:45:42 +0100 | <maerwald[m]> | Often useless |
2022-12-03 04:46:01 +0100 | <davean> | Its a rather bad spec really sadly. I'd had hopes for Haskell2020 |
2022-12-03 04:47:36 +0100 | king_gs | (~Thunderbi@2806:103e:29:94a4:81e0:429b:22ec:cf13) (Ping timeout: 256 seconds) |
2022-12-03 04:47:45 +0100 | <EvanR> | anything other than the extremes of 1. never change anything ever 2. create the language completely from scratch including branding any time you need a change |
2022-12-03 04:47:55 +0100 | <EvanR> | sounds like project management witchcraft to me |
2022-12-03 04:48:08 +0100 | <EvanR> | some wise person is guiding the ship |
2022-12-03 04:49:35 +0100 | td_ | (~td@83.135.9.0) (Ping timeout: 252 seconds) |
2022-12-03 04:51:34 +0100 | td_ | (~td@83.135.9.32) |
2022-12-03 04:51:36 +0100 | azimut_ | (~azimut@gateway/tor-sasl/azimut) |
2022-12-03 04:51:54 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-03 04:57:44 +0100 | causal | (~user@50.35.83.177) |
2022-12-03 04:59:25 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-12-03 04:59:30 +0100 | xff0x | (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 256 seconds) |
2022-12-03 05:12:10 +0100 | xff0x | (~xff0x@ai071162.d.east.v6connect.net) |
2022-12-03 05:13:02 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) |
2022-12-03 05:21:50 +0100 | <iqubic> | What's the minimum version of GHC needed to use Haskell2020? |
2022-12-03 05:24:53 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-03 05:30:12 +0100 | TonyStone | (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) |
2022-12-03 05:30:40 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
2022-12-03 05:39:15 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving) |
2022-12-03 05:41:11 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds) |
2022-12-03 05:43:53 +0100 | <maerwald[m]> | iqubic: there is no Haskell2020 |
2022-12-03 05:43:59 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 05:44:28 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) |
2022-12-03 05:45:09 +0100 | <Guest60> | How would I approach a function like this? `Semigroup b => [Either a b] -> Either [a] b` |
2022-12-03 05:45:51 +0100 | <maerwald[m]> | Guest60: homework? |
2022-12-03 05:45:52 +0100 | <Guest60> | Where I either have all of the lefts or if there are no lefts, all of the rights combined? |
2022-12-03 05:46:02 +0100 | <Guest60> | Not homework |
2022-12-03 05:47:16 +0100 | <EvanR> | so basically, Semigroup b => [Either a b] -> Either (NonEmpty a) b |
2022-12-03 05:47:34 +0100 | <EvanR> | more accurate type might help |
2022-12-03 05:47:57 +0100 | <EvanR> | then you could go back to a list if you don't really care, but the same algorithm will work |
2022-12-03 05:47:58 +0100 | <maerwald[m]> | Semantics are not clear to me |
2022-12-03 05:48:23 +0100 | <maerwald[m]> | [Right a, Left b, Left b]. ..what shall be the output? |
2022-12-03 05:48:27 +0100 | <Guest60> | yes, the NonEmpty is more accurate |
2022-12-03 05:48:48 +0100 | <EvanR> | if there's at least one Left, map fromLeft |
2022-12-03 05:48:49 +0100 | <Guest60> | [Left b, Left b] |
2022-12-03 05:48:49 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
2022-12-03 05:49:01 +0100 | <EvanR> | otherwise sconcat . map fromRight |
2022-12-03 05:49:07 +0100 | <iqubic> | maerwald[m]: Oh? Isn't there like, a cabal language option that is GHC2020? Can't I just set that? |
2022-12-03 05:49:26 +0100 | <maerwald[m]> | iqubic: yes, GHC2020, not Haskell2020 |
2022-12-03 05:49:32 +0100 | <EvanR> | except what I said will crash |
2022-12-03 05:49:56 +0100 | <EvanR> | Guest60, you could "brute force" this by using partitionEithers from Data.Either |
2022-12-03 05:49:57 +0100 | <iqubic> | What's the minimum GHC version required for GHC2020? |
2022-12-03 05:50:22 +0100 | <EvanR> | case analysis on the two partitions |
2022-12-03 05:50:43 +0100 | <Guest60> | partitionEithers was my first attempt but it felt really verbose considering the type signature. Seems like there might be a general pattern in it |
2022-12-03 05:51:00 +0100 | <EvanR> | it doesn't seem particularly patterny |
2022-12-03 05:51:30 +0100 | <EvanR> | or efficient, you have to check the whole list for lefts before doing anything |
2022-12-03 05:52:06 +0100 | <iqubic> | Is partitionEithers just the Either version of catMaybes :: [Maybe a] -> [a]? |
2022-12-03 05:52:14 +0100 | <EvanR> | :t partitionEithers |
2022-12-03 05:52:15 +0100 | <lambdabot> | [Either a b] -> ([a], [b]) |
2022-12-03 05:52:24 +0100 | <EvanR> | kinda of |
2022-12-03 05:53:19 +0100 | <Guest60> | I suppose partitionEithers is fine considering I'd need to process all of them anyway for the logic to work |
2022-12-03 05:53:20 +0100 | <pavonia> | partitionMaybes :: [Maybe a] -> ([()], [a]) |
2022-12-03 05:54:22 +0100 | <pavonia> | And then catMaybes = snd . partitionMaybes |
2022-12-03 05:54:29 +0100 | gawen | (~gawen@user/gawen) (Quit: cya) |
2022-12-03 05:55:17 +0100 | <iqubic> | Is there a thing called mapEithers :: (a -> c) -> (b -> d) -> [Either a b] -> [Either c d] |
2022-12-03 05:55:41 +0100 | <iqubic> | Wait... that's just "\f g xs -> map (bimap f g) xs" |
2022-12-03 05:55:50 +0100 | gawen | (~gawen@user/gawen) |
2022-12-03 05:55:50 +0100 | <maerwald[m]> | Guest60: consider using These |
2022-12-03 05:56:16 +0100 | <iqubic> | These is like Either, but also gives you the option of having Both |
2022-12-03 05:59:33 +0100 | <EvanR> | that's bimap from Bifunctor |
2022-12-03 05:59:34 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-12-03 05:59:46 +0100 | <iqubic> | Yeah, I got that now |
2022-12-03 06:16:34 +0100 | ddellacosta | (~ddellacos@89.45.224.153) (Ping timeout: 268 seconds) |
2022-12-03 06:19:14 +0100 | <c_wraith> | notable sudden channel silence at midnight EST. "odd", I saw as if I don't know exactly why... |
2022-12-03 06:19:29 +0100 | <c_wraith> | *say |
2022-12-03 06:20:22 +0100 | <famubu[m]> | Hi. I needed to represent a Float value that I needed to limit to a 0.0 to 1.0 range. How can this be done in haskell. I saw about smart constructors, but there the checking is done only at run-time. |
2022-12-03 06:21:05 +0100 | <c_wraith> | Do you want a Float specifically? Or just some representation of a lot of values between 0 and 1? |
2022-12-03 06:25:30 +0100 | <famubu[m]> | The exact value is needed. Or some way to convert to that value. |
2022-12-03 06:26:34 +0100 | polo | Guest6586 |
2022-12-03 06:26:35 +0100 | Guest6586 | (money@user/polo) (Killed (cadmium.libera.chat (Nickname regained by services))) |
2022-12-03 06:26:35 +0100 | money | polo |
2022-12-03 06:27:44 +0100 | <EvanR> | smart constructors for this are probably good |
2022-12-03 06:28:04 +0100 | <EvanR> | the checking is at construction time but it will still be right |
2022-12-03 06:28:32 +0100 | <c_wraith> | the key thing with a smart constructor is that they have different types, so you still have the compile-time guarantee that *if you have such a value*, it's within the expected range. |
2022-12-03 06:29:41 +0100 | <c_wraith> | also, someone here (merijn?) has a nice package for checking smart constructors of literals at compile time. |
2022-12-03 06:30:26 +0100 | <c_wraith> | yeah, it is merijn: https://hackage.haskell.org/package/validated-literals |
2022-12-03 06:31:11 +0100 | <famubu[m]> | Thanks! Let me check that out. |
2022-12-03 06:32:31 +0100 | <famubu[m]> | And is there some way to indicate that a type has some means to be converted to a list? A type class maybe? For example, I got an int type, and I wanna say that if I try to make it a list, it will be [x mod 2, x mod 3, xmod 5] or something like that? |
2022-12-03 06:32:39 +0100 | mbuf | (~Shakthi@49.204.140.192) |
2022-12-03 06:33:02 +0100 | nihonium | (~nihonium@91.193.176.241) |
2022-12-03 06:33:07 +0100 | <c_wraith> | Nothing I'm aware of means that sort of thing |
2022-12-03 06:35:53 +0100 | <int-e> | . o O ( type Convert a b = a -> b ) |
2022-12-03 06:37:31 +0100 | <int-e> | Sometimes a type class is so generic that it's better not to have it. We do have first-class functions. |
2022-12-03 06:38:38 +0100 | Guest60 | (~Guest60@101.98.118.246) (Quit: Client closed) |
2022-12-03 06:40:26 +0100 | <c_wraith> | I probably would have thrown a functional dependency on the class |
2022-12-03 06:47:10 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
2022-12-03 06:48:06 +0100 | polo | (~money@user/polo) (Quit: Textual IRC Client: www.textualapp.com) |
2022-12-03 06:48:43 +0100 | <famubu[m]> | 👍️ |
2022-12-03 06:48:52 +0100 | money | (~money@user/polo) |
2022-12-03 06:50:49 +0100 | money | (~money@user/polo) (Client Quit) |
2022-12-03 06:51:09 +0100 | money | (~money@user/polo) |
2022-12-03 06:53:44 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
2022-12-03 06:56:01 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
2022-12-03 06:56:05 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 06:56:14 +0100 | nihonium | (~nihonium@91.193.176.241) (Ping timeout: 256 seconds) |
2022-12-03 06:59:24 +0100 | redmp | (~redmp@mobile-166-171-250-195.mycingular.net) |
2022-12-03 07:01:25 +0100 | Erutuon | (~Erutuon@user/erutuon) (Ping timeout: 260 seconds) |
2022-12-03 07:04:33 +0100 | <dsal> | famubu[m]: Foldable? |
2022-12-03 07:05:12 +0100 | <dsal> | Though that sounds a bit more like an anamorphism. |
2022-12-03 07:13:46 +0100 | aeroplane | (~user@user/aeroplane) |
2022-12-03 07:17:57 +0100 | money | (~money@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
2022-12-03 07:19:17 +0100 | Guest60 | (~Guest60@101.98.118.246) |
2022-12-03 07:25:03 +0100 | Guest6586 | (Guest6586@id-532813.tinside.irccloud.com) |
2022-12-03 07:28:28 +0100 | redmp | (~redmp@mobile-166-171-250-195.mycingular.net) (Ping timeout: 252 seconds) |
2022-12-03 07:29:40 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
2022-12-03 07:29:56 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2022-12-03 07:31:12 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-03 07:35:41 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
2022-12-03 07:38:01 +0100 | Guest6586 | (Guest6586@id-532813.tinside.irccloud.com) (Changing host) |
2022-12-03 07:38:01 +0100 | Guest6586 | (Guest6586@user/polo) |
2022-12-03 07:40:15 +0100 | redmp | (~redmp@mobile-166-171-250-195.mycingular.net) |
2022-12-03 07:42:29 +0100 | raehik | (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 260 seconds) |
2022-12-03 07:43:32 +0100 | Guest6586 | money |
2022-12-03 07:45:11 +0100 | <Guest60> | How can I pattern match an array of strings on `Aeson.Types.Value` ? |
2022-12-03 07:46:18 +0100 | <c_wraith> | You generally wouldn't. |
2022-12-03 07:46:36 +0100 | <c_wraith> | I mean, you *could*, but it would be really awkward. |
2022-12-03 07:47:01 +0100 | <Guest60> | My goal is to define an instance of FromJSON which matches on a string or an array of strings |
2022-12-03 07:47:28 +0100 | Erutuon | (~Erutuon@user/erutuon) |
2022-12-03 07:47:42 +0100 | <c_wraith> | You can match on the Array constructor and then do whatever with the Vector it contains |
2022-12-03 07:48:34 +0100 | <c_wraith> | The big issue being that it's a Vector Value, and you need to deal with all the possible types of Value |
2022-12-03 07:49:29 +0100 | redmp | (~redmp@mobile-166-171-250-195.mycingular.net) (Ping timeout: 260 seconds) |
2022-12-03 07:50:57 +0100 | redmp | (~redmp@mobile-166-171-250-195.mycingular.net) |
2022-12-03 07:51:24 +0100 | <Guest60> | What does a pattern match on a vector look like? |
2022-12-03 07:51:34 +0100 | <c_wraith> | It usually doesn't. |
2022-12-03 07:51:35 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 07:52:25 +0100 | <c_wraith> | Vector is an opaque type. You work with the functions it provides. |
2022-12-03 07:52:52 +0100 | <c_wraith> | (or possibly with the OverloadedLists extension, but that's awkward at best) |
2022-12-03 07:53:28 +0100 | <Guest60> | Does a vector contain only one type? If so, how do I see which type it has |
2022-12-03 07:54:03 +0100 | <iqubic> | Is there a good way to write a function of the type "(a,a) -> [a]"? |
2022-12-03 07:55:05 +0100 | <int-e> | . o O ( const [] ) |
2022-12-03 07:56:11 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 255 seconds) |
2022-12-03 07:56:36 +0100 | <iqubic> | Yes, that works, but it gets rid of the data. |
2022-12-03 07:56:46 +0100 | <int-e> | \(a,b) -> [a,b,b,a,b,a,a,b] |
2022-12-03 07:56:54 +0100 | <iqubic> | I want the output to be a two element list. |
2022-12-03 07:57:01 +0100 | <int-e> | \(a,b) -> [a,a] |
2022-12-03 07:57:05 +0100 | <int-e> | :-P |
2022-12-03 07:57:20 +0100 | son0p | (~ff@2604:3d08:5b7f:5540::ea0e) (Ping timeout: 246 seconds) |
2022-12-03 07:57:34 +0100 | <iqubic> | Are you being obtuse on purpose? |
2022-12-03 07:57:44 +0100 | <int-e> | > traverse (\x -> [x,x]) (1,2) |
2022-12-03 07:57:46 +0100 | <lambdabot> | [(1,2),(1,2)] |
2022-12-03 07:57:52 +0100 | <int-e> | mm |
2022-12-03 07:58:19 +0100 | <int-e> | > foldMap (\x -> [x,x]) (1,2) |
2022-12-03 07:58:21 +0100 | <lambdabot> | [2,2] |
2022-12-03 07:58:54 +0100 | <int-e> | iqubic: I'm finding holes in your specification. |
2022-12-03 07:59:11 +0100 | <iqubic> | I see... |
2022-12-03 07:59:41 +0100 | <mauke> | @pl \p -> fst p : snd p : [] |
2022-12-03 07:59:41 +0100 | <lambdabot> | liftM2 (:) fst (return . snd) |
2022-12-03 08:01:01 +0100 | <iqubic> | I'm just gonna use this: |
2022-12-03 08:01:13 +0100 | <iqubic> | > \(xs, ys) -> [xs, ys]) (1, 2) |
2022-12-03 08:01:15 +0100 | <lambdabot> | <hint>:1:22: error: parse error on input ‘)’ |
2022-12-03 08:01:25 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) |
2022-12-03 08:01:28 +0100 | <iqubic> | > (\(xs, ys) -> [xs, ys]) (1, 2) |
2022-12-03 08:01:29 +0100 | <lambdabot> | [1,2] |
2022-12-03 08:02:03 +0100 | <int-e> | I'd object to naming those variables x*s* and y*s* but I guess this is for AoC where you actually have lists. |
2022-12-03 08:02:28 +0100 | <iqubic> | It is Advent of Code. But fair point. |
2022-12-03 08:03:08 +0100 | <xerox> | another way to go about it is applying a function g xs ys = ... transformed as uncurry g which gives you ([a],[a]) -> ... |
2022-12-03 08:03:43 +0100 | <[Leary]> | > Data.Bifoldable.biList (1,2) |
2022-12-03 08:03:44 +0100 | <lambdabot> | error: |
2022-12-03 08:03:44 +0100 | <lambdabot> | Not in scope: ‘Data.Bifoldable.biList’ |
2022-12-03 08:03:44 +0100 | <lambdabot> | Perhaps you meant ‘Data.Foldable.toList’ (imported from Data.Foldable) |
2022-12-03 08:05:04 +0100 | <iqubic> | @import Data.Bifoldable |
2022-12-03 08:05:04 +0100 | <lambdabot> | Unknown command, try @list |
2022-12-03 08:05:08 +0100 | <Guest60> | what's the syntax to pattern match on a type from a list? |
2022-12-03 08:06:00 +0100 | <int-e> | pattern match on a type? |
2022-12-03 08:06:53 +0100 | <[Leary]> | Well, you get the idea---that exists. Strange that lambdabot can do :t for things it deems not in scope. |
2022-12-03 08:06:54 +0100 | <Guest60> | yeah idk, I guess you pattern match on constructors |
2022-12-03 08:07:09 +0100 | <iqubic> | You don't pattern match on types. |
2022-12-03 08:07:11 +0100 | <Guest60> | I'm just completely stumped on this Aeson array stuff |
2022-12-03 08:07:24 +0100 | <int-e> | iqubic: it's @let import |
2022-12-03 08:07:30 +0100 | <Guest60> | I just want to know if I have an array of strings or not |
2022-12-03 08:07:41 +0100 | <int-e> | [Leary]: `ghci` does that too |
2022-12-03 08:09:09 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) |
2022-12-03 08:09:39 +0100 | freeside | (~mengwong@185.223.152.95) (Ping timeout: 260 seconds) |
2022-12-03 08:10:14 +0100 | <iqubic> | Why am I getting this error? Module ‘Data.Bifoldable’ does not export ‘bilist’ |
2022-12-03 08:10:17 +0100 | <int-e> | And in fact, :t is implemented by invoking ghci. But @run actually puts the code into a module and compiles so that functionality is lost. |
2022-12-03 08:10:37 +0100 | <int-e> | :t Data.Bifoldable.biList |
2022-12-03 08:10:38 +0100 | <lambdabot> | Data.Bifoldable.Bifoldable t => t a a -> [a] |
2022-12-03 08:10:38 +0100 | money_ | (~money@user/polo) |
2022-12-03 08:10:51 +0100 | <int-e> | iqubic: a typo, I think |
2022-12-03 08:11:10 +0100 | <[Leary]> | int-e: Maybe you mean that it implicitly imports everything qualified? They're still in scope. |
2022-12-03 08:11:15 +0100 | <iqubic> | Yeah... Why does that have a capital L |
2022-12-03 08:11:31 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-03 08:12:40 +0100 | <int-e> | I have no idea. Maybe it's a pun on `toList`. |
2022-12-03 08:17:02 +0100 | jinsun__ | (~jinsun@user/jinsun) |
2022-12-03 08:17:02 +0100 | jinsun | Guest568 |
2022-12-03 08:17:02 +0100 | jinsun__ | jinsun |
2022-12-03 08:19:32 +0100 | Guest568 | (~jinsun@user/jinsun) (Ping timeout: 256 seconds) |
2022-12-03 08:20:30 +0100 | money_ | (~money@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
2022-12-03 08:22:23 +0100 | azimut_ | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-03 08:24:29 +0100 | lottaquestions_ | (~nick@2607:fa49:503e:7100:70c7:eab8:4b94:7f8a) |
2022-12-03 08:24:34 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 08:26:04 +0100 | lottaquestions | (~nick@104.221.24.83) (Ping timeout: 268 seconds) |
2022-12-03 08:26:09 +0100 | bilegeek | (~bilegeek@2600:1008:b026:a50f:e2e0:72c1:76cc:3163) |
2022-12-03 08:28:25 +0100 | redmp | (~redmp@mobile-166-171-250-195.mycingular.net) (Quit: leaving) |
2022-12-03 08:29:06 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 252 seconds) |
2022-12-03 08:30:37 +0100 | maerwald_ | (~maerwald@mail.hasufell.de) (Changing host) |
2022-12-03 08:30:37 +0100 | maerwald_ | (~maerwald@user/maerwald) |
2022-12-03 08:31:45 +0100 | maerwald_ | maerwald |
2022-12-03 08:33:27 +0100 | nihonium | (~nihonium@93.175.28.1) |
2022-12-03 08:33:55 +0100 | <EvanR> | biList, toList, ... |
2022-12-03 08:34:20 +0100 | ballast | (~ballast@rrcs-24-43-123-92.west.biz.rr.com) |
2022-12-03 08:34:37 +0100 | <EvanR> | oops you said that |
2022-12-03 08:34:51 +0100 | money_ | (~money@user/polo) |
2022-12-03 08:36:05 +0100 | Guest60 | (~Guest60@101.98.118.246) (Quit: Client closed) |
2022-12-03 08:36:41 +0100 | <ballast> | anyone know if it's possible to have optparse-applicative default a command using subparser if no subcommand is passed? Something like default :: ParserInfo a -> Mod CommandFields a |
2022-12-03 08:40:20 +0100 | freeside | (~mengwong@103.252.202.193) (Quit: Lost terminal) |
2022-12-03 08:41:52 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 08:46:44 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
2022-12-03 08:52:24 +0100 | <ballast> | hmmm seems like it's unlikely to be possible given that prefShowHelpOnEmpty is used to hardcode the behavior of showing help when there are no arguments |
2022-12-03 09:00:28 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 09:02:47 +0100 | oldsk00l | (~znc@ec2-3-73-153-196.eu-central-1.compute.amazonaws.com) |
2022-12-03 09:05:01 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
2022-12-03 09:05:42 +0100 | razetime | (~quassel@49.207.211.219) |
2022-12-03 09:08:00 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 260 seconds) |
2022-12-03 09:11:08 +0100 | money_ | (~money@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
2022-12-03 09:20:55 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 09:21:00 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
2022-12-03 09:22:05 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-03 09:22:19 +0100 | califax | (~califax@user/califx) (Remote host closed the connection) |
2022-12-03 09:22:22 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 09:25:53 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
2022-12-03 09:27:40 +0100 | califax | (~califax@user/califx) |
2022-12-03 09:29:27 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-12-03 09:30:22 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) |
2022-12-03 09:34:57 +0100 | money_ | (~money@user/polo) |
2022-12-03 09:39:01 +0100 | money_ | (~money@user/polo) (Client Quit) |
2022-12-03 09:46:18 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-03 09:51:10 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
2022-12-03 09:51:36 +0100 | gmg | (~user@user/gehmehgeh) |
2022-12-03 09:52:34 +0100 | husixu | (~husixu@182.55.67.24) |
2022-12-03 09:55:48 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 09:56:25 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
2022-12-03 09:57:06 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 252 seconds) |
2022-12-03 09:59:33 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) |
2022-12-03 10:00:03 +0100 | M0rphee[m] | (~M0rpheema@2001:470:69fc:105::2:b1ce) (Quit: You have been kicked for being idle) |
2022-12-03 10:00:03 +0100 | drsooch[m] | (~drsoochma@2001:470:69fc:105::1:c8a1) (Quit: You have been kicked for being idle) |
2022-12-03 10:01:05 +0100 | iqubic | (~avi@2601:601:1100:edd0:d29b:dc2d:eab0:9e7d) (Ping timeout: 260 seconds) |
2022-12-03 10:03:04 +0100 | bilegeek | (~bilegeek@2600:1008:b026:a50f:e2e0:72c1:76cc:3163) (Quit: Leaving) |
2022-12-03 10:05:20 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-03 10:06:39 +0100 | Vajb | (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) (Read error: Connection reset by peer) |
2022-12-03 10:06:56 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
2022-12-03 10:08:25 +0100 | son0p | (~ff@2604:3d08:5b7f:5540::a58f) |
2022-12-03 10:10:02 +0100 | nihonium | (~nihonium@93.175.28.1) (Ping timeout: 256 seconds) |
2022-12-03 10:10:41 +0100 | <freeside> | for my next trick, i get HLS working with Emacs and ghc 9.2.5 on Mac 12.6. wish me luck. |
2022-12-03 10:11:01 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
2022-12-03 10:11:04 +0100 | <tomsmeding> | freeside: doesn't hls not yet support ghc 9.2.5 |
2022-12-03 10:11:09 +0100 | <tomsmeding> | you may have better luck with 9.2.4 |
2022-12-03 10:11:25 +0100 | <freeside> | for my next trick, i get HLS working with Emacs and ghc 9.2.4 on Mac 12.6. wish me luck. |
2022-12-03 10:11:57 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-12-03 10:12:52 +0100 | husixu | (~husixu@182.55.67.24) (Ping timeout: 256 seconds) |
2022-12-03 10:13:25 +0100 | <freeside> | For maximum compatibility, I begin by setting up a fresh source dir using stack new. In accordance with the above advice about preferring ghc 9.2.4, I look for a resolver version on stackage.org that uses ghc 9.2.4. |
2022-12-03 10:14:21 +0100 | money_ | (~money@user/polo) |
2022-12-03 10:14:26 +0100 | <freeside> | i don't see an LTS that has ghc 9.2.4, so instead I choose nightly 2022-11-12. |
2022-12-03 10:14:29 +0100 | <maerwald> | freeside: M1? |
2022-12-03 10:14:34 +0100 | <freeside> | yes, M1, I'm afraid |
2022-12-03 10:14:39 +0100 | <maerwald> | 9.2.4 is broken on M1 |
2022-12-03 10:14:42 +0100 | <tomsmeding> | lol |
2022-12-03 10:15:22 +0100 | <freeside> | I see. Rewinding top-level goal. For my next trick, i get HLS working with Emacs and ghc _ on Mac 12.6 on M1. wish me luck. |
2022-12-03 10:15:48 +0100 | <maerwald> | will be more challenging with stack |
2022-12-03 10:16:14 +0100 | <freeside> | I see. Rewinding top-level goal. For my next trick, i get HLS working with Emacs and ghc _ on Mac 12.6 on M1, using ghcup instead of stack. wish me luck. |
2022-12-03 10:16:38 +0100 | <maerwald> | that should work |
2022-12-03 10:16:56 +0100 | <maerwald> | make sure xcode command line tools are installed |
2022-12-03 10:19:14 +0100 | <freeside> | we begin with a fresh start. $ rm ~/.{ghcup,local}/bin/haskell-language-server* |
2022-12-03 10:20:15 +0100 | <maerwald> | freeside: ehm |
2022-12-03 10:20:24 +0100 | <maerwald> | that's not a proper uninstallation for ghcup |
2022-12-03 10:20:31 +0100 | <ballast> | hmmm, is my usage of stack why i'm having compile errors with ghc-lib-parser on 9.0.2? or could it be because i'm still on macos 10.14 |
2022-12-03 10:20:43 +0100 | <ballast> | ghc-lib-parser > error: In file included from FFI.hsc:9: |
2022-12-03 10:20:44 +0100 | <ballast> | ghc-lib-parser > /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ffi/ffi.h:193:1: error: expected ',' |
2022-12-03 10:20:44 +0100 | <ballast> | ghc-lib-parser > FFI_AVAILABLE_APPLE FFI_EXTERN ffi_type ffi_type_void; |
2022-12-03 10:20:53 +0100 | <freeside> | i shall run ghcup tui to uninstall the hls |
2022-12-03 10:21:11 +0100 | <maerwald> | 'ghcup nuke' does too |
2022-12-03 10:21:24 +0100 | husixu | (~husixu@182.55.67.24) |
2022-12-03 10:21:28 +0100 | <maerwald> | although maybe I should have named this command different during these times |
2022-12-03 10:21:31 +0100 | <freeside> | thank you, i suspect i am about 1.5 hours way from runnin ga nuke |
2022-12-03 10:22:11 +0100 | <tomsmeding> | maerwald: is there a central list of issues like this, i.e. known bugs of previous ghc versions |
2022-12-03 10:22:36 +0100 | <maerwald> | tomsmeding: dunno, probably not |
2022-12-03 10:22:47 +0100 | <tomsmeding> | including incompatibilities like "9.2.5 is not supported by HLS yet", but also "9.2.4 doesn't work on M1" and "9.0.something has severe codegen bugs with Natural" or what was it |
2022-12-03 10:23:25 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) (Quit: Leaving.) |
2022-12-03 10:23:25 +0100 | <maerwald> | tomsmeding: https://gitlab.haskell.org/ghc/ghc/-/issues/21491 |
2022-12-03 10:23:35 +0100 | <tomsmeding> | lol |
2022-12-03 10:24:00 +0100 | <freeside> | why is it that on one computer, my ghcup tui shows "hls-powered", but on another computer, it doesn't? |
2022-12-03 10:24:02 +0100 | nihonium | (~nihonium@93.175.28.1) |
2022-12-03 10:24:17 +0100 | <tomsmeding> | because that one computer has HLS installed via ghcup and the other doesn't? |
2022-12-03 10:24:39 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2022-12-03 10:24:40 +0100 | <freeside> | my finger creeps closer to the 'nuke' button |
2022-12-03 10:24:57 +0100 | <c_wraith> | I've never used hls. is it any good? |
2022-12-03 10:24:59 +0100 | <maerwald> | freeside: hls-powered just reads file-names... if you want to know hls-ghc bindist support, the only source of truth is: https://github.com/haskell/ghcup-metadata/blob/develop/hls-metadata-0.0.1.json |
2022-12-03 10:25:14 +0100 | <tomsmeding> | maerwald: yes that's almost precisely what I was describing, just misses the 9.2.5-has-no-hls thing, but not sure this is the right place for that either (though it's _very_ useful end-user info) |
2022-12-03 10:25:22 +0100 | <maerwald> | that file is not utilized by ghcup though |
2022-12-03 10:25:30 +0100 | money_ | (~money@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
2022-12-03 10:26:34 +0100 | ballast | (~ballast@rrcs-24-43-123-92.west.biz.rr.com) (Quit: Client closed) |
2022-12-03 10:29:07 +0100 | nihonium | (~nihonium@93.175.28.1) (Ping timeout: 256 seconds) |
2022-12-03 10:32:34 +0100 | Vajb | (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
2022-12-03 10:33:04 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
2022-12-03 10:33:21 +0100 | acidjnk | (~acidjnk@p200300d6e7137a6578c6ff3ed8f071f7.dip0.t-ipconnect.de) |
2022-12-03 10:33:33 +0100 | Vajb | (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) |
2022-12-03 10:35:35 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 10:36:40 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
2022-12-03 10:38:36 +0100 | oldsk00l | (~znc@ec2-3-73-153-196.eu-central-1.compute.amazonaws.com) (Remote host closed the connection) |
2022-12-03 10:39:59 +0100 | <freeside> | ok, my emacs seems to be happy with the HLS 1.8.0.0 installed by ghcup, running against a source file inside a project directory initialized by stack with resolver nightly-2022-11-12, contrary to the advice here; I do not expect ghc 9.2.4 to DTRT on M1, but this is nonetheless a step forward. Whether that step forward is in the right direction ... |
2022-12-03 10:40:37 +0100 | <freeside> | to remove the stack aspect, I will now switch to a project which was not initialized by stack, and see if I can get HLS to do all the tricks. |
2022-12-03 10:40:39 +0100 | <maerwald> | freeside: 9.2.4 produces wrong maths on M1 |
2022-12-03 10:40:47 +0100 | <maerwald> | you're running a ticking time bomb |
2022-12-03 10:41:31 +0100 | <tomsmeding> | maerwald: https://gitlab.haskell.org/ghc/ghc/-/issues/21964 says it's not really wrong math, but rather segfaults due to invalid code generation |
2022-12-03 10:41:36 +0100 | <freeside> | ok. to defuse the bomb, i switch the resolver to lts-20.2 |
2022-12-03 10:41:40 +0100 | <tomsmeding> | but not sure that matters here :) |
2022-12-03 10:42:43 +0100 | <freeside> | after reloading the Lib.hs file from under the lts-20.2 project, I get a nice warning "ghcide compiled against GHC 9.2.4 but currently using 9.2.5". I will set this aside for now and just see what happens with a simpler, non-stack situation. |
2022-12-03 10:43:17 +0100 | <tomsmeding> | freeside: try restarting the language server |
2022-12-03 10:43:41 +0100 | <tomsmeding> | HLS is compiled with ghc version X to work with projects using ghc version X |
2022-12-03 10:43:45 +0100 | <maerwald> | tomsmeding: https://gitlab.haskell.org/ghc/ghc/-/issues/22282 |
2022-12-03 10:43:51 +0100 | <tomsmeding> | so every (supported) ghc version has its own HLS executable |
2022-12-03 10:44:09 +0100 | <freeside> | i use ghcup tui to set 9.2.5, and M-x lsp-wo-re |
2022-12-03 10:44:10 +0100 | <tomsmeding> | maerwald: that's 9.4.2, not 9.2.4 |
2022-12-03 10:44:18 +0100 | <tomsmeding> | I remember that one too :) |
2022-12-03 10:44:40 +0100 | <tomsmeding> | freeside: lsp-world-reenact? |
2022-12-03 10:45:25 +0100 | <freeside> | not ready for that yet; my lsp-haskell window shows: Tool versions found on the $PATH: cabal 3.8.1.0, stack 2.9.1, ghc 9.2.5. And, aha, the error appears: Failed to find a HLS version for GHC 9.2.5. |
2022-12-03 10:45:34 +0100 | <maerwald> | tomsmeding: https://downloads.haskell.org/~ghc/9.2.5/docs/html/users_guide/9.2.5-notes.html |
2022-12-03 10:45:37 +0100 | <maerwald> | it is listed there |
2022-12-03 10:46:01 +0100 | <tomsmeding> | ah so it was a thing on 9.2.4 too |
2022-12-03 10:46:06 +0100 | <maerwald> | "Now GHC 9.2.4 fails in precisely the same way that GHC 9.4.2 does. So it seems GHC 9.2 is still buggy, but in this case, it gets lucky." |
2022-12-03 10:46:10 +0100 | <maerwald> | 9.2.4 is broken |
2022-12-03 10:46:25 +0100 | <tomsmeding> | freeside: yeah the ghcup-distributed hls doesn't provide a build for 9.2.5; I'm compiling HLS master here to see if it builds on 9.2.5 |
2022-12-03 10:46:30 +0100 | <freeside> | So, the "failed to find a HLS version for GHC 9.2.5" is expected; HLS does not claim to support 9.2.5 yet. But, we proceed with blind faith in the directions at https://www.haskell.org/ghcup/guide/ |
2022-12-03 10:46:32 +0100 | <maerwald> | you don't want your compiler to "get lucky" |
2022-12-03 10:46:45 +0100 | <maerwald> | freeside: yes, 'ghcup compile hls' |
2022-12-03 10:46:59 +0100 | <freeside> | I am prepared to compile HLS master from source, but first I want to try ghcup compile hls. |
2022-12-03 10:47:15 +0100 | <maerwald> | https://www.haskell.org/ghcup/guide/#hls |
2022-12-03 10:47:25 +0100 | <tomsmeding> | 'ghcup compile hls --git-ref master --ghc 9.2.5' presumably? |
2022-12-03 10:47:29 +0100 | <maerwald> | yeah |
2022-12-03 10:47:43 +0100 | <tomsmeding> | I mean, 'ghcup compile hls' does exactly that :p |
2022-12-03 10:47:49 +0100 | <freeside> | how about $ ghcup compile hls --version 1.8.0.0 --ghc 9.2.5 --cabal-update |
2022-12-03 10:47:56 +0100 | <maerwald> | also can |
2022-12-03 10:47:58 +0100 | <maerwald> | try any |
2022-12-03 10:48:40 +0100 | <freeside> | Just to prove that the time-bomb version does work, I will try ghcup compile hls --version 1.8.0.0 --ghc 9.2.4 --cabal-update |
2022-12-03 10:49:00 +0100 | <maerwald> | bad maths is subtle, lol... it can cause wrong code paths |
2022-12-03 10:49:01 +0100 | nihonium | (~nihonium@93.175.28.32) |
2022-12-03 10:49:10 +0100 | <maerwald> | like... delete random directories, at worst |
2022-12-03 10:49:23 +0100 | <freeside> | there is no such thing as bad maths, only non-monotonic logic |
2022-12-03 10:49:37 +0100 | <maerwald> | well, don't care what you call it... good luck anyways |
2022-12-03 10:49:48 +0100 | <tomsmeding> | we do really need that survival guide |
2022-12-03 10:49:52 +0100 | <maerwald> | I should probably remove that version from ghcup |
2022-12-03 10:50:13 +0100 | <maerwald> | but then again, that's not the only ghc that's broken |
2022-12-03 10:50:14 +0100 | <tomsmeding> | does it have issues only on aarch64? |
2022-12-03 10:50:18 +0100 | <freeside> | so, when I run ghcup compile hls --version 1.8.0.0 --ghc 9.2.4 --cabal-update, I get BuildFailed. "After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: haskell-language-server, hls-plugin-api, hls-stylish-haskell-plugin," |
2022-12-03 10:50:29 +0100 | <tomsmeding> | yeah 1.8.0.0 doesn't have updated bounds yet for 9.2.5 |
2022-12-03 10:50:34 +0100 | <tomsmeding> | try --git-ref master |
2022-12-03 10:50:40 +0100 | <freeside> | ok, doing that now. |
2022-12-03 10:50:42 +0100 | <tomsmeding> | that at least gets an install plan here, still compiling |
2022-12-03 10:50:44 +0100 | <maerwald> | freeside: try `ghcup compile hls --git-ref 1.8.0.0 --ghc 9.2.5 --cabal-update' |
2022-12-03 10:51:00 +0100 | <maerwald> | --git-ref master is a bit lucky goon |
2022-12-03 10:51:19 +0100 | <tomsmeding> | maerwald: you think git 1.8.0.0 is newer than hackage 1.8.0.0? |
2022-12-03 10:51:27 +0100 | <tomsmeding> | I mean, could be |
2022-12-03 10:51:37 +0100 | <maerwald> | it has a cabal.project file |
2022-12-03 10:51:43 +0100 | <tomsmeding> | oooh right |
2022-12-03 10:55:06 +0100 | <tomsmeding> | master build succeeded |
2022-12-03 10:57:31 +0100 | <tomsmeding> | (and seems to work) |
2022-12-03 10:58:03 +0100 | <freeside> | I am currently building ghcup compile hls --git-ref 1.8.0.0 --ghc 9.2.5 --cabal-update ... seems to br running fine so far |
2022-12-03 10:58:09 +0100 | <tomsmeding> | nice |
2022-12-03 10:58:30 +0100 | <freeside> | would it be a good idea to bump the HLS version (from cabal file) to something like 1.8.0.1 to distinguish master from release 1.8.0.0? |
2022-12-03 10:59:04 +0100 | <tomsmeding> | sounds like a job for 'ghcup compile hls --overwrite-version' |
2022-12-03 11:00:01 +0100 | <freeside> | yeah. It's nice how ghcup gives an Info log Examining git ref ____, showing commit hash and HLS version. |
2022-12-03 11:00:28 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
2022-12-03 11:00:34 +0100 | <tomsmeding> | in certain communities 1.8.0.0-git would be the appropriate version tag |
2022-12-03 11:00:37 +0100 | <maerwald> | you can also use --git-describe-version |
2022-12-03 11:00:38 +0100 | <freeside> | wow, I am now pegging my CPU for the first time in a long time, doing two parallel builds using GHC 9.2.4 and 9.2.5. I trust the filenames will keep from colliding |
2022-12-03 11:00:57 +0100 | <tomsmeding> | I can peg my cpu just fine with just one hls build lol |
2022-12-03 11:01:07 +0100 | <tomsmeding> | and I have 20 virtual cores to fill |
2022-12-03 11:01:10 +0100 | <maerwald> | freeside: ghcup does not do any locking |
2022-12-03 11:01:15 +0100 | <maerwald> | so good luck |
2022-12-03 11:02:18 +0100 | <freeside> | the builds seem to be happening in different ~/.ghcup/tmp/ghcup-* directories |
2022-12-03 11:02:42 +0100 | <maerwald> | yes, but once it merges it will try to change symlinks in ~/.ghcup/bin |
2022-12-03 11:02:44 +0100 | <maerwald> | that can blow up |
2022-12-03 11:03:11 +0100 | husixu | (~husixu@182.55.67.24) (Ping timeout: 246 seconds) |
2022-12-03 11:03:13 +0100 | <freeside> | i could see the wrapper -> wrapper-1.8.0.0 colliding, yes |
2022-12-03 11:03:27 +0100 | <tomsmeding> | will it though? The binaries it'll install will be suffixed with the ghc version, and as long as you don't use 'ghcup set', will it update symlinks? |
2022-12-03 11:04:49 +0100 | <maerwald> | the default for HLS is to set |
2022-12-03 11:04:56 +0100 | <tomsmeding> | a |
2022-12-03 11:04:57 +0100 | <tomsmeding> | *ah |
2022-12-03 11:05:07 +0100 | <maerwald> | only for GHC the default is to do nothing |
2022-12-03 11:05:13 +0100 | <tomsmeding> | may need to manually fix symlinks then afterwards |
2022-12-03 11:05:28 +0100 | <tomsmeding> | the builds are unlikely to finish at precisely the same time though |
2022-12-03 11:05:42 +0100 | <maerwald> | don't complain if it breaks your ghcup install though |
2022-12-03 11:06:42 +0100 | <tomsmeding> | maerwald: people will complain anyway ;) |
2022-12-03 11:07:03 +0100 | freeside | rages idemimpotently |
2022-12-03 11:07:24 +0100 | <tomsmeding> | similarly powerless? |
2022-12-03 11:08:31 +0100 | king_gs | (~Thunderbi@187.201.204.122) |
2022-12-03 11:09:55 +0100 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) |
2022-12-03 11:10:06 +0100 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 268 seconds) |
2022-12-03 11:10:06 +0100 | talismanick | (~talismani@76.133.152.122) (Ping timeout: 268 seconds) |
2022-12-03 11:11:12 +0100 | Lord_of_Life_ | Lord_of_Life |
2022-12-03 11:12:16 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 252 seconds) |
2022-12-03 11:12:21 +0100 | Tuplanolla | (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
2022-12-03 11:12:24 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 11:14:14 +0100 | levinlevinlevin | (~levin@ip5f584d02.dynamic.kabel-deutschland.de) |
2022-12-03 11:16:43 +0100 | <freeside> | dual to idempotently |
2022-12-03 11:17:09 +0100 | <freeside> | anyway, i have built --git-ref 1.8.0.0 --ghc 9.2.5 |
2022-12-03 11:18:50 +0100 | <freeside> | on both M1 and Intel |
2022-12-03 11:19:01 +0100 | <tomsmeding> | nice! and does it work? |
2022-12-03 11:19:18 +0100 | <freeside> | I'm seeing lsp-log has an InternalError: typecheck but I don't know how internal that error really is |
2022-12-03 11:19:50 +0100 | <freeside> | that error line appears to be pinned to the bottom of the buffer. then it says Live bytes: 44.43MB ... |
2022-12-03 11:20:03 +0100 | <freeside> | to see if it works, i will go back to my lts-20.2 project |
2022-12-03 11:23:06 +0100 | <freeside> | ah, yes, after restarting emacs, my ghcide 9.2.4/9.2.5 error has gone away, and the lsp-log has no more errors, and i am getting all the hover magic i am used to seeing |
2022-12-03 11:23:26 +0100 | <tomsmeding> | yay! |
2022-12-03 11:23:32 +0100 | <freeside> | yay, thank you for all the help |
2022-12-03 11:23:39 +0100 | <tomsmeding> | thanks for your persistence |
2022-12-03 11:24:12 +0100 | <freeside> | now i feel like this experience should in fact go into some sort of survival guide; doing --git-ref 1.8.0.0 instead of --version 1.8.0.0 was key, but that's not in the instructions at https://haskell-language-server.readthedocs.io/en/latest/installation.html |
2022-12-03 11:25:23 +0100 | <freeside> | --git-ref master is mentioned at https://www.haskell.org/ghcup/guide/#hls |
2022-12-03 11:25:58 +0100 | chomwitt | (~chomwitt@2a02:587:7a0c:6a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 256 seconds) |
2022-12-03 11:26:26 +0100 | <freeside> | it seems to me that a decision table of | OS (Windows, Linux, Mac) | hardware (M1, M2, Intel) | ghc version | HLS version | is almost ready to spring into existence |
2022-12-03 11:27:06 +0100 | <tomsmeding> | where every cell in that 4-dimensional table is a boolean? |
2022-12-03 11:27:09 +0100 | <tomsmeding> | yeah |
2022-12-03 11:27:23 +0100 | <freeside> | well, something that helps you decide how to run a build command |
2022-12-03 11:27:33 +0100 | <tomsmeding> | I am most particularly looking forward to the (Windows, M2) subtable |
2022-12-03 11:27:44 +0100 | <freeside> | for my next trick, I will chance the ruination of all this good work by upgrading the emacs-side lsp-haskell-whatever-mode |
2022-12-03 11:27:46 +0100 | <tomsmeding> | good luck there |
2022-12-03 11:27:50 +0100 | <freeside> | haha |
2022-12-03 11:27:51 +0100 | <tomsmeding> | lol |
2022-12-03 11:28:07 +0100 | <tomsmeding> | (Linux, M2) is now actually kinda a thing with Asahi |
2022-12-03 11:30:13 +0100 | tomsmeding | is afk for a while |
2022-12-03 11:30:21 +0100 | <freeside> | ur fingers deserve a rest, thnu |
2022-12-03 11:30:23 +0100 | <freeside> | thnku |
2022-12-03 11:30:48 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 11:31:31 +0100 | accord | (uid568320@id-568320.hampstead.irccloud.com) |
2022-12-03 11:32:55 +0100 | husixu | (~husixu@182.55.67.24) |
2022-12-03 11:36:10 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
2022-12-03 11:40:55 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
2022-12-03 11:41:08 +0100 | razetime | (~quassel@49.207.211.219) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2022-12-03 11:41:16 +0100 | king_gs | (~Thunderbi@187.201.204.122) (Quit: king_gs) |
2022-12-03 11:42:55 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
2022-12-03 11:44:03 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 11:44:28 +0100 | chomwitt | (~chomwitt@2a02:587:7a0c:6a00:1ac0:4dff:fedb:a3f1) |
2022-12-03 11:45:48 +0100 | nihonium | (~nihonium@93.175.28.32) (Ping timeout: 256 seconds) |
2022-12-03 11:47:49 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-03 11:48:07 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Client Quit) |
2022-12-03 11:48:25 +0100 | levinlevinlevin | (~levin@ip5f584d02.dynamic.kabel-deutschland.de) (Quit: leaving) |
2022-12-03 11:48:25 +0100 | razetime | (~quassel@49.207.211.219) |
2022-12-03 11:49:13 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 11:54:09 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:e558:b5d6:f082:6f2c) (Remote host closed the connection) |
2022-12-03 11:55:04 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 260 seconds) |
2022-12-03 11:55:56 +0100 | nihonium | (~nihonium@93.175.28.32) |
2022-12-03 12:01:06 +0100 | nihonium | (~nihonium@93.175.28.32) (Ping timeout: 256 seconds) |
2022-12-03 12:01:27 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-03 12:03:02 +0100 | econo | (uid147250@user/econo) (Quit: Connection closed for inactivity) |
2022-12-03 12:09:24 +0100 | Sgeo | (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
2022-12-03 12:09:38 +0100 | pyrex_ | (~pyrex@2601:645:8781:1c90:2d9a:11e:afbe:1759) |
2022-12-03 12:11:59 +0100 | dextaa7 | (~DV@user/dextaa) |
2022-12-03 12:13:08 +0100 | pja | (~pja@217.155.153.10) |
2022-12-03 12:13:24 +0100 | dextaa | (~DV@user/dextaa) (Ping timeout: 248 seconds) |
2022-12-03 12:13:24 +0100 | dextaa7 | dextaa |
2022-12-03 12:13:56 +0100 | pyrex | (~pyrex@user/pyrex) (Ping timeout: 248 seconds) |
2022-12-03 12:14:16 +0100 | superbil | (~superbil@1-34-176-171.hinet-ip.hinet.net) (Ping timeout: 268 seconds) |
2022-12-03 12:15:18 +0100 | superbil | (~superbil@1-34-176-171.hinet-ip.hinet.net) |
2022-12-03 12:20:56 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Ping timeout: 256 seconds) |
2022-12-03 12:27:30 +0100 | gmg | (~user@user/gehmehgeh) (Remote host closed the connection) |
2022-12-03 12:28:31 +0100 | gmg | (~user@user/gehmehgeh) |
2022-12-03 12:34:35 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
2022-12-03 12:36:32 +0100 | pyrex_ | (~pyrex@2601:645:8781:1c90:2d9a:11e:afbe:1759) (Ping timeout: 255 seconds) |
2022-12-03 12:37:33 +0100 | pyrex | (~pyrex@user/pyrex) |
2022-12-03 12:41:54 +0100 | jmdaemon | (~jmdaemon@user/jmdaemon) (Ping timeout: 256 seconds) |
2022-12-03 12:47:34 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-03 12:48:46 +0100 | lisbeths | (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-03 12:54:34 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-03 12:54:34 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-03 12:58:54 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 256 seconds) |
2022-12-03 13:00:38 +0100 | coderpath | (~coderpath@d66-183-126-83.bchsia.telus.net) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-03 13:01:03 +0100 | coderpath | (~coderpath@d66-183-126-83.bchsia.telus.net) |
2022-12-03 13:03:11 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 13:05:31 +0100 | teehemkay_ | (sid14792@id-14792.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-03 13:05:31 +0100 | teehemkay | (sid14792@id-14792.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-03 13:05:51 +0100 | mzan | (~quassel@mail.asterisell.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2022-12-03 13:07:53 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
2022-12-03 13:19:47 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
2022-12-03 13:20:53 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 13:28:18 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-03 13:32:28 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 13:32:38 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-03 13:33:12 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-03 13:37:41 +0100 | Lycurgus | (~juan@user/Lycurgus) |
2022-12-03 13:46:19 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) |
2022-12-03 13:47:46 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-03 13:51:44 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-12-03 13:52:54 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
2022-12-03 13:55:27 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
2022-12-03 14:03:30 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 252 seconds) |
2022-12-03 14:06:52 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
2022-12-03 14:06:52 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 14:07:28 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
2022-12-03 14:08:31 +0100 | acidjnk | (~acidjnk@p200300d6e7137a6578c6ff3ed8f071f7.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
2022-12-03 14:10:40 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-03 14:15:24 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
2022-12-03 14:19:46 +0100 | Lycurgus | (~juan@user/Lycurgus) (Quit: Exeunt https://tinyurl.com/4m8d4kd5) |
2022-12-03 14:25:02 +0100 | acidjnk | (~acidjnk@p200300d6e7137a51dd9a34ca5f6ed83a.dip0.t-ipconnect.de) |
2022-12-03 14:25:53 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2022-12-03 14:28:36 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-03 14:32:42 +0100 | mzan | (~quassel@mail.asterisell.com) |
2022-12-03 14:32:58 +0100 | argento | (~argento@191.81.234.127) |
2022-12-03 14:33:19 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) (Quit: Leaving.) |
2022-12-03 14:34:18 +0100 | argento | (~argento@191.81.234.127) (Client Quit) |
2022-12-03 14:34:40 +0100 | mzan | (~quassel@mail.asterisell.com) (Client Quit) |
2022-12-03 14:34:47 +0100 | argento | (~argento@191.81.234.127) |
2022-12-03 14:37:22 +0100 | jakalx | (~jakalx@base.jakalx.net) () |
2022-12-03 14:40:52 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) |
2022-12-03 14:41:41 +0100 | mzan | (~quassel@mail.asterisell.com) |
2022-12-03 14:44:30 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-03 14:44:57 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
2022-12-03 14:48:46 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-12-03 14:49:29 +0100 | merijn | (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds) |
2022-12-03 14:51:40 +0100 | Erutuon | (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
2022-12-03 14:51:56 +0100 | money | (Guest6586@user/polo) (Killed (tantalum.libera.chat (Nickname regained by services))) |
2022-12-03 14:52:28 +0100 | money | (~textual@user/polo) |
2022-12-03 14:54:20 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
2022-12-03 14:56:24 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-03 15:00:55 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 260 seconds) |
2022-12-03 15:02:51 +0100 | crazazy | (~user@130.89.171.62) |
2022-12-03 15:03:37 +0100 | money | (~textual@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
2022-12-03 15:05:30 +0100 | money | (money@user/polo) |
2022-12-03 15:06:29 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
2022-12-03 15:06:56 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 255 seconds) |
2022-12-03 15:07:26 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-03 15:08:35 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 15:09:09 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-12-03 15:11:37 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2022-12-03 15:13:19 +0100 | argento | (~argento@191.81.234.127) (Quit: leaving) |
2022-12-03 15:24:52 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-03 15:24:56 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
2022-12-03 15:25:50 +0100 | lottaquestions | (~nick@2607:fa49:503e:7100:fd99:63e8:8bc:5217) |
2022-12-03 15:26:22 +0100 | lottaquestions_ | (~nick@2607:fa49:503e:7100:70c7:eab8:4b94:7f8a) (Ping timeout: 252 seconds) |
2022-12-03 15:27:27 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2022-12-03 15:29:35 +0100 | lottaquestions | (~nick@2607:fa49:503e:7100:fd99:63e8:8bc:5217) (Client Quit) |
2022-12-03 15:29:59 +0100 | lottaquestions | (~nick@2607:fa49:503e:7100:fd99:63e8:8bc:5217) |
2022-12-03 15:30:44 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 248 seconds) |
2022-12-03 15:31:24 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
2022-12-03 15:31:48 +0100 | aeroplane | (~user@user/aeroplane) (Ping timeout: 248 seconds) |
2022-12-03 15:42:18 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) (Remote host closed the connection) |
2022-12-03 15:47:20 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 255 seconds) |
2022-12-03 15:47:31 +0100 | nihonium | (~nihonium@83.220.239.213) |
2022-12-03 15:53:22 +0100 | michalz | (~michalz@185.246.204.93) |
2022-12-03 15:56:00 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-03 16:00:39 +0100 | freeside | (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
2022-12-03 16:00:39 +0100 | nihonium | (~nihonium@83.220.239.213) (Read error: Connection reset by peer) |
2022-12-03 16:01:49 +0100 | causal | (~user@50.35.83.177) (Ping timeout: 260 seconds) |
2022-12-03 16:03:03 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) |
2022-12-03 16:08:40 +0100 | basti_ | (~basti@ip-084-119-008-088.um24.pools.vodafone-ip.de) |
2022-12-03 16:09:08 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 248 seconds) |
2022-12-03 16:11:09 +0100 | machinedgod | (~machinedg@d198-53-218-113.abhsia.telus.net) |
2022-12-03 16:12:59 +0100 | Unicorn_Princess | (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
2022-12-03 16:13:29 +0100 | jlgw | (~jw@46-162-74-53.cust.bredband2.com) (Read error: Connection reset by peer) |
2022-12-03 16:13:46 +0100 | money_ | (~money@pool-100-11-18-203.phlapa.fios.verizon.net) |
2022-12-03 16:15:19 +0100 | causal | (~user@50.35.83.177) |
2022-12-03 16:20:04 +0100 | money_ | (~money@pool-100-11-18-203.phlapa.fios.verizon.net) (Ping timeout: 256 seconds) |
2022-12-03 16:24:27 +0100 | nihonium | (~nihonium@83.220.239.213) |
2022-12-03 16:29:07 +0100 | freeside | (~mengwong@103.252.202.193) |
2022-12-03 16:36:09 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) |
2022-12-03 16:38:24 +0100 | ozkutuk5 | (~ozkutuk@176.240.173.153) |
2022-12-03 16:40:00 +0100 | azimut_ | (~azimut@gateway/tor-sasl/azimut) |
2022-12-03 16:40:31 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-03 16:54:56 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
2022-12-03 16:56:08 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2022-12-03 16:58:19 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-03 17:00:35 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-03 17:02:56 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 255 seconds) |
2022-12-03 17:06:12 +0100 | <freeside> | so, I'm about to ask a question, and I suspect the answer is going to be "that's just how it is. buy more RAM" |
2022-12-03 17:06:21 +0100 | <freeside> | can you guess what the question is lol |
2022-12-03 17:08:24 +0100 | <geekosaur> | the alternative answer is often "do less type level or generics shenanigans" |
2022-12-03 17:09:47 +0100 | <freeside> | the question is "why is haskell-language-server taking up so much RAM" |
2022-12-03 17:10:26 +0100 | <geekosaur> | I think it just caches a lot, but #haskell-language-server is more likely to know |
2022-12-03 17:11:13 +0100 | <freeside> | (^^)v |
2022-12-03 17:12:00 +0100 | mbuf | (~Shakthi@49.204.140.192) (Quit: Leaving) |
2022-12-03 17:19:18 +0100 | ddellacosta | (~ddellacos@86.106.143.75) |
2022-12-03 17:20:01 +0100 | ddellacosta | (~ddellacos@86.106.143.75) (Client Quit) |
2022-12-03 17:20:36 +0100 | <freeside> | hey, i just saw something cool ... after the upgrade to 9.2.5, a stray `fromJust` blew up on a Nothing value, but in addition to the usual error Maybe.fromJust: Nothing, I got a stack trace! (from HasCallStack)! how cool! |
2022-12-03 17:21:18 +0100 | <freeside> | I didn't even compile with --profile |
2022-12-03 17:21:24 +0100 | ddellacosta | (~ddellacos@143.244.47.100) |
2022-12-03 17:23:35 +0100 | <freeside> | is this a free new feature in v9? |
2022-12-03 17:32:35 +0100 | nihonium | (~nihonium@83.220.239.213) (Ping timeout: 260 seconds) |
2022-12-03 17:34:10 +0100 | ec | (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
2022-12-03 17:34:18 +0100 | abrar | (~abrar@static-108-2-152-54.phlapa.fios.verizon.net) (Ping timeout: 256 seconds) |
2022-12-03 17:34:43 +0100 | ec | (~ec@gateway/tor-sasl/ec) |
2022-12-03 17:35:05 +0100 | razetime | (~quassel@49.207.211.219) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
2022-12-03 17:38:16 +0100 | zer0bitz | (~zer0bitz@196.244.192.58) |
2022-12-03 17:39:40 +0100 | <geekosaur> | they've gradually been adding it to things, yes |
2022-12-03 17:42:02 +0100 | <freeside> | nice. love it. |
2022-12-03 17:42:23 +0100 | <freeside> | I will add "stack traces" to my List of Features That Python Stole From Haskell |
2022-12-03 17:43:19 +0100 | aeroplane | (~user@user/aeroplane) |
2022-12-03 17:51:51 +0100 | <geekosaur> | I'm quite certain Pythin had them first. CallStack was experimental in ghc8 and is still being worked in |
2022-12-03 17:54:17 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) |
2022-12-03 17:56:30 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-12-03 17:56:43 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Remote host closed the connection) |
2022-12-03 17:56:50 +0100 | <freeside> | joke, joke |
2022-12-03 18:04:14 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 246 seconds) |
2022-12-03 18:04:22 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 18:04:30 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
2022-12-03 18:13:32 +0100 | finsternis | (~X@23.226.237.192) (Read error: Connection reset by peer) |
2022-12-03 18:18:35 +0100 | Lycurgus | (~juan@user/Lycurgus) |
2022-12-03 18:23:02 +0100 | basti_ | (~basti@ip-084-119-008-088.um24.pools.vodafone-ip.de) (Ping timeout: 256 seconds) |
2022-12-03 18:24:14 +0100 | <tomsmeding> | freeside: I had this screenshot sent to me at some point https://tomsmeding.com/vang/aAiRo6/hls-memory.png |
2022-12-03 18:24:30 +0100 | <tomsmeding> | I hope it's not that bad yet on your side |
2022-12-03 18:25:06 +0100 | money_ | (~money@pool-100-11-18-203.phlapa.fios.verizon.net) |
2022-12-03 18:28:52 +0100 | merijn | (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds) |
2022-12-03 18:32:55 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
2022-12-03 18:34:01 +0100 | <monochrom> | That's... epic. :) |
2022-12-03 18:34:13 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 18:38:53 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
2022-12-03 18:40:00 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-03 18:43:49 +0100 | ddellacosta | (~ddellacos@143.244.47.100) (Ping timeout: 256 seconds) |
2022-12-03 18:45:43 +0100 | ddellacosta | (~ddellacos@143.244.47.73) |
2022-12-03 18:50:28 +0100 | pavonia | (~user@user/siracusa) (Quit: Bye!) |
2022-12-03 18:50:53 +0100 | Lycurgus | (~juan@user/Lycurgus) (Quit: Exeunt https://tinyurl.com/4m8d4kd5) |
2022-12-03 18:57:09 +0100 | bobbingbob | (~dfadsva@2604:3d09:207f:f650::7b3a) |
2022-12-03 18:58:37 +0100 | <bobbingbob> | so i was trying to learn how to do haskell development with nix. are we supposed to run nix commands as root? |
2022-12-03 18:59:44 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-03 19:00:30 +0100 | <bobbingbob> | ah i think i will just stick with cabal. |
2022-12-03 19:01:15 +0100 | <bobbingbob> | today i'm going to try to learn about segmentation algorithms and will try to get something going in haskell |
2022-12-03 19:02:15 +0100 | Scraeling | (~Scraeling@user/scraeling) |
2022-12-03 19:04:10 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 260 seconds) |
2022-12-03 19:05:01 +0100 | aeroplane | (~user@user/aeroplane) (Ping timeout: 252 seconds) |
2022-12-03 19:06:43 +0100 | money_ | (~money@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host) |
2022-12-03 19:06:43 +0100 | money_ | (~money@user/polo) |
2022-12-03 19:06:47 +0100 | money | Guest1418 |
2022-12-03 19:06:48 +0100 | Guest1418 | (money@user/polo) (Killed (calcium.libera.chat (Nickname regained by services))) |
2022-12-03 19:06:48 +0100 | money_ | money |
2022-12-03 19:09:47 +0100 | <geekosaur> | I think the only thing you normally run as root is the initial install, so it can create /nix |
2022-12-03 19:09:57 +0100 | <geekosaur> | everything else you run as a user |
2022-12-03 19:11:13 +0100 | econo | (uid147250@user/econo) |
2022-12-03 19:14:27 +0100 | ss4 | (~wootehfoo@user/wootehfoot) |
2022-12-03 19:16:39 +0100 | pagnol | (~user@213-205-209-87.ftth.glasoperator.nl) |
2022-12-03 19:17:00 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Ping timeout: 260 seconds) |
2022-12-03 19:18:05 +0100 | <pagnol> | Sometimes I find myself wanting to quickly write a one-off script in Haskell without going through lengthy incantations like setting up a project |
2022-12-03 19:18:10 +0100 | <pagnol> | Are there ways to do that? |
2022-12-03 19:18:27 +0100 | <EvanR> | a cabal script can be used for a 1 file program, to bring in packages |
2022-12-03 19:18:42 +0100 | <geekosaur> | both cabal and stack have script modes. and for really quick stuff there's runhaskell |
2022-12-03 19:18:42 +0100 | <EvanR> | sometimes I use that for advent of code |
2022-12-03 19:18:49 +0100 | wroathe | (~wroathe@user/wroathe) (Quit: Reconnecting) |
2022-12-03 19:19:01 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) |
2022-12-03 19:19:01 +0100 | wroathe | (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
2022-12-03 19:19:01 +0100 | wroathe | (~wroathe@user/wroathe) |
2022-12-03 19:20:15 +0100 | <EvanR> | what's the difference between cabal run and runhaskell |
2022-12-03 19:20:30 +0100 | <geekosaur> | cabal run has access to the cabal package store |
2022-12-03 19:20:40 +0100 | <geekosaur> | runhaskell has only the ghc global package db |
2022-12-03 19:20:46 +0100 | <EvanR> | ah |
2022-12-03 19:21:04 +0100 | <geekosaur> | also cabal run compiles things, runhaskell is an interpreter |
2022-12-03 19:21:26 +0100 | <sclv> | also i believe cabal run is compiles by default these days while runhaskell is evaluated |
2022-12-03 19:21:28 +0100 | <pagnol> | so like this? https://stackoverflow.com/a/65541020 |
2022-12-03 19:21:53 +0100 | ss4 | (~wootehfoo@user/wootehfoot) (Quit: Leaving) |
2022-12-03 19:22:08 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) |
2022-12-03 19:22:08 +0100 | <EvanR> | yeah, though the code for splitOn might take up less space xD |
2022-12-03 19:22:35 +0100 | <EvanR> | shame it's not in the standard library somewhere |
2022-12-03 19:22:56 +0100 | <geekosaur> | yeh, splitOn is trivially writable with break/span, seems odd to bring in a dependency just for that |
2022-12-03 19:23:42 +0100 | <geekosaur> | well, they are trying to split as much about of the standard library as possible, just to minimize the amout of stuff that cn only be upgraded by upgrading ghc |
2022-12-03 19:24:18 +0100 | <geekosaur> | there's currently a discussion about making all of base that way (the ghc-pinned part moved to a new ghc-base package and then base itself can be upgraded) |
2022-12-03 19:25:49 +0100 | <EvanR> | currently if you want to use a package (splitOn may be trivial, but vectors or containers not) via the cabal script that stops you from also ghci testing as you go |
2022-12-03 19:26:10 +0100 | <EvanR> | moving more out of the prelude makes that harsher? |
2022-12-03 19:26:21 +0100 | <EvanR> | or base |
2022-12-03 19:26:43 +0100 | <geekosaur> | moving more out of base just means less stuff that's unnecessarily pinned to ghc |
2022-12-03 19:26:57 +0100 | <sclv> | well you can use a project file and “cabal repl” |
2022-12-03 19:26:59 +0100 | <geekosaur> | splitting base itself into pinned and unpinned parts mitigates that |
2022-12-03 19:27:08 +0100 | Xeroine | (~Xeroine@user/xeroine) (Ping timeout: 268 seconds) |
2022-12-03 19:27:12 +0100 | <EvanR> | yeah this is moot if you set up a formal project |
2022-12-03 19:27:33 +0100 | <money> | moot? |
2022-12-03 19:27:52 +0100 | Xeroine | (~Xeroine@user/xeroine) |
2022-12-03 19:28:14 +0100 | <EvanR> | subject was quick one off script that uses non-base stuff, with less pomp and circumstance |
2022-12-03 19:29:13 +0100 | <EvanR> | not sure how geekosaur changes the non-base part |
2022-12-03 19:29:22 +0100 | <EvanR> | er, what geekosaur is talking about |
2022-12-03 19:30:11 +0100 | <geekosaur> | it shouldn't change it, base moves from non-upgradeable part to small non-upgradeable core and larger upgradeable boot package |
2022-12-03 19:30:25 +0100 | <geekosaur> | like text is currently a boot package but can be upgraded |
2022-12-03 19:30:26 +0100 | <EvanR> | oh if there is pinned and unpinned part, you could hypotheticall just have splitOn and chunksOf in the unpinned part |
2022-12-03 19:30:50 +0100 | <geekosaur> | right, it makes it easier to bring useful utils into base without pinning thyem to ghc at the same time |
2022-12-03 19:31:14 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
2022-12-03 19:31:27 +0100 | dsrt^ | (~dsrt@76.145.185.103) |
2022-12-03 19:31:51 +0100 | <geekosaur> | might even let us think about starting to use Text and ByteString APIs instead of String in base |
2022-12-03 19:32:13 +0100 | <geekosaur> | since making those non-upgradeable would be Bad |
2022-12-03 19:32:54 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2022-12-03 19:33:26 +0100 | <EvanR> | oh hell yeah |
2022-12-03 19:34:39 +0100 | <geekosaur> | and have a compat-base for older code that continued to use the older APIs |
2022-12-03 19:35:18 +0100 | <EvanR> | which API exactly, like getLine |
2022-12-03 19:35:22 +0100 | ss4 | (~wootehfoo@user/wootehfoot) |
2022-12-03 19:35:24 +0100 | <EvanR> | readFile |
2022-12-03 19:35:51 +0100 | <geekosaur> | yep. the exact APIs would probably be bikeskedded to death though 🙂 |
2022-12-03 19:35:57 +0100 | <geekosaur> | *bikeshedded |
2022-12-03 19:38:13 +0100 | <cpli> | https://tio.run/##jVCxbsIwFNz9FSfokAioyhopGZG6IaFOiOE1foGoiVvZpqRq@@2p4xhIyYIXn@7du7PvQOaNq6ptvxdTVKT2R9ozXpTkvJT0WvGzMpZUzgbTxa8QkixhpZlRgJBifdTswE/PRQWi8zCOhSjDMqLN4f0EmsPf/2Ux0izwFxKnA2sWgHG8WWvOIRH1YU7v6TVpVogkMiyfYjx4cmN1qfaYeOkEjwOD5RJ06@gD67scvXTkWIdKNl/KUrOqyLr3p@iAZcUS22IHybr87Ey6XwpR@KFGkvStDXYJi2xMXjYGDfToOun7v@aOiMbESGCprHzlrolwRpuNwWwWlDcBnUmKAIWwbOwqCNKR0XZE@EdH8RwB7IZQiJpK5Xw@XOHWtX@OHqS07R8 |
2022-12-03 19:38:19 +0100 | kuribas | (~user@ptr-17d51elyntgmmzbvw93.18120a2.ip6.access.telenet.be) |
2022-12-03 19:38:23 +0100 | wootehfoot | (~wootehfoo@user/wootehfoot) (Ping timeout: 252 seconds) |
2022-12-03 19:38:37 +0100 | <cpli> | how would i properly implement `flatter` by using combinators on Free monads? |
2022-12-03 19:40:16 +0100 | tzh | (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
2022-12-03 19:44:56 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
2022-12-03 19:45:05 +0100 | turlando | (~turlando@user/turlando) (Ping timeout: 265 seconds) |
2022-12-03 19:49:49 +0100 | <cpli> | correction: https://tio.run/##jVCxbsIwFNz9FSdgSARUzRopGZG6IaFOiOEVv0DUxK1sU6jafnvqOA6kZOnk0717d893JPPKVdU0X8spKlKHEx0Yz0ryvpT0UvGTMpbUng2myx8hJFnCSjOjACHD@qTZge@OiwpE/TCOhSjDMqLN8e0MWsC/f2UxsjzwVxLnI2sWgHG8WWveQyLqwpze02vSrBBJ5EgeY8w8ubG6VAdMvHSCh4FBkoDuHX1g/S9HLx051qGSzaeydFlVZN39GVpgWbHEtthBsi4/WpP2l0IUfqiRpl1rg13CMh@T141BAx26Tbr@b7kj4mJipLBUVr5y10S/O8No@WIwnwfxXUbrkyFAISwbuwqCbGS0HRH@7iheIIDdEApRU6mcz7vr3LrD@uhBStP8Ag |
2022-12-03 19:52:28 +0100 | finsternis | (~X@23.226.237.192) |
2022-12-03 19:53:53 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) (Remote host closed the connection) |
2022-12-03 19:54:30 +0100 | <mniip> | cpli, equationally I think this is always flatter = wrap . retract |
2022-12-03 19:54:46 +0100 | Kaiepi | (~Kaiepi@108.175.84.104) |
2022-12-03 19:55:22 +0100 | <mniip> | wrap . fmap pure . retract |
2022-12-03 19:56:14 +0100 | ss4 | (~wootehfoo@user/wootehfoot) (Quit: Leaving) |
2022-12-03 19:56:32 +0100 | gurkenglas | (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-03 20:00:20 +0100 | <mniip> | ah wait my bad, they disagree on Free [Pure _, Free _, ...] |
2022-12-03 20:00:46 +0100 | <mniip> | tbh that makes me think this operation doesn't have the vibe of being relevant to free monads |
2022-12-03 20:02:11 +0100 | nihonium | (~nihonium@46.148.105.76) |
2022-12-03 20:12:01 +0100 | jakalx | (~jakalx@base.jakalx.net) (Error from remote client) |
2022-12-03 20:15:43 +0100 | causal | (~user@50.35.83.177) (Ping timeout: 252 seconds) |
2022-12-03 20:17:40 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
2022-12-03 20:18:51 +0100 | Guest13 | (~Guest13@c83-248-102-237.bredband.tele2.se) |
2022-12-03 20:19:26 +0100 | jakalx | (~jakalx@base.jakalx.net) |
2022-12-03 20:21:53 +0100 | Guest13 | (~Guest13@c83-248-102-237.bredband.tele2.se) (Client Quit) |
2022-12-03 20:25:01 +0100 | <cpli> | mniip you're here too?? |
2022-12-03 20:25:04 +0100 | <cpli> | huh |
2022-12-03 20:25:12 +0100 | <cpli> | how's study going? |
2022-12-03 20:25:21 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-03 20:25:24 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 20:26:53 +0100 | <cpli> | hmm |
2022-12-03 20:27:00 +0100 | kuribas | (~user@ptr-17d51elyntgmmzbvw93.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 27.1)) |
2022-12-03 20:27:10 +0100 | <cpli> | really this is part of something that turns |
2022-12-03 20:27:22 +0100 | <cpli> | data SyntaxDeep f = App f f deriving Show |
2022-12-03 20:27:32 +0100 | <cpli> | into |
2022-12-03 20:27:32 +0100 | <cpli> | data SyntaxFlat f = Flattened [f] deriving Show |
2022-12-03 20:27:45 +0100 | <cpli> | so couldn't i retract on syntaxDeep? |
2022-12-03 20:28:16 +0100 | <cpli> | not really.. since it would just flatten all applications, but i want to preserve (g a) in "f b (g a)" |
2022-12-03 20:29:11 +0100 | causal | (~user@50.35.85.7) |
2022-12-03 20:29:57 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 255 seconds) |
2022-12-03 20:34:05 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
2022-12-03 20:35:12 +0100 | sammelweis | (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
2022-12-03 20:36:54 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 20:37:58 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-03 20:38:34 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 20:38:54 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 260 seconds) |
2022-12-03 20:41:45 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
2022-12-03 20:42:22 +0100 | money | (~money@user/polo) (Quit: money) |
2022-12-03 20:42:41 +0100 | neminis | (~neminis@43.21.135.77.rev.sfr.net) |
2022-12-03 20:43:06 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 20:43:16 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-12-03 20:43:21 +0100 | <tomsmeding> | % putStrLn "mniip: because yahb was gone I made a replacement" |
2022-12-03 20:43:21 +0100 | <yahb2> | mniip: because yahb was gone I made a replacement |
2022-12-03 20:43:32 +0100 | money | (~money@user/polo) |
2022-12-03 20:43:45 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-03 20:44:16 +0100 | <geekosaur> | I still kinda miss the pastebin functionality though |
2022-12-03 20:44:28 +0100 | <geekosaur> | %% putStrLn "doesn't work" |
2022-12-03 20:44:49 +0100 | Guest13 | (~Guest13@c83-248-102-237.bredband.tele2.se) |
2022-12-03 20:45:22 +0100 | money | (~money@user/polo) (Client Quit) |
2022-12-03 20:45:36 +0100 | iqubic | (~avi@2601:601:1100:edd0:7a35:ede8:5354:af72) |
2022-12-03 20:45:39 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:5d48:f2d9:c47:66b6) |
2022-12-03 20:45:50 +0100 | money | (~money@user/polo) |
2022-12-03 20:46:18 +0100 | gmg | (~user@user/gehmehgeh) (Remote host closed the connection) |
2022-12-03 20:46:18 +0100 | azimut_ | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-03 20:46:18 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-03 20:46:18 +0100 | califax | (~califax@user/califx) (Read error: Connection reset by peer) |
2022-12-03 20:46:47 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 20:46:59 +0100 | neminis | (~neminis@43.21.135.77.rev.sfr.net) (Client Quit) |
2022-12-03 20:47:07 +0100 | gmg | (~user@user/gehmehgeh) |
2022-12-03 20:47:18 +0100 | califax | (~califax@user/califx) |
2022-12-03 20:47:32 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
2022-12-03 20:47:50 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-03 20:50:26 +0100 | money | (~money@user/polo) (Client Quit) |
2022-12-03 20:53:55 +0100 | money | (~money@user/polo) |
2022-12-03 20:54:12 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 20:54:26 +0100 | Guest13 | (~Guest13@c83-248-102-237.bredband.tele2.se) (Quit: Client closed) |
2022-12-03 20:54:42 +0100 | titibandit | (~titibandi@xdsl-78-35-173-119.nc.de) (Quit: Leaving.) |
2022-12-03 20:55:17 +0100 | money | (~money@user/polo) (Read error: Connection reset by peer) |
2022-12-03 20:55:24 +0100 | chexum_ | (~quassel@gateway/tor-sasl/chexum) |
2022-12-03 20:56:44 +0100 | money_ | (~money@user/polo) |
2022-12-03 20:58:44 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
2022-12-03 20:58:44 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds) |
2022-12-03 20:58:57 +0100 | money_ | (~money@user/polo) (Read error: Connection reset by peer) |
2022-12-03 20:59:06 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
2022-12-03 20:59:19 +0100 | Sgeo | (~Sgeo@user/sgeo) |
2022-12-03 21:00:01 +0100 | sagax | (~sagax_nb@user/sagax) (Read error: Connection reset by peer) |
2022-12-03 21:00:18 +0100 | money | (~money@user/polo) |
2022-12-03 21:01:13 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-03 21:05:43 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 21:05:46 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 252 seconds) |
2022-12-03 21:09:24 +0100 | anpad | (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in) |
2022-12-03 21:09:41 +0100 | anpad | (~pandeyan@user/anpad) |
2022-12-03 21:10:24 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 260 seconds) |
2022-12-03 21:10:42 +0100 | lortabac | (~lortabac@2a01:e0a:541:b8f0:5d48:f2d9:c47:66b6) (Quit: WeeChat 2.8) |
2022-12-03 21:11:30 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 21:12:59 +0100 | crazazy` | (~user@130.89.173.127) |
2022-12-03 21:14:44 +0100 | crazazy | (~user@130.89.171.62) (Ping timeout: 248 seconds) |
2022-12-03 21:16:17 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
2022-12-03 21:17:23 +0100 | nihonium | (~nihonium@46.148.105.76) (Ping timeout: 256 seconds) |
2022-12-03 21:17:33 +0100 | coot | (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
2022-12-03 21:18:08 +0100 | acidjnk | (~acidjnk@p200300d6e7137a51dd9a34ca5f6ed83a.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2022-12-03 21:22:01 +0100 | money | (~money@user/polo) (Quit: money) |
2022-12-03 21:22:08 +0100 | TimWolla | (~timwolla@2a01:4f8:150:6153:beef::6667) (Quit: Bye) |
2022-12-03 21:22:38 +0100 | money | (~money@user/polo) |
2022-12-03 21:23:02 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 21:24:09 +0100 | <mniip> | cpli, I graduated this summer |
2022-12-03 21:28:09 +0100 | TimWolla | (~timwolla@2a01:4f8:150:6153:beef::6667) |
2022-12-03 21:28:13 +0100 | <cpli> | huh |
2022-12-03 21:28:33 +0100 | <cpli> | math? |
2022-12-03 21:28:50 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 260 seconds) |
2022-12-03 21:30:05 +0100 | neminis | (~neminis@43.21.135.77.rev.sfr.net) |
2022-12-03 21:31:07 +0100 | hpc | (~juzz@ip98-169-32-242.dc.dc.cox.net) (Ping timeout: 248 seconds) |
2022-12-03 21:31:18 +0100 | rekahsoft | (~rekahsoft@bras-base-wdston4533w-grc-02-142-113-160-156.dsl.bell.ca) |
2022-12-03 21:31:37 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 21:33:44 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-03 21:34:37 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 21:35:39 +0100 | acidjnk | (~acidjnk@p200300d6e7137a51dd9a34ca5f6ed83a.dip0.t-ipconnect.de) |
2022-12-03 21:41:49 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
2022-12-03 21:44:11 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-03 21:45:46 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) |
2022-12-03 21:45:55 +0100 | troydm | (~troydm@host-176-37-124-197.b025.la.net.ua) |
2022-12-03 21:46:32 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) (Client Quit) |
2022-12-03 21:46:44 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) |
2022-12-03 21:49:06 +0100 | money | (~money@user/polo) (Quit: money) |
2022-12-03 21:50:45 +0100 | money_ | (~money@user/polo) |
2022-12-03 21:51:25 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) (Ping timeout: 252 seconds) |
2022-12-03 21:51:48 +0100 | money_ | (~money@user/polo) (Client Quit) |
2022-12-03 21:52:31 +0100 | money_ | (~money@user/polo) |
2022-12-03 21:52:31 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
2022-12-03 21:53:10 +0100 | money_ | (~money@user/polo) (Client Quit) |
2022-12-03 21:53:53 +0100 | money_ | (~money@user/polo) |
2022-12-03 21:58:22 +0100 | pagnol | (~user@213-205-209-87.ftth.glasoperator.nl) (Ping timeout: 256 seconds) |
2022-12-03 22:00:59 +0100 | nate4 | (~nate@98.45.169.16) |
2022-12-03 22:01:26 +0100 | money_ | (~money@user/polo) (Quit: money_) |
2022-12-03 22:01:50 +0100 | eggplantade | (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
2022-12-03 22:01:59 +0100 | money_ | (~money@user/polo) |
2022-12-03 22:03:49 +0100 | hpc | (~juzz@ip98-169-35-163.dc.dc.cox.net) |
2022-12-03 22:03:57 +0100 | pavonia | (~user@user/siracusa) |
2022-12-03 22:06:18 +0100 | nate4 | (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
2022-12-03 22:07:38 +0100 | king_gs | (~Thunderbi@2806:103e:29:94a4:81e0:429b:22ec:cf13) |
2022-12-03 22:08:07 +0100 | neminis | (~neminis@43.21.135.77.rev.sfr.net) (Quit: Client closed) |
2022-12-03 22:10:06 +0100 | money_ | (~money@user/polo) (Quit: money_) |
2022-12-03 22:10:31 +0100 | Erutuon | (~Erutuon@user/erutuon) |
2022-12-03 22:10:44 +0100 | money_ | (~money@user/polo) |
2022-12-03 22:11:21 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-03 22:11:54 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 22:12:26 +0100 | money_ | (~money@user/polo) (Read error: Connection reset by peer) |
2022-12-03 22:12:52 +0100 | Sauvin | (~sauvin@user/Sauvin) (Ping timeout: 252 seconds) |
2022-12-03 22:13:11 +0100 | money_ | (~money@user/polo) |
2022-12-03 22:15:49 +0100 | Sauvin | (~sauvin@user/Sauvin) |
2022-12-03 22:19:23 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
2022-12-03 22:20:48 +0100 | money | (Guest1418@user/polo) |
2022-12-03 22:27:03 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 22:27:14 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-03 22:27:40 +0100 | Bocaneri | (~sauvin@user/Sauvin) |
2022-12-03 22:27:47 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 22:28:02 +0100 | glguy_ | glguy |
2022-12-03 22:28:03 +0100 | Bocaneri | Guest6927 |
2022-12-03 22:29:15 +0100 | yahb2 | (~yahb2@static.56.27.47.78.clients.your-server.de) (Remote host closed the connection) |
2022-12-03 22:29:27 +0100 | yahb2 | (~yahb2@2a01:4f8:c0c:5c7b::2) |
2022-12-03 22:29:30 +0100 | Sauvin | (~sauvin@user/Sauvin) (Killed (NickServ (GHOST command used by Guest6927))) |
2022-12-03 22:29:36 +0100 | Guest6927 | Sauvin |
2022-12-03 22:30:21 +0100 | <tomsmeding> | %% putStrLn "geekosaur tells lies" |
2022-12-03 22:30:21 +0100 | <yahb2> | https://paste.tomsmeding.com/IYICDlAa |
2022-12-03 22:30:33 +0100 | gmg | (~user@user/gehmehgeh) (Remote host closed the connection) |
2022-12-03 22:31:04 +0100 | <tomsmeding> | it creates pastes that expire in 1 day currently |
2022-12-03 22:32:23 +0100 | chexum_ | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-03 22:33:12 +0100 | <monochrom> | May I use %%% to extend it to 2 days? :) |
2022-12-03 22:33:14 +0100 | gmg | (~user@user/gehmehgeh) |
2022-12-03 22:33:18 +0100 | <tomsmeding> | haha |
2022-12-03 22:33:44 +0100 | <monochrom> | "No, %%% means two independent pastebins" :) |
2022-12-03 22:33:50 +0100 | <glguy> | I've been making a little clone of Patrick's Parabox https://imgur.com/a/djAxYWg https://glguy.net/gitea/glguy/parabox (warning, the screen shots are spoilers for two of the puzzle solutions) |
2022-12-03 22:34:19 +0100 | <geekosaur> | tomsmeding, thanks! |
2022-12-03 22:35:20 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 260 seconds) |
2022-12-03 22:35:20 +0100 | <tomsmeding> | monochrom: and then it prints the two urls received interleaved, so you get hhttttppss::////ppaassttee..dteobmisamne.dnientg/... etc |
2022-12-03 22:35:37 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-03 22:35:48 +0100 | ski__ | (~slj@ext-1-443.eduroam.chalmers.se) (Ping timeout: 248 seconds) |
2022-12-03 22:35:57 +0100 | <EvanR> | %% many (randomRIO (0,1) >>= \x -> case x of 0 -> putChar 'a'; 1 -> empty) |
2022-12-03 22:35:57 +0100 | <yahb2> | https://paste.tomsmeding.com/943EqmSh |
2022-12-03 22:36:15 +0100 | <EvanR> | blast |
2022-12-03 22:36:18 +0100 | <tomsmeding> | :p |
2022-12-03 22:36:52 +0100 | <monochrom> | haha tomsmeding that's a cool feature |
2022-12-03 22:37:09 +0100 | <monochrom> | or rather s/'s/ would be/ |
2022-12-03 22:37:31 +0100 | <tomsmeding> | % interleave [] l = l ; interleave l [] = l ; interleave (x:xs) (y:ys) = x : y : interleave xs ys |
2022-12-03 22:37:31 +0100 | <yahb2> | <no output> |
2022-12-03 22:37:49 +0100 | <EvanR> | patrick's parabox? |
2022-12-03 22:37:55 +0100 | tcard_ | (~tcard@2400:4051:5801:7500:19ce:ed82:2ab7:90f9) (Quit: Leaving) |
2022-12-03 22:37:57 +0100 | <monochrom> | The interleaving should be randomized. |
2022-12-03 22:38:40 +0100 | <glguy> | EvanR: a sokoban-like puzzle game on Steam that features recursion; levels are blocks on other levels and can be contained in themselves |
2022-12-03 22:38:45 +0100 | <tomsmeding> | monochrom: some of my code prints un-synchronised log messages from multiple haskell threads and when they step on each others' toes, they get interleaved _almost_ perfectly character-by-character |
2022-12-03 22:38:52 +0100 | <tomsmeding> | I'm amazed every time I see it |
2022-12-03 22:38:52 +0100 | <EvanR> | oh nice |
2022-12-03 22:38:56 +0100 | <EvanR> | like Infinite Turtles |
2022-12-03 22:40:51 +0100 | <EvanR> | yes very much in similar spirit |
2022-12-03 22:41:44 +0100 | <geekosaur> | sadly I no longer have the one I worked out ("you have a problem and you decide to use threads, now <interleaved gibberish>") |
2022-12-03 22:42:01 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
2022-12-03 22:42:58 +0100 | <EvanR> | glguy, can I have your terminal that supports the doubly infinite nesting? Sounds handy |
2022-12-03 22:43:29 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-03 22:43:44 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-03 22:44:35 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 246 seconds) |
2022-12-03 22:44:54 +0100 | <EvanR> | interleaved gibberish is a luxury. Back in the type writer days the output would be striked over itself and misaligned |
2022-12-03 22:44:59 +0100 | <tomsmeding> | https://paste.tomsmeding.com/BFVvzpf5 |
2022-12-03 22:46:19 +0100 | <EvanR> | that threads get interrupted after 1 character is insane, is it really doing outputting 1 character at a time |
2022-12-03 22:46:30 +0100 | money_ | (~money@user/polo) (Quit: money_) |
2022-12-03 22:48:01 +0100 | stiell | (~stiell@gateway/tor-sasl/stiell) |
2022-12-03 22:48:08 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 22:48:43 +0100 | <tomsmeding> | EvanR: I mean I literally got these log lines just now, first try: https://paste.tomsmeding.com/FbiXiCbz |
2022-12-03 22:48:50 +0100 | <tomsmeding> | first two lines are the log, 5-7 are my decomposition |
2022-12-03 22:49:02 +0100 | <tomsmeding> | oh the L is a typo, should be : obviously |
2022-12-03 22:49:16 +0100 | <glguy> | Often stderr is unbuffered and one character at a time while stdout is line buffered |
2022-12-03 22:49:18 +0100 | <EvanR> | maybe it gets interrupted way faster than once per character |
2022-12-03 22:49:20 +0100 | <mauke> | I bet it's a consequence of String = [Char] |
2022-12-03 22:49:54 +0100 | <EvanR> | every once in a while you see a character, and since it's the same code, same rate of characters |
2022-12-03 22:51:20 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
2022-12-03 22:51:31 +0100 | <tomsmeding> | the log messages indeed go to stderr |
2022-12-03 22:52:01 +0100 | <tomsmeding> | so probably that, plus a decent probability that those two haskell threads are still scheduled on the same physical core |
2022-12-03 22:52:09 +0100 | <tomsmeding> | so the rts scheduler just round-robins |
2022-12-03 22:52:13 +0100 | mrkun[m] | (~mrkunmatr@2001:470:69fc:105::2:2a39) |
2022-12-03 22:52:35 +0100 | zant | (~zant@62.214.20.26) (Ping timeout: 255 seconds) |
2022-12-03 22:52:48 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
2022-12-03 22:53:08 +0100 | gmg | (~user@user/gehmehgeh) (Ping timeout: 255 seconds) |
2022-12-03 22:53:08 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
2022-12-03 22:53:08 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
2022-12-03 22:53:18 +0100 | <tomsmeding> | EvanR: I'd hope that traversing a link in a linked list is faster than doing a write(2) syscall on stderr :) |
2022-12-03 22:53:40 +0100 | <tomsmeding> | so probably just the rts yielding on every IO operation |
2022-12-03 22:53:51 +0100 | FinnElija | (~finn_elij@user/finn-elija/x-0085643) |
2022-12-03 22:54:11 +0100 | <dsal> | traverse write "some string" |
2022-12-03 22:55:19 +0100 | husixu | (~husixu@182.55.67.24) (Remote host closed the connection) |
2022-12-03 22:55:27 +0100 | azimut | (~azimut@gateway/tor-sasl/azimut) |
2022-12-03 22:55:27 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2022-12-03 22:55:27 +0100 | <EvanR> | if "some string" is a non trivial list program, there may be many more opportunities to yield |
2022-12-03 22:55:37 +0100 | gmg | (~user@user/gehmehgeh) |
2022-12-03 22:55:49 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
2022-12-03 22:55:56 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-03 22:56:25 +0100 | <tomsmeding> | EvanR: look at the strings in my paste |
2022-12-03 22:56:40 +0100 | <tomsmeding> | maybe some parts are nontrivial, but significant chunks are string literals |
2022-12-03 22:56:55 +0100 | <EvanR> | the last paste was a paste of a paste, exhausting my depth limit |
2022-12-03 22:57:22 +0100 | <dsal> | Heh. I had to check twice. |
2022-12-03 22:57:47 +0100 | michalz | (~michalz@185.246.204.93) (Remote host closed the connection) |
2022-12-03 22:58:01 +0100 | <EvanR> | it seems to be a loop |
2022-12-03 22:59:57 +0100 | <dsal> | > let paste = paste in paste |
2022-12-03 22:59:59 +0100 | <lambdabot> | *Exception: <<loop>> |
2022-12-03 23:00:30 +0100 | <tomsmeding> | EvanR: lol yes that one is a little magic |
2022-12-03 23:00:35 +0100 | <tomsmeding> | but I was referring to this one https://paste.tomsmeding.com/FbiXiCbz |
2022-12-03 23:00:56 +0100 | thyriaen | (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
2022-12-03 23:01:17 +0100 | accord | (uid568320@id-568320.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
2022-12-03 23:01:25 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
2022-12-03 23:02:13 +0100 | <geekosaur> | also last time I looked putStr didn't buffer the whole string as a single chunk, it looped doing putChar |
2022-12-03 23:02:25 +0100 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) |
2022-12-03 23:02:38 +0100 | <geekosaur> | which makes it far more likely that you get character interleaving |
2022-12-03 23:03:23 +0100 | <tomsmeding> | if putChar itself (without the time spent in write(2), if unbuffered) takes an amount of time even remotely comparible to write(2), then it is ridiculously inefficient |
2022-12-03 23:03:26 +0100 | tomokojun_ | (~tomokojun@37.19.221.160) |
2022-12-03 23:03:30 +0100 | <tomsmeding> | *comparable |
2022-12-03 23:03:47 +0100 | tomokojun | (~tomokojun@37.19.221.160) (Remote host closed the connection) |
2022-12-03 23:04:04 +0100 | <EvanR> | honestly I'm glad it does that, because clojure's equivalent of list evaluates a magic number of elements at a time. So if you want to print just the first letter, an error in the 9th letter means you get no letters |
2022-12-03 23:04:23 +0100 | <EvanR> | but not if there's an error in the 34th letter |
2022-12-03 23:04:28 +0100 | tomokojun_ | tomokojun |
2022-12-03 23:04:28 +0100 | tomokojun | (~tomokojun@37.19.221.160) (Remote host closed the connection) |
2022-12-03 23:04:29 +0100 | <tomsmeding> | yeah for stderr I guess it's the right thing to do |
2022-12-03 23:04:40 +0100 | <geekosaur> | that should not come up |
2022-12-03 23:04:48 +0100 | tomokojun | (~tomokojun@37.19.221.160) |
2022-12-03 23:05:40 +0100 | <geekosaur> | if you want to print just the firts letter of ('a':undefined) it shopuld work either way. and it should fail either way if you putStr ('a':'b':undefined) |
2022-12-03 23:06:09 +0100 | king_gs | (~Thunderbi@2806:103e:29:94a4:81e0:429b:22ec:cf13) (Ping timeout: 265 seconds) |
2022-12-03 23:06:17 +0100 | <EvanR> | % putStr ('a':'b':undefined) |
2022-12-03 23:06:17 +0100 | <yahb2> | ab*** Exception: Prelude.undefined ; CallStack (from HasCallStack): ; error, called at libraries/base/GHC/Err.hs:74:14 in base:GHC.Err ; undefined, called at <interactive>:14:17 in interactive:... |
2022-12-03 23:06:27 +0100 | <tomsmeding> | geekosaur: not on stdout with optimisations enabled |
2022-12-03 23:06:43 +0100 | <tomsmeding> | oh the optimisations are a red herring, correction: not on stdout when compiled |
2022-12-03 23:07:07 +0100 | <tomsmeding> | in ghci, yes, because in ghci stdout is also unbuffered |
2022-12-03 23:07:59 +0100 | <EvanR> | oof |
2022-12-03 23:08:22 +0100 | <EvanR> | ./Main -- doesn't print ab |
2022-12-03 23:08:28 +0100 | <EvanR> | runhaskell Main.hs -- prints ab |
2022-12-03 23:09:06 +0100 | <EvanR> | I guess this is where someone comes out and says "I told you IO has no semantics" xD |
2022-12-03 23:09:22 +0100 | <tomsmeding> | %% System.Process.system "echo \"main = putStrLn ('a':undefined)\" >b.hs; ghc b.hs -o b; ./b" |
2022-12-03 23:09:22 +0100 | <yahb2> | https://paste.tomsmeding.com/0OwSOd1M |
2022-12-03 23:09:31 +0100 | <mauke> | personally I think it should peek ahead to see how much of the string is already defined |
2022-12-03 23:09:35 +0100 | <tomsmeding> | oh lol |
2022-12-03 23:10:04 +0100 | <tomsmeding> | EvanR: this buffering thing is literally the case in almost every programming language |
2022-12-03 23:10:51 +0100 | <EvanR> | ok it's the OS buffering behavior and not putStr doing two different things, at least |
2022-12-03 23:11:08 +0100 | <tomsmeding> | EvanR: putStr is probably doing two different things |
2022-12-03 23:11:15 +0100 | <EvanR> | o_O |
2022-12-03 23:11:24 +0100 | <tomsmeding> | which is just like in C, C++, Java, JavaScript, Python, Rust, Go, name your language |
2022-12-03 23:11:26 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-03 23:11:47 +0100 | <EvanR> | @src putStr -- second opinion |
2022-12-03 23:11:47 +0100 | <lambdabot> | Source not found. Just what do you think you're doing Dave? |
2022-12-03 23:11:52 +0100 | <tomsmeding> | EvanR: https://hackage.haskell.org/package/base-4.16.0.0/docs/System-IO.html#g:12 |
2022-12-03 23:12:08 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-03 23:12:09 +0100 | <geekosaur> | pretty much every language does buffering because without it performance absolutely sucks |
2022-12-03 23:12:11 +0100 | <tomsmeding> | EvanR: stdout is LineBuffering by default, stderr NoBuffering |
2022-12-03 23:12:21 +0100 | <EvanR> | so ghc handles that |
2022-12-03 23:12:25 +0100 | <tomsmeding> | you can hSetBuffering to change |
2022-12-03 23:12:29 +0100 | <geekosaur> | doing a syscall on every character is horrid |
2022-12-03 23:12:31 +0100 | <EvanR> | instead of C lib or the kernel |
2022-12-03 23:12:37 +0100 | <tomsmeding> | yes |
2022-12-03 23:12:49 +0100 | <geekosaur> | even in 2022 you can see individual characters get printed |
2022-12-03 23:13:01 +0100 | <EvanR> | and the defaults are magically determined depending on build or not mode |
2022-12-03 23:13:15 +0100 | <tomsmeding> | % System.Process.system "cd /tmp; echo \"main = putStrLn ('a':undefined)\" >b.hs; ghc b.hs -o b; ./b" |
2022-12-03 23:13:16 +0100 | <yahb2> | [1 of 1] Compiling Main ( b.hs, b.o ) ; Linking b ... ; b: Prelude.undefined ; CallStack (from HasCallStack): ; error, called at libraries/base/GHC/Err.hs:74:14 in base:GHC.Err ; un... |
2022-12-03 23:13:20 +0100 | <tomsmeding> | there we go |
2022-12-03 23:13:39 +0100 | <tomsmeding> | EvanR: > The default buffering mode when a handle is opened is implementation-dependent and may depend on the file system object which is attached to that handle. |
2022-12-03 23:14:25 +0100 | <tomsmeding> | furthermore, if stdout is a terminal it'll be LineBuffering, but if you pipe stdout to something else (a file or another program), it'll be BlockBuffering _ |
2022-12-03 23:15:14 +0100 | <tomsmeding> | same as in C, which is why e.g. grep(1) has --line-buffered, with the documentation (see `man 1 grep`) "This can cause a performance penalty." |
2022-12-03 23:15:15 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
2022-12-03 23:15:36 +0100 | zant | (~zant@62.214.20.26) |
2022-12-03 23:18:13 +0100 | <cpli> | if there's an invariant to an `f` in `Free f a` which is binary i.e. `Two f f` can i retract only the first f? |
2022-12-03 23:18:14 +0100 | <EvanR> | that part makes sense |
2022-12-03 23:18:52 +0100 | <EvanR> | but why is the mode one way in runhaskell and another way after compilation, on the same kind of handle / object |
2022-12-03 23:19:08 +0100 | chexum | (~quassel@gateway/tor-sasl/chexum) |
2022-12-03 23:19:16 +0100 | <tomsmeding> | EvanR: Because I guess it makes sense that the mode is NoBuffering in ghci, and runhaskell is literally ghci |
2022-12-03 23:19:41 +0100 | <geekosaur> | because ghc cheats and decides the default mode based on whether it's using the bytecode backend instead of whether it's ghci |
2022-12-03 23:19:51 +0100 | <tomsmeding> | doesn't explain why runhaskell doesn't hSetBuffering manually to smooth over the differences though |
2022-12-03 23:20:01 +0100 | <geekosaur> | and ghci is unbuffered because haskeline requires it |
2022-12-03 23:20:28 +0100 | <geekosaur> | (well, line editing in general, not haskeline in specific) |
2022-12-03 23:20:38 +0100 | <tomsmeding> | not sure if haskeline is a great argument; ghci could very well switch buffering before and after executing a command |
2022-12-03 23:21:24 +0100 | <tomsmeding> | but in ghci you kinda want to see partial output if an exception occurs halfway through |
2022-12-03 23:21:47 +0100 | <EvanR> | and get a false impression of what will actually happen |
2022-12-03 23:21:50 +0100 | <EvanR> | in production |
2022-12-03 23:21:58 +0100 | Scraeling | (~Scraeling@user/scraeling) (Quit: Going offline, see ya! (www.adiirc.com)) |
2022-12-03 23:22:01 +0100 | <geekosaur> | you're getting that anyway in ghci |
2022-12-03 23:22:22 +0100 | <tomsmeding> | EvanR: asynchronous exceptions are unpredictable under optimisations anyway :p |
2022-12-03 23:22:26 +0100 | <EvanR> | no! I want to spawn graphics windows and interactively debug my game! xD |
2022-12-03 23:22:31 +0100 | <tomsmeding> | so not sure there were many guarantees to begin with |
2022-12-03 23:23:02 +0100 | <tomsmeding> | EvanR: you can, right, from ghci? Will just be a bit slower :) |
2022-12-03 23:23:13 +0100 | <EvanR> | yeah you can, and now I'm paranoid |
2022-12-03 23:23:31 +0100 | <EvanR> | will answers like 5 be 6 in production |
2022-12-03 23:23:38 +0100 | <tomsmeding> | no |
2022-12-03 23:23:45 +0100 | <tomsmeding> | buffering is not _that_ big of a deal :p |
2022-12-03 23:24:24 +0100 | <tomsmeding> | unless you actively rely on getting "ab** Exception ..." as output and parsing that, in which case, don't do that :p |
2022-12-03 23:25:12 +0100 | <EvanR> | yeah in simple scenarios, and ignoring bottom, buffering only changes performance |
2022-12-03 23:25:39 +0100 | <tomsmeding> | also in complex scenarios, assuming that your production app doesn't crash halfway through |
2022-12-03 23:25:39 +0100 | <EvanR> | but if two processes are interacting, seeing nothing until "you" send a newline might cause deadlock |
2022-12-03 23:25:45 +0100 | <tomsmeding> | ye |
2022-12-03 23:25:46 +0100 | <tomsmeding> | s |
2022-12-03 23:25:50 +0100 | <tomsmeding> | that's why hFlush exists |
2022-12-03 23:25:58 +0100 | <tomsmeding> | everyone in every language has to deal with that :p |
2022-12-03 23:26:20 +0100 | <EvanR> | worse excuse ever! |
2022-12-03 23:26:40 +0100 | <tomsmeding> | buffering has a massive performance impact though, if you output lots of stuff |
2022-12-03 23:26:59 +0100 | <tomsmeding> | writing to a terminal is SLOW, especially some ones (cough windows cmd) |
2022-12-03 23:27:02 +0100 | bobbingbob | (~dfadsva@2604:3d09:207f:f650::7b3a) (Quit: Leaving) |
2022-12-03 23:27:33 +0100 | <EvanR> | some protocols send like single character datagrams at a time! |
2022-12-03 23:27:45 +0100 | <EvanR> | how is that not 100 times worse xD |
2022-12-03 23:27:54 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
2022-12-03 23:28:09 +0100 | <tomsmeding> | EvanR: do they send lots of them in a batch? Or is a single message just 1 char, after which they wait for the other party |
2022-12-03 23:28:18 +0100 | <tomsmeding> | in the former case, ... don't do that? |
2022-12-03 23:28:33 +0100 | <tomsmeding> | I trust the number of users of such protocols is negligible :) |
2022-12-03 23:28:41 +0100 | <EvanR> | they have to not batch so the other end gets timely updates |
2022-12-03 23:28:44 +0100 | ChaiTRex | (~ChaiTRex@user/chaitrex) |
2022-12-03 23:28:46 +0100 | <geekosaur> | ssh |
2022-12-03 23:28:58 +0100 | <tomsmeding> | right, unless your usecase requires it, sure |
2022-12-03 23:29:11 +0100 | <geekosaur> | then again, there's a special mode for tcp/ip to support ssh and similar,m because it does buffering too |
2022-12-03 23:29:14 +0100 | merijn | (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds) |
2022-12-03 23:29:46 +0100 | <geekosaur> | becuase, whether it's network transfer or terminal output or file output or etc., character at a time I/O is really expensive |
2022-12-03 23:30:09 +0100 | <EvanR> | if it's from user input I guess it's not that bad |
2022-12-03 23:32:53 +0100 | Topsi | (~Topsi@dialin-80-228-141-008.ewe-ip-backbone.de) |
2022-12-03 23:38:23 +0100 | jao | (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
2022-12-03 23:39:31 +0100 | Feuermagier | (~Feuermagi@user/feuermagier) (Quit: Leaving) |
2022-12-03 23:49:24 +0100 | ballast | (~ballast@rrcs-24-43-123-92.west.biz.rr.com) |
2022-12-03 23:51:04 +0100 | Guest26 | (~Guest26@2001:999:488:5cc:e5b0:b492:b43a:8f46) |
2022-12-03 23:54:54 +0100 | <Guest26> | @pl (\x -> splitAt (div (length x) 2) x) |
2022-12-03 23:54:54 +0100 | <lambdabot> | splitAt =<< flip div 2 . length |
2022-12-03 23:58:20 +0100 | takuan | (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
2022-12-03 23:59:33 +0100 | <Guest26> | What does =<< mean? |
2022-12-03 23:59:43 +0100 | <mauke> | @src (=<<) |
2022-12-03 23:59:43 +0100 | <lambdabot> | f =<< x = x >>= f |
2022-12-03 23:59:44 +0100 | fockerize | (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |