AFP Midtvejsevaluering

Quiz
•
Computers
•
University
•
Hard

Henrik Kirk
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Result of:
[-2;3;5] |> List.map (fun x -> x*2)
val it : int list = [-4; 6; 10]
val it : float list = [-4.0; 6.0; 10.0]
error FS0001: The type 'float' does not match the type 'int'
val it: int list = []
Answer explanation
Map transforms input type to output type of same shape
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
F# is
General purpose language with roots in FP
Functional first language with strong types, support imperative, FP and OOP
Purely functional with strong types
General purpose language with support of OOP and FP
Answer explanation
F# is functional first language in the ML language family. But offers OOP programming and can even be used to web, devops and much more
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which is the higher order function(s) in F#
'a -> int -> 'b -> float option list
'a -> 'b -> ('c -> int)
('a -> int) -> 'c
('a -> int) -> ('b -> 'c) -> ('d -> float)
Answer explanation
Functions that return a function or take other functions as paremeter
4.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
F# is lazy evaluated
True
False
Some
None
Answer explanation
F# is eagerly evaluated - Haskell is lazyly.
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which is the polymorphic function(s) in F#
(int -> float) -> int option -> float option
int -> int list
('a -> 'b) -> 'a -> 'b
int -> 'a list
Answer explanation
Polymorphic is also present in FP - sinze its just a way to state multiple forms.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Type of:
[1;2;3;4] |> List.fold (fun a b -> a + string b) ""
val it : string list
val it : string
val it : int
val it : int list
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Result of:
[1;2;3;4] |> List.fold (fun a b -> string (int a + b)) "0"
"0"
"10"
"11"
"1234"
Answer explanation
Type name is a function that converts to that type eg 'int' and 'string'
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
C Programming Quiz-1

Quiz
•
University
15 questions
C programming

Quiz
•
University
13 questions
Récursivité

Quiz
•
University
9 questions
Повторям материал

Quiz
•
University
15 questions
ARRAYLIST - JAVA

Quiz
•
University
10 questions
AppsLab_Q2

Quiz
•
10th Grade - Professi...
15 questions
Java Programming

Quiz
•
University
15 questions
Milking Minds 2 17-01-24

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University