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 ![]()
Any thoughts about implementing/adding this new function into the Enum module? ![]()
Most Liked
LostKobrakai
[
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
]
|> Enum.zip_with(& &1)
# [
# [1, 4, 7],
# [2, 5, 8],
# [3, 6, 9]
# ]
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 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
Yeah this sounds like a recipe for trouble ![]()
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










