The Wayback Machine - https://web.archive.org/web/20210109122007/https://github.com/theiterators/kebs/issues/26
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

Provide mappings for all standard Java types #26

Open
luksow opened this issue Apr 5, 2018 · 4 comments
Open

Provide mappings for all standard Java types #26

luksow opened this issue Apr 5, 2018 · 4 comments

Comments

@luksow
Copy link
Contributor

@luksow luksow commented Apr 5, 2018

It's very common that you paste mappers for types like ZonedDateTime, UUID or Currency from project to project. It'd be nice to have those covered for kebs.

It might be done with typeclasses like Reads, Writes and CaseClass1Rep (or variant). This will allow us to easily write unmarshallers for Akka HTTP matchers and such.

User-facing data, like JSON or PathMatchers need special handling as throwing Exception is not the best idea ex. for spray-json.

@jborkowski
Copy link
Contributor

@jborkowski jborkowski commented Jan 28, 2019

Can I take this one?

@luksow
Copy link
Contributor Author

@luksow luksow commented Jan 29, 2019

@jborkowski sure. Two things you should discuss with me / @marcin-rzeznicki are:

  1. What typeclass to use and if it's CaseClass1Rep maybe it's a good time to make it more standalone from macros.
  2. List of types you'd like to cover.
@marcin-rzeznicki
Copy link
Contributor

@marcin-rzeznicki marcin-rzeznicki commented Jan 29, 2019

CaseClass1Rep as such is independent of macros. Macros are just one way of obtaining an instance of it.

@marcin-rzeznicki
Copy link
Contributor

@marcin-rzeznicki marcin-rzeznicki commented Jan 29, 2019

So, you can freely provide CaseClass1Rep for anything you want. The machinery should work. In fact, macros will not try to provide an instance of Rep for any Java type and bail out early. For the list of types you want to support you should probably go through some projects you're working on (or know about) and see what are the commonly hand-writted implicits that conform to this model.

@luksow luksow assigned luksow and unassigned luksow Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.