-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
239 additions
and
162 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.6") | ||
addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.4.5-SNAPSHOT") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Conclusion #{-} | ||
|
||
With Part II's look at `shapeless.ops`, | ||
we have arrived at the end of this guide to shapeless. | ||
We hope you found it useful for understanding | ||
this fascinating and powerful library. | ||
|
||
As functional programmers | ||
we value abstraction above all else. | ||
Concepts like functors and monads | ||
arise from years of programming research: | ||
writing code, spotting patterns, | ||
and making abstractions to remove redundancy. | ||
Shapeless raises the bar for abstraction in Scala. | ||
Tools like `Generic` and `LabelledGeneric` | ||
provide an interface for abstracting over data types | ||
that we previously thought unique and distinct. | ||
|
||
There have traditionally been two barriers to entry | ||
for aspiring new shapeless users. | ||
The first is the wealth of theoretical knowledge | ||
and implementation detail | ||
required to understand the bigger picture. | ||
Hopefully this guide has done its job in this regard. | ||
The second barrier is the fear and uncertainty | ||
surrounding a library that is seen | ||
as "academic" and "advanced". | ||
We can overcome this by sharing knowledge | ||
and showing each other the use cases, | ||
advantages, and disadvantages of its use. | ||
So please share this book with a friend... | ||
and let's scrap some boilerplate together! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
## Summary | ||
|
||
In this chapter we discussed | ||
In this chapter we discussed | ||
how shapeless represents natural numbers | ||
and how to calculate the length | ||
of an `HList` or `Coproduct`. | ||
and how we can use them in type classes. | ||
We saw some predefined ops type classes | ||
that let us do things like calculate lengths | ||
and access elements by index, | ||
and created our own type classes | ||
that use `Nat` in other ways. | ||
|
||
Such calculations involve two parts: | ||
one at the type level involving | ||
the `Length` type classes and the `Nat` type, | ||
and one at the value level involving | ||
the `ToInt` type class and regular `Ints`. | ||
Between `Nat`, `Poly`, and the variety of | ||
type classes and examples we have seen in Part II, | ||
we have seen just a small fraction of | ||
the toolbox provided in `shapeless.ops`. | ||
There are many other ops type classes | ||
that provide a comprehensive foundation | ||
on which to build our own code. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.