Haskell Flashcards

1
Q

What do you do in imperative programming

A

Give a computer a sequence of tasks and it executes these tasks. While executing them it can change state.

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

What do you do in functional programming?

A

You dont tell the computer what to do but rather what stuff is. You cant change a variable state

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

What is functional programming?

A

Haskell is a purely functional programming language, which means it focuses on describing what things are rather than giving the computer a sequence of tasks to perform. In imperative languages, you set up tasks and can change state during execution. However, in Haskell, you express operations as functions that have no side effects, meaning they only calculate and return results. This approach has benefits like referential transparency, ensuring that the same function with the same inputs always produces the same result. This enables reasoning about program behavior, proving function correctness, and building complex functions from simple ones.

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

What is lazy in Haskell?

A

Haskell wont execute functions and calculate things unless its really forced to show you a result

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

What are programas

A

transformations on data

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

what is statically typed

A

the compiler knows which piece of code is a number which is a string and so on

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

What is in fix notation

A

calls a functino in infix with ``

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

If then else

A

if bool then res else res

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

Lists are homogenous

A

Store data of the same type

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

How a list

A

denoted by square brackets and the values in a list are separated by commas

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

Put strings together

A

++

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

cons

A

bEGINNING Of a list :

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

get element out of a list

A

!! indices start at 0

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

head, tail, last, init

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