Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,962 events total
2021-08-02 17:20:32 × arkho quits (~ccc@dynamic-acs-24-112-153-241.zoominternet.net) (Ping timeout: 252 seconds)
2021-08-02 17:20:34 <dminuoso> % main = do { args <- getArgs; let len = length args; print len }
2021-08-02 17:20:34 <yahb> dminuoso: ; <interactive>:58:63: error: parse error on input `}'
2021-08-02 17:21:15 <tromp> i tried
2021-08-02 17:21:16 <tromp> let legality = map (\fen -> fen ++ "\n " ++ research verbose (readFEN fen))
2021-08-02 17:21:16 <tromp> let verbose = "-v" `elem` args
2021-08-02 17:21:16 <tromp> getContents >>= mapM_ putStrLn . legality . filter (not . null) . lines
2021-08-02 17:21:37 <tromp> but that fails with error: Variable not in scope: verbose :: Bool
2021-08-02 17:22:00 <tromp> oh, need to reverse order?
2021-08-02 17:22:02 <dminuoso> tromp: drop the second let
2021-08-02 17:22:08 <dminuoso> and keep the alignment
2021-08-02 17:22:46 <dminuoso> This way let sort of looks like where, allowing you to write multiple potentially recursive definitions, but sitting in the middle of a do expression
2021-08-02 17:23:12 <tromp> ah yes, that works. thanks!
2021-08-02 17:31:28 × nf quits (~n@monade.li) (Quit: Fairfarren.)
2021-08-02 17:31:35 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2021-08-02 17:31:57 nf joins (~n@monade.li)
2021-08-02 17:32:17 × euouae quits (~euouae@user/euouae) (Quit: Client closed)
2021-08-02 17:33:38 arkho joins (~ccc@dynamic-acs-24-112-153-241.zoominternet.net)
2021-08-02 17:34:28 × bgamari quits (~bgamari@2001:470:e438::1) (Ping timeout: 256 seconds)
2021-08-02 17:36:07 × hendursa1 quits (~weechat@user/hendursaga) (Quit: hendursa1)
2021-08-02 17:37:05 hendursaga joins (~weechat@user/hendursaga)
2021-08-02 17:37:10 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds)
2021-08-02 17:40:58 × myShoggoth quits (~myShoggot@97-120-70-214.ptld.qwest.net) (Ping timeout: 272 seconds)
2021-08-02 17:41:33 boggin joins (~mikey@tyhog-gua01a-216.cronon.net)
2021-08-02 17:44:43 mikey joins (~mikey@79.140.120.237)
2021-08-02 17:47:05 × boggin quits (~mikey@tyhog-gua01a-216.cronon.net) (Ping timeout: 258 seconds)
2021-08-02 17:49:01 curiousgay joins (~curiousga@77-120-186-48.kha.volia.net)
2021-08-02 17:51:56 euouae joins (~euouae@user/euouae)
2021-08-02 17:53:01 <energizer> I generally favor replacing boolean flag arguments with two different functions. There are some blog posts about that, but they're mostly about, like, java. What do haskellers have to say about this?
2021-08-02 17:53:12 <euouae> I updated cabal with `cabal install cabal-install` and I get: 'Warning: Could not create a symlink in ~/.cabal/bin for cabal because the file exists there already but is not managed by cabal. You can create a symlink for this executable manually if you wish. The executable file has been installed at ~/.cabal/bin/cabal'
2021-08-02 17:53:28 <euouae> from 2.4.0.1 to 3.4.0.0
2021-08-02 17:53:53 bgamari joins (~bgamari@72.65.104.136)
2021-08-02 17:54:04 <sclv> ok so that warning should make sense to you and explain what happened
2021-08-02 17:54:27 <sclv> The old binary is in the first location and the new one in the second location
2021-08-02 17:54:35 <sclv> Manage em as you see fit
2021-08-02 17:54:38 <euouae> Iisn't that the same location?
2021-08-02 17:55:09 <sclv> hrm, good point?
2021-08-02 17:56:07 <sclv> The install logs should give more detail where everything ended up
2021-08-02 17:57:56 <euouae> It ended up in ~/.cabal/bin/cabal, I also checked with --version previously. Ok so the warning is a bit of a dud then right?
2021-08-02 17:58:18 <sclv> yeah must br
2021-08-02 17:58:18 <sclv> be
2021-08-02 17:58:31 <euouae> Do I just need to modify $PATH or is there some other step I need as well to have other tools that use cabal to use 3.4?
2021-08-02 17:59:04 <sclv> just path
2021-08-02 17:59:06 burnsidesLlama joins (~burnsides@dhcp168-023.wadham.ox.ac.uk)
2021-08-02 17:59:18 <euouae> great, thank you
2021-08-02 17:59:57 <sm> lechner: no, I didn't do any more work on it
2021-08-02 18:01:55 <geekosaur> energizer: look up "boolean blindness"; much of the discussion is about Haskell, because it's so easy to overcome in Haskell
2021-08-02 18:03:31 × deejaytee quits (~deejaytee@cpc91196-cmbg18-2-0-cust215.5-4.cable.virginm.net) (Quit: Leaving)
2021-08-02 18:03:35 MoC joins (~moc@user/moc)
2021-08-02 18:04:00 × burnsidesLlama quits (~burnsides@dhcp168-023.wadham.ox.ac.uk) (Ping timeout: 265 seconds)
2021-08-02 18:06:15 <energizer> geekosaur: looking
2021-08-02 18:07:27 <monochrom> I am surprised that there are now even blog posts on using booleans.
2021-08-02 18:07:53 <monochrom> Is there no end to this infinite descent into depravity?
2021-08-02 18:08:27 <monochrom> "Hi all I need a blog post that explains the number 1." "Hey there you're in luck I've just written one!"
2021-08-02 18:10:02 <euouae> flooding the search engines with crappy blog posts is the work of big publishers
2021-08-02 18:10:22 <euouae> ... at least that's what I came to believe after trying to search for some college stats stuff
2021-08-02 18:10:55 falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net)
2021-08-02 18:13:11 × jess quits (~jess@libera/staff/jess) ()
2021-08-02 18:13:25 <euouae> My blog depresses me because it's all wrong and needs a total rewrite
2021-08-02 18:13:47 <monochrom> Use the subtraction method. >:)
2021-08-02 18:14:04 <euouae> Remove until it's correct?
2021-08-02 18:14:30 <monochrom> Every rewrite begins with one bold step of deletion.
2021-08-02 18:15:12 <monochrom> Even openFile filename WriteMode begins with one bold step of erasure.
2021-08-02 18:15:24 <monochrom> s/Even/Every/
2021-08-02 18:15:44 <euouae> without enthusiasm you don't get those blog posts, and enthusiasm wanes as knowledge increases :P
2021-08-02 18:17:05 <monochrom> And knowledge wanes as enthusiasm increases.
2021-08-02 18:17:21 <euouae> :D:D
2021-08-02 18:17:27 × haskell-lurk quits (~haskell-l@78.155.54.115) (Quit: Client closed)
2021-08-02 18:17:34 <monochrom> This is why so many blog posts and the haskell wiki are of utterly poor quality in terms of pedagogy.
2021-08-02 18:18:19 <dsal> energizer: Can you expand on "boolean flag arguments"? Do you mean cli args? Or just function args. Boolean blindness is real, so there's generally a better, clearer way.
2021-08-02 18:18:50 <monochrom> Well, knowledge of the author doesn't wane. But knowledge that the audience can actually glean from the enthusiastically incoherent writing wanes.
2021-08-02 18:19:11 <energizer> dsal: yeah i mean function arguments
2021-08-02 18:19:45 <euouae> monochrom: I'm with you on that. It's something I like thinking about, how to efficiently transmit knowledge
2021-08-02 18:21:17 <dsal> energizer: Ah, yeah. Even knowing about boolean blindness, I had a function that took a bool I had to look up docs for every time I used it before fixing the api
2021-08-02 18:22:37 × chele quits (~chele@user/chele) (Remote host closed the connection)
2021-08-02 18:22:54 × justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.2)
2021-08-02 18:23:07 <monochrom> I am happy if a certain parameter really has only two legal values. I'm unhappy if it is hard to remember "so True means what? False means what?"
2021-08-02 18:23:51 <monochrom> There there are cases where it is easy to remember and/or guess. I don't always object to booleans.
2021-08-02 18:24:11 <monochrom> s/There there/But there/ # Clearly I have buffering problems.
2021-08-02 18:25:33 <euouae> hmm my cabal manual is out of sync with the cabal version
2021-08-02 18:25:35 johnw joins (~johnw@76-234-69-149.lightspeed.frokca.sbcglobal.net)
2021-08-02 18:25:48 <euouae> Guess I'll download the docs from the link I was given here previously
2021-08-02 18:26:15 <dsal> Sure, yes. Boolean is not always wrong. I was implementing a protocol that had a bit for resuming sessions. I could never remember whether true meant use an existing one or make a new one.
2021-08-02 18:26:41 <monochrom> "when :: Bool -> IO a -> IO a" is one of the good cases because the name "when" already helps you, for example.
2021-08-02 18:26:49 dschrempf joins (~dominik@070-207.dynamic.dsl.fonira.net)
2021-08-02 18:27:12 jgeerds joins (~jgeerds@55d45555.access.ecotel.net)
2021-08-02 18:27:17 <monochrom> Heh yeah that one is a tougher one.
2021-08-02 18:27:28 × falafel quits (~falafel@pool-96-255-70-50.washdc.fios.verizon.net) (Remote host closed the connection)
2021-08-02 18:27:52 falafel joins (~falafel@pool-96-255-70-50.washdc.fios.verizon.net)
2021-08-02 18:28:05 <monochrom> Clearly, "should I reuse or create?" the answer is "yes". >:)
2021-08-02 18:29:33 <monochrom> Maybe works better for "coffee or tea?"
2021-08-02 18:30:26 <monochrom> People in Hong Kong are actually fond of blending coffee with tea, BTW.
2021-08-02 18:30:34 <dsal> We're trained to map binary concepts to true/false/file_not_found and never look to see if there's a better way.
2021-08-02 18:31:22 <euouae> quantum coffee
2021-08-02 18:32:08 × gambpang quits (~ian@207.181.230.156) (Ping timeout: 252 seconds)
2021-08-02 18:32:59 <euouae> I loved discovering how Maybe is an Applicative that can be summed
2021-08-02 18:33:31 <euouae> as someone who likes boolean tricks... not entirely related to boolean blindness I suppose
2021-08-02 18:33:48 <euouae> but you could emulate Maybe with a tuple (Bool, a)
2021-08-02 18:34:17 <sclv> not really
2021-08-02 18:34:34 <sclv> for `Nothing` what do you put in the `a` slot?

All times are in UTC.