Skip to content

[Suggestion] don't use Enum #30

Description

@dkuku

Cool idea - I like it.
But I think you should not use Enum, instead use some other name like Enumdx.
Currently you can use Enum, Stream, Flow to have the same output, so it won't be confusing - more confusing will be having unsupported functions in the enum module or errors when I insert something between 2 enum calls

Schema
|> Enum.filter(..)
|> MyCustomInspect()
|> Enum.filter(..)

Maybe calling Enum should execute the query - just like it is with Streams right now ?

You can also look how some stuff is implemented in prql - it is a bit similar to elixir in syntax and generates sql

edit: I just checked and Nx also is not simulating any Enum functions - It uses Nx - so maybe Dx.filter would make sense?:

  defn softmax(t) do
    t
    |> Nx.exp()
    |> then(& &1 / Nx.sum(&1))
  end

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions