aloisdg

aloisdg

Any news about adding a transpose function to the standard lib? It was discussed on the mailing list in 2021, but nothing since.

Transposing lists are a quite common operation and people often talk about it online like on this forum. From working with CSV, to doing the advent of code, transposing matrix is everywhere.

  • The impact on the eco-system would be limited. This is just another function.
  • The impact on learning would be good since this function is quite common in other language. Even VBA has it.
  • This suggestion is easily implemented with the state of Elixir
  • Some people wont need it but others will be grateful to find it.

cheers,

Showing Posts 1 to 8

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

There is a transpose function in Explorer which I think is a better fit than the standard library. Lists of lists are just flat not an efficient structure on which to do matrix operations, and I don’t think it makes sense to build a set of functions around using them for that purpose.

aloisdg

aloisdg OP

So we need an external dependence to do something as trivial as rotate a list of list? I am not asking to handle matrix in the standard library, I am asking for something for List and Enum.

benwilson512

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

Serious question: when are you rotating a list of lists in Elixir? Advent of code and other puzzles don’t count.

Explorer and Nx were created by the creators of elixir explicitly to do number crunching operations in the language. Given the extra dependencies involved and the relatively specialized area of work for those operations within the general use cases of the language.

LostKobrakai

LostKobrakai

Isn‘t Enum.zip_with(nested, & &1) what you‘re looking for?

aloisdg

aloisdg OP

Yes it is working. Note that what I am looking for is not quite an implementation of transpose but a way to add transpose to the library. This goal is not have to write it each time

transpose = fn nested -> Enum.zip_with(nested, & &1) end
aloisdg

aloisdg OP

Last time it was to handle data send by a client in day job. It was not in Elixir. So the answer to " Any update on a transpose function?" would be “none because not enough people ask for it” right?

dimitarvp

dimitarvp

I don’t speak for Ben but IMO the answer would be more along the lines of: “We deem this a more specialized functionality and as such we will not put it in the standard library and into a dedicated number-crunching library instead”.

aloisdg

aloisdg OP

alright. thank you

— All posts loaded —

Where Next? Top

Trending in Discussions Top

AstonJ
As the title says, please share what you’ve been up to with Elixir. Whether that’s been learning it, looking into it, making stuff with i...
2977 94592 917
New
cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
heathen
Quite interesting article Google brought me. Didn’t find any mentions about it here. What do you think in general? Would you use togethe...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
AstonJ
Since we have deprecated our Erlang sections (as we have dedicated Erlang Forums now) let’s add this thread for those who’d like to post ...
New
Null-logic-0
What IDE or editor are you using for Elixir development? Personally, I use Zed, and I really like it, but sometimes I wish there were a ...
New
maennchen
:warning: Security advisory: Decimal DoS vulnerability A vulnerability has been published for decimal where very large exponents can cau...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews