Title: Theory / Unimportant / CS / Programming / Haskell / for great good!+3
Tags: hasNotNewEffectReturnsMeaning FromInstruction computer_to_instruction some_instruction duplicate duplicateFromOtherBook type duplicateToOtherBook mathToSee automatedNewLineAfterCommaSpace declaration examplesSwitchExample1 has_seen_instruction_2 how
On every note of this deck, unless a note says otherwise:
Language: Haskell

Q: [...]
A: boolean negation
Q: [...]
A: not

Q: [...]
A: boolean conjonction
Q: [...]
A: &&

Q: [...]
A: boolean disjunction
Q: [...]
A: ||

Instruction: :set prompt "foo"
Page: 10
Effect: Set the prompt to "foo"
Chapter: 2
Section: 1

Instruction: True, False
Page: 5
Effect: Boolean constants
Chapter: 1
Typ: Bool

Instruction: ==
Page: 6
Effect: Equality of elements of the same type
Chapter: 1
Typ: Eq a => a -> a -> Bool

Instruction: [val_1, ..., val_n] (where ... actually should be explicit value)
Page: 8
Effect: Creating list with val_1, ..., val_n with same distance between elements
Chapter: 1
Variables: val__i of type t_i
Assuming: All t_i's are equal
Typ: [t_i]

Instruction: [val_1, val_2 .. val_n] (where .. actually appears in the code)
Page: 10
Effect: Creating list with val_1, val_2, up to val_n with same distance between elements
Chapter: 1
Variables: val_i: t_i
Assuming: All t_i's are equal
Typ: [t_i]

Instruction: [val_1 .. val_n] with .. actually in the code
Page: 10
Effect: Creating list with val_1,up to val_n with distance one betwen elements
Chapter: 1
Variables: val_i:Enum
Typ: typeOfval_i list

Instruction: [val_1, val_2 ..] where .. occurs in the code
Page: 10
Effect: Creating a list starting with val_1, val_2 with same distance between all elements until maximal element if it exists
Chapter: 1
Variables: val_i of type Enum
Typ: typeOfval_i list

Instruction: [val_1 ..] where ".." occurs in the code
Page: 10
Effect: Creating list with val_1, up to infty, with distance 1 between successive elements
Chapter: 1
Variables: val_1 : Enum
Typ: typeOfval_i list

Instruction: ++ (infix) or append (prefix)
Page: 9
Effect: Concatenation of 2 lists
Chapter: 2
Typ: [a] -> [a] -> [a]
Library: Data.list for append

Instruction: foo : bar
Page: 9
Chapter: 1
Section: 2
Returns: The list whose head is foo and tail is bar
Typ: a -> [a] -> [a]

Instruction: Integer
Page: 18
Effect: Unbounded ints
Chapter: 3

Instruction: Double
Page: 21
Effect: the native floating point representation
Chapter: 2

Instruction: tail
Page: 11
Effect: The input list without its first element if it exists. Exception Prelude.tail otherwise
Chapter: 2
Typ: [a]->[a]

Instruction: head
Page: 11
Effect: The first element if it exists. exception Prelude.head otherwise
Chapter: 2
Typ: [a]->a

Instruction: take n l
Page: 26
Chapter: 2
Returns: Return the n first elements of l
Typ: Int -> [a] ->[a]

Instruction: drop n l
Page: 26
Chapter: 2
Returns: the list without its n first elements
Typ: Int -> [a] ->[a]

Instruction: if cond
  then val_1
  else val_2
Page: 8
Effect: If cond is true then val_1 else val_2
Chapter: 2
Variables: cond : bool
val_i of type t_i
Assuming: t_1=t_2
Typ: t_i

Instruction: FunctionName pattern_1
|gard_1= code_11
|gard_2= code_12
|otherwise=code_13
FunctionName pattern_2= code_2
Page: 7
Meaning: A definition by case, testing each pattern in the defined order.
If a pattern is found, testing each guard until one holds. If none holds, otherwise is chosen, or the next pattern.
Language: Haskell
Chapter: 68a2
Section: 2
Identifier: FunctionName
Variables: gard_i of type Bool,
pattern_i of type t_i
code_ij of type t'_ij
Assuming: all t_i's are equal,
all t_ij's are equal,
Typ: t_i => t'_ij

Instruction: product
Page: 51
Effect: The product of the elements of the argument
Chapter: 3
Typ: (Foldable t, Num a) => t a -> a

Instruction: sum
Page: 51
Effect: The sum of the elements of the argument
Chapter: 3
Typ: (Foldable t, Num a) => t a -> a

Instruction: elem elt l
Page: 76
Chapter: 4
Returns: Whether elt belongs to l
Typ: (Foldable t, Eq a) => a -> t a -> Bool

Instruction: length
Page: 11
Effect: the length of the set
Chapter: 4
Section: 2
Typ: Foldable t => t a -> Int

Instruction: null s
Page: 11
Chapter: 2
Returns: Whether s is empty
Typ: [a]->Bool

Instruction: last
Page: 11
Effect: The last element of the list
Chapter: 2
Typ: [a]->a

Instruction: init
Page: 11
Effect: The entire list without its last element.
Chapter: 2
Typ: [a]->[a]

Instruction: reverse
Page: 80
Effect: reverse the list
Chapter: 4
Typ: [a]->[a]

Instruction: minimum
Page: 196
Chapter: 8
Returns: the minimal element of a set
Typ: (Ord a, Foldable t) => t a -> a

Instruction: maximum
Page: 196
Chapter: 8
Returns: the maximal element of a set
Typ: (Ord a, Foldable t) => t a -> a

Typ: String
Meaning: List of Char
Page: 9
Language: Haskell
Chapter: 2

Typ: Int
Meaning: The hardware's integers
Page: 21
Language: Haskell
Chapter: 3
Section: 1

Name: statically typed language
Definition: the type of each variable is known at compilation time
Page: 2
Chapter: 1

Instruction: foo bar_1 ... bar_n
Page: 6
Chapter: 2
Returns: Apply function foo to n arguments bar_1 ... bar_n

Name: homogenous data structure
Definition: A data structure which contains element of a single type
Page: 8
Chapter: 2
Example: List in Haskell
Counterexample: List in Python

Instruction: foo !! bar
Page: 10
Chapter: 2
Returns: The bar-th element of list foo

Instruction: cycle l
Page: 14
Chapter: 2
Section: 4
Returns: the list l repeated infinitely often

Instruction: repeat l
Page: 14
Chapter: 2
Section: 4
Returns: A list with an infinite number of l

Instruction: replicate n elt
Page: 14
Chapter: 2
Section: 4
Returns: A list with n copies of elt

Instruction: [foo(
  bar_1 ,
  ... ,
  bar_n
) | bar_1<- plop_1,
  ...,
  bar_n<- plop_n,
  miam_1,
  ... miam_m]
Page: 14
Chapter: 2
Section: 4
Returns: The list containing an occurrence of foo, for each value bar_i of the set plop_i satisfying each miam_j's condition

Instruction: :t foo
Page: 20
Effect: print the type of foo
Context: REPL
Chapter: 3
Section: 1

Typ: [foo]
Meaning: Type of list whose elements are of type foo
Page: 20
Language: Haskell
Chapter: 3
Section: 1

Typ: foo->bar
Meaning: Type of function taking an argument of type foo and returning a value of type bar
Page: 20
Language: Haskell
Chapter: 3
Section: 1

Instruction: foo::bar
Page: 20
Chapter: 3
Section: 1
Returns: foo, ensuring its type is bar

Typ: Float
Meaning: real floating point with single precision.
Page: 21
Language: Haskell
Chapter: 3
Section: 1

Typ: (foo_1 ... foo_n) => bar
Meaning: Type bar where the constraints foo are satisfied
Page: 22
Language: Haskell
Chapter: 3
Section: 1