diff --git a/3-99 Research/Haskell/Chapter 1 - Introduction.md b/3-99 Research/Haskell/Chapter 1 - Introduction.md index e69de29bb..17f3a7c48 100644 --- a/3-99 Research/Haskell/Chapter 1 - Introduction.md +++ b/3-99 Research/Haskell/Chapter 1 - Introduction.md @@ -0,0 +1,14 @@ +# 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: + +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. + +- [?] What is a 'state' for a computer really? #Follow-Up #Haskell + +Functional programming languages do not do this. Instead of using iteratives like that or having the possiblity of functions changing variable states, everything is instead immutable. If I define a function for a factorial, I define *what a factorial is*, rather than explicit steps to compute one. Then, when I apply the 'function' to an input, the output is something new: the function applied to that variable that is fundamentally not an execution of the function or a malation of the original input. This is *maybe* what a monad is. + +- [?] What is a 'monad' really? #Follow-Up #Haskell + +^1 not really Rust, because I believe Rust has functional programming support.