added composed call

This commit is contained in:
Jian Han 2018-01-02 09:02:21 +10:00
parent 4d46aaefac
commit 6808953da8

View File

@ -18,6 +18,10 @@ func main() {
// Consume the output.
fmt.Println(<-out) // 4
fmt.Println(<-out) // 9
for n := range sq(sq(gen(2, 3))) {
fmt.Println(n) // 16 then 81
}
}
//The first stage, gen, is a function that converts a list of integers to a channel that emits the integers in the list.