....Because trying something new is fun!
What is Haskell?
- Functional - Given the arguments, always returns the same output ie no global or local state.
- Statically typed
Learn you a Haskell
Learn You a Haskell for Great Good the goal of the reading group is to get through this book.
Week 1 is about
- Getting Started
- Lists (and list comprehension)
Running from Powershell GIT in windows
Loading hello.hs and calling functions
- Ctrl D - exit from GHCI in Powershell
- Ctrl L - cls
Project Euler is where I start when learning a new language to flex my new ‘toolbelt’..
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
running the function h to get the answer. Reloading changes :r in file euler.hs
The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?
_ and Tuples
Summary of Book so far
Have been able to solve most of the first 9 Euler problems with just list comprehensions.
There are a ton of interesting functions in the language!
Highlights from this meeting were
- no let needed in REPL now
- brackets around (+) mean passing + as an argument (actually an infix function to add 2 numbers)
- ’ is for single characters, “ is for strings (list of chars!)
Noel Markham’s exercises link
Evolution of a Haskell coder