regex.sh

regex.sh

Elixir's `Enum.transpose/1` written by ChatGPT?

So I was going back and forward with ChatGPT about Elixir and tried making something using only GPT (it seems to be hot topic rn). Anyhow, suddenly ChatGPT gave me advice to use Enum.transpose. And when I told him that doesn’t exist, he continued to hallucinate. So I went down the rabbit hole and got this :smiley:
Any thoughts about implementing/adding this new function into the Enum module? :nerd_face:

Most Liked

LostKobrakai

LostKobrakai

[
  [1, 2, 3],
  [4, 5, 6],
  [7, 8, 9]
]
|> Enum.zip_with(& &1)
# [
#   [1, 4, 7], 
#   [2, 5, 8], 
#   [3, 6, 9]
# ]
lucaong

lucaong

This is a good reminder that, as impressive as they are, models like GPT are great at producing plausible content, not correct one :slight_smile:

Slight detour: I even think that it would be great if GPT-like models could express uncertainty in their output. Right now they sound like an overconfident but ultimately mistaken person that knows some stuff but is far from really understanding the topic.

Anyway, my opinion is that transpose is a special purpose function that only makes sense if the enumerable is representing a matrix as a collection of rows. As such, I don’t think that such a special case has its right place in Enum. In fact, depending on what the enumerable is, there are more efficient ways to do that.

lucaong

lucaong

Yeah this sounds like a recipe for trouble :slight_smile:

Where Next?

Popular in Discussions Top

matthias_toepp
I’d love to hear what people think about Wisp, the new Gleam web framework started by Gleam’s primary creator Louis Pilfold. Gleam, alon...
New
Jayshua
I recently came across the javascript library htmx. It reminded me a lot of liveview so I thought the community here might be interested....
New
sashaafm
I’m trying to evaluate the best combo/stack for a BEAM Web app. Right now I’m exploring Yaws a bit, after having dealt with Phoenix for a...
New
Fl4m3Ph03n1x
Background A few days ago I was listening to The future of Elixir from Elixir Talks, with Dave Thomas (@pragdave ) and Brian Mitchell. I...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
pillaiindu
In django there is a cache framework backed by memcached. Rails also puts a lot of emphasis on caching, and even the idea of russian-doll...
New
lucaong
Hello Elixir and Nerves community, I have been working for a while on an open-source embedded key-value database for Elixir, that I call...
230 13924 124
New
New
eteeselink
Hi all, In the last days, two things happened: A blog post titled “They might never tell you it’s broken” made the rounds. It’s about ...
New
Owens
Hello all, I am developing a new mobile app with Flutter frontend and Phoenix backend. The mobile app has real-time task management and c...
New

Other popular topics Top

malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31142 143
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement