mrh

joined 2 years ago
6
submitted 2 years ago* (last edited 2 years ago) by mrh@mander.xyz to c/vexillology@lemmy.world
 

7 stripes for 7 core founding fathers

13 stars in a circle for the original 13 colonies

1 larger, more prominent star in the center of the 13 for E Pluribus Unum

3:5 for both flag and blue corner

2
CSV Parsing (mander.xyz)
submitted 2 years ago* (last edited 2 years ago) by mrh@mander.xyz to c/haskell@programming.dev
 

New-ish to Haskell. Can't figure out the best way to get Cassava (Data.Csv) to do what I want. Can't tell if I'm missing some haskell type idioms or common knowledge or what.

Task: I need to read in a CSV, but I don't know what the headers/columns are going to be ahead of time. The user will provide input to say which headers from the CSV they want processed, but I won't know where (index-wise) those columns will be in the CSV, nor how many total columns there will be (either specified by the user or total). Say I have a [String] which lists the headers they want.

Cassava is able to read CSVs with and without headers.

Without headers Cassava can read in entire rows, even if it doesn't know how many columns are in that row. But then I wouldn't have the header data to filter for the values that I need.

With headers Cassava requires(?) you to define a record type instantiating its FromNamedRecord typeclass, which is how you access parts of the column by name (using the record fields). But in order for this to be well defined you need to know ahead of time everything about the headers: their names, their quantity, and their order. You then emulate that in your record type.

Hopefully I'm missing something obvious, but it feels a lot like I have my hands tied behind my back dealing with the types provided by Cassava.

Help greatly appreciated :)

[–] mrh@mander.xyz 1 points 2 years ago* (last edited 2 years ago)

Wow super excited about slices package! Very nice quality of life addition.

[–] mrh@mander.xyz 8 points 2 years ago* (last edited 2 years ago) (1 children)

This is patently false. Most alternatives to GNU software are permissively licensed (MIT, BSD, Apache, etc.). Just look at musl, clang, bzip2, and the various “new” userland replacements like ripgrep, neovim, bat, exa, dust, etc. The one notable exception is busybox which is GPL 2.

I don’t know why this trend exists, but I am constantly disappointed that talented young open source devs choose to sacrifice software freedom just because it will make their software easier to integrate in proprietary contexts. This strikes me as pure vanity or greed on the devs part so that their software is more popular and maybe even monetizable.

I hope that trend halts, but time will tell.

[–] mrh@mander.xyz 3 points 2 years ago* (last edited 2 years ago)

Nice to see a measured (though somewhat pro go) article about a big language’s strengths and weaknesses from someone whose been real world using it for long enough to experience the evolution of the language.

I’ve always liked go, and also think it made fundamentally good decisions and has evolved in a way that respects the original philosophy (e.g. adding generics, but only after massive consideration).

Reddit had an enormous hate totem for go, more than virtually any other language imo, and I always thought that was strange. Curious what people here think.

[–] mrh@mander.xyz 0 points 2 years ago* (last edited 2 years ago) (2 children)

Obsidian is not free software?! How could anybody even browsing this community consider obsidian?

[–] mrh@mander.xyz 1 points 2 years ago

Yep! I used it as a daily driver for ~a year, switched off to try something new, and have recently switched back indefinitely.

Only distro I’ve ever switched back to after leaving, and that’s because it’s where I plan to stay. It really lives in such a sweet spot of up to date, stable, and simple/hackable.

With a nice handbook, friendly community, runit, xbps-src, and multi lib/arch support, Void is truly great.

[–] mrh@mander.xyz 1 points 2 years ago* (last edited 2 years ago)

guix pull && guix upgrade is still a bit slow, but I never thought excessively slow (definitely slower than xbps, pacman, and probably apt too).

I guess I never thought much about it because of rollbacks, so it’s safe enough to just cron.

[–] mrh@mander.xyz 5 points 2 years ago (1 children)

Yeah Void is fantastic. I just switched back and I doubt I’ll be moving to anything else.

I only switched away in the first place because I had gotten so comfortable I wanted to try something new (Guix, also amazing!).

But there’s something so comfy about Void once you grok it, just lots of little good decisions which add up to a great experience.

[–] mrh@mander.xyz 2 points 2 years ago (1 children)

GNU Shepherd! Written and configurable entirely in Guile Scheme, just like Guix itself.

[–] mrh@mander.xyz 4 points 2 years ago* (last edited 2 years ago) (5 children)

I've never used Arch or Nix, but I switched from Void -> Guix and have been very happy with it. It's such a huge peace of mind to be able to have your whole system declaratively configured, package changes being atomic and generational (rollbacks so no worries about breakage), Guix shell for messing about, and being able to make your system do anything you can write in Scheme.

That's my daily driver. On servers so far I've gone with Debian Stable + Guix.

Also Void is still a fantastic distro, and is what I would use if not for Guix/Nix.

[–] mrh@mander.xyz 2 points 2 years ago (1 children)

lol glad to see you here on lemmy too, keep up the good and enthusiastic work :)

[–] mrh@mander.xyz 1 points 2 years ago* (last edited 2 years ago)

Guix is a source based (rolling release) distro. Any package operation you do like like installing, updating, or removing, can be rolled back. So if an update ever breaks anything you can just roll-back and wait for the fix. You can even pin that specific package and continue to upgrade the rest of your system. And every state is saved in a generation, so you can go to any state your system has ever been in package/configuration wise.

Nix has all of these advantages as well.

view more: ‹ prev next ›