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

Turn on coercion by default #67

Open
schwern opened this issue Feb 17, 2013 · 0 comments
Open

Turn on coercion by default #67

schwern opened this issue Feb 17, 2013 · 0 comments

Comments

@schwern
Copy link
Contributor

schwern commented Feb 17, 2013

#65 proposes adding a trait to turn on coercion. In Moose, coercion is declared on the type, but must be explicitly turned on at each use. Usually in an attribute, but also in signatures.

I find this very tedious. #66 will mitigate this somewhat by allowing one to make coercion the default. However I would rather it was the default as its conveniences outweigh its dangers. The Moose arguments against coercion seem to come from the C world where types don't make much sense and coercion is a far fuzzier concept.

My use cases are mostly about coercing strings into objects. URI strings into URI objects. File and directory paths into Path::Class objects. I'd rather if I'm using a type with coercion that it just worked without having to specially tell it to work.

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

No branches or pull requests

1 participant