F# Flashcards

(21 cards)

1
Q

What modern hardware architectures are compatible with F# through the .NET runtime.

A
  • x64
  • ARM32
  • ARM64 2
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Name the key features of F# mentioned in the report that defines its core identity or functionality.

PFCTI

A
  • Pattern Matching
  • First-Class Functions
  • Computation Expressions
  • Type Inference
  • Immutability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name the two programming paradigms supported by F# in addition to functional programming

OI

A
  • Object-oriented
  • imperative
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Name two ways F# handles program-level abstraction.

MN

A
  • Modules
  • Namespaces
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two (2) diagnostic controls introduced in recent versions of F# to enforce stricter code quality?

A
  • # warnon
  • # nowarn
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Values in F# are mutable by default, meaning they can be changed at any time within their scope.
True or False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The F# Software Foundation (FSSF) is a non-profit organization that is independent of Microsoft.
True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

F# 2.0 was first introduced as a standalone research project and was never shipped inside Visual Studio.
True or False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In F#, indentation defines the scope of blocks like loops and functions.
True or False

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The let keyword is used only for declaring constant values.
True or False

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

This specialized translator program translates F# source code into .NET Common Intermediate Language (CIL).

A

F# Compiler (fsc)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

This feature allows a developer to create a new variable with the same name as an existing one, effectively hiding the old one.

A

Shadowing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which data structure in F# is an ordered, immutable collection of elements that must all be of the same type?

A

List

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

This non-blocking loop construct, introduced in recent versions of F#, allows asynchronous control flow to remain as readable as standard imperative logic.

A

while! (while-bang)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What specific operator is used in F# to denote “not equal to”?

A

<>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain the difference between a “List” and an “Array” in F# syntax and memory structure.

A

In F#, a List is an immutable, linked structure where elements cannot be changed after creation. An Array is a fixed-size, mutable sequence that allows direct access to elements and can be modified.

17
Q

Describe how “Pattern Matching” works as a control-level structure.

A

Pattern matching acts as F#’s primary control flow expression by evaluating the shape or type of incoming data and branching to the corresponding result. It ensures strict program safety by refusing to compile until you have explicitly written a matching rule for every possible data scenario.

18
Q

Discuss the role of “Modules” in organizing F# code.

A

Modules act as static containers used to group related functions, values, and stateless operations together in one organized place. By separating this behavioral logic from the data itself, modules help keep your code clean, predictable, and easy to maintain.

19
Q

How does F# handle “Null” values differently than traditional C-style languages?

A

To prevent the runtime crashes common in C-style languages, F# discourages raw nulls and instead safely wraps potentially missing data in an explicit Option type.

20
Q

What is the significance of “Immutability by Default” in F# program structure?

A

Immutability by default means that once a value is bound to a name, it becomes permanently fixed and cannot be accidentally overwritten.