# Implicit Function Types

**URL:** <https://contributors.scala-lang.org/t/implicit-function-types/219>\
**Category:** Dotty\
**Created:** [December 7, 2016, 8:08pm UTC](https://contributors.scala-lang.org/t/implicit-function-types/219 "2016-12-07T20:08:56Z")\
**Posts on this page:** 1\
**Showing post:** 46

<div class="post-metadata">

**Author:** ![AMatveev](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/amatveev/32/847_2.png) [@AMatveev](https://contributors.scala-lang.org/u/AMatveev)\
**Post date:** [May 25, 2018, 9:00am UTC](https://contributors.scala-lang.org/t/implicit-function-types/219/46 "2018-05-25T09:00:35Z")

</div>

For comparison, there is extension in kotlin:  
see: [https://kotlinlang.org/docs/reference/extensions.html](https://kotlinlang.org/docs/reference/extensions.html)  
With this functionality we can make sql dsl:

```auto
fun search(name: String, minAge: Int?) = list {
    where {
        upper(c.name) like upper("%$name%")
        if (minAge != null) {
            and {
                c.age gte minAge
            }
        }
    }
}

```

In this example “where” is declared as:

```auto
fun where(op: WhereExpr.() -> Unit) =
            add(WhereExpr(this), op)

```

see:[https://github.com/edvin/kdbc/blob/master/src/main/kotlin/kdbc/expression.kt](https://github.com/edvin/kdbc/blob/master/src/main/kotlin/kdbc/expression.kt)

This is equivalent of scope injection.  
It’s very convenient.

---

_[View the full topic](https://contributors.scala-lang.org/t/implicit-function-types/219)._
