Add explicit "Extension functions" section to README
diff --git a/README.md b/README.md
index 160d7b8..8f8ffbf 100644
--- a/README.md
+++ b/README.md
@@ -614,21 +614,45 @@
Methods also have parameters, varargs, KDoc, annotations, type variables, return type and receiver
type for extension functions. All of these are configured with `FunSpec.Builder`.
-Also, KotlinPoet can recognize single-expression functions and print them out properly. It treats
-each function with a body that starts with `return` as a single-expression function:
+#### Extension functions
+
+Extension functions can be generated by specifying a `receiver`.
```kotlin
-val abs = FunSpec.builder("abs")
+val square = FunSpec.builder("square")
.receiver(Int::class)
.returns(Int::class)
- .addStatement("return if (this < 0) -this else this")
+ .addStatement("var s = this * this")
+ .addStatement("return s")
.build()
```
Which outputs:
```kotlin
-fun Int.abs(): Int = if (this < 0) -this else this
+fun Int.square(): Int {
+ val s = this * this
+ return s
+}
+```
+
+#### Single-expression functions
+
+KotlinPoet can recognize single-expression functions and print them out properly. It treats
+each function with a body that starts with `return` as a single-expression function:
+
+```kotlin
+val abs = FunSpec.builder("abs")
+ .addParameter("x", Int::class)
+ .returns(Int::class)
+ .addStatement("return if (x < 0) -x else x")
+ .build()
+```
+
+Which outputs:
+
+```kotlin
+fun abs(x: Int): Int = if (x < 0) -x else x
```
#### Default function arguments