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

Several functions with same name #10

Open
lucamug opened this issue Apr 28, 2020 · 1 comment
Open

Several functions with same name #10

lucamug opened this issue Apr 28, 2020 · 1 comment

Comments

@lucamug
Copy link

lucamug commented Apr 28, 2020

I am not that familiar with the library but I wonder if there could be some way to differentiate these functions.

Animator.xy

xy :
    Timeline state
    -> ( state
         -> { x : Movement
            , y : Movement
            }
       )
    -> { x : Float
       , y : Float
       }

Animator.Inline.xy

xy :
    Timeline state
    -> ( state
         -> { x : Movement
            , y : Movement
            }
       )
    -> Attribute msg

Animator.Css.xy

xy :
    { x : Float
    , y : Float
    }
    -> Transform
@Erudition
Copy link

Erudition commented Oct 26, 2023

The namespaces already differentiate them, no? If you are importing from more than one of these modules, it's expected that you wouldn't use exposing (..).

I think you are supposed to pick from one of (default), Inline, or Css methods to build your project's animations (as in the examples), so you normally wouldn't import the other two. In this sense, it makes sense that the functions have the same name, just like Html.Styled.div has the same name as Html.div.

The arguments taken differ based on the method chosen, but the difference should be consistent across all functions in the chosen module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants