Skip to content

Neater syntax #7

@lJoublanc

Description

@lJoublanc

Is there some technical reason for the Impl object inside the newtype, rather than making the methods part of the newtype object itself?

It just seems to make everything clunkier ... i.e. writing MyInt.Impl(1) rather than just MyInt(1), like a value class? Perhaps there is some other way of doing this, but it's not obvious to me.

Also, would it make sense to add an unapply to allow pattern matches, again to work like a value class?

Great lib btw. The linked articles were also an compelling read for me!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions