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

add mapWithName and Functor instance #37

Closed
gcanti opened this issue Apr 8, 2017 · 0 comments
Closed

add mapWithName and Functor instance #37

gcanti opened this issue Apr 8, 2017 · 0 comments
Milestone

Comments

@gcanti
Copy link
Owner

gcanti commented Apr 8, 2017

function mapWithName<A, B>(f: (a: A) => B, type: t.Type<A>, name: string): t.Type<B> {
  return new t.Type(
    name,
    (v, c) => type.validate(v, c).map(f)
  )
}
@gcanti gcanti added this to the 0.3.1 milestone Apr 8, 2017
@gcanti gcanti closed this as completed in 5c65d4d Apr 24, 2017
gcanti added a commit that referenced this issue Apr 24, 2017
add mapWithName and Functor instance, fix #37
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