'Kotlin - function composition - explanation

I am following some video presentation on Kotlin's arrow library about functional programming. I have come to this example of function composition:

val greaterThanThree = { it > 3 } 
val even = { it % 2 == 0 }
val greaterThanThreeAndEven = greaterThanThree compose even

then it can be used for something like:

list.filter(::greaterThanThreeAndEven)

From my previous understanding of function composition is that the we pass the paramater to the first function then returned value is passed to the second function, like in this example:

fun compose(f: (Int) -> Boolean, g: (Int) -> Boolean): (Int) -> Boolean = {
                                                                   x -> f(g(x)) }

So, I don't know if I got this right, since I haven't been dealing with functional programming yet, but I thought the steps would be something like this:

val x = 8 is passed to greaterThanThree(8) evaluates to -> true
// then the confusing part for me is that according to the logic above true would be passed to even which makes no sense

even(true)

Can somebody explain me how are this two functions composed and what are the steps for this resulting composed function:

{ it > 3 && it % 2 == 0 } 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source