subject

Question 2 (1 point) Consider the following Scala function definitions: def f [X, Y] (a:Option[X], g:X=>Y) : Option[Y] = { a match { case None => None case Some (x) => Some (g (x)) } } def index [X] (xs:List[X], n:Int) : Option[X] = { xs match { case Nil => None case y::ys if (n == 0) => Some (y) case _::ys => index (ys, n - 1) } } What is the output of running: f (index (List (10, 11, 12), 1), (n:Int) => n * 2)

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:30
Which tab should you open to find the option for adding a header?
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
What provides an array of buttons for quick access to commonly used commands and tools
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
You know the right answer?
Question 2 (1 point) Consider the following Scala function definitions: def f [X, Y] (a:Option[X], g...
Questions
question
Mathematics, 18.05.2021 05:10
question
Mathematics, 18.05.2021 05:10
question
Mathematics, 18.05.2021 05:10
question
Mathematics, 18.05.2021 05:10