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

Simplify Reporter type #47

Closed
OliverJAsh opened this issue May 31, 2017 · 1 comment
Closed

Simplify Reporter type #47

OliverJAsh opened this issue May 31, 2017 · 1 comment

Comments

@OliverJAsh
Copy link
Contributor

The docs state a Reporter type as:

interface Reporter<A> {
  report: (validation: Validation<any>) => A;
}

However, it could just be a function instead:

(validation: Validation<any>) => A

This is a nitpick, but I noticed I accidentally deviated from your standard in my library, https://github.com/OliverJAsh/io-ts-reporters, where I just export a reporter function.

Does it make sense to simplify the type here, or are there reasons for keeping it as a function on an object?

@gcanti
Copy link
Owner

gcanti commented May 31, 2017

are there reasons for keeping it as a function on an object?

For consistency. It's just how type classes are encoded in fp-ts (static dictionaries)

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

2 participants