Permalink
Browse files

citations were needed

  • Loading branch information...
gangstead committed Jan 8, 2015
1 parent ab2313c commit bb47585508501cbba142444a6391fbc5df6f8940
Showing with 25 additions and 5 deletions.
  1. +8 −0 README.md
  2. +1 −1 build.sbt
  3. +16 −4 slides/slides.md
View
@@ -11,6 +11,14 @@ This project includes the plugin to generate Eclipse project files. From the co
```
Then in Eclipse `File > Import > Existing Projects` and find this project.
+Optionally if you want to include the sources of the dependencies:
+```
+> sbt
+#sbt starts up...
+> eclipse with-source=true
+```
+This will take longer in big projects, but this project is small. I don't know why you can't just do `sbt eclipse with-source=true`. That's what the plugin docs say, but it won't work for me.
+
### IDEA
Intellij IDEA can import SBT projects natively.
View
@@ -13,4 +13,4 @@ scalacOptions := Seq(
)
libraryDependencies +=
- "com.typesafe.akka" %% "akka-actor" % "2.3.8" withSources() withJavadoc()
+ "com.typesafe.akka" %% "akka-actor" % "2.3.8"
View
@@ -97,6 +97,9 @@ A simple example would be the method map on String:
```scala
"abc".map(_.toInt)
```
+String does not support the method map, but StringOps does, and there’s an implicit conversion from String to StringOps available (see implicit def augmentString on Predef).
+
+.footnote[[Source](http://docs.scala-lang.org/tutorials/FAQ/finding-implicits.html#implicits-defined-in-current-scope)]
---
# Basic Example
```scala
@@ -150,8 +153,8 @@ We can make our own ScalaEnthusiastsStringOps...
- Reduce boilerplate code by having a bunch of conversions to one base class (aka [Magnet Pattern](http://spray.io/blog/2012-12-13-the-magnet-pattern/))
- `enhancement(thing)` becomes `thing.enhancement` (just preference?)
---
-#Implicit Classes Before
-~~Pimping~~ Bedazzling usually of the form
+# Implicit Classes
+~~Pimping~~ Bedazzling originally of the form
```scala
class BetterThing(t: Thing){
def enhancement = t + 1
@@ -166,7 +169,7 @@ val t = new Thing()
val u = t.enhancement
```
---
-#Implicit Classes After
+# Implicit Classes After
As of Scala 2.10 you have syntatic sugar:
```scala
@@ -181,8 +184,17 @@ import Helpers._
val t = new Thing()
val u = t.enhancement
```
-[Important Gotchas](http://docs.scala-lang.org/overviews/core/implicit-classes.html#restrictions)
+[Example](https://github.com/gangstead/implicitly-yours/blob/gh-pages/src/main/scala/gangstead/ImplicitClass.scala) in code.
+Some [Important Gotchas](http://docs.scala-lang.org/overviews/core/implicit-classes.html#restrictions)
+
+---
+
+# Bedazzling limitations
+- Cannot be ambiguous (nothing new here)
+- "Anyone can pimp" core primitives can change and break your code*
+- Requires explicit import that user might forget*
+.footnote[[*source](http://jsuereth.com/scala/2011/02/18/2011-implicits-without-tax.html)]
---
# Implicit Context Bounds

0 comments on commit bb47585

Please sign in to comment.