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

support option in abstract type (part 2) #2665

Merged
merged 3 commits into from
Mar 22, 2018
Merged

Conversation

bobzhang
Copy link
Member

No description provided.

@chenglou
Copy link
Member

For those following this, see #2663

I have a few comments:

  • What does the composition of [@@bs.deriving abstract] and [@@bs.deriving {jsConverter = newType}] look like?
  • The bikesheddy point is whether to generate setHeight or heightSet. I understand the name mangling point but I think we should go over this
  • Is it possible to go from a creation function to a record type instead?

@bobzhang
Copy link
Member Author

Is it possible to go from a creation function to a record type instead?

No, the whole point is that the type is abstract type, so you can write portable code

What does the composition of [@@bs.deriving abstract] and [@@bs.deriving {jsConverter = newType}] look like?

The semantics is slightly different, in jsConverter, the type could be abstracted, but it does not have to be. In deriving abstract, it has to be an abstract type

@bobzhang
Copy link
Member Author

let's move the discussion into #2614, the PR will be split into several parts

@bobzhang bobzhang merged commit a1e53a0 into master Mar 22, 2018
@bobzhang bobzhang deleted the customize_label_name_part2 branch March 22, 2018 03:54
@chenglou
Copy link
Member

No, the whole point is that the type is abstract type, so you can write portable code

Right. What about creation function that generates the abstract type? The main reason is that it circumvents some bs.optional or bs.default that'd otherwise be needed

@bobzhang
Copy link
Member Author

What about creation function that generates the abstract type

it will generate it

@chenglou
Copy link
Member

Yes, but I mean annotating a creation function, rather than declare a record type with potential [@bs.default] and [@bs.optional] annotations

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

Successfully merging this pull request may close these issues.

2 participants