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

Export oft-used types w/o exposing implementation #1

Closed
wants to merge 1 commit into from

Commits on Jan 21, 2021

  1. Export oft-used types w/o exposing implementation

    Export more types that meet these criteria:
    
    - Documented
    - Convenient for client code. They are already
    used in specs of public functions of their respective
    modules.
    - These types do not expose implementation details.
    
    The types are:
    
    ets.erl:
    - type() :: set | ordered_set | bag | duplicate_bag.
    
    supervisor.erl:
    - `restart() :: 'permanent' | 'transient' | 'temporary'
    - `mfargs() :: {M :: module(), F :: atom(), A :: [term()]
       | undefined}.`
    - `shutdown() :: 'brutal_kill' | timeout().`
    
    The reason for this change is to fix the status quo, which is
    that teams either must:
    - copy/pasta the types into client code, leading to code bloat and having
    to manually keep the types in sync.
    - OR refer to non-exported types, which will mean either more noise
    or less accuracy from code analysis tools. For example,
    Dialyzer will either warn or treat the types as `term()`.
    mheiber committed Jan 21, 2021
    Configuration menu
    Copy the full SHA
    c049e0d View commit details
    Browse the repository at this point in the history