elixir icon indicating copy to clipboard operation
elixir copied to clipboard

Add :take to comprehensions

Open josevalim opened this issue 3 years ago • 7 comments

It expects a positive integer and it will restrict the amount of results returned. For into: "" and custom collectables, it controls how many times the collectable function is called.

josevalim avatar Nov 11 '20 15:11 josevalim

I would like to tackle this issue.

AlexJuca avatar Nov 21 '20 22:11 AlexJuca

Hi @AlexJuca! Contributions are always welcome but keep in mind this feature is actually quite complex to implement and it touches different parts of the compiler.

josevalim avatar Nov 22 '20 07:11 josevalim

Hey, @josevalim, I created a draft of this feature on this PR -> #10507. I believe it's a good starting point.

AlexJuca avatar Nov 22 '20 09:11 AlexJuca

@josevalim , I would love to work on this issue. Is it still open for PRs ?

Benjamin-Philip avatar May 06 '21 12:05 Benjamin-Philip

I have already started working on this. Unfortunately is a bit more complex than I expected, so I couldn't push it yet.

josevalim avatar May 06 '21 12:05 josevalim

@Benjamin-Philip btw, thanks for the PRs on Livebook and Nx!

If you are looking for things to help, there is still a lot of work to be done on Nx+Torchx by adding new functions, which you sent a PR for. :) If web is more your area of interest, there is also the Hex.pm repository. In particular, I know they are interested on implementing web auth (so you authenticate the CLI on the browser), so if you are interested you can open up an issue there asking more questions (I asked one of the maintainers if you could do that and he said yes. cc @wojtekmach).

I will keep thinking and let you know if anything else comes up. You are also welcome to join us on Slack.

josevalim avatar May 06 '21 12:05 josevalim

@josevalim,

@Benjamin-Philip btw, thanks for the PRs on Livebook and Nx!

You're welcome!

there is still a lot of work to be done on Nx+Torchx by adding new functions, which you sent a PR for. :)

Meh. Tensor compilers aren't my thing (probably because I don't know much about tensors, let alone compiling them). I was just curious about Nx.

if web is more your area of interest, there is also the Hex.pm repository. In particular, I know they are interested on implementing web auth (so you authenticate the CLI on the browser), so if you are interested you can open up an issue there asking more questions (I asked one of the maintainers if you could do that and he said yes. cc @wojtekmach).

This seems to be more of my interest... I will open up an issue when I get the time.. Though be warned/informed: I'm quite new to elixir and the erlang ecosystem. Wojtek will have to do thorough reviews before he merges my code so as to filter the sloppy/naïve bits. He most likely will also have to answer some questions with seemingly obvious answers. I hope he's okay with that.

I will keep thinking and let you know if anything else comes up.

Yes please do! I'm all open to suggestions!

PS: You should have sent me an email than bump the thread PSS: I should have replied with an email than bump the thread! :smiley:

Benjamin-Philip avatar May 07 '21 01:05 Benjamin-Philip

Closing this for now as we should probably add more general features to comprehensions rather than meal-piece ones.

josevalim avatar Aug 23 '22 06:08 josevalim