1/17
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is a compiler and what does it do?
A program which translates code into a standalone executable, called the GHC for Haskell.
What is an interpreter and what does it do?
An interactive interpreter which executes code directly (line-by-line), called the GHCi for Haskell.
What is the standard library for Haskell, and what is it good at?
Standard Prelude, good for list processing.
What is functional programming?
A programming paradigm (algebraic programming style) in which computation is the application of functions to arguments. Programs specify a data flow to describe what computations should happen (thus is declarative), not necessarily how.
What is imperative programming?
A programming paradigm (algorithmic programming style) in which computation is about modifying variables. Programs describe a control-flow to describe how computations should happen. Examples include Python, Java and C.
What is a function?
A mapping of arguments onto a single result. They can be defined as equations that match patterns.
What is an effectful function?
These functions’ outputs depend on/change internal, encapsulated states – thus, are affected by side effects, which are hidden state changes resulting from functions relying upon objects (like variables) external to its parameter list.
What is a pure function?
A deterministic function that takes all its inputs as arguments and produces all its outputs as results. It thus has no side effects.
What is a unary/binary function?
Takes one/two arguement(s).
What was early code, and why did it suck?
Early code was essentially assembly language, which was very hard to read, modify and debug.
What do high level langauges do well?
High-Level languages on the other hand abstract away from hardware details, using interpreters/compilers to translate into machine code. It lets programmers describe what to do, not how to manipulate the physical memory.
What do high-level languages use as tools?
Interpreters, compilers, or a mix of both.
What is the mix of both called?
JIT - “Just-in-time” hybrid compilation, using a compiler and then an interpreter to translate code at run-time.
What is infix notation?
Where you use backticks to insert a function name into a line between two arguments/other functions.
What is prefix notation?
Where you write the function (operations in brackets) before the arguments.
Can variables be changed? What does this mean?
Variables in function are immutable – they are defined once and cannot change. This means Haskell is referentially transparent.
What does referentially transparent mean?
Any expression can be replaced by its value without changing program behaviour.
What is an identity value?
Usually values that, when used in the operation defined by the function, do not change the function’s output.