Starting Out Flashcards

1
Q

File name extension for Haskell

A

.hs

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

What compiler package to download

A

Haskell Platform / GHCI

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

Specify Not Equal to operator

A

/=

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

Get Help in GHCI environment

A

:?

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

To switch different prompt

A

:set prompt

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

To restore default prompt

A

:unset prompt

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

Rule for conditional statements

A

else part is necessary

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

unusual function name spec

A

quote is a valid character in function name

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

function name constraint

A

Name cannot begin with Upper case letters

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

Describe how function succ works

A

succ takes any input which has a defined successor and returns that successor

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

How to pass parameters to a function

A

function name and parameters are separated by space

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

Describe min function

A

Takes two parameters which can be ordered and returns the lesser item

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

How max function works

A

Takes two parameters which can be ordered and returns the larger item

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

Give an example of a function definition with Syntax

A

doubleMe x = x + x

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

Give an example function with control stmt if

A

doubleLT100 x = (if x < 100 then x*2 else x) + 1

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

Define a function with no parameters

A

conanOBrien = “Conan O Brian”