!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

729 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org146 Servers

Load older messages


SenderMessageTime
17 Jan 2025
@alexfmpe:matrix.orgalexfmpe# my silly file defaultPackageSet = "98" defaultHLSSupport = [defaultPackageSet, maybeOthers...]16:16:29
@profpatsch:augsburg.oneProfpatschsternenseemann: project-wide search&replace on unique names >>> DRY 16:21:50
@profpatsch:augsburg.oneProfpatsch:P16:21:53
@b:chreekat.netchreekatDRY is in frequent conflict with YAGNI17:38:01
@bowuigi---now-more-based:kde.org@bowuigi---now-more-based:kde.orgYAGNI?17:38:43
18 Jan 2025
@b:chreekat.netchreekat @bowuigi---now-more-based:kde.org: you aren't gonna need it 08:47:05
@b:chreekat.netchreekat= avoid early abstraction as you would avoid early optimization 08:48:05
@bowuigi---now-more-based:kde.org@bowuigi---now-more-based:kde.orgAh, yeah those seem in conflict08:50:58
@alex:tunstall.xyzAlex
In reply to @b:chreekat.net
DRY is in frequent conflict with YAGNI

DRY: don't write the same thing twice
YAGNI: don't define something you don't (yet) need

I can see how they conflict when applied loosely, but applying DRY carefully should be OK.

13:27:32
@magic_rb:matrix.redalder.orgmagic_rb if i need lens_5_3_3 is there a way to overrideAttrs lens_5_3_2 into it? 22:43:57
@magic_rb:matrix.redalder.orgmagic_rbi tried just changing the version, but that unsurprisingly didnt work22:44:13
@magic_rb:matrix.redalder.orgmagic_rbchanging the src?22:45:54
@implicit_operative:matrix.orgymeister

Maybe something like this?

lens_5_3_3 = self.callHackageDirect {
  pkg = "HaskellNet-SSL";
  ver = "5.3.3";
  sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
} {};
22:46:10
@implicit_operative:matrix.orgymeister *

Maybe something like this?

lens_5_3_3 = self.callHackageDirect {
  pkg = "lens";
  ver = "5.3.3";
  sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
} {};
22:46:20
@implicit_operative:matrix.orgymeister *

Maybe something like this?

lens_5_3_3 = callHackageDirect {
  pkg = "lens";
  ver = "5.3.3";
  sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
} {};
22:46:36
@implicit_operative:matrix.orgymeister *

Maybe something like this?

lens_5_3_3 = pkgs.haskell.lib.callHackageDirect {
  pkg = "lens";
  ver = "5.3.3";
  sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
} {};
22:46:51
@magic_rb:matrix.redalder.orgmagic_rbhow does it know the deps? thats smells like IFD22:47:04
@magic_rb:matrix.redalder.orgmagic_rbor is a giant FOD, im fine with that22:47:22
@magic_rb:matrix.redalder.orgmagic_rboh, changing src did it, well, it still thought its compiling lens 5.3.2, but hey, if it works it works22:48:07
@implicit_operative:matrix.orgymeister It gets the tarball with the hash from hackage, and, I assume, gets the rest of the deps from nixpkgs. 22:48:12
@magic_rb:matrix.redalder.orgmagic_rb
pkgs.haskellPackages.lens.overrideAttrs {
  version = "5.3.3";
  src = pkgs.fetchzip {
     url = "mirror://hackage/lens-5.3.3/lens-5.3.3.tar.gz";
     hash = "sha256-3xm0+HH2CY3rcigl8x1kYVLOW5PVFhilg0s0hxHxzWE=";
  };
};
22:48:43
@magic_rb:matrix.redalder.orgmagic_rbright, but it doesnt know which deps, so it has to do a FOD or IFD22:48:58
@maralorn:maralorn.demaralorn
In reply to @implicit_operative:matrix.org

Maybe something like this?

lens_5_3_3 = pkgs.haskell.lib.callHackageDirect {
  pkg = "lens";
  ver = "5.3.3";
  sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
} {};
Yeah that uses ifd
22:57:30
@alexfmpe:matrix.orgalexfmpeFYI, using `sha256 = ""` does the same AAAA screaming23:04:36
@magic_rb:matrix.redalder.orgmagic_rbthat i know and it was the highlight of that years nix releases :)23:13:21
@alexfmpe:matrix.orgalexfmpehear hear23:37:59
19 Jan 2025
@b:chreekat.netchreekat They're fundamentally in conflict. You only avoid conflict precisely by applying them loosely. :) DRY, applied religiously, requires you to define abstractions very early that allow slightly different use cases to share common expressions. But abstractions have a cost. Copy/paste/modify is often cheaper. And most importantly, it requires a lot less careful thought. Wasting brainpower to develop a thoughtful abstraction for something that will never have more than two use cases is a shame. That's really the essence of YAGNI. 12:22:37
@maralorn:maralorn.demaralorn
In reply to @b:chreekat.net
They're fundamentally in conflict. You only avoid conflict precisely by applying them loosely. :) DRY, applied religiously, requires you to define abstractions very early that allow slightly different use cases to share common expressions. But abstractions have a cost. Copy/paste/modify is often cheaper. And most importantly, it requires a lot less careful thought. Wasting brainpower to develop a thoughtful abstraction for something that will never have more than two use cases is a shame. That's really the essence of YAGNI.
It's a very interesting dispute in our company. Our code is very YAGNI but the newer part of the team, mostly juniors, me included, have mostly heard the DRY gospel.
12:35:47
@maralorn:maralorn.demaralornEverytime my boss comes with a new requirement and it's a three liner for me because there is exactly one central function for it I am sooo happy.12:37:32
@maralorn:maralorn.demaralornWhereas applying the same API change roughly 15 times to slight variations of the same code drives me mad.12:38:17

Show newer messages


Back to Room ListRoom Version: 6