2021-05-21 12:31:03 +0200samhh(~samhh@90.252.103.244)
2021-05-21 12:31:46 +0200nsilv(~nsilv@212.103.198.210) (Quit: WeeChat 3.0.1)
2021-05-21 12:34:37 +0200 <cjay> nice
2021-05-21 12:34:43 +0200Robin_Jadoul(~Robin_Jad@152.67.64.160) (Ping timeout: 260 seconds)
2021-05-21 12:35:04 +0200juhppetersen
2021-05-21 12:38:04 +0200wonko(~wjc@user/wonko) (Quit: See You Space Cowboy..)
2021-05-21 12:50:25 +0200wonko(~wjc@62.115.229.50)
2021-05-21 12:51:00 +0200pcapriotti(pcapriotti@107.161.19.109)
2021-05-21 12:51:14 +0200azeem74(azeem@107.161.19.109)
2021-05-21 12:51:21 +0200lambdadog(~user@136.55.166.148)
2021-05-21 12:53:02 +0200 <tomsmeding> 🎉
2021-05-21 12:53:21 +0200azeem74(azeem@107.161.19.109) (Client Quit)
2021-05-21 12:54:30 +0200 <Hecate> hurray boxscape
2021-05-21 12:54:37 +0200 <boxscape> :)
2021-05-21 12:55:33 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-05-21 12:56:31 +0200pcapriotti(pcapriotti@107.161.19.109) (Quit: Connection closed)
2021-05-21 12:57:00 +0200lambdadog(~user@136.55.166.148) (Quit: rcirc on GNU Emacs 28.0.50)
2021-05-21 12:57:26 +0200 <prop> i was surprised at how quickly certain names were taken
2021-05-21 12:57:30 +0200 <prop> i wanted to take my forename
2021-05-21 12:57:32 +0200 <prop> but no chance
2021-05-21 12:57:34 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-05-21 12:57:35 +0200 <prop> or middle name, no chance
2021-05-21 12:57:43 +0200 <Hecate> I have a question that may sound like cargo culting, but would it be preferable to chain functions, or to call the next one inside the previous one?
2021-05-21 12:57:44 +0200lambdadog(~user@136.55.166.148)
2021-05-21 12:57:57 +0200 <prop> what do you mean hecate?
2021-05-21 12:58:03 +0200 <Hecate> so, chaining functions
2021-05-21 12:58:10 +0200 <Hecate> foo >== bar >== baz
2021-05-21 12:58:35 +0200cfricke(~cfricke@user/cfricke)
2021-05-21 12:58:41 +0200 <boxscape> as in (flip .)?
2021-05-21 12:58:42 +0200 <Hecate> or foo x = bar x ; bar y = baz y
2021-05-21 12:58:47 +0200 <boxscape> as in (flip (.))?*
2021-05-21 12:58:51 +0200 <Taneb> Hecate: I'd say chaining functions here
2021-05-21 12:59:00 +0200 <Hecate> (with a meaningful transformation of the argument inside each function, I'm not just inlining)
2021-05-21 12:59:14 +0200 <Hecate> Taneb: ok :) That's what I thought
2021-05-21 12:59:21 +0200 <Taneb> It means you can re-use them or test them individually easier
2021-05-21 12:59:24 +0200Robin_Jadoul(~Robin_Jad@152.67.64.160)
2021-05-21 12:59:26 +0200 <Hecate> yup
2021-05-21 12:59:39 +0200 <Hecate> yeah I guess continuations have some legit usage at a lower-level
2021-05-21 12:59:46 +0200 <prop> ooooh you mean to compose or write the call inside the function
2021-05-21 13:00:12 +0200pcapriotti(pcapriotti@107.161.19.109)
2021-05-21 13:00:21 +0200 <Hecate> yep
2021-05-21 13:00:52 +0200pcapriotti(pcapriotti@107.161.19.109) (Client Quit)
2021-05-21 13:01:05 +0200 <prop> i think sometimes for recursive functions at least, it is better to leave it with its fixed point argument
2021-05-21 13:01:18 +0200 <prop> the reason being is that there are caching libraries that can use the fixed point argument if i remember correctly
2021-05-21 13:01:31 +0200 <prop> but this depends on the situation ofc as to whether it matters
2021-05-21 13:01:34 +0200wonko(~wjc@62.115.229.50) (Changing host)
2021-05-21 13:01:34 +0200wonko(~wjc@user/wonko)
2021-05-21 13:01:49 +0200 <Hecate> oki doki!
2021-05-21 13:02:10 +0200 <dminuoso> Hecate: Personally Im quite fond of binding things in where clauses
2021-05-21 13:02:26 +0200infinisil(~infinisil@mail.infinisil.com)
2021-05-21 13:02:26 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-05-21 13:03:05 +0200 <dminuoso> Function composition is more useful when the composition itself has interesting structure, properties or reuse value
2021-05-21 13:03:17 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-05-21 13:04:07 +0200 <Hecate> I'm not sure what you suggest applies in the question I was asking (composition/piping vs continuations) although I am indeed fond of where clauses myself
2021-05-21 13:04:14 +0200 <maerwald> yeah, I also use $ more than ., unless . somehow feels right
2021-05-21 13:04:29 +0200fendor(~fendor@178.115.59.240.wireless.dyn.drei.com)
2021-05-21 13:04:43 +0200 <boxscape> don't tell ski
2021-05-21 13:04:57 +0200 <dminuoso> Hecate: well, its a sort of in between. rather than writing `foo (bar (quux x))` I might write `f = foo special where special = bar (quux x)`
2021-05-21 13:05:07 +0200fendor_(~fendor@178.115.59.240.wireless.dyn.drei.com)
2021-05-21 13:05:21 +0200 <dminuoso> Its hard to put into words, it largely depends on whether I want to put the focus and naming of things on the value itself, or the function.
2021-05-21 13:05:31 +0200 <Hecate> dminuoso: yeah that's still composition :3 at a lower-leve/codegen I doubt it changes much
2021-05-21 13:05:39 +0200knyppeldynan(~kristina@h-178-174-136-151.NA.cust.bahnhof.se) (Quit: Lost terminal)
2021-05-21 13:05:52 +0200 <boxscape> Oh is that what the question was about? I had assumed it was about readability
2021-05-21 13:06:04 +0200 <dminuoso> XY territory now. :)
2021-05-21 13:06:26 +0200 <prop> ? am confused too ?
2021-05-21 13:06:40 +0200 <Hecate> Taneb had a great point about testability in favour of chaining functions
2021-05-21 13:07:02 +0200 <Hecate> so I'll stick with chaining
2021-05-21 13:07:09 +0200 <Hecate> and will leave continuations to the compiler
2021-05-21 13:07:14 +0200 <dminuoso> Im quite confused now.
2021-05-21 13:07:25 +0200infinisil(~infinisil@mail.infinisil.com) (Quit: Configuring ZNC, sorry for the joins/quits!)
2021-05-21 13:07:51 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-05-21 13:08:03 +0200infinisil(~infinisil@mail.infinisil.com)
2021-05-21 13:08:25 +0200 <dminuoso> Hecate: What, to you, is the difference between "chaining functions" and "calling the next one inside the previous one"?
2021-05-21 13:08:35 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-05-21 13:08:38 +0200 <dminuoso> Your pseudo code examples don't parse in my head
2021-05-21 13:09:16 +0200knyppeldynan(~kristina@h-178-174-136-151.NA.cust.bahnhof.se)
2021-05-21 13:10:02 +0200 <Hecate> at the code level, function composition is flat
2021-05-21 13:10:13 +0200 <prop> personally i try to leave everything as point free as i can, but i think it is just a matter of taste really
2021-05-21 13:10:25 +0200 <prop> it is what you like?
2021-05-21 13:10:44 +0200 <dminuoso> "flat"?
2021-05-21 13:10:45 +0200 <Hecate> whereas with calling the next one inside the previous one, you call one function in your call-site, and this function will call the rest of the functions for you
2021-05-21 13:10:51 +0200 <__monty__> dminuoso: `f . g` vs `f x = something (g x)`
2021-05-21 13:11:09 +0200 <__monty__> Where the first f would be `f = something`.
2021-05-21 13:11:13 +0200 <dminuoso> __monty__: Yeah Im not sure, they sound.. confused..
2021-05-21 13:11:21 +0200 <Hecate> let me write a pastebin
2021-05-21 13:13:03 +0200 <Hecate> https://paste.tomsmeding.com/S7s8xhmO dminuoso
2021-05-21 13:13:28 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds)
2021-05-21 13:13:37 +0200 <dminuoso> So first, those are not continuations.
2021-05-21 13:13:41 +0200 <Hecate> ah, great
2021-05-21 13:13:44 +0200 <prop> when should i use haskell.nix or cabal2nix? i'm annoyed at not having the right system dependencies like C libraries on different machines. also if i use nix can i run haskell binaries on other computers?
2021-05-21 13:13:51 +0200 <dminuoso> Secondly, you seem to be mixing monad bind and function call here.
2021-05-21 13:14:01 +0200 <dminuoso> So Im still not sure what you are asking about, exactly
2021-05-21 13:14:02 +0200merijn(~merijn@83-160-49-249.ip.xs4all.nl)
2021-05-21 13:14:11 +0200 <dminuoso> Function composition is (.), not (>>=)
2021-05-21 13:14:21 +0200 <dminuoso> The monadic equivalent of function composition is (>=>/<=<)
2021-05-21 13:14:24 +0200 <Hecate> prop: cabal2nix and haskell.nix are when you want nix to handle your haskell dependencies
2021-05-21 13:14:42 +0200 <Hecate> prop: for system deps like C libraries, just write a shell.nix
2021-05-21 13:14:54 +0200 <Hecate> prop: or use stack with nix support in the stack.yaml
2021-05-21 13:15:03 +0200 <dminuoso> prop: Broadly, callCabal2Nix is closer to stack where you have curated versions, and haskell.nix gives you wider freedom in picking versions.
2021-05-21 13:15:11 +0200 <dminuoso> (though haskell.nix has a lot of other tooling around it)