Logs: liberachat/#haskell
| 2021-06-22 11:43:21 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 244 seconds) |
| 2021-06-22 11:43:25 | → | awth13 joins (~user@user/awth13) |
| 2021-06-22 11:45:09 | <kritzefitz> | Las[m], yes you can, exactly as you say. Start a bound thread and pass your IO actions there using a channel. |
| 2021-06-22 11:45:18 | × | Feuermagier quits (~Feuermagi@user/feuermagier) (Ping timeout: 264 seconds) |
| 2021-06-22 11:46:21 | <boxscape> | dminuoso: MonadComprehensions works nicely with that |
| 2021-06-22 11:46:22 | <boxscape> | % let pred = (< 3) in foldrM (\x xs -> [x:xs | pred x]) [] [1,2,2] |
| 2021-06-22 11:46:22 | <yahb> | boxscape: [1,2,2] |
| 2021-06-22 11:46:46 | <dminuoso> | mmm |
| 2021-06-22 11:46:56 | <dminuoso> | Oh, using list monad itself, thats not bad either! |
| 2021-06-22 11:47:00 | <dminuoso> | % let pred = (< 1) in foldrM (\x xs -> [x:xs | pred x]) [] [1,2,2] |
| 2021-06-22 11:47:01 | <yahb> | dminuoso: *** Exception: user error (mzero) |
| 2021-06-22 11:47:10 | <dminuoso> | boxscape: except this is bad. mmm |
| 2021-06-22 11:47:13 | <dminuoso> | % :t let pred = (< 1) in foldrM (\x xs -> [x:xs | pred x]) [] [1,2,2] |
| 2021-06-22 11:47:14 | <yahb> | dminuoso: (Monad m, Alternative m, Ord a, Num a) => m [a] |
| 2021-06-22 11:47:16 | <boxscape> | :/ |
| 2021-06-22 11:47:22 | <dminuoso> | Oh, this probably defaults to IO |
| 2021-06-22 11:47:36 | <dminuoso> | % let pred = (< 1) in foldrM (\x xs -> [x:xs | pred x]) [] [1,2,2] :: Maybe [Int] |
| 2021-06-22 11:47:37 | <yahb> | dminuoso: Nothing |
| 2021-06-22 11:47:39 | <dminuoso> | Yeah this is good |
| 2021-06-22 11:48:32 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 2021-06-22 11:49:24 | <boxscape> | ah yeah I didn't realize the Just was missing in the output at first |
| 2021-06-22 11:49:57 | → | Feuermagier joins (~Feuermagi@user/feuermagier) |
| 2021-06-22 11:52:09 | × | kayprish quits (~kayprish@46.240.143.86) (Remote host closed the connection) |
| 2021-06-22 11:52:12 | <Las[m]> | kritzefitz: Thanks! Do you have any recommendations for how I'd get the result back to the calling Haskell thread? |
| 2021-06-22 11:52:36 | <merijn> | Las[m]: Oh, there's a simple solution for that |
| 2021-06-22 11:52:42 | <merijn> | Well "simple" :p |
| 2021-06-22 11:53:29 | <merijn> | Las[m]: Pass an empty MVar along with the IO action and have the thread running it write the result to the empty MVar |
| 2021-06-22 11:53:31 | <boxscape> | @pl \x -> [x | True] |
| 2021-06-22 11:53:31 | <lambdabot> | return . (| True) |
| 2021-06-22 11:53:54 | <boxscape> | that's kind of funny |
| 2021-06-22 11:53:57 | × | chomwitt quits (~Pitsikoko@2a02:587:dc0b:ff00:c813:70d9:31b2:b1b9) (Ping timeout: 268 seconds) |
| 2021-06-22 11:54:01 | <Las[m]> | Ah yeah that is simple, thanks |
| 2021-06-22 11:54:06 | <merijn> | boxscape: That's because pl is dumb and doesn't parse Haskell |
| 2021-06-22 11:54:19 | <merijn> | Las[m]: Then the original thread can just block on the empty MVar until it's done :) |
| 2021-06-22 11:54:25 | <boxscape> | yeah |
| 2021-06-22 11:54:37 | <merijn> | It's a super useful trick |
| 2021-06-22 11:55:03 | <Las[m]> | Thanks for the help! |
| 2021-06-22 11:55:54 | <dminuoso> | merijn: Wait, so automatically running @pl on my edit on save in emacs is a bad idea? |
| 2021-06-22 11:55:54 | × | xlei quits (znc@pool-68-129-84-118.nycmny.fios.verizon.net) (Read error: Connection reset by peer) |
| 2021-06-22 11:55:59 | × | fef quits (~thedawn@user/thedawn) (Remote host closed the connection) |
| 2021-06-22 11:56:16 | <merijn> | dminuoso: For several reasons :p |
| 2021-06-22 11:56:30 | → | fef joins (~thedawn@user/thedawn) |
| 2021-06-22 11:56:37 | <merijn> | Pretty sure that @pl on save is a great way to get lynched by future maintainers |
| 2021-06-22 11:56:37 | <boxscape> | I prefer running a macro that runs pl . unpl until a get a fixpoint |
| 2021-06-22 11:57:44 | <dminuoso> | merijn: Im sure that running @pl keeps you safe from future maintainers in the first place. |
| 2021-06-22 11:57:53 | <dminuoso> | So my life is safe. |
| 2021-06-22 11:58:56 | <maerwald[m]> | It's HLint's fault making haskellers believe that caring about pointfree is something inherently idiomatic |
| 2021-06-22 11:59:05 | <dminuoso> | boxscape: Sounds great. `let code' = fix (pl . unpl) code in ...` |
| 2021-06-22 11:59:12 | <merijn> | HLint is to blame for lots of stuff :p |
| 2021-06-22 11:59:12 | <dminuoso> | Profit? |
| 2021-06-22 11:59:36 | <tomsmeding> | just like writing in APL is profit, I guess |
| 2021-06-22 11:59:53 | <boxscape> | every once in a while running it on a function diverges but you know, that's what makes it fun |
| 2021-06-22 12:00:14 | <dminuoso> | tomsmeding: Im sure that if you're capable in APL, you will earn more than the top 5% Haskell earners.. |
| 2021-06-22 12:00:44 | <tomsmeding> | https://github.com/Co-dfns/Co-dfns/tree/master/cmp |
| 2021-06-22 12:01:04 | → | maroloccio joins (~marolocci@189.15.9.54) |
| 2021-06-22 12:01:13 | <boxscape> | ooh, self-documenting code |
| 2021-06-22 12:01:55 | <maerwald[m]> | Yeah, HLint also makes people put newtype everywhere there is only one constructor, thinking that's gonna fix all their space leaks |
| 2021-06-22 12:01:58 | × | Codaraxis quits (~Codaraxis@user/codaraxis) (Remote host closed the connection) |
| 2021-06-22 12:02:17 | → | Codaraxis joins (~Codaraxis@user/codaraxis) |
| 2021-06-22 12:02:19 | → | CookE[] joins (~thedawn@user/thedawn) |
| 2021-06-22 12:02:39 | <dminuoso> | If you have your ancient APL codebase, then due to lack of programmers you as the developer can dictate your price easily I think. |
| 2021-06-22 12:03:06 | <dminuoso> | APL is not like your run-off-the-mill JS clone that you simply teach to your average pythonista |
| 2021-06-22 12:03:20 | × | CookE[] quits (~thedawn@user/thedawn) (Remote host closed the connection) |
| 2021-06-22 12:04:07 | <tomsmeding> | maerwald[m]: not all that comes out of hlint is nonsense though. What I'd like, I think, is some way to run hlint in my HLS, but then be able to mark certain notes as "I don't want this" without having to pollute my source with annotations |
| 2021-06-22 12:04:13 | → | xlei joins (znc@pool-68-129-84-118.nycmny.fios.verizon.net) |
| 2021-06-22 12:04:23 | <tomsmeding> | but that's going to be hard to robustly implement |
| 2021-06-22 12:05:34 | × | fef quits (~thedawn@user/thedawn) (Ping timeout: 244 seconds) |
| 2021-06-22 12:06:35 | <boxscape> | tomsmeding: do you mean "I don't want this type of warning" or "I don't want this specific instance of this warning"? |
| 2021-06-22 12:06:50 | <maerwald[m]> | Most of what comes out of hlint is nonsense imo... or just not very useful, like "yoe could have omitted that 'do'"... yeah, so what |
| 2021-06-22 12:07:01 | <tomsmeding> | boxscape: this specific instance |
| 2021-06-22 12:07:10 | <boxscape> | ah, yeah, that sounds difficult |
| 2021-06-22 12:07:25 | <tomsmeding> | yeah I know that you can disable particular notes wholesale; not talking about that |
| 2021-06-22 12:09:06 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 2021-06-22 12:10:11 | <merijn> | HLint is great...if your opinions on formatting/writing Haskell overlap for 95% with Neil Mitchell :p |
| 2021-06-22 12:10:29 | <maerwald> | Then it tries to tell me that I should avoid `maybe` for golfing reasons |
| 2021-06-22 12:10:30 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 2021-06-22 12:10:46 | <tomsmeding> | or replace a non-trivial do block with applicative style :p |
| 2021-06-22 12:12:40 | <maerwald> | and then people think it's so useful, they have to include it as ERRORS in their CI, so now you got increased roundtrip times for fixing nonsensical stuff... or remember to run it before pushing |
| 2021-06-22 12:13:13 | <maerwald> | Then have annoyieg discussions about why you disabled a suggestion |
| 2021-06-22 12:13:59 | <maerwald> | "because it's nonsense" apparently isn't enough :p |
| 2021-06-22 12:14:02 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 2021-06-22 12:14:11 | <stevenxl> | morning folks |
| 2021-06-22 12:16:00 | <maerwald> | linters are placebo for code cleanliness |
| 2021-06-22 12:16:57 | × | korayal quits (~Koray_Al@213.14.171.115) (Quit: WeeChat 3.3-dev) |
| 2021-06-22 12:17:08 | → | korayal joins (~Koray_Al@213.14.171.115) |
| 2021-06-22 12:17:27 | × | korayal quits (~Koray_Al@213.14.171.115) (Changing host) |
| 2021-06-22 12:17:27 | → | korayal joins (~Koray_Al@user/korayal) |
| 2021-06-22 12:17:49 | × | korayal quits (~Koray_Al@user/korayal) (Client Quit) |
| 2021-06-22 12:17:59 | → | korayal joins (~Koray_Al@user/korayal) |
| 2021-06-22 12:20:55 | × | korayal quits (~Koray_Al@user/korayal) (Client Quit) |
| 2021-06-22 12:21:06 | → | korayal joins (~Koray_Al@user/korayal) |
| 2021-06-22 12:21:17 | <dminuoso> | merijn: Yeah this is precisely why I dont also use ormolu. |
| 2021-06-22 12:21:25 | <dminuoso> | I dont need someone else dictating their style on me. |
| 2021-06-22 12:21:45 | <dminuoso> | stylish-haskell's way of formatting import lists matches what I do anyway, so I use it for nothing but import list formatting |
| 2021-06-22 12:22:42 | tomsmeding | . o O ( users 1, 3, 4, 5 on this list are non-fans of linters and formatters https://ircbrowse.tomsmeding.com/nicks/lchaskell/all ) |
| 2021-06-22 12:23:33 | <tomsmeding> | maerwald is a bit further down the list on the old freenode haskell stats :p |
| 2021-06-22 12:25:30 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:e846:fcb5:a54b:afb8) |
| 2021-06-22 12:25:45 | × | chddr quits (~Thunderbi@31.148.23.125) (Quit: chddr) |
| 2021-06-22 12:29:24 | <merijn> | I'm simultaneously sad and glad the old ircbrowse stats died |
| 2021-06-22 12:29:40 | <merijn> | because they made me look like a slacker xD |
All times are in UTC.