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

Vertical type aliases for records. #12

Open
rupertlssmith opened this issue Nov 7, 2019 · 0 comments
Open

Vertical type aliases for records. #12

rupertlssmith opened this issue Nov 7, 2019 · 0 comments
Milestone

Comments

@rupertlssmith
Copy link
Collaborator

rupertlssmith commented Nov 7, 2019

The pretty printer can fit records onto single lines:

type alias AccessKeyMetadata =
    { userName : UserNameType, status : StatusType, createDate : DateType, accessKeyId : AccessKeyIdType }

but this is definitely better broken:

type alias AccessKeyMetadata =
    { userName : UserNameType
    , status : StatusType
    , createDate : DateType
    , accessKeyId : AccessKeyIdType
    }

A better rule is break if >1 field.

Only want to force break in the alias definition, not in pattern matches like { userName, status, createDate, accessKeyId } or in expressions that build records, or in type annotations.

{-| Calc distance between two things that can be 2d points. -}
distance : { a | x : Int, y : Int } -> { b | x : Int, y : Int } ->  Int
@rupertlssmith rupertlssmith added this to the v5 milestone Dec 9, 2019
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

1 participant