Logs: liberachat/#haskell
| 2021-05-31 06:47:21 | → | favonia joins (~favonia@user/favonia) |
| 2021-05-31 06:47:36 | <mib_lfiwfw> | dminuoso: hmm |
| 2021-05-31 06:47:45 | <dminuoso> | mib_lfiwfw: One could think of a sorted list as one where each element is placed in between the lower sorted elements and the greater sorted elements. |
| 2021-05-31 06:48:04 | → | lortabac joins (~lortabac@2a01:e0a:541:b8f0:c68c:4252:bd9f:2d01) |
| 2021-05-31 06:48:04 | → | favonia_ joins (~favonia@user/favonia) |
| 2021-05-31 06:48:06 | <dminuoso> | With that view, you can think this of declarative programming |
| 2021-05-31 06:48:10 | × | favonia_ quits (~favonia@user/favonia) (Client Quit) |
| 2021-05-31 06:48:48 | <mib_lfiwfw> | dminuoso: I am curious how you would write quicksort in haskell |
| 2021-05-31 06:48:55 | <mib_lfiwfw> | just to compare |
| 2021-05-31 06:49:01 | <dminuoso> | I wouldn't to begin with. :p |
| 2021-05-31 06:49:03 | × | vicfred quits (~vicfred@user/vicfred) (Quit: Leaving) |
| 2021-05-31 06:49:06 | <dminuoso> | There's better sorts |
| 2021-05-31 06:49:12 | → | cfricke joins (~cfricke@user/cfricke) |
| 2021-05-31 06:49:15 | <koishi_> | hoare's trick is indeed ingenious, but perhaps it's not what makes it quicksort |
| 2021-05-31 06:49:35 | <mib_lfiwfw> | dminuoso: ok |
| 2021-05-31 06:49:36 | <koishi_> | there are parallel quicksort algorithms, and they are not in-place |
| 2021-05-31 06:49:36 | <dminuoso> | But roughly the same you'd write it in any language (except the mutation is hidden away with ST) |
| 2021-05-31 06:50:53 | <dminuoso> | But with inplace partitioning inside ST, the code doesn't look cute and pretty anymore.. so nobody shows you that. |
| 2021-05-31 06:51:15 | → | the-coot[m] joins (~the-cootm@2001:470:69fc:105::95f) |
| 2021-05-31 06:51:16 | <dminuoso> | Which is why I think this is a terrible example, at worst it might suggest to users that Haskell cant implement efficient quicksort. |
| 2021-05-31 06:51:37 | <mib_lfiwfw> | dminuoso: Igot that snippet form some haskell intro video |
| 2021-05-31 06:51:53 | <mib_lfiwfw> | I liked its syntax and style |
| 2021-05-31 06:53:18 | × | holy_ quits (~h01y_b4z0@2400:adc1:178:c800:9e45:76a9:57f2:1665) (Remote host closed the connection) |
| 2021-05-31 06:53:46 | → | holy_ joins (~h01y_b4z0@103.244.176.36) |
| 2021-05-31 06:54:42 | → | anandprabhu joins (~anandprab@87.201.97.214) |
| 2021-05-31 06:54:54 | o | is now known as niko |
| 2021-05-31 06:56:04 | × | solomon quits (~solomon@165.227.48.175) (Ping timeout: 250 seconds) |
| 2021-05-31 07:00:06 | × | slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving) |
| 2021-05-31 07:00:16 | → | Cubic joins (~hannesste@ip5f5be453.dynamic.kabel-deutschland.de) |
| 2021-05-31 07:01:02 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 2021-05-31 07:01:27 | → | chaosite joins (~chaosite@user/chaosite) |
| 2021-05-31 07:04:13 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-05-31 07:04:25 | × | mib_lfiwfw quits (a0ee4bcb@ircip1.mibbit.com) (Quit: https://mibbit.com Online IRC Client) |
| 2021-05-31 07:04:59 | → | ddellacosta joins (~ddellacos@89.45.224.118) |
| 2021-05-31 07:05:10 | <phma> | Is there a way to set up an out-of-source build in Cabal? |
| 2021-05-31 07:06:46 | × | chaosite quits (~chaosite@user/chaosite) (Ping timeout: 264 seconds) |
| 2021-05-31 07:07:52 | <sclv> | what means out of source |
| 2021-05-31 07:08:23 | <dminuoso> | "out-of-source" refers to keeping build artifacts separate from source code |
| 2021-05-31 07:08:33 | <dminuoso> | e.g. intermediate object files, final artifacts |
| 2021-05-31 07:08:55 | <dminuoso> | At least that's the terminology used in the C/C++ world |
| 2021-05-31 07:09:20 | <sclv> | cabal does that by default |
| 2021-05-31 07:09:44 | <sclv> | all its artifacts go in dist-newstyle |
| 2021-05-31 07:09:46 | × | ddellacosta quits (~ddellacos@89.45.224.118) (Ping timeout: 264 seconds) |
| 2021-05-31 07:09:47 | <phma> | I have the source in ~/src/foo/. I'd like the built binary to be in ~/build/foo/, where I keep data files I run the program on. |
| 2021-05-31 07:10:06 | <phma> | but dist-newstyle is inside the source directory |
| 2021-05-31 07:10:51 | <sclv> | you can cabal install the package and pass the —install-dir flag |
| 2021-05-31 07:11:23 | <sclv> | and it symlinks (or copies depending on flag) the exe to the target |
| 2021-05-31 07:11:46 | <phma> | I'm not installing it yet, I'm still working on it |
| 2021-05-31 07:12:11 | <sclv> | install just copies or symlinks the product to the specified dir |
| 2021-05-31 07:12:38 | <sclv> | if its an executable that is |
| 2021-05-31 07:13:06 | × | ell quits (~ellie@user/ellie) (Quit: The Lounge - https://thelounge.chat) |
| 2021-05-31 07:13:59 | <phma> | in my C++ projects I have ~/build/foo/grel, ~/build/foo/cdbg, etc. according to which compiler I use and whether it's a release, install, debug, or fuzzing build |
| 2021-05-31 07:14:36 | <phma> | and the binary goes in that file, with build artifacts in subdirectories of it |
| 2021-05-31 07:14:59 | <sclv> | ok thats dist-newstyle for cabal |
| 2021-05-31 07:15:19 | <sclv> | it just so happens to be in the project dir |
| 2021-05-31 07:15:43 | <phma> | but the dist-newstyle directory is inside the source directory, not the build directory |
| 2021-05-31 07:15:49 | <phma> | and I don't see the binary |
| 2021-05-31 07:17:10 | → | chaosite joins (~chaosite@user/chaosite) |
| 2021-05-31 07:17:43 | <sclv> | the binary is hidden in it |
| 2021-05-31 07:18:42 | <sclv> | https://cabal.readthedocs.io/en/3.4/nix-local-build.html#where-are-my-build-products |
| 2021-05-31 07:19:27 | <phma> | is there a way to tell cabal to put the binary in the build directory? and I'm not installing it because I'm still working on it |
| 2021-05-31 07:20:08 | <sclv> | install is that command. that’s literally all it does. If you don’t like the name... sorry |
| 2021-05-31 07:22:10 | <phma> | is there a way to run cabal in the build directory and tell it where the source directory is? that's how cmake works |
| 2021-05-31 07:22:25 | → | Lycurgus joins (~juan@cpe-45-46-140-49.buffalo.res.rr.com) |
| 2021-05-31 07:22:37 | × | chaosite quits (~chaosite@user/chaosite) (Ping timeout: 268 seconds) |
| 2021-05-31 07:22:53 | <sclv> | not that i know of. its a different tool, it has different flags and conventions. *shrug* |
| 2021-05-31 07:25:42 | × | arrowd quits (~arr@2.94.203.147) () |
| 2021-05-31 07:25:51 | <phma> | what does "nix-style" mean? |
| 2021-05-31 07:25:58 | × | riatre quits (~quassel@2001:310:6000:f::5198:1) (Ping timeout: 264 seconds) |
| 2021-05-31 07:26:45 | <phma> | where can I submit a feature request for cabal? |
| 2021-05-31 07:26:46 | → | riatre joins (~quassel@h203-145-233-111.ablenetvps.ne.jp) |
| 2021-05-31 07:26:57 | → | dpl joins (~dpl@77-121-78-163.chn.volia.net) |
| 2021-05-31 07:27:24 | <sclv> | ok first please explain why you want this |
| 2021-05-31 07:27:33 | <sclv> | other than “cmake does it” |
| 2021-05-31 07:27:43 | <sclv> | but also just go to the github |
| 2021-05-31 07:33:05 | × | holy_ quits (~h01y_b4z0@103.244.176.36) (Ping timeout: 268 seconds) |
| 2021-05-31 07:33:23 | <tomsmeding> | sclv: install does more, it also does a clean rebuild, right? |
| 2021-05-31 07:33:50 | <sclv> | yes, i was simplifying a bit |
| 2021-05-31 07:34:38 | <tomsmeding> | phma: nix-style means that it automatically builds and caches dependencies in the user-wide store in ~/.cabal when you mention them in the dependency list in your .cabal file |
| 2021-05-31 07:35:11 | → | mc47 joins (~yecinem@89.246.239.190) |
| 2021-05-31 07:35:31 | <tomsmeding> | nix is a tool that did this for other applications, and is somewhat used/known in the haskell world, and people chose this name to distinguish the behaviour from what cabal previously did |
| 2021-05-31 07:35:38 | <sclv> | this is all explained in The Fine Manual i linked |
| 2021-05-31 07:36:05 | <dminuoso> | 09:19:27 phma | is there a way to tell cabal to put the binary in the build directory? and I'm not installing it because I'm still working on it |
| 2021-05-31 07:36:21 | <dminuoso> | phma: There's a plumbing command in cabal 3.4.0.0 called `list-bin` |
| 2021-05-31 07:36:37 | <dminuoso> | For older versions, you can use `cabal-plan`. With those you can extract the build artifact with something like |
| 2021-05-31 07:36:48 | tomsmeding | is delighted |
| 2021-05-31 07:36:56 | <dminuoso> | $ cp $(cabal -v0 list-bin <target>) ./ |
| 2021-05-31 07:37:22 | → | cheater1__ joins (~Username@user/cheater) |
| 2021-05-31 07:37:24 | × | cheater quits (~Username@user/cheater) (Ping timeout: 268 seconds) |
| 2021-05-31 07:37:34 | cheater1__ | is now known as cheater |
| 2021-05-31 07:39:15 | → | ddellacosta joins (~ddellacos@86.106.121.235) |
| 2021-05-31 07:40:11 | <dminuoso> | phma: If you want a different directory for dist-newstyle, you can pass one of: --builddir, --distdir, --distpref DIR |
| 2021-05-31 07:42:43 | → | cheater1__ joins (~Username@user/cheater) |
| 2021-05-31 07:42:57 | × | cheater quits (~Username@user/cheater) (Ping timeout: 268 seconds) |
| 2021-05-31 07:44:11 | × | ddellacosta quits (~ddellacos@86.106.121.235) (Ping timeout: 268 seconds) |
| 2021-05-31 07:45:09 | → | bilegeek joins (~bilegeek@2600:1008:b06d:65ed:93d7:e6a:a06d:9e4) |
| 2021-05-31 07:45:30 | → | holy_ joins (~h01y_b4z0@2400:adc1:178:c800:9e45:76a9:57f2:1665) |
| 2021-05-31 07:47:23 | → | beka joins (~beka@104.193.170-254.PUBLIC.monkeybrains.net) |
| 2021-05-31 07:47:33 | × | cheater1__ quits (~Username@user/cheater) (Ping timeout: 265 seconds) |
| 2021-05-31 07:49:22 | <phma> | can I tell it --sourcedir? |
All times are in UTC.