Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert a function capture lamda syntax to fn syntax #443

Open
mhanberg opened this issue Apr 30, 2024 · 0 comments
Open

Convert a function capture lamda syntax to fn syntax #443

mhanberg opened this issue Apr 30, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers workspace-command

Comments

@mhanberg
Copy link
Collaborator

A workspace command that converts a capture syntax lambda into an fn syntax version

Example:

defmodule Example do
  def run(list) do
    Enum.map(list, & &1 + 1)
  end
end

Using the workspace command on the capture operator will result in:

defmodule Example do
  def run(list) do
    Enum.map(list, fn one -> one + 1 end)
  end
end

Consider the following:

  • calculating the right number of parameters. a capture syntax might just say &3 in it, which means there are at least 3 parameters
@mhanberg mhanberg added enhancement New feature or request good first issue Good for newcomers workspace-command labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers workspace-command
Projects
None yet
Development

No branches or pull requests

1 participant