Introduction Flashcards
Haskell consists of purely…
Mathematical Functions
Haskell computes via…
Reduction
Haskell is based on the…
Lambda Calculus
What are the 5 core traits of Haskell (and any functional programming language)?
Immutability, less side effects, purely mathematical functions, declarative, lazy evaluation.
Define Purely Mathematical Functions
Haskell works solely with mathematical expressions due to being based on the Lambda Calculus.
Define Immutability
Variables in Haskell can not be modified or re-assigned. This makes scripts easier to process for the CPU.
Define Less / No side effects
Due to immutability, Haskell variables have less chance of affecting variables outside of their local environment.
Define Declarative Language
A programming paradigm that identifies the constraints and end results of the program, and allows the compiler to provide the most effective way of reaching the end result, as opposed to imperative languages.
Declarative does not focus on the how.
Define Lazy Evaluation
Lazy evaluation means that only the absolutely necessary computations are made to achieve the end result.
Define Software Runaway
Software projects that don’t get finished due to increasing complexity and cost amongst other things.
Why is Haskell naturally easier to understand than imperative languages?
Because it is not referentially opaque, thus programmers don’t have to constantly keep state in mind. It’s stateless.
What is meant by referentially opaque?
Values of variables change over time. States are constantly changing.
No referential opacity means no…
Sequence and state.
Define referential transparency. Why does it make programming easier?
Values can’t change over time (immutable). This means programs in Haskell are stateless and are easier to run in parallel due to no update errors such as race condition.