Logs on 2022-12-03 (liberachat/#haskell)
| 00:01:12 | <mauke> | don't need splitOn " "; can just use words instead |
| 00:01:37 | <mauke> | repeated 'us ==' is redundant and could be replaced by pattern matching |
| 00:02:52 | → | Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
| 00:04:04 | <mauke> | getMove is arithmetible |
| 00:05:17 | <mauke> | getMove (them, us) = (them, toEnum ((fromEnum them + fromEnum us - 1) `mod` 3)) |
| 00:06:16 | <seydar> | ah good move |
| 00:08:03 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 255 seconds) |
| 00:08:16 | <mauke> | scoreOutcome (them, us) = (fromEnum us - fromEnum them + 1) `mod` 3 * 3 |
| 00:08:55 | → | sammelweis joins (~quassel@mobile-107-92-122-90.mycingular.net) |
| 00:09:50 | <segfaultfizzbuzz> | geekosaur: ah interesting i didn't know about setting, thanks |
| 00:09:53 | <mauke> | that (... + 1) `mod` 3 thing basically encodes the betterShape relationship |
| 00:11:18 | <Guest60> | If you have a type `a b` is it implied with `Show (a b)` that `b` has the `Show` typeclass? |
| 00:11:26 | <c_wraith> | no |
| 00:12:19 | <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) .... |
| 00:12:26 | <mauke> | data Proxy b = Proxy; instance Show (Proxy b) where { show Proxy = "Proxy" } |
| 00:12:46 | <c_wraith> | If you have a case like that, ghc will infer the transitive dependency |
| 00:12:49 | × | Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 260 seconds) |
| 00:13:15 | <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 |
| 00:13:31 | <Guest60> | Hence the inference |
| 00:13:33 | → | accord joins (uid568320@id-568320.hampstead.irccloud.com) |
| 00:14:09 | <mauke> | .oO( because of the implication ) |
| 00:15:00 | <gqplox> | okay seydar i've done part two |
| 00:15:29 | <gqplox> | http://sprunge.us/i6pvj9 |
| 00:16:03 | <seydar> | mauke: thank you thank you |
| 00:16:14 | <gqplox> | i did some reading on data classes today that's probably why i used them so much haha |
| 00:16:58 | <seydar> | gqplox: ugh your code is so much better than mine. mine is still 58 lines |
| 00:17:55 | <seydar> | the win lose draw datatype is much cleaner than i thought it would be |
| 00:17:58 | <gqplox> | well your code solves both cases i wrote two separate programs so total yours has fewer lines ;) |
| 00:18:10 | <seydar> | and it solves the problem of treating all letters as moves |
| 00:18:12 | <gqplox> | but i didn't really try to code golf i was trying to use data types |
| 00:18:35 | <mauke> | parseShape :: Char -> Shape; parseShape c = toEnum (fromEnum c - fromEnum 'A') |
| 00:18:52 | <gqplox> | i learnt about the record syntax its quite cool how you can change it |
| 00:19:14 | <gqplox> | like getName p = name p if i make the data with record |
| 00:19:45 | <dsal> | gqplox: I wouldn't model a thing that can only have two items as a list. |
| 00:20:14 | <gqplox> | yeah I agree |
| 00:20:19 | <gqplox> | for the [[String]] in solve? |
| 00:20:43 | <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 |
| 00:21:32 | <dsal> | You could still parse it that way if you wanted to, but that doesn't need to escape the parser. |
| 00:21:54 | <gqplox> | sorry what do you mean by that? |
| 00:22:29 | <dsal> | > let p s = case words s of [a,b] -> Just (a,b); _ -> Nothing in (p "a b", p "a b c") |
| 00:22:31 | <lambdabot> | (Just ("a","b"),Nothing) |
| 00:22:34 | <mauke> | case words s of [a, b] -> (a, b); _ -> error ("Well, I certainly wasn't expecting this: " ++ show s) |
| 00:22:35 | <gqplox> | and what would you suggest? have it as a [[(String, String)]? |
| 00:22:47 | <dsal> | They're not strings either, though. |
| 00:23:02 | <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") |
| 00:23:04 | <lambdabot> | (Just ('a','b'),Nothing,Nothing) |
| 00:24:02 | <mauke> | in my version I didn't even bother with 'words'. I just match the whole line against [a, ' ', b] :-) |
| 00:24:41 | <mauke> | means it will abort on any malformed input, but at that point there is no good way to proceed anyway, so :shrug: |
| 00:25:10 | <dsal> | I used megaparsec because I like to spend more time than necessary. |
| 00:25:47 | <dsal> | > let p s = case s of [a, ' ', b] -> Just (a,b); _ -> Nothing in (p "a b", p "a b c", p "a bee") |
| 00:25:48 | <lambdabot> | (Just ('a','b'),Nothing,Nothing) |
| 00:26:51 | <gqplox> | would you mind sending over the complete program mauke or dsal please? |
| 00:27:07 | <dsal> | Based on yours? |
| 00:27:21 | × | sammelweis quits (~quassel@mobile-107-92-122-90.mycingular.net) (Ping timeout: 268 seconds) |
| 00:27:29 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 00:27:29 | <gqplox> | if that wouldn't be too much troubled that'd be great, using your method of parsing |
| 00:27:52 | <dsal> | Sec. |
| 00:28:06 | <dsal> | Oh, I'm using megaparsec. Unless you're wanting to learn megaparsec, don't do that. :) |
| 00:28:47 | <dsal> | hmm... yours is already partial. |
| 00:28:50 | <gqplox> | Oh right, yeah I only have the stdlib (prelude?) |
| 00:28:53 | <dsal> | So I'll lean into that a sec. |
| 00:29:13 | <mauke> | my full code: https://paste.tomsmeding.com/u5htAZuJ |
| 00:29:50 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 00:29:58 | <mauke> | parsing is done with 'lines' and the pattern match in 'score' for each line |
| 00:30:48 | money | is now known as polo |
| 00:31:08 | <gqplox> | oh cool |
| 00:31:22 | <gqplox> | what does ord -> c1 do? |
| 00:31:27 | <mauke> | that's a view pattern |
| 00:31:37 | <dsal> | :t ord |
| 00:31:38 | <lambdabot> | Char -> Int |
| 00:31:48 | <mauke> | it says: take the incoming value, pipe it through the 'ord' function, then pattern match the result against 'c1' |
| 00:32:15 | <gqplox> | oh right nice |
| 00:32:30 | <mauke> | in my version, Shape has been replaced by its Enum instance (i.e. instead of Rock | Paper | Scissors I have 0 | 1 | 2) |
| 00:32:34 | <gqplox> | so it saves you having to write ord c1 each time or doing where c1 = ord? |
| 00:32:38 | <mauke> | right |
| 00:33:06 | <mauke> | also, "parsing" the characters is done with fromEnum (which is ord for Chars) |
| 00:34:04 | <gqplox> | oh cool |
| 00:34:07 | × | seydar quits (~seydar@154-27-113-252.starry-inc.net) (Quit: leaving) |
| 00:34:07 | <gqplox> | yeah that makes sense |
| 00:34:16 | <mauke> | so: shapeFromChar c = toEnum (fromEnum c - fromEnum 'A') |
| 00:34:37 | <mauke> | only I don't have the outer toEnum because I never actually use the Shape values |
| 00:34:46 | <dsal> | This is minimal changes to yours. https://www.irccloud.com/pastebin/dUC7zGuy/day2.hs |
| 00:34:56 | <mauke> | and I was too lazy to type fromEnum, so I used ord instead |
| 00:34:59 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 260 seconds) |
| 00:35:02 | <dsal> | I'd avoid partial here, though. |
| 00:36:00 | <mauke> | also I never actually need to subtract ord 'A' because it is merged with the rest of the calculation |
| 00:36:35 | <mauke> | > (-1) `mod` 3 |
| 00:36:36 | <lambdabot> | 2 |
| 00:36:38 | <mauke> | good |
| 00:37:37 | <dsal> | Here's a variation of yours that doesn't have partial functions. https://www.irccloud.com/pastebin/jLoy9DIF/total.hs |
| 00:38:58 | <mauke> | I think that's strictly worse than the partial version |
| 00:39:04 | <dsal> | Why's that? |
| 00:39:15 | <mauke> | it silently produces wrong results for malformed input |
| 00:39:22 | <mauke> | my version just crashes |
| 00:39:33 | <dsal> | It returns 0 which I guess is silently wrong. |
| 00:39:51 | <mauke> | yeah, it pretends it has a sensible answer when it really doesn't |
| 00:39:59 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 255 seconds) |
| 00:40:05 | <EvanR> | if you never pass in a bad input to a partial function, it's not partial xD |
| 00:40:07 | <dsal> | In practice, I'd push the Maybe all the way down. |
| 00:40:27 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 00:40:52 | <dsal> | So `part2 = fmap solve . traverse parse . lines <$> readFile "input/day2"` |
| 00:41:00 | <dsal> | In any case, partial functions just hurt later. |
| 00:41:49 | <mauke> | you could argue that in some cases the partial function is still better |
| 00:42:37 | <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 |
| 00:42:53 | <mauke> | with the Maybe version you just end up with Nothing |
| 00:42:57 | <mauke> | and no idea what went wrong |
| 00:43:27 | <dsal> | Well, I guess you could use either, then. https://www.irccloud.com/pastebin/FRqgV2Qn/either.hs |
| 00:43:52 | <dsal> | I can't argue that crashing is good, though. Crashing means I have angry customers. |
| 00:44:08 | <mauke> | why? |
| 00:44:21 | <geekosaur> | AoC is a different story there, I think |
| 00:44:50 | <mauke> | "crashing" is implicitly bounded by process structure |
| 00:44:57 | <mauke> | don't put all your eggs in one process :-) |
| 00:45:35 | <dsal> | Well, I don't use erlang at work right now and microservices are almost always a bad idea. |
| 00:46:25 | <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. |
| 00:47:02 | <gqplox> | Thank you very mcuh dsal |
| 00:47:15 | <gqplox> | the parse is way nicery |
| 00:47:19 | <gqplox> | nicer |
| 00:47:28 | <gqplox> | uncurry is very cool too |
| 00:47:51 | → | merijn joins (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
| 00:48:47 | <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" |
| 00:49:14 | <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. |
| 00:49:51 | <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? |
| 00:50:34 | <dsal> | A lot of aoc is practice for me, and I don't want to practice making runtime errors. :) |
| 00:50:36 | <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" |
| 00:50:41 | <dsal> | Depends on what you want to get out of it. |
| 00:51:14 | <gqplox> | what do you mean maybe loses some information you want later? |
| 00:51:39 | <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. |
| 00:52:08 | <gqplox> | Oh cool I didn't even see you posted that |
| 00:52:09 | <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'"` |
| 00:52:15 | <gqplox> | Yeah that's much more robust |
| 00:52:16 | → | nate4 joins (~nate@98.45.169.16) |
| 00:52:30 | <gqplox> | Cool |
| 00:53:03 | <dsal> | I don't bother most of the time. |
| 00:53:10 | <mauke> | it all depends on context |
| 00:53:30 | × | tremon quits (~tremon@83-84-18-241.cable.dynamic.v4.ziggo.nl) (Quit: getting boxed in) |
| 00:53:33 | <hpc> | there's a context-free grammar joke in there somewhere :D |
| 00:53:54 | <mauke> | partial functions should be avoided if there's something sensible you can do instead |
| 00:54:09 | <mauke> | but you should not hide failures just to keep the program going |
| 00:54:12 | <mauke> | that way lies PHP |
| 00:54:15 | <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 |
| 00:54:36 | <hpc> | there's always something sensible to do, as well imo |
| 00:55:00 | <mauke> | yes, it just depends on how much effort you're willing to put in |
| 00:57:09 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
| 00:59:10 | → | mvk joins (~mvk@2607:fea8:5ce3:8500::efb) |
| 00:59:17 | × | mvk quits (~mvk@2607:fea8:5ce3:8500::efb) (Client Quit) |
| 00:59:36 | <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." |
| 01:00:43 | <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. |
| 01:01:00 | <mauke> | that's a good point |
| 01:01:11 | <mauke> | libraries aren't allowed to crash the main program |
| 01:01:14 | <mauke> | that's illegal |
| 01:03:30 | → | Buliarous joins (~gypsydang@46.232.210.139) |
| 01:04:12 | × | Guest60 quits (~Guest60@101.98.118.246) (Quit: Client closed) |
| 01:05:48 | <gqplox> | print $ solve $ map parse $ lines input |
| 01:05:48 | <gqplox> | (print . solve . map parse . lines) input |
| 01:05:56 | <gqplox> | which is preferred? |
| 01:08:11 | <mauke> | print . solve . map parse . lines $ input -- compromise :-) |
| 01:08:17 | <dsal> | Yeah, I'd go with that ^ |
| 01:08:36 | <dsal> | I do the second one sometimes. I don't like throwing $ all over the place, though. My code's cheap. |
| 01:08:49 | <gqplox> | ahh nice |
| 01:08:53 | <gqplox> | i don't know why i didn't think of that |
| 01:09:25 | <dsal> | Though I'd probably not mix the print and other stuff just because it makes things harder to test. |
| 01:09:47 | <dsal> | I don't have main on these, though. My actual execution is `unit_part2 = assertEqual "" 10349 =<< part2` |
| 01:09:54 | <mauke> | the . version has the advantage that you can extract subexpressions (and make e.g. `map parse . lines` its own function) |
| 01:10:08 | <mauke> | `map parse $ lines` is just an error |
| 01:10:16 | × | Topsi quits (~Topsi@dyndsl-031-150-076-205.ewe-ip-backbone.de) (Read error: Connection reset by peer) |
| 01:10:27 | <gqplox> | oh right nice that's a good point |
| 01:11:24 | <gqplox> | also it might be trivial but generally which way to order functions? |
| 01:11:37 | <dsal> | total ordering of functions is the best |
| 01:11:40 | <gqplox> | like in here for example, http://sprunge.us/npXAnG. is it good to keep main at the top |
| 01:11:52 | <gqplox> | oh i meant positions oops |
| 01:11:55 | <dsal> | I've always done main at the bottom, but it doesn't matter unless you use TH |
| 01:12:05 | <gqplox> | TH? |
| 01:12:28 | <dsal> | TemplateHaskell |
| 01:12:45 | <dsal> | It breaks the file into chunks with boundaries defined by TH expressions and you can't refer to stuff in The Future |
| 01:13:10 | <geekosaur> | because it runs code at compile time, so it hasn't seen the rest of the file yet |
| 01:14:38 | <dsal> | > let options = zip "abc" [1..] <> zip "xyz" [1..] in lookup 'y' options |
| 01:14:40 | <lambdabot> | Just 2 |
| 01:17:16 | × | Tuplanolla quits (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) (Quit: Leaving.) |
| 01:17:31 | × | gqplox quits (~textual@2a02:c7c:941d:fd00:84dc:e5:8d89:ecd6) (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
| 01:18:05 | <dsal> | > let options = zip "abc" [1..] <> zip "xyz" [1..]; lu x = maybe (Left $ "wtf is " <> show x) Right (lookup x options) in lu 'y' |
| 01:18:07 | <lambdabot> | Right 2 |
| 01:18:21 | <dsal> | > let options = zip "abc" [1..] <> zip "xyz" [1..]; lu x = maybe (Left $ "wtf is " <> show x) Right (lookup x options) in lu 'w' |
| 01:18:22 | <lambdabot> | Left "wtf is 'w'" |
| 01:20:28 | <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 |
| 01:20:29 | <lambdabot> | Right Paper |
| 01:20:30 | → | gqplox joins (~textual@2a02:c7c:941d:fd00:84dc:e5:8d89:ecd6) |
| 01:20:54 | → | fieldbuck_ joins (~fieldbuck@mobile-access-c1d2a3-227.dhcp.inet.fi) |
| 01:21:02 | <fieldbuck_> | i am so angry because you don't live in midwest |
| 01:21:25 | × | jao quits (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) (Ping timeout: 260 seconds) |
| 01:21:37 | <tomokojun> | what is lambdabot doing? |
| 01:22:06 | <fieldbuck_> | he is being a donald trump supporter |
| 01:22:22 | <dsal> | tomokojun: gqplox Has a partial pattern matching function for parsing characters to shapes. I'm just making a list and using lookup. |
| 01:22:51 | × | merijn quits (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 268 seconds) |
| 01:23:08 | <dsal> | > let options = zip "abc" [minBound..] <> zip "xyz" [minBound..]; lu x = lookup x options in lu 'y' :: Maybe Shape |
| 01:23:10 | <lambdabot> | Just Paper |
| 01:23:15 | <dsal> | Bit easier without the Either. |
| 01:23:54 | <fieldbuck_> | that pattern matching would be much easier to write in c or c++' |
| 01:24:10 | <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 |
| 01:24:12 | <lambdabot> | Just Paper |
| 01:24:45 | ChanServ | sets mode +o geekosaur |
| 01:24:46 | <dsal> | > let options = foldMap (flip zip [minBound..]) ["abc", "xyz"]; lu x = lookup x options in lu 'y' :: Maybe Shape -- this is a little nicer |
| 01:24:47 | <lambdabot> | Just Paper |
| 01:25:09 | <dsal> | gqplox is supposed to be asleep and not seeing this anyway. |
| 01:25:13 | <fieldbuck_> | EVEN CSHARP HAS MAYBE KEYWORD |
| 01:25:23 | geekosaur | sets mode +b *!*@mobile-access-c1d2a3-227.dhcp.inet.fi |
| 01:25:23 | fieldbuck_ | is kicked by geekosaur (fieldbuck_) |
| 01:26:01 | geekosaur | sets mode -o geekosaur |
| 01:26:53 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 01:28:51 | → | Guest60 joins (~Guest60@101.98.118.246) |
| 01:28:59 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 01:28:59 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 01:28:59 | → | wroathe joins (~wroathe@user/wroathe) |
| 01:29:01 | <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? |
| 01:29:13 | <geekosaur> | <|> |
| 01:30:48 | <Guest60> | Oh wow, that's extremely simple. |
| 01:31:01 | <geekosaur> | more generally, asum takes a list of such and returns the first successful result |
| 01:32:46 | × | gqplox quits (~textual@2a02:c7c:941d:fd00:84dc:e5:8d89:ecd6) (Quit: Textual IRC Client: www.textualapp.com) |
| 01:33:19 | <Guest60> | very handy, How is <|> expressed for Either? |
| 01:33:52 | <geekosaur> | > Left "oops" <|> Right 5 |
| 01:33:54 | <lambdabot> | Right 5 |
| 01:34:05 | <geekosaur> | otherwise I don't understand the question |
| 01:34:43 | <geekosaur> | `<|>` works for anything with an Alternative instance, including `Either String` |
| 01:35:28 | <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. |
| 01:35:53 | ChanServ | sets mode +o litharge |
| 01:35:53 | litharge | sets mode -bo *!*@mobile-access-c1d2a3-227.dhcp.inet.fi litharge |
| 01:36:24 | → | merijn joins (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
| 01:37:46 | <dsal> | Hmm... Either lost some power in the past. I wonder if that's part of it. |
| 01:41:08 | × | merijn quits (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 248 seconds) |
| 01:41:35 | <geekosaur> | actually I don't see anything Either-related for Alternative. so I'm not sure how that worked either |
| 01:41:41 | <geekosaur> | :t (<|>) |
| 01:41:42 | <lambdabot> | Alternative f => f a -> f a -> f a |
| 01:42:00 | <dsal> | Oh, I guess that's not a thing. https://stackoverflow.com/questions/44472008/why-is-there-no-alternative-instance-for-either-but-a-semigroup-that-behaves-sim |
| 01:42:11 | <dsal> | This is something I always expect to be there and then am surprised when I can't find it. |
| 01:42:20 | × | tabaqui quits (~root@88.231.62.215) (Quit: WeeChat 3.7.1) |
| 01:42:55 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 01:43:56 | <dsal> | Oh, `Alternative` has `empty` |
| 01:44:34 | <geekosaur> | yeh |
| 01:44:56 | <geekosaur> | I thought it required a monoid anyway but that's at the wrong level for this |
| 01:45:36 | <dsal> | So, there's Alt. |
| 01:45:40 | <dsal> | :t <!> |
| 01:45:41 | <lambdabot> | error: parse error on input ‘<!>’ |
| 01:45:44 | <dsal> | :t (<!>) |
| 01:45:45 | <lambdabot> | error: |
| 01:45:45 | <lambdabot> | • Variable not in scope: <!> |
| 01:45:45 | <lambdabot> | • Perhaps you meant one of these: |
| 01:45:49 | <dsal> | lerrn |
| 01:46:07 | <dsal> | Oh, that's semigroupoids? Why did I think I had that in base. |
| 01:46:22 | <geekosaur> | people have a lot of wishful thinking about that 🙂 |
| 01:46:42 | <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. |
| 01:48:04 | <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. |
| 01:48:40 | <dsal> | Sometimes there's no alternative. |
| 01:49:09 | <geekosaur> | also, it's in part intended for parsers (hence `some` and `many`) and you need a null parser sometimes |
| 01:49:49 | <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. |
| 01:50:46 | <Guest60> | okay that makes sense. How would you implement the alt logic using base? |
| 01:52:16 | <dsal> | https://hackage.haskell.org/package/semigroupoids-5.3.7/docs/src/Data.Functor.Alt.html#line-188 |
| 01:52:37 | <dsal> | You could just write that function and call it <!> and you'd be done. |
| 01:54:43 | <Guest60> | seems obvious when you look at it haha, thanks |
| 01:59:25 | <EvanR> | :t empty |
| 01:59:26 | <lambdabot> | Alternative f => f a |
| 02:00:43 | <dsal> | > empty :: Either String Int |
| 02:00:45 | <lambdabot> | Left "" |
| 02:00:55 | <dsal> | You could write an Alternative for `Either String` |
| 02:01:26 | <dsal> | > empty :: Either Shape Int |
| 02:01:27 | <lambdabot> | error: |
| 02:01:27 | <lambdabot> | • No instance for (Control.Monad.Trans.Error.Error Shape) |
| 02:01:27 | <lambdabot> | arising from a use of ‘empty’ |
| 02:01:41 | <dsal> | oooh. There's a clue. |
| 02:01:45 | <dsal> | > empty :: Either Int Int |
| 02:01:46 | <lambdabot> | error: |
| 02:01:46 | <lambdabot> | • No instance for (Control.Monad.Trans.Error.Error Int) |
| 02:01:46 | <lambdabot> | arising from a use of ‘empty’ |
| 02:01:59 | × | ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
| 02:02:45 | <dsal> | Yeah, that orphans the Alternative instance. It's deprecated and another thing I want sometimes. |
| 02:02:46 | <EvanR> | Alternative might be more widely applicable if it didn't have empty |
| 02:03:15 | <dsal> | Yeah, that's basically wherefore Alt. |
| 02:03:23 | <dsal> | It seems to have taken people a while to figure out that smaller is better. |
| 02:04:06 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 02:05:49 | <dsal> | I don't even know how to think about `some` and `many` most of the time |
| 02:05:53 | <dsal> | > some :: Maybe Int |
| 02:05:54 | <lambdabot> | error: |
| 02:05:54 | <lambdabot> | • Couldn't match expected type ‘Maybe Int’ |
| 02:05:54 | <lambdabot> | with actual type ‘f0 a0 -> f0 [a0]’ |
| 02:06:35 | <dsal> | > some (Just 1) :: Maybe [Int] |
| 02:06:37 | <lambdabot> | *Exception: <<loop>> |
| 02:07:24 | → | merijn joins (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
| 02:08:20 | × | tinwood quits (~tinwood@canonical/tinwood) (Remote host closed the connection) |
| 02:10:46 | <pavonia> | What do you do with the Advent of Code leaderboard code in the topic? |
| 02:10:51 | → | razetime joins (~quassel@49.207.211.219) |
| 02:11:20 | → | tinwood joins (~tinwood@general.default.akavanagh.uk0.bigv.io) |
| 02:11:20 | × | tinwood quits (~tinwood@general.default.akavanagh.uk0.bigv.io) (Changing host) |
| 02:11:20 | → | tinwood joins (~tinwood@canonical/tinwood) |
| 02:11:31 | <dsal> | paste it into https://adventofcode.com/2022/leaderboard/private |
| 02:11:41 | <EvanR> | if you click Leaderboard then Private Leaderboard, you get a box to paste it into |
| 02:12:58 | × | merijn quits (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 02:13:29 | <pavonia> | I'm redirected to https://adventofcode.com/2022/leaderboard when clicking on that link |
| 02:13:54 | <pavonia> | And I don't see any prvate link or similar on that page |
| 02:14:08 | <dsal> | Are you logged in? |
| 02:14:34 | <pavonia> | No |
| 02:15:03 | <pavonia> | Can't you access them without being registered? |
| 02:15:20 | <geekosaur> | presumably that's what "private" means |
| 02:15:47 | <EvanR> | if you're not logged in, how does it know who to add to the leaderboard |
| 02:16:08 | <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-and-its-relationship-to |
| 02:17:09 | <pavonia> | geekosaur: I see |
| 02:23:36 | → | merijn joins (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
| 02:25:44 | <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. |
| 02:25:53 | <EvanR> | I was joking |
| 02:26:26 | <EvanR> | it's 10 pages of algebra with 3 instances of assertions that "it's useful" |
| 02:26:34 | <EvanR> | without much to back it up |
| 02:31:45 | → | ddellacosta joins (~ddellacos@89.45.224.153) |
| 02:31:55 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 268 seconds) |
| 02:34:30 | <EvanR> | many (randomRIO (0,1) >>= \x -> case x of 0 -> putChar 'a'; 1 -> empty) |
| 02:34:48 | <EvanR> | aaaaaaaaaa[(),(),(),(),(),(),(),(),(),()] -- winner winner chicken dinner |
| 02:36:14 | <EvanR> | many (Just 'a'), using the same logic, never ends and never yields anything sooner than that |
| 02:36:49 | <geekosaur> | right |
| 02:37:08 | <geekosaur> | I mentioned earlier that they make the most sense in the context of parsers |
| 02:38:08 | <EvanR> | s/never ends/never fails, so never ends/ |
| 02:38:13 | <geekosaur> | `many` keeps doing <|> until the parser fails, `some` requires it to succeed at least once before failing |
| 02:38:27 | <geekosaur> | er, kinda the opposite of <|> I guess |
| 02:38:41 | <geekosaur> | and collects the successes |
| 02:41:37 | <EvanR> | but... IO is clearly collecting the successes and would return an infinite list if you let it. Why doesn't Just 'a'... |
| 02:42:41 | <EvanR> | is there something wrong with this theory of collecting the successes |
| 02:42:46 | <geekosaur> | its instance doesn't know when it would fail (throw an exception, iirc) |
| 02:42:57 | <geekosaur> | Just 'a' will never fail |
| 02:43:38 | × | razetime quits (~quassel@49.207.211.219) (Ping timeout: 268 seconds) |
| 02:43:55 | <geekosaur> | I don't know what the implementation is that causes it to <<loop>> though |
| 02:44:04 | <EvanR> | oh, my IO is not returning an infinite list after all, if it doesn't ever fail |
| 02:44:47 | <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. |
| 02:44:48 | <EvanR> | IO and Maybe aren't very lazy |
| 02:45:03 | <EvanR> | here |
| 02:45:35 | <EvanR> | the full list is only available upon failure |
| 02:45:49 | <EvanR> | the beginning of the list even |
| 02:46:22 | <dsal> | It just seems weird to me that it must not be useful. |
| 02:46:44 | <geekosaur[m]> | > empty:: IO () |
| 02:46:45 | <lambdabot> | <IO ()> |
| 02:46:59 | <geekosaur[m]> | Oh right |
| 02:47:27 | <EvanR> | user error (mzero) |
| 02:58:18 | × | merijn quits (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 03:00:05 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 03:00:33 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 03:01:21 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:02:15 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 03:07:09 | × | haritz quits (~hrtz@user/haritz) (Remote host closed the connection) |
| 03:07:19 | <Guest60> | Is there any way I can remove the lambda from this expression? `\a -> return $ f t a` |
| 03:08:01 | <davean> | pure . f t |
| 03:09:56 | <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 |
| 03:10:25 | <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? |
| 03:10:47 | → | haritz joins (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) |
| 03:10:47 | × | haritz quits (~hrtz@2a02:8010:65b5:0:6009:6384:e3cb:2220) (Changing host) |
| 03:10:47 | → | haritz joins (~hrtz@user/haritz) |
| 03:10:48 | <Guest60> | Thanks EvanR, that factorisation clears it up a bit |
| 03:10:53 | <davean> | Its knowing what is going on |
| 03:11:22 | <davean> | There are only one argument functions. |
| 03:13:04 | × | kadobanana quits (~mud@user/kadoban) (Ping timeout: 260 seconds) |
| 03:13:20 | <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? |
| 03:14:20 | <davean> | Read the docs |
| 03:14:31 | <davean> | What does it say? |
| 03:15:09 | <Guest60> | oh right my bad |
| 03:16:16 | <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? |
| 03:16:39 | <EvanR> | logically yes, culturally maybe not |
| 03:16:48 | <davean> | yes, return is just a restricted version of pure, its legacy. Theres no reason for it to exist anymore. |
| 03:17:18 | <EvanR> | it's like meters vs feet, there's no reason for feet to exist |
| 03:17:52 | <davean> | and like pure and return, feet are defined in terms of meters |
| 03:18:01 | <Guest60> | So logically, yes, you might as well express something more generally, but culturally no, if it helps express code intention then be specific? |
| 03:18:21 | <EvanR> | return is still used in a lot of tutorials and makes it clear we're talking monads right now |
| 03:18:28 | <davean> | It would shock me to find someone who thoguht return made anything clearer |
| 03:18:45 | <davean> | EvanR: I think that is only because they haven't been updated.\ |
| 03:20:00 | <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? |
| 03:20:09 | <EvanR> | sometimes I think changing random code that uses return into pure is too aggressive |
| 03:20:28 | <EvanR> | like if you barged into someone elses project and changed all their indentation |
| 03:20:45 | → | money joins (~money@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 03:20:51 | money | is now known as Guest9300 |
| 03:21:06 | <EvanR> | truth is people have to know pure and return both |
| 03:21:38 | <davean> | have to know, because we haven't reduced the legacy, but using return makes your code clearly worse |
| 03:21:53 | <EvanR> | does it |
| 03:22:03 | <EvanR> | is there some kind of performance thing |
| 03:22:05 | <davean> | yes |
| 03:22:20 | <davean> | That monad constraint isn't free. It must be coherent with Applicative but it adds requirements. |
| 03:22:25 | × | Guest9300 quits (~money@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host) |
| 03:22:25 | → | Guest9300 joins (~money@user/polo) |
| 03:22:36 | <davean> | requirements that can't be useful to pure |
| 03:22:40 | <EvanR> | well if you're doing applicative only code yeah you would use pure |
| 03:22:42 | Guest9300 | is now known as money |
| 03:22:54 | <davean> | when you use return you force code up to monad |
| 03:23:16 | <davean> | A lot of monadic code can be applicative if you stop using reutrn |
| 03:23:20 | <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" |
| 03:23:29 | <davean> | And, improtantly, regions of it can be applicative |
| 03:23:31 | <EvanR> | (ignoring ApplicativeDo for a second) |
| 03:23:40 | <davean> | EvanR: Theres no such thing. |
| 03:23:49 | <davean> | EvanR: you're carrying the extra constraint *on that line of code* |
| 03:23:49 | <EvanR> | there's no such what |
| 03:24:03 | <davean> | the use of pure couldn't have required Monad |
| 03:24:13 | <davean> | Other code might, but THAT piece couldn't |
| 03:24:16 | <davean> | and that MATTERS |
| 03:24:25 | <EvanR> | if changing 1 return to pure drops a monad constraint everywhere, it's applicative code |
| 03:24:45 | <davean> | It ALWAYS drops the Monad constraint *on that usage* |
| 03:25:00 | <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 |
| 03:25:09 | <davean> | Incorrect |
| 03:25:13 | <davean> | Completely incorrect |
| 03:25:29 | <EvanR> | ghc deals in "lines of code" now? xD |
| 03:25:35 | <davean> | GHC deals with functions |
| 03:25:41 | <davean> | and that function call changes |
| 03:26:15 | <davean> | It doesn't have this concept of a larger context you're putting on it |
| 03:26:19 | <EvanR> | are you saying using a Monad instance has different performance from using Applicative instance |
| 03:26:27 | <davean> | Absolutely |
| 03:26:28 | <EvanR> | like, when using return / pure |
| 03:27:11 | <davean> | Applicative isn't ordered. |
| 03:27:24 | <EvanR> | the results of pure aren't ordered either |
| 03:27:32 | <EvanR> | or return |
| 03:27:49 | <davean> | How it is allowed to be combined with other code is. |
| 03:28:26 | <davean> | EvanR: So there are things like https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/applicative_do.html |
| 03:29:08 | <davean> | That might be illustrative |
| 03:29:14 | <EvanR> | so if you have a bunch of monadic code, you think changing one of the returns to pure is going to matter |
| 03:29:28 | <davean> | it can |
| 03:29:29 | <EvanR> | actual monad code, not ApplicativeDo |
| 03:30:06 | → | kadobanana joins (~mud@user/kadoban) |
| 03:30:25 | <davean> | It depends on the code, but there is no sensible reason to use return and it can hurt regularly. |
| 03:30:46 | <davean> | How it relates to exactly one other thing matters |
| 03:30:46 | × | gentauro quits (~gentauro@user/gentauro) (Read error: Connection reset by peer) |
| 03:30:59 | × | accord quits (uid568320@id-568320.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 03:30:59 | <davean> | The overall picture isn't particularly relivent |
| 03:31:13 | <davean> | EACH INTERACTION is where things operate at |
| 03:31:26 | <davean> | Sure, the entire function might be monadic, but half of it might not be |
| 03:31:32 | <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 |
| 03:32:06 | <davean> | EvanR: They're different constraints, but you can know the constraint doesn't matter |
| 03:32:12 | <davean> | return was a complete mistake |
| 03:32:15 | <EvanR> | i.e. since return should = pure, why isn't the compiler exploiting that |
| 03:32:37 | <davean> | EvanR: should doesn't mean it does |
| 03:32:48 | <davean> | Thats why MonadOfNoreturn |
| 03:33:02 | → | rcharles joins (~user@pool-71-166-43-226.bltmmd.fios.verizon.net) |
| 03:33:21 | <davean> | https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/monad-of-no-return |
| 03:33:23 | <EvanR> | it makes sense as a cultural movement |
| 03:33:41 | <EvanR> | one day we might see return go bye bye |
| 03:34:06 | <davean> | No, it makes sense from a correctness and optimization standpoint |
| 03:34:08 | → | nattiestnate joins (~nate@202.138.250.46) |
| 03:35:55 | <EvanR> | now return is incorrect too? xD |
| 03:36:11 | × | nattiestnate quits (~nate@202.138.250.46) (Client Quit) |
| 03:36:13 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:36:13 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 03:36:13 | finn_elija | is now known as FinnElija |
| 03:36:17 | → | gentauro joins (~gentauro@user/gentauro) |
| 03:36:19 | <davean> | Yes, its exist can only be to allow incorrect code |
| 03:37:00 | <davean> | Thats the problem with it and why we lose a lot when it is used |
| 03:37:02 | <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 |
| 03:37:23 | <davean> | Oh? |
| 03:37:28 | <EvanR> | which exist in isolation from Applicative |
| 03:38:35 | <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! |
| 03:38:36 | <davean> | but Monad hasn't changed. |
| 03:39:06 | <davean> | Monad includes Applicative |
| 03:39:30 | <EvanR> | you never hear about applicative functor when reading intro material about monads (CT) |
| 03:39:54 | <davean> | Sure, because that break out isn't a CT relivent thing. But the Haskell Monad class still ahs everything it ever had. |
| 03:40:12 | <EvanR> | oh ok |
| 03:40:32 | <davean> | Well in CT I think they're lax monoidal functors? |
| 03:40:35 | <davean> | IIRC |
| 03:40:49 | <EvanR> | correction, the Monad class would be missing return |
| 03:40:52 | <davean> | I'd have to double check. |
| 03:40:56 | <davean> | No, it wouldn't! |
| 03:41:01 | <davean> | it wouldn't be missign return |
| 03:41:17 | <EvanR> | which proposal are we talking about now |
| 03:41:23 | <davean> | MonadOfNoReturn |
| 03:41:37 | <EvanR> | it says right there under proposal return would be removed |
| 03:42:08 | <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. |
| 03:42:21 | <davean> | FROM THE TYPE CLASS, Monad would still have return. |
| 03:42:45 | → | king_gs joins (~Thunderbi@2806:103e:29:94a4:81e0:429b:22ec:cf13) |
| 03:42:48 | <davean> | and now return would actually be correct. |
| 03:42:50 | <maerwald[m]> | Monad requires applicative? |
| 03:42:58 | <EvanR> | now a days yeah |
| 03:43:01 | <maerwald[m]> | Isn't that against the spec, |
| 03:43:19 | <davean> | class Applicative m => Monad m where |
| 03:43:55 | <EvanR> | why not define return, in that proposal, to have type Applicative m => a -> m a |
| 03:44:04 | <maerwald[m]> | https://www.haskell.org/onlinereport/haskell2010/haskellch6.html#x13-1270006.3 |
| 03:44:10 | <maerwald[m]> | Yes, it's against the spec |
| 03:44:20 | × | rcharles quits (~user@pool-71-166-43-226.bltmmd.fios.verizon.net) (Ping timeout: 260 seconds) |
| 03:44:33 | <EvanR> | wait, nevermind that |
| 03:44:44 | <davean> | EvanR: Oh you can have it as that yes :) |
| 03:44:51 | <maerwald[m]> | And so is monad of no return |
| 03:45:11 | <maerwald[m]> | Not that anyone cares about the spec anymore |
| 03:45:12 | <davean> | maerwald[m]: Thats why we update thing. Or depricate them |
| 03:45:13 | <EvanR> | we have a history of proposals which break things |
| 03:45:26 | → | nate4 joins (~nate@98.45.169.16) |
| 03:45:34 | <EvanR> | creative destruction |
| 03:45:42 | <maerwald[m]> | Often useless |
| 03:46:01 | <davean> | Its a rather bad spec really sadly. I'd had hopes for Haskell2020 |
| 03:47:36 | × | king_gs quits (~Thunderbi@2806:103e:29:94a4:81e0:429b:22ec:cf13) (Ping timeout: 256 seconds) |
| 03:47:45 | <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 |
| 03:47:55 | <EvanR> | sounds like project management witchcraft to me |
| 03:48:08 | <EvanR> | some wise person is guiding the ship |
| 03:49:35 | × | td_ quits (~td@83.135.9.0) (Ping timeout: 252 seconds) |
| 03:51:34 | → | td_ joins (~td@83.135.9.32) |
| 03:51:36 | → | azimut_ joins (~azimut@gateway/tor-sasl/azimut) |
| 03:51:54 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 03:57:44 | → | causal joins (~user@50.35.83.177) |
| 03:59:25 | → | Kaiepi joins (~Kaiepi@108.175.84.104) |
| 03:59:30 | × | xff0x quits (~xff0x@ai071162.d.east.v6connect.net) (Ping timeout: 256 seconds) |
| 04:12:10 | → | xff0x joins (~xff0x@ai071162.d.east.v6connect.net) |
| 04:13:02 | → | Feuermagier joins (~Feuermagi@user/feuermagier) |
| 04:21:50 | <iqubic> | What's the minimum version of GHC needed to use Haskell2020? |
| 04:24:53 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 04:30:12 | → | TonyStone joins (~TonyStone@cpe-74-76-57-186.nycap.res.rr.com) |
| 04:30:40 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
| 04:39:15 | × | Unicorn_Princess quits (~Unicorn_P@user/Unicorn-Princess/x-3540542) (Quit: Leaving) |
| 04:41:11 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 265 seconds) |
| 04:43:53 | <maerwald[m]> | iqubic: there is no Haskell2020 |
| 04:43:59 | → | zant joins (~zant@62.214.20.26) |
| 04:44:28 | → | Lord_of_Life joins (~Lord@user/lord-of-life/x-2819915) |
| 04:45:09 | <Guest60> | How would I approach a function like this? `Semigroup b => [Either a b] -> Either [a] b` |
| 04:45:51 | <maerwald[m]> | Guest60: homework? |
| 04:45:52 | <Guest60> | Where I either have all of the lefts or if there are no lefts, all of the rights combined? |
| 04:46:02 | <Guest60> | Not homework |
| 04:47:16 | <EvanR> | so basically, Semigroup b => [Either a b] -> Either (NonEmpty a) b |
| 04:47:34 | <EvanR> | more accurate type might help |
| 04:47:57 | <EvanR> | then you could go back to a list if you don't really care, but the same algorithm will work |
| 04:47:58 | <maerwald[m]> | Semantics are not clear to me |
| 04:48:23 | <maerwald[m]> | [Right a, Left b, Left b]. ..what shall be the output? |
| 04:48:27 | <Guest60> | yes, the NonEmpty is more accurate |
| 04:48:48 | <EvanR> | if there's at least one Left, map fromLeft |
| 04:48:49 | <Guest60> | [Left b, Left b] |
| 04:48:49 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 04:49:01 | <EvanR> | otherwise sconcat . map fromRight |
| 04:49:07 | <iqubic> | maerwald[m]: Oh? Isn't there like, a cabal language option that is GHC2020? Can't I just set that? |
| 04:49:26 | <maerwald[m]> | iqubic: yes, GHC2020, not Haskell2020 |
| 04:49:32 | <EvanR> | except what I said will crash |
| 04:49:56 | <EvanR> | Guest60, you could "brute force" this by using partitionEithers from Data.Either |
| 04:49:57 | <iqubic> | What's the minimum GHC version required for GHC2020? |
| 04:50:22 | <EvanR> | case analysis on the two partitions |
| 04:50:43 | <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 |
| 04:51:00 | <EvanR> | it doesn't seem particularly patterny |
| 04:51:30 | <EvanR> | or efficient, you have to check the whole list for lefts before doing anything |
| 04:52:06 | <iqubic> | Is partitionEithers just the Either version of catMaybes :: [Maybe a] -> [a]? |
| 04:52:14 | <EvanR> | :t partitionEithers |
| 04:52:15 | <lambdabot> | [Either a b] -> ([a], [b]) |
| 04:52:24 | <EvanR> | kinda of |
| 04:53:19 | <Guest60> | I suppose partitionEithers is fine considering I'd need to process all of them anyway for the logic to work |
| 04:53:20 | <pavonia> | partitionMaybes :: [Maybe a] -> ([()], [a]) |
| 04:54:22 | <pavonia> | And then catMaybes = snd . partitionMaybes |
| 04:54:29 | × | gawen quits (~gawen@user/gawen) (Quit: cya) |
| 04:55:17 | <iqubic> | Is there a thing called mapEithers :: (a -> c) -> (b -> d) -> [Either a b] -> [Either c d] |
| 04:55:41 | <iqubic> | Wait... that's just "\f g xs -> map (bimap f g) xs" |
| 04:55:50 | → | gawen joins (~gawen@user/gawen) |
| 04:55:50 | <maerwald[m]> | Guest60: consider using These |
| 04:56:16 | <iqubic> | These is like Either, but also gives you the option of having Both |
| 04:59:33 | <EvanR> | that's bimap from Bifunctor |
| 04:59:34 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
| 04:59:46 | <iqubic> | Yeah, I got that now |
| 05:16:34 | × | ddellacosta quits (~ddellacos@89.45.224.153) (Ping timeout: 268 seconds) |
| 05:19:14 | <c_wraith> | notable sudden channel silence at midnight EST. "odd", I saw as if I don't know exactly why... |
| 05:19:29 | <c_wraith> | *say |
| 05:20:22 | <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. |
| 05:21:05 | <c_wraith> | Do you want a Float specifically? Or just some representation of a lot of values between 0 and 1? |
| 05:25:30 | <famubu[m]> | The exact value is needed. Or some way to convert to that value. |
| 05:26:34 | polo | is now known as Guest6586 |
| 05:26:35 | × | Guest6586 quits (money@user/polo) (Killed (cadmium.libera.chat (Nickname regained by services))) |
| 05:26:35 | money | is now known as polo |
| 05:27:44 | <EvanR> | smart constructors for this are probably good |
| 05:28:04 | <EvanR> | the checking is at construction time but it will still be right |
| 05:28:32 | <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. |
| 05:29:41 | <c_wraith> | also, someone here (merijn?) has a nice package for checking smart constructors of literals at compile time. |
| 05:30:26 | <c_wraith> | yeah, it is merijn: https://hackage.haskell.org/package/validated-literals |
| 05:31:11 | <famubu[m]> | Thanks! Let me check that out. |
| 05:32:31 | <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? |
| 05:32:39 | → | mbuf joins (~Shakthi@49.204.140.192) |
| 05:33:02 | → | nihonium joins (~nihonium@91.193.176.241) |
| 05:33:07 | <c_wraith> | Nothing I'm aware of means that sort of thing |
| 05:35:53 | <int-e> | . o O ( type Convert a b = a -> b ) |
| 05:37:31 | <int-e> | Sometimes a type class is so generic that it's better not to have it. We do have first-class functions. |
| 05:38:38 | × | Guest60 quits (~Guest60@101.98.118.246) (Quit: Client closed) |
| 05:40:26 | <c_wraith> | I probably would have thrown a functional dependency on the class |
| 05:47:10 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
| 05:48:06 | × | polo quits (~money@user/polo) (Quit: Textual IRC Client: www.textualapp.com) |
| 05:48:43 | <famubu[m]> | 👍️ |
| 05:48:52 | → | money joins (~money@user/polo) |
| 05:50:49 | × | money quits (~money@user/polo) (Client Quit) |
| 05:51:09 | → | money joins (~money@user/polo) |
| 05:53:44 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 05:56:01 | → | merijn joins (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
| 05:56:05 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 05:56:14 | × | nihonium quits (~nihonium@91.193.176.241) (Ping timeout: 256 seconds) |
| 05:59:24 | → | redmp joins (~redmp@mobile-166-171-250-195.mycingular.net) |
| 06:01:25 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 260 seconds) |
| 06:04:33 | <dsal> | famubu[m]: Foldable? |
| 06:05:12 | <dsal> | Though that sounds a bit more like an anamorphism. |
| 06:13:46 | → | aeroplane joins (~user@user/aeroplane) |
| 06:17:57 | × | money quits (~money@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 06:19:17 | → | Guest60 joins (~Guest60@101.98.118.246) |
| 06:25:03 | → | Guest6586 joins (Guest6586@id-532813.tinside.irccloud.com) |
| 06:28:28 | × | redmp quits (~redmp@mobile-166-171-250-195.mycingular.net) (Ping timeout: 252 seconds) |
| 06:29:40 | × | merijn quits (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 06:29:56 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 06:31:12 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 06:35:41 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 06:38:01 | × | Guest6586 quits (Guest6586@id-532813.tinside.irccloud.com) (Changing host) |
| 06:38:01 | → | Guest6586 joins (Guest6586@user/polo) |
| 06:40:15 | → | redmp joins (~redmp@mobile-166-171-250-195.mycingular.net) |
| 06:42:29 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 260 seconds) |
| 06:43:32 | Guest6586 | is now known as money |
| 06:45:11 | <Guest60> | How can I pattern match an array of strings on `Aeson.Types.Value` ? |
| 06:46:18 | <c_wraith> | You generally wouldn't. |
| 06:46:36 | <c_wraith> | I mean, you *could*, but it would be really awkward. |
| 06:47:01 | <Guest60> | My goal is to define an instance of FromJSON which matches on a string or an array of strings |
| 06:47:28 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 06:47:42 | <c_wraith> | You can match on the Array constructor and then do whatever with the Vector it contains |
| 06:48:34 | <c_wraith> | The big issue being that it's a Vector Value, and you need to deal with all the possible types of Value |
| 06:49:29 | × | redmp quits (~redmp@mobile-166-171-250-195.mycingular.net) (Ping timeout: 260 seconds) |
| 06:50:57 | → | redmp joins (~redmp@mobile-166-171-250-195.mycingular.net) |
| 06:51:24 | <Guest60> | What does a pattern match on a vector look like? |
| 06:51:34 | <c_wraith> | It usually doesn't. |
| 06:51:35 | → | zant joins (~zant@62.214.20.26) |
| 06:52:25 | <c_wraith> | Vector is an opaque type. You work with the functions it provides. |
| 06:52:52 | <c_wraith> | (or possibly with the OverloadedLists extension, but that's awkward at best) |
| 06:53:28 | <Guest60> | Does a vector contain only one type? If so, how do I see which type it has |
| 06:54:03 | <iqubic> | Is there a good way to write a function of the type "(a,a) -> [a]"? |
| 06:55:05 | <int-e> | . o O ( const [] ) |
| 06:56:11 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 255 seconds) |
| 06:56:36 | <iqubic> | Yes, that works, but it gets rid of the data. |
| 06:56:46 | <int-e> | \(a,b) -> [a,b,b,a,b,a,a,b] |
| 06:56:54 | <iqubic> | I want the output to be a two element list. |
| 06:57:01 | <int-e> | \(a,b) -> [a,a] |
| 06:57:05 | <int-e> | :-P |
| 06:57:20 | × | son0p quits (~ff@2604:3d08:5b7f:5540::ea0e) (Ping timeout: 246 seconds) |
| 06:57:34 | <iqubic> | Are you being obtuse on purpose? |
| 06:57:44 | <int-e> | > traverse (\x -> [x,x]) (1,2) |
| 06:57:46 | <lambdabot> | [(1,2),(1,2)] |
| 06:57:52 | <int-e> | mm |
| 06:58:19 | <int-e> | > foldMap (\x -> [x,x]) (1,2) |
| 06:58:21 | <lambdabot> | [2,2] |
| 06:58:54 | <int-e> | iqubic: I'm finding holes in your specification. |
| 06:59:11 | <iqubic> | I see... |
| 06:59:41 | <mauke> | @pl \p -> fst p : snd p : [] |
| 06:59:41 | <lambdabot> | liftM2 (:) fst (return . snd) |
| 07:01:01 | <iqubic> | I'm just gonna use this: |
| 07:01:13 | <iqubic> | > \(xs, ys) -> [xs, ys]) (1, 2) |
| 07:01:15 | <lambdabot> | <hint>:1:22: error: parse error on input ‘)’ |
| 07:01:25 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 07:01:28 | <iqubic> | > (\(xs, ys) -> [xs, ys]) (1, 2) |
| 07:01:29 | <lambdabot> | [1,2] |
| 07:02:03 | <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. |
| 07:02:28 | <iqubic> | It is Advent of Code. But fair point. |
| 07:03:08 | <xerox> | another way to go about it is applying a function g xs ys = ... transformed as uncurry g which gives you ([a],[a]) -> ... |
| 07:03:43 | <[Leary]> | > Data.Bifoldable.biList (1,2) |
| 07:03:44 | <lambdabot> | error: |
| 07:03:44 | <lambdabot> | Not in scope: ‘Data.Bifoldable.biList’ |
| 07:03:44 | <lambdabot> | Perhaps you meant ‘Data.Foldable.toList’ (imported from Data.Foldable) |
| 07:05:04 | <iqubic> | @import Data.Bifoldable |
| 07:05:04 | <lambdabot> | Unknown command, try @list |
| 07:05:08 | <Guest60> | what's the syntax to pattern match on a type from a list? |
| 07:06:00 | <int-e> | pattern match on a type? |
| 07:06:53 | <[Leary]> | Well, you get the idea---that exists. Strange that lambdabot can do :t for things it deems not in scope. |
| 07:06:54 | <Guest60> | yeah idk, I guess you pattern match on constructors |
| 07:07:09 | <iqubic> | You don't pattern match on types. |
| 07:07:11 | <Guest60> | I'm just completely stumped on this Aeson array stuff |
| 07:07:24 | <int-e> | iqubic: it's @let import |
| 07:07:30 | <Guest60> | I just want to know if I have an array of strings or not |
| 07:07:41 | <int-e> | [Leary]: `ghci` does that too |
| 07:09:09 | → | lisbeths joins (uid135845@id-135845.lymington.irccloud.com) |
| 07:09:39 | × | freeside quits (~mengwong@185.223.152.95) (Ping timeout: 260 seconds) |
| 07:10:14 | <iqubic> | Why am I getting this error? Module ‘Data.Bifoldable’ does not export ‘bilist’ |
| 07:10:17 | <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. |
| 07:10:37 | <int-e> | :t Data.Bifoldable.biList |
| 07:10:38 | <lambdabot> | Data.Bifoldable.Bifoldable t => t a a -> [a] |
| 07:10:38 | → | money_ joins (~money@user/polo) |
| 07:10:51 | <int-e> | iqubic: a typo, I think |
| 07:11:10 | <[Leary]> | int-e: Maybe you mean that it implicitly imports everything qualified? They're still in scope. |
| 07:11:15 | <iqubic> | Yeah... Why does that have a capital L |
| 07:11:31 | → | freeside joins (~mengwong@103.252.202.193) |
| 07:12:40 | <int-e> | I have no idea. Maybe it's a pun on `toList`. |
| 07:17:02 | → | jinsun__ joins (~jinsun@user/jinsun) |
| 07:17:02 | jinsun | is now known as Guest568 |
| 07:17:02 | jinsun__ | is now known as jinsun |
| 07:19:32 | × | Guest568 quits (~jinsun@user/jinsun) (Ping timeout: 256 seconds) |
| 07:20:30 | × | money_ quits (~money@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 07:22:23 | × | azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 07:24:29 | → | lottaquestions_ joins (~nick@2607:fa49:503e:7100:70c7:eab8:4b94:7f8a) |
| 07:24:34 | → | zant joins (~zant@62.214.20.26) |
| 07:26:04 | × | lottaquestions quits (~nick@104.221.24.83) (Ping timeout: 268 seconds) |
| 07:26:09 | → | bilegeek joins (~bilegeek@2600:1008:b026:a50f:e2e0:72c1:76cc:3163) |
| 07:28:25 | × | redmp quits (~redmp@mobile-166-171-250-195.mycingular.net) (Quit: leaving) |
| 07:29:06 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 252 seconds) |
| 07:30:37 | × | maerwald_ quits (~maerwald@mail.hasufell.de) (Changing host) |
| 07:30:37 | → | maerwald_ joins (~maerwald@user/maerwald) |
| 07:31:45 | maerwald_ | is now known as maerwald |
| 07:33:27 | → | nihonium joins (~nihonium@93.175.28.1) |
| 07:33:55 | <EvanR> | biList, toList, ... |
| 07:34:20 | → | ballast joins (~ballast@rrcs-24-43-123-92.west.biz.rr.com) |
| 07:34:37 | <EvanR> | oops you said that |
| 07:34:51 | → | money_ joins (~money@user/polo) |
| 07:36:05 | × | Guest60 quits (~Guest60@101.98.118.246) (Quit: Client closed) |
| 07:36:41 | <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 |
| 07:40:20 | × | freeside quits (~mengwong@103.252.202.193) (Quit: Lost terminal) |
| 07:41:52 | → | zant joins (~zant@62.214.20.26) |
| 07:46:44 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
| 07:52:24 | <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 |
| 08:00:28 | → | zant joins (~zant@62.214.20.26) |
| 08:02:47 | → | oldsk00l joins (~znc@ec2-3-73-153-196.eu-central-1.compute.amazonaws.com) |
| 08:05:01 | → | gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
| 08:05:42 | → | razetime joins (~quassel@49.207.211.219) |
| 08:08:00 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 260 seconds) |
| 08:11:08 | × | money_ quits (~money@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 08:20:55 | → | zant joins (~zant@62.214.20.26) |
| 08:21:00 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 08:22:05 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 08:22:19 | × | califax quits (~califax@user/califx) (Remote host closed the connection) |
| 08:22:22 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 08:25:53 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
| 08:27:40 | → | califax joins (~califax@user/califx) |
| 08:29:27 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 08:30:22 | → | titibandit joins (~titibandi@xdsl-78-35-173-119.nc.de) |
| 08:34:57 | → | money_ joins (~money@user/polo) |
| 08:39:01 | × | money_ quits (~money@user/polo) (Client Quit) |
| 08:46:18 | → | nate4 joins (~nate@98.45.169.16) |
| 08:51:10 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 260 seconds) |
| 08:51:36 | → | gmg joins (~user@user/gehmehgeh) |
| 08:52:34 | → | husixu joins (~husixu@182.55.67.24) |
| 08:55:48 | → | zant joins (~zant@62.214.20.26) |
| 08:56:25 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 252 seconds) |
| 08:57:06 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 252 seconds) |
| 08:59:33 | → | jmdaemon joins (~jmdaemon@user/jmdaemon) |
| 09:00:03 | × | M0rphee[m] quits (~M0rpheema@2001:470:69fc:105::2:b1ce) (Quit: You have been kicked for being idle) |
| 09:00:03 | × | drsooch[m] quits (~drsoochma@2001:470:69fc:105::1:c8a1) (Quit: You have been kicked for being idle) |
| 09:01:05 | × | iqubic quits (~avi@2601:601:1100:edd0:d29b:dc2d:eab0:9e7d) (Ping timeout: 260 seconds) |
| 09:03:04 | × | bilegeek quits (~bilegeek@2600:1008:b026:a50f:e2e0:72c1:76cc:3163) (Quit: Leaving) |
| 09:05:20 | → | freeside joins (~mengwong@103.252.202.193) |
| 09:06:39 | × | Vajb quits (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) (Read error: Connection reset by peer) |
| 09:06:56 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) |
| 09:08:25 | → | son0p joins (~ff@2604:3d08:5b7f:5540::a58f) |
| 09:10:02 | × | nihonium quits (~nihonium@93.175.28.1) (Ping timeout: 256 seconds) |
| 09:10:41 | <freeside> | for my next trick, i get HLS working with Emacs and ghc 9.2.5 on Mac 12.6. wish me luck. |
| 09:11:01 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 09:11:04 | <tomsmeding> | freeside: doesn't hls not yet support ghc 9.2.5 |
| 09:11:09 | <tomsmeding> | you may have better luck with 9.2.4 |
| 09:11:25 | <freeside> | for my next trick, i get HLS working with Emacs and ghc 9.2.4 on Mac 12.6. wish me luck. |
| 09:11:57 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 09:12:52 | × | husixu quits (~husixu@182.55.67.24) (Ping timeout: 256 seconds) |
| 09:13:25 | <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. |
| 09:14:21 | → | money_ joins (~money@user/polo) |
| 09:14:26 | <freeside> | i don't see an LTS that has ghc 9.2.4, so instead I choose nightly 2022-11-12. |
| 09:14:29 | <maerwald> | freeside: M1? |
| 09:14:34 | <freeside> | yes, M1, I'm afraid |
| 09:14:39 | <maerwald> | 9.2.4 is broken on M1 |
| 09:14:42 | <tomsmeding> | lol |
| 09:15:22 | <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. |
| 09:15:48 | <maerwald> | will be more challenging with stack |
| 09:16:14 | <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. |
| 09:16:38 | <maerwald> | that should work |
| 09:16:56 | <maerwald> | make sure xcode command line tools are installed |
| 09:19:14 | <freeside> | we begin with a fresh start. $ rm ~/.{ghcup,local}/bin/haskell-language-server* |
| 09:20:15 | <maerwald> | freeside: ehm |
| 09:20:24 | <maerwald> | that's not a proper uninstallation for ghcup |
| 09:20:31 | <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 |
| 09:20:43 | <ballast> | ghc-lib-parser > error: In file included from FFI.hsc:9: |
| 09:20:44 | <ballast> | ghc-lib-parser > /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ffi/ffi.h:193:1: error: expected ',' |
| 09:20:44 | <ballast> | ghc-lib-parser > FFI_AVAILABLE_APPLE FFI_EXTERN ffi_type ffi_type_void; |
| 09:20:53 | <freeside> | i shall run ghcup tui to uninstall the hls |
| 09:21:11 | <maerwald> | 'ghcup nuke' does too |
| 09:21:24 | → | husixu joins (~husixu@182.55.67.24) |
| 09:21:28 | <maerwald> | although maybe I should have named this command different during these times |
| 09:21:31 | <freeside> | thank you, i suspect i am about 1.5 hours way from runnin ga nuke |
| 09:22:11 | <tomsmeding> | maerwald: is there a central list of issues like this, i.e. known bugs of previous ghc versions |
| 09:22:36 | <maerwald> | tomsmeding: dunno, probably not |
| 09:22:47 | <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 |
| 09:23:25 | × | titibandit quits (~titibandi@xdsl-78-35-173-119.nc.de) (Quit: Leaving.) |
| 09:23:25 | <maerwald> | tomsmeding: https://gitlab.haskell.org/ghc/ghc/-/issues/21491 |
| 09:23:35 | <tomsmeding> | lol |
| 09:24:00 | <freeside> | why is it that on one computer, my ghcup tui shows "hls-powered", but on another computer, it doesn't? |
| 09:24:02 | → | nihonium joins (~nihonium@93.175.28.1) |
| 09:24:17 | <tomsmeding> | because that one computer has HLS installed via ghcup and the other doesn't? |
| 09:24:39 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 09:24:40 | <freeside> | my finger creeps closer to the 'nuke' button |
| 09:24:57 | <c_wraith> | I've never used hls. is it any good? |
| 09:24:59 | <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 |
| 09:25:14 | <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) |
| 09:25:22 | <maerwald> | that file is not utilized by ghcup though |
| 09:25:30 | × | money_ quits (~money@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 09:26:34 | × | ballast quits (~ballast@rrcs-24-43-123-92.west.biz.rr.com) (Quit: Client closed) |
| 09:29:07 | × | nihonium quits (~nihonium@93.175.28.1) (Ping timeout: 256 seconds) |
| 09:32:34 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a5-27.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 09:33:04 | → | merijn joins (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
| 09:33:21 | → | acidjnk joins (~acidjnk@p200300d6e7137a6578c6ff3ed8f071f7.dip0.t-ipconnect.de) |
| 09:33:33 | → | Vajb joins (~Vajb@2001:999:504:3ad6:52a4:a3b5:32d8:e74d) |
| 09:35:35 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 09:36:40 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 09:38:36 | × | oldsk00l quits (~znc@ec2-3-73-153-196.eu-central-1.compute.amazonaws.com) (Remote host closed the connection) |
| 09:39:59 | <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 ... |
| 09:40:37 | <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. |
| 09:40:39 | <maerwald> | freeside: 9.2.4 produces wrong maths on M1 |
| 09:40:47 | <maerwald> | you're running a ticking time bomb |
| 09:41:31 | <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 |
| 09:41:36 | <freeside> | ok. to defuse the bomb, i switch the resolver to lts-20.2 |
| 09:41:40 | <tomsmeding> | but not sure that matters here :) |
| 09:42:43 | <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. |
| 09:43:17 | <tomsmeding> | freeside: try restarting the language server |
| 09:43:41 | <tomsmeding> | HLS is compiled with ghc version X to work with projects using ghc version X |
| 09:43:45 | <maerwald> | tomsmeding: https://gitlab.haskell.org/ghc/ghc/-/issues/22282 |
| 09:43:51 | <tomsmeding> | so every (supported) ghc version has its own HLS executable |
| 09:44:09 | <freeside> | i use ghcup tui to set 9.2.5, and M-x lsp-wo-re |
| 09:44:10 | <tomsmeding> | maerwald: that's 9.4.2, not 9.2.4 |
| 09:44:18 | <tomsmeding> | I remember that one too :) |
| 09:44:40 | <tomsmeding> | freeside: lsp-world-reenact? |
| 09:45:25 | <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. |
| 09:45:34 | <maerwald> | tomsmeding: https://downloads.haskell.org/~ghc/9.2.5/docs/html/users_guide/9.2.5-notes.html |
| 09:45:37 | <maerwald> | it is listed there |
| 09:46:01 | <tomsmeding> | ah so it was a thing on 9.2.4 too |
| 09:46:06 | <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." |
| 09:46:10 | <maerwald> | 9.2.4 is broken |
| 09:46:25 | <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 |
| 09:46:30 | <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/ |
| 09:46:32 | <maerwald> | you don't want your compiler to "get lucky" |
| 09:46:45 | <maerwald> | freeside: yes, 'ghcup compile hls' |
| 09:46:59 | <freeside> | I am prepared to compile HLS master from source, but first I want to try ghcup compile hls. |
| 09:47:15 | <maerwald> | https://www.haskell.org/ghcup/guide/#hls |
| 09:47:25 | <tomsmeding> | 'ghcup compile hls --git-ref master --ghc 9.2.5' presumably? |
| 09:47:29 | <maerwald> | yeah |
| 09:47:43 | <tomsmeding> | I mean, 'ghcup compile hls' does exactly that :p |
| 09:47:49 | <freeside> | how about $ ghcup compile hls --version 1.8.0.0 --ghc 9.2.5 --cabal-update |
| 09:47:56 | <maerwald> | also can |
| 09:47:58 | <maerwald> | try any |
| 09:48:40 | <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 |
| 09:49:00 | <maerwald> | bad maths is subtle, lol... it can cause wrong code paths |
| 09:49:01 | → | nihonium joins (~nihonium@93.175.28.32) |
| 09:49:10 | <maerwald> | like... delete random directories, at worst |
| 09:49:23 | <freeside> | there is no such thing as bad maths, only non-monotonic logic |
| 09:49:37 | <maerwald> | well, don't care what you call it... good luck anyways |
| 09:49:48 | <tomsmeding> | we do really need that survival guide |
| 09:49:52 | <maerwald> | I should probably remove that version from ghcup |
| 09:50:13 | <maerwald> | but then again, that's not the only ghc that's broken |
| 09:50:14 | <tomsmeding> | does it have issues only on aarch64? |
| 09:50:18 | <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," |
| 09:50:29 | <tomsmeding> | yeah 1.8.0.0 doesn't have updated bounds yet for 9.2.5 |
| 09:50:34 | <tomsmeding> | try --git-ref master |
| 09:50:40 | <freeside> | ok, doing that now. |
| 09:50:42 | <tomsmeding> | that at least gets an install plan here, still compiling |
| 09:50:44 | <maerwald> | freeside: try `ghcup compile hls --git-ref 1.8.0.0 --ghc 9.2.5 --cabal-update' |
| 09:51:00 | <maerwald> | --git-ref master is a bit lucky goon |
| 09:51:19 | <tomsmeding> | maerwald: you think git 1.8.0.0 is newer than hackage 1.8.0.0? |
| 09:51:27 | <tomsmeding> | I mean, could be |
| 09:51:37 | <maerwald> | it has a cabal.project file |
| 09:51:43 | <tomsmeding> | oooh right |
| 09:55:06 | <tomsmeding> | master build succeeded |
| 09:57:31 | <tomsmeding> | (and seems to work) |
| 09:58:03 | <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 |
| 09:58:09 | <tomsmeding> | nice |
| 09:58:30 | <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? |
| 09:59:04 | <tomsmeding> | sounds like a job for 'ghcup compile hls --overwrite-version' |
| 10:00:01 | <freeside> | yeah. It's nice how ghcup gives an Info log Examining git ref ____, showing commit hash and HLS version. |
| 10:00:28 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
| 10:00:34 | <tomsmeding> | in certain communities 1.8.0.0-git would be the appropriate version tag |
| 10:00:37 | <maerwald> | you can also use --git-describe-version |
| 10:00:38 | <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 |
| 10:00:57 | <tomsmeding> | I can peg my cpu just fine with just one hls build lol |
| 10:01:07 | <tomsmeding> | and I have 20 virtual cores to fill |
| 10:01:10 | <maerwald> | freeside: ghcup does not do any locking |
| 10:01:15 | <maerwald> | so good luck |
| 10:02:18 | <freeside> | the builds seem to be happening in different ~/.ghcup/tmp/ghcup-* directories |
| 10:02:42 | <maerwald> | yes, but once it merges it will try to change symlinks in ~/.ghcup/bin |
| 10:02:44 | <maerwald> | that can blow up |
| 10:03:11 | × | husixu quits (~husixu@182.55.67.24) (Ping timeout: 246 seconds) |
| 10:03:13 | <freeside> | i could see the wrapper -> wrapper-1.8.0.0 colliding, yes |
| 10:03:27 | <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? |
| 10:04:49 | <maerwald> | the default for HLS is to set |
| 10:04:56 | <tomsmeding> | a |
| 10:04:57 | <tomsmeding> | *ah |
| 10:05:07 | <maerwald> | only for GHC the default is to do nothing |
| 10:05:13 | <tomsmeding> | may need to manually fix symlinks then afterwards |
| 10:05:28 | <tomsmeding> | the builds are unlikely to finish at precisely the same time though |
| 10:05:42 | <maerwald> | don't complain if it breaks your ghcup install though |
| 10:06:42 | <tomsmeding> | maerwald: people will complain anyway ;) |
| 10:07:03 | freeside | rages idemimpotently |
| 10:07:24 | <tomsmeding> | similarly powerless? |
| 10:08:31 | → | king_gs joins (~Thunderbi@187.201.204.122) |
| 10:09:55 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 10:10:06 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 268 seconds) |
| 10:10:06 | × | talismanick quits (~talismani@76.133.152.122) (Ping timeout: 268 seconds) |
| 10:11:12 | Lord_of_Life_ | is now known as Lord_of_Life |
| 10:12:16 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 252 seconds) |
| 10:12:21 | → | Tuplanolla joins (~Tuplanoll@91-159-68-152.elisa-laajakaista.fi) |
| 10:12:24 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 10:14:14 | → | levinlevinlevin joins (~levin@ip5f584d02.dynamic.kabel-deutschland.de) |
| 10:16:43 | <freeside> | dual to idempotently |
| 10:17:09 | <freeside> | anyway, i have built --git-ref 1.8.0.0 --ghc 9.2.5 |
| 10:18:50 | <freeside> | on both M1 and Intel |
| 10:19:01 | <tomsmeding> | nice! and does it work? |
| 10:19:18 | <freeside> | I'm seeing lsp-log has an InternalError: typecheck but I don't know how internal that error really is |
| 10:19:50 | <freeside> | that error line appears to be pinned to the bottom of the buffer. then it says Live bytes: 44.43MB ... |
| 10:20:03 | <freeside> | to see if it works, i will go back to my lts-20.2 project |
| 10:23:06 | <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 |
| 10:23:26 | <tomsmeding> | yay! |
| 10:23:32 | <freeside> | yay, thank you for all the help |
| 10:23:39 | <tomsmeding> | thanks for your persistence |
| 10:24:12 | <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 |
| 10:25:23 | <freeside> | --git-ref master is mentioned at https://www.haskell.org/ghcup/guide/#hls |
| 10:25:58 | × | chomwitt quits (~chomwitt@2a02:587:7a0c:6a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 256 seconds) |
| 10:26:26 | <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 |
| 10:27:06 | <tomsmeding> | where every cell in that 4-dimensional table is a boolean? |
| 10:27:09 | <tomsmeding> | yeah |
| 10:27:23 | <freeside> | well, something that helps you decide how to run a build command |
| 10:27:33 | <tomsmeding> | I am most particularly looking forward to the (Windows, M2) subtable |
| 10:27:44 | <freeside> | for my next trick, I will chance the ruination of all this good work by upgrading the emacs-side lsp-haskell-whatever-mode |
| 10:27:46 | <tomsmeding> | good luck there |
| 10:27:50 | <freeside> | haha |
| 10:27:51 | <tomsmeding> | lol |
| 10:28:07 | <tomsmeding> | (Linux, M2) is now actually kinda a thing with Asahi |
| 10:30:13 | tomsmeding | is afk for a while |
| 10:30:21 | <freeside> | ur fingers deserve a rest, thnu |
| 10:30:23 | <freeside> | thnku |
| 10:30:48 | → | zant joins (~zant@62.214.20.26) |
| 10:31:31 | → | accord joins (uid568320@id-568320.hampstead.irccloud.com) |
| 10:32:55 | → | husixu joins (~husixu@182.55.67.24) |
| 10:36:10 | × | merijn quits (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 256 seconds) |
| 10:40:55 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.or.comcast.net) (Quit: zzz) |
| 10:41:08 | × | razetime quits (~quassel@49.207.211.219) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 10:41:16 | × | king_gs quits (~Thunderbi@187.201.204.122) (Quit: king_gs) |
| 10:42:55 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 10:44:03 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 10:44:28 | → | chomwitt joins (~chomwitt@2a02:587:7a0c:6a00:1ac0:4dff:fedb:a3f1) |
| 10:45:48 | × | nihonium quits (~nihonium@93.175.28.32) (Ping timeout: 256 seconds) |
| 10:47:49 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 10:48:07 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Client Quit) |
| 10:48:25 | × | levinlevinlevin quits (~levin@ip5f584d02.dynamic.kabel-deutschland.de) (Quit: leaving) |
| 10:48:25 | → | razetime joins (~quassel@49.207.211.219) |
| 10:49:13 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 10:54:09 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:e558:b5d6:f082:6f2c) (Remote host closed the connection) |
| 10:55:04 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 260 seconds) |
| 10:55:56 | → | nihonium joins (~nihonium@93.175.28.32) |
| 11:01:06 | × | nihonium quits (~nihonium@93.175.28.32) (Ping timeout: 256 seconds) |
| 11:01:27 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 11:03:02 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 11:09:24 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 11:09:38 | → | pyrex_ joins (~pyrex@2601:645:8781:1c90:2d9a:11e:afbe:1759) |
| 11:11:59 | → | dextaa7 joins (~DV@user/dextaa) |
| 11:13:08 | → | pja joins (~pja@217.155.153.10) |
| 11:13:24 | × | dextaa quits (~DV@user/dextaa) (Ping timeout: 248 seconds) |
| 11:13:24 | dextaa7 | is now known as dextaa |
| 11:13:56 | × | pyrex quits (~pyrex@user/pyrex) (Ping timeout: 248 seconds) |
| 11:14:16 | × | superbil quits (~superbil@1-34-176-171.hinet-ip.hinet.net) (Ping timeout: 268 seconds) |
| 11:15:18 | → | superbil joins (~superbil@1-34-176-171.hinet-ip.hinet.net) |
| 11:20:56 | × | Kaiepi quits (~Kaiepi@108.175.84.104) (Ping timeout: 256 seconds) |
| 11:27:30 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 11:28:31 | → | gmg joins (~user@user/gehmehgeh) |
| 11:34:35 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
| 11:36:32 | × | pyrex_ quits (~pyrex@2601:645:8781:1c90:2d9a:11e:afbe:1759) (Ping timeout: 255 seconds) |
| 11:37:33 | → | pyrex joins (~pyrex@user/pyrex) |
| 11:41:54 | × | jmdaemon quits (~jmdaemon@user/jmdaemon) (Ping timeout: 256 seconds) |
| 11:47:34 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 11:48:46 | × | lisbeths quits (uid135845@id-135845.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 11:54:34 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 11:54:34 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
| 11:58:54 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 256 seconds) |
| 12:00:38 | × | coderpath quits (~coderpath@d66-183-126-83.bchsia.telus.net) (Quit: ZNC 1.8.2 - https://znc.in) |
| 12:01:03 | → | coderpath joins (~coderpath@d66-183-126-83.bchsia.telus.net) |
| 12:03:11 | → | zant joins (~zant@62.214.20.26) |
| 12:05:31 | × | teehemkay_ quits (sid14792@id-14792.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 12:05:31 | × | teehemkay quits (sid14792@id-14792.lymington.irccloud.com) (Quit: Connection closed for inactivity) |
| 12:05:51 | × | mzan quits (~quassel@mail.asterisell.com) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 12:07:53 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
| 12:19:47 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 12:20:53 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 12:28:18 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 12:32:28 | → | zant joins (~zant@62.214.20.26) |
| 12:32:38 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 12:33:12 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 12:37:41 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 12:46:19 | → | titibandit joins (~titibandi@xdsl-78-35-173-119.nc.de) |
| 12:47:46 | → | nate4 joins (~nate@98.45.169.16) |
| 12:51:44 | × | freeside quits (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
| 12:52:54 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 12:55:27 | → | thyriaen joins (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
| 13:03:30 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 252 seconds) |
| 13:06:52 | → | gurkenglas joins (~gurkengla@p548ac72e.dip0.t-ipconnect.de) |
| 13:06:52 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 13:07:28 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 256 seconds) |
| 13:08:31 | × | acidjnk quits (~acidjnk@p200300d6e7137a6578c6ff3ed8f071f7.dip0.t-ipconnect.de) (Ping timeout: 260 seconds) |
| 13:10:40 | → | freeside joins (~mengwong@103.252.202.193) |
| 13:15:24 | × | freeside quits (~mengwong@103.252.202.193) (Ping timeout: 256 seconds) |
| 13:19:46 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt https://tinyurl.com/4m8d4kd5) |
| 13:25:02 | → | acidjnk joins (~acidjnk@p200300d6e7137a51dd9a34ca5f6ed83a.dip0.t-ipconnect.de) |
| 13:25:53 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 13:28:36 | → | freeside joins (~mengwong@103.252.202.193) |
| 13:32:42 | → | mzan joins (~quassel@mail.asterisell.com) |
| 13:32:58 | → | argento joins (~argento@191.81.234.127) |
| 13:33:19 | × | titibandit quits (~titibandi@xdsl-78-35-173-119.nc.de) (Quit: Leaving.) |
| 13:34:18 | × | argento quits (~argento@191.81.234.127) (Client Quit) |
| 13:34:40 | × | mzan quits (~quassel@mail.asterisell.com) (Client Quit) |
| 13:34:47 | → | argento joins (~argento@191.81.234.127) |
| 13:37:22 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 13:40:52 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 13:41:41 | → | mzan joins (~quassel@mail.asterisell.com) |
| 13:44:30 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 13:44:57 | → | merijn joins (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) |
| 13:48:46 | → | Kaiepi joins (~Kaiepi@108.175.84.104) |
| 13:49:29 | × | merijn quits (~merijn@c-001-002-023.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds) |
| 13:51:40 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 256 seconds) |
| 13:51:56 | × | money quits (Guest6586@user/polo) (Killed (tantalum.libera.chat (Nickname regained by services))) |
| 13:52:28 | → | money joins (~textual@user/polo) |
| 13:54:20 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
| 13:56:24 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
| 14:00:55 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 260 seconds) |
| 14:02:51 | → | crazazy joins (~user@130.89.171.62) |
| 14:03:37 | × | money quits (~textual@user/polo) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 14:05:30 | → | money joins (money@user/polo) |
| 14:06:29 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 14:06:56 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Ping timeout: 255 seconds) |
| 14:07:26 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 14:08:35 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 14:09:09 | → | fockerize joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 14:11:37 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 14:13:19 | × | argento quits (~argento@191.81.234.127) (Quit: leaving) |
| 14:24:52 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 14:24:56 | × | ec quits (~ec@gateway/tor-sasl/ec) (Ping timeout: 255 seconds) |
| 14:25:50 | → | lottaquestions joins (~nick@2607:fa49:503e:7100:fd99:63e8:8bc:5217) |
| 14:26:22 | × | lottaquestions_ quits (~nick@2607:fa49:503e:7100:70c7:eab8:4b94:7f8a) (Ping timeout: 252 seconds) |
| 14:27:27 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 14:29:35 | × | lottaquestions quits (~nick@2607:fa49:503e:7100:fd99:63e8:8bc:5217) (Client Quit) |
| 14:29:59 | → | lottaquestions joins (~nick@2607:fa49:503e:7100:fd99:63e8:8bc:5217) |
| 14:30:44 | × | freeside quits (~mengwong@103.252.202.193) (Ping timeout: 248 seconds) |
| 14:31:24 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 14:31:48 | × | aeroplane quits (~user@user/aeroplane) (Ping timeout: 248 seconds) |
| 14:42:18 | × | thyriaen quits (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) (Remote host closed the connection) |
| 14:47:20 | × | fockerize quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 255 seconds) |
| 14:47:31 | → | nihonium joins (~nihonium@83.220.239.213) |
| 14:53:22 | → | michalz joins (~michalz@185.246.204.93) |
| 14:56:00 | → | freeside joins (~mengwong@103.252.202.193) |
| 15:00:39 | × | freeside quits (~mengwong@103.252.202.193) (Ping timeout: 260 seconds) |
| 15:00:39 | × | nihonium quits (~nihonium@83.220.239.213) (Read error: Connection reset by peer) |
| 15:01:49 | × | causal quits (~user@50.35.83.177) (Ping timeout: 260 seconds) |
| 15:03:03 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 15:08:40 | → | basti_ joins (~basti@ip-084-119-008-088.um24.pools.vodafone-ip.de) |
| 15:09:08 | × | machinedgod quits (~machinedg@d198-53-218-113.abhsia.telus.net) (Ping timeout: 248 seconds) |
| 15:11:09 | → | machinedgod joins (~machinedg@d198-53-218-113.abhsia.telus.net) |
| 15:12:59 | → | Unicorn_Princess joins (~Unicorn_P@user/Unicorn-Princess/x-3540542) |
| 15:13:29 | × | jlgw quits (~jw@46-162-74-53.cust.bredband2.com) (Read error: Connection reset by peer) |
| 15:13:46 | → | money_ joins (~money@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 15:15:19 | → | causal joins (~user@50.35.83.177) |
| 15:20:04 | × | money_ quits (~money@pool-100-11-18-203.phlapa.fios.verizon.net) (Ping timeout: 256 seconds) |
| 15:24:27 | → | nihonium joins (~nihonium@83.220.239.213) |
| 15:29:07 | → | freeside joins (~mengwong@103.252.202.193) |
| 15:36:09 | → | titibandit joins (~titibandi@xdsl-78-35-173-119.nc.de) |
| 15:38:24 | → | ozkutuk5 joins (~ozkutuk@176.240.173.153) |
| 15:40:00 | → | azimut_ joins (~azimut@gateway/tor-sasl/azimut) |
| 15:40:31 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 15:54:56 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
| 15:56:08 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 15:58:19 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
| 16:00:35 | → | nate4 joins (~nate@98.45.169.16) |
| 16:02:56 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 255 seconds) |
| 16:06:12 | <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" |
| 16:06:21 | <freeside> | can you guess what the question is lol |
| 16:08:24 | <geekosaur> | the alternative answer is often "do less type level or generics shenanigans" |
| 16:09:47 | <freeside> | the question is "why is haskell-language-server taking up so much RAM" |
| 16:10:26 | <geekosaur> | I think it just caches a lot, but #haskell-language-server is more likely to know |
| 16:11:13 | <freeside> | (^^)v |
| 16:12:00 | × | mbuf quits (~Shakthi@49.204.140.192) (Quit: Leaving) |
| 16:19:18 | → | ddellacosta joins (~ddellacos@86.106.143.75) |
| 16:20:01 | × | ddellacosta quits (~ddellacos@86.106.143.75) (Client Quit) |
| 16:20:36 | <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! |
| 16:21:18 | <freeside> | I didn't even compile with --profile |
| 16:21:24 | → | ddellacosta joins (~ddellacos@143.244.47.100) |
| 16:23:35 | <freeside> | is this a free new feature in v9? |
| 16:32:35 | × | nihonium quits (~nihonium@83.220.239.213) (Ping timeout: 260 seconds) |
| 16:34:10 | × | ec quits (~ec@gateway/tor-sasl/ec) (Remote host closed the connection) |
| 16:34:18 | × | abrar quits (~abrar@static-108-2-152-54.phlapa.fios.verizon.net) (Ping timeout: 256 seconds) |
| 16:34:43 | → | ec joins (~ec@gateway/tor-sasl/ec) |
| 16:35:05 | × | razetime quits (~quassel@49.207.211.219) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 16:38:16 | → | zer0bitz joins (~zer0bitz@196.244.192.58) |
| 16:39:40 | <geekosaur> | they've gradually been adding it to things, yes |
| 16:42:02 | <freeside> | nice. love it. |
| 16:42:23 | <freeside> | I will add "stack traces" to my List of Features That Python Stole From Haskell |
| 16:43:19 | → | aeroplane joins (~user@user/aeroplane) |
| 16:51:51 | <geekosaur> | I'm quite certain Pythin had them first. CallStack was experimental in ghc8 and is still being worked in |
| 16:54:17 | → | merijn joins (~merijn@86-86-29-250.fixed.kpn.net) |
| 16:56:30 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 16:56:43 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Remote host closed the connection) |
| 16:56:50 | <freeside> | joke, joke |
| 17:04:14 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Ping timeout: 246 seconds) |
| 17:04:22 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 17:04:30 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 268 seconds) |
| 17:13:32 | × | finsternis quits (~X@23.226.237.192) (Read error: Connection reset by peer) |
| 17:18:35 | → | Lycurgus joins (~juan@user/Lycurgus) |
| 17:23:02 | × | basti_ quits (~basti@ip-084-119-008-088.um24.pools.vodafone-ip.de) (Ping timeout: 256 seconds) |
| 17:24:14 | <tomsmeding> | freeside: I had this screenshot sent to me at some point https://tomsmeding.com/vang/aAiRo6/hls-memory.png |
| 17:24:30 | <tomsmeding> | I hope it's not that bad yet on your side |
| 17:25:06 | → | money_ joins (~money@pool-100-11-18-203.phlapa.fios.verizon.net) |
| 17:28:52 | × | merijn quits (~merijn@86-86-29-250.fixed.kpn.net) (Ping timeout: 248 seconds) |
| 17:32:55 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 17:34:01 | <monochrom> | That's... epic. :) |
| 17:34:13 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 17:38:53 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 17:40:00 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 17:43:49 | × | ddellacosta quits (~ddellacos@143.244.47.100) (Ping timeout: 256 seconds) |
| 17:45:43 | → | ddellacosta joins (~ddellacos@143.244.47.73) |
| 17:50:28 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 17:50:53 | × | Lycurgus quits (~juan@user/Lycurgus) (Quit: Exeunt https://tinyurl.com/4m8d4kd5) |
| 17:57:09 | → | bobbingbob joins (~dfadsva@2604:3d09:207f:f650::7b3a) |
| 17:58:37 | <bobbingbob> | so i was trying to learn how to do haskell development with nix. are we supposed to run nix commands as root? |
| 17:59:44 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
| 18:00:30 | <bobbingbob> | ah i think i will just stick with cabal. |
| 18:01:15 | <bobbingbob> | today i'm going to try to learn about segmentation algorithms and will try to get something going in haskell |
| 18:02:15 | → | Scraeling joins (~Scraeling@user/scraeling) |
| 18:04:10 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 260 seconds) |
| 18:05:01 | × | aeroplane quits (~user@user/aeroplane) (Ping timeout: 252 seconds) |
| 18:06:43 | × | money_ quits (~money@pool-100-11-18-203.phlapa.fios.verizon.net) (Changing host) |
| 18:06:43 | → | money_ joins (~money@user/polo) |
| 18:06:47 | money | is now known as Guest1418 |
| 18:06:48 | × | Guest1418 quits (money@user/polo) (Killed (calcium.libera.chat (Nickname regained by services))) |
| 18:06:48 | money_ | is now known as money |
| 18:09:47 | <geekosaur> | I think the only thing you normally run as root is the initial install, so it can create /nix |
| 18:09:57 | <geekosaur> | everything else you run as a user |
| 18:11:13 | → | econo joins (uid147250@user/econo) |
| 18:14:27 | → | ss4 joins (~wootehfoo@user/wootehfoot) |
| 18:16:39 | → | pagnol joins (~user@213-205-209-87.ftth.glasoperator.nl) |
| 18:17:00 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 260 seconds) |
| 18:18:05 | <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 |
| 18:18:10 | <pagnol> | Are there ways to do that? |
| 18:18:27 | <EvanR> | a cabal script can be used for a 1 file program, to bring in packages |
| 18:18:42 | <geekosaur> | both cabal and stack have script modes. and for really quick stuff there's runhaskell |
| 18:18:42 | <EvanR> | sometimes I use that for advent of code |
| 18:18:49 | × | wroathe quits (~wroathe@user/wroathe) (Quit: Reconnecting) |
| 18:19:01 | → | wroathe joins (~wroathe@207-153-38-140.fttp.usinternet.com) |
| 18:19:01 | × | wroathe quits (~wroathe@207-153-38-140.fttp.usinternet.com) (Changing host) |
| 18:19:01 | → | wroathe joins (~wroathe@user/wroathe) |
| 18:20:15 | <EvanR> | what's the difference between cabal run and runhaskell |
| 18:20:30 | <geekosaur> | cabal run has access to the cabal package store |
| 18:20:40 | <geekosaur> | runhaskell has only the ghc global package db |
| 18:20:46 | <EvanR> | ah |
| 18:21:04 | <geekosaur> | also cabal run compiles things, runhaskell is an interpreter |
| 18:21:26 | <sclv> | also i believe cabal run is compiles by default these days while runhaskell is evaluated |
| 18:21:28 | <pagnol> | so like this? https://stackoverflow.com/a/65541020 |
| 18:21:53 | × | ss4 quits (~wootehfoo@user/wootehfoot) (Quit: Leaving) |
| 18:22:08 | → | wootehfoot joins (~wootehfoo@user/wootehfoot) |
| 18:22:08 | <EvanR> | yeah, though the code for splitOn might take up less space xD |
| 18:22:35 | <EvanR> | shame it's not in the standard library somewhere |
| 18:22:56 | <geekosaur> | yeh, splitOn is trivially writable with break/span, seems odd to bring in a dependency just for that |
| 18:23:42 | <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 |
| 18:24:18 | <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) |
| 18:25:49 | <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 |
| 18:26:10 | <EvanR> | moving more out of the prelude makes that harsher? |
| 18:26:21 | <EvanR> | or base |
| 18:26:43 | <geekosaur> | moving more out of base just means less stuff that's unnecessarily pinned to ghc |
| 18:26:57 | <sclv> | well you can use a project file and “cabal repl” |
| 18:26:59 | <geekosaur> | splitting base itself into pinned and unpinned parts mitigates that |
| 18:27:08 | × | Xeroine quits (~Xeroine@user/xeroine) (Ping timeout: 268 seconds) |
| 18:27:12 | <EvanR> | yeah this is moot if you set up a formal project |
| 18:27:33 | <money> | moot? |
| 18:27:52 | → | Xeroine joins (~Xeroine@user/xeroine) |
| 18:28:14 | <EvanR> | subject was quick one off script that uses non-base stuff, with less pomp and circumstance |
| 18:29:13 | <EvanR> | not sure how geekosaur changes the non-base part |
| 18:29:22 | <EvanR> | er, what geekosaur is talking about |
| 18:30:11 | <geekosaur> | it shouldn't change it, base moves from non-upgradeable part to small non-upgradeable core and larger upgradeable boot package |
| 18:30:25 | <geekosaur> | like text is currently a boot package but can be upgraded |
| 18:30:26 | <EvanR> | oh if there is pinned and unpinned part, you could hypotheticall just have splitOn and chunksOf in the unpinned part |
| 18:30:50 | <geekosaur> | right, it makes it easier to bring useful utils into base without pinning thyem to ghc at the same time |
| 18:31:14 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 18:31:27 | → | dsrt^ joins (~dsrt@76.145.185.103) |
| 18:31:51 | <geekosaur> | might even let us think about starting to use Text and ByteString APIs instead of String in base |
| 18:32:13 | <geekosaur> | since making those non-upgradeable would be Bad |
| 18:32:54 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 18:33:26 | <EvanR> | oh hell yeah |
| 18:34:39 | <geekosaur> | and have a compat-base for older code that continued to use the older APIs |
| 18:35:18 | <EvanR> | which API exactly, like getLine |
| 18:35:22 | → | ss4 joins (~wootehfoo@user/wootehfoot) |
| 18:35:24 | <EvanR> | readFile |
| 18:35:51 | <geekosaur> | yep. the exact APIs would probably be bikeskedded to death though 🙂 |
| 18:35:57 | <geekosaur> | *bikeshedded |
| 18:38:13 | <cpli> | https://tio.run/##jVCxbsIwFNz9FSfokAioyhopGZG6IaFOiOE1foGoiVvZpqRq@@2p4xhIyYIXn@7du7PvQOaNq6ptvxdTVKT2R9ozXpTkvJT0WvGzMpZUzgbTxa8QkixhpZlRgJBifdTswE/PRQWi8zCOhSjDMqLN4f0EmsPf/2Ux0izwFxKnA2sWgHG8WWvOIRH1YU7v6TVpVogkMiyfYjx4cmN1qfaYeOkEjwOD5RJ06@gD67scvXTkWIdKNl/KUrOqyLr3p@iAZcUS22IHybr87Ey6XwpR@KFGkvStDXYJi2xMXjYGDfToOun7v@aOiMbESGCprHzlrolwRpuNwWwWlDcBnUmKAIWwbOwqCNKR0XZE@EdH8RwB7IZQiJpK5Xw@XOHWtX@OHqS07R8 |
| 18:38:19 | → | kuribas joins (~user@ptr-17d51elyntgmmzbvw93.18120a2.ip6.access.telenet.be) |
| 18:38:23 | × | wootehfoot quits (~wootehfoo@user/wootehfoot) (Ping timeout: 252 seconds) |
| 18:38:37 | <cpli> | how would i properly implement `flatter` by using combinators on Free monads? |
| 18:40:16 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 18:44:56 | → | coot joins (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) |
| 18:45:05 | × | turlando quits (~turlando@user/turlando) (Ping timeout: 265 seconds) |
| 18:49:49 | <cpli> | correction: https://tio.run/##jVCxbsIwFNz9FSdgSARUzRopGZG6IaFOiOEVv0DUxK1sU6jafnvqOA6kZOnk0717d893JPPKVdU0X8spKlKHEx0Yz0ryvpT0UvGTMpbUng2myx8hJFnCSjOjACHD@qTZge@OiwpE/TCOhSjDMqLN8e0MWsC/f2UxsjzwVxLnI2sWgHG8WWveQyLqwpze02vSrBBJ5EgeY8w8ubG6VAdMvHSCh4FBkoDuHX1g/S9HLx051qGSzaeydFlVZN39GVpgWbHEtthBsi4/WpP2l0IUfqiRpl1rg13CMh@T141BAx26Tbr@b7kj4mJipLBUVr5y10S/O8No@WIwnwfxXUbrkyFAISwbuwqCbGS0HRH@7iheIIDdEApRU6mcz7vr3LrD@uhBStP8Ag |
| 18:52:28 | → | finsternis joins (~X@23.226.237.192) |
| 18:53:53 | × | Kaiepi quits (~Kaiepi@108.175.84.104) (Remote host closed the connection) |
| 18:54:30 | <mniip> | cpli, equationally I think this is always flatter = wrap . retract |
| 18:54:46 | → | Kaiepi joins (~Kaiepi@108.175.84.104) |
| 18:55:22 | <mniip> | wrap . fmap pure . retract |
| 18:56:14 | × | ss4 quits (~wootehfoo@user/wootehfoot) (Quit: Leaving) |
| 18:56:32 | × | gurkenglas quits (~gurkengla@p548ac72e.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
| 19:00:20 | <mniip> | ah wait my bad, they disagree on Free [Pure _, Free _, ...] |
| 19:00:46 | <mniip> | tbh that makes me think this operation doesn't have the vibe of being relevant to free monads |
| 19:02:11 | → | nihonium joins (~nihonium@46.148.105.76) |
| 19:12:01 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 19:15:43 | × | causal quits (~user@50.35.83.177) (Ping timeout: 252 seconds) |
| 19:17:40 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
| 19:18:51 | → | Guest13 joins (~Guest13@c83-248-102-237.bredband.tele2.se) |
| 19:19:26 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 19:21:53 | × | Guest13 quits (~Guest13@c83-248-102-237.bredband.tele2.se) (Client Quit) |
| 19:25:01 | <cpli> | mniip you're here too?? |
| 19:25:04 | <cpli> | huh |
| 19:25:12 | <cpli> | how's study going? |
| 19:25:21 | → | merijn joins (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
| 19:25:24 | → | zant joins (~zant@62.214.20.26) |
| 19:26:53 | <cpli> | hmm |
| 19:27:00 | × | kuribas quits (~user@ptr-17d51elyntgmmzbvw93.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 27.1)) |
| 19:27:10 | <cpli> | really this is part of something that turns |
| 19:27:22 | <cpli> | data SyntaxDeep f = App f f deriving Show |
| 19:27:32 | <cpli> | into |
| 19:27:32 | <cpli> | data SyntaxFlat f = Flattened [f] deriving Show |
| 19:27:45 | <cpli> | so couldn't i retract on syntaxDeep? |
| 19:28:16 | <cpli> | not really.. since it would just flatten all applications, but i want to preserve (g a) in "f b (g a)" |
| 19:29:11 | → | causal joins (~user@50.35.85.7) |
| 19:29:57 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 255 seconds) |
| 19:34:05 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 19:35:12 | → | sammelweis joins (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) |
| 19:36:54 | → | zant joins (~zant@62.214.20.26) |
| 19:37:58 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 19:38:34 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 19:38:54 | × | troydm quits (~troydm@host-176-37-124-197.b025.la.net.ua) (Ping timeout: 260 seconds) |
| 19:41:45 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
| 19:42:22 | × | money quits (~money@user/polo) (Quit: money) |
| 19:42:41 | → | neminis joins (~neminis@43.21.135.77.rev.sfr.net) |
| 19:43:06 | → | zant joins (~zant@62.214.20.26) |
| 19:43:16 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 19:43:21 | <tomsmeding> | % putStrLn "mniip: because yahb was gone I made a replacement" |
| 19:43:21 | <yahb2> | mniip: because yahb was gone I made a replacement |
| 19:43:32 | → | money joins (~money@user/polo) |
| 19:43:45 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 19:44:16 | <geekosaur> | I still kinda miss the pastebin functionality though |
| 19:44:28 | <geekosaur> | %% putStrLn "doesn't work" |
| 19:44:49 | → | Guest13 joins (~Guest13@c83-248-102-237.bredband.tele2.se) |
| 19:45:22 | × | money quits (~money@user/polo) (Client Quit) |
| 19:45:36 | → | iqubic joins (~avi@2601:601:1100:edd0:7a35:ede8:5354:af72) |
| 19:45:39 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:5d48:f2d9:c47:66b6) |
| 19:45:50 | → | money joins (~money@user/polo) |
| 19:46:18 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 19:46:18 | × | azimut_ quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 19:46:18 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 19:46:18 | × | califax quits (~califax@user/califx) (Read error: Connection reset by peer) |
| 19:46:47 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 19:46:59 | × | neminis quits (~neminis@43.21.135.77.rev.sfr.net) (Client Quit) |
| 19:47:07 | → | gmg joins (~user@user/gehmehgeh) |
| 19:47:18 | → | califax joins (~califax@user/califx) |
| 19:47:32 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 256 seconds) |
| 19:47:50 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 19:50:26 | × | money quits (~money@user/polo) (Client Quit) |
| 19:53:55 | → | money joins (~money@user/polo) |
| 19:54:12 | → | zant joins (~zant@62.214.20.26) |
| 19:54:26 | × | Guest13 quits (~Guest13@c83-248-102-237.bredband.tele2.se) (Quit: Client closed) |
| 19:54:42 | × | titibandit quits (~titibandi@xdsl-78-35-173-119.nc.de) (Quit: Leaving.) |
| 19:55:17 | × | money quits (~money@user/polo) (Read error: Connection reset by peer) |
| 19:55:24 | → | chexum_ joins (~quassel@gateway/tor-sasl/chexum) |
| 19:56:44 | → | money_ joins (~money@user/polo) |
| 19:58:44 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
| 19:58:44 | × | merijn quits (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 255 seconds) |
| 19:58:57 | × | money_ quits (~money@user/polo) (Read error: Connection reset by peer) |
| 19:59:06 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Quit: No Ping reply in 180 seconds.) |
| 19:59:19 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 20:00:01 | × | sagax quits (~sagax_nb@user/sagax) (Read error: Connection reset by peer) |
| 20:00:18 | → | money joins (~money@user/polo) |
| 20:01:13 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
| 20:05:43 | → | zant joins (~zant@62.214.20.26) |
| 20:05:46 | × | eggplantade quits (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) (Ping timeout: 252 seconds) |
| 20:09:24 | × | anpad quits (~pandeyan@user/anpad) (Quit: ZNC 1.8.2 - https://znc.in) |
| 20:09:41 | → | anpad joins (~pandeyan@user/anpad) |
| 20:10:24 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 260 seconds) |
| 20:10:42 | × | lortabac quits (~lortabac@2a01:e0a:541:b8f0:5d48:f2d9:c47:66b6) (Quit: WeeChat 2.8) |
| 20:11:30 | → | zant joins (~zant@62.214.20.26) |
| 20:12:59 | → | crazazy` joins (~user@130.89.173.127) |
| 20:14:44 | × | crazazy quits (~user@130.89.171.62) (Ping timeout: 248 seconds) |
| 20:16:17 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 268 seconds) |
| 20:17:23 | × | nihonium quits (~nihonium@46.148.105.76) (Ping timeout: 256 seconds) |
| 20:17:33 | × | coot quits (~coot@2a02:a310:e241:1b00:ec1a:e9df:79ac:66ba) (Quit: coot) |
| 20:18:08 | × | acidjnk quits (~acidjnk@p200300d6e7137a51dd9a34ca5f6ed83a.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
| 20:22:01 | × | money quits (~money@user/polo) (Quit: money) |
| 20:22:08 | × | TimWolla quits (~timwolla@2a01:4f8:150:6153:beef::6667) (Quit: Bye) |
| 20:22:38 | → | money joins (~money@user/polo) |
| 20:23:02 | → | zant joins (~zant@62.214.20.26) |
| 20:24:09 | <mniip> | cpli, I graduated this summer |
| 20:28:09 | → | TimWolla joins (~timwolla@2a01:4f8:150:6153:beef::6667) |
| 20:28:13 | <cpli> | huh |
| 20:28:33 | <cpli> | math? |
| 20:28:50 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 260 seconds) |
| 20:30:05 | → | neminis joins (~neminis@43.21.135.77.rev.sfr.net) |
| 20:31:07 | × | hpc quits (~juzz@ip98-169-32-242.dc.dc.cox.net) (Ping timeout: 248 seconds) |
| 20:31:18 | → | rekahsoft joins (~rekahsoft@bras-base-wdston4533w-grc-02-142-113-160-156.dsl.bell.ca) |
| 20:31:37 | → | zant joins (~zant@62.214.20.26) |
| 20:33:44 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 20:34:37 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 20:35:39 | → | acidjnk joins (~acidjnk@p200300d6e7137a51dd9a34ca5f6ed83a.dip0.t-ipconnect.de) |
| 20:41:49 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 20:44:11 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 20:45:46 | → | hpc joins (~juzz@ip98-169-35-163.dc.dc.cox.net) |
| 20:45:55 | → | troydm joins (~troydm@host-176-37-124-197.b025.la.net.ua) |
| 20:46:32 | × | hpc quits (~juzz@ip98-169-35-163.dc.dc.cox.net) (Client Quit) |
| 20:46:44 | → | hpc joins (~juzz@ip98-169-35-163.dc.dc.cox.net) |
| 20:49:06 | × | money quits (~money@user/polo) (Quit: money) |
| 20:50:45 | → | money_ joins (~money@user/polo) |
| 20:51:25 | × | hpc quits (~juzz@ip98-169-35-163.dc.dc.cox.net) (Ping timeout: 252 seconds) |
| 20:51:48 | × | money_ quits (~money@user/polo) (Client Quit) |
| 20:52:31 | → | money_ joins (~money@user/polo) |
| 20:52:31 | → | fockerize joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 20:53:10 | × | money_ quits (~money@user/polo) (Client Quit) |
| 20:53:53 | → | money_ joins (~money@user/polo) |
| 20:58:22 | × | pagnol quits (~user@213-205-209-87.ftth.glasoperator.nl) (Ping timeout: 256 seconds) |
| 21:00:59 | → | nate4 joins (~nate@98.45.169.16) |
| 21:01:26 | × | money_ quits (~money@user/polo) (Quit: money_) |
| 21:01:50 | → | eggplantade joins (~Eggplanta@2600:1700:38c5:d800:dc47:5d05:725b:66f2) |
| 21:01:59 | → | money_ joins (~money@user/polo) |
| 21:03:49 | → | hpc joins (~juzz@ip98-169-35-163.dc.dc.cox.net) |
| 21:03:57 | → | pavonia joins (~user@user/siracusa) |
| 21:06:18 | × | nate4 quits (~nate@98.45.169.16) (Ping timeout: 256 seconds) |
| 21:07:38 | → | king_gs joins (~Thunderbi@2806:103e:29:94a4:81e0:429b:22ec:cf13) |
| 21:08:07 | × | neminis quits (~neminis@43.21.135.77.rev.sfr.net) (Quit: Client closed) |
| 21:10:06 | × | money_ quits (~money@user/polo) (Quit: money_) |
| 21:10:31 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 21:10:44 | → | money_ joins (~money@user/polo) |
| 21:11:21 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 21:11:54 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 21:12:26 | × | money_ quits (~money@user/polo) (Read error: Connection reset by peer) |
| 21:12:52 | × | Sauvin quits (~sauvin@user/Sauvin) (Ping timeout: 252 seconds) |
| 21:13:11 | → | money_ joins (~money@user/polo) |
| 21:15:49 | → | Sauvin joins (~sauvin@user/Sauvin) |
| 21:19:23 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Ping timeout: 255 seconds) |
| 21:20:48 | → | money joins (Guest1418@user/polo) |
| 21:27:03 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 21:27:14 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 21:27:40 | → | Bocaneri joins (~sauvin@user/Sauvin) |
| 21:27:47 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 21:28:02 | glguy_ | is now known as glguy |
| 21:28:03 | Bocaneri | is now known as Guest6927 |
| 21:29:15 | × | yahb2 quits (~yahb2@static.56.27.47.78.clients.your-server.de) (Remote host closed the connection) |
| 21:29:27 | → | yahb2 joins (~yahb2@2a01:4f8:c0c:5c7b::2) |
| 21:29:30 | × | Sauvin quits (~sauvin@user/Sauvin) (Killed (NickServ (GHOST command used by Guest6927))) |
| 21:29:36 | Guest6927 | is now known as Sauvin |
| 21:30:21 | <tomsmeding> | %% putStrLn "geekosaur tells lies" |
| 21:30:21 | <yahb2> | https://paste.tomsmeding.com/IYICDlAa |
| 21:30:33 | × | gmg quits (~user@user/gehmehgeh) (Remote host closed the connection) |
| 21:31:04 | <tomsmeding> | it creates pastes that expire in 1 day currently |
| 21:32:23 | × | chexum_ quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 21:33:12 | <monochrom> | May I use %%% to extend it to 2 days? :) |
| 21:33:14 | → | gmg joins (~user@user/gehmehgeh) |
| 21:33:18 | <tomsmeding> | haha |
| 21:33:44 | <monochrom> | "No, %%% means two independent pastebins" :) |
| 21:33:50 | <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) |
| 21:34:19 | <geekosaur> | tomsmeding, thanks! |
| 21:35:20 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 260 seconds) |
| 21:35:20 | <tomsmeding> | monochrom: and then it prints the two urls received interleaved, so you get hhttttppss::////ppaassttee..dteobmisamne.dnientg/... etc |
| 21:35:37 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 21:35:48 | × | ski__ quits (~slj@ext-1-443.eduroam.chalmers.se) (Ping timeout: 248 seconds) |
| 21:35:57 | <EvanR> | %% many (randomRIO (0,1) >>= \x -> case x of 0 -> putChar 'a'; 1 -> empty) |
| 21:35:57 | <yahb2> | https://paste.tomsmeding.com/943EqmSh |
| 21:36:15 | <EvanR> | blast |
| 21:36:18 | <tomsmeding> | :p |
| 21:36:52 | <monochrom> | haha tomsmeding that's a cool feature |
| 21:37:09 | <monochrom> | or rather s/'s/ would be/ |
| 21:37:31 | <tomsmeding> | % interleave [] l = l ; interleave l [] = l ; interleave (x:xs) (y:ys) = x : y : interleave xs ys |
| 21:37:31 | <yahb2> | <no output> |
| 21:37:49 | <EvanR> | patrick's parabox? |
| 21:37:55 | × | tcard_ quits (~tcard@2400:4051:5801:7500:19ce:ed82:2ab7:90f9) (Quit: Leaving) |
| 21:37:57 | <monochrom> | The interleaving should be randomized. |
| 21:38:40 | <glguy> | EvanR: a sokoban-like puzzle game on Steam that features recursion; levels are blocks on other levels and can be contained in themselves |
| 21:38:45 | <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 |
| 21:38:52 | <tomsmeding> | I'm amazed every time I see it |
| 21:38:52 | <EvanR> | oh nice |
| 21:38:56 | <EvanR> | like Infinite Turtles |
| 21:40:51 | <EvanR> | yes very much in similar spirit |
| 21:41:44 | <geekosaur> | sadly I no longer have the one I worked out ("you have a problem and you decide to use threads, now <interleaved gibberish>") |
| 21:42:01 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Remote host closed the connection) |
| 21:42:58 | <EvanR> | glguy, can I have your terminal that supports the doubly infinite nesting? Sounds handy |
| 21:43:29 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 21:43:44 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 21:44:35 | × | fockerize quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 246 seconds) |
| 21:44:54 | <EvanR> | interleaved gibberish is a luxury. Back in the type writer days the output would be striked over itself and misaligned |
| 21:44:59 | <tomsmeding> | https://paste.tomsmeding.com/BFVvzpf5 |
| 21:46:19 | <EvanR> | that threads get interrupted after 1 character is insane, is it really doing outputting 1 character at a time |
| 21:46:30 | × | money_ quits (~money@user/polo) (Quit: money_) |
| 21:48:01 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 21:48:08 | → | zant joins (~zant@62.214.20.26) |
| 21:48:43 | <tomsmeding> | EvanR: I mean I literally got these log lines just now, first try: https://paste.tomsmeding.com/FbiXiCbz |
| 21:48:50 | <tomsmeding> | first two lines are the log, 5-7 are my decomposition |
| 21:49:02 | <tomsmeding> | oh the L is a typo, should be : obviously |
| 21:49:16 | <glguy> | Often stderr is unbuffered and one character at a time while stdout is line buffered |
| 21:49:18 | <EvanR> | maybe it gets interrupted way faster than once per character |
| 21:49:20 | <mauke> | I bet it's a consequence of String = [Char] |
| 21:49:54 | <EvanR> | every once in a while you see a character, and since it's the same code, same rate of characters |
| 21:51:20 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 21:51:31 | <tomsmeding> | the log messages indeed go to stderr |
| 21:52:01 | <tomsmeding> | so probably that, plus a decent probability that those two haskell threads are still scheduled on the same physical core |
| 21:52:09 | <tomsmeding> | so the rts scheduler just round-robins |
| 21:52:13 | → | mrkun[m] joins (~mrkunmatr@2001:470:69fc:105::2:2a39) |
| 21:52:35 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 255 seconds) |
| 21:52:48 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Remote host closed the connection) |
| 21:53:08 | × | gmg quits (~user@user/gehmehgeh) (Ping timeout: 255 seconds) |
| 21:53:08 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 255 seconds) |
| 21:53:08 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 255 seconds) |
| 21:53:18 | <tomsmeding> | EvanR: I'd hope that traversing a link in a linked list is faster than doing a write(2) syscall on stderr :) |
| 21:53:40 | <tomsmeding> | so probably just the rts yielding on every IO operation |
| 21:53:51 | → | FinnElija joins (~finn_elij@user/finn-elija/x-0085643) |
| 21:54:11 | <dsal> | traverse write "some string" |
| 21:55:19 | × | husixu quits (~husixu@182.55.67.24) (Remote host closed the connection) |
| 21:55:27 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 21:55:27 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 21:55:27 | <EvanR> | if "some string" is a non trivial list program, there may be many more opportunities to yield |
| 21:55:37 | → | gmg joins (~user@user/gehmehgeh) |
| 21:55:49 | → | merijn joins (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) |
| 21:55:56 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 21:56:25 | <tomsmeding> | EvanR: look at the strings in my paste |
| 21:56:40 | <tomsmeding> | maybe some parts are nontrivial, but significant chunks are string literals |
| 21:56:55 | <EvanR> | the last paste was a paste of a paste, exhausting my depth limit |
| 21:57:22 | <dsal> | Heh. I had to check twice. |
| 21:57:47 | × | michalz quits (~michalz@185.246.204.93) (Remote host closed the connection) |
| 21:58:01 | <EvanR> | it seems to be a loop |
| 21:59:57 | <dsal> | > let paste = paste in paste |
| 21:59:59 | <lambdabot> | *Exception: <<loop>> |
| 22:00:30 | <tomsmeding> | EvanR: lol yes that one is a little magic |
| 22:00:35 | <tomsmeding> | but I was referring to this one https://paste.tomsmeding.com/FbiXiCbz |
| 22:00:56 | → | thyriaen joins (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
| 22:01:17 | × | accord quits (uid568320@id-568320.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 22:01:25 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Remote host closed the connection) |
| 22:02:13 | <geekosaur> | also last time I looked putStr didn't buffer the whole string as a single chunk, it looped doing putChar |
| 22:02:25 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 22:02:38 | <geekosaur> | which makes it far more likely that you get character interleaving |
| 22:03:23 | <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 |
| 22:03:26 | → | tomokojun_ joins (~tomokojun@37.19.221.160) |
| 22:03:30 | <tomsmeding> | *comparable |
| 22:03:47 | × | tomokojun quits (~tomokojun@37.19.221.160) (Remote host closed the connection) |
| 22:04:04 | <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 |
| 22:04:23 | <EvanR> | but not if there's an error in the 34th letter |
| 22:04:28 | tomokojun_ | is now known as tomokojun |
| 22:04:28 | × | tomokojun quits (~tomokojun@37.19.221.160) (Remote host closed the connection) |
| 22:04:29 | <tomsmeding> | yeah for stderr I guess it's the right thing to do |
| 22:04:40 | <geekosaur> | that should not come up |
| 22:04:48 | → | tomokojun joins (~tomokojun@37.19.221.160) |
| 22:05:40 | <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) |
| 22:06:09 | × | king_gs quits (~Thunderbi@2806:103e:29:94a4:81e0:429b:22ec:cf13) (Ping timeout: 265 seconds) |
| 22:06:17 | <EvanR> | % putStr ('a':'b':undefined) |
| 22:06:17 | <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:... |
| 22:06:27 | <tomsmeding> | geekosaur: not on stdout with optimisations enabled |
| 22:06:43 | <tomsmeding> | oh the optimisations are a red herring, correction: not on stdout when compiled |
| 22:07:07 | <tomsmeding> | in ghci, yes, because in ghci stdout is also unbuffered |
| 22:07:59 | <EvanR> | oof |
| 22:08:22 | <EvanR> | ./Main -- doesn't print ab |
| 22:08:28 | <EvanR> | runhaskell Main.hs -- prints ab |
| 22:09:06 | <EvanR> | I guess this is where someone comes out and says "I told you IO has no semantics" xD |
| 22:09:22 | <tomsmeding> | %% System.Process.system "echo \"main = putStrLn ('a':undefined)\" >b.hs; ghc b.hs -o b; ./b" |
| 22:09:22 | <yahb2> | https://paste.tomsmeding.com/0OwSOd1M |
| 22:09:31 | <mauke> | personally I think it should peek ahead to see how much of the string is already defined |
| 22:09:35 | <tomsmeding> | oh lol |
| 22:10:04 | <tomsmeding> | EvanR: this buffering thing is literally the case in almost every programming language |
| 22:10:51 | <EvanR> | ok it's the OS buffering behavior and not putStr doing two different things, at least |
| 22:11:08 | <tomsmeding> | EvanR: putStr is probably doing two different things |
| 22:11:15 | <EvanR> | o_O |
| 22:11:24 | <tomsmeding> | which is just like in C, C++, Java, JavaScript, Python, Rust, Go, name your language |
| 22:11:26 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 22:11:47 | <EvanR> | @src putStr -- second opinion |
| 22:11:47 | <lambdabot> | Source not found. Just what do you think you're doing Dave? |
| 22:11:52 | <tomsmeding> | EvanR: https://hackage.haskell.org/package/base-4.16.0.0/docs/System-IO.html#g:12 |
| 22:12:08 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 22:12:09 | <geekosaur> | pretty much every language does buffering because without it performance absolutely sucks |
| 22:12:11 | <tomsmeding> | EvanR: stdout is LineBuffering by default, stderr NoBuffering |
| 22:12:21 | <EvanR> | so ghc handles that |
| 22:12:25 | <tomsmeding> | you can hSetBuffering to change |
| 22:12:29 | <geekosaur> | doing a syscall on every character is horrid |
| 22:12:31 | <EvanR> | instead of C lib or the kernel |
| 22:12:37 | <tomsmeding> | yes |
| 22:12:49 | <geekosaur> | even in 2022 you can see individual characters get printed |
| 22:13:01 | <EvanR> | and the defaults are magically determined depending on build or not mode |
| 22:13:15 | <tomsmeding> | % System.Process.system "cd /tmp; echo \"main = putStrLn ('a':undefined)\" >b.hs; ghc b.hs -o b; ./b" |
| 22:13:16 | <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... |
| 22:13:20 | <tomsmeding> | there we go |
| 22:13:39 | <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. |
| 22:14:25 | <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 _ |
| 22:15:14 | <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." |
| 22:15:15 | × | chexum quits (~quassel@gateway/tor-sasl/chexum) (Remote host closed the connection) |
| 22:15:36 | → | zant joins (~zant@62.214.20.26) |
| 22:18:13 | <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? |
| 22:18:14 | <EvanR> | that part makes sense |
| 22:18:52 | <EvanR> | but why is the mode one way in runhaskell and another way after compilation, on the same kind of handle / object |
| 22:19:08 | → | chexum joins (~quassel@gateway/tor-sasl/chexum) |
| 22:19:16 | <tomsmeding> | EvanR: Because I guess it makes sense that the mode is NoBuffering in ghci, and runhaskell is literally ghci |
| 22:19:41 | <geekosaur> | because ghc cheats and decides the default mode based on whether it's using the bytecode backend instead of whether it's ghci |
| 22:19:51 | <tomsmeding> | doesn't explain why runhaskell doesn't hSetBuffering manually to smooth over the differences though |
| 22:20:01 | <geekosaur> | and ghci is unbuffered because haskeline requires it |
| 22:20:28 | <geekosaur> | (well, line editing in general, not haskeline in specific) |
| 22:20:38 | <tomsmeding> | not sure if haskeline is a great argument; ghci could very well switch buffering before and after executing a command |
| 22:21:24 | <tomsmeding> | but in ghci you kinda want to see partial output if an exception occurs halfway through |
| 22:21:47 | <EvanR> | and get a false impression of what will actually happen |
| 22:21:50 | <EvanR> | in production |
| 22:21:58 | × | Scraeling quits (~Scraeling@user/scraeling) (Quit: Going offline, see ya! (www.adiirc.com)) |
| 22:22:01 | <geekosaur> | you're getting that anyway in ghci |
| 22:22:22 | <tomsmeding> | EvanR: asynchronous exceptions are unpredictable under optimisations anyway :p |
| 22:22:26 | <EvanR> | no! I want to spawn graphics windows and interactively debug my game! xD |
| 22:22:31 | <tomsmeding> | so not sure there were many guarantees to begin with |
| 22:23:02 | <tomsmeding> | EvanR: you can, right, from ghci? Will just be a bit slower :) |
| 22:23:13 | <EvanR> | yeah you can, and now I'm paranoid |
| 22:23:31 | <EvanR> | will answers like 5 be 6 in production |
| 22:23:38 | <tomsmeding> | no |
| 22:23:45 | <tomsmeding> | buffering is not _that_ big of a deal :p |
| 22:24:24 | <tomsmeding> | unless you actively rely on getting "ab** Exception ..." as output and parsing that, in which case, don't do that :p |
| 22:25:12 | <EvanR> | yeah in simple scenarios, and ignoring bottom, buffering only changes performance |
| 22:25:39 | <tomsmeding> | also in complex scenarios, assuming that your production app doesn't crash halfway through |
| 22:25:39 | <EvanR> | but if two processes are interacting, seeing nothing until "you" send a newline might cause deadlock |
| 22:25:45 | <tomsmeding> | ye |
| 22:25:46 | <tomsmeding> | s |
| 22:25:50 | <tomsmeding> | that's why hFlush exists |
| 22:25:58 | <tomsmeding> | everyone in every language has to deal with that :p |
| 22:26:20 | <EvanR> | worse excuse ever! |
| 22:26:40 | <tomsmeding> | buffering has a massive performance impact though, if you output lots of stuff |
| 22:26:59 | <tomsmeding> | writing to a terminal is SLOW, especially some ones (cough windows cmd) |
| 22:27:02 | × | bobbingbob quits (~dfadsva@2604:3d09:207f:f650::7b3a) (Quit: Leaving) |
| 22:27:33 | <EvanR> | some protocols send like single character datagrams at a time! |
| 22:27:45 | <EvanR> | how is that not 100 times worse xD |
| 22:27:54 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Remote host closed the connection) |
| 22:28:09 | <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 |
| 22:28:18 | <tomsmeding> | in the former case, ... don't do that? |
| 22:28:33 | <tomsmeding> | I trust the number of users of such protocols is negligible :) |
| 22:28:41 | <EvanR> | they have to not batch so the other end gets timely updates |
| 22:28:44 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 22:28:46 | <geekosaur> | ssh |
| 22:28:58 | <tomsmeding> | right, unless your usecase requires it, sure |
| 22:29:11 | <geekosaur> | then again, there's a special mode for tcp/ip to support ssh and similar,m because it does buffering too |
| 22:29:14 | × | merijn quits (~merijn@c-001-001-017.client.esciencecenter.eduvpn.nl) (Ping timeout: 260 seconds) |
| 22:29:46 | <geekosaur> | becuase, whether it's network transfer or terminal output or file output or etc., character at a time I/O is really expensive |
| 22:30:09 | <EvanR> | if it's from user input I guess it's not that bad |
| 22:32:53 | → | Topsi joins (~Topsi@dialin-80-228-141-008.ewe-ip-backbone.de) |
| 22:38:23 | → | jao joins (~jao@cpc103048-sgyl39-2-0-cust502.18-2.cable.virginm.net) |
| 22:39:31 | × | Feuermagier quits (~Feuermagi@user/feuermagier) (Quit: Leaving) |
| 22:49:24 | → | ballast joins (~ballast@rrcs-24-43-123-92.west.biz.rr.com) |
| 22:51:04 | → | Guest26 joins (~Guest26@2001:999:488:5cc:e5b0:b492:b43a:8f46) |
| 22:54:54 | <Guest26> | @pl (\x -> splitAt (div (length x) 2) x) |
| 22:54:54 | <lambdabot> | splitAt =<< flip div 2 . length |
| 22:58:20 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 22:59:33 | <Guest26> | What does =<< mean? |
| 22:59:43 | <mauke> | @src (=<<) |
| 22:59:43 | <lambdabot> | f =<< x = x >>= f |
| 22:59:44 | → | fockerize joins (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 23:00:00 | <EvanR> | d-_-b |
| 23:01:48 | <EvanR> | :t (=<<) |
| 23:01:49 | <lambdabot> | Monad m => (a -> m b) -> m a -> m b |
| 23:04:36 | <mauke> | it doesn't help that the monad in question is the naked reader |
| 23:04:36 | <mauke> | @pl \x -> f (g x) x |
| 23:04:37 | <lambdabot> | f =<< g |
| 23:04:37 | × | fockerize quits (~finn@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 256 seconds) |
| 23:04:41 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 255 seconds) |
| 23:06:35 | <mauke> | > let f' = f :: Expr -> Expr -> Expr in (f' =<< g) x |
| 23:06:36 | <lambdabot> | f (g x) x |
| 23:06:53 | <EvanR> | how to type application (=<<) to the (->) r type |
| 23:08:42 | <mauke> | ? |
| 23:08:50 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 23:08:57 | × | thyriaen quits (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) (Quit: Leaving) |
| 23:09:01 | <EvanR> | like, specialize the type to a particular m |
| 23:09:45 | <EvanR> | :t (=<<) @Maybe |
| 23:09:46 | <lambdabot> | error: |
| 23:09:46 | <lambdabot> | Pattern syntax in expression context: (=<<)@Maybe |
| 23:09:46 | <lambdabot> | Did you mean to enable TypeApplications? |
| 23:09:57 | <mauke> | was that a question? |
| 23:10:11 | <EvanR> | I'll just keep trying stuff until you tell me lol |
| 23:10:19 | <mauke> | tell you what? |
| 23:10:28 | <EvanR> | % (=<<) @((->) r) |
| 23:10:28 | <yahb2> | <interactive>:22:14: error: Not in scope: type variable ‘r’ |
| 23:10:41 | → | thyriaen joins (~thyriaen@2a01:aea0:dd4:470d:6245:cbff:fe9f:48b1) |
| 23:10:48 | <EvanR> | % (=<<) @Maybe |
| 23:10:48 | <yahb2> | <interactive>:24:1: error: ; • No instance for (Show ((a0 -> Maybe b0) -> Maybe a0 -> Maybe b0)) ; arising from a use of ‘Yahb2Defs.limitedPrint’ ; (maybe you haven't applied a ... |
| 23:13:45 | <ballast> | I'm looking for a function of type (a -> Maybe a) -> a -> [a]. Sort of like a bounded iterate. Should I just write takeWhile pred . iterate f |
| 23:14:53 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 23:15:10 | <EvanR> | :t unfoldr |
| 23:15:11 | <geekosaur> | :t unfoldM |
| 23:15:11 | <lambdabot> | (b -> Maybe (a, b)) -> b -> [a] |
| 23:15:11 | <lambdabot> | error: |
| 23:15:11 | <lambdabot> | • Variable not in scope: unfoldM |
| 23:15:11 | <lambdabot> | • Perhaps you meant one of these: |
| 23:15:16 | <geekosaur> | er, unfoldr, yes |
| 23:15:34 | <mniip> | cpli, mathematical physics |
| 23:15:58 | <ballast> | bah i figured it was unfoldr, thanks |
| 23:16:01 | <EvanR> | % :t (=<<) @Maybe |
| 23:16:01 | <yahb2> | (=<<) @Maybe :: Monad Maybe => (a -> Maybe b) -> Maybe a -> Maybe b |
| 23:16:13 | <EvanR> | % :t (=<<) @((->) [Int]) -- Guest26 |
| 23:16:13 | <yahb2> | (=<<) @((->) [Int]) -- Guest26 ; :: Monad ((->) [Int]) => ; (a -> [Int] -> b) -> ([Int] -> a) -> [Int] -> b |
| 23:16:27 | <ballast> | now to figure out how to make it compatible with what i wrote |
| 23:16:41 | <EvanR> | write your function in terms of unfoldr xD |
| 23:16:46 | <EvanR> | then use your function |
| 23:16:58 | <ballast> | that's the tricky part haa |
| 23:17:04 | <mauke> | :t fmap (join (,)) |
| 23:17:05 | <lambdabot> | Functor f => f a -> f (a, a) |
| 23:17:13 | <EvanR> | b = a in this case |
| 23:17:35 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Ping timeout: 268 seconds) |
| 23:17:44 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) |
| 23:17:48 | <mauke> | @pl \f a -> unfoldr (fmap (join (,)) . f) a |
| 23:17:48 | <lambdabot> | unfoldr . (fmap (join (,)) .) |
| 23:18:00 | <mauke> | :t unfoldr . (fmap (join (,)) .) |
| 23:18:01 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
| 23:18:22 | <mniip> | tomsmeding, looks like you're using a different ghci config |
| 23:18:35 | <mauke> | @unpl unfoldr . (fmap (join (,)) .) |
| 23:18:35 | <lambdabot> | (\ x -> unfoldr (\ x0 -> fmap (((,)) >>= \ x1 -> x1) (x x0))) |
| 23:18:41 | <mauke> | heh |
| 23:18:43 | <mniip> | idk if you're aware but you can set something like -dppr-cols10000 |
| 23:18:44 | <mauke> | that's even worse! |
| 23:18:55 | <ballast> | hmmm not enough symbols. :t unfoldr <$> ((<$>) (join (,)) <$>) |
| 23:18:58 | <mniip> | so that it doesn't try to pretty-print vertically |
| 23:19:05 | <mauke> | I "like" how it expands join to >>= id |
| 23:19:09 | <EvanR> | (\ x -> unfoldr (\ x0 -> fmap (((,)) >>= \ x1 -> x1) (x x0))) has a certain charm though |
| 23:19:11 | <ballast> | :t unfoldr <$> ((<$>) (join (,)) <$>) |
| 23:19:12 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
| 23:19:22 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 23:19:46 | <ballast> | now i'll just define (\/) = join and (||=>) = unfoldr |
| 23:19:51 | × | ddellacosta quits (~ddellacos@143.244.47.73) (Quit: WeeChat 3.7.1) |
| 23:19:52 | <mauke> | :t unfoldr `fmap` (fmap (join (,)) `fmap`) |
| 23:19:53 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
| 23:20:06 | <EvanR> | use unicode operators for good measure |
| 23:20:23 | <ballast> | but i can't type those |
| 23:20:27 | <ballast> | maybe if i get an APL keyboard |
| 23:20:28 | <mauke> | :t fmap unfoldr (fmap (fmap (join (,)))) |
| 23:20:29 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
| 23:20:37 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 23:20:44 | <EvanR> | typing is overrated, it leads to write-only code anyway |
| 23:20:52 | → | ddellacosta joins (~ddellacos@143.244.47.73) |
| 23:20:52 | <mauke> | as a general rule, at least half of the identifiers in any given Haskell program should be fmap |
| 23:21:08 | <ballast> | no need for lenses, just fmap 7 times |
| 23:21:11 | × | chomwitt quits (~chomwitt@2a02:587:7a0c:6a00:1ac0:4dff:fedb:a3f1) (Ping timeout: 246 seconds) |
| 23:21:18 | <c_wraith> | lenses fmap plenty. :P |
| 23:21:24 | × | zant quits (~zant@62.214.20.26) (Ping timeout: 248 seconds) |
| 23:21:28 | <mauke> | "good luck, I'm behind seven functors!" |
| 23:21:45 | <EvanR> | I'm starting to think renaming fmap to map wouldn't be that great after all |
| 23:23:12 | <ballast> | we should adopt the lisp style and let fffmap = fmap . fmap . fmap |
| 23:23:30 | <EvanR> | rather, fmap should just take any number of arguments? |
| 23:23:51 | <ballast> | i'm scared now |
| 23:24:08 | <mniip> | pure = liftA @0; fmap = liftA @1 |
| 23:24:31 | <EvanR> | liftA\0 liftA\1 |
| 23:24:31 | <mauke> | :t fmap (fmap unfoldr) (fmap fmap (fmap fmap join)) (,) |
| 23:24:32 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
| 23:24:32 | → | zant joins (~zant@62.214.20.26) |
| 23:24:39 | → | talismanick joins (~talismani@76.133.152.122) |
| 23:25:20 | → | Guest192 joins (~Guest19@69.181.32.7) |
| 23:27:50 | <Guest192> | hey I'm new to haskell and i'm trying to print my commit messages from github to a web page in ihp |
| 23:27:52 | <Guest192> | https://paste.tomsmeding.com/eWhrZJq0 |
| 23:27:59 | <mauke> | :t fmap fmap fmap unfoldr (fmap (fmap fmap) (fmap fmap) join) (,) |
| 23:28:00 | <lambdabot> | (a -> Maybe a) -> a -> [a] |
| 23:28:02 | <mauke> | h e l p |
| 23:28:21 | <Guest192> | this is what I came up with so far but I cannot seem to get they types to match up for liftIO |
| 23:29:03 | <Guest192> | I'm actually very lost as to how to proceed so any direction would be appreciated |
| 23:29:17 | <mauke> | I don't know this web stuff, but I don't think you're supposed to do I/O in your views |
| 23:29:37 | <dsal> | Guest192: General advice is to put type definitions on at least your toplevel bindings. I don't know what any of this is. |
| 23:30:24 | <dsal> | The bindings will give you better error messages at times. That first one, at least, isn't unclear, but is it what you mean to be doing? |
| 23:30:49 | EvanR | looks up ihp |
| 23:31:05 | <Guest192> | okay they display on my editor i can update the text one moment plz |
| 23:31:15 | <mauke> | why does CommitsView even exist here? isn't it supposed to contain the data you want to render? |
| 23:32:48 | <Guest192> | EvanR: https://ihp.digitallyinduced.com/ |
| 23:33:37 | <EvanR> | *The World's Most Powerful Programming Language At Your Fingertips* |
| 23:33:41 | <EvanR> | damn |
| 23:33:55 | <Guest192> | https://paste.tomsmeding.com/VhaJWi6b |
| 23:34:15 | <Guest192> | CommitsView exists to render the page |
| 23:34:32 | <Guest192> | I need to append I think to most of the stuff i say ehre |
| 23:35:01 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Remote host closed the connection) |
| 23:35:56 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 23:37:06 | <Guest192> | it gets imported here https://paste.tomsmeding.com/UatnF9dz |
| 23:38:04 | <Guest192> | is there a difference between MonadIO and IO |
| 23:39:01 | <mauke> | is there a difference between Num and Integer? |
| 23:39:15 | × | sammelweis quits (~quassel@2601:401:8200:2d4c:bd9:d04c:7f69:eb10) (Quit: No Ping reply in 180 seconds.) |
| 23:39:45 | <EvanR> | yes there is a difference |
| 23:40:01 | <dsal> | Guest192: MonadIO is a type class that is used to allow arbitrary monads to provide access to IO. |
| 23:40:11 | <EvanR> | one is a class, one is a type |
| 23:40:28 | <EvanR> | :t liftIO |
| 23:40:29 | <lambdabot> | MonadIO m => IO a -> m a |
| 23:41:13 | <mauke> | :t fromInteger |
| 23:41:14 | <lambdabot> | Num a => Integer -> a |
| 23:41:52 | → | sammelweis joins (~quassel@c-68-48-18-140.hsd1.mi.comcast.net) |
| 23:42:00 | <Guest192> | if i understand correctly, liftIO provides the result of a MonadIO, which will be the left or right side depending on what happened |
| 23:42:29 | <EvanR> | it's for running an IO action within your monad that's not IO |
| 23:42:51 | <Guest192> | mmmm okay so I don't need this |
| 23:43:15 | <Guest192> | What I want is to go from IO Html -> Html |
| 23:43:17 | <EvanR> | or you can't do this if you aren't in a MonadIO |
| 23:43:25 | <dsal> | Guest192: That's not a thing. |
| 23:43:29 | → | Bocaneri joins (~sauvin@user/Sauvin) |
| 23:43:32 | × | Sauvin quits (~sauvin@user/Sauvin) (Killed (NickServ (GHOST command used by Bocaneri))) |
| 23:43:41 | → | emmanuelux joins (~emmanuelu@user/emmanuelux) |
| 23:43:46 | Bocaneri | is now known as Sauvin |
| 23:43:47 | <EvanR> | IO Html contains an Html like the ls command contains a list of files |
| 23:44:03 | <EvanR> | that's an old saying, I'm not sure if it helps xD |
| 23:44:33 | <dsal> | You can put stuff in IO, but you can't take stuff out of IO. You can manipulate things in IO, though. |
| 23:44:41 | <EvanR> | (I hate container analogies) |
| 23:44:45 | <dsal> | The question, I suppose, is why do you want the Html out of the IO? Aren't you going to send the HTML somewhere? |
| 23:45:49 | <mauke> | I think the real issue is, why are you trying to do controller/model stuff in your view? |
| 23:47:23 | <Guest192> | no reason, just generated a static view using ihp's admin |
| 23:47:37 | <EvanR> | pass what the view needs in as an argument |
| 23:48:03 | <EvanR> | pull it in from somewhere else |
| 23:48:23 | <Guest192> | mauke idk I was trying to do this https://paste.tomsmeding.com/2gUfbrjO and I just don't know where to proceed from here |
| 23:48:46 | <Guest192> | ohh interesting! |
| 23:49:07 | <Guest192> | EvanR I think I do need to do this somewhere |
| 23:49:50 | <mauke> | yeah, the MarkupM Html thing sounds like it simply assembles HTML from data |
| 23:50:05 | <mauke> | it's not supposed to reach out and fetch things on its own |
| 23:50:11 | <Guest192> | the tutorial has a controller for blog posts and comments and i had to do this for getting a posts comments https://paste.tomsmeding.com/LtTzH4f3 |
| 23:50:27 | <Guest192> | so i need to make a controller for this page and collect the messages there |
| 23:50:34 | → | gqplox joins (~textual@97e650e2.skybroadband.com) |
| 23:50:35 | <Guest192> | and pass that into the view? |
| 23:50:44 | <EvanR> | yeah you did I/O to get the data in the action, then you passed something to the view |
| 23:51:09 | <mauke> | that's why I said the CommitsView thing was weird; it doesn't contain any data |
| 23:51:55 | <mauke> | I assume the ShowView from the tutorial has a post (or postId) parameter? |
| 23:52:06 | <EvanR> | what is going on here |
| 23:52:07 | <EvanR> | render ShowView { .. } |
| 23:52:15 | <mauke> | ~magic~ |
| 23:52:43 | <EvanR> | why does web always require magic |
| 23:53:01 | <gqplox> | yo guys im back with my advent of code, any feedback? http://sprunge.us/jJVvn8 |
| 23:53:20 | <mauke> | EvanR: https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/record_wildcards.html |
| 23:53:22 | <Guest192> | EvanR data ShowView = ShowView { post :: Include "comments" Post } |
| 23:53:48 | <mniip> | gqplox, exercise: come up with a single pass "half" function |
| 23:53:53 | <mauke> | in this case, it means ShowView{ post = post } -- where 'post' is a local variable in that function |
| 23:54:10 | <mniip> | chunks is available in Data.List.Split.chunksOf |
| 23:54:12 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 23:54:15 | <EvanR> | the space character threw me off |
| 23:54:41 | <EvanR> | (render ShowView) { .. } -- xD |
| 23:54:50 | <mauke> | yeah, nah |
| 23:54:51 | <mniip> | take &&& drop = splitAt |
| 23:55:02 | <gqplox> | <no location info>: error: |
| 23:55:02 | <gqplox> | Could not find module ‘Data.List.Split’ |
| 23:55:02 | <gqplox> | It is not a module in the current program, or in any known package. |
| 23:55:26 | <mauke> | record update syntax is at the secret 11th precedence level |
| 23:55:29 | <gqplox> | i think i tried before i get this |
| 23:55:43 | <c_wraith> | you need to depend on the split package for that module |
| 23:55:48 | <mauke> | even more powerful than function application |
| 23:55:58 | <EvanR> | :t splitAt |
| 23:55:58 | <lambdabot> | Int -> [a] -> ([a], [a]) |
| 23:56:19 | <dsal> | gqplox: higher level, don't use a list for exactly two things. :) |
| 23:56:36 | <EvanR> | in this case it works out better |
| 23:56:47 | <EvanR> | because you can do foldl1 intersect on stuff |
| 23:56:51 | <mniip> | dsal, using a list here helps unify later code |
| 23:56:54 | <gqplox> | yeah I remembered from last time, But with lists i could solve on as many things as i wanted |
| 23:57:10 | <gqplox> | first solution it had two i used a tuple then next time i saw it needed three so i thought to use a list |
| 23:57:12 | <dsal> | Yeah, that's true. I did end up using a list myself, I think. |
| 23:57:16 | <mniip> | I used `readInput1 = map (toListOf both . halves) . lines` |
| 23:58:26 | <dsal> | I don't really like `head` here (partial function). I did a similar thing, but just folded my answer. |
| 23:58:26 | <mauke> | gqplox: for comparison, here is mine: http://sprunge.us/DpHnCc |
| 23:58:49 | <EvanR> | head isn't partial in this problem, because you're guaranteed to have duplicates xD |
| 23:58:56 | <dsal> | Oh, I totally forgot I wrote a BitSet type. Should use that. |
| 23:59:06 | <EvanR> | if you never use the bad input, partial functions are total! |
| 23:59:45 | <dsal> | Heh. `head` is bad for two reasons: 1. it doesn't work if there are 0 results. 2. it silently works if there's more than 1 result. |
All times are in UTC on 2022-12-03.