Conversation
|
Why not use shapeless?
|
|
I don't want to have a dependency on Shapeless for this feature, so I added a small standalone implementation that covers the typical use cases in Slick. Support for Shapeless HLists should be trivial to implement (5 lines of code?). We could do this with a separate module once we have automated builds. |
|
Rebased |
|
At least maybe it should be a separate module/artifact in the codebase that could be published with slick and that slick would depend upon? |
|
I don't see the need for putting HLists into a separate module. The way they are written, they require Slick (because the Shapes are defined in the companion objects) and it's very little extra code. HList support for other libraries like Shapeless would have to go into separate modules which depend on Slick and the 3rd-party library. |
|
I think @nafg meant that it may be useful to have a slick-shapeless module that would use HLists from shapeless for those that don't mind the dependency. I think that can be added later. For now, having a simple HList in Slick seems like a good step forward. |
There was a problem hiding this comment.
The name Fold is misleading. This is not http://en.wikipedia.org/wiki/Fold_%28higher-order_function%29 . It is closer to something like http://reference.wolfram.com/mathematica/ref/Nest.html . It applies F (N+1) times to Z. Certainly needs a doc comment.
There was a problem hiding this comment.
But applying f (n+1) times to z is the catamorphism or fold for Nat (which essentially turns the Peano structure into Church Numerals)
There was a problem hiding this comment.
You are right. Added a doc comment to #231 . This should be enough.
|
@cvogt WDYT? |
|
LGTM (and thx for the separate commit, made it easy to review!) |
- Simplify MapperTest.testCustomShape. No need to introduce another HList here, now that we have a real one in Slick. Tests in HListTest, NatTest and MapperTest.testHList.
|
Rebased, reordered and squashed |
Add a custom HList implementation with a corresponding Shape, and simplify the handling of custom Shapes a bit.
Review by @cvogt