vault backup: 2025-02-19 10:44:32

This commit is contained in:
Dane Sabo 2025-02-19 10:44:32 -05:00
parent bdc142f5a4
commit 18f65f1db0

View File

@ -1,7 +1,7 @@
# What is Haskell?
Haskell is a purely functional programming language.
What does that mean? What isn't a functional programming language? Well, just about every programming language I've used before: C, Python, Rust, MATLAB are all imperative^1. To do things, you give the computer a list of tasks to execute. Here's an example:
What does that mean? What isn't a functional programming language? Well, just about every programming language I've used before: C, Python, Rust, MATLAB are all imperative[^2][^1]. To do things, you give the computer a list of tasks to execute. Here's an example:
If I want to compute a factorial, I'd probably say take this value, and multiply it a whole bunch of times until you get to an end condition. The computer may change state at this point, where your input variable gets overwritten with the result, or some thing inside the task list, such as an iterator, changes to a value that can create a different result if run again.
@ -16,7 +16,8 @@ There's a special property about functions that can be called multiple times wit
Haskell is a statically typed language, and supports type inference. It has been developed since 1987, with the first stable version of the language coming out ofthe Haskell Report in 2003.
# What I need to dive in:
A Haskell compiler
A Haskell compiler! The recommended one is GHC.
GHC can compile code but it can also run from the prompt interactively, by running 'ghci'. You can list functions from the current folder using ':l filename'. The file can be reloaded using ':r'
^1 not really Rust, because I believe Rust has functional programming support.
[^1]: not really Rust, because I believe Rust has functional programming support.