Skip to content
Browse files

played with return values

  • Loading branch information...
1 parent 08e47be commit 5b5bd37e9a9469c418ab2e7e67a48d95535f0ec8 @derekwyatt committed
Showing with 6 additions and 0 deletions.
  1. +6 −0 beginning-scala/functions.scala
View
6 beginning-scala/functions.scala
@@ -35,3 +35,9 @@ def typeFunction[T, U](i: T, f: T => U) = {
def toBeCalled(i: Int) = "toBeCalled returning " + i
typeFunction(200, toBeCalled)
+
+def t[T](f: Int => T): T = f(10)
+
+val intList: Int => List[Int] = i => (1 to i).toList
+
+println(t(intList).mkString("List(", ", ", ")"))

0 comments on commit 5b5bd37

Please sign in to comment.
Something went wrong with that request. Please try again.